Repository navigation
ci: sweep the Db2 cases in Evidence Refresh and pin the Db2 image by digest - #4740
Merged
Merged
Conversation
…digest (Fixes #4733) A nightly/dispatch `db2` job sweeps the Db2 det cases (proof_sweep.py --db2-only) and re-proves the stale Db2 records; the refresh job merges both into the ledger, pages and reports. IMAGE is pinned by digest, recorded in oracle_assumptions.md and in a Db2 case's oracle fingerprint, and a test enforces it. The harness no longer races when several processes start a fresh Db2 container. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
Contributor
squid-protocol
marked this pull request as ready for review
October 9, 2026 02:29
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4733
What. Evidence Refresh now sweeps the Db2 cases, so Db2-backed programs (GenApp, several CBSA) get their measured L3/L4 in the ledger and report on main.
db2job in.github/workflows/evidence-refresh.yml:proof_sweep.py --det-only --db2-only(new flag;--aggregate --expect db2too) with the same baseline ratchet, plusevidence.py refresh --stale --only-db2(new flag) for the 4 Db2 records (cbsa-inqacc, cbsa-updacc, genapp-lgicdb01, genapp-lgupdb01). It uploads itssweep.jsonand the evidence records it wrote.refresh(needs: db2,if: !cancelled(), so it runs whendb2is skipped or failed) overlays those records (onlyevidence.jsonregular files), passes both sweeps todet_coverage_ledger.py update(when the Db2 sweep passed its ratchet), then re-renders pages and builds the report as before. It checks out the commit the Db2 job swept, so the ledger fingerprints match the measured tree. Auto-merge only ifdb2succeeded or was skipped; a faileddb2fails the run and leaves the bot PR for a person.concurrency(cancel-in-progress false, ci: evidence-refresh finishes a running refresh instead of cancelling it on every push (#4703) #4720), the PAT/auto-merge steps (ci: evidence report refreshed by bot on main, advisory in PRs, release-gated (#4703) #4705), the non-Db2 sweep and records (--skip-db2), pinned action SHAs,permissions: contents: read(write only onrefresh). actionlint and zizmor: no findings.Cadence.
db2runs on the nightly schedule and on dispatch withdb2 = true(now the default), not on every push. Measured locally (12 cores, fresh pinned container, 4 pool databases,--jobs 4): sweep of 30 Db2 cases 13.4 min, 4 record re-proofs 1.9 min, so ~15 min plus image pull (4.5 GB) and Db2 start on top; I estimate 30-45 min on a 4 vCPU hosted runner (timeout 150). A push-triggered refresh skipsdb2, keeps the last Db2 ledger entries and records, and the report shows them as stale rather than zero (#4730, merged). Every push would add that time ahead of the ~1 h refresh on merge-heavy days.Runner capacity.
ubuntu-latest(public repo: 4 vCPU, 16 GB, root docker) can run the container:--privilegedis allowed, and Db2 used ~2 GB with 4 databases active. No Db2 CI existed before (det-sweep.yml deliberately uses--skip-db2). Not proven on a hosted runner until the first nightly/dispatch run.Pin.
equivalence_db2.IMAGE = icr.io/db2_community/db2@sha256:2de8151713c261843868c5c3411b57be6ae79d99d70a5b3022337836776bfda6(what:latestresolved to on 2026-10-08, built 2026-07-13: the image every local Db2 proof used). Recorded inoracle_assumptions.md; a Db2 case's proof report records it underoracle.db2;tests/cobol_mainframe/test_db2_image_pin.pyfails on a tag or a digest missing from the doc; a container left from another image is refused. The harness fingerprint coversequivalence_db2.py, so this change stales every evidence record (scheduled, not blocking); the next bot run re-proves them.Harness fix found on the way. On a fresh container (the CI case) several sweep processes raced: the first sweep run against a new container lost 14 of 30 cases with
KeyError: 'Database code set'._ensure_containernow serialises the start behind a lock and waits for GGDB to exist before any process goes on.Evidence. Fresh container from the pinned digest,
proof_sweep.py --det-only --db2-only --jobs 4:det: 30/30 proven,sweep: as expected.evidence.py refresh --stale --only-db2: 4/4 proven. Ledgerupdatefrom the sweep works.pr_gates --fast5/5,--ratchets7/7.Verify after merge. Dispatch Evidence Refresh on main (db2 = true) or wait for the nightly: the
db2job summary shows the sweep and records time; the bot PR should includedet_sweep_coverage.jsonentries for the genapp-/cbsa- cases and the Db2 evidence records, and GenApp should show its L3/L4. (A dispatch on this branch would check out main and use the bot PAT, so it is not a safe pre-merge test.)🤖 Generated with Claude Code
https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D