Given a single out-of-scope or P3 finding id from docs/findings.json, file a GitHub issue for future resolution, dedup against existing open issues, append to docs/issues-filed.json, and label with deferred-from-loop. Refuses P1 findings. Operates on exactly one finding per invocation.
Optional post-green cleanup of a slice's implementation. Fires when the slice's test suite is green after slice-impl completes. Reads the slice definition and test files; modifies only implementation files. Tests must be green before starting and must remain green throughout. Aborts and reverts if any refactor step breaks a test. Skipped when the green implementation already reads cleanly.
Write exactly ONE failing test targeting a slice's first acceptance criterion. Fires when a slice is ready and no passing test yet covers the first criterion. Never writes implementation. Refuses to run if a passing test already covers the criterion.
Write the minimum implementation to pass the failing tracer test for a slice. Fires when a failing tracer test exists for the slice. Reads the slice (including out_of_scope) and the failing test before writing anything. Refuses to add features listed in out_of_scope. Refuses to modify the test.
Given a single finding id from docs/findings.json, apply a triage-approved fix to the relevant slice, re-run the slice's tests, and record the resolution result. Refuses to act on findings where in_scope is false. Aborts and reports if tests fail after the fix. Operates on exactly one finding per invocation.
On workflow exit, read the workflow trace and substrate indexes lazily, identify real signal (recurring deferral, novel ADR, new anti-pattern, reusable solution, new vocabulary term), and write 0–4 substrate entries via substrate-write. Refuses to write when nothing meaningful surfaced. On a failed-gate workflow, writes the rejection reason as an anti-pattern or ADR. Invoke when a workflow is about to exit.
Run weekly substrate maintenance: promote recurring anti-patterns to reviewer entries, merge overlapping ADRs with supersession, mark stale solutions and superseded ADRs, and retag scope globs for moved files. All writes go through substrate-write (append-only). Invoke on cadence (weekly) or when substrate signal degrades.
Derive the slice execution DAG from an approved plan. Fires when docs/plans/<workflow_id>.md exists and has been approved. Two phases: (a) mechanical file-overlap edges — derived from touched_paths intersections, no LLM reasoning; (b) agent-added semantic edges with reason fields. Extends the plan doc in place; stores the updated slice YAML in a fenced block.