Bound retained-history work during conversation staging

Merged
VA
3d ago
+1886-212

Bound retained-history work during conversation staging

Reuse authenticated immutable subtrees during append-only publication,
without bypassing closure validation or original-ledger custody. Compact
diffs in one pass and avoid repeated memory-stream history and replay scans.
Use logical conversation revisions when binding summary forks.

Keep the memory-backed fixture and replace the 10,000-turn brute-force run
with compaction, reopen and retry coverage plus a deterministic growth test.
After 250 warmup stages, compare 250 and 1,000 stages with a 1.25x bound on
average copied bytes, examined items and allocation operations.

Validation: all six focused harness tests passed in 24.01 seconds; the
focused stream history/prefix regression passed. Cargo check passed for
acyclic-fs, acyclic-stream and acyclic-harness with --tests --all-features.

Known gaps

The six focused tests take 24 s, above the 10 s per-suite target. Follow-up required.

🤖 Generated with Claude Code


Summary by cubic

Bounds retained-history work during conversation staging by caching append-only closure proofs per volume, compacting generation diffs in one pass, and keeping memory-stream history and replay scans cheap.

  • Reuses a cached authenticated proof when the new generation is an append-only child of the last proven one, falling back to a full proof on large diffs, closure limits, or non-append changes; shared ancestry is memoized instead of rescanned per binding, and ordered page children are matched with one descending cursor.
  • Retained replay lookups live in a balanced index embedded in the already-funded entries, with shared inventory reserved before acceptance, buffer-growth copies charged, and lookups, insertions, and settlement examinations metered against the original ledger and refunded when unused.
  • Memory-stream reads use prefix windows for single-record reads; summary forks compare logical conversation revisions instead of the last message's sequence.
  • Replaces the 10,000-turn brute-force run with compaction, reopen, and retry coverage plus a deterministic growth test bounding copied bytes, examined items, and allocations across 64 vs 256 staged turns after 192 warmup.
  • Focused suites now finish in ~6 seconds, within the 10-second per-suite target.