Hosted compositions compose without the local group-commit writer - #603
Merged
Conversation
Platform #620 merged a hosted composition whose components have no write_ledger, and NativeControlPlane crashed constructing (AttributeError) because the bridge unconditionally wrapped components.write_ledger in the group-commit facade. The seam had leaked two local-engine implementation details into the hosted contract: write_ledger typed as the SQLite batching writer and ledger typed as SQLiteAttemptLedger. The contract now says what it means: write_ledger is optional (hosted stores return None or omit it) and ledger is a structural SyncWriteLedger, the synchronous durable surface the data-plane threads settle through. The bridge falls back to the host's own ledger when no group-commit writer exists; the local composition is unchanged. Regression tests construct the control plane over components with write_ledger absent and None and settle a request end to end through the raw path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Greptile SummaryThis PR allows the native control plane to run over hosted components that lack the local SQLite group-commit writer, falling back to their synchronous durable ledger while preserving local batching.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issue identified. The hosted fallback matches the bridge’s synchronous write call surface, local compositions retain their existing group-commit path, and regression tests cover both supported forms of a missing writer.
|
| Filename | Overview |
|---|---|
| exp/runtime/gateway/native_bridge.py | Selects either the local group-commit facade or the hosted synchronous ledger and reuses the shared quota-error helper. |
| exp/runtime/gateway/native_components.py | Defines the synchronous durable write protocol and makes the local group-commit writer optional. |
| exp/runtime/gateway/native_bridge_test.py | Adds end-to-end regression coverage for hosted-shaped components with an absent or null group-commit writer. |
| exp/runtime/gateway/native_settlement.py | Centralizes construction of the public monthly-quota protocol error. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[NativeControlPlane initialization] --> B{write_ledger present?}
B -->|Yes| C[SyncGroupCommitLedger facade]
B -->|No or None| D[Hosted synchronous ledger]
C --> E[Accept request and start attempt]
D --> E
E --> F[Provider dispatch]
F --> G[Durable terminal settlement]
Reviews (1): Last reviewed commit: "Hosted compositions compose without the ..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Platform #620 (merged) composes the native control plane over Postgres-backed components with no
write_ledger; at the pinned revisionNativeControlPlane.__init__unconditionally runsSyncGroupCommitLedger(components.write_ledger), so the hosted worker crashes at startup:(reproduced against platform main's exact pin before writing this fix.)
Root cause: the hosted seam leaked local-engine implementation details — the components protocol demanded the SQLite group-commit batching writer, which a Postgres host cannot honestly provide.
write_ledgeris nowGroupCommitAttemptLedger | None; hosted stores returnNoneor omit the attribute (getattrfallback keeps platform's current dataclass working with just a pin bump)ledgeris retyped as a structuralSyncWriteLedgerprotocol: the synchronous, thread-safe durable surface data-plane threads settle through; the local composition still batches through the group-commit facade unchangedNone) and settle a request end to end through the raw pathAfter this merges, platform only needs to bump its experiential pin — no platform code changes.
🤖 Generated with Claude Code