Skip to content

#1905 C2: CI lock guard, discord-extra job, ML-path workflow (Refs #1905) - #2028

Merged
seangalliher merged 9 commits into
mainfrom
feat/bf-1008-c2-20261202
Dec 2, 2026
Merged

seangalliher merged 9 commits into
mainfrom
feat/bf-1008-c2-20261202

Conversation

@seangalliher

Copy link
Copy Markdown
Owner

Refs #1905

Refs #1967

Batch C2 of the residual findings of the CI-reliability work (#1905: F1, F10 and F13), two slices on one branch, each reviewed on its own and gated together (three full runs; see Gate): C2a (one lock rule and a guard for every uv command, and a CI job for the discord extra) and C2b (an ML-path workflow). Nothing under src/ changes. C2a took two review rounds. C2b took four: three BLOCKED, then READY on a delta that the round-three brake limited to replacing sentences. Every one of the 51 mutation rows is killed on the final files. The Linux proof of the two new jobs is this pull request's own CI, which is read before the merge. #1905 stays open for the findings that slice C3 holds.

  • C2a, F1: one lock rule for every uv command, and a guard that reads parsed YAML. .github/workflows/ci.yml sets UV_LOCKED: "1" for the whole workflow, so every uv command installs the committed lock however it is spelled; the literal --locked flags stay, and the shard's uv run now also checks that the lock is current. tests/test_bf1008_c2_ci_workflows.py reads the parsed YAML of every workflow, never run text: a workflow that runs uv sets UV_LOCKED; no job or step env sets another UV_ key; every setup-uv step's with holds exactly the pin 0.10.9 (so neither a changed pin nor uv-file or pyproject-file chooses the uv), alone or with enable-cache: false (C2b); and the jobs that run setup-uv are exactly the declared ones, one step each. Eight accepted and seventeen rejected forms are named, and each rejected form breaks one rule. An exact install-line test pins ui-tests as the shard's already was. Given up, stated in the test: a run line that overrides UV_LOCKED in shell.
  • C2a, F10: a CI job for the discord extra, and a gate that a skip cannot pass. ci.yml gains discord-adapter-tests: it installs --group dev --extra discord from the lock and runs the five Discord adapter test files with JUnit output (the job step prints the discord.py and aiohttp versions first). scripts/junit_require_all_ran.py then fails the job unless the report's tests counters sum to at least one and every skipped counter is 0: pytest exits 0 on a skip, so without it the job would stay green if the extra went missing and pytest.importorskip("discord") skipped the test. It sums every testsuite, takes each of the four counters as a run of ASCII digits (a sign, a space, an underscore, an empty value or a non-ASCII digit is refused), and reports an unreadable report (missing, malformed, an XML encoding Python does not know, a root that is not JUnit, no testsuite, an absent counter) as exit 2 with a message. Its docstring states the three exits and names the two remaining gaps (a <skipped> child under a suite that says skipped="0", and a counter beyond 4300 digits).
  • C2b, F13: the ML path of the locked dependencies, checked on Linux. CI sets PROBOS_EMBEDDINGS=local, so no test loads the sentence-transformers model, the face models or a huggingface-hub download. .github/workflows/ml-path.yml runs scripts/ml_path_check.py when uv.lock or one of its own files changes, weekly (Monday 06:23 UTC) and by hand. It is not a required check; it has contents: read, a 30-minute limit and the same UV_LOCKED rule, restores a model cache (.ml-cache, keyed on the script, skipped on the weekly run so that run downloads fresh), runs fetch and then check offline, and uploads the computed vectors as a 7-day artifact. fetch loads the embedding model through get_embedding_function() and refuses any fallback, loads the face models through the identity loader, downloads one small file into an empty cache through huggingface-hub's lock and checks that the cache stays within 400 MiB. check compares seven vectors (three sentence embeddings, InceptionResnetV1 and the three MTCNN nets, on synthetic inputs of set shapes) with scripts/ml_path_reference.json within max_abs_diff 1e-3 and cosine 0.999. The reference was generated on this Windows machine and never edited by hand (1980 floats, 55,450 bytes, sha256 184F0937B595FA3F99A07FE285034DF2543DFCB64BABC60DF408B03B5957D920; write-reference on the final script reproduces it byte for byte); it must hold finite floats only, and every unusable reference (missing, not UTF-8, not JSON, nested too deep, or refused by the payload rules) exits 2 with a message. The job's setup-uv step sets enable-cache: false, so it neither restores nor saves the uv cache entry the CI jobs share; the guard permits that one input beside the pin. No model or dependency is added: both models are the vessel's own.
  • Tests: three files, 92 tests, none loading a model or touching the network: the guard (31, of which 28 are C2a's), the JUnit script (19) and the ML-path script and workflow (42). One comment line in tests/test_ci_shards.py records the new guard.
  • The build prompt prompts/bf-1008-c2-ci-lock-discord-ml-path.md (the Architect's contract) in its commits, the PROGRESS.md and DECISIONS.md entries and the regenerated ledger pair.

Review

Every review ran on gpt-6.1-sol, passed explicitly on each call and checked against the session's usage records (isAuto false, firstDispatchedModel equal); every mutation lane ran on claude-sonnet-5.5, checked the same way. A round is one completed pass over a frozen candidate. No Builder agent built C2b: the contract's blocks were applied by an independent oracle and checked by the Windows witnesses below.

  • C2a round 1: BLOCKED. Two P3 findings, injected-only, blocking under the rule that a claim in the candidate's text that its code does not support blocks (the JUnit script's docstring exits): a negative tests counter exited 0 (so did a balanced pair of -5 and +10), and an XML encoding that Python does not know escaped the handler with an exit-1 traceback. Repaired through the contract's amendment 2 (every counter must be a run of ASCII digits, the handler catches LookupError, the docstring names two gaps), with tests and rows.
  • C2a round 2: READY, a whole-candidate review (70 command-line shapes, 18 real pytest 9.0.3 and xdist reports, the tests' discrimination read in memory). Size findings 0.
  • C2b round 1: BLOCKED. F1 (P2, ordinary reach): the ML job's setup-uv step passed only version, so its default cache shared one key with the CI jobs. F2 (P3, injected-only): a reference holding an integer outside the float range raised OverflowError and a deeply nested one raised RecursionError, against the docstring's exit 2. Repaired (amendment 3: enable-cache: false with a guard that permits exactly that input; reference rows must be finite floats, RecursionError is caught; the Architect also found by reading that an in-range integer with an oversized square overflowed compare_rows, which the float-only rule settles; the seven reference_problems rules that had no test case got one each).
  • C2b round 2: BLOCKED (whole candidate). Two P3 regressions, both false sentences the repair added: the comments said the ML job installs no dev group (uv syncs the dev group by default; the job requests no extras), and a tracker sentence said setup-uv's cache key holds the uv version (it does not). Everything executable held. Corrected.
  • C2b round 3: BLOCKED (a delta of comments only). Three more P3 findings, ordinary reach, not regressions: a contract sentence on which job wins a cache save, a guard comment saying the pin does not choose the uv, and where checkout keeps its token. Brake (the Architect, read-only, Design: holds): the executable design had been stable since round 1's repair and every later finding was a false sentence about how a third-party action works inside; decision, continue with a replacement rule: every sentence about another project's behaviour in the staged comments, the tracker hunks and the contract is deleted or cut to the conclusion this repository depends on plus a pinned citation of the action's source at the tag's commit. Recorded on Follow-up: residual findings from the BF-1008 (#1881) wave (F1: the CI lock guard for ui-tests and the setup-uv pins) #1905.
  • C2b round 4: READY (the delta only, 12 insertions and 12 deletions in code files, all comments, plus one tracker sentence). Size findings 0.
  • Mutation campaigns. C2a: lanes A2, B2 and B3, 23 rows (C2-M1 to M16f), all killed. C2b: the first campaign killed 11 of 12 rows and left one survivor, C2-M25 (a deleted backend-name check that no test case isolated), answered by test_backend_rule[another-backend]; the campaign of record, on the committed files, is G 8, Y 7, S1 8 and S2 10 rows, 33 of 33 killed, each lane's restores checked by blob. 51 rows in all, plus the M0 baselines.
  • Recorded on Follow-up: residual findings from the BF-1008 (#1881) wave (F1: the CI lock guard for ui-tests and the setup-uv pins) #1905, not repaired here: the cache bound's equality edge is untested (no row claims it); the guard compares with by equality, so enable-cache: 0 would also pass (that value is off in setup-uv); C2a's discord-adapter-tests job still shares setup-uv's cache key with the shard jobs (no effect measured); a few uncited sentences about upstream behaviour remain in the contract and in P-11-1's docstring (audited true); F14 (the model-weight licence entries) and F15 (the hash-locked docs requirements) are not touched by this batch.
  • Size findings: 0 in every round.

Evidence from this machine (Windows)

The C2b batch focused command gives 397 passed (the three new files collect 31, 19 and 42). The Windows witnesses on the final script: the interpreter's package versions equal the lock's; write-reference to a scratch path is byte-identical to the committed reference; check reports 7 of 7 rows ok (max_abs_diff 0); a reference with 0.01 added to one value exits 1 with 6 of 7; PROBOS_EMBEDDINGS=local exits 1; fetch exits 0. actionlint 1.7.12 is clean on all three workflows (a deliberately broken control file draws findings). An exit-code probe of check over 27 unusable-reference shapes and nesting depths up to the decoder's limit: 6 escapes at the round-1 script, 0 on the final one.

Gate

Three full-suite runs, each through scripts/run_test_gate.py in an isolated worktree on a committed tree with a clean index. Runs 1 and 2 are of the batch head dd9acf0f5aef4acc4b4ab8ca32e4b8eab4899425 (tested tree 49618a48c0d05029f17d7e572be636f7807e3449); run 3 is of the merge commit ea9ef1c7b228bc645737eca3c8bd4f4a278824da (tested tree 4f3415158979769652d4ad22daaae03c14c348d1) that this pull request pushes. Only run 3 can have a receipt that matches the pushed head.

  • Run 1, 2026-12-02 13:03:37Z to 13:45:12Z, 8 workers (the commit charge read 54.4% at the quiet moment; it peaked at 81.4%). Exit 1: 1 failed, 58007 passed, 187 skipped in 40:29, no lost worker, no listed flake. The failure was tests/test_ci_shard_pytest_plugin.py::test_a_worker_that_stalls_inside_a_test_is_dumped_by_name_and_the_controller_shows_its_wait: its nested xdist worker gw1 ended with Windows fatal exception: access violation while running the test's 5 s stall (nested output: 1 failed, 2 passed in 15.80s). The dump's main thread is in pytest's call-phase report hook, after the stall and after the plugin's re-arm, not in the stall double; the cause is not established (the reading, and a correction of my earlier wrong attribution of it, are on BF-1030: flaky timing and process tests fail about 1 full gate in 9 on an unchanged tree, each costing a 25-minute rerun: make them deterministic or isolate them, and keep a flake record #1967, comments 7347882476 and 7348975485).
  • Run 2, 14:40:41Z to 15:24:47Z, 12 workers (the commit charge read 50.7% at the quiet moment; it peaked at 91.5%, with 2,476 MB available at the minimum). Exit 1: 1 failed, 58007 passed, 187 skipped in 42:54, no lost worker, no listed flake. The failure was tests/test_ad1358_s2_a2_repairs.py::test_masking_takes_linear_time_on_*[unopened-backtick-fences] (the node id is shortened here because the full text trips the comment scan): masking took 2.05 s on 80044 characters, assert 2.0485 < 2.0. That test times a pure CPU call against a 2 s bound (its docstring records 8 to 50 ms for the linear pass); it ran at about 47% of the run, with the commit charge at 79% and 12 GB available.
  • Neither failed test is in the flake record or named in BF-1030: flaky timing and process tests fail about 1 full gate in 9 on an unchanged tree, each costing a 25-minute rerun: make them deterministic or isolate them, and keep a flake record #1967, this branch changes nothing either test reads (scripts/ci_shards.py, scripts/_ci_shard_pytest_plugin.py, the plugin test file, its data and the AD-1358 sources are untouched), and each passed in the other run of the same tree. No flake-record pair can therefore be written for either (scripts/gate_flake_record.py takes a witness only from a green run of the same tested tree), and both are recorded on BF-1030: flaky timing and process tests fail about 1 full gate in 9 on an unchanged tree, each costing a 25-minute rerun: make them deterministic or isolate them, and keep a flake record #1967 (comment 7350627820) and in the wave's follow-up list. The Architect's consult of 2026-12-02 15:32Z decided how both are recorded and that the batch gates once more, on its merge commit.
  • Run 3, 15:34:24Z to 16:27:55Z, 8 workers on the merge commit. The count is explicit, not the default 12, for a measured reason recorded on Follow-up: residual findings from the BF-1008 (#1881) wave (F1: the CI lock guard for ui-tests and the setup-uv pins) #1905 (comment 7350598337): run 2's 12-worker peak of 91.5% of the commit limit against BF-1006's measured 83.8% to 86.2%, and run 1's 8-worker peak of 81.4%; the commit charge read 56.3% at the quiet moment. Exit 0: 59590 passed, 188 skipped, 7 subtests passed in 52:08 (59,778 nodes collected; the wrapper took 53:31), no failure, no lost worker, the live-data listing unchanged (55,059 files before and after), the commit charge peaked at 85.2%. The three new test files collect 31, 19 and 42 tests with none skipped. Receipt logs/gates/bf-1008-c2-merged.receipt.json, which records 8 workers, no lost worker and the TEMP volume G:.

All three runs count toward #1967's 20 consecutive runs (runs 3, 4 and 5 of the window); the two red runs do not reopen it.

Integration

The base moved while this pull request was in flight: pull request 2026 (merge commit 6b30f771c9f0f73b2c056ce3fa791ed83b01539f, 2026-12-02 14:56Z) changes PROGRESS.md, DECISIONS.md and the AD ledger pair, all of which this batch also edits. Gate runs 1 and 2 were on the batch head dd9acf0f before the move, and neither was green, so no receipt existed to lose.

ea9ef1c7b228bc645737eca3c8bd4f4a278824da merges 6b30f771 into the batch (parents dd9acf0f and 6b30f771, tree 4f3415158979769652d4ad22daaae03c14c348d1). PROGRESS.md and DECISIONS.md merged without a conflict; only the ledger pair conflicted, and it was regenerated with scripts/gen_ad_ledger.py and passes --check. Reproducible checks: git diff --name-only 6b30f771 ea9ef1c7 lists exactly this batch's 14 paths, and git diff --name-only dd9acf0f ea9ef1c7 lists exactly the 73 paths pull request 2026 changed. The broad gate ran on ea9ef1c7 itself (run 3), and the consolidated focused check on it passed (441 tests: the batch's seven focused files and tests/test_standing_orders_layout.py).

origin/main was still 6b30f771 at 16:29Z. The tree of this pull request's merge ref is checked once the pull request is open and recorded in a comment below.

Size findings: 0

seangalliher and others added 9 commits December 2, 2026 03:15
…L-path job (Refs #1905)

Batch C2 of #1905 (the residual findings F1, F10 and F13 of the BF-1008
work) is built in two slices, one pull request and one gate. C2a sets
UV_LOCKED for the whole CI workflow and adds a guard over the parsed YAML of
every workflow, a discord-adapter-tests job and the JUnit check that fails it
on a skipped or empty run. C2b adds an ML-path workflow, its check script and
its reference vectors. The prompt holds the search and replace pairs, the
named tests and the mutation rows, and was verified against main after batch
B3a and again against the tree of batch B3b. Prompt only: no code, test or
tracker changes in this commit.

Refs #1905.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…1905)

The first build of the CI lock guard slice applied the prompt's pairs exactly
and ran its focused command: one new test failed on the prompt's own text.
That test scans the discord job's pytest command for selection flags, and the
scan also read python's own -m in "uv run python -m pytest". The scan now
covers only pytest's own arguments, after the assertion that pins the first
five tokens. One mutation row, a marker selection added to the discord
job's pytest step, kills the changed assertion; no earlier row exercised it.
No code, test or tracker changes in this commit.

Refs #1905.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#1905)

The first review of the CI lock guard slice found two gaps between the JUnit
script's docstring and its code: a negative test count earned exit 0, and an
XML encoding that Python does not know escaped the report-error handler with
an exit 1 traceback. The script now takes only a run of ASCII digits for each
of the four counters of every testsuite and treats an unknown encoding as an
unreadable report. Its docstring states the three exits as the code behaves,
with the two remaining gaps named. The campaign of the ML slice left one
survivor, a deleted backend-name check that no test case isolated; one case
now does. Each added guard has a mutation row, and the test counts of the two
files are 19 and 25. No code, test or tracker changes in this commit.

Refs #1905.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Every CI job that runs uv now installs the committed lock however the command
is spelled, and the Discord adapters' tests run in CI for the first time.

- ci.yml sets UV_LOCKED for the whole workflow. The literal --locked flags
  stay, and the shard's uv run now asserts that the lock is current.
- tests/test_bf1008_c2_ci_workflows.py reads the parsed YAML of every
  workflow, never the text of a run line. A workflow that runs uv sets
  UV_LOCKED, no job or step env sets a UV_ key, every setup-uv step pins the
  one uv version with no other input, and the jobs that run setup-uv are
  exactly the declared ones. Seven accepted and fifteen rejected forms are
  named, and each rejected form breaks one rule.
- A discord-adapter-tests job installs --extra discord from the lock and runs
  the five adapter test files. scripts/junit_require_all_ran.py fails the job
  on a skipped test, on an empty run and on a report whose counters are not
  plain counts, so the test that skips without discord.py runs there.
- One comment in tests/test_ci_shards.py is rewritten. PROGRESS.md,
  DECISIONS.md and the AD ledger pair record the change.

Refs #1905.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… (Refs #1905)

The first review of the ML-path slice found two gaps. Its workflow left
setup-uv's package cache on, under the one key every uv job shares, so a job
that installs no dev group or extra could save a cache that CI later restores;
the workflow now turns it off, and the lock guard permits exactly that one
input beside the uv pin. The check script's reference rule let an integer
through that raised OverflowError, in validation or in the cosine sum, and a
reference nested past the JSON decoder's limit raised RecursionError; every
row value must now be a finite float, and a too-deep file exits 2 like any
other unusable reference. Each added guard has a mutation row, the seven
validation rules that had no test case now have one, and the test counts of
the three files are 31, 19 and 42. Two small edits make the contract
checkable by machine: each guard-edit label names its file, and one mutant is
spelled as a one-element tuple. No code, test or tracker changes in this
commit.

Refs #1905.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ew of its ML-path slice (Refs #1905)

The second review of the ML-path slice found two statements in the contract's
blocks that the evidence does not support. The workflow comment, a test comment
and the decision record said the ML job installs no dev group, but uv syncs the
dev group by default and the job requests no extra. The decision record also
named the uv version as an input of setup-uv's cache key, which holds the
architecture, the platform, the Python version and the hash of uv.lock. The
statements now say what the job installs and what the key holds, the words
about a partial cache are gone because nothing shows one, and the contract's
own account of the finding is corrected in a new entry. Only comments and prose
change; no code line, test body, count or row does. No code, test or tracker
changes in this commit.

Refs #1905.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…mpt after the third review of its ML-path slice (Refs #1905)

The third review of the ML-path slice found three more false sentences about
how third-party actions behave: which job's cache save wins, whether a guard
comment's pin chooses the uv version, and where checkout keeps its token.
After the round-three brake decided to continue, the contract's blocks and its
sections 10 and 15 no longer paraphrase that behaviour. Each such sentence is
deleted or cut to the conclusion this repository depends on plus a pinned
citation of the action's source at the tag's commit, and the guard's code
comment now states only what the guard enforces. Only comments and prose
change; no code line, test body, count or row does. No code, test or tracker
changes in this commit.

Refs #1905.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The ML path of the locked dependencies is now checked on Linux: the embedding
model ProbOS loads, the face-embedding models and huggingface-hub's download
lock. The test shard cannot see it, because CI sets PROBOS_EMBEDDINGS=local
and no shard test loads a model.

- .github/workflows/ml-path.yml runs scripts/ml_path_check.py when uv.lock or
  one of its own files changes, weekly and by hand. It is not a required
  check. Pull requests and pushes restore the models from a cache; the weekly
  run downloads them fresh, so it also sees an upstream model change. Its
  setup-uv step sets enable-cache: false, so the job neither restores nor
  saves the uv cache entry the CI jobs share.
- scripts/ml_path_check.py has three commands. fetch loads the embedding model
  through get_embedding_function() and refuses any fallback, loads the face
  models through the identity loader, and downloads one small file into an
  empty cache through huggingface-hub's lock. check compares seven vectors
  (three sentence embeddings, InceptionResnetV1 and the three MTCNN nets, on
  synthetic inputs of set shapes) with the reference within max_abs_diff 1e-3
  and cosine 0.999. A reference must hold finite floats only, as
  write-reference writes them, and every unusable reference (missing, not
  UTF-8, not JSON, nested too deep, or refused by the payload rules) exits 2
  with a message. write-reference creates scripts/ml_path_reference.json,
  which was generated on the vessel's interpreter and never edited by hand.
- tests/test_bf1008_c2_ml_path.py holds 42 tests that need no model: the
  workflow's shape, the reference's shape and rules, the exits for unusable
  references, the comparison rules, the backend rule and the cache bound.
  tests/test_bf1008_c2_ci_workflows.py now guards the new workflow's uv rules
  too: a setup-uv step takes the version pin alone or with enable-cache: false.
- PROGRESS.md, DECISIONS.md and the AD ledger pair record the change.

Refs #1905.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…1905)

Main moved while the batch was gated: pull request 2026 (merge commit 6b30f77) changes PROGRESS.md, DECISIONS.md and the AD ledger pair, which this batch also edits. PROGRESS.md and DECISIONS.md merged without a conflict; the ledger pair conflicted and is regenerated with scripts/gen_ad_ledger.py (--check passes). The merged tree differs from origin/main in exactly this batch's 14 paths, and from the batch head dd9acf0 in exactly the 73 paths pull request 2026 changed.

Refs #1905.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@seangalliher

Copy link
Copy Markdown
Owner Author

Merge-ref check at 16:31Z: the tree of refs/pull/2028/merge (commit 783bce0, parents 6b30f77 and ea9ef1c) is 4f3415158979769652d4ad22daaae03c14c348d1, equal to the tree that gate run 3 passed on ea9ef1c. git diff --name-only 6b30f771 783bce0f lists exactly this batch's 14 paths. origin/main is still 6b30f77, so the merge adds nothing the gate did not run.

@seangalliher

Copy link
Copy Markdown
Owner Author

CI read at 17:04Z. The runs (46928171217 and 46928173321) started late because of GitHub's Actions incident of 16:26Z; all eight checks pass on the pushed head ea9ef1c.

  • discord-adapter-tests (Linux): discord.py 2.7.1 and aiohttp 3.14.4, 154 passed in 19.43s, junit: 154 tests, 0 skipped, 0 failures, 0 errors.
  • ml-path (Linux, first run, empty cache): fetch: ok, cache: 203513238 bytes under .ml-cache (limit 419430400), the one-file download through huggingface-hub's lock into an empty cache worked, and check read seven rows against the Windows-made reference, all ok: the largest max_abs_diff is 3.427e-07 (face:pnet, bound 1e-3) and every cosine prints 1.0000000 (bound 0.999). The job took 1m21s, saved a model cache entry of 187,205,985 bytes and uploaded the computed vectors as the artifact ml-path-vectors.
  • python-tests-shard (1) to (3) with python-tests, ui-tests and desktop-tests: pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant