Repository navigation
Description
⚠️ Re-aimed 2026-08-09 after/specmeasurement — read this first.The original framing below is preserved for the reasoning trail, but its central premise is measurably false:
sequant-explorerhas 0 recorded spawns across 1,332 local transcripts (169 of which ran/spec; 78% of those spawned no subagent at all). The explorer fan-out never executes — filed as #927.Consequences: AC-2 as originally written is unsatisfiable (the explorer-transcript corpus is empty, so no rate is computable), and Phase B would have gated a code path that never runs. This is the denominator trap @zeweihan predicted, in its limit case — the gate would have measured 0% and read as a clean bill of health when the true reading is "no data".
The method survives; only the corpus was wrong. Measure-first, deterministic-script-not-LLM-pass, and the #608/#834 reasoning all still hold. The target moves from explorer report text to the posted
SEQUANT_PHASE: specplan comment — durable, timestamped (so the contemporaneous-commit caveat becomes resolvable rather than a caveat), and the artifact/execactually consumes. Acceptance Criteria below are updated accordingly; everything above them is the original text.Full measurement: spec planning comment.
Problem
/spec's research fan-out is the one agent output in the pipeline that is consumed with zero verification.
The spec skill spawns 1–3 sequant-explorer subagents (spec/SKILL.md:133-148) whose entire output contract is one prose line in the agent definition: "Report findings in structured format: file paths, patterns discovered, recommendations" (.claude/agents/sequant-explorer.md). Their free-form findings feed directly into the Implementation Plan. No existence check on cited files, no symbol resolution, no validation of any kind — not in the skill, not in the agent definition, not in TypeScript.
The codebase already documents this exact failure mode — but only for QA: qa/SKILL.md:165 — "Ad-hoc background agents for code review are unreliable — they hallucinate about file existence, misattribute API patterns…". /spec has no equivalent caveat or mitigation, yet its explorers are the same kind of background agent, and their claims have a longer blast radius: a plan built on a phantom path or misattributed API misdirects /exec, then burns /qa and quality-loop iterations on rework, in a worktree run that costs 20–30 minutes.
Evidence honesty: there is no captured sequant incident of an explorer hallucination corrupting a plan. The failure mode is documented in-repo for the same agent class, and was observed directly on background QA agents in a downstream project (Apr 2026: claims that existing test files "don't exist in the repository", misattributed fetch wrappers). Because direct evidence here is thin, this issue is deliberately structured measure-first (the #608 pattern): Phase A establishes the phantom-citation rate before any gate ships, and "rate ≈ 0 → close as acceptable-as-is" is an explicit, valid outcome.
Design
Not another LLM review pass. #608 measured the last two always-on LLM gap sections (§6c, §6d) at a 0% action rate; #834's finding is that automated checks reliably catch exactly what is a deterministic gate and miss what requires judgment. Verifying "does src/lib/foo.ts exist" is deterministic — it should be a script, not a prompt.
Phase A — measure (blocks Phase B): a standalone script (idiom: scripts/qa/precheck.ts → .sequant/gap-precheck.json) that extracts path-like and symbol-like citations from explorer report text and checks them against the repo (git ls-files for paths, grep for symbols). Run it over ≥10 recent spec-run transcripts (~/.claude/projects/*/*.jsonl) and report the phantom-citation rate per run. Extraction reuses the PATH_REGEX genus from assess-collision-detect.ts with the #769 lesson applied: extraction over prose produces false positives, so the checker only verifies existence (side-effect-free, cheap) and never treats a miss as more than a flag; deleted-file citations from historical transcripts are excluded by checking against the commit contemporaneous with the run where feasible, else noted as a caveat.
Phase B — gate (only if Phase A shows signal): wire the same script into /spec as a post-explorer step. The spec agent runs it over the explorer reports before writing the plan; findings citing nonexistent paths/symbols are quarantined — the agent either re-grounds them with a direct Read/Glob (cheap, in-session) or excludes them from the plan with a one-line note. Deterministic script output, agent judgment only on the surfaced candidates — the same division of labor as qa's Phase 0c precheck (qa/SKILL.md:808).
Rejected alternatives: a fresh-context LLM verifier per finding (token cost with no evidence of need — see #608); tightening the explorer prompt alone (prompt-only contracts are the failure mode #814 just demonstrated); verifying explorer recommendations (judgment calls, not checkable facts — only existence claims are in scope).
Effect on process and code quality
- Plans grounded in real code paths before /exec commits 20–30 minutes of worktree work to them — the highest-leverage point to catch confabulation because everything downstream compounds it.
- Near-zero marginal cost: the gate is a deterministic script (~ms, no tokens); the only LLM cost is re-grounding actually-flagged citations, proportional to the error rate.
- Data before ceremony: if Phase A measures ~0, we close with a number instead of shipping a gate that pattern-matches to methodology. Either outcome improves on today's unknown.
- Symmetry: closes the documented QA-agent reliability caveat's blind spot in /spec, with the mitigation style (deterministic precheck + agent adjudication) the codebase already uses.
Acceptance Criteria
Re-aimed per the banner above. AC-1/AC-3 are near-verbatim; AC-2 changes corpus and adds a second rate; AC-4–AC-7 are Phase B and must be re-derived, not merely unblocked. Note the (Phase B) marker is now inside the description — a leading (Phase B) parenthetical defeats the AC parser's ID match and forces re-synthesized IDs.
Phase A — measure (blocks Phase B)
- AC-1: A citation-grounding script exists at
scripts/spec/ground-check.tsthat takes plan/report text and emits JSON{citations: [{raw, kind: path|symbol, exists, matchedAt?}]}usinggit ls-files/grep only — no writes, no network. Follows thescripts/qa/precheck.tsidiom: always exit 0, findings live in the JSON, consumers decide gating. - AC-2: Phase A report posted as a comment on this issue, over ≥10 recent
SEQUANT_PHASE: specplan comments (not explorer transcripts), each checked against the commit contemporaneous with its timestamp. The report states two rates, not one: the phantom rate (phantom citations ÷ path-typed citations) and the coverage rate (findings carrying any mechanically-extractable citation ÷ all findings). It states plainly that this is an existence score, not a grounding-quality score — it catches the loud failure (invented path) and leaves the quiet one (real path, wrong description of it) untouched. It also records the explorer-corpus null result as the finding it is. - AC-3: Decision gate recorded on this issue. Low coverage → do not wire the gate regardless of phantom rate. High coverage + phantom rate ≈ 0 → close as acceptable-as-is, citing the number. High coverage + real phantom rate → proceed to Phase B.
- AC-4: Extractor validated against a real captured spec plan comment, not a synthetic fixture (feat(qa): require detection-pattern verification for skill regex/grep/awk changes #551/feat(#529): enforce manual-test AC gate in QA skill #547), with Windows/POSIX handled via
path.posixagainstgit ls-filesoutput — no hand-rolled separator regexes. Unit + CLI integration tests mirroringscripts/qa/precheck.test.tsandprecheck-cli.integration.test.ts; note that without an.integration.infix the 5sunit-project timeout applies to subprocess tests (fix(test): tsx-spawning integration tests blow vitest's 5s default — phase-registry should use the prebuilt dist like its five siblings #842).
Phase B — gate: NOT BUILT. AC-3 resolved against it on the data (0.31% adjudicated hallucination rate, ~4.7:1 false-flag ratio). Left unchecked deliberately — these are declined, not outstanding.
- AC-5: (Phase B) The spec skill, all 3 mirrors sync-verified, runs the grounding script before plan writing; quarantined citations are either re-grounded in-session or excluded from the plan with a one-line note. Must merge with the
SEQUANT_SPECmarker block fix(run): spec recommendation handoff parses ephemeral chat text — recommended phases silently dropped; move the contract to a structured comment marker #921 added to the Output Template, not rewrite around it. - [~] AC-6: (Phase B, half-landed —
resolvedShaships in the checker output; the per-finding flag has no plan artifact to live in without a gate) Each cited finding carries a provenance flag (ground-checked/re-grounded/unverified) and the commit SHA the check ran against, surviving into the posted plan artifact — so/execand/qacan see the cost of trusting an unverified citation, and can detect drift on the specific cited files rather than trusting a spec-time confirmation whose shelf life is shorter than the 20–30 min/exectakes to consume it. (Both points from @zeweihan's review.) - AC-7: (Phase B) Gate test scoped to the skill section that invokes the script, mutation-verified per CLAUDE.md — delete the invocation, confirm exactly that test fails, record in the PR body.
- AC-8: CHANGELOG entry if Phase B ships; Phase A alone needs only the issue-comment report.
Non-Goals
- Any fresh-context LLM refuter over QA findings — the qa checker subagents are advisory-only (their output never enters the verdict algorithm), no incident of a hallucinated finding burning the quality loop is on record, and investigate(metrics): gap-check signal-to-noise — does flagged → action rate justify cumulative QA prompt cost? #608's data argues against speculative always-on review passes.
- Verifying recommendations/pattern judgments — only existence claims are mechanically checkable.
- Changing explorer count, model, or maxTurns. Retiring the dead explorer prescription itself is fix(spec): the explorer fan-out prescription has a 0% execution rate over 169 runs — delete it or make it real #927, deliberately not bundled here.
- Making
sequant-exploreractually fire so it can then be measured — that ships a behavior change to manufacture the problem being measured, and runs against the repo's preference for targeted reads.
References
qa/SKILL.md:165(documented hallucination mode, QA-only mitigation),scripts/qa/precheck.ts(deterministic-precheck idiom), investigate(metrics): gap-check signal-to-noise — does flagged → action rate justify cumulative QA prompt cost? #608 (measure-before-gate; 0% action-rate lesson), fix(qa): §7 gates must be reachable — lint the skill's own enforcement chain (§2h has been unwired since it shipped) #834 (deterministic gates vs review), fix(assess): path extraction counts cited paths as modification targets, producing phantom collisions #769 (path-extraction false positives), feat(qa): require detection-pattern verification for skill regex/grep/awk changes #551/feat(#529): enforce manual-test AC gate in QA skill #547 (dogfood detection against real corpus, not synthetic fixtures).- fix(spec): the explorer fan-out prescription has a 0% execution rate over 169 runs — delete it or make it real #927 — the explorer fan-out has a 0% execution rate; the finding that re-aimed this issue.
- fix(run): spec recommendation handoff parses ephemeral chat text — recommended phases silently dropped; move the contract to a structured comment marker #921 — added the
SEQUANT_SPECmarker to the spec Output Template; Phase B must merge with it. Also the reason plan comments are a reliable corpus: the spec agent posts viagh issue comment --body-file, so the comment is the durable artifact and chat text is not.
Complexity
Phase A: simple — one read-only script + a measurement report. Phase B: simple-to-medium — skill wiring across 3 mirrors + one gate test.
Self-assessed workflow
spec → exec → qa for Phase A (script + report); Phase B re-assessed after the data lands.
Activity
admarble commentedon Aug 9, 2026
#922 — feat(spec): measure-first grounding gate for explorer findings — deterministically verify cited paths/symbols before they enter the plan
OPEN
────────────────────────────────────────────────────────────────
→ PROCEED — Measure-first Phase A is a narrow, mechanical deliverable (script + report)
Commands:
sequant run 922
spec → exec → qa · 7 ACs
────────────────────────────────────────────────────────────────
Cleanup:
gh issue edit 922 --add-label enhancement # unlabeled; net-new measurement feature
────────────────────────────────────────────────────────────────
⚠ Phase B (spec/SKILL.md wiring) overlaps #921 and is contingent on Phase A's measured phantom-citation rate — scope exec to Phase A pending the decision gate
────────────────────────────────────────────────────────────────
zeweihan commentedon Aug 9, 2026
Strong writeup, and the "deterministic existence-check, not another LLM review pass" instinct is exactly right —
git ls-files/grep is the correct tool class for existence. A few things the measure-first framing should account for from the audit-trail side, because they shape what Phase A's number will and won't tell you:Existence phantoms are the easy class; misattribution is the unmeasured dangerous one. A finding citing
src/lib/auth.tsthat exists but is described as "uses a deprecated callback pattern" when it doesn't, passes the existence gate and is strictly harder to catch than a phantom path. The acceptance criteria (AC-1/AC-2) measure existence-class phantoms, which is fair for a deterministic script — but the "blast radius" framing in the problem statement should be honest that the gate catches the loud failure (invented path) and leaves the quiet one (real path, wrong description of it) untouched. That's still worth shipping; just don't let Phase A's number read as a grounding-quality score. It's an existence score.The
rate ≈ 0 → closegate has a denominator trap. If Phase A measures ~0 phantom citations, the first thing to check is whether the extractor is too narrow rather than whether the problem is absent. Prose-typed findings ("the auth module handles retries") carry no path syntax and won't enter the denominator at all — so the measured rate is(phantom path citations) / (path-typed citations), not(unsupported findings) / (all findings). Recommend AC-2 also report the coverage rate: what fraction of explorer findings carry any mechanically-extractable citation. A phantom rate of 0% over a coverage of 30% means 70% of findings were never checkable in the first place — which is the more decision-relevant number for whether Phase B is worth wiring in.The downstream plan needs to know which citations were confirmed, not just that some were quarantined. When an explorer finding is re-grounded in-session via Read/Glob, the Implementation Plan should record the verification on the finding itself — otherwise a plan is byte-identical whether its citations were checked against the tree or merely asserted. The property
/execand/qacare about is "confirmed-against-tree" vs "asserted-only," and that distinction has to survive into the plan artifact, not live only in the gate's stdout. Cheapest form: a provenance flag per cited finding (ground-checked/re-grounded/unverified), so the cost of trusting an unverified finding is visible downstream instead of absorbed.Grounding has a shelf life. The gate checks citations against the tree at spec-time;
/execmay run later against a tree that moved (concurrent work, rebase). A path verified at spec-time can be gone or semantically changed by the time/execcommits 20–30 min to it. Near-free mitigation: record the commit SHA the ground-check ran against alongside the finding, so/execcan detect drift on the specific cited files and re-trigger cheaply rather than trusting a stale confirmation. Provenance should include when it was grounded, not just that it was.admarble commentedon Aug 9, 2026
/spec — Planning Review
Complexity: Standard (7 ACs, 3 directories)
Premise Check — the explorer fan-out is a dead prompt
The issue's first design claim is "The spec skill spawns 1–3
sequant-explorersubagents … whose free-form findings feed directly into the Implementation Plan." Measured against the local transcript corpus (~/.claude/projects/**/*.jsonl, 1,332 transcripts, 2026-07-07 → 2026-08-09):"subagent_type":"sequant-explorer"across all 1,332 transcripts/specskill bodyExplore/general-purposeinstead/specruns (matcha-maps + ad-motion).sequant/logs/**(this repo + both testbeds)Availability is not the cause —
.claude/agents/sequant-explorer.mdis installed in this repo and in both consumer testbeds. The corpus is representative of headless runs: 160 transcripts live in worktree project dirs and 108 contain the exec-skill body, so the driver does record phase agents;/specsimply runs pre-worktree, which is why its 169 transcripts sit in the main-checkout dirs.The agent is choosing targeted inline
Read/Grepover the fan-out — which is the behavior the repo's own guidance prefers. This planning run did exactly that, and never considered spawning an explorer.What this does to each AC
This is @zeweihan's denominator trap in its limit case. Their review predicted the measured rate would be
phantom path citations / path-typed citationsrather thanunsupported findings / all findings; the actual coverage denominator turns out to be 0 findings, so the gate would have measured 0% and read as "no problem" when the real reading is "no data".Recommendation — re-aim Phase A, keep the method
The measure-first structure, the deterministic-script design (
git ls-files/grep, no LLM pass), and the #608/#834 reasoning are all sound and worth keeping. Only the corpus is wrong.Primary (recommended): measure the posted spec plan comment, not explorer transcripts. The
## Implementation Plan+ AC sections of<!-- SEQUANT_PHASE: spec -->issue comments are the artifact/execactually consumes, they are durable and timestamped (so the contemporaneous-commit caveat in the issue becomes resolvable rather than a caveat), and they exist in volume. This keeps AC-1 and AC-3 nearly verbatim and changes only AC-2's corpus definition.Secondary (same script, second corpus, near-free): the 38 spec runs that did spawn
Explore/general-purposeresearchers. Their results aretool_resultblobs in the transcripts — extractable, and closest to the original "verify the researcher" framing. Small-n, so report it as a side panel, not the headline number.Rejected: make explorers actually fire, then measure. That ships a behavior change in order to manufacture the problem you then measure, and it runs against the repo's own preference for targeted reads. Also out of bounds — the issue's own Non-Goals forbid changing explorer count/model/maxTurns.
Scope Assessment
Non-Goals: present and well-formed (3 items) ✅
Verdict:⚠️ SCOPE_WARNING — driven entirely by the Phase A + Phase B bundle. Scoping this run to Phase A only (per the
/assessnote) drops it to 3 ACs / 1–2 directories → SCOPE_OK. Plan below assumes Phase-A-only.AC Quality Check
lintAcceptanceCriteria: ✅ all 7 clear and testable — no vague/unmeasurable/open-ended patterns.One hygiene note the linter doesn't cover: the
(Phase B)parenthetical in AC-4/5/6 defeatsparseACLine, so those three fall through to the bare-checkbox path and get re-synthesized IDs. They happen to land on AC-4/5/6 here by ordering luck. Prefer- [ ] **AC-4:** (Phase B) …so the ID is parsed, not inferred.Behavior-rule detector: no AC triggered → Rule Touchpoints section omitted (correctly — this is a new script, not a rule edit).
Acceptance Criteria (as re-aimed)
AC-1: Citation-grounding script exists — unchanged
scripts/spec/ground-check.ts, JSON out{citations:[{raw, kind: path|symbol, exists, matchedAt?}]},git ls-files/grep only, no writes, no network.Verification: Unit Test + Integration Test
Scenario: Given a captured report containing a real path, a deleted path, a prose-only sentence, and a backticked non-path → When
npx tsx scripts/spec/ground-check.ts --in <file>→ Then JSON classifies each correctly and exit code is 0 regardless of findings.Assumptions: follows the
scripts/qa/precheck.tsidiom (always exit 0; findings live in JSON; consumers decide gating). Test layout copiesprecheck.test.ts+precheck-cli.integration.test.ts.AC-2 (re-aimed): Phase A report over spec plan comments
Verification: Manual Test (measurement report posted as an issue comment)
Scenario: Given ≥10 recent
SEQUANT_PHASE: specplan comments → When ground-check runs against each comment's contemporaneous commit → Then the comment reports both numbers.Per @zeweihan, AC-2 must report two rates, not one:
and must state plainly that the gate catches the loud failure (invented path) and leaves the quiet one (real path, wrong description) untouched. Also report the explorer-corpus result above as the null finding it is.
AC-3: Decision gate — unchanged in form
Verification: Manual Test. Low coverage → the gate is not worth wiring regardless of phantom rate. High coverage + ~0 phantom → close as acceptable-as-is with the number. High coverage + real phantom rate → Phase B.
AC-4 – AC-7 (Phase B): deferred behind AC-3, and to be re-derived, not merely unblocked
If Phase B proceeds it targets the plan comment, not explorer reports, so AC-4's wording needs rewriting. Two @zeweihan design inputs to carry forward: a per-finding provenance flag (
ground-checked/re-grounded/unverified) that survives into the plan artifact so/execand/qacan see the cost of trusting an unverified citation, and the commit SHA the check ran against, since a spec-time confirmation has a shelf life shorter than the 20–30 min/exectakes to consume it.Implementation Plan (Phase A only)
Phase 1 — script
scripts/spec/ground-check.ts, modeled onscripts/qa/precheck.ts:1-30(shebang, exported types,schemaVersion, always-exit-0).PATH_REGEXgenus fromsrc/lib/assess-collision-detect.ts:84(backtick-quoted, tracked-root-anchored, known-extension). ReusenormalizeSkillMirrorPath(:175) — otherwise every skill citation triples. Apply the fix(assess): path extraction counts cited paths as modification targets, producing phantom collisions #769 lesson: verify existence only, never escalate a miss beyond a flag.git grep -n. Report unresolved asexists:false, not as an error.path.posixagainstgit ls-filesoutput (always/-separated) — no hand-rolled separator regexes (AC-5's requirement, worth honoring in Phase A since the extractor is written here).Phase 2 — corpus + report
5. Harvest ≥10
SEQUANT_PHASE: speccomments viagh issue list/gh api; for each, resolve the contemporaneous commit from the comment timestamp so deleted-file citations don't inflate the phantom rate.6. Run, tabulate phantom rate + coverage rate per run, post as an issue comment.
7. Record the AC-3 decision in the same comment.
Phase 3 — tests
8. Unit tests on the extractor against a real captured spec plan comment, not a synthetic fixture (
#551/#547; the synthetic-fixture trap is exactly how a multi-marker extractor hides false negatives).9. CLI integration test mirroring
precheck-cli.integration.test.ts. Note: no.integration.infix → theunitproject's 5s timeout applies, which subprocess tests will flake against.Design Review
scripts/spec/, sibling toscripts/qa/. It is a standalone measurement CLI, not library code — nothing insrc/lib/should import it. Path-extraction primitives stay insrc/lib/assess-collision-detect.tsand get imported, not copied.src/lib/behind a CLI wrapper (premature — one consumer), and extendingprecheck.ts(different phase, different lifecycle).scripts/qa/precheck.ts— deterministic precheck emitting JSON, agent adjudicates surfaced candidates, missing/malformed JSON falls back rather than blocking. Fits exactly.Feature Quality Planning
Conflict Risk
None. In-flight worktrees are #915 (loop), #916 (bench), #919 (locks) — no overlap with
scripts/spec/. #921 merged (9ae2e1b4) and touchedspec/SKILL.md's Output Template; Phase A touches no SKILL.md, so no contention. Phase B would, and must merge that marker block rather than rewrite around it.Open Questions
spec/SKILL.md:133-148) prescribes 1–3 explorers with a 0% execution rate over 169 runs. Either delete it in favor of the observed behavior (targeted inline reads, escalate toExplorefor open-ended discovery) or make it real. That is a genuine finding, it is not what feat(spec): measure-first grounding gate for explorer findings — deterministically verify cited paths/symbols before they enter the plan #922 asked for, and feat(spec): measure-first grounding gate for explorer findings — deterministically verify cited paths/symbols before they enter the plan #922's Non-Goals explicitly fence off explorer configuration. Not silently widening scope — your call.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Matches the
/assessrecommendation (spec,exec,qa, quality-loop off). Phase-A-only scoping keeps this at 3 ACs / 1–2 directories, so the SCOPE_WARNING that would auto-enable the loop no longer applies.testgenconsidered and declined: one script, with a directly copyable two-file test precedent inscripts/qa/, against/testgen's known untracked-stub pitfall. If Phase B is later bundled into the same run, re-enable the quality loop.Blocking on AC-2's re-aim:
/execshould not start against AC-2 as currently written — the corpus is empty and the phase would either stall or fabricate a rate.Label Review
Current: none
Recommended:
enhancementReason: net-new measurement tooling; matches the
/assesscleanup suggestion. Noui(no component files), so no browser testing.→
gh issue edit 922 --add-label enhancementPlanning only — no implementation performed.
admarble commentedon Aug 9, 2026
Phase A report + AC-3 decision
Instrument:
scripts/spec/measure-corpus.ts(PR #928). Reproduce withnpx tsx scripts/spec/measure-corpus.ts --limit 45.Verdict up front: recommend closing as acceptable-as-is per AC-3. The adjudicated hallucination rate is 0.31% (3 of 972 citations across 39 merged plans), and a shipped gate would run an 8:1 false-to-true flag ratio. Detail below.
Headline — closed issues (the discriminable corpus)
Open issues — reported separately, not discriminable
6 comments, 182 citations, 12 unresolved at both refs (6.6%). Their work has not merged, so planned-new and phantom are indistinguishable by construction — this number is an upper bound, not a rate.
Per-run detail (closed issues)
Phantom candidates (closed issues) — for manual adjudication
--immutable, which Yarn 1 rejects — no berry detection exists #871: path:.yarnrc.yml (reference), path:../worktrees/feature/870-.../ (reference)|| "npm"fallback disagrees with the PM-aware shell path on manifest-less projects #870: path:pnpm-lock.yaml (reference)sequant run(automates the any-gaps/fix-gaps second look, stops at human merge) #817: path:dist/marketplace/external_plugins/sequant/README.md (reference)sequant run(automates the any-gaps/fix-gaps second look, stops at human merge) #817: symbol:executeIssue (reference)Caveats
origin/mainby comment timestamp. A plan written against an unmerged branch will show its branch-only files as missing-then.hasDeliverableCommitsas an alias and shippedhasExecChanges. The intent split separates proposals from claims about existing code; the latter is the only bucket a grounding gate would have caught, and it still warrants reading before it is believed.Manual adjudication of the 27 raw asserted-phantoms
The script cannot tell a confabulation from a hypothetical, so I read all 27.
Genuine hallucinations — 3
executeIssue— invented independently in two plans (fix(run): exec that leaves work uncommitted reports success and the run passes with no PR — #534's empty-branch escape, reopened via a new route #879, feat(run): --ready-gate — run the post-QA ready gate insidesequant run(automates the any-gaps/fix-gaps second look, stops at human merge) #817), both giving concrete edit instructions ("InexecuteIssue, changeconst success→ a mutable final verdict"). The real function isexecuteBatch. Two plans converging on the same plausible-but-absent name is the more interesting half of this finding.finalizePhaseLog(fix(cli): post-run SUMMARY duration sums per-issue times instead of wall clock — 4-issue parallel run reported 1h 12m for 36m 18s #867) — asserted as an existing pattern with a fabricated line number: "MirrorsfinalizeRunLog/finalizePhaseLog(run-log-schema.ts:389/415)".finalizeRunLogis real, at line 477 — so the line reference is wrong too. A real sibling lending credibility to an invented one, with a specific citation attached, is the textbook shape of the failure this issue was written about.All three are symbols. Zero path citations were genuine phantoms.
Not hallucinations — 24
pnpm-lock.yaml×2,.yarnrc.yml,build/,out/.sequant/state.json×4,scripts/dev/×2,../worktrees/×2computeResumePlan,ALGORITHM_UNPARSEABLE,mapRollupToTerminal,isTerminalReadyGateStatus("Rejected: aReadyGateStatushelper").integration.test.ts(a filename suffix being discussed)AC-3 decision
AC-3 says: high coverage + phantom rate ≈ 0 → close as acceptable-as-is, citing the data.
Coverage is 51.6% — moderate, comfortably above the "nothing was checkable" failure mode @zeweihan warned about. Adjudicated phantom rate is 0.31%.
Recommendation: close as acceptable-as-is; do not proceed to Phase B. Three reasons, in order of weight:
executeIssuecases would surface within seconds of an implementer openingbatch-executor.ts.What survives
The checker itself is worth keeping as an on-demand tool even with no gate wired in:
npx tsx scripts/spec/ground-check.ts --in plan.mdis a few milliseconds and no tokens, and re-runningmeasure-corpus.tsin six months costs one command. If the rate moves, the decision can be revisited against a comparable number instead of an intuition.Two honest limits on this number
If you'd rather not close
The one variant worth considering is a symbol-only, advisory check — no gate, no quarantine, just a line in the plan output listing unresolved symbols. It targets the only class with a positive hit rate. I'd still want a second measurement before wiring even that, because the 8:1 ratio above is driven mostly by symbol extraction, not path extraction.
Phase A complete: AC-1, AC-2, AC-3, AC-4 satisfied in PR #928. AC-5–AC-8 (Phase B) remain deferred pending your call on the above.
admarble commentedon Aug 9, 2026
/exec complete — Phase A
PR #928 · branch
feature/922-feat-spec-measure-first-grounding-gate-for-expscripts/spec/ground-check.tspath.posix, unit + CLI integrationChecks: build ✅ · lint ✅ ·
npm test259/259 files, 5353 passed (Node 22.23.0) · 3 mutations verified, one of which exposed a tautology in my own test — detail in the PR body.fix(#922): make the --ref integration test hermetic
fix(#922): close the gaps flagged in Phase A review
feat(#922): pin the resolved commit SHA in ground-check output
admarble commentedon Aug 10, 2026
@zeweihan Thanks for this — all four points ended up shaping the work, one of them more literally than either of us expected. Where each landed:
1. Existence vs. misattribution — adopted verbatim. AC-2 now requires the report to state it, the Phase A report carries it as its first caveat, and the checker's own file header opens with it. And the data made your point sharper than the framing did: of the 3 genuine confabulations found in 972 citations, all three are symbols, zero are paths — and the standout (
finalizePhaseLog, invented next to the realfinalizeRunLogwith a fabricated line number attached) is exactly the "real sibling lending credibility to an invented one" shape. The loud failure class (invented path) turns out to be nearly empty; even within existence-checkable claims, the quieter and more symbol-shaped the claim, the more it fails.2. The denominator trap — this one fired in its limit case before the measurement even ran. The original corpus (explorer transcripts) turned out to be empty:
sequant-explorerhas 0 recorded spawns across 1,332 transcripts (#927). A gate over that corpus would have measured 0% and read as a clean bill of health when the true reading was "no data" — the issue was re-aimed at posted plan comments because of it. The coverage rate you asked for is in the report: 51.6% of claim lines carry a mechanically-extractable citation, stated alongside the phantom rate rather than hidden under it. Adjudicated hallucination rate over the checkable half: 0.31% (3/972 across 39 merged plans).3 & 4. Provenance flags and shelf life — both were written into AC-6, but the AC-3 decision went the other way: with 3 true positives against 14 false flags (~4.7:1 after instrument fixes), wiring a gate would recreate the 0%-action-rate failure (#608) this issue cites as its own cautionary precedent, so Phase B stays unwired and the recommendation is to close on the number. The part of your feedback that survives that verdict is now implemented anyway: the checker (kept as an on-demand tool, PR #928) pins
resolvedSha— the full SHA of--refresolved, or HEAD in working-tree mode — alongsidegeneratedAt, with an unresolvable ref pinningnullrather than silently reporting HEAD (08040c7). So if the rate ever moves and a gate does get wired, drift detection is already in the JSON schema rather than a retrofit. The full provenance-flag-per-finding design stays parked in AC-6 with the Phase B ACs, to be re-derived from data rather than shipped on spec.feat(#922): Phase A — citation grounding checker and measured verdict…
admarble commentedon Aug 10, 2026
AC-3 decision: close as acceptable-as-is
Per the gate AC-3 defines — coverage is adequate (51.6%, well clear of the nothing-was-checkable failure mode) and the adjudicated phantom rate is ≈ 0 (0.31%, 3 of 972 citations across 39 merged plans) — this closes acceptable-as-is, with the number.
Why no Phase B:
/exec, not the 20–30-minute blast radius the problem statement feared. Zero of ~700 path citations were phantoms; the cheap, reliable half of a gate would have nothing to catch.What ships and what's parked:
e9a1a8a4):scripts/spec/ground-check.tsas an on-demand tool (now pinningresolvedShaper @zeweihan's shelf-life point, so drift detection is in the schema if a gate is ever wired) andscripts/spec/measure-corpus.tsas the re-measurement instrument. AC-1, AC-2, AC-3, AC-4 done; AC-8 satisfied by this report (Phase A needs no CHANGELOG entry).Reopen trigger: if spec prompts, models, or plan style change materially,
npx tsx scripts/spec/measure-corpus.ts --limit 45reproduces this measurement in one command — compare against 0.31% / 51.6% and revisit with numbers, not intuition.Known limits, restated so the close doesn't overclaim: this is an existence score over the checkable half of plan claims. Misattribution (real path, wrong description) is unmeasured and out of deterministic reach; 48.4% of claim lines carry no extractable citation.
The dead explorer fan-out that re-aimed this issue remains tracked separately in #927.
admarble commentedon Aug 10, 2026
Revised Phase A numbers after the gap-closing pass
Three instrument defects were making the measurement report its own errors as plan defects. Fixed in PR #928; re-measured over the same 39 merged plan comments / 972 citations.
Adjudicated hallucinations stayed at 3 throughout. The fixes removed noise, not signal — which is the reassuring outcome: the headline finding was not an artifact of a sloppy extractor.
What changed in the instrument:
git check-ignorereplaces a barefs.existsSyncas the untracked-path signal. The filesystem check made the number checkout-dependent — a fresh worktree has nodist/or.sequant/state.json, so it scored as phantoms what a built checkout resolves. A gitignore match is checkout- and history-independent. This alone moved 11 citations.../worktrees/) are out of scope rather than phantom, compared on the resolved path rather than by looking for".."in the string.origin/,fix/,./) no longer parse as directory citations.The recommendation is unchanged
Close as acceptable-as-is per AC-3. At ~4.7:1 the ratio is better than the 8:1 I first reported, but still four-plus false flags per true one — and the three true positives remain low-cost to catch downstream (
executeIssueis contradicted the moment anyone opensbatch-executor.ts). Coverage is unchanged at 51.6%, so the caveat that half of all claim lines were never checkable still stands.Also closed in this pass
Repo-level gaps found while measuring, none of them #922's doing but all in its blast radius:
scripts/was neither typechecked nor linted.tsconfig.jsoncoverssrc/+bin/;lintraneslint src/ bin/. Every CLI/qaand/specshell out to was unguarded. Now covered bytsconfig.scripts.json+typecheck:scripts(wired into CI) and an extended lint scope — which immediately surfaced 11 real problems, all fixed.vitest run --project <name>never worked. Vitest 4 reads a projectnameonly from inside itstestblock; as a sibling it is silently ignored and the filter fails with "No projects matched" — which reads like a typo, not a config defect. The fix(test): tsx-spawning integration tests blow vitest's 5s default — phase-registry should use the prebuilt dist like its five siblings #842 unit/integration split had been unverifiable from the CLI since it landed. Now verified: 42 unit, 6 integration for these scripts.resolvedSha(the shelf-life half of @zeweihan's provenance point) landed separately as the Phase-A-safe slice — the checker now emits which commit it ran against, so a stale confirmation is detectable without any gate being wired.Phase B remains not started, per AC-3. Say the word if you'd rather I build the symbol-only advisory variant anyway.
admarble commentedon Aug 10, 2026
Closing — AC-3 resolved against the gate, on the data
Phase A shipped in #928 (
e9a1a8a4), with a follow-up in #930 (93a7483c). Closing per AC-3's own terms.The number
Over 39 merged plan comments / 972 citations, each checked at the commit contemporaneous with the comment and again at HEAD:
Three real confabulations, all symbols, none paths:
executeIssue— invented independently by two plans (fix(run): exec that leaves work uncommitted reports success and the run passes with no PR — #534's empty-branch escape, reopened via a new route #879, feat(run): --ready-gate — run the post-QA ready gate insidesequant run(automates the any-gaps/fix-gaps second look, stops at human merge) #817), each giving concrete edit instructions for it. The real function isexecuteBatch.finalizePhaseLog(fix(cli): post-run SUMMARY duration sums per-issue times instead of wall clock — 4-issue parallel run reported 1h 12m for 36m 18s #867) — cited with a fabricated line number beside the realfinalizeRunLog.Why close rather than build Phase B
Not "no signal" — signal too dilute to survive being read. 3 true positives against 14 residual false flags is ~4.7:1. #608 measured the last two always-on LLM gap sections at a 0% action rate; a gate that cries wolf four times per real catch is how that outcome is reached. All three hallucinations are also cheap to catch downstream:
executeIssueis contradicted the moment anyone opensbatch-executor.ts.And a path-only gate — the cheap, reliable half — would have caught nothing: 0 phantoms across ~700 path citations.
Two limits on this number, stated plainly
What survives
scripts/spec/ground-check.ts— on-demand, offline, read-only, always exits 0. Now also pinsresolvedSha, the shelf-life half of @zeweihan's provenance point, so a stale confirmation is detectable without any gate wired.scripts/spec/measure-corpus.ts— re-run withnpx tsx scripts/spec/measure-corpus.ts --limit 45to revisit this decision against a comparable number rather than an intuition.Also closed along the way
sequant-explorerhas 0 spawns across 1,332 transcripts, so the original premise (explorers feed plans) was false and the original AC-2 corpus was empty. Still open, tracked separately.scripts/was neither typechecked nor linted — every CLI/qaand/specshell out to was unguarded. Now covered bytsconfig.scripts.json+typecheck:scripts(in CI) and an extended lint scope, which surfaced 11 real problems. fix(lint): exclude gitignored scripts/dev from the widened lint/typecheck scope #930 then excluded gitignoredscripts/dev/, which had made lint fail locally while passing CI.vitest run --project <name>never worked — vitest 4 reads a projectnameonly from inside itstestblock. The fix(test): tsx-spawning integration tests blow vitest's 5s default — phase-registry should use the prebuilt dist like its five siblings #842 unit/integration split had been unverifiable from the CLI since it landed.If the decision should be revisited
The one variant still worth considering is a symbol-only, advisory check — no gate, no quarantine, just a line listing unresolved symbols. Symbols are where all 3 true positives were and where the path half contributed nothing. I'd want a second measurement first, since the residual noise is concentrated in symbol extraction.