Skill Tracer
Skills › Compound Engineering › lfg › debug-return.md

debug-return.md

25 lines · skills/lfg/references/debug-return.md at 3449230

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# Reading ce-debug's structured return (LFG defect route)
2
3On the defect route, `ce-debug mode:return-to-caller` is the work source and the implementation at once: it reproduces, root-causes, fixes with test-first discipline, verifies, and commits on a feature branch without pushing. This file defines how to read its return, which returns advance, what each later step substitutes for the plan path it would otherwise receive, and the one case that stops.
4

Reading ce-debug's structured return (LFG defect route)

On the defect route, ce-debug mode:return-to-caller is the work source and the implementation at once: it reproduces, root-causes, fixes with test-first discipline, verifies, and commits on a feature branch without pushing. This file defines how to read its return, which returns advance, what each later step substitutes for the plan path it would otherwise receive, and the one case that stops.

Raw lines 1 to 4
5## What advances
6
7Only `status: fixed` advances to step 3. `diagnosed-no-fix`, `needs-human`, and `blocked` stop the run with the return's `root_cause`, `residuals`, and blockers reported verbatim; nothing has been pushed. A malformed return, or a `fixed` return whose fix-owned files show no change on the branch, stops the run as blocked.
8

What advances

Only status: fixed advances to step 3. diagnosed-no-fix, needs-human, and blocked stop the run with the return's root_cause, residuals, and blockers reported verbatim; nothing has been pushed. A malformed return, or a fixed return whose fix-owned files show no change on the branch, stops the run as blocked.

Raw lines 5 to 8
9## What `status: fixed` must carry
11Require `status`, `root_cause`, `changed_files`, `head_sha`, `branch`, `pre_fix_scope`, `verification_evidence`, `residuals`, `issue_of_record`, `behavior_change`, and `standalone_shipping_skipped: true`. Empty arrays are valid for `residuals`; `issue_of_record` is `null` when the input carried no ticket.
13`verification_evidence` follows the same shape `ce-work` returns: when `behavior_change: true` it must name the regression test used, existing tests inspected, tests added/changed or used unchanged, the red failure or characterization observed before the fix, the verification run, and any deliberate test exception. Do NOT decide the test strategy inside LFG; the evidence is `ce-debug`'s contract. A `fixed` return with `behavior_change: true` and evidence missing or too vague to tell how the fix was proven stops the run as blocked, reporting the missing fields. There is no recovery invocation on this route: `ce-debug` has no reconciliation path, and a second run would reinvestigate.

What status: fixed must carry

Require status, root_cause, changed_files, head_sha, branch, pre_fix_scope, verification_evidence, residuals, issue_of_record, behavior_change, and standalone_shipping_skipped: true. Empty arrays are valid for residuals; issue_of_record is null when the input carried no ticket.

verification_evidence follows the same shape ce-work returns: when behavior_change: true it must name the regression test used, existing tests inspected, tests added/changed or used unchanged, the red failure or characterization observed before the fix, the verification run, and any deliberate test exception. Do NOT decide the test strategy inside LFG; the evidence is ce-debug's contract. A fixed return with behavior_change: true and evidence missing or too vague to tell how the fix was proven stops the run as blocked, reporting the missing fields. There is no recovery invocation on this route: ce-debug has no reconciliation path, and a second run would reinvestigate.

Raw lines 9 to 14
Names a skill ce-work :13
Names a skill ce-debug :13
15## Ship only what the user offered
17The user asked for this fix. They did not offer whatever else the branch and the tree already carried: uncommitted files the fix does not touch, or commits beyond the base that are not already under review in an open pull request for this branch. `pre_fix_scope` in the return tells you what was there before the fix; it is the only record, because the fix commit is on top of it now. Before any step in this run pushes, a review-fix commit included, decide whether everything that push would publish is offered: the fix, what this run itself added (including `pre_fix_scope.caller_edits`, edits this run made for the work the user asked for before invoking `ce-debug`), and prior work an open PR already holds. When it is, ship as usual and keep the dirty files out of every commit. When it is not, or you cannot tell, hold: commit the fix locally, let no step publish, record leftover findings where a reader will find them without a PR, and say what was held back and that `ce-debug` invoked directly fixes inline on a branch the user is still working on.

Ship only what the user offered

The user asked for this fix. They did not offer whatever else the branch and the tree already carried: uncommitted files the fix does not touch, or commits beyond the base that are not already under review in an open pull request for this branch. pre_fix_scope in the return tells you what was there before the fix; it is the only record, because the fix commit is on top of it now. Before any step in this run pushes, a review-fix commit included, decide whether everything that push would publish is offered: the fix, what this run itself added (including pre_fix_scope.caller_edits, edits this run made for the work the user asked for before invoking ce-debug), and prior work an open PR already holds. When it is, ship as usual and keep the dirty files out of every commit. When it is not, or you cannot tell, hold: commit the fix locally, let no step publish, record leftover findings where a reader will find them without a PR, and say what was held back and that ce-debug invoked directly fixes inline on a branch the user is still working on.

Raw lines 15 to 18
Names a skill ce-debug :17
19## What later steps receive instead of a plan path
21- **Step 3, `ce-simplify-code`:** pass `changed_files` as the scope, never the branch diff, so the pass cannot reach work the user did not offer; pass `root_cause` as the structure the simplification must keep, so the fix is not simplified away; pass `mode:pipeline` and each test `verification_evidence` names as proving the fix as its own `proof-test:<path>`.
22- **Step 4, `ce-code-review`:** no `plan:` argument. Its requirements check is additive by its own contract and it infers intent from the commits; pass the `root_cause` summary as review context. The review has no fix-only scope and reads the working tree, so it may report on files the user did not offer; step 5 applies a finding only to `changed_files` and this run's own edits, and reports the rest as residuals.
23- **Step 6 and step 9:** the settled-decisions brief was never composed on this route, so no settled-decisions provenance line is rendered. Pass `root_cause` and `issue_of_record` to `ce-commit-push-pr` as PR-description context, so the PR body carries the diagnosis and links or closes the ticket, and name the files that must stay out of the commit.
24- **Step 7, `ce-compound`:** the same counterfactual applies; a debugged root cause is the most common shape of a durable learning.
25- **Step 11, close-out:** the next-work offer reads a plan and is not made.

What later steps receive instead of a plan path

  • **Step 3, ce-simplify-code:** pass changed_files as the scope, never the branch diff, so the pass cannot reach work the user did not offer; pass root_cause as the structure the simplification must keep, so the fix is not simplified away; pass mode:pipeline and each test verification_evidence names as proving the fix as its own proof-test:<path>.
  • **Step 4, ce-code-review:** no plan: argument. Its requirements check is additive by its own contract and it infers intent from the commits; pass the root_cause summary as review context. The review has no fix-only scope and reads the working tree, so it may report on files the user did not offer; step 5 applies a finding only to changed_files and this run's own edits, and reports the rest as residuals.
  • Step 6 and step 9: the settled-decisions brief was never composed on this route, so no settled-decisions provenance line is rendered. Pass root_cause and issue_of_record to ce-commit-push-pr as PR-description context, so the PR body carries the diagnosis and links or closes the ticket, and name the files that must stay out of the commit.
  • **Step 7, ce-compound:** the same counterfactual applies; a debugged root cause is the most common shape of a durable learning.
  • Step 11, close-out: the next-work offer reads a plan and is not made.
Raw lines 19 to 25
Names a skill ce-simplify-code :21
Names a skill ce-code-review :22
Names a skill ce-commit-push-pr :23
Names a skill ce-compound :24