Repository navigation
E1: batch pipeline policy snapshot - #22448
Conversation
# Conflicts: # backend/config/batch_pipeline.py
# Conflicts: # backend/testing/sync_cloud_tasks_stack/batch.py
# Conflicts: # backend/routers/batch_pipeline.py # backend/tests/unit/test_batch_pipeline_serving.py # backend/utils/batch_pipeline/serving.py
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: 3a62781fcf
ℹ️ 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".
| retire = min(parse_percent(env.get('BATCH_LIVE_STT_RETIRE_PERCENT', '0')), percent) | ||
| final_pass = False | ||
| if env.get('TRANSCRIPTION_FINAL_PASS_DIARIZER', 'legacy') == 'pyannote_shadow': | ||
| final_percent = max(0.0, min(100.0, float(env.get('TRANSCRIPTION_FINAL_PASS_PERCENT', '0')))) |
There was a problem hiding this comment.
Fail closed on malformed final-pass percentages
When TRANSCRIPTION_FINAL_PASS_DIARIZER=pyannote_shadow, a malformed TRANSCRIPTION_FINAL_PASS_PERCENT now raises ValueError here. Because sync_local_files_v2 unconditionally calls resolve_batch_policy(uid) before routing every upload, a typo in this otherwise unrelated final-pass setting makes all sync uploads return an error rather than merely disabling the final pass. Non-finite values are also unsafe: nan is clamped to 100 by this expression and unexpectedly enables the cohort. Parse this value with the same finite, invalid-to-zero handling used for the batch percentages.
Useful? React with 👍 / 👎.
# Conflicts: # backend/testing/pipeline_sim/README.md
…ider_reason='byok') The route stays language-only; provider_reason='byok' records that admission funded the unit while the validated keys were present. The provider stage never re-runs the keyless funding check for it. Writing the same value into ProjectionBinding.policy (lane 6's GPU dispatch skip) waits for E1 (#22448): neither ProjectionBinding.policy nor BatchUnitPolicy.provider_reason exists on integration yet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35e73d5005
ℹ️ 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".
| policy = replace( | ||
| resolve_batch_policy(uid), batch_enabled=True, live_admission_enabled=True, live_record_enabled=True | ||
| ) |
There was a problem hiding this comment.
Preserve the policy chosen when reserving native recordings
When a recording is reserved as batch_live_v1, this code can run minutes or hours after the route was chosen, but it resolves every policy field from the current environment and only forces the three batch/live booleans. If rollout percentages or final-pass settings change while the recording is in progress, the durable job records new batch_percent, retirement, and final-pass decisions rather than the policy under which the capture actually ran, corrupting rollout attribution and replay results. Persist the admission policy with the route reservation and reuse it here.
Useful? React with 👍 / 👎.
| if ( | ||
| outcome == 'ok' | ||
| and metadata['comparison']['remap_safe'] | ||
| and policy.final_pass_authoritative | ||
| ): | ||
| metadata['promoted'] = conversations_db.promote_final_pass_if_current( |
There was a problem hiding this comment.
Honor the recorded authority through final-pass promotion
When TRANSCRIPTION_FINAL_PASS_AUTHORITATIVE is rolled back after _run_shadow captures this policy but before the pass completes, this branch still runs under the recorded true decision, yet promote_final_pass_if_current immediately re-reads authoritative_for(uid)—both before and inside its transaction—and refuses the promotion. Because the old code checked enablement immediately before starting the pass, the new earlier snapshot can now spend the full final-pass work only to have the live downstream gate discard it; pass the recorded authority into the fenced promotion instead of consulting mutable rollout state again.
Useful? React with 👍 / 👎.
| job.get('recovery_state') == 'failed_held' | ||
| or RecoveryPolicy.from_dict( | ||
| (job.get('policy_parts') or {}).get('recovery', {}) | ||
| ).terminal_empty_disposition | ||
| and spent_canary(job) |
There was a problem hiding this comment.
Resolve legacy recovery policy before classifying canary rows
For a pre-E1 spent-canary job with recovery_state='held' and no policy_parts.recovery, this expression constructs the default policy, so terminal_empty_disposition is always false. The operator census calls SpeechRedriveStore.terminal from checked_job before prepare gets a chance to stamp the fallback stage policy, causing the historical canary row to be rejected as not_failed_held even when the recovery/disposition rollout is enabled; classify it with the candidate fallback policy (or stamp that part before the census) instead of treating an absent part as a recorded off decision.
Useful? React with 👍 / 👎.
…ion (lane 8 slice 2) (#22457) * feat(batch): C8 provider-STT stage core (lane 8 slice 1, behaviour-neutral) Adds the batch provider-STT stage for languages Parakeet cannot serve, so batch never needs the legacy fallback for them: - resolve_route(): admission-time stt_route/provider_reason/provider_service (contract (c) fields). Unknown language is 'multi' -> Parakeet, as legacy. BYOK never changes the STT route (sync prerecorded never used BYOK keys). - enqueue_in_transaction(): writes a provider unit as provider_pending with merge_pending set, outside the GPU DRR ring, keeping the owner revision fence and late-capture watermark. Intended for an admit() enqueue hook. - ProviderSttStore/ProviderSttStage: paid-once job-row intent (pending -> running CAS mints the token), one Modulate call with client retries disabled, deterministic per-token result object, settle to the same result_ready transition Scheduler.complete performs. Redelivery reconciles, never re-spends; vendor failure and abandoned intents settle failed_held (never 'held', so quarantine recovery cannot pay twice). Nothing imports the new module yet: intake wiring, the queue consumer and the router follow once the lane-1 stubs and the admit() hook land. Expected C8 traces are pinned under pipeline_sim_goldens_pending/ with a strict xfail until the sim configs exist. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(batch): route the intake language decision through provider_stt.resolve_route Behaviour-neutral at legacy_sync 'on': unknown and 'multi' languages keep today's legacy fallback explicitly, and a parametrized test pins the old and new conditions equal for every language class with and without BYOK. This is the seam the C8 provider route replaces in draining/dark. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(batch): keep the pending C8 golden check inside the fast-unit CPU budget Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(batch): admit() enqueue= and adopt= hooks (additive, keyword-only) Contract (a) amendment (lead ruling 10-19): enqueue= lets the C8 provider stage write its units and their outbox rows outside the GPU ring in the admission transaction; adopt= lets intake take over a legacy ledger row it re-validates inside that transaction (a row legacy can no longer finish). With both unset, behaviour is unchanged. File owned by E1/Sol: needs Sol's agreement before merge. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(batch): C8 provider-STT consumer, route and draining/dark admission (lane 8 slice 2) - ProviderSttConsumer (kind provider_stt, role workers, 1800s lease, no heartbeat) maps the stage onto contract (a) results; the route POST /v2/batch-pipeline/provider-stt/run answers 200 / 409 retry / 400 malformed under Cloud Tasks OIDC, never 429/503. - Intake, with legacy_sync draining or dark: a language Parakeet cannot serve is admitted to the provider stage (outbox row in the admission transaction, wake after commit); legacy-owned content is fenced per contract (h) invariant 4 through lane 10's fence_decision; a stranded legacy row is adopted once by the admit() adopt= CAS; a legacy final-pass recording is acknowledged, never re-admitted. At 'on' every route is today's. - BYOK (David, 10-19): routed like every other upload. The batch 503 sync_batch_byok_unavailable and the live-upload legacy owner choice for BYOK are removed; enrichment runs on Omi's keys. - merge.py (lead sign-off, one line): provider results carry the recovery_version marker, so projection uses vendor labels as for recovered units. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(batch): resolve the provider-STT outbox off the event loop Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(batch): keep lane-8 tests inside the fast-unit CPU budget Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(batch): record BYOK as the admission-time funding decision (provider_reason='byok') The route stays language-only; provider_reason='byok' records that admission funded the unit while the validated keys were present. The provider stage never re-runs the keyless funding check for it. Writing the same value into ProjectionBinding.policy (lane 6's GPU dispatch skip) waits for E1 (#22448): neither ProjectionBinding.policy nor BatchUnitPolicy.provider_reason exists on integration yet. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
|
Two-lane lead (legacy-retire swarm): please add these fields to
Why: lane 8 (#22457, merged to integration/legacy-retire) admits BYOK uploads into batch, and lane 6's dispatch funding skip (#22425) keys on |
…slice 3, stacked on #22457) (#22467) * feat(batch): C8 provider-STT stage core (lane 8 slice 1, behaviour-neutral) Adds the batch provider-STT stage for languages Parakeet cannot serve, so batch never needs the legacy fallback for them: - resolve_route(): admission-time stt_route/provider_reason/provider_service (contract (c) fields). Unknown language is 'multi' -> Parakeet, as legacy. BYOK never changes the STT route (sync prerecorded never used BYOK keys). - enqueue_in_transaction(): writes a provider unit as provider_pending with merge_pending set, outside the GPU DRR ring, keeping the owner revision fence and late-capture watermark. Intended for an admit() enqueue hook. - ProviderSttStore/ProviderSttStage: paid-once job-row intent (pending -> running CAS mints the token), one Modulate call with client retries disabled, deterministic per-token result object, settle to the same result_ready transition Scheduler.complete performs. Redelivery reconciles, never re-spends; vendor failure and abandoned intents settle failed_held (never 'held', so quarantine recovery cannot pay twice). Nothing imports the new module yet: intake wiring, the queue consumer and the router follow once the lane-1 stubs and the admit() hook land. Expected C8 traces are pinned under pipeline_sim_goldens_pending/ with a strict xfail until the sim configs exist. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(batch): route the intake language decision through provider_stt.resolve_route Behaviour-neutral at legacy_sync 'on': unknown and 'multi' languages keep today's legacy fallback explicitly, and a parametrized test pins the old and new conditions equal for every language class with and without BYOK. This is the seam the C8 provider route replaces in draining/dark. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(batch): keep the pending C8 golden check inside the fast-unit CPU budget Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(batch): admit() enqueue= and adopt= hooks (additive, keyword-only) Contract (a) amendment (lead ruling 10-19): enqueue= lets the C8 provider stage write its units and their outbox rows outside the GPU ring in the admission transaction; adopt= lets intake take over a legacy ledger row it re-validates inside that transaction (a row legacy can no longer finish). With both unset, behaviour is unchanged. File owned by E1/Sol: needs Sol's agreement before merge. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(batch): C8 provider-STT consumer, route and draining/dark admission (lane 8 slice 2) - ProviderSttConsumer (kind provider_stt, role workers, 1800s lease, no heartbeat) maps the stage onto contract (a) results; the route POST /v2/batch-pipeline/provider-stt/run answers 200 / 409 retry / 400 malformed under Cloud Tasks OIDC, never 429/503. - Intake, with legacy_sync draining or dark: a language Parakeet cannot serve is admitted to the provider stage (outbox row in the admission transaction, wake after commit); legacy-owned content is fenced per contract (h) invariant 4 through lane 10's fence_decision; a stranded legacy row is adopted once by the admit() adopt= CAS; a legacy final-pass recording is acknowledged, never re-admitted. At 'on' every route is today's. - BYOK (David, 10-19): routed like every other upload. The batch 503 sync_batch_byok_unavailable and the live-upload legacy owner choice for BYOK are removed; enrichment runs on Omi's keys. - merge.py (lead sign-off, one line): provider results carry the recovery_version marker, so projection uses vendor labels as for recovered units. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(batch): resolve the provider-STT outbox off the event loop Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(batch): keep lane-8 tests inside the fast-unit CPU budget Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(batch): record BYOK as the admission-time funding decision (provider_reason='byok') The route stays language-only; provider_reason='byok' records that admission funded the unit while the validated keys were present. The provider stage never re-runs the keyless funding check for it. Writing the same value into ProjectionBinding.policy (lane 6's GPU dispatch skip) waits for E1 (#22448): neither ProjectionBinding.policy nor BatchUnitPolicy.provider_reason exists on integration yet. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(batch): cap-hold rehome adapter into batch admission (lane 8, C11 precondition) cap_hold_admission.admit_held decodes a claimed, sealed, unspent hold into one WAV and admits it through the same batch intake as uploads, under a content id derived from the hold, so a retried sweep re-presents the same content and the batch ledger guarantees one unit. Enabled only while legacy sync is draining or dark (cap_hold_mode batch_hold). Holds legacy recovery already spent on (piece receipts / processed paths) are refused and finish on the legacy path. Imports nothing from utils.sync.pipeline (C11). intake.accept_upload gains decode= for server-held audio; capture_decode exposes its canonicalization as canonical_pcm. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(sync): hand eligible cap holds to batch admission in recover_selected The one hook in #22388's recovery path (driven by /v2/cap-hold-recovery/sweep): under the existing row claim, an eligible hold in draining/dark is admitted to batch, marked batch_admitted, and erased; batch projection owns the conversation and usage, so the hold is never settled as legacy-transcribed. At legacy_sync 'on' the legacy path is unchanged. File owned by the Subscription session: needs its agreement before merge. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(batch): Firestore outbox for provider_stt (contract (b), lane 8) One row per provider unit keyed by its batch segment id, in a stage-scoped collection (dev and prod share a Firestore project). Lease-token fencing on every post-claim mutation, STALE/BUSY/DEFERRED/DISCARDED claim outcomes, transactional enqueue in the caller's batch transaction with the wake after commit, privacy discard at claim and sweep, and a sweep that re-wakes only lost wakes (older than 600s, no live lease). Wakes are pst- named Cloud Tasks built in utils/provider_stt_tasks.py, outside the env-ratcheted paths. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(outbox): route OutboxKind.PROVIDER_STT to lane 8's Firestore outbox The one-line selector branches in FirestoreOutbox and firestore_outbox (lead ruling 10-19: lane 8 owns the provider_stt outbox, lane 9's seam). Lane 9's selector tests now pin the still-reserved CAP_HOLD_REDRIVE as unserved. Lane 9's file: flagged for lane 9. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(firestore): register the provider-STT outbox claim/sweep query drivers Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(sync): gate cap-hold batch hand-off like legacy dispatch; batch_admitted is terminal Subscription-session review of #22467 (comment 6264627147): - The batch branch now runs _new_dispatch_allowed (funded allowance, hard restriction, daily audio ceiling) before admit_held; a gated owner's audio stays held. - A batch_admitted row is terminal: re-selecting it never claims, re-admits or settles (settlement would bill twice); it only finishes an interrupted erase. The adapter treats batch_admitted/completed/retained/purged as ineligible. - Tests pin the summary decrement in checkpoint's own transaction on held -> batch_admitted (once, not per retried save) and the re-select no-op. The durable sweep's backlog page (held/staging/sealing) and discovery kinds already skip batch_admitted rows. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a743ec1bd5
ℹ️ 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".
| summary_policy = ( | ||
| FirstSummaryPolicy.from_dict(row['first_summary_policy']).first_summary_enabled | ||
| if row.get('first_summary_policy') is not None | ||
| else summary_enabled(row['uid'], include_admitted_context=False) or preserves_admitted(row) |
There was a problem hiding this comment.
Route snapshotted summaries through the priority pool
When an outbox row was stamped with first_summary_enabled=true and FIRST_SUMMARY_DEADLINE_ENABLED is later rolled back, this branch still treats the row as deadline-bound, but enrichment_response in backend/routers/batch_pipeline.py continues to choose sync_executor solely from the current flag. The accepted summary can therefore queue behind long transcription work and miss its recorded 60–120 second deadline after rollback; carry the recorded decision into executor selection or consistently use the post-processing pool for these batch summary rows.
AGENTS.md reference: backend/AGENTS.md:L274-L275
Useful? React with 👍 / 👎.
| if self.projector and self.projector.has_async_followups: | ||
| await self.projector.start_followups() |
There was a problem hiding this comment.
Schedule follow-ups independently of the current sweep page
With mixed recorded projection policies and more than one page of pending results, this gate reflects only the current Projector.discovery page, while ProjectionFollowups advances a separate cursor and filters its own page for async rows. If the follow-up page contains only synchronous or blocked rows, it launches nothing and cannot advance again until the main cursor eventually encounters another async row; sparse async receipts can consequently wait multiple full backlog scans, potentially hours, before client completion. Invoke the follow-up scheduler on every reconciliation once mixed policies are possible, rather than gating its independent cursor on the main page.
Useful? React with 👍 / 👎.
| if policy is None or not policy.projection_timing: | ||
| yield | ||
| return |
There was a problem hiding this comment.
Preserve read-phase timing under the recorded policy
When a unit's recorded projection policy enables timing, persist() still calls projection_phase('read') without supplying that policy, and project() performs its initial read outside the context manager entirely. Because this new condition disables timing whenever policy is absent, the enabled rollout silently loses all read-phase measurements and under-reports projection latency. Measure the read first and conditionally emit it after the persisted policy has been loaded.
Useful? React with 👍 / 👎.
| if row.get('summary_lane') == 'batch' and row.get('first_summary_policy') is None: | ||
| if candidate is None: | ||
| candidate = resolve_stage_policy(row['uid'], 'first_summary', obligation=row) | ||
| row['first_summary_policy'] = candidate.to_dict() | ||
| row['first_summary_policy_source'] = 'fallback' |
There was a problem hiding this comment.
Carry the first-summary policy through redirect custody
When an enabled batch summary is redirected to a canonical conversation, transfer_redirect copies its deadline and lane but not first_summary_policy. The target therefore reaches this fallback branch and is reclassified from the current environment (or retains a dormant target's unrelated policy); after a rollout rollback, an already admitted summary can become disabled and be completed without the promised first summary. Transfer the donor's immutable policy and source alongside its deadline, resolving conflicts according to the earliest obligation.
Useful? React with 👍 / 👎.
| summary_policy = ( | ||
| FirstSummaryPolicy.from_dict(row['first_summary_policy']).first_summary_enabled | ||
| if row.get('first_summary_policy') is not None | ||
| else summary_enabled(row['uid'], include_admitted_context=False) or preserves_admitted(row) | ||
| ) |
There was a problem hiding this comment.
Propagate the recorded summary decision into nested gates
When an admitted row records first_summary_enabled=true but the current first-summary master flag is rolled back, this branch sets only the local summary_policy; ADMITTED_OWNER below is still populated through preserves_admitted(row), which is false after that rollback. Nested processing such as llm_input_dedupe.notes() consequently sees summary_enabled(uid)==false and can reuse a cached server-minimum with no overview instead of generating the promised summary, after which the outer check treats the output as empty. Seed the nested feature context from the recorded policy and allow it to override the mutable master flag.
Useful? React with 👍 / 👎.
…22450, #22497 sync) E1 (batch policy snapshot) conflicted with legacy-retire in 7 files; per-owner resolutions: - lane 8: database/batch_pipeline_intake.py, utils/batch_pipeline/intake.py, live_upload.py (E1 policy= + admit enqueue=/adopt= hooks), provider_stt.py (enqueue hook takes policy=). - lane 9: utils/sync/reprocess.py stays the alias shim; E1's first-summary policy snapshot is ported into utils/enrichment/outbox.py (mark_update/run), outbox_firestore claim_key/consumer and projection.mark_enrichment; config/policy/guard.py RESOLUTION_EDGES moved to the outbox (lead sign-off, Sol FYI). - lane 6: config/batch_live_preview.py takes E1; config/policy/batch.py reads the _ramp runtime percents in resolve_batch_policy when flags is None (lead sign-off; Sol no objection). test_runtime_percent.py covers ramp wins/recorded, env fallback, explicit flags never read _ramp, retire clamped after runtime batch, and source-blind policy_id. - lane 1: routers/batch_pipeline.py drops the env read (E1) and keeps the 409 kill switch. Verified (unit, m5): runtime_percent, batch_unit_policy (E1 guard), batch_stage_policy, batch_pipeline_serving, quarantine_recovery, batch_provider_stt, outbox_firestore, enrichment_route, task_target_retry_semantics, app_roles census: 359 passed, 3 xfailed.
Result
E1 records immutable policy parts where their owners make the first decision. Admission persists only its own fields. Projection, scheduler and recovery each CAS a part on first handling; first-summary policy is stamped when its obligation is created. Every part has
schema_version,source_roleand a stable content-hashpolicy_id. Subsequent handling and replay consume the recorded part, preserving the first writer across env changes and restarts.This implements the parent's 2026-10-19 per-owner source ruling. No new RPC, env/config/IAM edits, or prod/dev env-value changes. Worker-owned
pump.pyanddiarizer/batch_pipeline.pyare untouched by this diff; main's #22358 GPU controls remain explicit E1b exceptions;EMPTY_ASR_*and worker dispositions remain E1b. Listen session policy remains E2.Per-role ownership
policy(outsideprojection_binding), Redis sync job besideledger_fence_modepolicy_parts.projectionpolicy_parts.schedulerpolicy_parts.recoveryfirst_summary_policy; sim's recorded obligationRead-only
ro-prodevidence compared the two traffic-serving Cloud Run revisions (not templates). They differ on these seven keys, so an intake-wide snapshot would change behavior:BATCH_PIPELINE_AUTHORITATIVE_LABELS_ENABLED,BATCH_PIPELINE_REQUIRE_LIVE_TARGET_ENABLED,BATCH_PIPELINE_PROJECTION_CONTENTION_ENABLED,BATCH_PIPELINE_PROJECTION_TIMING_ENABLED,BATCH_PIPELINE_RECOVERY_MODE,BATCH_PIPELINE_SPEECH_EMPTY_MULTILINGUAL_ENABLED,BATCH_PIPELINE_TERMINAL_EMPTY_DISPOSITION_ENABLED. Key names only; no env values or user data are included here.When B ships a canonical stage profile, these owner parts can move to admission without changing consumers. E1 does not add a remote dependency.
Before / after read map
Process startup, auth/service endpoints, provider packing, scrape controls and recovery discovery page size remain outside E1 snapshot ownership. Live E1 ops switches use only
kill_switch(name): recovery task dispatch, projection pagination and the leader lease (which retains its on-unless-false semantics). The allowlist is checked against registrylifecycle: ops_kill. Privacy/deletion fences remain live data checks.The policy boundary fails direct reads of the declared snapshot-owned batch keys and live-switch keys outside
config/policy/, and rejects consumer calls that re-resolve stage getters. UnownedBATCH_PIPELINE_*keys print WARNING lines naming the file/key as E1b candidates, with a successful exit status. There is no hand-maintained worker-key allowlist, so another team's new worker knob cannot block their PR. Tests cover owned-key failures, live-switch failures, and warning-only handling for new unlisted keys.Examples awaiting E1b are
BATCH_PIPELINE_PUBLISH_CONCURRENCY(config/batch_pipeline.py, pump publication series),BATCH_PIPELINE_FLIGHT_BATCH_SECONDSandBATCH_PIPELINE_FLIGHT_BATCHING_ENABLED(config/batch_pipeline_providers.py, GPU batching / worker series #22368), andBATCH_PIPELINE_DIARIZE_SPEECH_ONLY_ENABLED/BATCH_PIPELINE_MODEL_BATCH_SIZE(diarizer/batch_pipeline_flight_qualify.py, #22368). These remain worker-owned and are not snapshotted by E1.Cohort salts and retirement
Retire percent is clamped to batch percent and retirement additionally requires batch admission. This intentionally closes unsafe retire-without-batch configurations. Every new percentage cohort needs its own nonempty salt; E1 does not reassign existing first-summary/final-pass users.
Grok follow-up
record_pendingreservation from a fresh cohort check, and its existing live regression expects draining after rollback. E1 preserves that accepted-work behavior, rejects an explicitly recorded false reserve bit, and adopts the recorded reserve part without comparing unrelated source-role/final-pass fields.role_policytrace records policy values, source roles and hashes under different sync/integration environments. Swapping either projection or recovery to sync must independently break its golden. Existing golden bytes remain unchanged.Validation
backend/test.sh, serially atnice -n 10.make preflightpassed all 36 local checks after moving native-record policy repair onto the database executor; Both final localmake preflightand CI-lane body preflight passed all 36 checks on the final tree.ro-prod, read-only serving-revision metadata comparison only. No product endpoint calls, deployment, config or IAM changes.The shared primitive is the immutable resolver plus durable per-unit snapshot. The AST guard enforces its boundary; it is not a replacement for the primitive. The real incident it prevents is the 2026-10-18 policy window, where obligations created at first-summary percent zero were graded against a later 120-second contract. The guard runs in both local and CI manifest lanes and rejects aliased/subscript env reads too.
Product invariants affected
INV-MEM-4 (
product/invariants/memory-promotion-authority.md): vector storage remains a rebuildable derived view. The canonical-vector test only moves its existing isolated database setup into a fixture; its real vector and privacy assertions remain intact. E1 does not change memory authority or promotion.Rollback
Revert E1 snapshot wiring. Admission and stage metadata are additive job fields;
projection_bindingretains the exact pre-E1 schema. A frozen constructor fixture from main 0d8e125 accepts the bindings E1 writes. No policy is copied into old bindings. Pre-E1 admission fallback is written only by an admitting role; other roles leave admission fields unset and stamp only their own part. Durable fields need no deletion. Preserve accepted-work drain and privacy fences. The parent handles Grok review/merge; deployment belongs to the two-lane train.Failure-Class: FC-additive-field-decides-identity