Skip to content

feature-plan: PR #582's plan_check.py silently drops a step whose number duplicates an earlier step — same-wave file collisions pass as 'ok' #585

Closed

Description

@dezren39

Finding

PR #582 adds .agents/skills/feature-plan/scripts/plan_check.py, the mechanical gate the rewritten feature-plan skill runs before the fresh-context validator (SKILL.md step 11; references/validation.md §1: "Fix everything it prints before launching the validator"). Its parse() stores steps in a dict keyed by step number with no duplicate guard:

# .agents/skills/feature-plan/scripts/plan_check.py:37 (PR #582 head d6d5c7a17e39d606ad7f1f73c7ac63afdbe8ca68)
steps[step] = {"wave": wave, "parallel": bool(found[2]), "text": ""}

A second step with the same number silently overwrites the first, so the overwritten step is never checked at all — and two same-numbered steps in one wave defeat the same-wave file-collision check, because both steps collapse into one dict entry.

Evidence

Reproduced against PR #582's head (d6d5c7a1) with a plan containing two complete steps, both numbered 1, both in Wave 1, both writing scripts/shared.py:

$ python3 -I .agents/skills/feature-plan/scripts/plan_check.py plan.md
ok: 1 steps in 1 waves        (exit 0)

Expected: a duplicate-step-number diagnostic (exit 1), and/or wave 1: scripts/shared.py written by steps 1, 1. Instead the checker reports one step and ok. A cross-wave variant (step 1 in Wave 1 and again in Wave 2) likewise produces no duplicate diagnostic — the Wave 1 step simply disappears from every check (fields, requires, files).

Step numbers are load-bearing in this format, which is why the silent overwrite matters:

Why it matters

plan_check.py is the only mechanical check in the S7 flow; everything after it (validator, zero-context readers, issue creation) trusts its ok. A plan author who renumbers or copy-pastes a step — the exact accident a mechanical checker exists to catch — gets a green ok while one step escapes every field, wave and file-collision check, and two colliding writers can be scheduled into the same wave.

Acceptance criteria

  • plan_check.py exits 1 and prints a clear diagnostic (e.g. step 1: duplicate step number) when a plan reuses a step number, in the same wave or across waves.
  • The same-wave/same-file repro above no longer prints ok.
  • A regression test or fixture covers duplicate step numbers (same-wave and cross-wave).
  • Existing behaviour is unchanged for well-formed plans (the PR body's sample outputs still reproduce).

Found by the pr-diff-review sweep reviewing PR #582 (open, head d6d5c7a17e39d606ad7f1f73c7ac63afdbe8ca68). plan_check.py does not exist on main yet — this is a defect in the PR's new code, filed so it is not lost if the PR merges as-is.

Activity

  1. dezren39 commented on Oct 26, 2026

    @dezren39
    MemberAuthor

    Intake review

    Still live (verified this run, fleet monitor): on current code main, .agents/skills/feature-plan/scripts/plan_check.py still stores steps in a plain dict (steps = {}, populated per step with no duplicate guard visible in the parser), so a duplicated step number still silently overwrites the earlier step exactly as the issue's reproduction shows.

    Related: filed by pr-diff-review from PR #582 (the feature-plan skill rewrite that added plan_check.py). No other open issue covers the plan checker.

    Notes / risks: step numbers are load-bearing downstream (implement-issue markers and blockedBy links are built from them), so a duplicate is not a cosmetic problem — the overwritten step escapes the field, wave and same-wave file-collision checks while the checker reports ok. The fix must diagnose the duplicate itself (exit 1), not merely dedupe, or the collision check stays void.

    Suggested approach: track seen step numbers in parse() and emit a duplicate-step-number diagnostic (exit 1) naming both waves; add a regression case with two same-numbered steps writing the same file in one wave, expecting the collision diagnostic as well.

    Labels normalized by the fleet monitor: kind/bug, source/pr-diff-review, status/needs-triage, priority/normal, effort/s.

  2. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    effort/sSmall: expected under 2 hours of work
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Oct 26, 2026
  3. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Picked up: OpenChamber scheduled lane claimed triage task 2173; checking current implementation and ownership.

  4. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Triage verdict (task 2173): confirmed; route to a scoped fix. At main cf1b243f8b72a102573492340623efc2dbf692b3, .agents/skills/feature-plan/scripts/plan_check.py:28-39 keys steps by number and overwrites duplicates; lines 40-84 validate only surviving entries and lines 96-105 can report success. Add a duplicate-number diagnostic with nonzero exit and regression cases for duplicates in the same and different waves, including a same-file collision example. No runtime reproduction was run; this verdict is based on current code inspection. No related implementation PR found.

  5. 1 remaining item

  6. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Triage done: task 2173 completed; scoped implementation follow-up task 4840 is queued. Issue remains open; evidence and tests are in the preceding verdict.

  7. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Picked up: OpenChamber scheduled lane claimed implementation task 4840; validating issue #585 and working the scoped duplicate-step-number fix.

  8. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 1, 2026
  9. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Handed off: Implementation is available for review in PR #3780; duplicate step numbers now fail validation while collision diagnostics remain intact.

  10. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Done: Task 4840 merged via PR #3780 (merge 9770e5579b87129017c6da0de83da340527b408f); issue #585 is closed. Focused and workflow tests passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/pr-diff-reviewFiled by the pr-diff-review jobstatus:done

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions