Skip to content

Propose WAL durability modes and batched submission - #788

Draft
flyingrobots wants to merge 4 commits into
mainfrom
docs/wal-durability-modes
Draft

flyingrobots wants to merge 4 commits into
mainfrom
docs/wal-durability-modes

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

What changes

Adds a proposed, not yet implemented design page: docs/architecture/wal-durability-modes.md. Documentation only.

Summary

  • Three host-chosen durability modes: none, deferred, strict.
  • Batched strict submission: append each envelope's ordinary intake transaction, sync once, then acknowledge. No format change; recovery is unchanged; a crash can leave a prefix, none of it acknowledged.
  • Deferred mode: an in-process writer thread behind a bounded queue, acknowledgements that state "accepted, not yet durable" with a log position, and an observable durable position.
  • Laws: acknowledgements state their posture; durability reports never influence admission or ticks; nothing is dropped silently; one writer; every mode writes an ordinary Echo WAL.
  • Alternatives not chosen (external WAL process; one transaction carrying many acceptances) and open decisions are recorded.

The page has a Current implementation section and names #787 as the owner of implementation state. Linked from docs/README.md and docs/topics/WAL.md.

No numbered ADR. No CHANGELOG entry: no shipped behavior changes.

Refs #787.

🤖 Generated with Claude Code

Record a proposed, not yet implemented design for when Echo waits for
storage: three host-chosen modes (none, deferred, strict), batched strict
submission that appends ordinary intake transactions and syncs once, and a
deferred mode with an in-process writer thread, a bounded queue and an
observable durable position. State the laws that keep it honest:
acknowledgements state their posture, durability reports never influence
admission or ticks, nothing is dropped silently, and every mode writes an
ordinary Echo WAL. Record what the runtime does today and name issue #787 as
the owner of implementation state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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-10-13T03:26:27.412838Z fcb881e New commits
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6fbb7c5ac6

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/architecture/wal-durability-modes.md Outdated
Comment on lines +6 to +8
- **Status:** Proposed design. **Not implemented.** The section
[Current implementation](#current-implementation) states what the runtime
does today.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep the proposal out of current architecture until accepted

Because this page explicitly identifies itself as a proposed design and still contains open decisions, checking it into docs/architecture/ and routing it through the Current Architecture index makes undecided behavior appear to be current architectural truth. Keep the proposal in issue #787 until it is accepted, then record the resulting durable decision in its canonical owner.

AGENTS.md reference: AGENTS.md:L69-L75

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that a proposal must not read as current architecture. I have converted this PR to a draft and am leaving this thread open. The design is tracked in #787 and will merge only if the repository owner accepts it, at which point the status line changes from proposed to accepted; otherwise the page stays out of docs/architecture/ and the content lives in the issue.

Comment thread docs/architecture/wal-durability-modes.md Outdated
Comment thread docs/architecture/wal-durability-modes.md Outdated
Comment thread docs/architecture/wal-durability-modes.md Outdated
Comment thread docs/architecture/wal-durability-modes.md Outdated
Comment thread docs/architecture/wal-durability-modes.md Outdated
A failed sync acknowledges nothing: a readable record is not a durable one.
Deferred acknowledgements are bound to writer epoch and transaction identity,
because a lost record's log position can be reused. Records after the
durable position may be lost, not are lost. A full queue makes the caller
wait and never refuses, so writer timing cannot decide admission. The
one-writer law applies to modes that write a WAL. Only scheduler passes that
produce receipt correlations write and sync a tick transaction. Record that
the current single-submission path treats a readable record as accepted
after a failed append or sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fcb881eefe

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

| Mode | An acknowledgement means | The caller waits for |
| -------- | ---------------------------------------------------------- | -------------------- |
| None | Accepted in memory. Nothing is recoverable. | Nothing |
| Deferred | Accepted, ordered, and handed to the WAL writer. | Nothing |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Account for queue backpressure in deferred waits

At queue saturation, the Nothing promise is false: law 4 at lines 104–105 requires the submission caller to wait for capacity, and the open decision allows that wait to continue until the host declares writer failure. A deferred client therefore cannot tell whether acknowledgement is nonblocking or may stall a frame—the performance property this design is intended to define. State the queue-capacity wait and its terminal failure result here rather than promising no wait.

AGENTS.md reference: AGENTS.md:L20-L27

Useful? React with 👍 / 👎.

Comment on lines +107 to +109
break law 2. When the writer fails, the runtime stops accepting work that
would need the WAL and reports an explicit obstruction that is recorded as
a fault. It does not continue in a weaker mode.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the typed fault/obstruction boundary

On writer failure, this assigns the same condition both obstruction and fault, although docs/topics/RuntimeAuthority.md lines 25–28 says fault/quarantine must not be confused with lawful obstruction and docs/topics/Obstructions.md lines 12–23 gives them different recovery semantics. An implementation following this cannot expose a stable typed posture—retrying unavailable support and quarantining an internally faulted runtime require different handling—so define the public obstruction and internal fault as separate attributable values, or select the one posture that applies.

AGENTS.md reference: AGENTS.md:L65-L75

Useful? React with 👍 / 👎.

Comment on lines +44 to +46
A host submits several envelopes in one call. Echo appends the ordinary intake
transaction of each envelope, in order, and then syncs storage once. Echo
acknowledges the batch only after that sync.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Define the result of a mid-batch failure

If transaction N fails validation, construction, or append after earlier transactions were appended, the prefix may later become durable through OS writeback or a subsequent sync even though the batch never reaches this acknowledgement point. The page defines crash and final-sync failure but gives no result posture for this ordinary partial-failure path, so callers cannot know which submissions to retry safely. Require all fallible admission/build work before appending, or return identity-bound accepted/indeterminate results for every prefix member and reconcile them before reporting the batch result.

AGENTS.md reference: AGENTS.md:L30-L34

Useful? React with 👍 / 👎.

Comment on lines +44 to +46
A host submits several envelopes in one call. Echo appends the ordinary intake
transaction of each envelope, in order, and then syncs storage once. Echo
acknowledges the batch only after that sync.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bound the batched submission surface

This new public call has no limit on envelope count, encoded bytes, or admission work, so a caller can supply an arbitrarily large batch and monopolize memory and the runtime thread even though the motivating contract is a fixed frame budget. Define a host-configured batch aperture and a typed over-budget result that is decided before partial append; otherwise reducing sync count does not make the frame-time claim bounded.

AGENTS.md reference: AGENTS.md:L20-L27

Useful? React with 👍 / 👎.

Comment on lines +121 to +124
- **An external WAL process on a port.** It gives the same speed as deferred
mode and adds a wire protocol, a second process to deploy and a second
holder of storage authority. A process crash would also lose records that
an in-process writer had already handed to the operating system.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Account for the external writer's separate failure domain

This rationale conflates a host crash with a WAL-daemon crash. If the Echo host dies after an IPC handoff but the external writer remains alive, that writer can still retain and sync the records; the in-process writer necessarily dies with the host. Conversely, daemon failure needs its own acknowledgement and recovery contract. Distinguish which process failed and what the IPC acknowledgement binds rather than claiming the external design has the same loss posture.

Useful? React with 👍 / 👎.

flyingrobots and others added 2 commits October 12, 2026 22:36
Batched submission landed in #791. Correct the status line and the current
implementation section, and replace the proposal that a later sync may make a
failed batch durable: a later sync cannot vouch for records an earlier sync
failed to write, so the host takes the batch back and must reopen the WAL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@flyingrobots

Copy link
Copy Markdown
Owner Author

Merged main and corrected the page now that #791 has landed: the status line and Current implementation say batched submission is implemented and deferred mode is not, and the failed-sync rule no longer proposes that a later sync can make the batch durable (it cannot vouch for what an earlier sync failed to write; the host takes the batch back and must reopen the WAL). Still a draft: the page is a proposal until the owner accepts it.

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