Skip to content

fix: parseDependencies matches prose mentions and silently reorders runs #767

Closed

Description

@admarble

Context

parseDependencies (src/lib/workflow/batch-executor.ts:199) matches its marker anywhere in an issue body, with no fence/comment stripping and an optional #:

/\*?\*?depends\s+on\*?\*?:?\s*#?(\d+)/gi

sortByDependencies feeds on it and silently reorders the run. Unlike the #762 pre-flight — which only warns and was anchored in PR #764 — a false match here changes execution order with no output the user can inspect.

The same false-positive class was found and fixed in chain-preflight.ts during #762 QA. That fix was deliberately scoped local (Open Q #3: leave sorter semantics untouched), so this parser is still exposed.

Evidence

Running the real regex over 36 real issues containing "depends on": 5 of 7 matches are false positives (71%).

Issue What matched Real?
#19 / #21 Use case: Issue 14 depends on 12+13 being merged first. ❌ prose; parses bare 12 (no #)
#31 **Depends on**: #10 inside a ```markdown fence ❌ format example
#111 - #11: Add login page (depends on #10) ❌ describes other issues
#325 ⚠ Depends on #175 (currently in implementation phase ❌ quoted tool output
#188 - Depends on #187 (...) ✅ genuine
#223 - Depends on: #219 being merged first ✅ genuine

Reproduced against the real sorter:

