LAB-1 — a broken import in a hypothesis-lab test fail-closes all three trading sleeves, and the marker convention that is supposed to prevent exactly this cannot
status: open · raised panel run 29 (2026-09-28; change-reviewer catch on the 2026-09-27 lab commits — a defect row, not a research or capture proposal, so it does NOT discharge the scout's 8-week cadence clock; same treatment as BTB-1 and CQA-3) · class: trading safety (G2) + isolation hygiene (G5) · effort ~0.25 pd · horizon: live today, and the exposure grows with every lab edit · queue was at the 12-file cap when this was raised; see "The slot this costs"
Plain-language summary for an owner reading one paragraph. On 2026-09-27
you merged the hypothesis lab — 5,384 lines — straight to main. It was
written carefully: its tests are auto-tagged research so that a lab bug can
never stop the three sleeves from trading, which is the lesson of 2026-07-17,
when a rotted reporting test blocked momentum and meanrev for two days. That
tag does not do what it is written to do. The tag is applied while pytest is
collecting tests; if a lab test file fails to import at all, collection
dies before any tag exists, the pre-trade gate exits non-zero, and not one
trading-critical test ever runs. All three sleeves fail closed, for a
research tool's defect. Nothing is broken today. What is missing is the
mechanism that would keep it that way — and the one test that currently keeps
today safe has not executed since the 2026-09-19 billing outage.
Mechanism — measured at HEAD 864da4e, reproduced from scratch
Leg 1 — marker deselection happens AFTER collection
The three pre-trade gates are identical
(.github/workflows/paper-trading.yml:89, paper-trading-meanrev.yml:84,
paper-trading-vrp.yml:70):
python -m pytest tests/ -q -m "not observability and not research" --tb=line
tests/test_lab/conftest.py:23-29 applies the research marker in
pytest_collection_modifyitems — a hook that runs after every test module
has been imported. A module-level ImportError therefore never reaches the
marker at all.
Reproduced in a scratch tree built from nothing (not a copy of the repo), with one trading-critical test and one auto-marked lab test carrying a bad import:
$ python -m pytest tests/ -q -m "not observability and not research" --tb=no
ERROR tests/test_lab/test_lab_thing.py
!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!
EXIT=2
test_trading_critical_invariant did not run. The gate reds, and on a
trading day that is a sleeve that does not trade.
Leg 2 — the isolation claim is false at the import-graph level
src/thales/cli.py:5535 imports the lab sub-app at module scope:
from thales.lab.cli import lab_app # noqa: E402 — light module; heavy imports are per-command
Measured:
$ python -c "import sys, thales.cli; print(sorted(m for m in sys.modules if m.startswith('thales.lab')))"
['thales.lab', 'thales.lab.cli']
So thales run, thales halt and thales portfolio all load the lab. Two
places in the tree assert the opposite:
| file:line | text |
|---|---|
CLAUDE.md:148 | "HYPOTHESIS LAB (research only; no trading path imports it)" |
src/thales/lab/__init__.py:37 | "Nothing on any trading path imports this package." |
(The RESEARCH.md banner for the lab says the same.) A module-level failure
anywhere under thales.lab takes the whole CLI down — including thales halt,
the manual kill switch.
Why "nothing is broken today" is not reassurance
Today's exposure is nil because the lab imports only declared dependencies
(numpy, pandas, scipy, pyyaml, typer + stdlib). The property that keeps it
nil is enforced by tests/test_declared_dependencies.py, which is marked
observability and therefore runs only in fleet-digest.yml — which has
not executed since Actions was refused on 2026-09-19. So a 5,384-line package
landed on main with zero CI, is under active edit (both committed study runs
are stamped +lab-dirty, i.e. run from an uncommitted tree), and the single
test that would catch a broken or undeclared import in it is not currently
running.
This is the 2026-07-29 matplotlib shape — a package that arrived transitively, vanished silently, and killed the digest for three trading days — pointed at the trading gate instead of the digest.
Data plan
None. No data, no PiT question, no registry row, no trial. Two workflow lines and either a two-line source change or two doc corrections.
Test design
Both legs get a pin with a real negative control; neither is a doc edit alone, because a corrected sentence with nothing enforcing it re-creates the same undefended assertion.
Leg 1. Add --ignore=tests/test_lab to the three pre-trade gates
alongside the marker (belt and braces — -m cannot cover collection
errors). Pin it with a test that asserts all three gate commands carry both
the marker expression and the ignore.
Falsification, measured in the same scratch tree:
| gate command | trading test | lab breakage still loud? |
|---|---|---|
-m "not observability and not research" | never runs, EXIT=2 | — |
… --ignore=tests/test_lab | 1 passed, EXIT=0 | — |
-m "observability or research" (fleet-digest) | — | EXIT=2, still reds |
The third row is the control that matters: the fix must not buy trading-gate safety by making a lab breakage silent. It does not.
Leg 2. Either (a) make the sub-app mount lazy or wrap it so an unavailable
lab cannot kill the CLI, and add an import-graph test asserting thales.lab
is not in sys.modules after import thales.cli; or (b) if the eager
mount is preferred, correct both sentences and pin the actual invariant —
that thales.lab.cli imports nothing beyond stdlib + typer at module scope.
Pick one and pin it; do not just fix the prose.
Pre-registered kill criterion
This row dies if either of these turns out true:
- The hazard is unreachable. If a test is added showing that a
module-level
ImportErrorundertests/test_lab/cannot interrupt the pre-trade gate as it is actually invoked in the workflows — i.e. my reproduction does not transfer to the real gate — the row is wrong and closes. (I reproduced the mechanism in a scratch tree, not against the live workflow runner; that is the gap a falsifier should aim at.) - The lab is removed from
tests/or from the CLI. Iftests/test_lab/moves outside thetests/tree the gate walks, or the lab sub-app stops being mounted on the production CLI, both legs evaporate and the row closes as overtaken.
It does not die merely because the suite is green — "green today" is the state the row is about.
Effort and horizon
~0.25 pd, implementer-buildable (routine PRs touch workflows — #185/#186 do). Decidable immediately. The first execution of the changed pre-trade gate will be the first trading day after Actions resumes, expected 2026-10-01 — momentum's monthly alpha-selection day. Both suites are green at HEAD locally (pre-trade 1229 passed / 1 skipped; research tier 144 passed), so this row is not a blocker for 10-01; it is the guard that should exist before the next lab edit, not before the next trading day.
The slot this costs
research/queue/open/ held exactly 12 files — the pre-registered cap —
when this was raised, and research/queue/approved/ has never held an item in
its existence. So this row cannot be free: it evicts an incumbent, and it
lands in a queue nothing is being pulled from.
It was opened anyway because it is the only candidate this run that is live, unguarded, buildable, and backed by a realised precedent already paid for in this shop's own ledger. The adversarial reviewer nominated RWG-1 for eviction (the queue's oldest, raised run 11 on 2026-08-20; its leg 1 was already discharged by the owner that same day, so it is partially resolved, and its remaining leg is a guard corner case with no date and no active bleed). Alternate nominee CQA-3 — but evicting that one immediately fires CQA-2's reopen leg (c), a downstream cost RWG-1 does not carry.
The ranking call is triage's mechanical one on Monday, not the panel's. A nominee is named so the trade is explicit rather than deferred; the move is not made here.
Re-verified 2026-10-01 against main at 3d4f432 (appended, body above unchanged)
This PR was stranded by the outage and sat unmerged for three days while the
lab kept growing (e53fa72, a9cffcd, ada5bff — a 1926+ panel, three new
families, five confirmatory studies). Every claim above still holds, and the
exposure is larger, not smaller:
- Both legs intact. All three pre-trade gates still carry
-m "not observability and not research"with no--ignore(grep -c "ignore=tests/test_lab"→ 0).src/thales/cli.py:5535still importslab_appat module scope. Both isolation sentences are still present and still false. tests/test_lab/grew from 11 files to 13 (test_confirmatory.py,test_longrun.pyadded), so there is more surface that can fail to import inside the trading gate than when this row was written.- Line references that drifted (the substance did not): the meanrev gate
is now
:125(was:84), the vrp gate:110(was:70), and CLAUDE.md's isolation claim:149(was:148).cli.py:5535andlab/__init__.py:37are unchanged.
Nothing here changes the ask, the test design or the kill criterion.
Triage annotation — 2026-10-05 (first annotation; annotation only, body untouched)
Defect intact at HEAD 502690b; one of the row's own urgency claims is
FALSE; and the hazard is structurally WORSE than the body states.
Both legs verified present. All three pre-trade gates still run
-m "not observability and not research" with no --ignore:
.github/workflows/paper-trading.yml:93 (the row cites :89 — drifted),
paper-trading-meanrev.yml:125, paper-trading-vrp.yml:110;
grep -rn "ignore=tests/test_lab" .github/ returns zero. The marker is still
applied post-collection at tests/test_lab/conftest.py:23-27
(pytest_collection_modifyitems), markers registered at pyproject.toml:77-86.
Leg 2 unchanged: src/thales/cli.py:5535 imports thales.lab.cli at module
scope, mounted :5537, and the two false "no trading path imports it"
sentences are still at CLAUDE.md:149 and src/thales/lab/__init__.py:37.
WORSE THAN STATED. tests/test_lab/conftest.py:14-18 imports numpy,
pandas and thales.lab.panel at module scope. A conftest-level
ImportError is therefore an unconditional collection error for the entire
tests/ walk — a failure no -m expression can reach, because marker
deselection happens after collection. So the row's remedy (--ignore) is not
merely the better of two options; for the conftest case it is the only one that
works. A builder should know this before choosing between the two fixes.
URGENCY CLAIM NOW FALSE. The row argues that the one test defending the
import graph, tests/test_declared_dependencies.py, "is not currently running"
because fleet-digest had not executed since 2026-09-19. It has: fleet-digest.yml
succeeded 2026-10-01T20:34Z and 2026-10-02T20:10Z (it failed 09-23 → 09-30
with everything else), and its observability job step "Run rendering +
research-tool tests" (fleet-digest.yml:163, -m "observability or research" —
the tier carrying both the declared-dependency test and all of tests/test_lab)
concluded success both days. The lab has CI again and the import property is
being checked. The defect is untouched; the "zero CI, unguarded" framing was
true only during the billing outage and should not be quoted as current.
The "slot this costs" header is also stale. It was written when
queue/open/ held 12 against the cap of 12. It holds 14 today, and this
run owes two overflow dismissals rather than one eviction-for-admission; the
eviction argument in the header (and FRZ-1's identical one) was reasoned under
the wrong count. No slot had to be bought for this row.
Rank this week: 1 of 12 (P0 trading safety — it is the only row whose failure mode is all three sleeves refuse to trade, and the exposure grows with every lab edit). BLOCKED on: nothing. Implementer-buildable; routine PRs already touch workflow files. 0.25 pd.
Triage annotation — 2026-10-19 (annotation only; the body above is untouched) — THE 2026-10-05 "URGENCY CLAIM NOW FALSE" NOTE IS ITSELF FALSE AGAIN, AND A FOURTH COPY OF THE GATE NOW SITS ON THE PRIMARY PATH
The 10-05 annotation concluded the row's urgency claim was false because
"fleet-digest ran 10-01/10-02 and the research tier passed, so the lab has
CI." It no longer does. #251 (merged 2026-10-18) added
needs: box + if: needs.box.outputs.ran != 'true' to
fleet-digest.yml:245-246, on the observability job — which at :266 is
the sole executor of -m "observability or research", the only tier that
runs tests/test_lab/ at all, and the only runner of
tests/test_declared_dependencies.py. The box's digest task runs no
tests: scripts/win/session.py:555 gates test_gate() on task == "trading". Today the box committed all four records with Box-Result: ok
(f68d9e5, 06816fa, 67d2ba9, d6ba109), so _box_ran.yml resolves
ran=true and that job skipped — and GitHub refused every job anyway from
2026-10-19T00:15Z on billing. The lab's import-graph guard ran nowhere
today, by two independent causes.
A fourth gate, and it is now the primary one. scripts/win/session.py:422-424
runs pytest tests/ -q -p no:cacheprovider -m "not observability and not research" --tb=line, and :554-557 turns a failure into
"STOPPED: the pre-trade test gate failed; no sleeve traded". The box has been
primary since ~2026-10-07, so a module-level ImportError under tests/test_lab/
now fail-closes all three sleeves on the runner that actually trades —
and the resulting alert is logged, not sent (session.py:500-507, under
weekly_digest_only). grep -rn "ignore=tests/test_lab" .github/ scripts/ src/
→ zero hits, so no gate anywhere excludes the directory.
Everything else verbatim at HEAD, with the row's cites re-pinned (drifted).
GitHub gates at paper-trading.yml:100, paper-trading-meanrev.yml:132,
paper-trading-vrp.yml:117. tests/test_lab/conftest.py:15-19 still imports
numpy, pandas and thales.lab.panel at module scope while the marker is
applied in pytest_collection_modifyitems at :24-27 — collection dies before
any tag exists. Leg 2 intact: src/thales/cli.py:5610 imports
thales.lab.cli at module scope, so import thales.cli leaves
thales.lab and thales.lab.cli in sys.modules, and both sentences denying
it are still live — CLAUDE.md:158 (row cites :149) and
src/thales/lab/__init__.py:37. tests/test_lab/ holds 13 files.
Reconcile with BGS-1, do not build both. Panel run 40 filed the same
fleet-digest.yml:266 finding today as BGS-1 leg (a) in open PR #252, from
the opposite direction (what #251's gating dropped, rather than what the lab's
marker cannot protect). They share one line of code. BGS-1 is not yet a file in
queue/open/; when #252 merges, these two rows must be merged or explicitly
split along the "marker convention" / "box gating" seam, or the implementer will
build the same fix twice.
Kill criteria: #1 (the hazard is unreachable in the real gate) could not be
tested here — pytest is not installed in this container — so it is verified
structurally only, and #2 (the lab leaves tests/ or the CLI) has not
happened. Live state: blocked on nothing · effort ~0.25 pd · urgency UP.
LEG 3, ADDED 2026-10-20 (panel run 41, change-reviewer catch on #253) — the same class arrived from a second direction: four schedule-vs-docs assertions landed INSIDE the trading gate, so the owner's own recommended DST cron move stops all three sleeves unless four prose files change in the same commit
Annotation only; the body above is untouched. This is filed as a leg of LAB-1
rather than a new row because the class is identical — a non-trading test
fail-closing trading (G2) — and because queue/open/ is at 12 of 12 with
DGX-1 as triage's pre-declared eviction. LAB-1's own fix does not cover this
surface, so it is a distinct leg, not a duplicate: LAB-1 is scoped to a
module-level ImportError under tests/test_lab/ defeating the research
marker, and its remedy (--ignore=tests/test_lab beside the marker,
lab-1:104-133) does nothing here — these tests are not under tests/test_lab,
they import fine, and they are unmarked by omission rather than by a hook
that fires too late.
The defect
#253 (87306e8, merged 2026-10-19) added section 8 to
tests/test_docs_consistency.py (:598+): four tests that assert a document
and a workflow or registry agree. The file carries no marker at all —
grep -n "pytestmark\|@pytest.mark" tests/test_docs_consistency.py returns
nothing — and pyproject.toml:82,87 define observability / research as the
only markers that exclude a test from the trading gate.
So they run inside the pre-trade gate, which is the identical command in four
places — .github/workflows/paper-trading.yml:100,
paper-trading-meanrev.yml:132, paper-trading-vrp.yml:117, and the
primary box leg at scripts/win/session.py:424:
pytest tests/ -q -m "not observability and not research" --tb=line
Verified by collection under that exact expression:
$ pytest tests/test_docs_consistency.py --collect-only -q \
-m "not observability and not research"
...
tests/test_docs_consistency.py::test_runbook_beacon_rows_match_their_workflow_cron
tests/test_docs_consistency.py::test_runbook_beacon_rows_match_routines_registry_cron
24 tests collected
24 of 24 selected — nothing in that file is excluded from the gate.
The trigger is dated, and it is the audit's own recommendation to the owner
AUDIT.md:240 escalation (a): the four tbx-win tasks are pinned in LOCAL time
and the backup crons in UTC, so from 2026-11-02 #201's ordering invariant
inverts, and the "cheapest fix" is to move the four crons one hour later before
11-02. Workflow edits are human-only (ops/STEWARD.md §0 limit 4).
A human who moves 15:30 / 15:35 / 15:40 / 15:50 forward one hour in
.github/workflows/ without editing CLAUDE.md, RUNBOOK.md, SLEEVES.md and
AUDIT.md in the same commit reds the gate on the next run — and every sleeve
submits nothing. Per-document stale sets measured under that simulation:
CLAUDE.md {15:30, 15:35, 15:40} · RUNBOOK.md {15:30, 15:35, 15:40, 15:50} ·
SLEEVES.md {15:30} · AUDIT.md {15:30}.
The wider half: a prose-only PR can now fail-close trading
test_runbook_beacon_rows_match_routines_registry_cron compares
ops/ROUTINES.md against RUNBOOK.md — two prose files, no code on either
side. That is exactly the tier ops/STEWARD.md §0 authorises the steward to
author and a later run to merge. Its vacuity floors are len(reg) >= 6
(actual 7) and checked >= 5 (actual 7), so retiring two cloud routines, or
deleting one registry row and its RUNBOOK twin, also reds it — and therefore
also stops trading.
The author identified this exact hazard and applied it to a different assertion
tests/test_docs_consistency.py:625-631, in the same PR, declining to pin the
box-vs-cron ordering:
"NOT pinned here, deliberately: the ordering between a tbx-win task's LOCAL time and its UTC backup cron … would be RED on main today — and this file carries no
observabilitymarker, so a red here fail-closes the pre-trade gate on both runners. It belongs in an observability-marked test landed together with the cron move."
The four tests that did land carry the identical hazard; the only difference is that theirs fires on an edit rather than on the calendar. The reasoning was written down, correctly, one screen above the code it does not protect.
And the shop has already paid for this shape once: 2026-07-17, a rotted reporting test blocked momentum and meanrev for two days — the incident cited in this row's own summary.
Negative controls (executed; nothing on disk was touched)
Both mutations were applied in memory or to a temp copytree, never to
.github/ or config/; tree verified clean after each.
HEAD: test_documented_cron_times_are_real_crons PASS
NC1 (patched _all_cron_times to simulate the four crons +1h):
FAILED -> CLAUDE.md names cron time(s) no workflow has:
['15:30','15:35','15:40']
NC2 (temp copytree; ops/ROUTINES.md steward cron 0 23 -> 0 22, RUNBOOK untouched):
FAILED -> RUNBOOK beacon row for thales-steward says '0 23 * * 1-5';
ops/ROUTINES.md says '0 22 * * 1-5'
NC2 is the one that matters: a one-character edit to a prose file, with no code change anywhere, reds the trading gate.
Blast radius
TRADING, both runners, all three sleeves. Not the owner's email: under
notifications.email: weekly_digest_only a red pre-trade gate is recorded, not
mailed, so the first human-visible signal is the steward's evening read or the
Friday digest.
Fix and pre-registered kill criterion
Mark the four section-8 tests observability, or move them into a marked file.
~0.05 pd — one pytestmark line plus two collection assertions.
The leg dies when both hold:
pytest tests/ --collect-only -m "not observability and not research"selects zero tests fromtests/test_docs_consistency.pysection 8; and- re-running NC1 leaves the trading-gate selection green while
pytest -m "observability or research"still reds — the fix must not buy gate safety by making the drift silent, which is this row's own third control in a different costume.
It dies immediately instead if a test is added demonstrating that an unmarked
failure in tests/test_docs_consistency.py cannot red the gate as the
workflows actually invoke it. It does not die because the suite is green
today — green today is the whole point: the hazard is latent until a human
makes the edit the audit recommended.
Reopens if any later unmarked test under tests/ asserts agreement between
a document and a non-code artifact.
One thing this leg discharges for the row above
LAB-1's kill criterion #1 — "the hazard is unreachable in the real gate" —
was recorded as "could not be tested here, pytest is not installed in this
container … verified structurally only." It is now tested: pytest ran in
this container, and the hazard is reachable — 24 of 24 tests in an unmarked
file are selected by the production gate expression. Criterion #1 is answered in
the row's favour and should no longer be carried as unverified.
Slot note
Filed as a leg because the cap binds today. If the steward prefers a standalone row, Friday 2026-10-23 frees a slot: NOL-1's criterion fires that day and the row closes whole (this run's change reviewer measured the 10-23 window end-to-end and all three of its lines render whole). Waiting three days costs nothing, because the trigger is a human cron edit that has not happened.
LEG 4 — ADDED 2026-10-21 (panel run 42, change-reviewer catch, reproduced independently by the chair) — IT HAS HAPPENED AGAIN, IN A PR MERGED YESTERDAY, AND THIS TIME THE SYSTEM'S OWN ALARM TELLS YOU TO PULL THE TRIGGER
Annotation only; the body above is untouched. This is the second instance of this row's shape in 48 hours (leg 3 was #253, landed 10-19; this is #258, landed 10-20), which moves the row's diagnosis from "a hazard the marker convention cannot prevent" to "a hazard the marker convention is not preventing, twice a week, in ordinary records work."
Plain language first
A capture stream goes dark for a day — the box reboots, GitHub refuses a job. The system notices, and prints an instruction telling you how to record it. If you follow that instruction, the next morning's pre-trade test gate turns red and all three sleeves submit nothing.
The failure path, end to end, every step CONFIRMED-BY-EXECUTION
-
The system instructs the write.
src/thales/cli.py:4955-4962, the countdown PR #255 added, prints on any day a gap-day is about to age out:"⚠ N unexplained gap-day(s) are about to leave the detector's reporting window and stop being reported at all — record them in CAPTURES.md and acknowledge them in
captures.ACKNOWLEDGED_GAPSwhile they are still visible"ACKNOWLEDGED_GAPSis therefore the documented, system-prompted sink for every future lost capture day. -
#258 made one calendar range of that sink illegal.
tests/test_data/test_captures.py:451-458(test_september_acknowledgement_does_not_deafen_the_streams_to_october) asserts, for every stream,not [d for d in entries if d >= "2026-10-01"]. -
The file is unmarked, so the gate selects all of it.
grep -c "pytestmark\|@pytest.mark" tests/test_data/test_captures.py→ 0. Collection under the production expression:pytest tests/test_data/test_captures.py --collect-only -m "not observability and not research"→ 28 of 28 selected.pyproject.toml:82,87makeobservabilityandresearchthe only markers that deselect. -
That expression is the pre-trade gate, in four places including the box's primary leg —
paper-trading.yml:100,-meanrev.yml:132,-vrp.yml:117, andscripts/win/session.py:424. -
So obeying step 1 reds the gate. Reproduced by the chair in an immutable
git archive 9e28a45export (the real tree never touched), injecting exactly one acknowledgement of a hypothetical lost November day onoptions_skew:"options_skew": {**_SEPT_2026_OUTAGE, "2026-11-05": "box offline, recorded in CAPTURES.md"}, → E assert not ['2026-11-05'] tests/test_data/test_captures.py:458: AssertionError 1 failed, 27 passedBaseline on the same export, unmodified: 28 passed. The change reviewer reproduced the identical failure independently on
order_log.
A red pre-trade gate fail-closes all three sleeves, on the box and on the backup legs — the 2026-07-17 outcome, which is this row's founding incident.
Two more live instances in the same file, same gate
:395test_september_outage_is_acknowledged_on_every_affected_stream— set equality overstartswith("2026-09"), so acknowledging any other September-2026 gap-day reds it. AUDIT.md still carries unadjudicated pre-clean-clock gaps, so a September-dated write is not hypothetical.:416test_every_september_acknowledgement_cites_its_record—checked == 56exactly, so the same write reds it too, and the citation check would then demand the new entry citeresearch/2026-09-21_..., i.e. a false citation as the price of a green gate.:428is the same shape on prose (md.count(...) == 6).
The guard cannot fail on the risk it names
The calendar cutoff is the only over-acknowledgement guard #258 added, and it is the wrong predicate in both directions. The risk worth guarding is acknowledging a date the store actually has — which silences a real stream for a day it did capture — and that is asserted nowhere; it passes freely at any pre-10-01 date. The change reviewer had to write the property itself to check the PR (it holds today: 0 of 67 entries over-acknowledged). Meanwhile the guard reds on obedience. A detector that cannot fail on its own stated risk, but can fail on correct use, is this row's thesis in one test.
Why this leg outranks leg 3
Leg 3's trigger is a human cron edit that may never happen. Leg 4's trigger is
the documented response to a routine incident, actively prompted by the
system. Base rate of the triggering event: five capture-loss incidents since
July (07-16, 07-17, 08-06, 08-07, 08-28, plus 09-21→09-30), and with Actions
refused until ~2026-11-01 the box is the only runner, so the next one is weeks
away rather than hypothetical. The window is also the worst possible one:
auto-merge is dark and records PRs are being hand-merged without CI (#260
records three on 10-20), which is exactly how a red reaches main unseen.
Fix, ~0.25 pd
Replace the calendar cutoff with the property it was reaching for: for each
(stream, date) in ACKNOWLEDGED_GAPS, if the store exists, assert the date is
absent from it. That guard never needs editing again, actually catches
over-acknowledgement, and lets a correct notch write land green. Scope the
== 56 and startswith("2026-09") assertions to the _SEPT_2026_OUTAGE
constant rather than to a calendar month. Optionally assert the cited
research/...md path exists — today the citation test matches strings, so a
dead citation passes.
And the root cause, which is this row's, not this leg's: records-pinning tests keep landing in the trading tier because nothing stops them. Whatever fix this row gets must make that structural, or leg 5 arrives next week.
Pre-registered kill criterion for this leg
It dies if (a) tests/test_data/test_captures.py is in fact deselected from the
pre-trade gate on both runners — the collection run above says it is not; or
(b) some sink other than ACKNOWLEDGED_GAPS is shown to be the documented home
for future notches, making a post-10-01 entry impossible — the CLI's own alarm
text contradicts this; or (c) a fix is shown to buy gate safety by making the
over-acknowledgement drift silent, in which case the fix is rejected rather than
the finding. It does not die because the guard is "correct about September":
it is, and that is not the question.
Slot note
Filed as a leg, no slot spent. If the steward wants it standalone, Friday 2026-10-23 frees one (NOL-1 closes whole). It should not wait for a slot to be fixed, though — the fix is 0.25 pd and the trigger is outside anyone's control.
LEG 4 IS DISCHARGED — fixed on main the same evening by #264 (665202f), and verified here
Appended 2026-10-21 ~23:30Z, hours after this leg was filed. Do not read leg 4 as a live defect. The daily audit, which had authored #258, found the same thing independently, credited this leg, and shipped the fix:
"#258 … shipped three assertions over the whole
ACKNOWLEDGED_GAPSsink that are scoped by CALENDAR rather than by the record they pin. Found by panel run 42 as LAB-1 leg 4 and independently reproduced here."
It fixed all three assertions this leg named, in the shape this leg proposed:
the calendar cutoff at :451-458 is replaced by the property
acknowledged ⇒ absent from the store (renamed
test_no_stream_acknowledges_a_day_it_actually_captured), the startswith("2026-09")
set-equality at :395 is relaxed to a superset, and the citation test at
:416 now iterates the outage constants' own dates instead of demanding every
September-dated entry cite research/2026-09-21_ — with the == 56 vacuity
floor still binding.
Verified by re-injection against origin/main, not taken on report. In an
immutable git archive origin/main export:
| injection | yesterday (as #258 merged) | on main now |
|---|---|---|
a future lost capture day acknowledged exactly as cli.py instructs (2026-11-05) | 1 failed, 27 passed | 28 passed |
over-acknowledging 2026-10-21, a day options_skew genuinely captured | 28 passed (the risk was unguarded) | 1 failed, naming stream and date |
The second row is the one that matters for this leg's kill criterion clause (c), which pre-committed to rejecting any fix that bought gate safety by making the over-acknowledgement drift silent. It does the opposite: the real risk is now caught for the first time, at any date. So the fix is accepted and clause (c) is satisfied rather than triggered.
What is NOT discharged, and is the reason this row stays open: leg 3. #264
says so itself — "Not fixed here and not mine: LAB-1 leg 3, the same
unmarked-file shape in tests/test_docs_consistency.py from #253, whose fuse
is the 2026-11-02 DST cron move." And the row's structural question is
untouched by both: nothing yet stops the next records-pinning test from
landing in the trading tier. Two instances in 48 hours, one fixed in hours and
one with a twelve-day fuse, is the argument for the structural fix, not against
it.
Approved by the steward — 2026-10-21 (legs 1–3 plus the structural root cause; leg 4 is already fixed)
Approved by the steward under the owner's 2026-10-07 delegation. This is P0
under NORTHSTAR §4. A test that pins records or prose currently sits inside the
pre-trade gate, and a red gate means all three sleeves trade nothing, with no
email under weekly_digest_only. The shape has now shipped three times in a
week (#253 leg 3, #258 leg 4, and FRZ-1's #263, which adds a declaration-scan
over research/*.md to the same unmarked tests/test_docs_consistency.py).
Leg 3 has a dated fuse: the owner's DST cron move on 2026-11-02. Leg 4 was
fixed by #264 (merged 2026-10-21) and needs no further build.
Scope.
- Leg 3: take the documentation/records-agreement tests out of the
trading-gate selection (mark them
observability, or move them into a marked file). They must still run in the reporting tier. The leg's own done-when applies: zero section-8 tests selected by-m "not observability and not research", and the NC1 control still reds under-m "observability or research". - Root cause (the row's own ask): add one structural guard so that the
next records-pinning test cannot land in the trading tier unnoticed. For
example, a collection test that fails if an unmarked test module reads
research/,CAPTURES.md,AUDIT.md,RUNBOOK.mdorCLAUDE.md. Its negative control must show it firing on a planted unmarked module. - Legs 1–2: in scope as written (
--ignore=tests/test_labbeside the marker in every gate invocation, and the lazy lab mount or its pinned invariant). These edit the gate command inpaper-trading*.ymlandscripts/win/session.py, so the PR will be reviewed under STEWARD.md §3's trading-path rule. It must change no order, and it must show the gate's selected-test count before and after.
Not in scope: removing any check from where it runs today. Every moved test must still run somewhere, and the PR must name where. Build by 2026-10-28 so that it merges before the 11-02 fuse.
BUILT 2026-10-28 — implementer slot, PR #299 — outcome: shipped (legs 1, 2, 3 + the root-cause guard)
Built on the steward's 2026-10-21 approval, inside its deadline ("Build by
2026-10-28 so that it merges before the 11-02 fuse"). Leg 4 needed no build
(#264). Nothing was removed from where it runs: 24 tests moved from the
pre-trade gate to fleet-digest.yml's -m "observability or research" step,
and the reporting tier's count rose by exactly 24 (565 → 589).
Leg 1 — the hazard is REAL, measured on the real test tree. With a
module-level ImportError planted under tests/test_lab/:
| gate command | result |
|---|---|
-m "not observability and not research" (main) | exit 2, "Interrupted: 1 error during collection", 0 tests run |
… --ignore=tests/test_lab (this PR) | exit 0, 1311 passed, 1 skipped |
-m "observability or research" (fleet-digest) | exit 2 — still reds, so the fix buys no silence |
--ignore=tests/test_lab now sits beside the marker in all FOUR gate
invocations, scripts/win/session.py (the primary, trading leg) included.
LAB-1's kill criterion #1 — "the hazard is unreachable in the real gate" —
is ANSWERED IN THE ROW'S FAVOUR, with the real tree and the real expression,
closing the gap the row itself named ("I reproduced the mechanism in a scratch
tree, not against the live workflow runner").
Leg 2 — option (b), with the prose corrected. import thales.cli does load
thales.lab and thales.lab.cli; the eager mount is kept (a lazy typer mount
would hide the sub-app from thales --help and from the command-existence
test). Both false "no trading path imports it" sentences are corrected
(CLAUDE.md, src/thales/lab/__init__.py), and the real invariant is pinned
instead: those two modules import nothing beyond stdlib + typer at module
scope, thales.lab.cli imports cleanly with numpy/pandas/scipy/polars/yaml
made unimportable, and the mount loads exactly those two modules and no more.
Leg 3 + root cause. Section 8 is out of the gate and still in the reporting
tier. The root cause is now a mechanism, not a convention:
tests/test_gate_tier.py runs the gate's OWN collection and fails if any
selected test reads a governed document. It fired live on four modules while
this PR was being built; the predicate is precise (a document name passed as
data, or a fixture written under tmp_path, is not a read).
Kill criterion #2 (the lab leaves tests/ or the CLI) has not happened and
is unaffected: the lab stays mounted and its tests stay in tests/test_lab/.