Repository navigation
Go lane 6c slice B: ordinary sync finalization on workerd, rebased onto main (admission closed) - #26346
Go lane 6c slice B: ordinary sync finalization on workerd, rebased onto main (admission closed)#26346Git-on-my-level wants to merge 95 commits into
Conversation
Co-authored-by: multica-agent <[email protected]>
Git-on-my-level
left a comment
There was a problem hiding this comment.
R19 review at 732f694739929ae5a903bac7e31c659b7628e710: no blocker found in the requested profile-refresh scope. The receiver constructs GoConversationEffectSource from the conversation ID, sync revision, owner epoch, job ID and finalization revision; apply_eager_sync_enrichment passes it through refresh_for_finalization into the profile writer. The commit transaction rechecks the account marker, source row and tombstone, Go owner epoch, job ID, finalization revision, sync revision, and the prior profile text before its existing profile update. The new Go source validation contributes two reads (source row and tombstone) and no writes. The three-attempt cap and cooldown/in-progress reservation cleanup are unchanged; the wrapper also releases its semaphore in finally. Regression coverage checks mismatches in engine, epoch, job ID, finalization revision and sync revision.
Co-authored-by: multica-agent <[email protected]>
SCA-3551 adds the paired missing-row fence and account erasure fixtures to the pinned workerd diagnostics. The runner captures the pre-wipe views and records the post-wipe Firestore absence and Go queue custody through the workerd test seam on #26346. **Current head: `ac891072`** (fast-forward of `db654737` via `99fbd280`). `99fbd280` validates the fence memo against the pre-delete conversation and link snapshot and checks the link survives unchanged (oracle artifact; accepted count 86→85). `ac891072` requires the bound intake memo whenever intake expects one, so both-sides-missing evidence is rejected. Worker 2 R19 SHIP at `ac891072` (Python replay 44 passed/1 skipped; Go memo comparator tests passed). Test tooling only: `backend-go/tools/replay/` and `backend/testing/finalization_replay/`; no serving code. Rollback: revert the merge commit. The comparator landed on main in #26322 at `58a67241`. This PR now targets main and contains only the paired lifecycle runner changes. Set `ORACLE_DIAG_PAIRED_LIFECYCLE=1` to enable the paired fixtures and `ORACLE_DIAG_SIDE_TIMEOUT_SECONDS=720` for the supplemental suite. The 109 jobd pre-wipe rows stay diagnostic. The serving missing-row attach memo evidence contributes one accepted gap, bringing SCA-3551 to 86 before later group releases. At `db654737`, the Python replay suite passed 42 tests with one replay-binary-dependent skip, and all 37 local preflight checks passed. The full 720-second-budget run against pinned worker `0a0640ae` completed all 41 cases. R7 held in every case at a minimum margin of +2 Firestore operations. Fence used 13 Go vs 25 Python operations, and erasure used 126 vs 130. The run had 163 diagnostic gap rows, zero unlabelled, zero pre-wipe binding failures, and zero execution errors. The normalized findings match the accepted baseline.
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
…patch Flex Co-authored-by: multica-agent <[email protected]>
…2-codex-sol/1ef7782a8379
Carry forward ordinary sync finalization and use a standalone OIDC status endpoint after the Episodes engine retirement. Keep the Python notes deadline and record the current Home projection with the effects receipt. Co-authored-by: multica-agent <[email protected]>
# Conflicts: # backend/utils/llm/conversation_processing.py
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
…ca-3551-b2-publish
# Conflicts: # backend/database/conversations.py # backend/database/llm_gateway_accounting.py
Co-authored-by: multica-agent <[email protected]>
# Conflicts: # backend/database/conversation_effect_fence.py
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Summary
Refresh the Slice B draft with SCA-6041 callback settlement and settled-outbox comparison, plus the SCA-6042 paired R7 replay adapter. Both callback routes acknowledge delivery once same-revision Go custody records completed fanout. The adapter compares isolated candidate and frozen Python replays against a deterministic loopback provider. This draft supersedes the scope of #26643 for SCA-4852 F2, F4, F5 and F6. The Go admission switch remains off with an empty allowlist.
The v2 result has a 24-hour read window. Activation still requires custody approval for physical expiry and a deployment decision for the sweep. Rollback closes admission and drains or reconciles pinned work before routing it back to Python.
After completed handback, the public status route resolves the retained Go receipt using the same owner, conversation, job and revision, with adjacent ownership epochs.
Workerd completes the held snapshot with the same fenced notes write. Hold release keeps the original summary acceptance and its deadline.
A completed handback returns the settled summary for the current revision, avoiding a repeat paid notes call.
Sync finalization retains the relevance hint and the existing Home icon on empty captures, with the neutral Structured default when the source has no icon.
After the Go empty-discard receipt and fanout commit, record the terminal noise stage in a lease-, revision-, and deletion-fenced transaction. The candidate replay measured four additional reads and one write per empty discard.
Trim legacy inline transcript text and compress changed lists in the existing Go persistence transaction. Preserve segment IDs, timing, and unrelated fields.
Keep main’s shared conversation tombstone check and the Go effect fence’s field projection. Update the sync emulator fixtures for the builder lease token and outbox callback and task lookup contracts.
Normalize the ruled timestamp and token differences only on settled outbox receipts. The comparator still reports incompatible field types, active defer values, and retained owner data.
Share the Go custody check between both callback routes, classify its reads, and update the outbox emulator fixtures to exercise the current callback contracts.
Product invariants affected
Failure class
Failure-Class: FC-retry-resume-behind-own-fence
Line-count exceptions
Line-Count-Exception: backend/database/conversation_finalization_jobs.py | 3812 -> 3818 | Pin the notes protocol and durable prompt clock when creating a job.
Line-Count-Exception: backend/database/conversations.py | 6170 -> 6226 | Keep handback ownership and multipart guards in the existing transaction and preserve the original pending clock and deadline at hold release.
Line-Count-Exception: backend/database/firestore_index_registry.py | 2427 -> 2428 | Exclude encrypted keyed notes results from indexing.
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3581 -> 3613 | Keep ordinary sync empty-capture disposition beside its existing decision and bind eager memory and notes writes to their source revision.
Line-Count-Exception: backend/utils/sync/assignment.py | 1689 -> 1696 | Pin an eligible source at creation or record its candidacy inside the existing hold.
Line-Count-Exception: backend/utils/sync/pipeline.py | 4063 -> 4072 | Recover queued admission and return already settled notes at the legacy sync callback without repeating provider work.
SCA-6042 fresh-held replay verification
The Go replay starts from fresh held assignment and enters Workerd through the serving callback after quiet-window release. The callback reads stored BYOK state and refuses Go admission for active BYOK users. The replay attributes privacy operations to their serving callers.
The archived manifest amendment replaces
go_seeded_sync_dispatchwithgo_serving_sync_admission_from_fresh_held_assignmentin the expected Go entrypoints. The audit still requires exact ordered matches. The Python labels and pinned corpus digest are unchanged.Verified on m1 at
ac28a19812008bab3ff14758708d2c3c2c1168a3. The local 42-case run completed all pairs and passed the exact entrypoint audit with zero violations. Serving refused all five BYOK cases with zero Workerd admission POSTs for those cases.The closed assignment control passed all 42 cases. Each side recorded 217 reads, 257 writes, zero deletes, and zero upstream calls. Go admission remains off with an empty allowlist.
The serving replay recorded 4,444 reads, 1,545 writes, 75 deletes, and 60 upstream calls for Go. Frozen Python recorded 15,252 reads, 3,351 writes, 78 deletes, and 53 upstream calls.
Go exceeded Python's per-case Firestore operation count in 35 cases and upstream call count in seven, for 36 distinct cases. The budget gate remains blocked. The upstream is a deterministic loopback fixture, and the run remains ineligible for R7 qualification.
make -C backend-go checkpassed vet, architecture, lint with zero findings, and the Firestore/Postgres race run across 26 test packages.go test -count=1 ./tools/replaypassed 76 top-level tests.backend-go/tools/replay/test.shpassed 26 Python contract tests, 10 admission parity cases, the 41-case expected-drift contract and its mutation checks. Seven adapter unit tests passed. The changed-files Python selector selected 3,140 files for CI, including 408 affected contract and changed-test files in its focused set.The focused Python run covered all 408 selected files. It recorded 16,767 passes, 72 expected failures, four Firestore-required skips, and one failure. The failure is the new
r7_held.pydependency on retiringutils.sync.pipeline, rejected bytest_sync_legacy_import_ratchet.py. A separate Firestore emulator run passed all 102 backfill tests, including the four requiring Firestore.Main was left out of this refresh because deploy(listen): re-pin the reviewed evidence scripts tree (SCA-2185) #26914 had not landed. The standalone Listen overlay workflow test had 40 passes and one failure on the stale reviewed scripts-tree pin.
Callback settlement, comparator, and adapter verification
Verified on m1 at
7bb6615484686cbed00c2b4b48aa9d3e57303e38. The branch includes SCA-6041 settlement7310d1b026, the SCA-6042 adapterbc48658703, the SCA-6041 comparator3f22f25fbf, and main throughed306bba58e.make -C backend-go checkpassed vet, architecture, lint with zero findings, and the Firestore/Postgres race run across 26 packages. The six-package race run passed 163 top-level tests. The opt-in worker paths ran through F6 and the adapter.go test -count=1 ./tools/replaypassed 76 top-level tests.backend-go/tools/replay/test.shpassed 26 Python contract tests, 10 admission parity cases, the 41-case expected-drift contract, and its mutation checks.backend-go/tools/replay/r7-adapter.shcompleted 42 of 42 synthetic lifecycle pairs. Go measured 1,815 reads, 786 writes, and 53 upstream calls. Frozen Python measured 15,035 reads, 3,094 writes, and 53 upstream calls. Each side's gateway portion was 156 reads and 119 writes. The frozen manifest reports 42 candidate entrypoint mismatches because the adapter records the serving admission handler from seeded custody. This loopback fixture is ineligible for R7 qualification.make preflightpassed 46 checks. Pipeline Lab passed four Home and sync scenarios. The adapter unit suite passed six tests.Noise ledger and transcript refresh verification
make checkpassed vet, lint with zero findings, the architecture checks, and the Firestore/Postgres race run across 26 test packages. The requested six-package race run passed 163 top-level tests, andgo test ./tools/replaypassed 75. The two opt-in worker replay paths ran separately through F6 and the notes replay harness.Four-candidate refresh verification
Previous successor verification
late_sync_joins_published_cardandsync_safety_copy_repeats_live.Prior Slice B verification
go test -race -count=1 ./...run using local Postgres and Firestore passed 402 top-level tests across 26 test packages. Two opt-in replays were skipped in that run. The F6 integration runs the interrupted-notes replay separately.