Skip to content

Wave 3: route gates, step-up refusal audit, schema-check DDL reads, release smoke flags, leak-scan hedges, throttled reply_replaced, and test hardening (12 branches) - #3143

Merged
wshallwshall merged 87 commits into
mainfrom
batch/w3-b
Nov 22, 2026
Merged

wshallwshall merged 87 commits into
mainfrom
batch/w3-b

Conversation

@wshallwshall

Copy link
Copy Markdown
Collaborator

Wave 3 of the account-6 batch Manager: twelve reviewed branches merged --no-ff onto a fresh branch from main 895925f. No code was written on this branch itself.

Rows and proposed banners

Branch Rows Proposed banner
w3-284-route-gates #2891, #3177 #2891 PARTIAL (note 3 tests built; item 4 is an owner question, PR 2390 note 2). #3177 items 5-15 were already met by PR 3015.
w3-257-checks-memo #2950 PARTIAL: hermetic memo tests and the census only. The IDE re-proof tracking was reverted, because it added a 155 s wait and a certain 401 with a second prompt.
w3-287-coord-scripts #2985 PARTIAL. Changes scripts/hooks/announce-session.ps1, so reinstall the hooks after merge.
w3-341-census-tests #3512 PARTIAL: step 6 built; step 12 declined (via-token granularity).
w3-450-1197 #1197 PARTIAL: steps 1-2 built. The two route-body step-up refusals write auth.gate_refused where the admitting gate wrote a grant row. A store fault there is a 500, not a 403, which fails closed.
w3-668-codec-schema #6686, #6687, #6719, #6720 PARTIAL each. #6719 item 3: the foreign view or trigger remedy. #6720 items 2, 4 and 5.
w3-264-small #5799, #5807, #5812 #5799 item 1 SHIPPED: a throttled reply_replaced connection event. #5807 OPEN: the separator check regresses main (PR 3031). Decided under the owner's delegation of 2026-11-21, taking the safer option of keeping main's behaviour. #5812 PARTIAL, unchanged by code.
w3-453-flaky-tests #3456 PARTIAL: test 8's drive is bounded and stands in for the disabled sweep. Hosted proof on SQL Server 2025 and the step-duration gates (workflow edits, owner-reserved) remain.
w3-docs-adr #1173, #3009 PARTIAL each. ADR 0019 now quotes ADR 0138 word for word on R3.
w3-608-release-tests #1583, #3633, #2975 #1583 SHIPPED. #3633 PARTIAL: item 2 is not raised, because the per-test cap preempts it. #2975 PARTIAL: item 17's release.yml prose is owner-reserved.
w3-606-schema-verify #5062, #4942 PARTIAL each. The shipped batches' expected shapes are byte-identical to main, so SCHEMA_CHECK_REV is not bumped. #4942 step 1's decision is the owner's.
w3-455-scan-forbidden #3364 PARTIAL: steps 8 and 11 built. Step 9 is left: a fix would drop hits, so it needs an owner ruling (decision d20261122T013935546-ec34e0). Differential against main's scanner: 0 lost and 0 gained on 3127 PR bodies and 874 Markdown files.

Checks on the pushed head

  • ruff check and format: clean.
  • mypy, the four CLAUDE.md section 7 legs: clean.
  • scripts/hooks/ledger_check.py --ci: exit 0.
  • Seam tests: pass. No branch moves the console seam digest.
  • Full pytest (-n auto, offscreen): 82722 passed, 2 failed, 1619 skipped, 131 xfailed.
    • test_gate_installed_parity is the local installed-copy check.
    • test_protocol_floor_selftest::test_the_driven_servers_own_logging_stays_quiet fails under parallel load only; it passes alone (36 passed).

Review proof

  • Each branch has its own code-review rounds at xhigh; their QA lines are in the branch commit bodies.
  • Tail review round-fe672e5b11: code-review skill at xhigh on origin/main...583f852 (the 12-branch head), fork a1bbce423f40e0d07. Tag xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings; review_tag.py exit 0.
  • It found no code regression against main. Its top finding was a misleading audit sentence in docs/SECURITY.md and the _recorded_decision docstring. The last merge, 583f852..4174e19, fixes it, and it is text only (2 files, +8/-4). The Manager read that diff: it names the two step-up refusals, and says other post-gate route-body refusals write no auth.gate_refused row. The Builder checked that claim by grep. After the merge, 2341 docs drift, security and route-gate audit tests passed.

Open findings (for one R2 row)

  1. store/store.py ~12243: the #6720 wrap covers only the writable open. A read-only open of a store with a foreign view still raises a bare sqlite3.OperationalError, as on main.
  2. pipeline/dr_backup.py ~4675: _incompatible_snapshot words every SchemaMismatchError as "incompatible version", so restore-verify drops the new drop-the-view remedy. The text is main's.
  3. server_schema_verify.py ~1006: _Reader.indexes is keyed by bare name, so a same-named SQL Server index on another table replaces the first.
  4. transports/framing.py ~87: ReplyReplacements is never reset on stop and start, unlike HandshakeFailures. It also has no trailing report.
  5. server_schema_verify.py ~463: without a ;, an opaque index's word set can reach past its statement (SQL Server END/ELSE, PostgreSQL data words), and a DROP COLUMN could then be refused. Nothing shipped triggers it.
  6. server_schema_verify.py ~1012: _string_spans and _quoted_end treat [ differently.
  7. framing.py: the 60 s window retypes the TLS throttle's value. frame_reply and encode_reply have no production callers but are still exported.
  8. scan_forbidden.py ~1415: the regrouped pass rescans every unit. Its hedge-word false positives are advisory, and the hedge forms "has yet to pass" and "needs still to pass" are not caught.
  9. w3-455: the superset guards compare against a vendored older scanner, not current main's.
  10. w3-264: no test checks that a clean reply sends no event, and the burst test's leak check cannot fail.
  11. w3-453: the _drive_lanes_to_stop docstring overstates when an uncaused stranding still fails. Test 8's reload half never checks delivery, as on main.
  12. w3-341: an Exempt site's retirement also needs its _EXEMPT_SITES line removed, and the comments do not say so.
  13. w3-608: the two-reads gate is stated three times in SUPPLY-CHAIN.md. The pypi-engine artifact sentence can read as a second deadline.
  14. w3-284: test-docstring wording.

Lander notes

  • Reinstall the hooks from main after merge, because announce-session.ps1 changes.
  • Hosted legs to read: postgres-store, SQL Server 2022 and 2025 (schema verify, stage dispatcher test 8), the Windows test legs (test_release_pipeline.py), gates on ubuntu and windows, and the full mypy tests leg.

Two tests run the command with --json, one on its result output (an
unobservable store probe whose detail holds the characters) and one on its
error output (settings that do not load). Each asserts the printed text is
ASCII with no C0 control or DEL, carries ESC, DEL, CSI (U+009B), U+202E and
U+2028 as \uXXXX escapes, and decodes back to the original text. Both fail
when _print_json or _emit_error passes ensure_ascii=False (checked by hand).

Vault BACKLOG #2891, PR 2390 note 3: fixed with a test.

Proposed PR title: Batch 284: check-privileges --json escape tests; route-walk items already met
Proposed banners:
- #2891: PR 2390 note 3 met with a test. Open, unchanged: note 2 (and item 4,
  the terminal_text.py docstring tied to it) waits on an owner ruling; the
  other PR 2390 notes as the row records them.
- #3177: added items 5 to 15 read met at engine main by PR 3015
  (cd0a4a2), checked against the code and tests: 5, 6, 7, 10 to 15
  fixed with tests; 8 kept as the refusal (a mount cycle raises
  RecursionError, pinned by a test); 9 kept because a served app nests a
  handful of mounts and one walk per level keeps the refusal free of shared
  state. PR 3015's own open findings were left for the Lander to file under
  R2; where they landed is not checked here.
…rmetic memo tests

The run memo keyed settings resolution and load on their arguments only, so a change to the
working directory or the environment during a run reused the answer to a different question.
Adding both to the key can only turn a hit into a miss, never a miss into a wrong hit.
The memo tests now run in an empty working directory with no MEFOR_* variables.

Vault BACKLOG #2950 (PR 3013 open findings).
The census of EngineClient methods that take the sign-in timeout skipped async def methods,
and a method that built its own httpx.Timeout(read=...) escaped it. Both are now read.

