fix: make vector reconciliation sequence-monotonic - #388
Conversation
Live local E2E evidence — exact head
|
|
Independent GPT-5.6 pre-Greptile review Reviewed the complete open PR diff (76 changed files) at exact head Findings
Verdict: FAIL |
|
Verdict: PASS Fresh independent GPT-5.6 review of the complete OPEN PR diff against the current base found zero actionable findings at exact head Reviewed publication authority and atomicity, PostgreSQL/Turso parity, migration and cold-start/restart paths, vector backfill/live-write fencing and deletion reconciliation, determinism, and the full changed test surface. Independent validation included the affected library suites, targeted server integrations, formatting, strict Clippy, and diff hygiene. |
|
@greptile review |
|
Verdict: PASS Fresh final independent GPT-5.6 review of the complete OPEN PR diff after Greptile found zero actionable findings at exact head The final audit covered atomicity, PostgreSQL/Turso/Sim parity, verified-spec publication boundaries, migrations and restart/bootstrap paths, vector generation/sequence fencing and deletion reconciliation, actor incarnation handoff, determinism, and the changed test surface. Greptile Review is SUCCESS with zero review threads. |
|
ARENA SHIPPABLE ARN-216 is complete on OPEN, unmerged PR #388 at exact head Evidence:
|
Summary
Root cause
Backfill rows were written without the journal sequence and declaration authority they represented. A rebuild that read sequence N could therefore overwrite a live vector co-committed at sequence N+1, then persist a completion watermark that made the stale result durable. Replacement also lacked durable omission tombstones, so restart could resurrect removed declarations.
Design
ADR-0181: Monotonic vector reconciliation
ADR-0181 was selected after auditing
origin/mainand every open PR; ADR-0180 is already claimed by ARN-242.RED → GREEN
541f58b6(test: reproduce stale vector reconciliation)bb50c0e6(fix: make vector reconciliation durably monotonic)Validation on
bb50c0e6dbd32ded74625be159c09d9321de5674cargo fmt --all -- --check: PASSgit diff --check HEAD: PASSCARGO_BUILD_JOBS=2 cargo test --workspace: PASS, including randomized simulation, all 656 temper-server tests, integration tests, and doc testsScope note
No source under
crates/temper-actor-runtimeis changed.Gate status
Independent GitHub-head review, Greptile review, final independent review, and CI are still required before ARENA SHIPPABLE. Do not merge.
Linear: https://linear.app/arni-build/issue/ARN-216/bug-vector-backfill-races-live-writes-and-can-permanently-mark-a-stale-index
Greptile Summary
This PR makes vector reconciliation sequence-monotonic and coordinates specification publication across runtime and storage layers.
Confidence Score: 5/5
The PR appears safe to merge because no concrete changed-code defect remained after checking reconciliation ordering, backend parity, atomic append behavior, and actor publication races.
Live writes and rebuilds consistently validate declaration authority and compare durable generations and journal sequences, while failed or stale work cannot publish completion; catalog replacement also updates existing actor table references in place and revalidates actor incarnations around publication.
Important Files Changed
Sequence Diagram
sequenceDiagram participant Registry participant Coordinator as Reconciliation coordinator participant Store as Postgres/Turso/Sim participant Writer as Live entity writer Registry->>Store: Persist declaration fingerprint/revision Coordinator->>Store: Begin reconciliation Store-->>Coordinator: Current generation Coordinator->>Store: Read journal/snapshot at sequence N Writer->>Store: Atomically append event N+1 and vector rows Store->>Store: Advance entity sequence fence Coordinator->>Store: Replace rows at generation G, sequence N Store-->>Coordinator: Ignore stale sequence or reject stale generation Coordinator->>Store: Publish completion watermark Store->>Store: Verify generation and declaration remain currentReviews (1): Last reviewed commit: "test: satisfy strict inline stream lint" | Re-trigger Greptile
Context used (4)