Repository navigation
fix: arm batch-live summary debt after capture finalization - #25621
Merged
Merged
Conversation
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Completed batch-live captures retain a finalization job ID after raw-capture handoff. Projection debt admission therefore refused them as
generation_owned, even when the bound finalizer job was already completed successfully. A pending timestamp from enrichment acceptance also incorrectly prevented a missing due time from being armed. The placeholder-title admission in #25611 did not remove either guard.The projection transaction now verifies the finalizer's owner/conversation/revision, terminal success, completed fanout and immutable non-BYOK custody, then commits generation-bound summary custody with the transcript and armed debt. Active, mismatched, failed and BYOK generations remain fenced, including a completed requires_byok job after the account switch turns off. Pending-only rows retain valid non-future original clocks; malformed/future clocks fall back to acceptance and expired clocks remain unarmed. A malformed finalizer ID refuses debt without aborting transcript projection. Legitimate unbound orphan records keep the existing debt policy without a custody exception. The existing default-on
SUMMARY_PROJECTION_DEBT_ENABLEDswitch disables enrollment and the custody exception. Projection and repair continue sharing the conversation-keyed enrichment outbox and its active leases; no new task producer is added.The new unit suite runs Projector -> ProjectionSession -> assignment -> replacement -> real codec -> stored conversation. The original code committed a transcript with no due time. The regression now covers blank/placeholder titles, pending clocks, generation/BYOK fences, kill-switch rollback, SDK deletion semantics, receipt-only acceptance and repair over an active enrichment lease. Literal metadata writes are registered in the lifecycle AST inventory; refusal logs contain only bounded static reasons, no customer/job identifiers.
The CI follow-up removes duplicate module parsing and skips expression-only subtrees in the assignment-constant inventory; five cases preserve constants through control flow and nested scopes. All 26 transaction tests remain in the fast lane. A module fixture prepares the real lazy lifecycle/speaker-evidence dependencies before the concurrent-reconcile call, following the existing summary-delivery fixture convention. Import failures still fail the suite; the unchanged whole-file wall limit includes their cost. The replay and every concurrency assertion stay real. No threshold, allowlist, marker, workflow or product/rollout change.
Rollback behavior: setting
SUMMARY_PROJECTION_DEBT_ENABLED=falsepauses both new enrollment and repair admission through existing batch-live finalization proofs. It retains their pending/due markers; ordinary already-enqueued enrichment continues independently. Re-enabling restores proof-based admission while the generation, privacy, BYOK, summary and age guards still pass. A pause extending past the repair age window requires a fresh residue count and separate approval before any enrollment/backfill. The flag does not delete receipt metadata or cancel existing enrichment.Validation: guard-enabled authoritative test.sh through omi-heavy passes 36 arming cases, all 26 transaction cases, 259 lifecycle invariants (86 existing xfails) and 1,901 writer-inventory cases. Complete local shards 1/8 (133 files) and 2/8 (156 files) pass with the normal guard enabled and four workers. GitHub checks are authoritative for current-head CI; the owning report links exact-head panel and triage receipts. Full runtime source closure covers all 19 registered images. The selected failure-class gate also exposed a stale missing-family fixture: its temporary definition now explicitly removes the migrated seed family, retaining the original assertions.
Historical investigation used ro-prod metadata aggregates only. Server document update_time proves some due markers already existed before November 16; retained finalizer IDs still prevented repair admission under the old predicate. This is a latent projection-admission gap, not a universal absence of due fields or a reconstructed historical arming rate. Owning evidence and full five-question report:
data/run-2026-11-17-discussion-notes-rootcause/lane-f/REPORT.mdon m5-mbp. Follow-up CI/review receipts are in itsci-followup/directory. No titles/transcripts/user IDs were emitted by the historical probes. The required dated pipeline note and canonical summary-custody section document the conditional read, custody boundary and rollback.Already-drained enrollment remains proposal-only. The report specifies the exhaustive read-only count and five-field transactional patch, with fresh privacy, generation, age, summary and manual-edit guards. Neither that residue count nor backfill was run. Production writes require David's separate approval. No merge, deploy, flag change, requeue, index creation, record sealing, in_progress backlog or v3 rollout/behavior change. No overlap with #25617 alerting files.
Failure-Class: FC-content-write-omits-implied-obligation
Line-Count-Exception: backend/database/conversation_finalization_jobs.py | 3639 -> 3640 | Extract the existing collection constant into an import-safe schema module; no finalizer behavior changes.