Skip to main content

Repository-source DB proof topology — #4225 / #4190

Status: approved third-producer Phase A amendment; historical proposal retained below. Owner: devops-engineer. Coordinator owns implementation assignment and landing. The original design was documentation only. The released Phase A scope below authorizes code preparation, not publication/canary, queue/protection/runner changes, dependency installation or runtime activation. Governing intake: 6282621187, with #4190 clarification; the approved repository-source foundation/LLD proof obligations remain unchanged.

Approved third-producer amendment — 2026-10-22​

The bounded Phase A release is #4225 comment6338550751, binding intake SHA256 dbfa14da5d4f8e9f674f7812644aefc54ff819698925d3fae586b479c348bd05 after independent architect and QA acceptance. It continues the existing #4220 author branch from ba762515a50de2116903910a34a0ed8d21e91f08 on actual main 450b13ea232c4807eb511c5ada4c04387ca7d318. This amendment supersedes the historical two-producer narrow assignment and 65-minute G2 cap below.

Run39744251637 passed all functional/raw/cleanup checks but took108m36s from run creation to required verdict, missing the unchanged108-minute acceptance. The approved remedy moves exactly original steps131 (complete G2) and132 (preservation) into source-g2-proof; every original step object, binary, raw command, material exclusion, cleanup/swap gate and proof population remains. The original138 numbered identities are independently accounted for; duplicate shared setup is explicit. G2 retains its already-approved90-minute step cap; all three producers retain110-minute caps. The required verdict retains its name/app binding, five-minute ubuntu-latest/no-services envelope and unchanged first integrity body. No required-context/protection/runner/queue change.

migrations.needs is exactly [changes, db-proof, source-proof, source-g2-proof]. Each producer directly needs changes and preserves cancellable gate-integrity and explicit irrelevant no-op behavior. The new G2 job has services: {} and env: {}. It repeats existing checkout, Go pin/cache:false, migrate4.17.1, Kustomize5.4.3/PyYAML>=6.0/Compose setup. Explicit relevant-only workflow docker pull followed by docker image inspect replaces service initialization's implicit acquisition for existing pgvector:pg16 and the existing pinned Redis image. The sanitized setup receipt records exact immutable IDs and RepoDigests; the verdict compares them to existing raw process-fixture image inspections. No cache deletion, new image, wrapper install or devbox image pull is licensed.

Runner snapshots have two closed cases: the original service-bearing jobs have one successful initialize-containers GUID record at position0; the new job has zero extras and a required, explicitly null runner_prelude in both channels. Missing is not null. Undeclared/moved/cross-owner records and boolean positions or counts fail. Irrelevant G2 executes no heavy/image/setup command.

All three same-run/attempt/tested-source/contract artifact identities are required before download and at the final join. G2 is consumed only from source-g2-proof; legacy raw readers and direct G4 stay in db-proof, mutants stay in source-proof. Every preserved binary remains hash-checked by the original G2 raw validator; matching forged inventories cannot reintroduce recursively excluded material. The independently measured gating floor is118. Actual edge deletions, equal-count substitutions, extra edges and joint workflow/contract/shared-roster omissions have independent literal/CLI witnesses. Offline fixtures do not certify hosted Actions scheduling or full raw proof.

Phase A permits code and listed scoped offline checks only. Coordinator must bind a later exact-head substantive push, normal CI and protected canaries; no full local producer/retry, installs, image pull, push, enqueue or activation follows from Phase A. Every review is renewed at the new head. One author waiter has a90-minute cap followed by explicit root handoff, never a restarted budget. The108-minute condition is observed acceptance, not a mathematical GitHub completion guarantee; no timing latch, extra Actions permission or observer is introduced. A failed proof/swap/cleanup/timing observation returns to diagnosis.

Full #4225 remains open until actual merge-group end-to-end and each producer meet72 minutes with separate queue-entry/run-created clocks and cleanup evidence. PCTX (~30m50) now follows G4 in the existing source-proof job with four fixed steps and trusted relocated readers. That historical arithmetic projects ~62m44 before setup/queue, but no combined-fit or hosted acceptance claim is made and no retention D5 work is appended here. Real irrelevant/cancellation/isolation evidence and #4190 closure remain pending. Root coordinates an independently reviewed atomic topology/contract/consumer/ roster rollback; restoring serial108m36s does not permit landing automatically.

Pinned module acquisition addendum — 2026-10-22​

