Skip to content

Dream Cycle 2026-09-18: grounding-quality — recover PR #239's provenance/receipt fix - #297

Draft
stuinfla wants to merge 8 commits into
mainfrom
dream/2026-09-18-grounding-quality-provenance-receipt
Draft

stuinfla wants to merge 8 commits into
mainfrom
dream/2026-09-18-grounding-quality-provenance-receipt

Conversation

@stuinfla

Copy link
Copy Markdown
Owner

Dream Cycle 2026-09-18 — DEEP=grounding-quality, SCAN=retrieval-precision,citation-binding (slot 3 of 5, 20260918 % 5 == 3). Full report: docs/dream-cycle/2026-09-18-grounding-quality-report.md.

Read this first — the backlog. Zero dream/* PRs have merged since #178 (2026-08-26): a bulk-close on 2026-09-07 closed 20 without merging, and 16 more opened since (through 2026-09-17) with none merged either — roughly 36 candidate PRs, zero integrated, 23 days running. This is not this candidate's problem to fix, but it is the single highest-value thing for the human owner to look at, ahead of any individual finding tonight (this one included). See the report's Recommendation section.

Hypothesis

Given the frozen provenance stratum in scripts/eval-brain.mjs's gradeQuestion(), when the "did a winning gist chunk carry its banner" check is computed from routedRepo (receipt?.repo ?? top?.repo ?? null, the same signal already used for routed) instead of the raw top-ranked citation (citations[0].repo), then the provenance stratum should correctly fail a bannerless gist chunk that verify-citation.mjs actually verified as the grounding source, even when a different, unverified citation happens to rank first — subject to: zero behavior change for grounded/routed/abstained, ABSTAIN_CE unchanged, evals/held-out.json hash unchanged, and the two receipt-less callers of gradeQuestion behaviorally unaffected.

Frozen before touching any file. Not modified since.

Candidate

Recovers PR #239 (2026-09-03), closed unmerged in the 2026-09-07 bulk-close and never integrated — re-verified against current main rather than reapplied blindly (independently confirmed the gap is still live by reading current source before writing anything). scripts/eval-brain.mjs: provenance case now reads routedRepo !== 'ruv-gists' instead of top?.repo !== 'ruv-gists'. tests/unit/eval-brain-gate.test.mjs: one new it() covering both directions. New evidence script: docs/dream-cycle/evidence/2026-09-18-grounding-quality-repro.mjs. 2 production/test files changed, ~34 lines.

Evaluation Receipt

  • npm run eval:gate: EVALUATED=blocked — no local corpus (stores 0 dark 0, never materialized on this host — not evidence of a wipe).
  • LLM_EVAL=blocked: no model-provider key in this container.
  • TEETH, independently reproduced twice (this session + an adversarial critic subagent): reverting only the scripts/eval-brain.mjs hunk turns the new test red (1 failed | 17 passed); restoring it is green (18/18).
  • Evidence script: exit 1 "VULNERABLE" against unmodified main, exit 0 "FIXED" against the candidate.
  • npm run claims:verify: 3 verified, 4 unmeasured (standard composition).

Baseline

Unmodified origin/main at 3996f502b18157fdc84e325fbe87c2a05351d58c, isolated via a separate git worktree (not this branch's working tree) to avoid contaminating the comparison with this branch's own already-committed report/evidence files.

Darwin Lineage

Not run — no continuous parameter to evolve for a scoring-attribution fix.

Evidence

OBSERVATION (gradeQuestion's provenance case read top?.repo directly, ignoring the receipt the same function already computes and already uses for routed) → MEASUREMENT (TEETH red pre-fix / green post-fix, reproduced independently twice) → INFERENCE (blast radius confined to the one call site that passes receipt) → DECISION (ACCEPT, pending human review).

Reward-Hack Check

CLEAR on all axes — see report's Reward-Hack Check section for the full breakdown (held-out set untouched, no vacuous assertions, no hidden cost, no cherry-picking, fix is bidirectionally corrective so it cannot be a one-directional score inflator).

Adversarial Critique

Independent general-purpose subagent, no access to this session's reasoning. Verdict: CLEAR. Independently confirmed the held-out set untouched, the 3-call-site blast radius, worked through the substitution's correctness algebraically in both directions with no leniency-loophole found, and empirically reverted/restored the fix to confirm the test is not vacuous. One non-blocking observation (pre-existing, unrelated to this diff): bannerPresent's regex is not scoped to the specific receipted citation.

Security Review

Pure, offline scoring-logic change inside an evaluation script consuming only this repo's own already-generated subprocess output and its own frozen held-out set. No new network call, credential, write path, or untrusted-input path.

Regression Analysis

test:integration (49 files/400 tests): byte-identical baseline vs candidate, same 9 pre-existing failing files both sides. test:unit (448 files/5617→5618 tests): baseline 13 failed files/40 failed tests, candidate 14 failed files/41 failed tests. The one delta, advocacy-claim.test.mjs, is a confirmed pre-existing flake independent of this diff — reproduced failing nondeterministically on the untouched baseline worktree too (3/3 fails in one run there, vs 1 pass/2 fail on the candidate in another run) — a claimOffer(..., { dir: '/nonexistent-root/...' }) mkdir-under-root timing issue in advocacy-claim.mjs itself, unrelated to the changed files. Net: the +1 test count is exactly the one new assertion this diff adds; the failure delta is fully accounted for by a diff-independent flake, not a regression. Full detail and both raw logs' failing-file lists in the report.

ADR

Not architectural — a bug-fix recovery mirroring an already-accepted sibling fix (routed's own use of receipt). No ADR filed, consistent with the original sibling fix's own precedent.

Gist

LOCAL — no gh CLI and no gist-creation MCP tool available this session (same limitation every prior Dream Cycle night on this repo has recorded). Full report committed at docs/dream-cycle/2026-09-18-grounding-quality-report.md.

Issue

NONE — per this repo's ISSUE DISPOSITION OVERRIDE, this is a verified-fix recovery of an already-closed, already-tested PR (#239), not a new defect.

Witness

SESSION_COMMIT = 3996f502b18157fdc84e325fbe87c2a05351d58c
REPORT_HASH    = 982460e88d704ebf6bf66e94744cfbefcf72a2af404e974b45a39a7c07e51460
WITNESS        = 7c48fc9cba00d0b1ec6dc4ac401371785991b84d1250502f437f3d770edb7b9a

Full verifier procedure in the report's own Witness section.

Merge Policy

Human review required. This session never self-merges and never autonomously promotes candidate state. Draft, by design.


🤖 Generated with Claude Code

https://claude.ai/code/session_01Gp2yaKTwQNjH8gCpzjqvtM


Generated by Claude Code

…eport

Evidence repro reproduces, on unmodified main, the gap PR #239 (2026-09-03,
closed unmerged) found and never got integrated: gradeQuestion()'s
provenance-stratum check grades off citations[0] instead of the receipt
verify-citation.mjs actually resolved. Report and convergence manifest
regenerated to track the new files. The candidate fix itself follows in the
next commit once the baseline regression comparison currently running
completes (kept separate so evaluation numbers are never asserted before
they exist).
…, not raw citations[0]

gradeQuestion()'s provenance-stratum check ("did a winning gist chunk carry
its banner") read citations[0].repo directly. verifyGrounding() already
computes routedRepo (receipt?.repo ?? top?.repo ?? null) for the routed
metric's own use — the citation verify-citation.mjs actually verified on
disk, which can rank below an unresolved/fabricated top citation. The
provenance branch never used it, so a fabricated top citation naming a
non-gist repo could mask a real, bannerless gist win underneath it (a false
pass), or a fabricated top citation naming ruv-gists could wrongly fail a
genuine better-repo hit (a false fail). Recovers the fix from PR #239
(2026-09-03), closed unmerged in the 2026-09-07 bulk-close and never
integrated — re-verified against current main rather than reapplied blindly.

Blast radius: gradeQuestion has exactly 3 call sites. The other two
(scripts/rerank-cap-eval.mjs, scripts/rerank-cap-warm-ab.mjs) never pass
receipt, so routedRepo falls back to the prior top?.repo behavior for both —
zero change. Independently re-verified by an adversarial critic subagent.

evals/held-out.json and evals/baseline.json untouched. npm run eval:gate
EVALUATED=blocked (no local corpus, no model-provider key) — a legitimate
night per this repo's own invariant.
@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

Deployment failed for project explainer with the following error:

Redirect at index 0 has invalid `source` pattern "^/(?!api/|metrics)(.*)$".

Learn More: https://vercel.link/invalid-route-source-pattern

@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
explainer Ready Ready Preview Sep 23, 2026 9:25am UTC
ruvnet-brain Ready Ready Preview Sep 23, 2026 9:25am UTC

Request Review

…, ledger row, witness stamp

Fills in the evaluation-receipt numbers the earlier scaffold commit left
pending: baseline-vs-candidate test:unit/test:integration comparison (run
against an isolated git worktree to avoid contaminating the baseline with
this branch's own already-committed files), the witness stamp, and the
ledger row for PR #297.

Copy link
Copy Markdown
Owner Author

CI status: Vercel – explainer is red, but not this PR's failure.

Vercel – explainer fails with Deployment failed. Redirect at index 0 has invalid \source` pattern "^/(?!api/|metrics)(.*)$"(https://vercel.link/invalid-route-source-pattern) — a raw-regex negative-lookahead inexplainer/vercel.json's redirects[0].source` that Vercel's redirect matcher (path-to-regexp, not full regex) doesn't support.

This PR never touches explainer/ (diff is scripts/eval-brain.mjs, tests/unit/eval-brain-gate.test.mjs, plus docs/dream-cycle/** and the generated data/convergence-manifest.json). explainer/vercel.json was last changed by 7d3ecf0 (part of the ADR-0086 corpus-seed pipeline work, already on main), and this exact failure reproduces identically on PR #295 (opened 2026-09-17, also unrelated to explainer/) — confirmed via get_status on both PRs, same error, same target_url. This is a pre-existing base-branch misconfiguration, not something this PR introduced or can fix without widening its scope well past tonight's grounding-quality candidate.

Deterministic config-validation error (identical on two independent commits), not a flake — a re-run would not change the outcome, so skipping it. No fix currently exists anywhere in the repo's open/closed PRs (searched). Vercel – ruvnet-brain, the actual app deployment, is green on this PR's head.


Generated by Claude Code


Generated by Claude Code

…nding-quality-provenance-receipt

# Conflicts:
#	data/convergence-manifest.json
#	scripts/eval-brain.mjs

Copy link
Copy Markdown
Owner Author

Merge conflict resolved. main advanced (3996f505f39481, ~150 commits) and picked up an independent, complementary fix to the same function: gradeQuestion()'s provenance and default cases gained an !abstained condition (a negative cross-encoder score on an answerable question is now correctly treated as a miss, not credited via an unrelated resolving citation). That change touches the same lines as this PR's routedRepo fix but doesn't overlap in effect — combined both: pass: !!grounded && !abstained && (routedRepo !== 'ruv-gists' || bannerPresent) for provenance. default merged cleanly (git auto-merged it; my diff never touched that branch).

Verified post-merge:

  • tests/unit/eval-brain-gate.test.mjs: 20/20 (18 from this PR + 2 new from main's merged-in fix).
  • Evidence script still exits 0/FIXED against the merged candidate.
  • test:integration: byte-identical failing-file set to before the merge (9 pre-existing files/23 tests).
  • test:unit: 16 failed files/50 failed tests post-merge vs. this PR's own pre-merge baseline of 13/40 — the delta is entirely new test files main added since this PR's base (adr-format, agentic-qe-early-public, candidate-retrieval-matrix, no-restated-truth), independently reproduced failing identically on a clean origin/main worktree with none of this PR's changes present — confirmed pre-existing, not a regression from this merge.
  • data/convergence-manifest.json and version:check both regenerated/green post-merge.

Also note: Vercel – explainer's redirect-pattern failure (flagged in my earlier comment) appears fixed on main by eeb073b (fix(explainer): use Vercel path-to-regexp redirect syntax) — should clear on this PR's next status refresh now that the fix is merged in.


Generated by Claude Code


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

Fully green as of head 98cfdc7: canonical-qa, qualify-development, integration all pass; Vercel – ruvnet-brain and Vercel – explainer both deployed successfully (the explainer redirect issue cleared once main's fix for it merged in); mergeable_state: clean, no conflict with current main. Nothing further pending from this side — waiting on human review.


Generated by Claude Code


Generated by Claude Code

…e-verified, no new PR

PR #297 already carries the correct, minimal, twice-critiqued fix for tonight's
slot (provenance-stratum routedRepo attribution). Independently re-confirmed
today against current main (e89ea1b): the bug is still live, the fix still
clears it, TEETH still red/green, reward-hack check still clear on all 5 axes,
and a full isolated-worktree baseline comparison shows zero regression
(test:integration byte-identical 9/23 both sides; test:unit identical 16-file
failure set). Per ISSUE DISPOSITION OVERRIDE, a duplicate PR would only pad
the already-severe dream/* backlog (25 open drafts, zero merged in 28 days),
so tonight adds evidence to this existing PR instead of opening a new one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M8RDbqitx56UmDzmZbmwY2

Copy link
Copy Markdown
Owner Author

Dream Cycle 2026-09-23 — reconciliation, no new PR. Tonight's assigned slot (grounding-quality / retrieval-precision,citation-binding) landed on this exact surface again. Rather than open a duplicate PR for the identical fix, I independently re-verified this one against today's main (e89ea1ba) and pushed the evidence here:

  • Bug still live on unmodified main today: re-ran docs/dream-cycle/evidence/2026-09-18-grounding-quality-repro.mjs against main fresh — exit 1 VULNERABLE, confirming git blame's finding that commit 12f8bf14 (2026-09-19, human-authored) landed only the sibling !abstained half of this fix, not the routedRepo half this PR carries.
  • TEETH reproduced twice independently tonight (this session + a fresh critic subagent with no shared context): revert → red (1 failed/19 passed), restore → green (20/20).
  • Reward-hack check: all 5 axes CLEAR, independently re-derived by the critic subagent (not reused from the 2026-09-18 report).
  • Regression check, isolated worktree, byte-identical results both directions:
    • test:integration: baseline and candidate both 9 failed | 38 passed | 4 skipped files, 23 failed | 323 passed tests — same 9 files exactly.
    • test:unit: baseline and candidate have the identical 16-file failure list (diffed, empty); candidate has 1 fewer failing test than baseline (net improvement, not regression).
  • Blast radius: 3 call sites confirmed by the critic; the 2 receipt-less callers verified algebraically and empirically unaffected.

Full report: docs/dream-cycle/2026-09-23-grounding-quality-reconciliation-report.md (this PR). Ledger row appended.

Also worth repeating with tonight's exact numbers: 25 open draft dream/* PRs, oldest (#269) now 15 days old, zero merged since #17828 days. This PR specifically has been fully green and current against main since 2026-09-22 and is now 5 days old with zero human review. Nothing further pending from this side — waiting on human review.


Generated by Claude Code

This branch was successfully deployed

2 active deployments
Preview – explainer 47572d2d Deployed Sep 23, 2026 by vercel[bot]
Preview – ruvnet-brain 47572d2d Deployed Sep 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants