grace-fix
Debug an issue using GRACE semantic navigation.
Process
Step 1: Locate via Knowledge Graph
From the error/description, identify which module is likely involved:
- Read
docs/knowledge-graph.xmlfor module overview - Read
docs/verification-plan.xmlfor relevant scenarios, test files, or log markers if available - Read
docs/operational-packets.xmlfor the canonicalFailurePacketshape if available - Follow CrossLinks to find the relevant module(s)
- Read the MODULE_CONTRACT of the target module
If the optional grace CLI is available, you may use:
grace module find <query> --path <project-root>to resolve likely module IDs from stack traces, paths, verification refs, or dependency namesgrace module show M-XXX --path <project-root> --with verificationto pull the shared/public module and verification snapshotgrace file show <path> --path <project-root> --contracts --blockswhen you already know the governed file and need its local/private navigation surface
Step 2: Navigate to Block
If the error contains a log reference like [Module][function][BLOCK_NAME]:
- Search for
START_BLOCK_BLOCK_NAMEin the codebase — this is the exact location - Read the containing function's CONTRACT for context
If the failure came from a named verification scenario or test:
- read the matching
V-M-xxxentry indocs/verification-plan.xml - open the mapped test file and expected evidence for that scenario
If no log reference:
- Use MODULE_MAP to find the relevant function
- Read its CONTRACT
- Identify the likely BLOCK by purpose
Step 3: Analyze
Read the identified block, its CONTRACT, and relevant verification entry. Determine:
- What the block is supposed to do (from CONTRACT)
- What evidence should prove that behavior (from tests, traces, or log markers)
- What it actually does (from code)
- Where the mismatch is
Step 4: Fix
Apply the fix WITHIN the semantic block boundaries. Do NOT restructure blocks unless the fix requires it.
Step 5: Update Metadata
After fixing:
- Add a CHANGE_SUMMARY entry with what was fixed and why
- If the fix changed the function's behavior — update its CONTRACT
- If the fix changed module dependencies — update knowledge-graph.xml CrossLinks
- If the fix changed tests, commands, or required markers — update
docs/verification-plan.xml - Run the relevant module-local verification commands
- If the failure revealed weak tests, weak logs, or poor execution-trace visibility — use
$grace-verificationto strengthen automated checks before considering the issue fully closed
Important
- Never fix code without first reading its CONTRACT
- Never change a CONTRACT without user approval
- If the bug is in the architecture (wrong CONTRACT) — escalate to user, don't silently change it
More from osovv/grace-marketplace
grace-explainer
Complete GRACE methodology reference. Use when explaining GRACE to users, onboarding new projects, or when you need to understand the GRACE framework - its principles, semantic markup, knowledge graphs, contracts, testing, and unique tag conventions.
49grace-multiagent-execute
Execute a GRACE development plan in controller-managed parallel waves with selectable safety profiles, verification-plan excerpts, batched shared-artifact sync, and scoped reviews.
30grace-execute
Execute the full GRACE development plan step by step with controller-managed context packets, verification-plan excerpts, scoped reviews, level-based verification, and commits after validated sequential steps.
28grace-status
Show the current health status of a GRACE project. Use to get an overview of project artifacts, codebase metrics, knowledge graph health, verification coverage, and suggested next actions.
27grace-refresh
Synchronize GRACE shared artifacts with the actual codebase. Use targeted refresh after controlled waves, or full refresh after refactors and when you suspect wider drift between the graph, verification plan, and code.
27grace-plan
Run the GRACE architectural planning phase. Use when you have requirements and technology decisions defined and need to design the module architecture, create contracts, map data flows, and establish verification references. Produces development-plan.xml, verification-plan.xml, and knowledge-graph.xml.
27