Skip to content

ledger-signals: extend duplicateDirections to see still-open PRs - #33

Draft
ruvnet wants to merge 3 commits into
mainfrom
dream/2026-08-26-ledger-signals
Draft

ledger-signals: extend duplicateDirections to see still-open PRs#33
ruvnet wants to merge 3 commits into
mainfrom
dream/2026-08-26-ledger-signals

Conversation

@ruvnet

@ruvnet ruvnet commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Nightly Dream Cycle, 2026-08-26. DEEP=ledger-signals, SCAN=witness,verify. Full report: docs/dream-cycle/2026-08-26-ledger-signals-report.md. Issue: #32.

Hypothesis

Given duplicateDirections only scans ledger rows already merged into LEDGER.md on main, when learningSignals() gains an optional pendingFindings: string[] parameter folded into the same first-6-word normalization/counting pipeline already used for merged rows, then a direction repeated across merged rows + still-open PRs' findings (>= 3 combined) should be flagged — while the default (omitted) path stays byte-identical. Frozen before implementation.

Candidate

+130/-9 across 5 files (1 new report, 4 edits: packages/ledger/src/index.ts + its tests, packages/cli/src/index.ts + its tests). One conceptual change: an additive pendingFindings option on learningSignals() + a --pending "f1|f2" CLI flag on ledger signals. No removal, no behavior change when the option/flag is omitted.

Evaluation Receipt

Real evaluator: npm test (vitest, this repo's own bench entrypoint).

Baseline (parent, commit 074fd1f) Candidate
Tests 96 104 (+8, 0 removed, 0 modified)
Result 96 passed 104 passed

Baseline reconfirmed via git stash immediately before finalizing (96/96, exact match). Live receipt:

$ node packages/cli/dist/bin.js ledger signals --path /tmp/synthetic-ledger.md
{ "duplicateDirections": [], ... }   # 1 merged row only, below threshold

$ node packages/cli/dist/bin.js ledger signals --path /tmp/synthetic-ledger.md \
    --pending "zero merge streak signal ignores real pr merge state (cli --merged flag night)|zero merge streak signal ignores real pr merge state (tonight's near-duplicate before catching #15/#27)"
{ "duplicateDirections": ["zero merge streak signal ignores real"], ... }

Baseline

Parent commit 074fd1fe6ceac4bebc993be6b6b0f0f69cc750f5, 96/96 tests passing, clean build (npm ci && npm run build, no wasm/NAPI packages in this workspace).

Darwin Lineage

Not run — DARWIN=not-applicable. Small, pure, deterministic string-processing change; no evolvable population. Same judgment as the 2026-08-13/2026-08-24 precedents.

Evidence

Confirmed live via GitHub MCP tonight: LEDGER.md on main has 1 row while GitHub has 9 open, unmerged dream-cycle draft PRs (#15, #17, #19, #21, #23, #24, #27, #29, #30), 0 merged since #7/#13. PR #15 (2026-08-16) and PR #27 (2026-08-24) independently propose closely related fixes for the same zeroMergeStreak-can't-see-real-merges defect — a real, demonstrated duplicate-direction case the existing detector cannot see, because neither finding ever landed in LEDGER.md.

Honesty correction (post-critique): the draft report initially implied this candidate "would have caught #15 vs #27." Verified directly (directionKey on the real title text) that it would not — their real titles don't share a 6-word lexical prefix. The candidate extends recall (pending findings become visible to the same detector), not the detector's underlying matching precision, which is a known, pre-existing limitation unchanged by this PR. See the full report for the corrected, honest framing.

Reward-Hack Check

Independent critic: a fresh subagent (Agent tool, no access to this candidate's authoring context) reviewed the diff adversarially. Initial verdict: BLOCKED on two findings:

  1. parsePendingFindings split on , — the real motivating PR developer-experience: thread real merge state into zero-merge learning signal (cli, tui) #27 title contains a comma and would fracture into a bogus extra finding. Not covered by the original tests. Fixed: delimiter switched to | (matches LEDGER.md's own field separator), regression test added.
  2. The draft report overstated that this candidate "would have caught ledger-signals: derive zeroMergeStreak from Prior-night fates tokens #15 vs developer-experience: thread real merge state into zero-merge learning signal (cli, tui) #27." Fixed: report corrected to the honest, narrower claim (see Evidence above).

Both fixes verified: rebuilt, reran npm test (104/104, 0 regressions), re-ran parsePendingFindings against the real PR #27 title to confirm the comma is preserved. Re-reviewed after fixes: CLEAR. No pre-existing test weakened/removed; default path verified byte-identical via a dedicated regression test; no new I/O/network/shell-exec/credential surface; no threshold/gate/safety constant touched; scope limited to the 4 intended source+test files.

Security Review

Pure string parsing (parsePendingFindings, directionKey, bumpDirection) — no eval, no shell interpolation, no external I/O, no LLM calls. --pending's input is always caller-supplied, never attacker-controllable runtime input.

Regression Analysis

0 pre-existing tests modified or removed. All 96 baseline tests still pass unchanged; 8 new tests added (3 in packages/ledger, 5 in packages/cli, including the post-critique comma-preservation regression test).

ADR

None — additive, opt-in extension to an existing, already-tested signal-computation function, not a new architectural decision. Same judgment as the PR #15/#27 precedents for adjacent changes.

Gist

No gh gist create / gh CLI available in this environment. Report committed at docs/dream-cycle/2026-08-26-ledger-signals-report.md instead. GIST=LOCAL.

Issue

#32

Witness

report_sha256 : c75b4a90f6ddab5ab26d0d547e36be1455916f748c559681c48fe130367f43fc
session_commit: 074fd1fe6ceac4bebc993be6b6b0f0f69cc750f5
witness       : 7bf7a1d1c628430d4a91860a8df4ca0e569b1f4c4007e49e790f996cf23619dc

Verify: sha256sum docs/dream-cycle/2026-08-26-ledger-signals-report.md, then printf '%s%s' "<that hash>" "074fd1fe6ceac4bebc993be6b6b0f0f69cc750f5" | sha256sum must equal the witness above. Confirmed tonight via dream-machine witness verify (✓ VALID).

Merge Policy

Draft — human review required. This PR does not carry the automerge-safe label: it modifies a decision-support signal (duplicateDirections) that future nights' STEP 1.1 relies on, which is exactly the low-confidence-blast-radius case this repo's guarded-auto-merge policy (.github/workflows/automerge.yml) keeps human-review-only. The session never applies that label itself and never merges.

Also flagged for human triage, not fixed by this PR: 9 dream-cycle draft PRs are open and unmerged (#15, #17, #19, #21, #23, #24, #27, #29, #30). This candidate makes the symptom (undetected duplicate directions) more visible for a future night that wires --pending in, but the actual fix — merging or closing the backlog — is a human decision outside any single nightly candidate's scope.


Generated by Claude Code

claude added 3 commits August 26, 2026 09:21
learningSignals()'s duplicateDirections only scanned rows already merged
into LEDGER.md, so a direction repeated across several still-open draft
PRs (demonstrated live tonight: PR #15 and PR #27, both unmerged, both
targeting the same zeroMergeStreak defect) went undetected. Add an
opt-in pendingFindings option folded into the same normalization/count
pipeline, plus a --pending CLI flag on `ledger signals`, so a future
night can feed in open-PR findings and get the same detector to see
them. Default (omitted) behavior is unchanged.

Nightly Dream Cycle, 2026-08-26. DEEP=ledger-signals, SCAN=witness,verify.
Full report: docs/dream-cycle/2026-08-26-ledger-signals-report.md
Issue: #32

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

main advanced with PR #24 (cron floor fix) plus portfolio-wide ledger
rows (2026-08-22..2026-08-26) appended by a separate cross-repo process.
Resolved by keeping all of main's rows and appending this branch's
2026-08-26 ledger-signals row after them (append-only log, no row
content changed). Rebuilt, relinted, and reran the full suite after the
merge: 106/106 passing, 0 regressions.

Note: `dream-machine ledger verify` reports 9 schema errors, all in the
pre-existing portfolio rows (2026-08-22 through 2026-08-26 "portfolio
31x") that use compound verdicts ("ACCEPT / INCONCLUSIVE") and
evaluated="partial", neither valid per this repo's own Verdict/Evaluated
enums. Confirmed these errors exist on origin/main by itself, before
this merge — not introduced by this PR, and this branch's own new row
is schema-valid. Left untouched: out of this PR's scope to rewrite
another process's committed ledger rows.

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

ruvnet commented Aug 26, 2026

Copy link
Copy Markdown
Owner Author

Resolved a merge conflict against main (which advanced with PR #24 + several "portfolio 30x" ledger rows from a separate cross-repo process) by keeping all of main's rows and appending this branch's 2026-08-26 row after them — no row content changed, append-only. Rebuilt, relinted, and reran the full suite post-merge: 106/106 passing, 0 regressions.

Side observation while re-verifying: dream-machine ledger verify reports 9 schema errors, all in the pre-existing "portfolio 308–311" rows (2026-08-22 through 2026-08-26), which use compound verdicts (e.g. ACCEPT / INCONCLUSIVE) and evaluated: partial — neither valid per this repo's own Verdict/Evaluated enums (packages/ledger/src/index.ts). Confirmed this already fails on origin/main by itself, before this merge — not introduced by this PR, and this branch's own new row is schema-valid. Left untouched; out of this PR's scope to rewrite another process's committed ledger rows, flagging for maintainer awareness.


Generated by Claude Code

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