fix(todo-check,implement): close undefined merge/resolution branches - #137
Conversation
Render the merge and unknown-resolution steps as guarded case-table blocks, which forces each previously undefined cell to be decided. Three branch-structure defects close: - the contextual lane carried an outcome vocabulary but no resolution procedure; it now settles its recorded scope check in main context - an unknown that cannot be settled at preflight time had no exit; it now surfaces to the user, naming what the row already carries - a resolved dual-lane half had no defined cell encoding; its setup action or N/A reason now joins the active half's in the same cell, and the row's status is recomputed from both half-statuses The coverage check's recovery now covers any deviation from its own criterion, not only a missing or duplicated slug, and a halted preflight emits no table at all. The preflight step in implement states the consequence for its caller: there are then no active rows to hand on, and the unit does not start. The discrepancy-adjudication provenance and the narrowed re-dispatch's return path and retry budget do not land here. They are one shared mechanism spanning both steps, tracked in #136. Refs #133
📝 WalkthroughWalkthroughThe PR formalizes ChangesTodo-check preflight flow
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Implementer
participant todo-check
participant quaere-execution
participant Unit
Implementer->>todo-check: run preflight
todo-check->>todo-check: merge and resolve outcomes
alt preflight completes
todo-check-->>quaere-execution: provide resolved △ rows
quaere-execution->>Unit: start planning and execution
else preflight halts
todo-check-->>Implementer: report halt without table
Implementer-->>Unit: do not start
end
Possibly related issues
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR clarifies and completes todo-check’s merge and unknown-resolution procedures by rewriting them into guarded case-table blocks that explicitly cover previously undefined branches, including new “halt without emitting a table” outcomes, and updates implement to define caller behavior when that halt occurs.
Changes:
- Rewrites
todo-checkStep 4 (merge) and Step 5 (resolve?) into guarded, explicitly-armed blocks, including halt paths that emit no table. - Updates
implement’s preflight step to treat a haltedtodo-checkrun as blocking the start of the unit (no △ rows to hand off). - Bumps marketplace version to
2026.7.27.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| skills/todo-check/SKILL.md | Replaces dense prose in merge/resolve steps with guarded blocks, adds explicit halt/no-table behavior, and updates output-format text accordingly. |
| skills/implement/SKILL.md | Defines what a halted todo-check preflight implies for the caller (unit does not start). |
| .claude-plugin/marketplace.json | Version bump to reflect the behavior change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@skills/todo-check/SKILL.md`:
- Around line 139-141: Update the discrepancy adjudication instructions in
SKILL.md so that when resolving each subagent discrepancy, you also recompute
the affected lane/half status based on the resolved applicability before
finalizing the row. Reapply the dual-lane rendering rule afterward, ensuring
stale △, ⊘, or ? verdicts are replaced and the final table neither skips
required setup nor invents work.
- Around line 117-130: Extend the coverage contract in
skills/todo-check/SKILL.md lines 117-130 to validate every return path,
including contextual results and merged rows, with the existing first-failure
redispatch and subsequent-failure halt behavior. At skills/todo-check/SKILL.md
line 187, require narrowed single-item responses to contain exactly one row for
the requested slug, rejecting missing, duplicate, or extra rows before
proceeding.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: aec6785f-5b7f-42d2-aa53-fb3dcf8ba04e
📒 Files selected for processing (3)
.claude-plugin/marketplace.jsonskills/implement/SKILL.mdskills/todo-check/SKILL.md
| coverage — the subagent's returned mechanical rows against the | ||
| mechanical-lane slug set the index predicts. This applies to a | ||
| full-set dispatch; a narrowed single-item return (Step 5) is exempt: | ||
| exactly one row per predicted slug, | ||
| and no others → proceed | ||
| any other return (a slug missing, | ||
| duplicated, or outside the predicted | ||
| set), first occurrence → re-dispatch Step 2 with the | ||
| prompt unchanged; re-check | ||
| any other return, after that | ||
| re-dispatch → surface to the user; do not | ||
| proceed with the mechanical | ||
| lane incomplete, and do not | ||
| emit the table |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Enforce coverage on every return path.
The coverage contract currently validates only full mechanical dispatches. Contextual results and narrowed single-item redispatches can still be malformed while the workflow proceeds, violating the final one-row-per-item invariant.
skills/todo-check/SKILL.md#L117-L130: validate contextual results or the merged row set, using the same retry/halt behavior.skills/todo-check/SKILL.md#L187-L187: require exactly one row for the requested slug and reject missing, duplicate, or extra rows.
🧰 Tools
🪛 SkillSpector (2.3.11)
[info] 44: [EA3] Scope Creep: Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.
Remediation: Limit the skill's scope to its documented purpose. Remove instructions that enable the agent to perform actions outside its stated functionality.
(Excessive Agency (EA3))
[warning] 125: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 128: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 129: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 130: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 155: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 156: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 157: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 160: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 164: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 166: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 167: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 168: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 169: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 170: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 171: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 172: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 173: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 176: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
[warning] 177: [MP2] Context Window Stuffing: Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
Remediation: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
(Memory Poisoning (MP2))
📍 Affects 1 file
skills/todo-check/SKILL.md#L117-L130(this comment)skills/todo-check/SKILL.md#L187-L187
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@skills/todo-check/SKILL.md` around lines 117 - 130, Extend the coverage
contract in skills/todo-check/SKILL.md lines 117-130 to validate every return
path, including contextual results and merged rows, with the existing
first-failure redispatch and subsequent-failure halt behavior. At
skills/todo-check/SKILL.md line 187, require narrowed single-item responses to
contain exactly one row for the requested slug, rejecting missing, duplicate, or
extra rows before proceeding.
There was a problem hiding this comment.
Triaged as two separate findings with different owners; neither is fixed here.
The narrowed single-item return. Agreed. The text exempts that return from the whole-set check and then says nothing about whether it carries the requested slug at all. That is #133's defect 5 — "the narrowed re-dispatch has no return path" — which this pull request deliberately carries to #136, whose scope is to give that re-dispatch a defined return path and a shared retry budget. Your sharper framing (reject missing, duplicate, or extra rows for the requested slug) is recorded there.
The contextual lane and the merged set. Filed as #139, as a question rather than a mirrored arm. The mechanical check works on two independent readings of the index: the subagent derives its own item set in a fresh context, so the return can be compared against the index. The contextual rows are produced by main context from that same index, so a check there is main context comparing its output against a reading it already made — the misreading that dropped an item can pass the check meant to catch it. #139 records that defeater, the candidate remedies including a cross-agent check that escapes it, and a probe that settles whether the block's existing one-row-per-index-item obligation already forces the failure to surface.
Both are outside #133's scope, which limits this change to the merge and unknown-resolution steps.
Separately, on the attached SkillSpector output: the [MP2] Context Window Stuffing findings span the lines of the two new fenced blocks and appear to be reading the case tables' column alignment as padding. Flagging it because every remaining phase of #132 converts prose into this same shape, so the pattern will recur.
There was a problem hiding this comment.
@ultimatile, thanks for the detailed triage. The split is sensible:
- The narrowed re-dispatch contract is a valid gap, now explicitly deferred to
#136along with its return-path and shared retry-budget design. #139appropriately treats contextual/merged coverage as an open design question rather than duplicating the mechanical-lane retry arm where it cannot provide independent validation.
I’ll leave this finding unresolved for this PR, since neither follow-up is implemented here.
Noted on SkillSpector’s [MP2] output as well: the aligned case-table formatting appears to be triggering a heuristic rather than identifying actionable context-stuffing behavior. 🐇
The merge step's domain line named the rule set by bare skill name while the contextual step and the output-format paragraph both spell `quality-list/SKILL.md`, which is where the index that is the single source of truth for the item set actually lives. Align the domain line with them, and with the same two surfaces in `done-check`.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
skills/todo-check/SKILL.md:115
- In Step 4's guarded block domain line, the phrase "in the
quality-list/SKILL.mdItems index" reads like the Items index is a separate artifact named by that phrase, whereas elsewhere this skill uses the possessive form ("quality-list/SKILL.md's Items index"). Aligning the wording here removes ambiguity about where the index lives.
domain: every item in the `quality-list/SKILL.md` Items index
Summary
todo-check's merge step and unknown-resolution step were each a single dense paragraph of prose. Between them they held four branch-structure defects that reading the prose does not surface: a lane carrying an outcome vocabulary but no procedure, a dead end with no exit, an undefined cell encoding, and a recovery attached to a narrower trigger than its own criterion. Rendering the branching parts of both steps as guarded case-table blocks forces each undefined cell to be decided, so the closed defects — not the notation — are what this change delivers. Two passages are deliberately left as prose; the delta at the bottom says which, and reconciles this count of four against the five defects #133 lists.Closes #133
Changes
skills/todo-check/SKILL.md— the merge step becomes a guarded block with two labelled sub-blocks: coverage of the returned mechanical rows against the slug set thequality-list/SKILL.mdItems index predicts, and row rendering over single-lane items plus the three combinations a dual-lane item's two half-statuses can take (either half active, both halves N/A, anything else). Its discrepancy-adjudication paragraph stays prose. The unknown-resolution step becomes a two-pass block — settle the scope fact by the lane of the check being settled, then record the outcome — with the narrowed re-dispatch kept as headed prose below it rather than compressed into an arm, since it carries two verbatim replacement strings, a nested special case, and a preservation constraint that an arm line would drop. The output-format paragraph gains the halt path.skills/implement/SKILL.md— the preflight step states what a halted preflight means for its caller..claude-plugin/marketplace.json— version bump.Throughout, the scope description is the plain account of the planned change that the preflight's first step writes, and which the dispatch step embeds in the subagent's prompt.
Three previously undefined states are now decided:
△ activewith a concrete setup action or a downgrade to⊘ N/Awith a reason — but the procedure that followed it sat under a mechanical-lane guard, so one of the two lanes had none. It now settles the scope check the contextual pass recorded, in main context.? unknownfrom the emitted table. It now surfaces to the user, naming what the row already carries, and emits no table.△ activestays△ active.Two further changes are clarifications rather than new outcomes:
Impact
todo-checkcan now terminate without emitting a table, which widens its outcome set from one shape to two. The only surface that consumes its active rows isskills/implement/SKILL.md's preflight step, updated in the same commit. The other references totodo-check— inREADME.md,skills/land-via-integration-branch/SKILL.md, andskills/quality-list/SKILL.md— name the skill's role or the lane split it shares withdone-checkand make no claim about its output, so none needs the new qualification.Test plan
Reading the text is not evidence that an agent can execute it, so each new or widened arm got a fixture.
Method. Twelve runs, one per fixture. Each run is a fresh-context agent given exactly two things: the two rewritten steps verbatim, plus one fixture. The fixture supplies a synthetic six-item index with lane tags (three
mechanical, twocontextual, one dual-lane), a stated subagent return, the rows the contextual pass produced, and whatever further facts the situation needs — so no run can reach the realquality-listand every arm is selected from the text alone. Each run reports the arm it took by name and either the table it emits or its reason for emitting none; that report was compared against the arm the text specifies. The fixtures are scaffolding for prose rather than a test surface this repository carries, so they are not committed — this section is their record.All twelve selected the expected arm. Five reached an emitted table:
△ activewhose carried half then resolves active — both setup actions land in the one cell⊘ N/A— the active half's setup action and the resolved half's reason both stand, and the row stays△ activeSeven withheld the table:
△ activeand the active half's setup action standProcess only <slug>, the following read-the-body sentence kept, the single-item return exempt from the coverage check, and no item body read in main contextFour of the twelve selected an arm that dispatches a subagent: the two coverage re-dispatches and the two narrowed re-dispatches. For those the probe verifies the arm taken, and the prompt composed where the arm specifies one; the probe context has no subagent to answer, so each then stopped rather than continuing to the arm's designed outcome. The other eight never dispatch. Where a fixture needed a return that a dispatch would have produced — the repaired second return, the second short return — the fixture states it as given history, so the run reads it rather than obtaining it.
Every span the new text quotes from elsewhere in the file was verified present verbatim, and the
mdformathook configured in.pre-commit-config.yamlpasses and leaves the blocks byte-identical.Notes
The discrepancy adjudication in the merge step and the narrowed re-dispatch below the resolution step keep their original prose, so two gaps remain open in this file. A discrepant row's grounding is still undeclared, because the dispatch prompt does not say which account its return follows when the scope description and the codebase conflict; and the narrowed re-dispatch still defines no consumption of its return and no retry budget. Both are one mechanism rather than two: the re-dispatch is reachable from the adjudication as well as from the resolution step, so the budget has to be shared and the adjudication's corrective dispatch has to carry the established fact and its precedence. Closing them is #136.
Recovery semantics for a halted preflight are undefined here — the halt surfaces to the user and emits no table, and nothing states what a resumed preflight may reuse. That is #134.
skills/done-check/SKILL.mdis not edited, so its merge step, which mirrors the one changed here, now diverges: it has no coverage check on its auditor's returned rows and no halt path. The divergence is deliberate. #133 records what a mirror edit would have to settle indone-check— a set of cells its own text does not determine, plus five provisionstodo-checkstates that it lacks — and defers all of it, on the grounds that landing a notation change and that behavior change in one squash-merged commit would make neither reviewable.Plan-vs-actual delta
Measured against #133's Scope, Out of scope, and Acceptance.
First, the counts, which do not line up on their face. #133 lists five defects plus one item it calls a clarification rather than a defect. The summary above counts four, and those four are #133's defects 1 through 3 plus that clarification — the set this change closes. Defects 4 and 5 are the subtractions below.
Scope subtractions
Why they were carried rather than landed is in Notes above and in #136, which states the constraint on form that this attempt produced. In short: the two are one mechanism reachable from both steps, so they need a passage shared between them, and the scope was narrowed to the three block-local defects rather than land that passage in this change.
Scope additions
skills/implement/SKILL.mdis edited, which Phase 1: todo-check merge and unknown-resolution steps #133's Scope does not name — it scopes the change totodo-check's two steps plus one sentence in the dispatch prompt. The halt path widenstodo-check's outcome set, and that step is the only surface consuming the active rows, so leaving it unqualified would strand an unconditional claim about what a preflight hands on. That ispaired-artifact-drift's qualification-completeness sweep doing its job, not scope creep.quality-list/SKILL.mdwhere Phase 1: todo-check merge and unknown-resolution steps #133's Scope text names the skill bare. That is the skill-relative form Step 3 and the output-format paragraph already use for the same file, whose repo path isskills/quality-list/SKILL.md. The change followed review on this pull request.Reworded, same provision
What the two prose passages actually retain
Both were left as prose, but not identically:
This distinction matters for the acceptance item below, so it is stated rather than folded into "the prose stands".
Acceptance
Performed against the landed text: the execution probes enumerated in the test plan above; reference resolution, with every step reference in the file resolving and no cross-skill reference pointing into either step; the verbatim quotation of the dispatch prompt's selection sentence; the formatter; and provision preservation, with "purely" surviving in both the dispatch step's prohibition and the resolution block's standing rule.
Not performed:
Out-of-scope churn
The four items in #133's Inconclusive / Deferred section are unchanged, and all four resolve when
done-check's own change lands. #134 is unchanged. One new deferral was opened: #136.Summary by CodeRabbit
Documentation
Chores
2026.7.27.@coderabbitai ignore