Skip to content

fix: repair union-merge damage across ledger, cli, compile and witness - #96

Merged
ruvnet merged 1 commit into
mainfrom
fix/union-merge-damage
Sep 7, 2026
Merged

fix: repair union-merge damage across ledger, cli, compile and witness#96
ruvnet merged 1 commit into
mainfrom
fix/union-merge-damage

Conversation

@ruvnet

@ruvnet ruvnet commented Sep 7, 2026

Copy link
Copy Markdown
Owner

main is currently red. Landing the stale dream-cycle backlog required rebasing branches whose conflicts were largely additive, but a mechanical union of the hunks cut across syntactic boundaries in several spots.

Repaired

  • ledger/src/index.tspendingFindings + the interface's closing brace ended up inside daysBetween(); moved back into LearningSignalsOptions.
  • ledger/compile/cli tests — five it(...) blocks lost their closing }); at the seam between the two sides' test sets.
  • cli/src/index.test.ts — duplicated import block collapsed.
  • cli/src/index.tsledger signals emitted two JSON objects (one per flag) instead of one combined result, so JSON.parse(out) threw in all 8 signals tests. Both --merged and --pending now feed a single learningSignals() call.
  • witness/src/index.tsfeat(witness): require evidence carrying completion certificates #35's termination and feat(witness): anchored trace replay for causal failure experiments #42's trace-replay each export their own canonicalJson (TS2308). They are not interchangeable (trace-replay's has WeakSet cycle detection and takes unknown; termination's is typed to JsonValue), so trace-replay is re-exported explicitly without it rather than silently promoting either.

Verified: typecheck clean, 585/585 vitest, npm run check 80/81 — the one remaining failure is the macOS-only /tmp/private/tmp symlink case in mission.test.mjs, not exercised by this repo's Linux-only CI.

🤖 Generated with RuFlo

https://claude.ai/code/session_01Ff2xRKvYrqXJhefvcapfE1

Landing the long-stale dream-cycle backlog (#21/#29/#33/#35/#42/#46) required
rebasing branches whose conflicts were mostly additive, but a mechanical union
of the conflict hunks cut across syntactic boundaries in several places and
left main red. This repairs all of it:

- ledger/src/index.ts: `pendingFindings` and the closing brace of
  LearningSignalsOptions landed inside daysBetween()'s body; field moved back
  into the interface and the function restored.
- ledger|compile|cli test files: five `it(...)` blocks lost their closing
  `});` at the seam between the two sides' test sets.
- cli/src/index.test.ts: duplicated import block collapsed.
- cli/src/index.ts: `ledger signals` emitted TWO JSON objects (one for
  --merged, one for --pending) instead of one combined result, so
  JSON.parse(out) threw for every signals test; both option sets now feed a
  single learningSignals() call. Duplicated help entry collapsed.
- witness/src/index.ts: #35's `termination` and #42's `trace-replay` each
  export their own `canonicalJson` (TS2308). They are not interchangeable --
  trace-replay's does WeakSet cycle detection and takes `unknown`,
  termination's is typed to JsonValue -- so trace-replay is now re-exported
  explicitly without it rather than silently promoting either.

Verified: typecheck clean, 585/585 vitest, `npm run check` 80/81 (the one
failure is the macOS-only /tmp symlink case in mission.test.mjs, which this
repo's Linux-only CI does not exercise).

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01Ff2xRKvYrqXJhefvcapfE1
@ruvnet
ruvnet merged commit 58573c7 into main Sep 7, 2026
9 checks passed
ruvnet added a commit that referenced this pull request Sep 7, 2026
…0010) (#97)

Every gate here freezes a policy before outcomes are visible, then treats the
receipt as timeless. PR #11 showed what that misses: evaluated 2026-08-15
against `dream.config.json` as it stood that day, honest evaluation, passed —
and three weeks later `autoMerge` had deliberately flipped, so landing it turned
main red on two tests.

git merged #11 cleanly. `dream.config.json` was never in its diff; it was in its
READ SET — a file the evaluation depended on but did not modify. git protects
the write set; nothing here protected the read set.

Adds `EvidenceFreshnessPolicy`/`Receipt` to @dream-machine/witness: the read set
is declared and digest-anchored at evaluation time, then re-digested against the
tree a candidate would land in. FRESH / STALE / INDETERMINATE / INVALID, every
receipt `authority: 'none'`.

Deliberately NOT age-based and NOT base-commit-based: main advances constantly,
so a gate keyed on either fires always and gets switched off. Drift in the
declared read set is the signal; age is an optional secondary bound.

`dream-machine freshness stamp|verify` does the I/O so the primitive stays pure
(exit 0 FRESH / 1 STALE / 2 indeterminate|invalid, usable as a CI gate).

Security: the CLI validates and anchors the policy BEFORE reading any
dependency. Without that ordering an untrusted policy file naming
`../../etc/hosts` would be read (and its existence confirmed) before the library
rejected it — a read/existence oracle. Caught in adversarial review of this
change, fixed, and regression-tested.

Validated against real history, not just fixtures: stamping `dream.config.json`
from 8ce3857 (PR #11's actual base) and verifying against current main yields
STALE, driftedPaths ["dream.config.json"], exit 1.

616/616 vitest, typecheck clean, sub-quadratic cost bound to 4096 deps.

Also removes a duplicated stale `tui` help line left behind by the #96 union merge.


Claude-Session: https://claude.ai/code/session_01Ff2xRKvYrqXJhefvcapfE1
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.

1 participant