Coordinator release6339067854 folds the independent architecture disposition SHA256 a59c0dc9ae6ac10df374467669bb59448ad261b02b6618df986355b37d053d35 into Phase A. The unchanged complete G2 wrapper sets GOPROXY=off; setup-go/cache:false alone does not acquire root-module dependencies. A new relevant-only source-modules step immediately after proof-003 therefore runs exactly local-toolchain go mod download then go mod verify, using ordinary runner acquisition configuration and existing pinned dependencies. No versions, all argument, get/tidy, toolchain download or wrapper change. Both go.mod/go.sum hashes must remain unchanged across both commands; errors never restore files and continue. Only successful ordered commands with local toolchain/integer zero exits and exact before/after root hashes produce a sanitized receipt. The complete G2 artifact owns it; the consumer compares it to its own tested checkout. Existing verified shared module entries may be reused, but acquisition and verification still execute every relevant time. No cache deletion/relocation, new dependencies, devbox downloads or added budgets. False-gate runs skip all module commands and require no module receipt. Actual-body cold Go-stub controls, independent literal/joint omission controls and receipt/CLI failure cases are required offline; they do not certify initially missing hosted-cache downloads. The original108-minute observation and later exact-head publication/canary gates remain in force.

Decision and scope​

Split expensive producers from a short required verdict. Keep the exact existing required context Migrate Up + Down (PostgreSQL 16 + pgvector), published once by db.yml. Retain every other required context and its app binding. Do not promote a new sibling or change protection to achieve this repair.

The narrow #4220 unblock uses two parallel producers. The existing DB body, including G1a/G1b/G1c/G2a, direct G4 metadata/runtime wiring and complete G2, remains together in db-proof, together with the proposed bounded G3a transactions mode. G4 semantic mutants and their preservation move to source-proof; the mandatory unchanged full G3a all mode and its post-exit checkers follow G4 in that sibling when #4224 is integrated. Both feed the required verdict. The exact G3a partition below supersedes the first draft’s unsplit G3a placement and local-time projection. Each gets its own exact checkout and existing Go/Python setup. The G4/G3a wrappers own scratch Postgres: preserve their image availability, environment and cleanup requirements without assuming another job's images, files, service ports or Go cache exist. G2's later relocation must also carry its pinned Redis/image prerequisites and material exclusions. This is a relocation, not reduced proof or PR-only execution. #4224 authors integrate and renew reviews at their actual final head; this design does not edit their branch.

The full #4225 follow-on separates the already owned complete G2 producer and its preservation into a third sibling source-g2-proof. db-proof retains G1a/b/c, G2a, direct G4 wiring, migrations and all legacy witnesses. The required verdict then directly needs all three producers plus changes. If measured G4 plus full G3a cannot fit the applicable combined budget, a separately approved G3a sibling is the explicit next topology option: three narrow producers, or four after the G2 split, all direct dependencies of the same required verdict. Do not add that job silently or count the extra capacity as free. That follow-on must prove fixture independence, unchanged proof discovery and actual performance; it is not part of the narrow unblock or delivered by this design.

Rejected alternatives: an unchecked G4 sibling can fail while protection passes; adding it to needs of the old heavy job serializes the work again; changing the required job to !cancelled() permits skipped-as-satisfied; keeping serial G4/G3a spends the remaining queue margin; raising the queue timeout changes a separate control and hides growth. More jobs alone do not prove a shorter critical path.

Evidence and budget​

Fresh REST job/step reads at 2026-10-20 03:28 UTC:

EvidenceMain merge_group 39334582860 / job 118340827568#4220 head 6496f893, PR run 39354097133 / job 118407727978
Runnerhetzner-ci-1-slot-2hetzner-ci-1-slot-1
Start to G1a24m49s29m45s
G1a / G1b / G1c / G2a60 / 38 / 72 / 118 s93 / 58 / 117 / 140 s
Direct G4 wiringabsent89 s, success
G4 mutantsabsent40m06s, success
Complete G244m48s, successrunning since 03:02:06; no final duration
Total75m28s, successstill running at read; not a green sample

Sources: main run, metadata run, blocking DevOps review. That review also records the earlier G4 sample 29m29s, so same-slot samples vary by 1.36×. G3a review records 12m31s locally. It is superseded for budgeting by the later blocking G3a review: job 118421244101, artifact 12238714683, full all mode ran 1213 seconds before its 20-minute timeout, still progressing with the cumulative tail unexecuted. G3a-specific producers/checkers completed in roughly 3.5 minutes, but no complete hosted all duration exists. The current G2 also subsequently failed after 31m55s, job total 110m33s; see 6282777840. Neither failed duration is a healthy completion sample.

The 120-minute queue window is the review's explicit live queue observation, not a new REST derivation: classic protection/rulesets cannot expose it. Fresh REST protection at 03:28 reports 11 required contexts, all app 15368, strict=true; rulesets are empty. Implementation/landing must re-derive protection and have the coordinator refresh the queue setting through the supported queue read.

Budget equation is changes + max(each producer's queue wait + setup + proof + cleanup + upload/post-job) + verdict queue wait + download/verification. Measure from the actual merge-group run creation and preserve the queue-entry timestamp; report both elapsed clocks. Runner/storage contention can stretch every term.

  • Narrow target: required verdict complete within 108 minutes (at least 10% headroom under 120), with all proofs actually executed. DB + direct G4 + the proposed transaction witness projects ~80.5 minutes at main’s pacing, or ~87.5 using the slower prefix and prior successful G2. A 15-minute planning allowance for scheduling/setup/changed pacing/verdict projects ~102.5 minutes, not a bound. The transaction mode itself still needs complete hosted timing and cleanup.
  • The original ~53-minute G4+G3a sibling forecast is withdrawn. Full G3a has no successful hosted sample; the 20-minute timeout leaves its tail censored. Propose 45 minutes solely as a finite full-G3a canary observation ceiling, subject to explicit architecture disposition. No timeout/partial receipt is PASS. Landing acceptance requires complete hosted execution ≤33m45s, which leaves at least 25% of that cap unused, plus complete producer/queue headroom. Failure or an unfinished 45-minute observation returns to design, never an automatic cap increase. G3a transactions retains its existing 20-minute cap.
  • With that proposed successful upper acceptance bound, G4’s measured 40m06s plus G3a’s 33m45s would be 73m51s before setup/cleanup/upload. This fits neither an asserted full ≤72-minute target nor an unmeasured contention claim. Measure the combined source-proof job inside its finite 110-minute job cap and the ≤108-minute required-verdict target. G4 retains its 90-minute step cap; cumulative step ceilings do not entitle a job to exceed its cap.
  • Full #4225 target stays ≤72 minutes end-to-end, with each producer also ≤72 minutes. A third G2 sibling can reduce the DB branch, but may leave the combined G4/G3a branch dominant. If actual G4+G3a plus overhead misses that target, disposition the separate G3a sibling above and remeasure; no automatic extra-job deployment or full-target acceptance by arithmetic.
  • Required verdict: ubuntu-latest, existing runner class, no services, 5-minute cap, no builds. Narrow producers have 110-minute caps; retain G2’s 65-minute step cap and every nested command/package budget. Queue/startup/ artifact-download delay counts toward acceptance despite not consuming all job/step timers. No queue cap increase is proposed.

Record runner ID/name, labels/group and co-scheduled job start/end intervals from GitHub’s verified runner/job metadata. Derive physical-host grouping only from metadata that actually identifies it; slot-name similarity is not proof. Mark physical host unknown when unavailable and retain that attribution limit. No SSH, CI-host access or unrelated host inventory. Concurrent scratch Postgres may increase storage contention; total runner occupancy rises even when elapsed critical path falls. Irrelevant PRs use two producer slots (three after the G2 split; three/four if a separate G3a job is approved) plus the short hosted verdict, versus today’s one DB slot. Measure no-op queue/setup/upload cost explicitly.

The narrow and full targets require their own actual merge_group evidence. The current base already takes 75m28s, so the two-producer narrow change cannot honestly close the ≤72-minute acceptance by subtraction alone.

Execution and required verdict​

changes retains its deny-list and literal true/false output. Following #4324, merge groups evaluate that policy on the event's verified immutable base/head comparison, using the pinned paths-filter action; malformed or unavailable comparisons fail closed. Keep the existing triggers and concurrency group: PR-ref cancellation only; merge-group work is not cancelled by another PR push. No workflow path filter, skip twin, positive allow-list or new test-selection filter is introduced.

All three producer jobs declare needs: changes and use a cancellable condition equivalent to !cancelled() && needs.changes.result == 'success'. They do not gate the job on changes.db == 'true'. Each begins by validating the gate. Literal false on a successful PR or merge-group gate runs a small explicit no-op path and writes a bound receipt; literal true executes all assigned proof steps. Unknown/empty values fail. Non-relevant jobs therefore finish successfully by actual execution, not by accepting a skipped job as success. The heavy steps retain their existing step-level relevance conditions. A merge-group no-op still requires every producer and the required verdict to execute, with matching event/base/head, run/attempt, gate and exact no-op artifact evidence.

The required migrations verdict runs on ubuntu-latest with no services, uses if: ${{ always() }}, direct needs on changes and every producer, a five-minute job cap, and the unchanged first Gate integrity body. It consumes changes.db, demands success for every upstream, and retains the shared behavioral battery and byte-identity check. Producer job outputs need not publish receipts as boolean gate outputs: immutable same-run artifacts carry structured evidence. The required job additionally validates graph completeness, relevance, artifact provenance and proof completion. There is no continue-on-error or fallback-success path.

Authoritative upstream job conclusions take precedence over receipt contents. A claimed successful artifact cannot override failed/cancelled/skipped/absent upstream work. The first integrity step fails immediately for bad upstreams; a bounded diagnostic preservation step may run afterward but never clears failure. Required verdict absence, cancellation, timeout or skip is never acceptance. GitHub outages/forced termination can prevent execution; always() is an intended scheduling condition, not a guarantee against the platform. Real canary evidence must show the required check executes on the supported cancellation path. GitHub cancellation semantics re-evaluate running-job conditions and eventually force termination; a finite always() verdict deliberately differs from the old long-running always() producer. This separates safety from liveness rather than assuming either.

Artifacts, identity and cleanup​

Every producer emits a versioned receipt plus raw proof in an artifact named with run ID, run attempt, tested SHA and producer ID. Download only from that run and attempt; do not search prior successful runs or use an artifact named only by branch. Retry choice (a): every producer must execute in the same attempt. A partial rerun carrying an earlier successful producer/artifact is rejected with an explicit “all producers must execute in this attempt; use an authorized full workflow rerun or a new legitimate run” diagnostic. Never fall back to an old attempt. A full workflow rerun exceeds the existing author retry whitelist when it reruns more than two jobs; it therefore needs separate coordinator/operator disposition. This design grants no automatic rerun authority, does not reset per-signature/head retry counts, and permits no dummy pushes to manufacture runs. Record event, PR number/head/base where applicable, actual checkout SHA, source tree/hash inventory, producer identity, exact command/roster versions, command exits, proof/cleanup outcomes and raw-log digests. For a PR, tested SHA is the synthetic merge checkout; author head is separate. For merge_group, require the composed SHA/event/base binding and the actual pinned comparison verdict, never an individual source PR diff. Selected work requires full relevant proof; unselected work requires the same complete no-op receipts as an excluded PR.

The verdict checks checkout/receipt identity against trusted event/run context, compares exact named producer and proof rosters against checked-in contracts, and executes the existing raw proof validators. Artifact existence or counts alone are insufficient. Avoid new actions/dependencies where the existing pinned upload/download mechanisms suffice; any unavailable mechanism is a pickup gap, not permission to install software. Required downloads use bounded commands within the five-minute cap; missing/truncated/duplicate/wrong-head/old-attempt artifacts, hash disagreement or validator errors fail. Retain upload IDs/digests for review.

Direct G4 metadata/wiring JSON remains with db-proof; G4 mutant output moves with source-proof. Preserve both sets with unique names and verify their union by identity, not count. Retain G2 built-byte receipts and material exclusions; retain G3a raw extraction/Remember and cumulative regression evidence. The narrow split must not drop direct G4 JSON when moving the original preservation step.

Cancellation terminates only owned producer processes/resources. Existing signal handling and bounded cleanup remain mandatory, with raw failures preserved. Add exact-owned-object cleanup receipts that distinguish confirmed absence from Docker/daemon/auth/inspect errors; an empty array or suppressed stderr is not proof of removal. Upload/cleanup failure fails the producer and required verdict. Always-attempted preservation cannot turn interruption into completed proof. A forcibly killed process may not run its trap; report that as unverified cleanup and let the coordinator handle it, never silently claim absence or scan/delete unrelated resources. No host-wide cleanup or resource-limit change is authorized.

The clone-DROP finding remains separate: it already used WITH (FORCE) with a fresh 15-second context; samples waited on IPC/CheckpointDone, with no target sessions or blocking backend. CPU/I/O/load causality is unproved. See 6282174940. No CPU-starvation, cleanup allowance or durability change is proposed here. The original CPU diagnosis is a hypothesis superseded by this narrower observation; bounded measurement and any corrective policy remain separately assigned.

Terminal matrix​

“Fail” means a non-success required verdict; a missing/skipped required verdict also blocks acceptance and is itself a defect, never a waiver.

Gate/eventProducers and evidenceRequired outcome
PR gate success, trueAll success, all bound raw proof/cleanup validSuccess
PR gate success, falseAll three execute validated no-op, zero heavy commands, bound receiptsSuccess, explicit irrelevant decision
Gate failure/cancel/skip/absent, even with a false outputProducers absent/skippedFail in first integrity step
Same bad gate, but producer receipts present or even successApparently green producers/artifactsFail; gate cannot be substituted
Gate success, absent/unknown/non-literal outputProducers present or absentFail; not “irrelevant”
Relevant gate, any producer failure/cancellation/timeout/absence/skipWith or without a successful-looking artifactFail
Irrelevant gate, producer skipped/absent or relevant-mode receiptAny other producer greenFail; no-op requires actual execution
All jobs success, absent/truncated/stale/duplicate proof or missing raw witnessAny eventFail
Partial rerun; successful producer did not execute this attemptSame run/SHA but prior-attempt artifactFail with explicit unsupported-partial-rerun diagnostic; no automatic full rerun
Cleanup or upload failed/unknownTests passedFail; keep original failure
Superseded PR headOld proof may complete or be cancelledCannot satisfy new head; cancelled work fails old verdict
merge_group, successful true gateAll producers execute on exact composed SHASuccess only after complete proof
merge_group, successful false gate from pinned comparisonAll producers execute bound no-op on exact composed SHASuccess after no-op receipts and required verdict execute; no heavy-proof claim
Failed/malformed merge-group comparison, PR-only proof condition on selected work, or unrelated PR cancellation reaches queue workAny evidenceFail; graph/event invariant violated
Verdict itself times out/cancels/is missing/skippedUpstreams greenNot accepted; diagnose scheduling/verdict defect

No fresh PR-head API read is part of the required verdict. Check-runs bind to the tested SHA; trusted run/attempt/event identity plus actual producer success and matching evidence is authoritative. Old-head success cannot satisfy a new head. Merge-group evidence binds its composed SHA. This avoids adding an unnecessary API availability dependency or treating a racing PR lookup as a substitute for proof identity. The coordinator re-derives the current PR head when assessing landing; no review or queue state is mutated here.

G3a D5: exact proof ownership​

This partition is proposed, not implemented. Counts below (30/17 children and 208/63 affected-package cases) describe source head 2f14a29e50b2d1fb77aa5cd2927ad6b21e8c43ea, not a permanent allow-list. The planned QA follow-up child can change the integrated roster; update and independently re-prove every literal producer/checker/manifest contract together at that final head. Never retain an outdated count to omit a new witness. Preserve the existing step name Repository source G3a extraction and Remember transaction proof (#4219) in db-proof, changing only its wrapper invocation to the new explicit mode:

bash scripts/verify-repo-source-g3a.sh "$RUNNER_TEMP/repository-source-g3a" transactions

transactions owns a fresh migrated/frozen scratch DB and all normal teardown. Its mode identity is recorded so that it cannot masquerade as full all proof. The required step retains both explicit G3a post-wrapper checkers, regression checker and python3 -m unittest tests.scripts.test_repo_source_proof.

Transaction outputExact producer populationIndependent consumer
g3a-extraction.jsonTestRepoMapSourceMarkerExtraction, all 30 childrencheck-repo-source-test-proof.py --gate G3a, extraction package/parent
g3a-remember.jsonTestRepoMapSourceRememberRace, all 17 childrenSame G3a checker, mcpsrv package/parent
extraction-regression.jsonTestProcess_PersistsTypedRowsWithProvenance, TestEnqueuer_Idempotent, TestReplay_RecoversDeadLetteredSession, TestReplay_CASRefusesEveryNonDeadLetterState, TestReplay_ConcurrentClaimHasExactlyOneWinner, TestClaimRun_DropsDeliveryWhileAReplayLeaseIsLive, TestClaimRun_LeaseDoesNotAlterTerminalOrEnqueuedHandlingExisting G3a regression checker
remember-regression.jsonTestRememberWritesRowAndEnqueuesEmbed, TestRememberScrubsSecretContentSame regression checker
remember-envelope.jsonTestRepoMapSourceRememberRefusalSame regression checker; exact three-file, 10-parent union

For both modes, preserve template-freeze identity, template drop, exact before/after DB roster equality, migration DOWN with zero application tables, and check-repo-source-g3a-cleanup.py exact owned container/volume absence. Checkers reject missing/cached/skipped/failed events and run after wrapper exit.

The parallel step Repository source G3a complete lifecycle and cumulative proof (#4219) runs the unchanged default all mode, then both G3a checkers, the regression checker and proof selftests. Its preservation step is Preserve repository source G3a complete proof receipts; use distinct mode-bound artifacts. Initially it follows G4 in source-proof, subject to the measured budget above. Do not substitute a complementary-only mode without separately proving the exact union. Duplication of the transaction subset is deliberate.

Full all outputs retained in parallelProducer/checker ownership
Five transaction outputs aboveSame 2 parents/47 children and 10 regression parents, same post-exit checkers
affected-extraction.json, affected-remember.jsonComplete affected packages (current author roster 208/63), not replaced by another lane’s similar test
unit.json, db.json, legacy.jsonG2a acquisition/path-secrets/memory-bounds; shared quota/cancellation; eight legacy quota/admission/lock-order parents; existing G2a/legacy checkers
template-proof.json, process-template-proof.jsonTestRepoSourcePristineTemplate, TestRepoSourceProcessTemplate, existing exact template contracts
template-lifecycle/receipt.jsonTwo actual failure/TERM cases through check-repo-source-template-lifecycle.py
g3a-lifecycle/receipt.jsonExtraction and Remember × failure/TERM/INT: six owned runs and exact absence through check-repo-source-g3a-lifecycle.py
template-selftests.logtests.scripts.test_repo_source_template_proof
audit-backfill.json, census.jsonExisting audit-hash and org-population witnesses
regression-g1a/migration.json, exact-complete/{builtin,core,oauth,identity}.json, regression-g1b/{mint,remember,forward}.jsonverify-repo-source-g1.sh, all eight packages/187 required children
proof-selftests.log, workflow-{scalars,size,gating}.log, vet.logAll test_repo_source*proof.py, three workflow guards, existing reposource/repomapgen/vault/context-engine vet, plus diff check
Normal teardown/rollback/roster/absence receiptsSame complete owned-resource cleanup contract, independent of test-body outcome

Update test_g3a_explicit_ci_producers_and_checkers to require both modes and both edges into required closure. Preserve omitted-producer/checker mutants and add missing-mode, missing-closure-edge, wrong-mode artifact and joint producer/manifest omission controls. Record every relocation by source/destination job and exact step name in the rationale index. Current local 17 semantic and 7 proof mutants remain explicit local proof obligations, not invented hosted execution. Full hosted all, actual post-exit validators and transactions must all complete at the final source head before requesting new implementation review.

Clone cleanup: separate diagnostic record​

The current failed G2 artifact is 12238423169, SHA256 914546bdae54353ff54fabc4b52c3efd8d0affb86e4e042efd0339c3cb2af075, actual checkout 025a9b44ee4676ca6278dea6d7cee8f635abd04d. The restored probe_not_shared arm fails cleanup at 15003ms; this is not an intended semantic kill. Its mutated arm also contains a cleanup failure, so quota failure and cleanup success must be assessed separately. Three censored 15-second waits do not establish a completion distribution or CPU cause.

Per QA disposition, cleanup options A/B are outside this topology design. Track the separate bounded measurement and any corrective proposal under #4225’s diagnosis. Measurement-only option A cannot produce G2 PASS or change the shipping 15-second default. No LegacyQuota profile, 60-second shipping allowance, delayed-lock implementation, host experiment or other cleanup-policy choice is approved or specified by this PR. The coordinator separately assigns that diagnostic and its exact command/budget. Topology acceptance still requires successful complete G2 and exact-owned-resource cleanup; moving jobs is not its corrective proof.

Guard adaptation and bounded implementation brief​

After explicit independent architect approval, coordinator assigns the narrow implementation against the then-current #4220/base. No global weakening of check-required-check-gating.py: preserve 11 context names/app bindings, exact always() on the required verdict, unchanged first integrity body, deny-list tracing and rejection of invalid/empty inputs. Q1: add an independent literal upstream/step contract in the proposed scripts/db-proof-contract.json, outside db.yml. For the narrow graph migrations.needs must be exactly [changes, db-proof, source-proof] as a set; future approved G2/G3a siblings extend that explicit set. The guard must compare the actual graph to this external roster, not derive both expected and actual from the same YAML.

Raise MIN_BEHAVIOUR_CASES in the implementation to the newly measured count: QA measured 106 baseline and 110 after adding one upstream, so 114 is the expected narrow count, to be executed and frozen with the two-producer change. Do not preserve the old 106 floor as sufficient. test_required_check_gating.sh must delete each producer edge independently and go RED even when the reduced count still clears 106. Keep the unchanged first integrity body; the external roster and floor prevent its input population silently shrinking.

Q2: pin one receipt entry per exact (job ID, step identity, mode) in the external contract. In test_db_proof_verdict, force one rostered proof step’s if false while the upstream job succeeds, and separately return a valid-shaped no-op under a successful PR true gate. Both must fail at the actual verdict. Require successful execution and raw witnesses for each relevant step, not a count or producer self-assertion. Positive false-gate no-op controls still pass. Add behavioral graph/receipt tests; do not merely compare repeated guard text.

check-db-rationale-index.py currently hardcodes JOB = "migrations". Extend its scope to the explicit proof/verdict jobs with exact (job ID, step name) identity; retain every rationale entry, budgets and duplicate/missing checks. Proof steps keep literal go test -run and checker commands discoverable in named jobs. Inspect every test/lint workflow reader and assert_exact_ci contract; adapt job location without changing test names, packages, flags, rosters or discovery population. A lost-step/substituted-step mutant must fail even if counts match.

Exact proposed implementation checks (not run or claimed by this docs PR):

git diff --check
python3 scripts/check-workflow-scalars.py
python3 scripts/check-required-check-gating.py
bash tests/scripts/test_required_check_gating.sh
python3 scripts/check-db-rationale-index.py
bash tests/scripts/test_db_rationale_index.sh
python3 scripts/check-workflow-size.py
bash tests/scripts/test_workflow_size.sh
go test ./test/lint/
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest tests.scripts.test_repo_source_proof
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest tests.scripts.test_db_proof_verdict

test_db_proof_verdict is a planned new implementation test module, not an existing executed suite. It must run the actual verdict against every matrix row and reject mutants: missing producer dependency; all-green fake receipt after failed job; empty gate treated false; skipped required verdict; restored heavy always(); omitted G4/G3a/legacy witness; mismatched SHA/attempt; merge-group no-op; swallowed cleanup/upload error. Paired positive controls prevent an always-fail implementation passing negative tests. Preserve exact production proof commands/rosters; run the complete G4 invocation (11 runtime mutants plus its appended CI controls, currently 16 receipts), G3a full manifest/cumulative regression and complete G2 envelope in their assigned lanes. G3a’s existing 17 semantic + 7 proof mutants remain required local evidence: the current workflow does not run that semantic mutant suite, and this design does not claim it did. Static mutation tests do not substitute for real producers.

Canary approval and acceptance evidence​

Before implementation pickup, coordinator and architect approve the bounded canary plan, expected rosters, observation budgets and rollback owner. Bind the actual isolated branch, reviewed implementation SHA and job IDs after that implementation exists and before canary execution. This is routine engineering authorization within scope, not renewed founder approval; a new policy/security surface, queue configuration change or scope expansion requires its own ruling. No dummy product push, manual check injection, review/protection manipulation or force cancel.

  1. Use the actual implementation PR for relevant execution. Use one separately authorized real documentation change on the isolated canary branch for the irrelevant path. Record actual event/gate/producer/no-op/verdict execution.
  2. Offline, execute all failed-gate present/absent and producer/error matrix cases. For actual GitHub failure/cancellation evidence, use naturally occurring outcomes or a separately approved bounded canary fixture tied to that branch; do not equate offline truth tables with GitHub job scheduling. No failure injection is authorized by this document alone.
  3. During one legitimate, separately approved revision to that same PR while a producer runs, observe natural PR supersession. Record old/new run/head IDs, producer start/stop times, terminal check conclusions, cleanup receipts and new-run start. The old long producer must stop; the finite required verdict must not be skipped-green. If GitHub does not schedule it as designed, stop and revise the design. Do not retry until green or widen cancellation budgets.
  4. Coordinator queues the independently reviewed change normally. Capture actual merge_group event/composed SHA, all per-step execution and raw artifacts. Use a real relevant composition for selected proof and a separately eligible excluded docs-only queue entry for executed no-op receipts; never fabricate a gh-readonly-queue branch. Observe an unrelated legitimate PR push while queue proof runs only when naturally available or separately approved; confirm the merge-group run survives. Otherwise that isolation evidence stays pending.
  5. Read all checks and protection at the exact head; demonstrate that the required verdict's real failure is blocking under unchanged protection. Never attempt an unsafe merge to “test” protection. Missing proof is not acceptance. Record runner names, queue waits, per-stage start/end, resource/cleanup receipts and total elapsed against the narrow ≤108-minute and separate full ≤72 targets.

Read-only evidence commands, with resolved IDs from the actual run (own bot token minted inside each call; discard inherited token/debug variables):

gh api 'repos/upsquad-ai/upsquad-core/actions/runs/RUN_ID/jobs?per_page=100' --paginate
gh api repos/upsquad-ai/upsquad-core/actions/jobs/JOB_ID/logs
gh api 'repos/upsquad-ai/upsquad-core/actions/runs/RUN_ID/artifacts?per_page=100' --paginate
gh api repos/upsquad-ai/upsquad-core/actions/artifacts/ARTIFACT_ID/zip
gh api 'repos/upsquad-ai/upsquad-core/commits/EXACT_SHA/check-runs?per_page=100' --paginate
gh api repos/upsquad-ai/upsquad-core/branches/main/protection
gh api repos/upsquad-ai/upsquad-core/rules/branches/main

Actual runtime commands in the approved implementation remain the current named db.yml proof bodies; relocation receipts must compare every body by name and hash before execution. The implementation brief must bind these placeholders and approve any new canary harness/commands before execution, not invent them mid-run. No CI-host access or queue/protection changes are needed for these observations.

Rollback and acceptance boundary​

Rollback is a reviewed revert of the topology/guard change as a unit, preserving all G4/G3a proof in the previous serial required job; reverting only the aggregate would create an unchecked producer. A rollback restores the known long-runtime risk, so it does not authorize landing #4220/#4224 without renewed headroom proof. No product flag, DB schema or runtime setting changes with this design.

Renewed architecture disposition of these amendments and requested QA approval precede implementation. The prior approval at d7ecb575 predates the G3a/cleanup addendum and does not approve the new full-G3a observation envelope; cleanup policy is outside this amended design. Docs-PR merge is not an extra implementation prerequisite unless reviewers require it. Implementation and final composed heads require their normal reviews and fresh CI. #4226/#4227 credential-fixture work stays separate. #4190 is not resolved until actual cancellation/cleanup/required-verdict evidence exists; #4225 is not resolved until its full runtime target and separately reviewed clone cleanup investigation are satisfied. Refs #4225, #4190, #4220; no issue closure.

G4 metadata fixture amendment (2026-10-22)​

Coordinator comment6344688192 replaces only the sixteen-database G4 fixture choice. The prior hosted parent took122.70s/180s (68.17%), with108.037s in sixteen DROP operations and one real60s DROP failure. That G4 job ran alone; this is not a three-producer overlap sample or proof of a runner fault. The failure and pre-removal remaining-database census remain binding.

The metadata parent now owns one clone of the validated invocation template. Its seven direct children create seventeen distinct logical tenant fixtures: published, other-ref, attempts, withheld/withheld-barrier, get-set, foreign-main/foreign-org/read-only, and the eight rollout/grant/withheld combinations. Each fixture retains its own pools, query tracer, claims, roles and client/service state. Published, observed and attempt coordinates are case-specific. Initial grant/barrier/map assertions and repeated durable projection hashes detect cross-case changes while preserving history; no database reset or template writes occur.

G4_PARENT binds the actual case database to template/invocation/manifest. G4_CASE, G4_CASE_SEALED, G4_AUDIT, G4_CASE_CLOSED and G4_PARENT_CLOSED provide fixed case identity, fresh state, unchanged prior state, completed closers and zero remaining sessions before the parent DROP. The independent reader requires all17 cases on GREEN and the exact reached prefix only for the failed semantic child on RED; all other children remain complete. It requires one matching real60s cleanup diagnostic, template disposal and the unchanged empty pre-container-removal census and exact container/volume absence. Parent timing includes final cleanup. Generic G1/G2 isolation contracts remain unchanged.

Verification remains the existing seven-child baseline and full eleven semantic RED/restored pairs plus five CI controls, with Go180s/arm420s and the same1CPU/512MiB database profile. The amendment also requires an intentional prior-case grant mutation to fail the no-coupling assertion, exact source restoration and real cleanup. Local reader controls or a local baseline do not discharge hosted acceptance: actual three-producer overlap must show parent<=108s (60% of180s), plus<=108-minute closure. No durability, workflow placement or timeout increase is authorized.

Complete G2 step cap composition (#4300, 2026-10-27)​

The founder-approved #4300 amendment supersedes only the current complete-G2 step's 90-minute scalar with 120 minutes. The relocated source-g2-proof / proof-131 keeps its original command body, gate, ownership and preservation step. The independent step contract and literal full-step assertion record this single scalar exception; historical timing and failed receipts above retain their original meaning.

All three producer jobs remain capped at 110 minutes, including setup. The G2 step therefore has at most the remaining enclosing job budget, not a guaranteed 120 minutes. The required verdict remains capped at five minutes. Actual current PR run-created-to-required-verdict closure must still be at most 108 minutes, including queue wait, setup, uploads/downloads and final validation. Queue-entry timing remains a separately recorded clock; the later 72-minute objective is unchanged. A predecessor G2 success does not prove this topology fits.

Same-attempt/head evidence, complete proof populations, raw cleanup, strict global swap/C7, actual overlap/headroom, physical-host attribution and capacity evidence remain required. A closure miss, timeout or failed proof returns to the coordinator/design owner with its evidence intact; it grants no automatic retry, cap increase, omitted work, host action or activation. This composition adds no new runner route, resource profile, timing observer or authority. Integration must use actual merged #4300 main; this addendum does not authorize publication or replace fresh reviews and current composed-head hosted acceptance.