## Summary
Fourth and final source-only Alpha replacement-stack PR. This adds release verification and activation controls on top of #1876.
- keeps the production-shaped deployment in PUBLICATION_MODE=manual_only with scheduling enabled only for no-Redshift-write rehearsals;
- preserves strict legacy top-level and params.dry_run compatibility while rejecting malformed or conflicting values before secrets or Redshift;
- permits a controlled write only for an exact run through a tightly IAM-restricted direct Lambda invocation, with params.dry_run=false and a one-time token supplied only through Lambda ClientContext;
- rejects raw controlled tokens in event payloads so Step Functions/on-demand parameters cannot transport approval material or reach publication;
- adds a getpass-based direct invocation helper that keeps the token out of shell arguments, environment variables, files, logs, event payloads, and Step Functions history;
- adds a read-only release verifier for the globally newest publication, exact immutable S3 evidence, source-derived Decimal rebuild, all 11 publication tables, physical catalog/owners/ACLs/migration hashes, volume/provenance thresholds, and exact version-pinned Lambda identity;
- replaces the legacy README with the proposed v2 runbook while clearly stating that v2 is not deployed or current.
## Stack
1. #1872 — API contract and lossless transforms
2. #1874 — physical schema and trusted installer
3. #1876 — atomic publication and recovery
4. this PR — release verification and activation controls
This PR must target fix/alpha-atomic-publication and be reviewed against its exact parent/head.
## Safety boundary
Source only. This PR does not merge any stack layer, deploy Lambda, apply DDL, publish Alpha data, change production configuration, invoke the controlled path, or activate automatic publication.
The existing Step Functions/schedule route remains incapable of controlled publication: manual-only unmarked invocations rehearse, payload tokens are rejected, and controlled approval is accepted only from exact Lambda ClientContext. Production activation additionally requires a separately approved, tightly scoped lambda:InvokeFunction policy for the designated direct caller.
## Validation
Final exact pushed head: afdb6764ebb14d08cedd5c42b1bd002dec2cd3a1.
- pytest -q: 723 passed
- current Ruff check/format: passed
- pinned ruff==0.15.22 check/format: passed
- scoped Pyright: 0 errors / 0 warnings
- scripts/run_ddl.py: dry run only, 7 migrations / 79 statements
- native git diff ... --check: passed; worktree clean after commit
- exact stack ancestry: PR3 head 25d9756b449dccec9f84cc955e6d817ea37235d5 is the merge base
- independent verifier/data-contract/topology audit: SAFE
- independent controlled-invocation security audit: SAFE
- independent follow-up specifically confirmed the scheduled StartAt route reaches the exact validated InvokePipelineLambda state: SAFE
## Prior-review disposition
The prior critical assertion that raw_endpoint_payloads was omitted from verifier contracts is factually incorrect. Executable regression evidence proves it is present in the publication allowlist, table signatures, qualified-name gate, catalog expectations, and derived ACL expectations. The review did expose a related real physical-column defect: the verifier now reads JSON_SERIALIZE(payload_json), and the regression covers that exact physical contract.
The remaining blocking classes are repaired and covered on this exact head: exact application-level committed result schemas, unknown-response-field/token-exfiltration rejection, canonical numeric Lambda qualifier plus matching ExecutedVersion, encoded ClientContext limit, migration-before-deploy runbook order, qualified publication-version and terminal $LATEST readiness/configuration checks, source/warehouse grain multiplicity, complete release environment, exact EventBridge target/input, and reachable Step Functions-to-unqualified-Lambda topology.
The subsequent exact-head review raised three additional blocking classes. They are now repaired on b6f216cd: every one of the 11 publication-count entries has an explicit valid committed-result predicate in both normal and recovered schemas; the EventBridge target, target IAM role, state machine, and state-machine execution role are pinned to their exact production ARNs; and the complete nine-state ASL graph, all task resources/function ARNs, transitions, terminal states, and the only permitted catch branches are attested with no extra/unreachable state, catch, branch construct, ClientContext, or control material. Independent focused reviews of the count contract and complete IAM/topology contract both returned SAFE.
The latest exact-head review then identified one remaining blocker: approval-token keys nested inside event/params JSON. Head 77d80a0a recursively rejects the exact controlled_publication_token key in all dict/list payload shapes, including present null, with bounded fail-closed scanning before boolean resolution, ClientContext access, secrets, source calls, S3, or Redshift; actual Lambda ClientContext remains the only accepted approval channel. The same pass enforces the 3-character S3 bucket minimum and controlled non-string S3 URI failure. Focused validation passed (184 tests) and independent security review returned SAFE.
The next exact-head review found the last two verifier boundaries: partial ASL field attestation and first-page-only EventBridge target enumeration. Head 80116610 pins the complete canonical production ASL to SHA-256 bae1e86a5f00e7354b96f9c13b47aa4d8aeac5655902068bef467c464cd874d1 (independently recomputed from the saved read-only 5,357-byte production definition) before semantic checks, and exhausts all ListTargetsByRule pages before enforcing global exact-one cardinality. Regressions cover a second-page extra target and direct TimeoutSeconds hash drift. Full validation remains 585 tests and the final independent verifier audit returned SAFE.
Mercy approved exact head 80116610 and reported no blocking findings, but its remaining notes identified valid fail-closed hardening. Head 12a8b1ae makes the 18-key normal and 14-key recovered response schemas value-disjoint; counts every visited JSON value in the bounded recursive token scan; validates canonical S3 bucket syntax plus all current AWS-reserved general-purpose prefixes/suffixes; requires writer-canonical aware UTC evidence timestamps; and rejects retired release-gate environment variables instead of silently applying defaults. Full validation passed (609 tests), and three focused independent audits returned SAFE after the final reserved-name repair.
The next exact-head review identified a PostgreSQL/Redshift null-ordering defect and two evidence-hardening gaps. Head 1bd4504e globally rejects any published ledger row with a NULL published_at, retains explicit non-null DESC NULLS LAST selection, requires one exact committed attempt timestamp on the physical run/hash identity, rejects non-string warehouse raw error_code, and recursively rejects duplicate Lambda-response JSON keys before validation or output. Full validation passed (617 tests), and independent SQL and response-security audits returned SAFE. The review suggestion to bind dry-run/recovery/URI fields on publication_attempts was not implemented because those columns do not exist in its immutable physical contract; committed presence is instead proven through its actual non-null committed_at row and exact run/hash cardinality.
Mercy approved exact head 1bd4504e and reiterated an attempt-binding request that does not match the immutable four-column successful-attempt schema. Its two valid helper notes are repaired on head 54aa4a65: token-reflection checks now cover decoded string substrings and exact emitted numeric/boolean/null scalar bytes, while prompt EOF/interruption becomes the same generic controlled failure without a traceback. The AWS-documented -an rejection remains intentional for this global general-purpose bucket contract because that suffix is permitted only in the separate account-regional namespace. Full validation passed (625 tests) and the independent helper-security audit returned SAFE.
Mercy's review of head 54aa4a65 correctly identified that verifier evidence JSON still accepted duplicate object keys. Head 33095207 routes every verifier JSON surface through one recursive duplicate-key rejecting parser while preserving Decimal parsing for externally sourced measures and rejecting non-standard constants. It also makes the immutable ASL-hash regression structurally explicit: the expected digest is pinned before the TimeoutSeconds fixture mutation, asserted unchanged, and only later semantic-specific checks intentionally repin their fixtures. Full validation passed (626 tests), and independent JSON-security and ASL-test audits both returned SAFE. The repeated non-blocking -an suggestion remains intentionally rejected for the documented namespace reason above.
Mercy's review of head 33095207 confirmed the hash, JSON, and -an dispositions, then identified a real rollout-order risk: v2 intentionally rejects retired release variables at import, so they must not remain during code replacement. Head dca86a0a updates the future runbook to require a separate configuration-only removal of MIN_SCHOOL_COUNT and MAX_SCHOOL_COUNT_DROP_FRACTION while legacy v1 remains deployed, followed by Active/Successful and exact-absence checks both before v2 code replacement and before any invocation path is re-enabled. Runtime fail-closed behavior is unchanged. Full validation passed (626 tests) and the independent rollout-order audit returned SAFE.
Mercy approved exact head dca86a0a and confirmed the retired-variable rollout fix, while noting one valid nonblocking verifier defect and two valid hardening gaps. Head 4a40af57 applies the dated 91/47/44 assertions only to v1-to-v2-cutover, leaving v2-bootstrap governed by its configured bootstrap bounds; enforces the same canonical global S3 bucket/key contract before verifier reads; and requires snapshot.fetched_at to exactly round-trip the writer's aware UTC form. The fractional sheet_row suggestion was intentionally rejected because migration 004 explicitly preserves values such as 26.5 and the physical contract is NUMERIC(18,6); a regression now protects that contract. Full validation passed (639 tests) and the independent final working-tree audit returned SAFE.
Mercy's review of head 4a40af57 found one further request-surface gap: a token appearing in run_id or as JSON escape bytes could enter the Lambda Payload even though ClientContext was the intended sole token channel. Head 29037a02 checks every semantic nonsecret request surface (FunctionName, numeric Qualifier, InvocationType, and the complete event), checks decoded and JSON-serialized scalar forms, and rechecks the exact final Payload bytes before ClientContext construction or boto client creation. Regressions cover semantic strings, numbers/booleans, quotes, and the \n spelling versus an actual newline. Full validation passed (647 tests) and the independent security re-audit returned SAFE.
Mercy's review of head 29037a02 found a rollout compatibility ambiguity plus valid floor/output hardening. Head d143a5bd makes the future transition two explicit fail-closed CloudFormation gates: a configuration-only v1 revision may delete only the two legacy keys after proving their values equal v1 defaults, while normalized full configuration and exact v1 code SHA remain unchanged; v2 then requires exact reviewed code/state/status and full environment equality before EventBridge can be enabled. Both command blocks use set -euo pipefail and cleanup traps. The cutover floor is positive. Controlled results are privately written, flushed/fsynced, and atomically hard-linked to a create-only final path; failed temporary writes are removed; stdout failures stay generic. Decoded string token matches remain substring-based, while non-string response scalars require exact complete JSON encodings. The invalid multi-head fast-forward command now uses only the final stacked head. Full validation passed (653 tests), and independent rollout and output-publication audits returned SAFE.
Mercy approved exact head d143a5bd and left one non-blocking hardening note: verifier CLI deployment inputs were not all rejected before Secrets Manager and Redshift access. Head 5f5dff48 closes that gap. Before any credential access, the verifier now requires a valid bare Lambda function name, a canonical base64-encoded 32-byte CodeSha256, exact manual_only and immutable raw-location controls, a canonical controlled token digest, and equality between the expected and controlled run IDs. Manifest binding and all later read-only deployment checks remain fail-closed. Full validation passed (656 tests), and the independent pre-credential audit returned SAFE.
Mercy's review of 5f5dff48 identified one blocking approval-material path and two valid hardening notes. Head 2edef21d hashes every event string scalar and dictionary key and uses constant-time comparison against the configured approval-token digest, so the exact token is rejected under arbitrary names before secrets, source, S3, or Redshift; reserved token keys, including null, and all existing bounds remain fail-closed. The runbook now waits for exact DISABLED and ENABLED EventBridge states before proceeding. Set-valued successful verifier checks serialize as deterministic sorted JSON arrays. Full validation passed (659 tests), and independent token-value security plus EventBridge/serialization audits returned SAFE.
Mercy's review of 2edef21d raised five items. The stated school_models omission was false—the table was already in value-level reconciliation—but head 6e93646f adds an exact reconciliation allowlist invariant covering every derived publication table while retaining separate exact raw-payload reconciliation. Valid findings are fixed: ClientContext plaintext enables a second pre-work scan for decoded token substrings in all event strings/keys; the freeze includes the exact EventBridge target role plus all on-demand principals and proves zero running executions immediately before DDL; the exact numeric version is captured from publish-version and remains in one protected shell through qualified read-back, grant, and invocation; $LATEST and later automatic activation have exact post-update read-back gates; and private-temp cleanup failure is surfaced generically. Full validation passed (663 tests). Independent token-substring, reconciliation/cleanup, and drain/read-back audits returned SAFE.
Mercy approved exact head 6e93646f and reported four runbook items. Its claim that jq should not compare .Version to the literal "$LATEST" was incorrect—AWS returns exactly that literal for unqualified configuration—and the automatic environment comparison is intentionally against the separately reviewed future source change. Head 78c03001 makes those assumptions explicit and repairs the valid operational gaps: full controlled and terminal environment updates are executable; the published numeric version remains in one shell through read-back/grant/invoke; the exact qualified-only inline role grant is created, read back, used, retried/revoked, and proven absent on normal and failure paths; every executable placeholder is shell-quoted; and automatic activation first proves the reviewed source environment is already automatic. All six Bash blocks pass bash -n; full validation remains 663 tests; the independent final command audit returned SAFE.
Mercy approved exact head 78c03001 with five further hardening findings. Head 6143614b independently requires complete official/rule-fallback/genuine-budget provenance before warehouse matching; makes every runbook cleanup failure loud; normalizes both object and URL-encoded IAM policy read-backs; rejects empty and NUL-containing output basenames generically; and fsyncs supported parent directories after final-link creation and temporary-name removal. The literal "$LATEST" jq checks remain intentionally correct because that is the AWS unqualified Version value. Full validation passed (673 tests), all six Bash blocks pass bash -n, and independent provenance, cleanup/policy, and output-durability audits returned SAFE.
Mercy's review of 6143614b exposed the digest-only substring limitation. Head 82767604 closes the class: a numeric version with configured controlled identity now rejects every no-ClientContext invocation before secrets, source, S3 (including failure markers), or Redshift; terminal $LATEST with empty controls retains legacy/scheduled dry runs; actual controlled requests still receive full plaintext substring scanning and constant-time digest binding. It also restricts helper function names to bare Lambda grammar, adds private atomic create-only verifier output, removes final output on post-link durability failure, and uses restrictive Windows/POSIX creation modes. Full validation passed (723 tests); configured-version and local-output audits returned SAFE. Mercy's full synthetic verify() fixture suggestion is retained as non-blocking test debt: the repository lacks 534 historical endpoint captures and a complete warehouse/catalog export, while current DDL/schema oracle tests cover the physical contract and the release run itself mandates the real read-only verifier. The hard-coded production identifiers are intentional pins and verify_schedule live-gates their exact rule, target, roles, ASL, account, and region.
Mercy review of 82767604 identified operational gaps now closed at 7ca1e7df: every runbook shell pins the runner directory; the temporary exact-resource states:StartExecution deny is applied, simulated to explicitDeny, later removed and proven absent, and the EventBridge target role is simulated back to allowed before enable; verifier evidence must be a fresh create-only artifact and is gated by PASS plus run/function/code/version identity; zero-school rejection occurs before dependent arithmetic; --output is nonempty, valid, and absent before credentials; and the live topology now hard-pins pipeline-alpha-public-api-sync-prod. Full validation passed 723 tests. Independent path/freeze/artifact and final code re-audits returned SAFE. The zero-school review claim that division preceded rejection was stale for 82767604, but head 7ca1e7df moves the guard to the start of verify() and adds explicit order coverage.
Mercy review of 7ca1e7df identified recovery, alternate-token-spelling, marker-boundary, and provenance gaps closed at d93dfbb4. A trap is now armed before the first freeze mutation: pre-DDL failure retries and proves removal plus restored allowed/ENABLED; immediately before DDL apply it switches to deliberate fail-closed retention; every failed v2 transition retries and proves DISABLED plus explicitDeny for every role, exiting 97 if recovery cannot be proven. All AWS blocks share one profile, region, and STS account. Token scanning linearly decodes all valid JSON short, \uXXXX, surrogate-pair, and escaped-slash spellings across values and keys. Secret configuration remains before the external-work marker boundary. Runtime transforms and the verifier both require exact aware-UTC +00:00 snapshotAt writer round-trip form across official, fallback, and genuine-budget provenance. Full validation passed 723 tests; independent cleanup, token/boundary, and provenance/AWS audits returned SAFE.
Mercy review of d93dfbb4 identified CloudFormation survivability, IAM create-only recovery, and pre-invocation output gaps closed at d4bca9db. The rollout freeze now uses a reviewed immutable-ID Organizations SCP: an unconditional deny scoped only to production account 479395885256, states:StartExecution, and the exact state machine. It covers all current/replacement principals and cannot be removed by CDK role mutation. Exact content/type and tri-state attachment are read before attach, immediately pre-DDL, and post-deploy. A validated <80-day terminal STANDARD execution name provides a real non-mutating authorization probe (ExecutionAlreadyExists detached; AccessDenied attached). Recovery reattaches by ID, never overwrites an IAM policy, and exit 97 remains fail-closed. Controlled helper output is preflighted before getpass or Lambda. $LATEST recovery now retries and proves exact empty/manual source state after any uncertain controlled update, and qualified IAM grants use a validated random UUID name. Captured fixture adaptation asserts an exact legacy allowlist before canonical mapping. Full validation passed 723 tests; SCP rollout, $LATEST cleanup, and output/fixture audits returned SAFE.
Mercy review of d4bca9db reported the DDL marker after --apply, although the exact pushed file placed it immediately before. Head afdb6764 removes the boolean entirely so the state cannot be misread or regress: the pre-DDL restore trap is structurally installed before the first AWS mutation, then replaced immediately after local dry-run and immediately before --apply by a post-DDL trap with no SCP detach or EventBridge enable path. Any apply ambiguity therefore retains the complete freeze. It also adds an explicit huge-integer regression proving _is_finite_number catches OverflowError. Full validation passed 723 tests; structural SCP re-audit plus independent full suite returned SAFE.
## Exact-head review closure (55699ebc)
Mercy review of afdb6764 identified six blocking release-control gaps. Exact head 55699ebc3e51a3ec7f97d0b790d0c4c922031a2e closes each one:
- Organizations Policy.Content is decoded as raw or URL-encoded JSON and compared in canonical compact/sorted form at every lifecycle read.
- v2 recovery propagates attachment, authorization-probe, wait, and stale-probe-file failures explicitly even when Bash suppresses errexit; an unprovable recovery exits 97.
- temporary qualified IAM access requires a pre-grant implicitDeny; revocation requires policy absence plus propagated implicitDeny twice around a guarded 30-second wait.
- event traversal charges dictionary keys and values within the root-inclusive 10,000-node budget, and configured-token digests match raw and valid decoded JSON spellings before ClientContext plaintext is available.
- only exact empty strings in both controlled settings mean unconfigured; falsy malformed values fail before secrets, S3 markers, source calls, or warehouse access in both manual_only and automatic modes.
- both output writers retain a duplicate descriptor, verify source/final inode identity in a private parent, invalidate a linked success artifact through the held descriptor on any post-link failure, retry removal, and reject any remaining mismatched inode. Descriptor-duplication failures close the original descriptor. The verifier publishes only its required output artifact and emits no sensitive stdout payload.
- fallback provenance now uses the strict canonical aware-UTC +00:00 timestamp validator.
The complete exact-tree validation passed 741 tests, current Ruff, pinned Ruff 0.15.22, Pyright with 0 errors, DDL dry run, all six extracted runbook Bash fences under bash -n, secret scanning, and diff checks. Independent policy/recovery/revocation, scanner/configuration, and output-invalidation audits each returned SAFE.
## Exact-head review closure (51f2e834)
Mercy review of 55699ebc identified two blocking activation/topology defects and four high-severity follow-ups. Exact head 51f2e8347dd9280da791b12820e5b8af1c018f88 resolves the concrete defects:
- Before the v2 SCP is detached or EventBridge is enabled, verify_schedule(..., expected_rule_state="DISABLED") now attests the exact rule expression, single paginated target, target ARN/input/role, state-machine role/type/status, nine-state workflow, Lambda resources, and canonical ASL hash.
- Automatic activation now arms recovery before mutation, independently disables EventBridge and attaches/proves the exact SCP before deployment, retains both freezes through Lambda/environment/topology checks and schedule enable read-back, and detaches only after those gates. Any partial failure independently retries both containment paths; an unproven recovery exits 97.
- Translation identity is shape-bound: legacy resources require alpha-public-api-v1, v2 resources require alpha-public-api-v2, and handler settings now flow consistently through the builder, snapshot, manifest, committed result, and ledger.
- MIN_BUDGET_SCHOOL_COUNT flows into the self-contained v2 builder and is independently revalidated there.
- Step 7 binds the create-only controlled-result artifact to the independently verified live ledger across run/attempt, normal-or-recovered commit semantics, manifest identity, counts, translation version, and publication multiset counts.
- Canonical warehouse timestamps now have a real datetime round-trip regression. Both output writers have explicit fault tests for the terminal case where directory durability, unlink, and held-inode invalidation all fail: the producer always fails, and consumers are forbidden to treat residual bytes as proof without that successful producer exit.
Two audit evidence corrections are explicit. The reported verifier short-write gap was false at 55699ebc: both writers already compared file.write(...) with the exact byte length before flush/fsync/link. The residual-PASS scenario is physically possible only when every revocation I/O mechanism also fails; the disposition remains blocked/fail-closed because the producer raises and the runbook requires successful producer exit plus independent run-bound ledger verification. This matches the reviewed best-effort removal contract rather than claiming impossible filesystem guarantees. Directory-entry fsync remains required where the platform supports O_DIRECTORY; Windows uses CPython's current-user-restrictive 0o700 creation ACL.
The complete exact-tree validation passed 744 tests, current Ruff, pinned Ruff 0.15.22, Pyright with 0 errors, DDL dry run, all six extracted runbook Bash fences under bash -n, secret scanning, and diff checks. Independent activation/topology and version/threshold audits returned SAFE; independent artifact triage confirmed the producer-failure contract and the narrow controller-to-verifier binding.
## Exact-head review closure (5621502e)
Mercy review of 51f2e834 identified two remaining blockers. Exact head 5621502ed8346943697303417f62af2d75f87d6b closes both:
- After the schedule and all new starts are frozen, automatic activation polls the exact production state machine until no RUNNING execution remains. It repeats that zero-running proof after CDK diff and immediately before deployment while the proven SCP prevents any new execution from entering.
- Controlled and verifier output validation walks every existing absolute path component before token/credential access and again immediately before writing. It rejects symbolic links, Windows junctions, and all Windows reparse points. Windows output publication fails before sensitive access on Python older than 3.13, where the required current-user-only 0o700 ACL behavior is unavailable.
- Invoke preflight retains the private create/delete/directory-fsync probe before token access; its post-remote recheck is side-effect-free. Both final writers retain create-only hard-link and exact inode protections.
- Verifier reconstruction now passes the exact settings.TRANSLATION_VERSION and settings.MIN_BUDGET_SCHOOL_COUNT values into the builder.
The repeated residual-PASS finding does not change disposition: if directory durability, three unlinks, and held-inode invalidation all fail, the producer returns a generic failure and consumers must not accept the bytes. Explicit regressions cover that terminal I/O case. This is the reviewed best-effort-removal contract; no filesystem protocol can revoke an already-visible inode after every revocation mechanism is stipulated to fail. Directory-entry fsync remains enforced where O_DIRECTORY exists, as required. Complete synthetic verify() orchestration remains deferred non-fabricated test debt; live read-only verification is still mandatory.
The complete exact-tree validation passed 748 tests, current Ruff, pinned Ruff 0.15.22, Pyright with 0 errors, DDL dry run, all six extracted runbook Bash fences under bash -n, secret scanning, and diff checks. Independent activation-drain/topology and nested-path/verifier-configuration audits returned SAFE.
## Exact-head review closure (44bf8795)
Mercy review of 5621502e identified three blocking classes. Exact head 44bf8795c1772868bb3f93d27b5e990b22dc32ce closes them:
- Controlled token scanning now handles intentional bytes, bytearray, and memoryview values without treating every transport payload as a token. It scans exact compact container bytes as well as semantic strings/keys/values, detects token text spanning JSON structure, preserves exact scalar semantics, and fails closed on cyclic/non-serializable containers. getpass OSError is generic.
- Retained duplicate-name probes must now be genuinely terminal and NOT_REDRIVABLE; PENDING_REDRIVE is not accepted. Before DDL or automatic deployment, all FAILED/TIMED_OUT/ABORTED executions are paginated and described to prove none is REDRIVABLE or REDRIVABLE_BY_MAP_RUN, followed by exact zero RUNNING and zero PENDING_REDRIVE checks under the proven new-start freeze immediately before mutation.
- Pre-DDL recovery now handles every detach, duplicate-probe, IAM-simulation, and schedule-enable failure by independently disabling the rule and reattaching/proving the SCP. Unproven containment exits 97.
- All inline Python safety gates use explicit sys.exit, not optimization-removable assert.
- Fixture normalization no longer hides missing/null provenance coverage: direct production-transform regressions reject both forms.
- Migration verification owns an independent immutable 001–007 hash map. Tests mutate the settings map and separately reject missing, extra, and wrong ledger rows.
- POSIX/Windows creation-mode tests execute the real selector branch before restoring the native platform for filesystem operations.
One review evidence correction is explicit: at 5621502e, the pre-client semantic request surface used an event dict, not a byte-valued Payload, so the claim that every normal invocation already failed before boto3.client() was false. The underlying byte-support and complete serialized-surface gaps were still valid hardening defects and are now covered. AWS Lambda GetFunction does not define a top-level ExecutedVersion; the immutable numeric version is already proven through the returned qualified configuration .Version. Directory durability remains conditional on platform O_DIRECTORY, per the reviewed contract, and complete historical verify() orchestration remains deferred non-fabricated test debt.
The complete exact-tree validation passed 759 tests, current Ruff, pinned Ruff 0.15.22, Pyright with 0 errors, DDL dry run, all six extracted runbook Bash fences under bash -n, secret scanning, and diff checks. Independent byte/token, resumable-execution/recovery, and regression-independence audits returned SAFE.
## Deferred integration proof
As in #1874, destructive 005–006 rollback/restart behavior requires an authorized disposable Redshift integration environment. No mock is presented as database rollback proof, and no production DDL was run.
## 2026-09-16 exact-parent rebase and validation
This PR was rebased after PR #1876 merged. Its exact parent is current main commit e37d7d414fce709a18e624e5784ca215998d829f; exact head is c6b1fe8c02a032936727c3591bd71dd619f1e02f. The validated local route-attestation repair is included. The review diff is the 14 release-control files only (7,647 additions / 229 deletions); inherited PR #1–#3 changes are excluded.
Exact-tree validation before the guarded force-with-lease push: full test suite, current and pinned Ruff, formatting, Pyright 0 errors, immutable DDL dry run, Git diff checks, and bash -n on all six README operational fences. Fresh CI and Mercy are required for this exact head.
## 2026-09-16 timestamp-review clarification
Mercy’s only blocking report on c6b1fe8c interpreted the producer timestamp regression as accepting arbitrary Redshift readback strings. The test instead validates build_publications output after normalize_source_timestamp/normalize_provenance_snapshot_at, whose explicit canonical producer form is UTC-naive ISO microseconds with a T separator. Commit 163dbb591ff8b3eefb73c898428332c51439d833 renames the test and makes that T boundary explicit with no runtime behavior change. Focused test and complete exact-tree validation passed before push. Fresh CI and Mercy are required for this exact head.
## 2026-09-16 Yibin review closure
Exact repair head: cd4ad3cf3727fdb6c08c17d57b2277721adadef4.
The earlier timestamp-review interpretation above is superseded by captured live-source evidence: valid aware Z/offset wire timestamps are normalized; documented explicit-null official/rule-fallback snapshotAt values are preserved; missing fields, naive/invalid values, and null genuine-budget provenance still fail closed.
All four blockers are repaired:
1. captured live timestamp/null forms are accepted without weakening genuine-budget provenance;
2. verified lost-ack recovery immediately returns the frozen exact 14-key result;
3. both helper and Lambda require alpha-cp-v1-[0-9a-f]{64} before invocation/publication work;
4. verify_release requires only REDSHIFT_SECRET_ARN, while the source-fetching runtime still requires both secrets.
All four high-priority findings are also addressed or explicitly bounded:
- the helper is bound to exact function pipeline-alpha-public-api-sync-prod; the qualified IAM grant remains ephemeral and is proven/revoked inside the protected runbook block;
- controlled cutover 91 / 47 genuine / 44 fallback checks now run in the producer before publication mutation, while ordinary automatic runs retain the generic producer contract;
- the exact EventBridge route is disabled and re-attested while controlled fields exist on $LATEST, with fail-closed terminal restoration before re-enable;
- the verifier releases Redshift before remote S3/AWS calls, reopens, and requires exact ledger identity before live checks. The bounded 91-school/547-endpoint in-memory multiset verification is accepted for this first release and documented as requiring redesign before contract expansion.
Validation on this exact tree: 770 tests, current and pinned Ruff, format checks, production-module Pyright with 0 errors, immutable DDL dry run, secret/diff checks, and all six README fences under bash -n. Independent blocker and high-priority audits both returned SAFE. Fresh CI and Mercy are required for this exact head; human review remains required before merge.
## 2026-09-16 exact-head Mercy follow-up
Exact repair head: 363f60e0f247438a0f550f196dd5caa0d41e4e50.
One repeated critical claim is explicitly rejected: recovered publication_counts are variable-grain table-row counts and cannot prove unique-school genuine-source coverage. The frozen 14-key lost-ack result proves durable publication identity; manifest/ledger/live-table release verification supplies the later coverage proof. Requiring invented row-count equalities in recovery would be incorrect and would violate the reviewed frozen contract.
Concrete exact-head findings were repaired:
- Step 1 now uses set -euo pipefail, selects and records the exact PR4 commit before validation, rechecks an unchanged clean head, and tags that exact SHA only after all gates pass.
- All three duplicate-name authorization probes use structured boto3 ClientError fields and require exact AccessDeniedException, states:StartExecution, and the exact state-machine ARN; generic stderr is no longer evidence.
- Automatic-activation containment attaches and proves the prevalidated SCP independently of later policy-readback failure; EXIT recovery independently disables the schedule, attaches/readbacks the SCP, and proves the exact structured denial or exits 97.
- Canonical alpha-cp-v1-[0-9a-f]{64} strings and substrings, including decoded JSON and intentional binary container values, are rejected recursively before work even when controlled settings are unconfigured.
- A handler-level regression restores the real controlled release-count validator and proves rejection before snapshot/publication mutation.
- Release verification requires ledger published_at/committed_at, manifest generated_at, and snapshot fetched_at to be canonical and no older than 24 hours (with at most five minutes future skew).
Exact-tree validation passed: full tests, current and pinned Ruff, formatting, production-module Pyright with 0 errors, immutable DDL dry run, secret/diff checks, and all six README Bash fences. Independent runbook and code audits both returned SAFE. Fresh CI, Mercy, and human review remain required; this PR must not be merged by automation.