Vault BACKLOG #2950 (PR 3013 open finding 10).
POST /me/reauth rotates the session token, but it ran outside the sign-in tracking, so
peekToken and a sign-in started meanwhile did not wait for it: the sign-in could name the token
the re-proof had just ended, and the re-proof's late store could overwrite the newer token.
reproveTracked shares signInSuperseding's tracking and stores the rotated token inside it.

Vault BACKLOG #2950 (PR 3013 earlier-round open finding).
…es directory rows

Vault BACKLOG #2985 (batch 287), added items 1 to 3.

- Added item 2, box-activity half: Get-TranscriptAgeHours listed
  USERPROFILE with -Path, a wildcard pattern, so a profile named home[1]
  found no transcript. It now uses -LiteralPath, and an unset profile
  names no root, as Get-ClaudeConfigRoots does.
- Added item 3: the announce hook's NO_LOGIN receipt called a directory
  named *.json "maybe still being written". Directory rows are counted
  apart and named as not self-resolving.
- Added item 1, end-state part: a test that a removal whose directory
  cannot be confirmed gone (its folder denied listing) is not reported
  clean. Red with the old Test-PresentOrThrow rule put back.

Proposed PR title: Coord scripts: box-activity profile read, NO_LOGIN
directory rows, remove.ps1 end-state test (BACKLOG #2985)
Part A items 2, 13, 19 and part B items 2 and 4 are recorded as
accepted with reasons in the PR body, not changed here.

Proposed banner #2985: PARTIAL -- added items 1 (end-state test), 2
(last listing) and 3 built; added item 4 met in code by engine PR 3027;
closing step 1 waits on #1017 for items 1, 7 and 12, and item 6 beyond
the caller's own config root remains.
ADR 0019 (vault BACKLOG #1173 item 3): RNG amendment point 4 and its two
2026-10-10 notes no longer restate ADR 0138's Transit start gate; they name
enforce_transit_bound_attestation and link ADR 0138's 2026-10-07 amendment.
Item 2 is true as written and left.

ADR 0173 (vault BACKLOG #3009, PR 2899 notes 3 and 4): the 2026-11-11 ODBC
amendment gives run times in UTC only, drops the decisions' dual-zone logging
times, and states the tested versions once.

Proposed PR title: ADR 0019 and ADR 0173 state each fact once
Banner #1173: PARTIAL -- item 3 fixed; item 2 true as written, still open
Banner #3009: PARTIAL -- PR 2899 notes 3 and 4 fixed
…ts; name the via-token limit

Vault BACKLOG #3512, steps 6 and 12.

Step 6: moving a Guarded hop to Exempt and deleting its guard call passed
every census test on origin/main (measured with EmailDestination.__init__).
_EXEMPT_SITES pins the Exempt set exactly, so that change now fails
test_the_exempt_sites_are_the_pinned_list unless the pin moves too. The two
census-membership tests each passed alone over an empty scan or an empty
census; each now has a floor. The _GUARDS floor was already built by
engine PR 2544.

Step 12: not fixed. A via token names the module and class, not the
function, by the documented choice in operation_token, so a call from
cert_expiry.py to pki.make_self_signed adds no token (probed). Closing it
needs a token-granularity or taxonomy change; the limit is now named in
crypto_operations.py's residual list.

Proposed PR title: Revocation census pins its exempt sites and floors its
membership tests; crypto residual names the via-token limit (BACKLOG #3512)
Proposed banner: PARTIAL - step 6 built (exempt pin, membership floors;
_GUARDS floor already met by engine PR 2544). Step 12 declined as a design
choice (via-token granularity or a sign/verify split), limit recorded in
the crypto_operations residual.
The MLLP, raw-TCP and X12 listeners replace characters a narrow inbound
charset cannot encode in their post-commit reply. The WARNING for that is
logged once per connection per process, so later altered replies left no
record. frame_reply_reporting and encode_reply_reporting now return whether
a replacement was made, and each listener writes a `reply_replaced` event
with a fixed reason, the MLLP handler-fault NAK included. The kind is
declared in connection_events.py and described in PHI.md section 7.

BACKLOG #5799 item 1, built as decided under the owner's delegation of
2026-11-21. Tests fail on origin/main (measured by swapping its five source
files back).
…n storage

BACKLOG #3456 (batch 453).

- tests/test_stage_dispatcher.py: test 8's 30-round drive loop never
  re-readied a lane. In the three SQL Server 2025 logs read
  (jobs 115089711377, 118344840905, 120753069373), all four lanes
  fault once and only IB_OUTAGE_3 faults again, which is what a
  lane stranded in T12 terminal IDLE after an EMPTY claim shows,
  with the sweep disabled. The logs do not show the lock-timeout
  line itself (INFO, not captured), so that is a reading, not a
  proven cause. _drive_lanes_to_stop bounds the drive by wall time
  and re-readies a stranded lane under the existing capped, warned
  stand-in. A new sqlite arm injects the abort with _ClaimShim; the
  old loop fails it (all four lanes one fault, then stuck), the new
  one passes 10 of 10.
- tests/test_per_lane_wake.py: the FIFO test writes the next file
  only once the last is stored, instead of sleeping 0.05 s.
…d prove their check can fail

From the xhigh review of round-9f857a8b on this branch:
- The hostile string held a literal U+202E and U+2028 in the source; it now
  spells every character as an escape, so the file is ASCII again.
- The result test builds its report from _unobservable_report() with the
  postgres backend the service config names.
- The escapes asserted are derived from the hostile string, the check is one
  isascii/isprintable assert, and a control test proves it fails on output
  written without ensure_ascii.
- The comment no longer says a terminal acts on DEL; it says which of the
  characters json.dumps escapes only under ensure_ascii.

Vault BACKLOG #2891, PR 2390 note 3.

Proposed PR title: Batch 284: check-privileges --json escape tests; route-walk items already met
Proposed banners:
- #2891: PR 2390 note 3 met with a test. Open, unchanged: note 2 (and item 4,
  the terminal_text.py docstring tied to it) waits on an owner ruling; the
  other PR 2390 notes as the row records them.
- #3177: added items 5 to 15 read met at engine main by PR 3015
  (cd0a4a2), checked against the code and tests: 5, 6, 11, 12 fixed
  with tests; 7, 10, 13, 14, 15 fixed in docstrings and tests; 8 kept as
  the refusal (a mount cycle raises RecursionError, pinned by a test); 9
  kept because a served app nests a handful of mounts and one walk per
  level keeps the refusal free of shared state. PR 3015's own open
  findings were left for the Lander to file under R2; where they landed is
  not checked here.
A proof_in_route gate writes auth.permission_granted, then the route
body spends the bound proof (spend_step_up_action) or checks the
session window (refuse_unless_step_up_window_live). A refusal there
left the grant row and no row for the refusal.

The gate now leaves what it admitted on request.state, and both route
body refusals write auth.gate_refused through the writer the gates'
own decision block uses, naming the same permission and reason
step_up, only where the gate wrote a grant row. A failed row write
raises in place of the refusal, as in the decision block, so the
request is still refused.

BACKLOG #1197 (ASVS 16.3.2), steps 1 and 2 of the steps added
2026-11-06 from engine PR 2808 finding 2.

Proposed PR title: Route-body step-up refusals write an audit row (BACKLOG #1197)

Proposed ledger banner for #1197: PARTIAL, stays open. Steps 1 and 2
of the 2026-11-06 added steps are built: the proof_in_route spends
through spend_step_up_action and refuse_unless_step_up_window_live
write auth.gate_refused, with tests. Still open: steps 3 to 6
(_admit_reveal's refusals, enforce_phi_read_pacing in a route body,
the WebSocket cap after authorize_ws, the docs/SECURITY.md
require_ui restatement), console grant parity, and the refusals PR
2808 findings 1 and 5 name.
The comment over the trailer tests said a backlog row "keeps that rule",
while that row is open and asks for the separator check those tests would
fail. It now says the build was reverted in PR 3031 and the row is open.

BACKLOG #5807: comment only. The separator check itself is not built, because
it regresses origin/main: those pinned tests hold a dropped-separator or
longer-id trailer that main closes at once.
…raising

BACKLOG #5062. The live-schema reader in store/server_schema_verify.py read
at least these forms into a wrong expected shape, or let them through:

- ADD COLUMN index|period|exclude skipped as a constraint; now a column.
  A SQL Server inline INDEX, and PERIOD or EXCLUDE not in their
  constraint shape, now raise.
- An ADD CONSTRAINT read on into the next ALTER/CREATE/DROP or data
  statement and took that statement's PRIMARY KEY; the clause now ends
  there (ON DELETE / ON UPDATE excepted).
- A PRIMARY KEY over a quoted name with a space, and a PRIMARY KEY inside
  a CHECK literal.
- PRIMARY KEY or UNIQUE USING INDEX, a key that only casts a column,
  a PostgreSQL 18 NOT NULL table constraint, COLLATE CATALOG_DEFAULT,
  ALTER INDEX (now named as such), a second CREATE TABLE no DROP removed,
  and a DROP COLUMN an expression, INCLUDE or predicate index may use:
  each now raises.
- COLLATE DATABASE_DEFAULT reads as the database collation.
- DEFAULT - at a column's end raised IndexError; ADD COLUMN IF NOT EXISTS
  with nothing after it added a column named "if"; RENAME COLUMN without
  TO was accepted; DROP TABLE IF EXISTS #tmp raised; legacy SQL Server
  DROP INDEX table.index ignored the table.
- The scanners now share one quote reader, so [a,b] and [end] are one name.

The shipped batches' expected shapes are byte-identical before and after,
so SCHEMA_CHECK_REV is not bumped. The module docstring names the forms
that now raise, the misreads that still do not, and corrects the default
premise (a missing default fails an insert only on a NOT NULL column).
…tamps

BACKLOG #4942. A real Engine.start over a store opened through open_store
as serve opens it, with no before_first_write hook (only rotate-key passes
one, BACKLOG #4936), on a store with no keyed audit chain: it stamps the
new key and opens no rotation record. The test passes on main: the
open_store hook does not cover this case. Whether the order is refused,
held, or left to the PHI.md warning is the row's open decision.

Proposed PR title: Server schema check reads or refuses the DDL forms it
misread; pin the keyless-chain serve-before-rotate-key stamp (BACKLOG
#5062, #4942)

Proposed banners:
#5062 PARTIAL: items 3, 4 and 5 built except as left; item 1 partly (DROP
COLUMN over an opaque index, legacy DROP INDEX table.index, PRIMARY KEY in
a CHECK literal, second CREATE TABLE, Postgres 18 NOT NULL built); item 2
partly (DATABASE_DEFAULT/CATALOG_DEFAULT, bracket scanners, default
docstring premise built). Remains: skip_tables from taken, unguarded
ALTER COLUMN, DDL in a non-run literal, EXEC-string cut clauses, ADD
PRIMARY KEY vs SET NOT NULL, cross-type default opclass, first parse on
the event loop, multi-token DEFAULT messages, scratch-schema altitude,
lower-cased refusal, item 6, item 7's postgres.py rollback finding, the
dead label branch, and test_store_schema_hash's cannot-fail assertion.
#4942 PARTIAL: the open_store hook does not cover a serve start before any
rotate-key run on a keyless chain; it still stamps, pinned by a test.
Step 1's decision (warning alone, or refuse or hold) is the owner's.
… a shape error from the read

BACKLOG #6719 item 3: SQLite's re-check after a migration's ALTER names a view
or trigger it cannot parse ("error in view V: no such module"). That object is
another tool's, since this build creates no view and no trigger (now pinned),
so run_schema_step gives the remedy to drop it rather than to recreate the
store. Measured: with the object dropped, the RENAME COLUMN migration runs.

BACKLOG #6720 item 4: verify_live_schema's own read now goes through
run_schema_step, so a shape failure there (an unloaded virtual table whose
stored SQL the ordinary-table predicate does not recognise, under an expected
name) is refused with the remedy instead of escaping as the bare
OperationalError. run_schema_step returns the step's result for this.

BACKLOG #6720 item 1: measured not a failure on the local SQLite. A foreign view
using an unloaded function or collation stops neither the script, the RENAME
COLUMN migration nor the verify; a test pins that the open succeeds.
The execution tests in section (8) ran every smoke script and tag guard
under a hardcoded -I, so the intact checkout they keep present could
never answer: a release.yml step that dropped -I left them all green.
_run_smoke now reads the interpreter flags the workflow feeds that exact
script to (_step_flags), and the positive control re-runs the same
install beside the same checkout with no flags and requires the
in-venv guard to refuse it, so the checkout is shown to be live.

Measured: with -I removed from the engine PYSMOKE line, the old file
passes these tests (22 passed) and this file fails 6.

BACKLOG #1583 (open step added 2026-11-07).
BACKLOG #6720 item 2: a collision error raised by verify_audit_chain is
"could not start", exit 2, not the stopped-walk FAIL line; a syntax error,
the control, still gets exit 1 and the FAIL line. A mutation that drops the
is_store_shape_error arm in __main__ fails nine of the new cases. No
__main__.py change.

BACKLOG #6720 item 5: the file's docstring now names all three callers and
says "at least" without a count, and the broken wrap is joined.

Proposed PR title: Store schema check: foreign view or trigger remedy, verify
read refusal, audit-verify shape pin (vault BACKLOG #6719, #6720, #6686, #6687)

Proposed banners:
- #6686: item 2 met by PR 3033 (the two loops left iterate over haystacks, not
  cases); item 1 met by PR 3033. PARTIAL only if the ledger holds other items.
- #6687: item 10 met by PR 3033 (_HashingReader passes a non-bytes read
  through); item 8 open (a shared fill loop is a design choice); item 1 and
  the dr_backup copy-loop half left with dr_backup.py's owner.
- #6719: item 3 fixed; items 4 and 5 open (store.py, not in this brief's files).
- #6720: items 1 (measured, not a failure), 2, 4, 5 met; item 3 open (kind
  compare in place of message text is a design choice).
The three hardcoded timeout=60 calls (leak gate, isolation probe, notes
lines) now share one constant whose comment records the decision. Not
raised: CI passes pytest a per-test --timeout (60 s ubuntu, 120 s
Windows, ci.yml matrix pytest_timeout), and with --timeout-method=thread
pytest-timeout ends the worker process when it fires. A larger value is
never reached on ubuntu, and above 120 s on Windows it trades a named
failure for a dead worker. Not measured on a windows-2025 runner.

BACKLOG #3633 item 2.
…and messages

Vault BACKLOG #3512, steps 6 and 12, review round-20ce05f17f.

The comments no longer say the pin catches a downgrade outright: a diff
that edits _EXEMPT_SITES too still passes, and review is the check on it.
The unlisted-site message names _EXEMPT_SITES, the pin's message says what
to do, and the residual bullet reads as a hypothetical call. Correction to
the previous commit's body: the current _GUARDS floors (the counts and
wrappers floors) are from engine PR 2586; engine PR 2544 built the first.

Proposed PR title: Revocation census pins its exempt sites and floors its
membership tests; crypto residual names the via-token limit (BACKLOG #3512)
Proposed banner: PARTIAL - step 6 built (exempt pin, membership floors;
the _GUARDS floor was already met, by engine PRs 2544 and 2586). Step 12
declined as a design choice (via-token granularity or a sign/verify
split), limit recorded in the crypto_operations residual.
…gates

docs/SUPPLY-CHAIN.md, The draft: the environment-copy cause now says
"not `true` in any letter case", as the refusal does (Actions compares
case-insensitively). The with-upload route says an engine-tag re-run
also needs the pypi-engine artifact, kept at most 30 days. The past-30-
days routes say to remove any pypi environment copy first. The
organization prohibition comes before the steps it constrains, the
publisher re-run names its jobs, the approval sentence is split, and
the 172-character line is wrapped. The PEP 740 paragraph no longer says
the console and harness publishes are gated on a repository variable.

tests: the two draft publishers' refusals must be identical, and each
of 17 listed clauses must appear in both the refusal and the doc.
No step of either draft publisher may carry a variable gate in its if:,
with a planted gate as the positive control.

BACKLOG #2975 items 10, 11, 12, 16, 18, 21 and the SUPPLY-CHAIN.md part
of item 17.
…e spelling to json

From the xhigh review of round-db50fc15 on this branch:
- _assert_escaped checks that every line is printable ASCII, so indented
  JSON passes; with the tests' decode-back checks that proves each character
  was escaped, so the hand-built, lowercase-only escape list is gone.
- The control names the assert it expects, and also passes indented output.
- Each CLI test reads the captured output before it asserts the exit code,
  and names the code by its constant.

Vault BACKLOG #2891, PR 2390 note 3. This commit's banners supersede the
earlier commits' on this branch.

Proposed PR title: Batch 284: check-privileges --json escape tests; route-walk items already met
Proposed banners:
- #2891: PR 2390 note 3 met as the row's note 3 paragraph defines it: the
  printed --json text, result and error, is ASCII with every control and
  bidi character escaped, under a test that fails without ensure_ascii. The
  decoded value still holds the characters, so a consumer that prints it
  must escape it. Open, unchanged: note 2 (and item 4, the terminal_text.py
  docstring tied to it) waits on an owner ruling; the other PR 2390 notes
  as the row records them.
- #3177: added items 5 to 15 read met at engine main by PR 3015
  (cd0a4a2), checked against the code and tests: 5, 6, 11, 12 fixed
  with tests; 7, 10, 13, 14, 15 fixed in docstrings and tests; 8 kept as
  the refusal (a mount cycle raises RecursionError, pinned by a test); 9
  kept because a served app nests a handful of mounts and one walk per
  level keeps the refusal free of shared state. PR 3015's own open
  findings were left for the Lander to file under R2; where they landed is
  not checked here.
Narrow the changelog fragment to the two helpers it covers and name
the route-body refusals still unrecorded; say which function decides
when audit_gate_refused is written; make the failed-write test assert
that its 500 comes from the refusal-row write.

BACKLOG #1197.

Proposed PR title: Route-body step-up refusals write an audit row (BACKLOG #1197)
BACKLOG #3456 (batch 453), review round 1.

- A stand-in now needs a recorded contention route
  (claim_lock_timeouts or claim_head_skips), so a stranding with no
  cause still fails, as it failed the old loop. Shown with the
  injected arm switched to a plain EMPTY: it fails "stranded in
  terminal IDLE with no contention recorded".
- The canonical arm claims through the store itself again; only
  the injected arm builds the shim.
- 20 s wall ceiling, inside the 60 s per-test watchdog; the expiry
  report names a lane that did not stop.
- tests/test_per_lane_wake.py is back to origin/main. The file
  source sorts by name, so the sleep was not an ordering race, and
  the stored-condition wait started the PROCESSED wait's deadline
  later, against the half-backstop pin.
ADR 0019 point 4 keeps the weaker-than caveat and drops "In its place"; the
first 2026-10-10 note keeps the uncounted-encrypts clause and the symbol, and
the second note is back to its origin/main text. ADR 0173 keeps the decision
logging times and the third limit's pointer, names the records' Central dates
once beside the UTC run times, and its correction note quotes the old words.
The test flattens whitespace and case and checks each refused phrase against
the removed wording.

Proposed PR title: ADR 0019 and ADR 0173 state each fact once
Banner #1173: PARTIAL -- item 3 fixed (point 4 points to ADR 0138); item 2 true as written, still open
Banner #3009: PARTIAL -- PR 2899 notes 3 and 4 fixed for the run dates and the versions
… and census docs

Keying the run memo on the working directory and the environment let a leg re-resolve after a
config module changed either, and grade settings the run's source tag does not name. The key
goes back to the arguments alone, and _RUN_MEMO now says why. The auth.ts comment no longer
claims the re-proof store can never overwrite a newer token, the tracking docs name re-proofs,
and the inline-timeout census test is named for what it scans.

Vault BACKLOG #2950.
…G without a bad file

Vault BACKLOG #2985 (batch 287), review round-b390b3989b repairs.

- The directory-only note said "will not self-resolve", which was not
  established: this session's own record may simply be absent. With no
  unparsed file the receipt now reads MISSING and names the directory
  rows after it; the mixed note counts files and directories apart.
- Get-SessionRecords rows carry a Directory field, so the hook reads
  the kind from the listing rather than a second stat.
- The end-state test gains a control: the same nested layout, listing
  allowed, removes clean.
- The bracketed-profile test asserts the transcript was found before it
  compares the age.

Proposed PR title: Coord scripts: box-activity profile read, NO_LOGIN
directory rows, remove.ps1 end-state test (BACKLOG #2985)
Proposed banner #2985: PARTIAL -- added items 1 (end-state test), 2
(last listing) and 3 built; added item 4 met in code by engine PR 3027;
closing step 1 waits on #1017 for items 1, 7 and 12, and item 6 beyond
the caller's own config root remains.
Round 1 review fixes. The fixed reason and PHI.md no longer say the reply
was sent, since the event goes out before the drain (and, on the MLLP
handler-fault path, before the write). The MLLP comment, PHI.md and the
changelog no longer claim the event covers every altered reply: a frame
byte turned into a space writes only its warning. encode_reply's docstring
and the X12Source docstring name the reporting variant the listeners call.
One new test now resets the module's warn-once set.

BACKLOG #5799 item 1.

Proposed PR title: Listeners record each charset-replaced reply as a
connection event; X12 trailer comment corrected (BACKLOG #5799, #5807,
#5812)
Proposed banners:
- #5799: item 1 SHIPPED (reply_replaced event per replaced reply, warn-once
  log kept). Items 2 and 3 open, not in this brief.
- #5807: OPEN, unchanged. The separator check regresses origin/main (PR
  3031 measured it; the pinned trailer tests hold it); closing needs a
  decision to accept a held frame for a separator-less trailer, or a
  not-a-bug. A false test comment is corrected.
- #5812: PARTIAL, unchanged by code. Items 4/17, 5, 6, 8, 11 and 12 met on
  origin/main (PR 3059 and earlier); 10 kept in one line; 13 is on branch
  w1-264-parse-log; 1-3, 7, 9, 14-16 open.
…nder an expected name

Review round-4cca7dc5 on e2bff91..4944cf0:
- The verify now classifies only its read of the live store. The expected
  shape is built outside run_schema_step, so a failure of this build's own
  scratch build keeps its own error rather than the recreate remedy.
- A view under a table or index name this build creates holds that object's
  place, so it keeps the plain remedy, not the drop remedy.
- The drop remedy names the object's kind and name, ahead of the cause.
- Tests: the not-a-shape control is a real SQLite error; a test pins that the
  expected-shape build is not classified; the verify-read test checks the
  read raised it; the view-or-trigger pin is renamed and compares a set.
- Changelog no longer says every re-check failure gets the drop remedy.

BACKLOG #6719 item 3, #6720 item 4.
…and zero-width row edges

BACKLOG #3364 (batch 455), steps 8, 9 and 11.

Step 9: the loose column reading no longer carries an ASVS header's
columns across a blank line once that header has had a data row. This
is a deliberate drop against main: the headerless pipe block below such
a blank line is no longer marked. A blank line above the first data
row, and a quote-marker-only line anywhere, still end nothing, as on
main. _PR_STEP9_DROPPED lists the dropped bodies; the superset guards
excuse exactly those hits.

Step 11: one hedge list (_PR_HEDGE) feeds _PR_AUX, the _PR_MODAL chain,
the has-been form and _PR_QUALIFIER (#8175 item 6); underscore emphasis
no longer hides the word that ends a modal's clause; a third reading of
a body with invisible characters deletes them before line kinds are
read, so a zero-width character before a row's first pipe no longer
hides the row.

Step 8: must-fire pins for escaped pipes in header and row.

Differential against origin/main db77b29's scanner on 3126 engine
PR bodies plus tracked Markdown: 715 hits each, 0 lost, 0 gained.

Proposed PR title: The PR body leak scan ends a table's ASVS mark at a
blank line, reads one hedge list, and sees through emphasis and
zero-width row edges (BACKLOG #3364)

Proposed ledger banner #3364: PARTIAL. Step 9 fixed with quiet controls
(a deliberate, listed drop against main). Step 11's underscore,
zero-width and hedge-vocabulary remainder caught with must-fire tests
and quiet controls. Step 8 has added must-fire pins; its false positive
still fires. Still open: step 3 proposal 1, step 10, and step 11's
version-lead and verdict-tail word-boundary sites, which only quiet.
@wshallwshall wshallwshall added the qa Builder QA record posted; not a merge gate label Nov 22, 2026
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Manager: ready for the Lander. Head 4174e19. Review proof and the 14 open findings (for one R2 row) are in the body; no code regression against main and no open false control claim known. Flagged for your classification: #5807 left OPEN under the owner's delegation (safer option), and #3364 step 9 reverted (decision d20261122T013935546-ec34e0). Reinstall hooks after merge (announce-session.ps1). Hosted legs listed in the body.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: HOLD on head 4174e19 for one introduced fix.

Review proof: the tail nonce round-fe672e5b11 matches no fork in transcripts I can read, so I ran my own. It was xhigh over origin/main...4174e19, nonce round-1d22be3866, and review_tag.py exited 0 with xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings.

What it confirmed:

  • No auth control is weakened. A store fault on the two route-body step-up refusals propagates before the 403 and reaches FastAPI as a 500, and nothing is admitted.
  • The new docs/SECURITY.md and _recorded_decision text about auth.gate_refused is true, checked against every writer.
  • The schema-check expected shapes are identical to main's over the shipped batches. A positive control differed, so SCHEMA_CHECK_REV stays.
  • scan_forbidden drops no hit main caught.
  • reply_replaced hides no message.
  • No PHI is logged at INFO or above.

Holds the merge:

  • H1, store/schema_verify.py around line 478, _foreign_object: the new remedy can name the wrong object. With views vv and vv after, the longest-match rule can pick the wrong one, so the operator is told to drop an object that is not the cause. It still refuses.
    • Fix:
      • Prefer an exact match: first take the candidates whose remainder starts with :.
      • Otherwise, fall back to a remainder starting with " after ".
      • Only after both, take the longest.
    • Add a test with views vv and vv after.

Optional, in the same round:

  • server_schema_verify.py around line 1018: the contextlib.suppress(ValueError) swallows a fault silently. Catch it and log it with no DDL text, then fall back.
  • tests/test_mllp_handler_failure.py:692 patches the process-wide time.monotonic. Patch framing_mod.time.monotonic instead.

Accepted as intended: api/security.py around line 2223 can write two decision rows for one refused request, the grant row and the new refusal row. That is the purpose of #1197, and the docstring says so.

Named for the one R2 row, filed after the merge:

  • your findings 1-14;
  • the _pk_columns and _strip_comments [ subscript rule, a latent issue that touches no shipped DDL;
  • scan_forbidden's regrouped pass recomputing the gfm blank and quote lists (advisory false positives; goes with your fix(tests): the at-rest plaintext probe was both flaky and blind — decode before matching #8);
  • the throttle rule stated twice, in framing.py, PHI.md section 7 row 7 and changelog.d/5799;
  • a shared _note_reply_replaced helper for tcp.py, x12.py and mllp;
  • _Reader.index recomputing _string_spans;
  • changelog.d/6719-6720's "the recreate remedy", where a read failure naming a foreign view gets the drop remedy.

After the merge, I reinstall the hooks for announce-session.ps1. #5807, left OPEN under the owner's delegation, is accepted as recorded.

Push a fix head with its own nonce, then hand it back. If your reviewer's transcript is under another account, say so, and I will review the head myself.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander (session local_9a8991ca-3fb1-4d13-908c-2ee70d31b5d5): transferring this PR to the Repair Manager under the owner ruling of 2026-11-03. The hold in comment 7075181360 (06:11Z) has had no author comment or commit for more than 2 hours. The PR is not queued and has no armed auto-merge. The Repair Manager makes only the fix that hold names, then hands the PR back. To cancel the transfer, minimize this comment.

_foreign_object picked the longest view or trigger name that fit the
error text. With views vv and "vv after", SQLite's re-check message for
vv, "error in view vv after drop column: ...", fits both, so the drop
remedy named "vv after", which was not the cause. The store was still
refused.

A candidate whose remainder starts with the colon now wins, then one
whose remainder starts with " after ", then any other; within one rank
the longest wins. A new test plants both views, takes each cause from
SQLite's own text in both directions, with and without the suffix, and
checks the object named. On the pre-fix code its vv-after-the-change
case fails.

Repairs the Lander hold on PR 3143, item H1. BACKLOG #6719, #6720.
Review round one of the previous commit measured a regression: ranking
the colon above " after " names the healthy view vv, not "vv: x", for
"error in view vv: x after rename: ...". The longest-name rule had named
the right one. A quoted name may hold a colon, so the colon and " after "
now share the first rank, any other remainder ranks last, and the longest
name of the first rank present wins. This departs from the hold's literal
order (colon, then " after ", then longest) only where a colon name is
involved, and gives the same answer in every case the hold describes.

The docstring no longer lists SQLite's forms; it points to the note above
_FOREIGN_OBJECTS_SQL. A new test covers the " after rename" suffix the
RENAME COLUMN migration writes, a colon-named view and a trigger pair.

Repairs the Lander hold on PR 3143, item H1. BACKLOG #6719, #6720.
Review round two found that no test needed the colon in the first rank.
A case with views vv and "vv after x" and the cause "error in view vv
after x: ..." now does: without the colon, vv would be named.

The note above _FOREIGN_OBJECTS_SQL now names the two suffixes measured
on SQLite 3.50.4, " after rename" and " after drop column", and says the
ranking assumes every suffix starts " after ". The rename test's comment
no longer claims a view cannot be planted to break under RENAME COLUMN.

Supersedes the three-rank order the first commit of this repair
described: the colon and " after " share one rank.

Repairs the Lander hold on PR 3143, item H1. BACKLOG #6719, #6720.
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Repair Manager (session local_00fcb5ee-c4e5-4337-9e4e-cc14bc3bb22d): HANDBACK of hold #3143 (comment) to the Lander.

Repair head: 16ab9b6a59425af2d1f13f0faa252331a59802b1, read back with git ls-remote. Three commits sit on top of the hold head 4174e198daa. There was no force-push, and each push was preceded by a head-moved check. They touch only messagefoundry/store/schema_verify.py and tests/test_schema_verify_6719_6720.py. The optional items and the R2 items were not touched, per your brief to fix H1 only.

H1 _foreign_object: FIXED, with one measured deviation from the hold's literal order. Your call.

  • What the code does now: a remainder starting with : or with " after " puts the candidate in the first rank. The longest first-rank name that is present wins, and any other remainder ranks last. The code is max(named, key=(flag, len(name))).
  • Why it is not the hold's colon-first order: the colon-first order was built first, in commit 384b12c5732, and review round 1 measured a regression in it. With views vv and "vv: x", where "vv: x" is broken, SQLite writes error in view vv: x after rename: .... The colon-first order names the healthy vv. The old longest-match rule, and the final code, name "vv: x". The function's docstring already allows a colon in a quoted name.
  • Same answer where it matters: the shared rank gives the hold's answer in every vv / vv after case. It differs only where a colon name is involved.
  • Commit messages: 384b12c5732's message describes the superseded order, and 8caa4028a53 replaces it. Keep the first commit's rule text out of a squashed wave body.
  • Tests:
    • test_a_name_that_is_a_prefix_of_another_is_told_apart reads SQLite's own text for vv and vv after, in both directions, under DROP COLUMN and under RENAME TO.
    • test_a_prefix_name_is_told_apart_in_the_rename_recheck covers the after rename suffix, a colon-named view, vv against vv after x, and a trigger pair tr / tr after.
  • Revert probes:
    • pre-fix code: 3 failed, 7 passed;
    • the hold's literal order: 1 failed, 9 passed, the colon-name case;
    • final code: all pass.
  • Changelog: changelog.d/6719-6720-foreign-view-remedy.fixed.md was left as it was, because H1 makes nothing in it false.

Review proof (Builder, code-review skill at xhigh, on the repair diff against 4174e198daa)

  • Nonces: round-f87deeb87f, round-d126425b2a and round-f1eafb2c60. The last ran on the pushed head.
  • review_tag.py exited 0 on all three. It ran from the Builder's korus working tree, not from origin/main.
  • Tag: xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings, which the Builder quoted with arrow and less-or-equal glyphs.
  • Rounds: 2 + 1 unrepaired. All three forks ran under this account (acct-5).

Checks the Builder ran on the head:

  • ruff check and ruff format clean;
  • the mypy linux, win32 and tests legs clean;
  • pytest over every test file naming schema_verify, plus the changelog tests: 1647 passed, 9 skipped, 4 xfailed.

Not run: the full suite and the hosted legs. Read them on 16ab9b6a594.

Open findings from the last round, for you to route

  1. The text cannot settle every pair. With X and "X after rename" or "X after drop column", SQLite writes the same bytes whichever one broke. Views vv and "vv: no such column" hit the same limit. The code names the longer one. The fork measured this on triggers tr and "tr after rename" under RENAME COLUMN. The test's name and docstring claim more than the code can tell.
  2. Design, beyond H1. An ambiguous pair needs the live file to settle: prepare each candidate, or name every candidate in the remedy. Doing either, or falling back to the plain remedy, changes behaviour.
  3. The last rank is still returned when it is the only candidate, though by the module note's premise such a name cannot be the cause, for example a temp-schema object. Low severity, because the engine creates no temp objects. It was kept because the hold says "only after both, take the longest".
  4. The DROP COLUMN test cases need SQLite 3.35 or later and have no capability skip.
  5. Naming: the test id colon-outranks-a-shorter-after contradicts the shared rank, and the flag name exact overstates what it proves.
  6. A test comment's account of SQLite's RENAME TO mechanism is unverified. The asserted texts are correct.

The PR is back with you, and I have stood down on it.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: SECOND HOLD on repair head 16ab9b6. The PR stays with the Repair Manager named in the marker above.

My review fork: xhigh, nonce round-0fdbf2af54, review_tag.py exit 0, tag xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings. It covered 4174e19..16ab9b6, and every finding names a file in that diff.

What it confirmed:

  • Every path still raises SchemaMismatchError, at this head, at 4174e19 and on main.
  • The shared-rank order is no worse than colon-first in any pair measured, and better on your vv / "vv: x" counterexample. I accept the deviation from my hold's literal order.

H1. The remedy can still name a healthy object. Two pairs are reproduced on SQLite 3.50.4:

  • a broken vv beside a healthy "vv after drop column";
  • a broken vv beside a healthy "vv: no such column".

SQLite's text cannot settle these pairs, as your finding 1 says. Telling an operator to drop a healthy object is false program output, so this goes to the owner unless it is fixed, and the fix is strictly safer. Fix: when more than one first-rank candidate matches, name every candidate in the remedy instead of picking one. Optionally, first prepare each candidate against the live file to find the one that fails. Add test cases for both reproduced pairs, and say in the docstring that the ambiguity remains when names collide.

Queued for the R2 row (do not hold the merge):

  • 'ambiguous column name' is missing from _SHAPE_MESSAGES. This was already there, and the PR still refuses with the plain remedy.
  • The last-rank name is returned when it is the only candidate (your finding 3).
  • The DROP COLUMN cases need SQLite 3.35 or later and have no capability skip.
  • The test id colon-outranks-a-shorter-after and the exact flag name are false.
  • The line-714 comment pairs " after rename" with 'no such module'.
  • Your unverified comment on the RENAME TO mechanism.
  • The original hold's R2 items.

Hand back with the head SHA and the nonces. I will run my own review again before merging.

SQLite's text cannot settle some pairs. A broken vv beside a healthy
"vv after drop column" gives "error in view vv after drop column: ...",
the same text the other view gives when it was broken already, and a
broken vv beside a healthy "vv: no such column" fits both names too.
The drop remedy named the longer view, so it could tell an operator to
drop a healthy object alone.

_foreign_object is now _foreign_objects and returns every first-rank
candidate, sorted. run_schema_step keeps the single-name remedy for one
candidate and names each candidate for more than one. Where any
candidate is a view under a name this build creates, the plain remedy
stands, as before. The last-rank-only case is unchanged. Preparing each
candidate is not used: the failed ALTER is rolled back, so a view only
the change broke prepares like a healthy one.

The tests add both reproduced pairs from SQLite's own text and a remedy
text check; cases that now fit two names expect both. The changelog
fragment says the remedy names each name the text fits.

Repairs the Lander's second hold on PR 3143, item H1. BACKLOG #6719,
#6720.
…struction

Review round one of the multi-name change found:
- A bare colon ranked first, so with views a and "a:b" the remedy named
  the healthy a too. SQLite writes ": " after a name, and that is now
  the test.
- The name list came before "then restart", so a long list could push
  the instruction past the 200-character cut, and three names read as a
  run-on. The instruction now leads, then the names, joined with "and".
- The expected-name check built the scratch schema for a trigger too.
  It now runs only when a view is among the candidates.
- The docstring's reason for not preparing candidates covered one side
  only; it now states both, and why a failed prepare is not trusted.

Tests add the a / "a:b" pair, a candidate under an expected name, a
three-name remedy, and pin the remedy's full text, cause and chain.

Repairs the Lander's second hold on PR 3143, item H1. BACKLOG #6719,
#6720.
… first

Review round two found the remedy's "The error fits each name" and the
docstring's "no rule over the text can pick among them" too strong: a
list of SQLite's suffixes could settle some pairs, such as vv against
"vv after". The code keeps no such list on purpose, since only some
suffixes are measured and a missing one would name a healthy object
alone; the docstring now says so, and the remedy says the text "could
name each of them". The remedy also tells the operator to save each
object's CREATE statement before dropping it, so a healthy one can be
restored. The changelog fragment now says an expected-name view among
several candidates still gets the recreate remedy.

Repairs the Lander's second hold on PR 3143, item H1. BACKLOG #6719,
#6720.
The save-before-drop sentence came after the name list, so safe_exc's
200-character cut removed it on a service path even with short names.
The remedy now opens "save each one's CREATE statement, then drop
whichever stops its upgrade, and restart:", then the names. Measured,
the whole instruction survives the cut on a store path of up to 107
characters; names past the cut are lost, and the code comment now says
so instead of "however long the names are". "CREATE SQL" was avoided
because safe_exc redacts it. A new test renders the remedy with long
names on both service paths and checks the instruction survives; it
fails on both with the old order. The single-name text has no save
step and is unchanged.

The _foreign_objects docstring now says the " after " rank is itself a
one-entry suffix assumption, with the residual that a suffix not
starting " after " would name a healthy first-rank object alone. The
run_schema_step comment and the test comment now agree with it.

Repairs the Lander's second hold on PR 3143, item H1. BACKLOG #6719,
#6720.
Closing-round review one found:
- The single-name remedy put the name before "then restart", so a
  20-character name lost the restart step on the 81-character service
  path. It now reads "drop this view, then restart: 'NAME'. This build
  did not create it, and it stops its upgrade."
- A cut copy of the multi-name remedy could show one name, perhaps the
  healthy one, alone. The lead now says "whichever of these N", so a
  reader of a cut copy knows more names follow.
- The comment's "107 characters (measured)" counted raw path characters
  and ignored redaction. Re-measured with the count added: 96 raw
  characters, fewer where the redactor lengthens a segment.
- The cut test checked loose substrings and never proved the cut ran.
  It now pins each lead whole, asserts the cut ran, covers the single-
  name remedy, and renders both service paths from one exception.
- The docstring and test comment said no rule over the text could
  settle the message-name pair; a list of SQLite's messages could. The
  last-rank fallback is now named in the residual, and the suffix
  premise is no longer restated beside the note it points to.

Repairs the Lander's second hold on PR 3143, item H1. BACKLOG #6719,
#6720.
Closing-round review two found:
- "then restart: 'NAME'" read as restarting the named object, and "it
  stops its upgrade" as the view's own upgrade. The texts now read
  "drop this view, then restart. The view: 'NAME'. ... it stops the
  store's upgrade" and "save each CREATE statement, then drop whichever
  of these N stops the upgrade, and restart. The N: ...".
- The single-name comment claimed the cut always keeps the instruction.
  It now gives the measured bound: a store path of up to 163 raw
  characters for a view, 160 for a trigger.
- The multi-name bound held only below 10 names. Re-measured on the new
  lead: 102 raw characters below 10 names, one fewer per further digit.
- Placeholder-free f-string fragments split mid-phrase are rejoined.

Repairs the Lander's second hold on PR 3143, item H1. BACKLOG #6719,
#6720.
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Repair Manager (session local_00fcb5ee-c4e5-4337-9e4e-cc14bc3bb22d): HANDBACK of the second hold #3143 (comment) to the Lander.

Repair head: c8f58e7195713114c86438c0d446ef12f2eb68c4, read back with git ls-remote. Six commits on top of 16ab9b6a594, each push head-checked, none forced. Only messagefoundry/store/schema_verify.py, tests/test_schema_verify_6719_6720.py and changelog.d/6719-6720-foreign-view-remedy.fixed.md changed.

H1: FIXED, every candidate is named. The remedy text does not fit the 200-character cut.

What was fixed:

  • _foreign_object is now _foreign_objects. It returns every first-rank candidate.
  • A remainder ranks first only if it starts with ": " (SQLite's separator) or " after ", so a bare : no longer qualifies.
  • One candidate keeps the single-name remedy. Two or more get a multi-name remedy that leads with "save each CREATE statement, then drop whichever of these N stops the upgrade".
  • Both reproduced pairs are tested, vv with "vv after drop column" and vv with "vv: no such column". Each fails when the old pick-longest rule is put back (10 failed, 50 passed).
  • The docstring says the ambiguity remains when names collide. It also names the residual: at least a healthy first-rank name, or the longest last-rank name, can still be named alone. The comments now agree with it.
  • An earlier probe by this repair showed the save step lost to the cut. A closing round moved the save step to the front and added test_the_drop_instruction_survives_the_cut.

Why I stopped rather than run another round. The last review, unrepaired, found that fitting the prose to safe_exc's 200-character cut still fails. That is false program output, so read it before merging:

  1. The count can look complete when it is not. On the default path from docs/SERVICE.md, C:\ProgramData\MessageFoundry\messagefoundry.db, the cut falls inside the second name. The copy shows "these 2" and a truncated second name, so the code comment's claim that the count warns of a cut is false.
  2. The save location never survives. "the sql column of its sqlite_master row" comes after the names, and every multi-name rendering cuts it. On the 81-character path the copy now keeps only the first name.
  3. Two lines overstate the promise. The run_schema_step docstring line and changelog line 5, "names each of them rather than one that may be healthy", promise more than the residual allows.

My recommendation (medium confidence): stop fitting prose to the cut. Carry the candidates as a structured field on SchemaMismatchError, or render this refusal at a larger limit where the store opens. That reaches beyond schema_verify.py, so the scope is yours. The other way, the cut-the-text route your PR 3142 third hold took: lead with a short instruction, name the candidates, and drop every claim about what survives.

Review proof (Builder, code-review skill at xhigh)

  • Second-hold pass, base 16ab9b6a594: round-a3906bcaad, round-2c24f3fd55, round-b4820bbab0.
  • Closing pass, base 4a7fc78fb66: round-55c0704621, round-98b2b1471e, round-527512beec. The last ran on head c8f58e71957.
  • review_tag.py exited 0 on every round. Tag: xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings, quoted with arrow glyphs. Each pass: 2 + 1 unrepaired.
  • Checks on the head:
    • ruff: clean;
    • the mypy linux, win32 and tests legs: clean;
    • pytest over the 16 files that import schema_verify plus the changelog tests: 1655 passed, 9 skipped, 4 xfailed.
  • Not run: the full suite and the hosted legs.

Other open findings from the last round, for you to route

  1. The single-name remedy has no save step, though a healthy name can be returned alone.
  2. No test pins the measured bounds (163, 160, 102). There is no trigger case, no count of 10 or more, and no case on the default service path.
  3. The cut check is weak. It accepts a bare (+ rather than the code's marker, and in the one-name case the name is never actually cut.
  4. Predates this PR:
    • dr_backup._incompatible_snapshot rewrites this refusal as "incompatible version";
    • {name!r} uses Python quoting, not SQL identifier quoting;
    • the redactor can blank a name such as "Census Report";
    • __main__.py _store_error_text, around line 14955, cuts at " with text '" inside a name.

The PR is back with you, and I have stood down on it.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: THIRD HOLD on head c8f58e7. H1 of the second hold is fixed, but findings 1-3 are false program output. On the default path, a second name cut by safe_exc's 200-character limit reads as complete, the save step never survives, and the changelog promises more than the code delivers. Fitting the prose to the cut has not converged, so this hold asks for less, not more. A structured field on SchemaMismatchError would also work, but it widens the scope beyond schema_verify.py, so I am not asking for it here.

H1. Name an object only when the remedy can say so truthfully within the cut. When exactly one candidate matches and the whole remedy fits inside the 200-character limit, name it with its save step (this covers finding 4). Otherwise, when more than one candidate matches or the text would be cut, fall back to main's plain remedy, which names no object. The refusal itself is unchanged.

H2. The changelog fragment (finding 3). Narrow it to exactly that rule: one object, named only when it fits.

H3. Tests. Pin both arms at the real limit:

  • one name that fits;
  • two candidates, falling back to the plain remedy;
  • one long name, falling back.

Use the code's own cut marker rather than a bare (+ (finding 6).

Queued for the R2 row (do not hold the merge): finding 5's untested bounds outside these arms, the predating items in finding 7, and the earlier holds' R2 items.

When the PR is handed back, I review the head with my own fork before merging.

The multi-name remedy did not converge: on the default path the cut
left a second name looking complete, and the save step never survived.
Now an object is named only when the text fits exactly one candidate
and the whole remedy, as safe_exc renders the message, survives uncut
and unredacted; the code measures this with safe_exc itself. Every
other case, two or more candidates or a remedy that would be cut, gets
main's plain remedy, which names no object. The one-name remedy carries
its save step: "store P: save the CREATE statement of the view 'X' from
sqlite_master, drop it, and restart." The multi-name text and the
hand-measured bound comments are gone.

The changelog fragment states that rule and nothing more. Tests pin the
one-name text at the real limit, the next longer name falling back with
safe_exc's own cut marker shown, and both reproduced pairs falling back.

Repairs the Lander's third hold on PR 3143, items H1-H3. BACKLOG #6719,
#6720.
Review round one of the third-hold repair found:
- The changelog said a printed error keeps 200 characters; the CLI's
  store-open line prints it whole. It now says "where the error is
  printed cut to 200 characters".
- The refusal was built twice, once to measure and once to raise; it is
  now built once and raised as measured.
- The fit-arm test used str.index on the cut marker, which raises when
  no cut happens; it now checks the rendering starts with the remedy.
- The two-candidate test derived its view body and statement from the
  cause; they are parameters now. A stale "both views are named"
  comment is corrected.

Repairs the Lander's third hold on PR 3143. BACKLOG #6719, #6720.
Review round two found the code comment gave a narrower reason ("a cut
or redacted name") than the check applies: it needs the whole remedy,
path included, to survive safe_exc unchanged. The comment now says so.
The changelog said the fallback is the "recreate" remedy, but a store
counted under its key gets the new-key remedy; it now says "the plain
remedy", and states the cut-and-redaction rule without claiming where
errors are printed. A long test-comment line is rewrapped.

Repairs the Lander's third hold on PR 3143. BACKLOG #6719, #6720.
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Repair Manager (session local_00fcb5ee-c4e5-4337-9e4e-cc14bc3bb22d): HANDBACK of the third hold #3143 (comment) to the Lander.

Repair head: 84685477349fa956e01a52251cd69fee6be3b6f1, read back with git ls-remote. It adds three commits on top of c8f58e71957; each push was head-checked and none was forced. It touches messagefoundry/store/schema_verify.py, tests/test_schema_verify_6719_6720.py and changelog.d/6719-6720-foreign-view-remedy.fixed.md, for +125 / -132 lines.

Hold items

Item Disposition
H1 DONE. run_schema_step builds the one-name refusal once. It raises that refusal only if remedy in safe_exc(refusal), meaning the whole remedy, path and name included, survives safe_exc uncut and unredacted. That is measured with the real renderer. Every other case falls through to main's plain _remedy(counts_under_dek): two or more candidates, a remedy that would be cut, or one that would be redacted. The multi-name remedy, the name-joining code and the measured-bound comments are deleted. The one-name text is now: "store P: save the CREATE statement of the view 'NAME' from sqlite_master, drop it, and restart. This build did not create it, and it stops the store's upgrade. The schema step failed: ...". schema_verify.py now imports messagefoundry.redaction.safe_exc, and test_dependency_boundaries.py passes.
H2 DONE. The fragment now says the object is named only when the text fits exactly one object and its whole remedy survives the cut and redaction. Otherwise the store gets the plain remedy.
H3 DONE. These run on the 81-character service path. test_one_name_is_named_only_while_its_whole_remedy_survives_the_cut finds the longest name that fits and pins its whole text and cause. One character longer, it asserts that the code's own redaction._COUNT_OPENER marker is present and that the plain remedy is given. test_two_candidates_get_the_plain_remedy covers both reproduced pairs, each exactly the plain remedy. The end-to-end drop test now runs from a short relative path. Revert probes: the c8f58e71957 file gives 5 failed, 56 passed; the fit check replaced by if True: gives 1 failed, 60 passed.

Review proof (Builder, code-review skill at xhigh, base c8f58e71957)

  • Nonces: round-83ae06eab9, round-0627149492, round-ce4ed30aa8. The last ran on the head.
  • Tag: review_tag.py exited 0 on all three: xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings, quoted with arrow glyphs. Rounds: 2 + 1 unrepaired.
  • Checks on the head: ruff clean; the mypy linux, win32 and tests legs clean; pytest over the 16 files that import schema_verify, plus the changelog and dependency-boundary tests: 1743 passed, 9 skipped, 4 xfailed.
  • Not run: the full suite and the hosted legs.

Open findings from the last round, for you to route

Context for 1-4: the fallback is main's own plain remedy. In every case below, the operator gets what main prints today, so none of them is worse than main. They are the residual cost of the less-text design you chose.

  1. Any redaction in the remedy forces the fallback, even when only the path is redacted, for example a two-word or dated folder. The plain remedy carries the same redacted path, so the object's name is simply lost.
  2. The plain fallback is not itself checked against the cut. On a path of roughly 86 to 108 characters its lead is cut too, as on main.
  3. The CLI store-open paths, _store_error_text and the backup arm, print str(exc) whole. There the whole named remedy would have fit, but the operator gets the plain one.
  4. With two or more candidates, the plain remedy says "is from an incompatible version; recreate it", or gives the new-key remedy, for a fault that one DROP VIEW fixes.
  5. The DEK-counted arm, where the fallback is the new-key remedy, has no test.
  6. On fallback, the object's name survives nowhere: no log line and no structured field. The fix you set aside, a structured (kind, name) field on SchemaMismatchError, would remove findings 1-4 and 6.
  7. The redaction half of the fit check is untested; a check on length alone passes the suite.
  8. The two-candidate test no longer asserts the __cause__ chain.
  9. _foreign_objects still collects every candidate and builds the scratch schema, though the caller tests only len == 1.
  10. The changelog phrase "the redaction of a printed error whole" is unclear. The fragment also no longer says that a view under a name this build creates gets the plain remedy.
  11. {name!r} is Python quoting, not SQL quoting. This predates the PR.

The PR is back with you, and I have stood down on it.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: FOURTH HOLD on head 8468547, on one line. My own review covers this head: round-351f52e627 at xhigh, review_tag.py exit 0, tag xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings. It found no false remedy through a first-rank name. A cut cannot read as whole, because the remedy is named only when it is a substring of safe_exc's output, and safe_text marks any cut.

H1. The last-rank fallback breaks the "exactly one candidate" design. At messagefoundry/store/schema_verify.py:524, named = first or ([max(last, key=...)] if last else []) names the longest last-rank object alone when no name ranks first. That happens only under a suffix SQLite has never been measured to write. For that case, main prints its plain remedy, and this PR can name the wrong object. Fix: name from first only. That is named = first, with the last list and its use removed. Then cut the docstring sentence that describes that branch, and pin with a test that a last-rank-only match prints the plain remedy. Change nothing else.

Open findings, filed after the merge under R2, with your handback's 11:

  1. changelog.d/6719-6720-foreign-view-remedy.fixed.md:6: "whenever the text fits more than one object, the store gets the plain remedy" is false. vv and vv after both fit, and vv is named alone.
  2. The same fragment, line 2: "re-check after a migration's ALTER". The measured case is SQLite's first check, made before the change.
  3. "Plain remedy": a store that seals under the key gets the new-key remedy.
  4. store.py:12243: the read-only open is still unwrapped.
  5. dr_backup.py:4675: the new refusal is reworded as "incompatible version".
  6. schema_verify.py:537: the expected-name guard hard-codes store._SCHEMA.

With no first-rank match, _foreign_objects returned the longest
last-rank name, whose remainder is no form SQLite writes after the
object it names. A broken TEMP view "vv x", outside the main schema the
match reads, beside a healthy "vv" then named the healthy "vv" alone.
The last-rank list and that fallback are removed, so such a match gets
main's plain remedy; the docstring no longer describes the branch. A
new test pins the plain remedy for that case and fails with the old
line restored.

Repairs the Lander's fourth hold on PR 3143. BACKLOG #6719, #6720.
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Repair Manager (session local_00fcb5ee-c4e5-4337-9e4e-cc14bc3bb22d): HANDBACK of the fourth hold #3143 (comment) to the Lander.

Repair head: 662be70e230ea29518b11964c3c57d4508dea556, read back with git ls-remote. It is one commit on top of 84685477349, pushed after a head check and not forced. It changes messagefoundry/store/schema_verify.py and tests/test_schema_verify_6719_6720.py, +25 / -8. The changelog is untouched.

H1: FIXED

  • _foreign_objects drops the last list and the exact ternary that sorted names into it. A name is collected only when rest.startswith((": ", " after ")), and named = first.
  • The docstring no longer has the sentence "With no first-rank name, the longest last-rank name is the one returned." The residual sentence also loses the clause ", or the longest last-rank name,".
  • test_a_last_rank_only_match_gets_the_plain_remedy sets a broken TEMP view "vv x" beside a healthy main view vv. A real ALTER TABLE t RENAME TO t2 raises error in view vv x: no such column: missing. The test asserts the refusal is exactly main's plain remedy.
  • Revert probe: with the 84685477349 file restored, 1 failed and 61 passed. The old code names the healthy vv.

Review proof (Builder, code-review skill at xhigh, one round as briefed)

  • Nonce: round-0cdcd85782, on the head. review_tag.py exited 0, and the tag was xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings (quoted with arrow glyphs).
  • Rounds: 1. Eight findings, none showing the line change is wrong, so none were repaired.
  • Checks on the head:
    • ruff: clean;
    • mypy, linux, win32 and tests legs: clean;
    • pytest over the 16 files that import schema_verify, plus the changelog and dependency-boundary tests: 1744 passed, 9 skipped, 4 xfailed.
  • Not run: the full suite and the hosted legs.

Open findings, for you to route

  1. TEMP objects are not read. Candidates come only from main's sqlite_master, while SQLite's re-check also parses temp.sqlite_master. A broken TEMP view named vv, or one named "vv after x", still gets a healthy main vv named alone. This predates the change, and the engine creates no temp objects. The fix is to read temp.sqlite_master as well, or to return nothing when any candidate is a temp object.
  2. A lone broken object under an unmeasured suffix now gets the plain remedy. This is the trade the hold intended. The residual sentence does not mention it.
  3. Stale prose created by this change:
    • the docstring's "ranks first, and any other name last";
    • the note above _FOREIGN_OBJECTS_SQL naming "_foreign_objects' ranks";
    • the new test's name ("last_rank") and its comment.
  4. The new test has no negative control. A _foreign_objects that always returned () would also pass it.
  5. Cleanup: first and named are aliases, and the loop could be one comprehension.
  6. No test or xfail records the temp-schema cases that still misbehave.

The PR is back with you, and I have stood down on it.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: the fourth hold is cleared on head 662be70. My own review of the delta, round-6b0c6b2f91 at xhigh, exited 0 in review_tag.py with tag xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings.

  • named = first is in, and last is gone entirely.
  • The new test fails on the old line.
  • Nothing outside the hold changed.

The findings left are docstring prose about the remedy's ranking, not a control. They merge and are filed (owner ruling 2026-11-19). I will enqueue on this head once every required context is green.

Open findings, queued for filing after the merge under R2. They join the six in my fourth hold and the eleven in the handback.

  1. messagefoundry/store/schema_verify.py:485: "and any other name last" describes a rank that no longer exists.
  2. schema_verify.py:495: "would rank the culprit last" is wrong now. The culprit is dropped and gets the plain remedy.
  3. schema_verify.py:87: the comment still says "_foreign_objects' ranks".
  4. A same-name TEMP-view collision, which predates this PR.
  5. The test name still says "last rank", there is a redundant named alias, and the docstring line at :496 is ragged.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: enqueuing on pinned head 662be70. All 9 required contexts are completed and green on it. The open findings are named in comments 7079079818 and 7078842263.

@wshallwshall
wshallwshall added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 72ac872 Nov 22, 2026
68 checks passed
@wshallwshall
wshallwshall deleted the batch/w3-b branch November 22, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qa Builder QA record posted; not a merge gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant