Skip to content

ledger-signals: add reviewBacklogSize (open, unmerged candidate PR count) - #109

Draft
ruvnet wants to merge 2 commits into
mainfrom
dream/2026-09-11-ledger-signals
Draft

ledger-signals: add reviewBacklogSize (open, unmerged candidate PR count)#109
ruvnet wants to merge 2 commits into
mainfrom
dream/2026-09-11-ledger-signals

Conversation

@ruvnet

@ruvnet ruvnet commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Hypothesis

Given the Dream Machine's self-hosting nightly cycle, when a reviewBacklogSize field (nullable, caller-supplied open-candidate-PR count) is added to learningSignals()'s output, then a night or human reading ledger signals/tui output gains direct visibility into review-queue depth, subject to: (a) zero change to any existing signal's value when the new option is omitted, (b) no change to learningSignals()'s purity (still no I/O — caller supplies the count, same as mergedPrNumbers), and (c) full test coverage at both the library and CLI layer.

Candidate

zeroMergeStreak (boolean) can't distinguish "nothing proposed lately" from "N candidates open and unreviewed" — both read the same. Live tonight: 5 open, unmerged dream/* PRs (#105, #103, #101, #100, #98), 0 merged since #24 (2026-08-26), matching 16+ consecutive zeroMergeStreak=true nights in LEDGER.md.

  • packages/ledger/src/index.ts: SignalOptions.openCandidateCount?: numberLearningSignals.reviewBacklogSize: number | null (default null, purely additive).
  • packages/cli/src/index.ts: --open-count N on ledger signals and tui, same fail-closed parsing discipline as the existing --merged flag (value-less/non-numeric → usage error, not NaN/crash).
  • packages/cli/src/tui.ts: ⚠ N candidate PR(s) open, unreviewed footer line when reviewBacklogSize > 0.

<300 changed lines, one conceptual change. No ADR — this is a parameter/feature addition, not an architectural decision (per STEP 19's own "never for parameter changes" guidance).

Evaluation Receipt

Real evaluator (npm test = vitest + governance), same corpus, parent then candidate:

Baseline (3edd426):  616/616 vitest + 81/81 governance
Candidate:            627/627 vitest (+11 net new, 0 regressions) + 81/81 governance
typecheck: clean · lint: clean

Live end-to-end against the real ledger:

$ node packages/cli/dist/bin.js ledger signals --path docs/dream-cycle/LEDGER.md --open-count 5
...
"reviewBacklogSize": 5

Every other field matches the --open-count-less run exactly (live check + dedicated unit test asserting structural equality modulo the new field).

Baseline

Parent commit 3edd426f6c9c4b1e80235f7447dc863e749345cc, unmodified, same evaluator/corpus as above.

Darwin Lineage

Not run — unrelated surface, and evaluatorEntrypoints.darwin (unpinned npx @metaharness/darwin) is already independently flagged as live-but-buggy (2026-09-07 ledger row). Deliberately skipped rather than adding supply-chain exposure for no evidentiary value.

Evidence

  • OBSERVATION: 5 open dream/* PRs at session start, 0 merged since fix(compile): enforce documented hourly cron floor #24.
  • MEASUREMENT: test deltas above; reviewBacklogSize echo verified live + unit.
  • INFERENCE (non-causal): the backlog-depth visibility gap plausibly compounded 16+ nights of undifferentiated "bias small" signal — merge decisions are outside this session's visibility, so no causal claim.

Reward-Hack Check

No test/threshold/gold-data change; 11 new tests added, 0 existing tests modified; field is informational-only (no gating logic); no ledger-schema change.

Security Review

No new I/O/filesystem/network/credential surface. --open-count is a bounded, fail-closed non-negative-integer parser, same shape as the existing --merged flag.

Regression Analysis

627/627 vitest (was 616/616) + 81/81 governance (unchanged) + clean typecheck/lint. All 11 new tests are additive; no existing test was touched.

ADR

None — parameter/feature addition, not an architectural decision.

Gist

GIST=LOCAL (no gh binary, no gist-creation MCP tool this session — not FALLBACK, GitHub API access worked throughout). Full report: docs/dream-cycle/2026-09-11-ledger-signals-report.md.

Issue

#108

Witness

SESSION_COMMIT=3edd426f6c9c4b1e80235f7447dc863e749345cc
REPORT_HASH=3bc41c0504f4d605227271a363a3f8d4124a4cab55b17d76ce342afbff0eb75e (sha256 of docs/dream-cycle/2026-09-11-ledger-signals-report.md as committed)
WITNESS=9e293048cfc60d2bdf7e466a08a67af2591477fe95acc8b1bf3c6c40b4a6633b

Reproduce:

REPORT_HASH=$(sha256sum docs/dream-cycle/2026-09-11-ledger-signals-report.md | awk '{print $1}')
printf '%s%s' "$REPORT_HASH" "3edd426f6c9c4b1e80235f7447dc863e749345cc" | sha256sum | awk '{print $1}'
# must equal 9e293048cfc60d2bdf7e466a08a67af2591477fe95acc8b1bf3c6c40b4a6633b

Merge Policy

Human review required. The session never self-merges and never autonomously promotes candidate state. dream.config.json's autoMerge: false; the repo's automerge.yml is a guard-only check now (no merge authority), so this PR waits on a human regardless.


🤖 Generated with Claude Code

https://claude.ai/code/session_01MCVdVup9eCLe8mdKc2LoSq


Generated by Claude Code

…unt)

zeroMergeStreak (boolean) cannot distinguish "nothing proposed lately" from
"N candidates open and unreviewed" -- both read the same. Live check tonight:
5 open dream/* PRs (#105, #103, #101, #100, #98), 0 merged since #24
(2026-08-26), matching 16+ consecutive zeroMergeStreak=true nights in
LEDGER.md. Add an optional, caller-supplied openCandidateCount ->
reviewBacklogSize (nullable number, default null) to learningSignals(),
wired through `ledger signals --open-count N` and `tui --open-count N`,
same fail-closed flag parsing as the existing --merged. Purely additive:
every other signal is unchanged when the option is omitted (asserted
directly in tests).

See docs/dream-cycle/2026-09-11-ledger-signals-report.md for the full
evidence, evaluation receipt, and competitor analysis.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MCVdVup9eCLe8mdKc2LoSq
Issue #108, PR #109. See docs/dream-cycle/2026-09-11-ledger-signals-report.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MCVdVup9eCLe8mdKc2LoSq
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