Skip to content

routine-self-review: cap consecutive CONSOLIDATE nights (closes #203) - #204

Draft
ruvnet wants to merge 2 commits into
mainfrom
dream/2026-11-05-routine-self-review
Draft

ruvnet wants to merge 2 commits into
mainfrom
dream/2026-11-05-routine-self-review

Conversation

@ruvnet

@ruvnet ruvnet commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Closes #203.

Hypothesis (frozen before implementation)

Given a run of consecutive non-self-review nights that all resolve to CONSOLIDATE because the review backlog stays over the limit with an eligible draft always available, when a CONSOLIDATE_STREAK cap (7 nights) is added to CONSOLIDATE's entry condition, forcing RESEARCH-ONLY once the cap is reached even with an eligible draft still waiting, then new research resumes within a bounded number of nights regardless of how long the human review backlog takes to clear, with zero regression in the test suite or any compiled target's golden snapshot.

Candidate

packages/compile/src/v2.ts:

  • Added export const CONSOLIDATE_STREAK_CAP = 7.
  • v2ModeSelection(): added a CONSOLIDATE_STREAK measurement instruction (consecutive non-routine-self-review nights with neither a new <branchPrefix><DATE>-<surface> branch nor a new [Dream Cycle <DATE>] issue — i.e. nights whose only visible action was CONSOLIDATE's refresh-and-comment); added AND CONSOLIDATE_STREAK < 7 to CONSOLIDATE's entry condition; added OR CONSOLIDATE_STREAK >= 7 to RESEARCH-ONLY's entry condition (so a backlog a human hasn't cleared no longer withholds research indefinitely); added CONSOLIDATE_STREAK to the printed MODE line.

packages/compile/src/index.ts: re-exported CONSOLIDATE_STREAK_CAP.

Does not touch implementationTrack.reviewBacklogLimit or selfReview.everyDays (both explicitly off-limits to self-review, per ROUTINE_CONSTITUTION), CONSOLIDATE's never-merge/never-close/never-force-push limits, the independent critic/reward-hack checks, any evaluator entrypoint, witness computation, or ledger schema.

Evaluation Receipt

Real evaluator: npm test (vitest run && node --test scripts/*.test.mjs).

Baseline (3fc3222d, parent, post-unshallow) Candidate
vitest 886 887 (+1 new, 0 regressions)
governance 195 195 (unchanged)
lint / typecheck clean clean
mirror check (compile-targets.mjs --check) pass pass (all 5 targets regenerated + reviewed)

Self-hosted dream.config.json compile output confirmed byte-identical to its regenerated mirror. All 5 targets sharing this compile engine (self-hosted + ruflo/metaharness/ruvector/ruclip) had their mirrors regenerated — same clause, no per-target parameter.

Baseline

Parent commit 3fc3222d2e5566a203331d3686c4d2eaf06713a8 (main), this session's own checkout (unshallowed to resolve the same already-tracked environmental governance-test failure as PR #202/#150).

Darwin Lineage

DARWIN=not-applicable — a MODE-selection threshold/prose fix has no evolvable population or fitness function.

Evidence

OBSERVATION: main unchanged at 3fc3222d since PR #196 (2026-10-19). OBSERVATION: 21 open dream/* PRs, 0 new ones since PR #194 (2026-10-18) — 16 non-self-review nights, all CONSOLIDATE. OBSERVATION: 6 of those nights independently confirmed via PR comments on #161/#180/#182/#184/#189/#192 (2026-10-30→11-04), each a real merge-main-in + fresh critic + marker. INFERENCE: this pattern can recur indefinitely because CONSOLIDATE's condition depends only on backlog size and eligibility, both chronically satisfied. DECISION: cap the streak rather than the limit itself. Full report with the scored prior forecast: docs/dream-cycle/2026-11-05-routine-self-review-report.md.

Reward-Hack Check

Independent critic dispatched (separate-context subagent, no authorship stake, given only the diff, ROUTINE_CONSTITUTION, and told to attack it against the off-limits list, test vacuity, and specification ambiguity): CLEAR. It independently re-ran npm run build -w packages/compile, vitest run on the three affected test files (181 passed), lint, typecheck, and compile-targets.mjs --check (all green); confirmed the CONSOLIDATE_STREAK "new branch OR new issue" discriminator is exhaustive against the real STEP numbering (RESEARCH-ONLY always files an issue per STEPS 15–18; IMPLEMENT/RESEARCH file both; only CONSOLIDATE does neither); confirmed the new test is not vacuous. Two disclosed non-blocking nitpicks: the given live-check command is open-PR-only (an under-count biases toward more research, not toward dodging the cap — not mission-defeating); and the cap value (7) is defensible but a round choice. No test weakened, no benchmark/threshold/gold data touched; one test added, none removed.

Security Review

Compiled-instructions-only change; no new tool, permission, credential, or network call. Reduces a resource/availability risk (new research silently withheld indefinitely while a human-only-clearable backlog persists) rather than introducing one.

Regression Analysis

11 files changed: 2 logic files (v2.ts new constant + template text, index.ts re-export), 1 test file (+1 test block), 2 generated snapshot files, 5 mechanically-regenerated compiled mirrors, 1 new report file. 887 vitest + 195 governance pass; lint/typecheck clean; mirror check clean. No GLOBAL INVARIANT, verdict rule, promotion gate, merge policy, CONSOLIDATE limit, critic/reward-hack check, evaluator entrypoint, witness computation, ledger schema, reviewBacklogLimit/everyDays, research floor, or config-validation/golden-snapshot test touched in substance — confirmed by diff review and the independent critic, as required by the self-review constitution (ADR-0011).

ADR

None — a MODE-selection threshold/prose fix to the routine's own compiled template, not an architectural decision.

Gist

GIST=LOCAL — no gh CLI (GH_TOKEN invalid this session), no gist MCP tool. Full report committed in this PR.

Issue

#203

Witness

Self-verified via dream-machine witness verify-report (canonical-exclusion scheme) — VALID, bound to session commit 3fc3222d2e5566a203331d3686c4d2eaf06713a8. Triple is in the report's own ## Witness section.

Merge Policy

This PR stays draft, regardless of verdict. Per STEP 1.6/ADR-0011's routine constitution: "A self-review PR always stays human-review-only, whatever prMode says." This session never merges and never autonomously promotes candidate state.


Generated by Claude Code

STEP 1.5's CONSOLIDATE entry condition (backlog over
implementationTrack.reviewBacklogLimit AND at least one eligible draft) has
no time bound: with 21 open dream/* PRs and main unchanged since 2026-10-19
(PR #196), every non-self-review night since has resolved to CONSOLIDATE,
skipping STEPS 2-9 and 17-24 for 16 consecutive nights with zero new
research. Only a human merge can ever clear the backlog below the limit,
something this routine's own merge policy forbids it from doing itself, so
the lock has no built-in exit.

Add CONSOLIDATE_STREAK_CAP (7 consecutive non-self-review nights). Past the
cap, MODE forces RESEARCH-ONLY even with an eligible draft still waiting, so
new findings keep arriving regardless of how long the backlog takes to
clear. Does not touch reviewBacklogLimit or selfReview.everyDays (both
off-limits to self-review), CONSOLIDATE's never-merge/close/force-push
limits, or any evaluator/witness/ledger-schema code.

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

ruvnet commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

CI red, not this PR's: dependency-audit (full dev-toolchain npm audit --audit-level=high) fails on the current head (6568339) with 15 findings (14 moderate, 1 high — vite@8.3.0-8.3.2→launch-editor advisory family, plus an eslint/@typescript-eslint toolchain cluster).

This PR's diff never touches package.json/package-lock.json — git diff origin/main -- package.json package-lock.json is empty, so the lockfile is byte-identical to main's. Reproduced locally: npm ci && npm audit --audit-level=high fails identically. Same pre-existing, already-tracked dev-toolchain advisory family as issue #37 (open since 2026-08-27) and issue #197 (opened 2026-10-21), hit by every recent PR sharing this lockfile (#189, #192, among others) — no fix PR exists yet to port (the real fix is a Vitest/Vite/eslint major-version bump, out of scope for this MODE-selection-template fix).

Production-reachable scope (dependency-security, npm audit --omit=dev) is unaffected by this — these are dev-only findings. All other jobs on this head are green or still in progress (test (22), no-optional-deps, CodeQL, Human merge policy guard all passed). Not re-running the job — this is a deterministic advisory-database finding against an unchanged lockfile, not a flake.


Generated by Claude Code

This branch has not been deployed

No deployments
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.

[Dream Cycle 2026-11-05] routine-self-review: CONSOLIDATE has no exit while the review backlog never clears (16 nights, 0 new findings since 2026-10-19)

2 participants