parseDependencies(19) = [ 12 ]   <- from prose "Issue 14 depends on 12+13"
parseDependencies(31) = [ 10 ]   <- from inside a ```markdown fence

sortByDependencies([19, 12]) -> [ 12, 19 ]   // silently reordered
sortByDependencies([31, 10]) -> [ 10, 31 ]   // silently reordered

Blast radius is bounded by deps.filter((d) => issueNumbers.includes(d)) — harm needs the falsely-named issue in the same run. That makes this low-frequency but silent and order-changing, which is why it is worth closing rather than leaving.

Proposal

Apply the PR #764 treatment to parseDependencies:

  1. Anchor the marker to line start (allow -/* list items and **bold**).
  2. Require the # — depends on 12+13 must not parse as issue Clean up matcha maps remnants (Supabase, dead code) #12.
  3. Strip fenced blocks, HTML comments, and inline code spans before matching.

Label parsing (depends-on/123) is an explicit machine-readable signal — leave it as-is.

Prefer extracting the now-hardened chain-preflight.ts:parseDeclaredBlockers into one shared parser over copying the regex, so the two cannot drift.

Acceptance Criteria

Open questions

  1. Should the sorter also honor blocked by #N? chain-preflight does; the sorter does not. Consolidating on one parser would make the sorter start reordering on blocked by, which is a real behavior change (new silent reorders) — arguably correct, but it should be a deliberate call, not a side effect of sharing code. Recommendation: share the parser, but let each caller pass which markers it honors.
  2. Should a reorder be announced? Silence is what makes this bite. A one-line "reordered N → M (declared dependency)" note would make a wrong inference visible without changing behavior. Possibly a better standalone fix than tightening the regex.

Out of scope

The Kahn's-algorithm implementation in sortByDependencies; the --strict-preflight / warning UX (shipped in #762).

References

Activity

  1. added
    bug
    cli
    on Jul 15, 2026
  2. admarble commented on Jul 15, 2026

    @admarble
    ContributorAuthor

    Assessment

    → PROCEED — Marker anchoring; ACs are complete and don't depend on the open questions resolving either way (AC-4 permits shared parser or documented divergence).

    Workflow: spec → exec → qa with quality loop

    Spec added despite the bug label: the two open questions (share the parser vs. per-caller markers; announce reorders) are genuine design calls that should be decided deliberately, not as a side effect of implementation.

    npx sequant run 767 -Q
    

    Order: after #766 — both modify src/lib/workflow/batch-executor.ts. Also land PR #770 first; it modifies chain-preflight.ts.

  3. admarble commented on Jul 16, 2026

    @admarble
    ContributorAuthor

    Pre-run update — blockers cleared, plus a hidden rider in AC-4

    Both prerequisites from the assessment are now on main, so this is unblocked:

    Prereq Status
    #766 (shared batch-executor.ts) ✅ merged — 0afc89a (PR #772)
    PR #770 (chain-preflight.ts) ✅ merged — 753fe4a

    Re-verified against main: parseDependencies is still at batch-executor.ts:199 and its regex is unchanged, so the issue body's references are all still accurate.

    Run it with sequant run 767 -Q, not npx sequant run 767 -Q. npx resolves through its own cache and a dual node prefix here, and can silently execute a stale build — which matters more than usual today, since batch-executor.ts changed an hour ago.


    AC-4 carries a semantic rider that isn't visible in its text

    AC-4 asks for the marker parser to live in exactly one place, shared by batch-executor.ts and chain-preflight.ts. Reading the two parsers side by side on main, sharing parseDeclaredBlockers wholesale would expand what reorders the run:

    // chain-preflight.ts:80 — matches TWO markers
    /^\s*(?:[-*]\s*)?\*?\*?(?:depends\s+on|blocked\s+by)\*?\*?:?\s*#(\d+)/gim
    
    // batch-executor.ts:214 — matches ONE
    /\*?\*?depends\s+on\*?\*?:?\s*#?(\d+)/gi

    parseDependencies today does not match blocked by #N. parseDeclaredBlockers does. Since sortByDependencies feeds on parseDependencies, adopting the shared parser as-is would make blocked by #N start silently reordering execution — a new class of silent reorder, in the issue whose entire premise is that silent reordering is the harm.

    This is not hypothetical: chain-preflight.ts:65-66 records that the regex was deliberately kept local precisely so the sorter's ordering semantics stayed untouched (#762 Open Question #3, warn-only by design). AC-4 would undo that decision as a side effect of a DRY refactor — exactly the kind of thing the assessment said should be decided deliberately rather than fall out of implementation.

    Suggested framing for spec: share the hardened mechanics (line-anchoring, required #, stripCodeAndComments) but keep the marker set per-caller — pre-flight matches depends on|blocked by, the sorter matches depends on only. That satisfies AC-4's intent (one parser, no drift) while keeping the sorter's semantics where #762 deliberately left them. If the spec instead wants the sorter to honour blocked by, that's defensible — but it's a behaviour change that deserves its own AC and its own test, not a silent inheritance.

    Two mechanical notes for whoever implements it

    1. stripCodeAndComments is private (chain-preflight.ts:94, not exported). Sharing means exporting or relocating it — and it is the exact helper docs: note why the two body-strip helpers must not be unified #770 just documented as must not be unified with assess-collision-detect.ts's near-identical twin. The batch-executor ↔ chain-preflight pair is safe to share (both want inline-code spans stripped; a backticked marker is an example in both). assess-collision-detect must stay out of any extraction — its PATH_REGEX only matches backtick-wrapped paths, so stripping inline spans there returns []. See 753fe4a.
    2. AC-3 is structurally safe. The label path (depends-on[-/](\d+), batch-executor.ts:228) is separate from the body regex, and parseDeclaredBlockers is body-only — so a shared body parser can't disturb label parsing. Worth an explicit test anyway, since AC-3 names it.

    On AC-5

    AC-5's "verbatim bodies, not synthetic fixtures" should be read literally — fetch the real bodies of #19, #31, #111, #325 (negatives) and #188, #223 (positives). Synthetic multi-marker fixtures are exactly what hides false negatives in this parser class, which is why the AC is worded that way.

  4. admarble commented on Jul 16, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (6 ACs, 1 directory)

    AC Quality Check

    All six ACs are measurable and testable — each names a concrete input and expected parse result. Notable:

    • AC-1 bundles three negatives (prose / in-fence / inline-code) plus one positive. Fine as written, but exec should assert each independently so a partial fix can't check the box.
    • AC-4 is an OR ("ONE place, shared … or the divergence is documented"). The chain-preflight.ts comments already establish a precedent of documented deliberate divergence (see stripCodeAndComments vs assess-collision-detect.ts). The issue's stated preference is extraction; treat documented-divergence as the fallback only if extraction proves unclean.
    • AC-6 ("no genuine declaration in open issues stops parsing") is a regression guard, not a fixture test — verify by running the new parser over the live corpus.

    No vague/unmeasurable/open-ended patterns. No title/body tension.


    Scope Assessment

    Non-Goals: Present and explicit ("Out of scope": Kahn's-algorithm impl in sortByDependencies; the --strict-preflight/warning UX shipped in #762).

    Metric Value Status
    Feature count 1 (harden + share one parser) ✅
    AC items 6 ✅
    Directory spread 1 (src/lib/workflow/) ✅

    Verdict: ✅ SCOPE_OK — tightly bounded, single-module change with a clear precedent (PR #764).


    Acceptance Criteria

    AC-1: Prose / in-fence / inline-code mentions ignored; line-leading Depends on: #N still parses

    Verification: Unit Test
    Scenario: Given the verbatim bodies of #19, #31, #111, #325 → When parsed → Then no dependency is returned; Given #188 / #223 → Then [187] / [219].
    Assumptions: The hardened BLOCKER_MARKER_REGEX + stripCodeAndComments from chain-preflight.ts already satisfy all four negatives and both positives (confirmed by reading its docstring, which cites the same false-positive class). This AC is met "for free" once parseDependencies delegates to that parser.

    AC-2: depends on 12+13 no longer parses as #12 (the # is required)

    Verification: Unit Test
    Scenario: Given body Issue 14 depends on 12+13 being merged first → When parsed → Then [].
    Assumptions: Satisfied by the shared regex's mandatory #(\d+) (vs the current #?).

    AC-3: Label-based depends-on/123 parsing unchanged

    Verification: Unit Test
    Scenario: Given a depends-on/123 label → When parseDependencies runs → Then 123 is still returned.
    Assumptions: Label parsing stays inline in batch-executor.ts (/depends-on[-/](\d+)/i); only the body branch is swapped for the shared parser. This is the key boundary: the shared parser handles body text only, labels remain caller-local.

    AC-4: Marker parser exists in exactly ONE place (or divergence documented)

    Verification: Unit Test (import-graph assertion) + code review
    Scenario: Given the codebase → When grepping for the body regex/strip logic → Then it appears once, imported by both batch-executor.ts and chain-preflight.ts.
    Assumptions: Extraction is clean because the only caller difference is which markers to honor (see Open Q #1) — parameterize, don't fork.

    AC-5: Unit tests use the verbatim issue bodies (#19/#31/#111/#325 negatives; #188/#223 positives)

    Verification: Unit Test
    Scenario: Given fixtures copied verbatim from this issue's Evidence table → When the parser runs → Then negatives yield [] and positives yield the declared number.
    Assumptions: Extracting a pure (body: string) => number[] parser (rather than testing fetch-based parseDependencies(issueNumber)) lets these fixtures be passed directly — no gh/spawnSync mock needed. This is why AC-4's extraction and AC-5's fixtures are coupled. Ref [feedback_synthetic_test_fixture_trap] / [feedback_motivating_example_regression].

    AC-6: Verified against the real corpus — no genuine declaration in open issues stops parsing

    Verification: Integration Test (one-shot corpus run, output captured for human review)
    Scenario: Given all open issues → When the new parser runs over each body → Then every genuine Depends on: #N (e.g. #188, #223) still resolves and no new misses appear vs a manual audit.
    Assumptions: Run as a /verify-style captured command, not a committed test that hits the network.


    Implementation Plan

    Phase 1: Extract the shared body-marker parser

    1. Create src/lib/workflow/dependency-markers.ts. Move BLOCKER_MARKER_REGEX, stripCodeAndComments, and a parameterized parser out of chain-preflight.ts:
      export type DepMarker = "depends on" | "blocked by";
      export function parseBodyDependencyMarkers(body: string, markers: DepMarker[]): number[]
      
      Build the regex from the requested markers so each caller opts into what it honors (resolves Open Q feat: Complete remaining v1.0 features (AC-10, AC-13, AC-14) #1 without a behavior change to the sorter). Carry over the anchoring/#-required/strip rationale comments verbatim — they are the reason the code exists.
    2. Re-point chain-preflight.ts:parseDeclaredBlockers to parseBodyDependencyMarkers(body, ["depends on", "blocked by"]). Keep the exported name and signature so its callers and tests are untouched.

    Phase 2: Harden parseDependencies

    1. In batch-executor.ts:199, replace the loose body regex (lines 213–225) with parseBodyDependencyMarkers(data.body, ["depends on"]). Only depends on — the sorter must NOT start reordering on blocked by (that would be the new silent-reorder behavior change Open Q feat: Complete remaining v1.0 features (AC-10, AC-13, AC-14) #1 warns against).
    2. Leave the label branch (lines 227–236) and the gh fetch untouched — AC-3.

    Phase 3: Tests

    1. New src/lib/workflow/dependency-markers.test.ts: verbatim Fix sequant run to use Claude Agent SDK #19/feat: Worktree isolation and multi-issue integration workflow #31/feat: Update /fullsolve to invoke child skills and add --chain to /solve recommendations #111/Unify /assess and /solve into single triage command with lifecycle recommendations #325 negatives, feat: Stack-aware constitution templates in /setup #188/feat(workflow): Track derived ACs through spec → exec → qa workflow #223 positives (AC-5), the depends on 12+13 case (AC-2), and a blocked by-honored-only-when-requested case.
    2. Extend chain-preflight.test.ts only if the extraction changed any observable behavior (it should not) — otherwise its green suite is the regression guard for AC-4.
    3. Corpus check (AC-6): a throwaway npx tsx -e run over open-issue bodies, output captured for the PR — not committed.

    Rule Touchpoints

    Not applicable — no AC triggers the behavior-rule detector (this is a single-runtime code path, not a skill-prompt + TypeScript duplication).


    Design Review

    1. Where does this logic belong? A new dependency-markers.ts in src/lib/workflow/, owned jointly by the two callers. The hardened logic currently lives in chain-preflight.ts only because feat: lightweight content pre-flight for --chain (AC presence, dependency-order sanity) #762 landed there first; it is not preflight-specific.
    2. What's the simplest correct approach? Parameterize by marker list. Rejected: (a) copy the regex into batch-executor.ts — that is exactly the drift AC-4 forbids; (b) share a single fixed parser that always honors both markers — cheapest but silently changes the sorter to reorder on blocked by (Open Q feat: Complete remaining v1.0 features (AC-10, AC-13, AC-14) #1's trap).
    3. What existing pattern does this follow? The PR feat(#762): lightweight content pre-flight for --chain #764 anchoring/strip treatment, now promoted from one-caller to shared-with-opt-in-markers. Mirrors how stripCodeBlocksAndComments is deliberately kept separate from its assess-collision-detect.ts sibling — precedent that "same syntax, different intent → keep configurable/separate."
    4. What would a senior reviewer challenge? "Why not just always honor both markers?" → because the sorter changes execution order and blocked by reorders are a real, unrequested behavior change (investigate(metrics): chain mode 29% success rate vs 92% single-issue — failure forensics #604: a wrong inference is worse than none). "Why a pure body parser instead of hardening parseDependencies in place?" → to make AC-5's verbatim fixtures testable without mocking gh.

    Feature Quality Planning

    All standard checks pass. Notable items:

    Derived ACs

    None — the six ACs fully cover the change.


    Open Questions

    1. Shared parser but per-caller markers? — Recommendation: yes, parameterize (parseBodyDependencyMarkers(body, markers)); sorter passes ["depends on"] only, preflight passes both. Impact if wrong: sharing a both-markers parser makes the sorter silently reorder on blocked by — a real, unrequested behavior change. This is the issue's own Open Q feat: Complete remaining v1.0 features (AC-10, AC-13, AC-14) #1.
    2. Announce reorders? — Recommendation: defer to a separate follow-up, not this PR. A "reordered N → M (declared dependency)" note is a UX addition orthogonal to the parser-correctness fix here; bundling it widens scope and muddies the regression story. Issue's Open Q docs: Add pre-release checklist #2 flags it as "possibly a better standalone fix" — agreed, standalone.

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: enabled
    Reasoning: Matches the prior /assess (spec → exec → qa, quality-loop on). Spec is now complete (this comment). No UI (no browser test needed) and no security surface. Testgen skipped despite Unit-Test ACs: bug-labeled fix and AC-5 dictates the exact fixtures verbatim — exec writes those directly; a stub-generation pass would add friction, not coverage. Quality loop stays on because the two open questions are genuine design calls that /qa should confirm were decided deliberately.


    Label Review

    Current: bug, cli
    Recommended: bug, cli, planned
    Reason: Scope is a bounded CLI bug fix; no complex/refactor/breaking warranted. Adding planned marks spec complete.
    Quality Loop: Will auto-enable via the /assess quality-loop=true marker; SCOPE_OK does not force it, but the design-decision risk justifies keeping it.

  5. added
    planned
    on Jul 16, 2026
  6. admarble commented on Jul 16, 2026

    @admarble
    ContributorAuthor

    Exec — implementation complete (PR #774)

    Hardened parseDependencies by extracting the pre-flight's marker mechanics into a shared parser, per the spec.

    AC coverage

    AC Status
    AC-1 Prose / in-fence / inline-code ignored; line-leading Depends on: #N parses ✅ (verbatim #19/#31/#111/#325 → []; #188/#223 → [187]/[219])
    AC-2 depends on 12+13 not parsed as #12 (# required) ✅
    AC-3 Label depends-on/123 unchanged ✅ (label branch untouched; tested)
    AC-4 Marker parser in exactly ONE place, shared by both callers ✅ (dependency-markers.ts)
    AC-5 Tests use verbatim issue bodies ✅ (real bodies under __fixtures__/dependency-markers/)
    AC-6 Verified against real corpus ✅ (open issues: 0 false hits; genuine #188/#223 still parse)

    Design decisions (Open Questions)

    1. Shared parser, per-caller marker set — pre-flight honors depends on + blocked by; the sorter honors only depends on. Sharing the parser deliberately does not make the sorter start reordering on blocked by (a new silent-reorder class; feat: lightweight content pre-flight for --chain (AC presence, dependency-order sanity) #762 Open Q Doctor: Add Claude Code CLI check #3). Implemented as parseBodyDependencyMarkers(body, markers).
    2. Announce reorders — deferred as a standalone UX follow-up (Open Q docs: Add pre-release checklist #2), not bundled into this parser-correctness fix.

    Key files

    • src/lib/workflow/dependency-markers.ts (new) — shared parseBodyDependencyMarkers, stripCodeAndComments
    • src/lib/workflow/batch-executor.ts — parseDependencies body branch → ["depends on"]; label branch unchanged
    • src/lib/workflow/chain-preflight.ts — parseDeclaredBlockers → ["depends on", "blocked by"]
    • src/lib/workflow/dependency-markers.test.ts + __fixtures__/dependency-markers/ (verbatim bodies)
    • CHANGELOG.md — Fixed entry

    Checks

    • npm run build ✅ · npm run lint ✅ (0 warnings) · targeted npm test ✅ 84 passed
    • Existing parseDeclaredBlockers suite (chain-preflight) passes unchanged — the AC-4 regression guard.

    Quality Plan Alignment

    Dimension Status
    Ordering risk (land after #766 / #770) ✅ both merged to main; branch 0 behind, no conflict
    No new silent behavior ✅ sorter marker set held to depends on only, documented inline

    PR: #774 (OPEN) — #774

  7. admarble commented on Jul 16, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #767

    Reviewed inline (code diff is ~380 lines; the 1,486-line total is dominated by six verbatim fixture bodies). All CI green, build/lint/tests pass locally.

    AC Coverage

    AC Description Status Notes
    AC-1 Prose / in-fence / inline-code mentions ignored; line-leading Depends on: #N still parses MET Verbatim #19 (prose), #31 (fenced), #111 (describes other issues), #325 (quoted tool output) → []; #188 → [187], #223 → [219]. Each asserted independently.
    AC-2 depends on 12+13 no longer parses as #12 (# required) MET buildMarkerRegex uses mandatory #(\d+); explicit unit + #19 fixture cover it.
    AC-3 Label-based depends-on/123 parsing unchanged MET Label branch in batch-executor.ts:228 (/depends-on[-/](\d+)/i) is byte-for-byte untouched; parseDependencies label tests (mocked gh) confirm depends-on/123 and depends-on-123 → [123].
    AC-4 Marker parser exists in exactly ONE place, shared by both callers MET parseBodyDependencyMarkers defined only in dependency-markers.ts, imported by both batch-executor.ts and chain-preflight.ts. Per-caller marker set (["depends on"] vs both) resolves Open Q #1 without changing sorter semantics.
    AC-5 Unit tests use verbatim issue bodies, not synthetic fixtures MET Real bodies saved under __fixtures__/dependency-markers/ (fetched via gh) and loaded with readFileSync; negatives/positives from the evidence table.
    AC-6 Verified against real corpus — no genuine declaration stops parsing MET One-shot run over live open issues: 0 false hits; genuine #188→[187], #223→[219] still parse.

    Coverage: 6/6 AC items MET.

    Design decisions verified (the point of keeping the quality loop on)

    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 11 (6 fixtures, 2 src, 1 new src, 1 test, CHANGELOG) OK
    Lines added / deleted +1486 / -61 (code ≈ +380) OK

    CI Status

    Check State Impact
    validate-plugin SUCCESS ✅
    build (22.x) SUCCESS ✅
    node-floor-guard SUCCESS ✅
    validate-skills SUCCESS ✅
    typecheck SUCCESS ✅

    CI Summary: 5 passed, 0 pending, 0 failed. (Diff is not markdown-only; no relaxation applied — full build matrix genuinely green.)

    Test Coverage Analysis

    Changed source file Tier Has Tests?
    dependency-markers.ts Standard ✅ dependency-markers.test.ts (pure parser + mocked-gh parseDependencies)
    batch-executor.ts (body branch) Standard ✅ parseDependencies suite in dependency-markers.test.ts
    chain-preflight.ts (parseDeclaredBlockers) Standard ✅ existing chain-preflight.test.ts (11 tests) — behavior byte-for-byte unchanged, serves as the AC-4 regression guard

    Coverage: 3/3 changed source files covered.

    Code Review

    Strengths:

    • The extracted regex for ["depends on","blocked by"] is byte-for-byte identical to the old BLOCKER_MARKER_REGEX, so the pre-flight's 11 tests pass unchanged — a clean, behavior-preserving extraction.
    • The markers.length === 0 guard is load-bearing and tested: without it the alternation would be empty and ^\s*...(?:)...#(\d+) would match a bare #N at line start. Good catch to guard + test it.
    • Fresh regex per call (no shared lastIndex state across matchAll).
    • Rationale comments carried over verbatim, including the "keep separate from assess-collision-detect" note (docs: note why the two body-strip helpers must not be unified #770).

    Issues: None.

    Suggestions: None blocking. (found.includes dedup is O(n²) but n is trivially small.)

    Anti-Pattern Detection

    No any, no hardcoded secrets, no SQL concatenation, no unbounded loops, no regex-injection risk (marker values are a closed DepMarker union of two literals). package.json unchanged — no dependency audit needed.

    Test Quality Review

    Category Status Notes
    Behavior vs Implementation ✅ OK Asserts parser outputs on real bodies, not internals.
    Coverage Depth ✅ OK 4 negatives + 2 positives + #-required + per-caller-markers + empty-set + dedup + label paths.
    Mock Hygiene ✅ OK Only child_process mocked (external gh); pure-parser suite is mock-free.
    Test Reliability ✅ OK Deterministic; fixtures are on-disk, no network at test time.

    Risk Assessment

    • Likely failure mode: A future "DRY" consolidation makes the sorter honor blocked by too, reintroducing silent reorders. Mitigated by explicit inline comments at both call sites and a dedicated per-caller-markers test.
    • Not tested: parseDependencies's gh-fetch failure path (status !== 0 → []) isn't newly tested, but it's unchanged pre-existing behavior outside this fix's scope.
    • Sibling sites considered: none — a codebase grep confirms the only two body-marker parsers are parseDependencies and parseDeclaredBlockers, both now delegating to the shared module. No other loose depends\s+on body regex exists.
    • Sibling-line audit: none — the only adjacent marker access in batch-executor.ts is the label regex, a separate explicit signal correctly left untouched (AC-3).

    Adversarial Re-Read

    Findings: No gaps found because: (1) ran the implementation against every verbatim motivating-example fixture from the issue body (#19/#31/#111/#325/#188/#223) — all produce the AC-claimed result; (2) the AC-6 "evidence" is a genuine post-fix corpus validation, not a pre-fix repro; (3) inspected process state — worktree clean, branch 0 behind origin/main, no stray uncommitted work; (4) sibling sites cited explicitly for both cross-file (§5: none) and intra-file (§4 Q5: none — label branch is a different signal); (5) checked Non-Goals — the sorter's marker set stayed depends on-only and the Kahn's-algorithm / warning-UX out-of-scope items were not touched.

    Status: Clean

    Verdict: READY_FOR_MERGE

    All 6 ACs MET, both design open-questions resolved deliberately and correctly, full CI green, behavior-preserving extraction with the pre-flight's existing suite as a regression guard, and the fix verified against the real corpus. Clean A+ implementation.

    Documentation

    Documentation: Optionally run /docs 767 before merge, though this is an internal bug fix with no admin-facing surface.

    Next Steps

    1. Merge PR fix(#767): harden parseDependencies; share body-marker parser #774.
    2. (Optional follow-up) Open Q docs: Add pre-release checklist #2 — announce reorders (reordered N → M (declared dependency)) as a standalone UX issue.
  8. added
    ready-for-review
    on Jul 16, 2026
  9. admarble commented on Jul 16, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #767 (independent second pass)

    Verdict: AC_MET_BUT_NOT_A_PLUS — all 6 ACs genuinely met (I re-verified AC-5 and AC-6 empirically rather than by reading), and the AC-4 design call was resolved correctly. But this PR introduces one small regression the in-pipeline QA marked "Adversarial Re-Read: Clean" and missed: it invalidates the cross-reference #770 landed an hour ago.

    AC-4 resolved correctly

    The implementation took the per-caller-markers route: shared hardened mechanics (buildMarkerRegex, stripCodeAndComments), marker set passed in by each caller. parseDependencies honors ["depends on"]; parseDeclaredBlockers honors ["depends on","blocked by"]. The extracted alternation is byte-identical to the old BLOCKER_MARKER_REGEX, so the pre-flight's 11 tests pass unchanged as a regression guard. The sorter does not inherit blocked by — locked by a dedicated test. This is exactly right.

    AC-5 verified byte-for-byte (not taken on trust)

    I diffed each fixture against the live issue body:

    issue-19.md: VERBATIM ✅   issue-31.md: VERBATIM ✅   issue-111.md: VERBATIM ✅
    issue-188.md: VERBATIM ✅  issue-223.md: VERBATIM ✅  issue-325.md: VERBATIM ✅
    

    Genuinely verbatim — not synthetic, not paraphrased.

    AC-6 verified against the real corpus (ran it myself)

    Fetched all 43 issues whose bodies contain depends on/blocked by, and ran the old regex against the new parser:

    #767 [OPEN]   old=[12,10,175,187,219] new=[]  dropped=[12,10,175,187,219]
    #325 [CLOSED] old=[175]               new=[]  dropped=[175]
    #111 [CLOSED] old=[10,11]             new=[]  dropped=[10,11]
    #31  [CLOSED] old=[10]                new=[]  dropped=[10]
    #21  [CLOSED] old=[12]                new=[]  dropped=[12]
    #19  [CLOSED] old=[12]                new=[]  dropped=[12]
    
    --- 43 issues | 6 changed | 11 dropped | 0 newly-parsed ---
    

    Every one of the 11 drops is a confirmed false positive from the Evidence table. Zero genuine declarations lost — #188 → [187] and #223 → [219] still parse (unchanged, hence absent from the diff). AC-6 holds.

    Worth recording: #767's own body parsed as depending on [12,10,175,187,219] under the old regex. The issue describing the bug was itself a victim of it — sequant run 767 12 would have silently reordered.

    Finding — this PR strands #770's guard rail (introduced here, not pre-existing)

    assess-collision-detect.ts:96 says:

    Do NOT unify this with chain-preflight.ts:stripCodeAndComments, which looks nearly identical but additionally strips inline spans.

    That function no longer exists in chain-preflight.ts — this PR moved it to dependency-markers.ts. The pointer now dangles.

    This matters more than a typo because of what the note is for. It is the only thing standing between a future dev and a silent-empty-set bug: unifying the two strip helpers deletes every path PATH_REGEX looks for. A dev who follows the reference, finds nothing at chain-preflight.ts, and concludes the warning is stale is exactly the failure mode #770 exists to prevent — and this PR makes that the likely outcome. The note was correct before this commit; it isn't now.

    A grep for the moved symbol's name would have caught it: moving a function has to carry its prose references, not just its call sites.

    Secondary: stripCodeAndComments is now exported from dependency-markers.ts but has no consumer outside its own module (it was private in chain-preflight.ts). Dead export — and an exported symbol implies a public API that the #770 note is warning people away from.

    Suggested fix (both one-liners)

    1. assess-collision-detect.ts:96 — repoint to dependency-markers.ts:stripCodeAndComments.
    2. dependency-markers.ts — drop the export on stripCodeAndComments, restoring the private status it had in chain-preflight.ts.

    Checks

    Check Result
    CI 5/5 SUCCESS
    Local build / lint ✅ / ✅ (0 warnings)
    Tests 84 pass (dependency-markers, chain-preflight, batch-executor)
    Behind main 1 (383c375, unrelated docs(reflect))
    Fixtures verbatim 6/6 ✅
    Corpus regression 0 genuine declarations lost

    AC Coverage

    AC Status Basis
    AC-1 prose/fence/inline-code ignored; line-leading parses MET 4 verbatim negatives + 2 positives; corpus run
    AC-2 # required (depends on 12+13 ≠ #12) MET Test + #19/#21 corpus drop
    AC-3 label parsing unchanged MET Label branch untouched; 3 label tests
    AC-4 one shared parser (or documented divergence) MET Shared module, per-caller markers
    AC-5 verbatim fixtures, not synthetic MET Byte-diffed vs live bodies
    AC-6 real-corpus verified, no genuine declaration lost MET 43-issue run, 0 lost

    Coverage: 6/6 met. Neither finding is an AC failure — both are quality items.

    Self-Evaluation

    • Verified working: Yes — ran the parser over the real 43-issue corpus and byte-diffed all 6 fixtures against live GitHub.
    • Test efficacy: High. Real fixtures + per-caller marker tests + label tests + end-to-end through parseDependencies with mocked gh.
    • Likely failure mode: Someone unifies the strip helpers after following docs: note why the two body-strip helpers must not be unified #770's now-dangling pointer to a function that isn't there, and path extraction silently returns [].
    • Verdict confidence: High.

    Next Steps

    1. Apply the two one-liners above → READY_FOR_MERGE.
    2. (Optional follow-up) Open Q docs: Add pre-release checklist #2 — announce reorders (reordered N → M (declared dependency)) as its own UX issue.
  10. added
    needs-improvement
    and removed
    ready-for-review
    on Jul 16, 2026
  11. added a commit that references this issue on Jul 16, 2026
  12. added a commit that references this issue on Jul 16, 2026
  13. added 2 commits that reference this issue on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclineeds-improvementplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions