Repository navigation
fix(markers): replace uncommitted pending carriers, retire late-parent prefixes - #5747
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71ef5f27cd
ℹ️ 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".
71ef5f2 to
1b8c464
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b8c464173
ℹ️ 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".
|
Answers to the Codex review threads. Inline replies to review threads are currently being rejected by GitHub's secondary rate limit, so all three answers are here.
|
…rent prefixes Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
…traction Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
1b8c464 to
47ad959
Compare
…rough user_write Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Summary
Two marker-carrier lifecycle defects that change what a fresh build stores (polylogue-1tyq5.139, polylogue-1tyq5.135):
Problem
Pending-carrier shortcut (1tyq5.139, seven Codex findings on #5507). If a raw's index transaction rolled back and another raw then published an identical session hash,
_reuse_current_accepted_marker_carrierreturned early and skipped_drain_ready_session_entries. The retry then:sessions.raw_idon the intervening raw;A related liveness defect: a pending carrier from a replaced index incarnation was refused on every retry. A cold build that restarts after its generation is reclaimed would therefore strand those raws permanently.
Child-before-parent markers (1tyq5.135, #5493). A child written before its parent is stored whole, so
marker_candidates_for_prepared_writesealed candidates for the replayed prefix under the child's message ids. When the parent arrived,_reextract_prefix_tail_dbdeleted those rows and the parent's carrier sealed the same markers under the parent's ids. Assertion ids include the evidence refs, so delivery kept two candidate assertions for each inherited marker.Solution
_reuse_current_accepted_marker_carriernow reuses a carrier only when a witness proves it committed in the current incarnation._publish_marker_witnesses_before_index_commitreplaces the pending carrier throughreplace_uncommitted_pending_marker_input_sync. The replacement is compare-and-swap on the retained digest and is declared in the durable-write census astwo_phase_recovery. Accepted carriers are never replaced.report_reextracted_prefix_blocks), which keeps only the derived ids. The writing raw's carrier records the child assertion ids those blocks produced, asretired_assertions, computed with the same extraction the child's carrier used (retired_marker_assertion_ids). Delivery records each retired id in the new user-tier tableretired_marker_assertions, marks an existing untouched candidatesuperseded, andlower_markersskips any retired id, so delivery order between the child's and parent's carriers does not matter. Only untouched agentcandidaterows are changed; human assertions and existing judgments are preserved. The marker recipe format moves from 3 to 4.Derived-identity closure:
storage/sqlite/archive_tiers/write.py,storage/accepted_marker_inputs.pyandpipeline/services/ingest_batch/_models.pyare members, so this must land before the fresh build starts. Schema classification: additive-durable, meaning one newuser.dbtable inUSER_DDL, written throughuser_write.record_retired_marker_assertion. No v1 archive has been built, so the change follows the repository's fresh-floor route (the same one #5657 used):ARCHIVE_FORMAT_LINEAGEmoves frompolylogue.archive-format.v4tov5, and every tier stays atuser_version=1. Any v4 development root is therefore fenced at open rather than opened without the table.devtools gate schema-manifestreportsdurable-schema-evolution: PASSanddevtools gate layeringreportsviolations: [].Verification
agentctl job start polylogue pytest_focused -- tests/unit/markers tests/unit/storage/test_accepted_marker_consumer.py tests/unit/storage/test_bulk_fts_prefix_reextract.py tests/unit/storage/test_fresh_archive_format.py tests/unit/storage/test_durable_tier_version_authority.py tests/unit/devtools/test_verify_schema_manifest.pyon head 50d7a48 (job 1194):Success.tests/unit/security/test_excision_carrier_reach.py. Its one failure is inherited and unrelated:raw_existence_changesis declared TOMBSTONE, and the test expects RETIRED.mypyon the changed files: no issues.Anti-vacuity:
sessions.raw_idon the intervening raw, records zero skipped sessions, and accepts the stale pending bytes.test_public_marker_retry_replaces_uncommitted_pending_carrierasserts all three.test_late_parent_supersedes_the_childs_prefix_markers.test_retirement_delivered_before_the_child_carrier_still_holds.Residuals
🤖 Generated with Claude Code
https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg