Skip to content

fix(qa): tautology detector still flags a subprocess-driven CLI test file — __dirname-built paths evade #885's build-output heuristic #956

Closed

Description

@admarble

Epic: M0 Blocked by: — Tier: judgment Doc: docs/internal/graph-2026-09/PLAN.md §7 D12, §9 OQ-10 Graph node: 03

Motivation

The tautology-advisory CI job added in #940/#955 went live and, on its own first successful run, flagged all 5 test blocks in scripts/qa/tautology-detector-cli.test.ts as 100% tautological (55.6% of the 9 total test blocks scanned in that PR). This is the same false-positive class #885 fixed for cli.integration.test.ts — a subprocess-driven integration test that spawns the CLI and asserts on stdout/exit code, invisible to the detector's static import analysis — recurring on a different file.

Live evidence: https://github.com/sequant-io/sequant/actions/runs/32452513904/job/96683478624

Root cause

isSourceModule/spawnsBuildOutput in src/lib/test-tautology-detector.ts recognizes a subprocess call as "production code" only when the spawned command's source text contains a literal build-output token: dist/ (BUILD_OUTPUT_PATTERN) or hooks/*.sh / scripts/** (PROJECT_SCRIPT_PATTERN) — either inline, or via collectBuildOutputVars, which scans variable declarations whose right-hand side textually contains one of those tokens.

scripts/qa/tautology-detector-cli.test.ts builds its spawn path like this:

const CLI_PATH = path.resolve(__dirname, "tautology-detector-cli.ts");
...
const stdout = execSync(`npx tsx ${CLI_PATH} ${args.join(" ")}`, ...);

CLI_PATH's right-hand side is path.resolve(__dirname, "tautology-detector-cli.ts") — there is no literal "scripts/..." substring anywhere in that expression (__dirname is a runtime-resolved Node global, not source text the detector can trace). collectBuildOutputVars is purely a textual regex scan, so it never captures CLI_PATH as a build-output variable, and every block in the file scores zero production references.

By contrast, #885's own AC-2 fixture (and every other file the heuristic now correctly handles) spawns a path built from a literal string containing dist/ or scripts/. The __dirname-relative construction pattern used here — arguably the more idiomatic way to build a path to a sibling file — falls outside what the heuristic can see.

Proposal (for whoever picks this up — not scoped/designed here)

Something in the direction of: also recognize path.resolve(__dirname, "<literal>.ts") / path.join(__dirname, "<literal>") constructions as build-output-variable sources when the literal argument matches the file being spawned is itself under scripts/ or a sibling test file's own directory — i.e. infer the project-relative path from the test file's own location rather than requiring the token to appear literally in the RHS. Needs its own design pass; #940's Non-Goals explicitly deferred detector-quality rework, and this issue is that deferred work.

Scope (graph plan 2026-09)

  • may touch: src/lib/test-tautology-detector.ts, src/lib/test-tautology-detector.test.ts, detector fixture files, a new src/lib/test-tautology-detector.corpus.test.ts
  • not in scope: CI workflow, scripts/qa/tautology-detector-cli.ts, per-block skip pragma, enforcement mode.

Acceptance criteria (graph plan 2026-09)

  • AC-1: scripts/qa/tautology-detector-cli.test.ts scores 0 tautological — Verify: npx vitest run src/lib/test-tautology-detector.corpus.test.ts -t "956 target" → passes (the test runs analyzeTestFile on the real file and asserts tautologicalCount === 0).
  • AC-2: a genuinely tautological test using the same path.resolve(__dirname, …) spawn idiom is still flagged — Verify: same file, -t "956 negative" → passes on a committed fixture whose spawn is real but whose assertions never touch its output; PR body carries Mutation-verified: AC-2 — removed the __dirname recognition; <test> failed; restored.
  • AC-3: the fix(#963): pre-tool.sh No-Changes Guard resolves cd targets instead of silently checking the wrong directory #966 remainder (__tests__/pre-tool-hook.integration.test.ts blocks ~912/926/938: join(REPO_ROOT, "hooks", "pre-tool.sh") + run(preHook, …) argument binding) is recognized — Verify: same file, -t "956 segments" asserts that file's tautologicalCount ≤ 1 (block ~1529 is legitimately flagged per the issue comment).
  • AC-4: corpus classification recorded — Verify: PR body contains a table with one row per file in git grep -l -e execSync -e spawnSync -e execFileSync -e 'spawn(' -- '*.test.ts' | xargs grep -l -e __dirname -e 'join(REPO_ROOT' -e 'resolve(REPO_ROOT' (33 rows today), columns: before, after, class ∈ {subprocess-fp-fixed, file-content-legit, harness-sanity-legit}, and every subprocess-fp-fixed row reads after = 0.
  • AC-5: existing detector suite green — Verify: npx vitest run src/lib/test-tautology-detector.test.ts → passes.

Done when (graph plan 2026-09)

No subprocess-driven test in the repo is flagged because its spawn path was built from __dirname or from separate string segments, and the remaining flags are each classified as legitimate in the PR.

Original acceptance criteria (superseded by the graph-plan ACs above; kept for history)
  • AC-1: scripts/qa/tautology-detector-cli.test.ts is not reported as tautological — its subprocess spawn of CLI_PATH (built via path.resolve(__dirname, ...)) is recognized as production code.
  • AC-2: A genuinely tautological test in a file using the same __dirname-relative spawn pattern is still reported (no blanket exemption by filename).
  • AC-3: Corpus check against other __dirname/path.resolve or path.join-based subprocess spawns in the repo (if any exist beyond this file) to confirm the fix generalizes, not just to this one file.

Context

Surfaced during #940's live-CI verification (PR #955). #940's Non-Goals explicitly ruled out detector-quality rework in that issue: "further tuning waits for Phase A data." This is that data, and the first concrete finding from it.

Activity

  1. admarble commented on Aug 26, 2026

    @admarble
    ContributorAuthor

    Additional evidence from #963 / PR #966 — two more instances of this class, plus one new sub-defect

    While fixing #963's gaps, PR #966 landed two detector improvements (src/lib/test-tautology-detector.ts) that partially overlap this issue's territory — recording what's now fixed vs. what remains, so this issue picks up from the current state:

    Already fixed in #966 (don't re-do):

    • collectBuildOutputVars now tolerates a bounded TS type annotation between the variable name and = (const HOOK_COPIES: Array<[label: string, path: string]> = [...] was invisible before).
    • New collectDescribeEachParams: when a describe.each(X) table is a build-output source, the callback's parameter names are added to the build-output var set. This took __tests__/pre-tool-hook.integration.test.ts from 74/74 falsely flagged to 4.

    Still flagged — the remainder belongs to this issue:

    1. Segment-built join() paths (3 blocks, lines ~912/926/938, the HOOK_PAIRS "hook log sink" section): paths built as join(REPO_ROOT, "hooks", "pre-tool.sh") — separate string-literal arguments, so no contiguous hooks/pre-tool.sh substring exists for PROJECT_SCRIPT_PATTERN to match. Same root cause as this issue's path.resolve(__dirname, ...) case, different construction idiom; one fix should cover both (recognize the path-building call's literal segments, not just contiguous RHS text).

    2. New sub-defect — call-site argument-value tracking: even if HOOK_PAIRS were collected, those blocks would still flag. Their describe.each callback params are preHook/postHook, but the spawning helper's own parameter is named hook — the name-text-match that makes collectDescribeEachParams work elsewhere (where hookPath = hookPath coincidentally) has no bridge here. Fixing it means teaching extractHelperDefinitions to capture parameter lists and cross-referencing call sites (run(preHook, ...) binds a build-output var into run's first param regardless of name). Suggest adding as an AC here rather than a separate issue — it's the same "heuristic can't see through one indirection layer" family, and any corpus check for AC-3 will hit it immediately.

    3. One definitional edge, noted for completeness (probably wontfix): __tests__/pre-tool-hook.integration.test.ts:~1529 ("confirms jq is actually unavailable on the filtered PATH") is flagged correctly by the detector's own definition — it's a test-harness sanity check that genuinely spawns only system binaries. If noise like this matters once enforcement (Phase B) arrives, a per-block skip pragma (the file-level hasTautologySkipPragma exists already) would be the mechanism; not worth building for advisory mode.

    Current measured state on main after #966: 4 advisory flags total across the repo's spawn-driven shell suites, all enumerated above.

  2. added
    graph-2026-09
    on Sep 7, 2026
  3. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    Runner context (graph-run, 2026-09-06): the plan for this graph is on PR #998 (branch docs/graph-plan-2026-09), not yet on main. Read it from the branch, not the working tree:

    git show origin/docs/graph-plan-2026-09:docs/internal/graph-2026-09/PLAN.md
    git show origin/docs/graph-plan-2026-09:docs/internal/graph-2026-09/issues/NODE-FILE.md
    

    PLAN §5 invariants are binding here: I-4 (hook/skill copies byte-identical: md5 -q a b c | uniq | wc -l → 1), I-5 (gate tests ship a Mutation-verified: record in the PR body), I-6 (stop at PR — never gh pr merge, never close the issue), I-9 (run the Verify commands verbatim; never reason an AC done). Base is main 20e2a867 (v2.13.1); no code drift from the plan base c3c1b0a8 beyond the version bump. Stay inside the may touch list in the node file.

    Node file: issues/03-956-detector-path-segments.md.

  4. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (5 ACs, 2 directories)

    AC Quality Check

    ⚠️ AC-3 — verification method integration_test was inferred from keywords, not declared. All 5 ACs use a Verify: clause rather than the house Evidence: field, so parseAcceptanceCriteria resolves AC-1/2/4/5 to manual. Cosmetic (the Verify commands are concrete and runnable), but it means testgen auto-detection sees no declared unit/integration evidence.

    ⚠️ AC-2 has a semantics conflict with the detector's own definition — see OQ-2. Everything else is clear and testable.


    Scope Assessment

    Non-Goals: Not present as a section. The node file's not in scope list stands in: CI workflow, scripts/qa/tautology-detector-cli.ts, per-block skip pragma, enforcement mode.

    Metric Value Status
    Feature count 3 (tool verdict) → 1 (human) ⚠️
    AC items 5 ✅
    Directory spread 5 (tool) → 2 (human) ⚠️

    Tool verdict: ❌ SCOPE_SPLIT_RECOMMENDED — overridden to ⚠️ SCOPE_WARNING. The assessor's split suggestion is a false positive: it classified AC-2/AC-5 as a "ui" feature (keyword match on "flagged"/"suite"), and its directory count includes the ~33 corpus files the ACs measure rather than edit. Real edit surface is src/lib/ (detector + 2 test files) plus a fixture dir — one coherent change. Quality loop stays enabled on the warning.


    Measured baseline (main @ 20e2a867)

    The corpus enumerated by AC-4's git grep is 33 files today (matches the node file). Running analyzeTestFile over it on current main:

    132 / 386 blocks flagged across 20 files. Analysis cost: 280 ms for all 33 files — comfortably inside the unit project's 5 s default timeout, so the new .corpus.test.ts needs no timeout override.

    Grouped by root cause:

    Root cause Blocks Representative files
    A. Segment-built join(ROOT,"a","b","c.sh") — no contiguous scripts/ substring ~40 cleanup-worktree-branch-resolution (12/12), new-feature-frozen-install (18/24), new-feature-checkout-guard (4/4), pre-tool-hook L912/926/938
    B. resolve(__dirname, "sibling.ts") — __dirname is a runtime global, invisible to a textual scan ~22 tautology-detector-cli.test.ts (6/6, the AC-1 target), lock-manager (5/11), abort-logging (3/3), precheck-cli (2/2), mcp-serve (6/10)
    C. Expression-bodied arrow helper — extractHelperDefinitions requires => {, so const runInTemp = (…) => runCli(…); is invisible 9 state-update-cli (8/10), sync-source-invocation (1/3)
    D. Dynamic await import() — extractImports misses const { resolveCliBinary } = await import("./tools/run.js") 27 server-extended (27/30)
    E. file-content-legit — gate tests that readFileSync a skill/hook/template and assert on text; tautological by the detector's definition, and legitimately so ~30 behavior-rule-qa-wiring (9/9), behavior-rule-spec-wiring (8/8), qa-markdown-only-ci-snippet (4/4), plugin-staleness-warning (3/16)
    F. harness-sanity-legit 1 pre-tool-hook L1529

    A and B are the issue's stated root cause. C and D are new findings from this pass — see OQ-1.

    Two extra facts that constrain the design:

    • mcp-serve spawns resolve(__dirname,"../../bin/cli.ts") and lock-manager spawns resolve(__dirname,"lock-manager.ts") — neither lands under dist/ or scripts/. So "add bin/ to PROJECT_SCRIPT_PATTERN" is not a fix; the heuristic has to reason about repo-internal paths generally.
    • lock-manager also declares TSX_BIN = resolve(__dirname,"../../../node_modules/.bin/tsx"), which resolves repo-internal. node_modules/ must be an explicit exclusion or that becomes a false negative.

    Acceptance Criteria

    AC-1: scripts/qa/tautology-detector-cli.test.ts scores 0 tautological

    Verification: Unit Test — npx vitest run src/lib/test-tautology-detector.corpus.test.ts -t "956 target"
    Scenario: Given the real file at its repo path → When analyzeTestFile(content, filePath) runs → Then tautologicalCount === 0.
    Assumptions: Verified — all 6 blocks call runCli, a function declaration spawning CLI_PATH. Once CLI_PATH is recognized, collectProductionHandles promotes runCli and all 6 pass. Current: 6/6 flagged.

    AC-2: a genuinely tautological test using the same path.resolve(__dirname, …) idiom is still flagged

    Verification: Unit Test — same file, -t "956 negative" + Mutation-verified: record in the PR body
    Scenario: Given a committed fixture declaring const CLI = path.resolve(__dirname,"cli.ts") → When analyzed → Then the block that spawns CLI is clean and a block that does not reach it is still flagged.
    Assumptions: ⚠️ See OQ-2 — the AC's stated fixture shape ("spawn is real but assertions never touch its output") is not tautological under the detector's rule; the enforceable requirement is "no blanket file-level exemption."

    AC-3: the #966 remainder in __tests__/pre-tool-hook.integration.test.ts is recognized

    Verification: Unit Test — same file, -t "956 segments" asserts tautologicalCount <= 1
    Scenario: Given the real file → When analyzed → Then only L1529 (harness-sanity) remains flagged. Current: 4/79 (L912, L926, L938, L1529).
    Assumptions: Needs both halves — segment resolution for join(REPO_ROOT,"hooks","pre-tool.sh") and call-site argument binding, because describe.each yields preHook/postHook while the spawning helper's own parameter is hook (per the #966 comment). Verify empirically after step 1; do not assume step 1 alone suffices.

    AC-4: corpus classification recorded in the PR body

    Verification: Manual — 33-row table (before / after / class), every subprocess-fp-fixed row reads after = 0
    Scenario: Given the git grep corpus → When the PR body table is read → Then each of the 33 files has a row and a class.
    Assumptions: ⚠️ The three-value class enum has no bucket for causes C and D — see OQ-1. Blocked on that decision.

    AC-5: existing detector suite green

    Verification: Unit Test — npx vitest run src/lib/test-tautology-detector.test.ts (70 blocks, currently 0 flagged / all passing)


    Implementation Plan

    Phase 1 — Path resolution (covers A + B; unblocks AC-1, AC-3-half-1)

    1. Add resolveDeclaredPathVars(content, filePath) to src/lib/test-tautology-detector.ts: match const NAME = (path.)?(resolve|join)(...) declarations; resolve the argument list when every argument is a string literal, __dirname, or an already-resolved variable name. Iterate to a fixpoint so HERE → REPO_ROOT → SCRIPT chains resolve. __dirname resolves from path.dirname(filePath).
    2. Classify a resolved path as production iff it is inside the repo root and not under node_modules/, os.tmpdir(), or a mkdtemp sandbox variable. Derive the repo root by walking up from filePath to the nearest .git/package.json — not from process.cwd(), so the corpus test is cwd-independent (and per the standing ban on vi.spyOn(process,"cwd")).
    3. Merge the result into the existing buildOutputVars set in analyzeTestFile (which already receives filePath — only collectBuildOutputVars needs the extra parameter threaded through). Keep the existing textual collectors untouched so fix(qa): tautology detector scores subprocess-driven integration tests 100% tautological (cli.integration.test.ts, pre-existing) #885/fix(locks): checkout release ignores holder identity on skip-pid-check locks — a blocked session's release contract unlocks the tree mid-run #906/fix(#963): pre-tool.sh No-Changes Guard resolves cd targets instead of silently checking the wrong directory #966 behavior is preserved by construction.

    Phase 2 — Call-site argument binding (AC-3 half 2)

    1. Extend extractHelperDefinitions to capture each helper's parameter list. Then, for every call H(argN, …) where argN is a known build-output var/param, add H's parameter N name to the set and re-run collectProductionHandles to a fixpoint. This is the run(preHook, …) → hook bridge.
    2. Re-measure pre-tool-hook.integration.test.ts; confirm it lands at exactly 1 (L1529).

    Phase 3 — Corpus test + fixtures (AC-1, AC-2, AC-3, AC-5)

    1. Create src/lib/test-tautology-detector.corpus.test.ts with test names containing the literal strings 956 target, 956 negative, 956 segments (the AC Verify commands filter on them with -t). It imports analyzeTestFile directly, so the file is not itself flagged.
    2. Commit the AC-2 negative fixture under the existing detector fixture directory. Commit before mutation-testing (git checkout <file> has wiped uncommitted work three times: feat(run): --ready-gate — run the post-QA ready gate inside sequant run (automates the any-gaps/fix-gaps second look, stops at human merge) #817/fix(locks): checkout release ignores holder identity on skip-pid-check locks — a blocked session's release contract unlocks the tree mid-run #906/feat(qa): mutation-verification becomes a parseable §7 gate instead of honor-system prose #939). Record Mutation-verified: AC-2 — <mutation>; <test> failed; restored. in the PR body with the machine-anchored <!-- SEQUANT_MUTATION: … --> comment.
    3. Run the full detector suite plus a whole-repo advisory pass to check for new false negatives introduced by the widened heuristic — the specific risk is a real tautology now excused because the file happens to declare a repo-internal path variable.

    Phase 4 — Classification + PR body (AC-4)

    1. Re-run the 33-file corpus, diff against the baseline table above, and classify every row. Any row whose after > 0 needs a named justification, not a bucket label.

    Design Review

    1. Where does this logic belong? Entirely inside src/lib/test-tautology-detector.ts, in the collector layer (collectBuildOutputVars / extractHelperDefinitions). No caller changes: analyzeTestFile already carries filePath.
    2. What's the simplest correct approach? Resolve path-construction expressions to a repo-relative path and ask "is this inside the repo?", instead of pattern-matching more literal tokens. Rejected: (a) adding bin/ and templates/ to PROJECT_SCRIPT_PATTERN — doesn't fix resolve(__dirname,"lock-manager.ts") and loses to the next new directory; (b) a real TS AST parse — correct but a rewrite, and the "may touch" list doesn't budget for it.
    3. What existing pattern does this follow? The file's established shape: bounded regexes, a named collector per idiom, a fixpoint closure in collectProductionHandles, and a docblock stating why the narrow miss is accepted.
    4. What would a senior reviewer challenge? "Does 'any repo-internal path' make the detector too permissive?" — the honest answer is that it widens the exemption, which is why Phase 3 step 8 (false-negative sweep) is a required step and not a nicety. The node_modules/ and tmpdir exclusions are the load-bearing guards.

    Feature Quality Planning

    • False-negative risk is the main quality exposure, not the fix itself. Any file that declares one repo-internal path variable gains a broader production surface. Mitigation: Phase 3 step 8, plus the AC-2 fixture as a standing regression.
    • AC-3 has a hidden second half. Reading it as "resolve the segments" alone will leave the file at 4 and fail the ≤1 assertion. Called out in the plan so exec doesn't discover it late.
    • No skill/hook files are touched, so invariant I-4 (byte-identical copies across the three mirrored dirs) is not in play for this change.
    • Worktree feature/956-… already exists, clean at main 20e2a867. No in-flight worktree touches the detector — no conflict risk.

    Open Questions

    1. AC-4's class enum has no bucket for root causes C and D (36 blocks). state-update-cli (8, expression-bodied arrow) and server-extended (27, dynamic await import()) are real false positives, but neither is file-content-legit nor harness-sanity-legit, and calling them subprocess-fp-fixed obliges after = 0 — which means fixing them. — Recommendation: fix both and keep the enum as written. Each is a small localized pattern addition in the same already-in-scope file (one extra arrow regex for expression bodies; one extra pattern in extractImports for destructured dynamic imports), and both fall under the fix(#963): pre-tool.sh No-Changes Guard resolves cd targets instead of silently checking the wrong directory #966 comment's own framing of "the same 'heuristic can't see through one indirection layer' family." Leaving them unfixed means the after column is 36/132 unexplained noise, which defeats AC-4's purpose. Impact if wrong: it is a genuine scope widening beyond the issue title — if you'd rather hold the line, the alternative is a 4th class out-of-scope-fp plus a follow-up issue, and AC-4's table gets an explicit deferral note. This is your call, not exec's.

    2. AC-2's fixture description contradicts the detector's rule. It asks for a fixture "whose spawn is real but whose assertions never touch its output" — but testBlockCallsProductionCode returns true on any block that spawns production code, regardless of what the assertions do, so that fixture would not be flagged and the test could never pass. The original (superseded) AC-2 states the enforceable requirement correctly: "no blanket exemption by filename." — Recommendation: implement the requirement, not the prescription. Fixture = one file declaring path.resolve(__dirname, …) with two blocks: one that spawns the handle (must be clean) and one that does not reach it (must stay flagged). The mutation still bites: removing __dirname recognition flips the first block to flagged and the test fails. Impact if wrong: if the intent really was to extend the detector to check assertion-to-output dataflow, that is a much larger feature and belongs in its own issue.

    3. Should templates/scripts/ resolve as production? cleanup-worktree.sh and new-feature.sh live there and are shipped, executed code (~34 blocks depend on the answer). — Recommendation: yes — PROJECT_SCRIPT_PATTERN already names the templates/scripts/ tree in its docblock, so this is consistent, not new policy. Low risk.


    Recommended Workflow

    Phases: exec → qa
    Quality Loop: enabled
    Reasoning: Judgment-tier node. The mechanical fix is small, but AC-4 requires classifying 33 files and AC-2 requires a mutation-verified gate test — both are exactly the cases the quality loop catches. Skipping testgen: all 5 ACs resolve to manual (no declared Evidence: clause), the Verify commands pin exact -t test names in a single new file, and the AC-2 negative fixture has to be hand-authored against the detector's real semantics — generated stubs would be churn. Skipping test (browser): no UI. Skipping security-review: no auth/IO/network surface.


    Label Review

    Current: graph-2026-09
    Recommended: graph-2026-09, bug, complex
    Reason: bug matches the fix(qa): title and the false-positive class. complex reflects the judgment load (33-file classification, a widened heuristic with false-negative exposure) that the AC count alone understates.

    → gh issue edit 956 --add-label bug --add-label complex


    Constraints acknowledged (graph-run runner context): I-5 (Mutation-verified: record in the PR body), I-6 (stop at PR — no gh pr merge, no closing the issue), I-9 (run the Verify commands verbatim). Stay inside the node file's may touch list.

  5. added
    planned
    on Sep 7, 2026
  6. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    Runner context (exec re-dispatch, 2026-09-07): the previous exec session for this issue was killed by the harness at 30 minutes of wall time (a hard no-progress ceiling on the launcher; it is not a credit or rate-limit problem, whatever the state says). The worktree survived with whatever was committed or left in the tree. This session has the same 30-minute ceiling. Work so it survives being cut off:

    1. Start by reading git log --oneline origin/main..HEAD and git status in the worktree and continue from the existing work — do not restart or re-derive.
    2. Commit a working increment at least every ~10 minutes (single-line conventional message, git commit as its own Bash call; wip:-style detail in the subject is fine as long as the type prefix is conventional). Uncommitted work is the only thing the cut-off loses.
    3. Run targeted tests in the foreground (timeout up to 600000). Do not start the full suite with run_in_background and then end your turn to wait — ending the turn ends the phase and the notification never arrives.
    4. Once the ACs pass, push and open the PR immediately; the PR body must carry the Mutation-verified: record for any gate-test AC (PLAN §5 I-5).
  7. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    Runner context — the worktree was destroyed; salvage from the transcript. The previous exec session was killed by the launcher's 30-minute ceiling while running the full suite, and the shutdown cleanup removed the worktree because nothing had been committed (the branch feature/956-… is still at main). The session's work is recoverable from its transcript:

    /Users/tony/.claude/projects/-Users-tony-Projects-worktrees-feature-956-fix-qa-tautology-detector-still-flags-a-subprocess/cf946718-b9f1-4ac7-ac11-184509216aa9.jsonl

    Every Write tool call there carries the full file contents (new corpus test, fixtures, classification table) and every Edit call carries old_string/new_string for src/lib/test-tautology-detector.ts in order — replay them (jq -c 'select(.type=="assistant") | .message.content[]? | select(.type=="tool_use" and (.name=="Write" or .name=="Edit")) | {name, input}' <file>) rather than re-deriving the heuristic. Then commit immediately, run only the targeted verify commands from the node file in the foreground, and commit again before anything long. The corpus classification table (AC-4) was already generated in that session — recover it from the transcript's tool results.

  8. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 0/1 met

    Gaps:

    • productionHandles matches at the use site by plain reference rather than call shape, so a block that merely reads a registered handle is excused; pre-existing on main, measured at 3 blocks, and the naive fix regresses a legitimate block
    • Exported buildPathContext has no direct unit test

    Suggestions:

    • Follow-up candidate: productionHandles matches at the use site by plain reference, not call shape. A block that merely reads a registered handle (expect(manager).toBeDefined()) is excused. I proved this is pre-existing on main — base and PR behave identically on a helper-based probe — so the PR inherits rather than introduces it. See Risk Assessment for the measured size.
    • buildPathContext (exported) still has no direct unit test; it is exercised only through analyzeTestFile.
  9. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    Runner verification — node 03 (PR #1002, QA verdict AC_MET_BUT_NOT_A_PLUS, iteration 2)

    Verify commands from issues/03-956-detector-path-segments.md, run verbatim in the worktree at 3c4be008:

    AC Command Result
    AC-1 npx vitest run src/lib/test-tautology-detector.corpus.test.ts -t "956 target" passed (real scripts/qa/tautology-detector-cli.test.ts → tautologicalCount === 0)
    AC-2 same file, -t "956 negative" passed; PR body mutation record (__dirname recognition removed → corpus test failed → restored) validated with parseMutationMarkers: valid
    AC-3 same file, -t "956 segments" passed (pre-tool-hook.integration.test.ts ≤ 1)
    AC-4 33-row classification table in the PR body 33 rows = the corpus grep's 33 files today; classes ∈ {subprocess-fp-fixed ×26, file-content-legit / harness-sanity-legit ×7}; every subprocess-fp-fixed row reads after = 0; second mutation record (AC-4 call-shape gate) also valid
    AC-5 npx vitest run src/lib/test-tautology-detector.test.ts 85 passed

    Run history: exec attempt 1 (original batch) was killed by the launcher's 30-minute ceiling and the shutdown cleanup deleted the worktree because nothing had been committed; attempt 2 rebuilt the work from the dead session's transcript in ~10 minutes, committed early, and the loop's second iteration passed QA.

    Not done (A+ notes, per stop-at-PR): productionHandles matches by plain reference rather than call shape — QA proved this is pre-existing on main, not introduced here; buildPathContext has no direct unit test. Both are follow-up material, not merge blockers, in my reading.

    Nothing fixed beyond the agent's work. Merge decision is yours — I will not merge.

  10. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    Runner note — A+ pass stopped by owner (PR #1002 stands at 3d913f3d)

    The owner halted the A+ re-review loop across the graph after measuring its cost (44 QA rounds for three READY_FOR_MERGE verdicts). The in-flight QA round for this issue was killed 4 minutes in; QA writes nothing to the worktree, so nothing was lost.

    Where #956 stands:

    • Verdict of record: AC_MET_BUT_NOT_A_PLUS (iteration 2, at 3c4be008).
    • Both A+ notes from that verdict were addressed and pushed at 3d913f3d: buildPathContext now has direct unit tests, and the productionHandles reference-vs-call asymmetry is documented as pre-existing on main rather than changed. CI is green on that head. No fresh QA verdict was taken on it.
    • All five node 03 verify commands passed at 3c4be008 (comment above); the 3d913f3d delta is test + doc only.

    Merge-ready by the plan's bar (all ACs verified). Same standing applies to #981, #987 and #992: their A+ edits are pushed but were not re-reviewed.

  11. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    Fixed by PR #1002 (squash-merged to main as 35ea072 on 2026-09-08); closing on the owner's instruction. PR #1002's body lacked a closing keyword, which is why GitHub did not auto-close this.

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

    graph-2026-09planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions