Skip to content

Avoid repeated WAL reconstruction in trusted host contexts - #729

Open
flyingrobots wants to merge 5 commits into
feature/retained-operation-strandsfrom
perf/validated-wal-prefix
Open

flyingrobots wants to merge 5 commits into
feature/retained-operation-strandsfrom
perf/validated-wal-prefix

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Healthy operation-context reads and writes rebuilt retained WAL history on each call. This change derives the context index and writer cursor from a validated committed prefix, advances the index from acknowledged records, and borrows it for healthy reads.

An append error invalidates the fast path, including an error reported after the commit marker became durable. Context writes reconcile before checking identity or appending; exact retries resolve their original bytes and changed semantic input is refused. The WAL format, durability, verification, and artifact publication format are unchanged.

Depends on #728; this PR targets feature/retained-operation-strands.

Validation

  • All 45 host-loop tests pass, including failures before commitment, durable-but-reported-failed observations and requests, immutable retries, and reopening.
  • Existing nine-case native communication loop and seven-case retained-strand acceptance pass.
  • Local operation, library, trusted-host, and filesystem WAL checks pass. Feature-enabled host-loop Clippy passes after the predicate simplification in d18ab778.
  • Two matched optimized replays per version reproduce all 250 original request/response records byte for byte, including commit identities. All four pass all three independent artifact acceptance stages. Each retains 80 submissions, 109 observations, four host launches, forced recovery, and the 240-byte publication format. No model calls.
Measure Before After
Mean total replay 13.264 s 7.074 s
Mean observation RPCs 5.192 s 1.736 s
Mean submission RPCs 6.301 s 3.810 s
Recovery calls per replay 403 14
Decoded frames per replay 154,146 4,737

Both measured binaries inherit dev with opt-level=3, retaining debug assertions. Measurements are pinned to ea1f03e1; d18ab778 only simplifies the equivalent prefix predicate for Clippy. OS caches are uncontrolled. Counters include required opening/recovery and count decoded frames, not physical I/O. A first baseline attempt is retained but excluded because Docker was stopped and compilation overlapped. This is one retained synthetic procedure, not an agent-effectiveness result.

The Telepathy record is docs/sandbox/wal-prefix-repair/report.html, committed with its evidence and interactive charts in 933e170; replay tooling is 4eebd86. Canonical hosting documentation and the Unreleased changelog are updated. README/GUIDE ownership boundaries are unchanged.

Parent review fixes are incorporated by normal merges, including ABA-aware change evidence, immutable head/occupancy binding, budget rejection, and writer-lease/tail hardening. The 45-case host suite and 126 WAL hardening tests pass after integration (one WAL child-process helper is ignored). The timing table above remains historical evidence pinned to ea1f03e; these later review changes have not been reprofiled.

Remaining gates: replacement CI and upstream review. Ready for review does not indicate merge readiness.

RED on purpose: healthy context operations perform 48 recovery scans over 376 frames instead of advancing derived state. The durable-marker failure reconciliation witness passes.
Bind derived contexts to the acknowledged commit prefix. Invalidate on append error and reconcile before identity checks and further context writes. Preserve durable-but-reported-failed requests and refuse changed retries.
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: flyingrobots/echo/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: e4acce77-f2b8-47df-b51a-e0ebba70819b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@flyingrobots flyingrobots self-assigned this Sep 22, 2026
@flyingrobots
flyingrobots marked this pull request as ready for review September 22, 2026 03:10
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T03:15:07.688226Z d18ab77 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@flyingrobots

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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