Skip to content

Realize 11.7: the model catalog declares routing rules (additive contract-v1.38) - #244

Merged
brettheap merged 27 commits into
mainfrom
change/doxbench-model-catalog-release
Aug 22, 2026
Merged

brettheap merged 27 commits into
mainfrom
change/doxbench-model-catalog-release

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Realizes task 11.7 of add-doxbench-editing-phase-b — the ratified scenario
"The menu offers a routing rule". A conformant catalog can now declare an
auto entry as a ROUTING RULE, and the runtime that already honoured one was
not rebuilt: _apply_model and doxbench_selected_model are byte-identical
to what §11 and §13 shipped, and each of their pre-existing duck-typed tests is
kept verbatim and still green.

One contract changes: contracts/schemas/xfactory-workbench-model-catalog.schema.yaml
gains three OPTIONAL properties on $defs/model_entry that travel together —
routing_rule, routes_to (unique, non-empty model_id references into the
same catalog), resolved_model_id — plus one dependentRequired block and two
allOf conditionals that both require routing_rule to be PRESENT, so an
entry declaring no routing rule is judged exactly as it was before.
contract_schema_version stays 1.


1. The version story — and there is NO tag in this PR

This slice was briefed as contract-v1.37. While it was in flight, PR #235
(6cbb4495) allocated v1.37
— a CHANGELOG heading plus
contract_bundle_version: contract-v1.37 — although its own squash message
still says "at contract-v1.36". Under docs/contract-versioning-policy.md the
version is allocated AT REALIZATION and CHANGELOG presence is the availability
test, not tag presence
, so this release is contract-v1.38.

No annotated tag is cut here. The policy publishes the tag against the
commit that actually lands, so both ref pins carry the
unpublished:contract-v1.38 sentinel — doxbench_contracts.CONTRACT_REF and
its test-side mirror RELEASED_REF — spelled as a value no stack.yaml can
declare, so a consumer comparing against it refuses rather than matching by
accident. A follow-up commit resolves both after the squash lands, exactly as
7c544c84 did for contract-v1.34 while ticking 13.3.

2. ⚠️ verify-commit fails on origin/main today — and it is NOT this branch

Before you run the release gate: python3 scripts/validate-contract-release.py verify-commit --commit origin/main exits 1 with

HGR-RELEASE-DIGEST-MISMATCH error path=contracts/CHANGELOG.md: digest does not match the raw Git blob at the pinned commit

Bisected: green at c1ffa0fd (#238), red from e11a057b (#242) onward.
PR #242 edited contracts/CHANGELOG.md — a v1.37 inventory member — without
rebuilding v1.37's digest inventory.

It is not this branch's, and this branch is unaffected in either direction:
resolve_committed_inventory reads contract_bundle_version AT THE COMMIT, so
this cut resolves v1.38 and checks against the v1.38 inventory that ships inside
it. verify-commit --commit HEAD on this branch passes. The v1.37 lane needs
an owner for the repair; this PR records the state rather than fixing another
release's surface.

3. Brett's rule 5′ ruling (2026-08-21)

Seven rules the shape cannot express are delegated to
scripts/validate-ideation-dashboard-contracts.py and enforced at catalog
construction in doxbench_model.py. Rule 5 was first shipped as a minimum over
every member of routes_to
; the adversarial review upheld it only WITH
RESERVATION, and Brett ruled in-session — "Swap to rule 5′" — that an available
rule's declared limits are bounded by resolved_model_id's entry alone.

Three reasons, recorded in the type, the validator, the schema, the CHANGELOG
and the tick: under this release's STATIC resolution the promise that matters is
that the menu's declared limits are honoured by the model that actually answers;
the un-resolved destinations are not load-bearing; and min-capping would bake in
semantics contradicting the sanctioned future direction — a per-turn, fit-aware
router, staged in this PR as ideation/staging/doxchat-auto-fit-routing/
(Brett's requirements as a verbatim origin quote, 6 claims, 6 open questions,
sequenced after the sprint archives).

A packaged POSITIVE carries the difference:
workbench-model-catalog-routing-rule-wider-than-a-non-resolved-member declares
800,000 bytes while a routable-but-not-resolved member accepts 2,048, and is
valid where the first form refused it.

4. Two judgement calls worth attacking

(a) The badge covering is SEGMENT MEMBERSHIP over a declared " / " separator
— containment was overturned, not chosen.
The first form was raw substring
in, and the adversarial review broke it twice on the released bytes: a rule
badged "Routes to a non-tenant endpoint." was accepted as carrying a target
badged "on-tenant" ("on-tenant" in "non-tenant" is True — the menu would show
the INVERSE of the posture it routes to), and a rule ending "...retain nothing."
was accepted as carrying "retain". Comparison now collapses whitespace, folds
case and ignores trailing .;,, and never rewrites interior characters —
that is where on-tenant and non-tenant differ. A routed badge that itself
contains (or collapses onto) the separator is refused as ill-formed.

(b) The 500-byte data_handling ceiling is UNCHANGED, and it is the
operator-facing bound on badge count.
A rule must carry every routed model's
badge as a segment, so that ceiling limits how many destinations one rule can
declare. Widening it was rejected as a consumer-visible change to an existing
field, which the additive class does not permit. A rule whose list does not fit
must be split, or its members' badges written more tightly.

5. A v1-lane limitation, recorded rather than fixed

The deprecated workbench-chat-turn-success envelope has ONE model_id slot and
no selected_model, so on a routed turn it records the requested id — what
every v1 consumer already reads and revalidates. Widening a deprecated closed
shape whose whole promise is byte-identical stability is what contract-v1.34's
deprecation forbids; the migration path is the v2 envelope, which exists. The
thread sidecar on that lane does name the answering model
, because it is
written above the branch and is not part of the v1 wire.

6. Reconciliations owed elsewhere, deliberately not edited here

  • add-doxchat-model-intake task 3.5 ("the closed seven-field public catalog
    entry does NOT widen") — another lane's ratified packet. Its descriptions were
    true when ratified and its no-widening promise is about its own delta; what
    moved is the referent. Read it against the v1.38 shape when that lane builds.
  • codexFactory specs/010-doxbench-editor-chat/contracts/model-catalog.md —
    its Reconciliation section claims an exact match with the seven-field shape.
    Correct while pinned: codexFactory declares contract-v1.27, so nothing
    there is wrong today; it becomes wrong the moment it re-pins. Updating it is
    that repository's own governed act under the domain upgrade runbook.

Review history

Two adversarial rounds plus a re-verify. Round 1 returned LAND AFTER FIXES
with three blocking findings, all closed: F1 the badge-covering substring
predicate (two false-accepts reproduced on the released bytes, now segment
membership); F2 resolved_model_id ∈ routes_to unenforced on the wire, which
made the file gate strictly weaker than the type gate while its docstring
claimed parity — both checks added and the parity now asserted by a test over
the packaged corpus; F3 the sidecar transcript naming the rule instead of the
answering model, against the ratified THEN's own purpose clause. F4–F6 and
F8 closed alongside (stale docstring, ledger correction, route-level scenario
test, cross-repo notice); F7 went to Brett and returned as rule 5′ above.

The re-verify returned READY TO PUSH with N1 folded in first: three places
claimed verify-commit passes on main again, which PR #242 had made false —
reproduced and bisected before the prose was touched. N2 (casefold is an
interior rewrite for multi-char folds; the claim restated as the one that is
load-bearing), N3 (the separator diagnostic tested the RAW badge, so a badge
collapsing onto " / " slipped it and then passed the covering check — a full
accept, not a message defect; proven by revert-test) and N4 (the rule-5′
positive was never bound to the type gate) landed with it.

Every new pin is revert-tested: disable the guarded change, confirm the test
fails, restore, purge __pycache__. Two arms — the separator collision and the
explicit self-reference — were proven by revert-test to be diagnostics rather
than independent refusals
, and are guarded on their finding code and message
rather than on the fact of refusal, with comments saying so.

Gates

Gate Result
pytest tests/ideation-dashboard 3819 passed, 15 skipped
pytest tests/ideation_dashboard 63 passed
pytest tests/doc-health 691 passed
openspec validate --all --strict 63 passed, 0 failed (14 changes + 49 specs)
validate-ideation-dashboard-contracts.py 0 errors / 4 warnings (the four by-design v1 deprecations); 39 valid, 61 negative, 8 transition pairs
validate-contract-release.py verify-commit --commit HEAD pass — 190-entry inventory, rebuilt after every contract edit
doc-health pre/post identical to origin/main (3 critical, 7 error, 75 warning, 3 info), zero new regressions; the new staged topic produces no finding
tests/hermes_runtime_contracts skipped — pre-existing environmental failure on this host (Docker: all predefined address pools have been fully subnetted), unrelated

🤖 Generated with Claude Code

brettheap and others added 22 commits August 21, 2026 18:24
Additive on `$defs/model_entry`: three OPTIONAL fields that travel together --
`routing_rule`, `routes_to` (opaque catalog handles, uniqueItems), and
`resolved_model_id` -- plus `dependentRequired` and two conditionals that BOTH
require `routing_rule` to be present, so an entry declaring no routing rule is
judged exactly as it was before. Verified against an eleven-case matrix.

`ModelCatalogEntry` gains the same three as defaulted fields (plain-model
defaults, so every pre-existing construction means what it always meant), with
the per-entry rules in `__post_init__` and the four CROSS-ENTRY rules in
`ModelCatalog._validate_routing_targets`: no dangling target, no chained rule,
an available rule resolves to an available model, and the BADGE COVERING the
ratified scenario's THEN demands.

`as_public_dict` discloses the three only for an entry that IS a routing rule,
so a plain entry's public dict is byte-identical across the release boundary.

Co-Authored-By: Claude Fable 5 <[email protected]>
…-tests

`check_routing_rules` enforces the five rules the shape cannot express — no
dangling target, no chained rule, an available rule resolves to an available
model, THE BADGE COVERING, and a rule declaring no more headroom than its
narrowest destination. The same five are enforced at catalog construction in
doxbench_model; neither place substitutes for the other, because an in-process
catalog never becomes a file and a file is never constructed through that type.

One packaged POSITIVE (`workbench-model-catalog-routing-rule`) and SIX negatives,
one per rule plus the structural plain-entry-carrying-a-routing-field case.
Verified individually: every negative fails for exactly its stated reason.
Validator output stays 0 errors / 4 warnings (the four v1 deprecations, by
design); the example self-test goes 37 -> 38 valid and 50 -> 56 negative.

Co-Authored-By: Claude Fable 5 <[email protected]>
MAIN MOVED UNDER THIS SLICE. The branch base is 6cbb449 (PR #235,
identity-brokering + trust-anchor), which ALLOCATED contract-v1.37 -- a
CHANGELOG heading plus `contract_bundle_version: contract-v1.37` -- while its
own squash message still says "at contract-v1.36". CHANGELOG presence is the
availability test under docs/contract-versioning-policy.md, so v1.37 is taken
and this release is contract-v1.38. Every one of this slice's own v1.37
references is renumbered; #235's twenty-odd manifest/README mentions are ITS
release's and are untouched.

PRE-EXISTING DEFECT FOUND AND NOT FIXED HERE: at origin/main,
`validate-contract-release.py verify-commit --commit origin/main` exits 1 with
HGR-RELEASE-INVENTORY-MISSING -- #235 bumped the bundle to v1.37 without
shipping contracts/releases/contract-v1.37.digests.yaml. It is another lane's
release surface; recorded, not touched.

Repin (the v1.34 pattern, mirrored): doxbench_contracts CONTRACT_TAG ->
contract-v1.38 with the `unpublished:` sentinel for the ref, the CATALOG digest
moved (the chat-turn's unmoved), manifest row digest + consumption_rule, and the
test-side RELEASED_* mirror plus the packaged-positive count 9 -> 10.

Co-Authored-By: Claude Fable 5 <[email protected]>
FLIPPED (test_doxbench_bridge): the pin that asserted `ModelCatalogEntry` has
NEITHER routing attribute becomes its inverse -- the type CARRIES both, and an
entry declaring neither still reports `routing_rule: False`,
`resolved_model_id: None` and a public dict with the three keys ABSENT. The
antecedent is asserted first (`hasattr` + `__slots__`), so it cannot pass against
a type that lost the fields again.

KEPT GREEN, UNTOUCHED, and that is the evidence: the duck-typed bridge test and
`test_a_routing_rule_entry_would_be_reported_as_one_without_touching_the_route`.
Each gains a REAL-TYPE sibling proving the release changes neither `_apply_model`
nor `doxbench_selected_model`.

New coverage: the five cross-entry catalog refusals (each also through the direct
constructor), the per-entry refusals, the TypeError/ValueError split, the
degraded-bridge projection still constructing, and eight schema-level refusals
against the REAL released bytes -- including `provider_id` on an entry, which
keeps task 11.6's placement ruling enforced by the shape.

Co-Authored-By: Claude Fable 5 <[email protected]>
THE MENU SCENARIO IS CLAIMED WITHOUT A VIEW CHANGE, and proved rather than
argued: a node probe mounts the SHIPPED chat rail over the packaged
contract-v1.38 routing catalog and reads the option text back. The `auto`
option's visible text contains BOTH routed models' handling badges, because the
covering rule requires the rule's own `data_handling` to carry them and this view
already renders `label — data_handling`. `sendDisclosure` needs no change for the
same reason. `adoptCatalog` spreads the whole entry (`{...entry}`), so the three
new fields reach browser state rather than being silently projected away.

Corrected our own "CLOSED seven-field" claims, which the release makes false:
`_apply_model`'s two docstrings (its 11.6 provider-id RULING is preserved and
now says WHY the growth does not reopen it — the schema still refuses
`provider_id` structurally), contracts/README's row, the local example's header,
and two test comments.

Co-Authored-By: Claude Fable 5 <[email protected]>
…wth)

Completes the release surface for tasks.md §11.7 of add-doxbench-editing-phase-b:
the CHANGELOG entry and the release DIGEST INVENTORY. The schema growth, the
manifest row (recomputed digest + rewritten consumption_rule), the bundle bump
and the consuming runtime repin are the preceding commits on this branch; the
branch squashes to one unit, exactly as §13's release did.

ALLOCATED v1.38, NOT v1.37. Main moved under this slice: 6cbb449 (PR #235)
allocated contract-v1.37 while this was in flight, its own squash message still
saying v1.36. CHANGELOG presence is the availability test, so v1.38 is the next
available number and the entry says so.

INVENTORY BUILT AFTER THE BUNDLE BUMP (v1.36's first tag failed on exactly this):
190 entries, and exactly four digests move -- CHANGELOG, README, manifest, and
the catalog schema, which are precisely this cut's inventory-member files.

RECORDED, NOT FIXED: at 6cbb449 `verify-commit` already exits 1 with
HGR-RELEASE-INVENTORY-MISSING, because that cut bumped the bundle to v1.37
without shipping releases/contract-v1.37.digests.yaml. `resolve_committed_inventory`
reads the bundle version AT THE COMMIT, so this cut verifies against its own
v1.38 inventory and is unaffected; v1.37's provenance gap is that lane's.

Co-Authored-By: Claude Fable 5 <[email protected]>
… flagged

The box is CHECKED because the ratified `The menu offers a routing rule` scenario
is now claimable: a conformant catalog can declare an `auto` entry, and the
runtime that already honoured one was not rebuilt.

The tick records the release, the five delegated rules and their revert-tests,
the credential/provisioning sentence P3-23 asked for, and SIX flagged judgement
calls for the reviewer: text-containment badge covering (with the unchanged
500-byte ceiling as its stated consequence), routes_to holding REFERENCES rather
than badge objects, disclosure only when declared, the three rules inferred from
how the turn gate actually works, no view change (proved by a node probe against
the shipped rail), and the v1.37 -> v1.38 re-allocation.

Ledger row struck; the blocking set is now 10.7, 12.7 and 13.8. The proposal's
`contract_release:` frontmatter goes TWO releases -> THREE and now owes one, not
two. 10.7 and 13.8's own task prose is deliberately NOT edited (13.8 still says
11.7 owes a release -- its owner's to re-adjudicate).

Co-Authored-By: Claude Fable 5 <[email protected]>
…lit) into the 11.7 release branch

Main moved twice during this slice. This merge takes the SECOND move, which
touches no contract file: no bundle version, no CHANGELOG heading, no schema. So
contract-v1.38 is still the next available number and this branch's allocation
stands. What it brings is the add-staged-topic-outline-template ARCHIVE (with its
promoted document-lifecycle and ideation-dashboard spec deltas), the README/INDEX
bookkeeping, and PR #239's realization-chain split -- none of which overlaps this
release's files.

Co-Authored-By: Claude Fable 5 <[email protected]>
…te stops

being weaker than the type gate

F1 (BLOCKING). Raw substring containment was wrong in the direction that
matters, and the reviewer broke it twice on the released bytes: a rule badged
"Routes to a non-tenant endpoint." was accepted as carrying a target badged
"on-tenant" (`"on-tenant" in "non-tenant"` is True — the menu then showed the
INVERSE of the posture it routes to), and a rule ending "...retain nothing." was
accepted as carrying a target badged "retain". Both reproduced on BOTH gates
before the fix.

The covering is now segment membership over a DECLARED separator (" / ", chosen
because `;` `.` `,` all occur in real badges and `/` does not). Each routed
entry's own badge must be one segment of the rule's badge, compared with
whitespace collapsed, case folded and trailing `.;,` dropped — the
over-strictness the reviewer also flagged — and with INTERIOR characters never
rewritten, because that is exactly where on-tenant/non-tenant lives. The
grammar's own residual collision is refused rather than hoped away: a routed
badge that itself contains " / " could never be one segment, so the catalog is
refused as ill-formed. Extra segments are permitted, so a rule may keep its own
lead-in. Declared in the schema (data_handling's comment plus both routing
fields' descriptions), implemented once in `doxbench_model`
(`ROUTING_BADGE_SEPARATOR`, `normalized_badge_segment`, `badge_segments`) and
restated in the standalone validator, which imports nothing from that package —
a companion test pins the two equal (next commit).

F2 (BLOCKING). `check_routing_rules` never checked `resolved_model_id ∈
routes_to` nor self-reference, so the reviewer's B instance passed the file gate
0-errors: badged safe, resolving to a model badged "retained and used for vendor
model training", which every covering check skipped because they all run over
`routes_to`. The type gate always refused it, so the file gate was strictly
WEAKER — while its own docstring claimed those rules were the type's business and
that "a structurally invalid instance never reaches this function". Both checks
added; self-reference is now its OWN named refusal instead of falling out of the
chained-rule rule with a misleading message. Docstring corrected, and it now says
the parity is asserted by a test rather than merely stated.

PACKAGED: all four reviewer instances (A, B, C, D) plus the separator-collision
case, as negatives that fail for exactly their own reason. Existing routing
instances converted to the segment grammar so each still fails for its intended
single reason. Both gates verified to AGREE on all thirteen catalog instances.
Example self-test 56 -> 61 negatives; validator still 0 errors / 4 warnings.

Co-Authored-By: Claude Fable 5 <[email protected]>
…io is tested

F3 (BLOCKING). `_mirror_turn_into_sidecar` was handed the REQUESTED model id
while the v2 wire record carried the RESOLVED one, because
`doxbench_selected_model(model_entry)` was computed INSIDE the v2 arm, after the
sidecar block. On a routed turn the durable transcript on disk therefore named
`auto` and no reader could learn which model wrote the answer -- against the
ratified THEN's own purpose clause, "so a transcript names the model that
actually answered". The derivation is hoisted above the sidecar and the sidecar
takes `selected_model["resolved_model_id"]`. One call site, one derivation, both
readers.

RECORDED v1 LIMITATION (F3's other half): the deprecated v1 success envelope has
ONE `model_id` and no `selected_model`, so it cannot state both facts on a
routed turn. It carries the REQUESTED id -- what every v1 consumer already reads
and revalidates -- and the fix is the v2 envelope, which exists. Widening a
deprecated closed shape whose whole promise is byte-identical stability is what
contract-v1.34's deprecation forbids. Noted at the v1 arm itself; the CHANGELOG
half follows. The sidecar on the v1 lane DOES name the answering model, because
it is written above the branch.

F4. `doxbench_selected_model`'s docstring still said no catalog entry can declare
a routing rule and that a release was owed. Rewritten; it now also names its
three consumers, which is what made F3 visible. Swept serve.py for siblings --
none.

F6. Two route-level tests, written in test_doxbench_thread_wiring rather than
test_doxbench_routes because only that harness sees BOTH halves in ONE real
request: the wire record (`model_id` == the resolved model, `selected_model`
naming the rule) and the sidecar's turn header. Its negative sibling asserts the
unrouted case is unchanged, so hoisting cannot have moved the ordinary path.

Plus: the two gates' badge grammar pinned equal (separator, punctuation set,
normalizer, segmenter), a pin that the normalizer forgives only what cannot flip
a posture (on-tenant vs non-tenant), the separator-collision refusal, F2's
resolved-badge-is-covered assertion, and a PARITY test running both gates over
all ten packaged routing negatives -- the claim review round 1 found stated in a
docstring and untrue. Catalog schema digest repinned (three places) after F1's
declarations moved its bytes.

Co-Authored-By: Claude Fable 5 <[email protected]>
The revert-test of the type's segment predicate (R1) failed only the
packaged-corpus PARITY test, which means the type's own suite had no direct
guard: a rule that lives in one gate's tests is a rule the other gate can lose.
Three rows now pin it where the predicate lives -- review instances A and D plus
a badge swallowed into a longer sentence -- and a positive sibling pins that the
predicate did not become a blanket refusal, across all three forgiven
normalizations.

Co-Authored-By: Claude Fable 5 <[email protected]>
…SAGE

REVERT-TESTING FOUND TWO ARMS THAT ARE NOT INDEPENDENT REFUSALS, and rather than
let a test imply otherwise, both now say so. Disabling the file gate's
separator-collision refusal left the validator at 0 errors, and disabling its
self-reference refusal did the same: a badge holding the separator can never BE
a segment, so the covering check refuses that catalog anyway, and a rule that
names itself names a routing rule, so the chained-rule arm refuses that one
anyway. Each arm's value is purely that it names the REAL cause instead of
sending the operator to add a badge that still will not match, or telling them
their rule 'routes to something that is itself a routing rule'.

So: comments in both gates state the arms are diagnostics; a new test pins every
routing negative's own finding CODE (ten rows, keys asserted against the corpus
so a new negative cannot skip the table); and a second test pins the two
diagnostic MESSAGES, which is the only guard that can fail if those arms are
deleted.

F2(b) asked for the self-reference check as 'an explicit check, not incidental
via the chained-rule rule' -- that is exactly a diagnostic ask, and this records
it as one rather than overclaiming a new refusal.

Co-Authored-By: Claude Fable 5 <[email protected]>
F5. The ledger note claimed a three-item blocking set including 12.7's tag +
pin. 12.7 is TICKED and its own body ends "Nothing on this task remains" -- its
tag is published and the aggregation pin landed at 04366e3. FOUR open rows became
TWO, not three, and the residual set is 10.7 + 13.8. ADJACENT-BUT-OWED, FLAGGED:
striking 12.7's un-struck ledger ROW is a bookkeeping correction on our own
change's kept-current table, made on the authority of that task's own already
-ticked discharge rather than on any new judgement of mine.

F8. The schema names codexFactory's `contracts/model-catalog.md` as its consumer
contract, and that document claims an exact match with the seven-field shape.
Recorded in the CHANGELOG as an owed cross-repo follow-up, with the fact that
keeps it honest: the claim is still CORRECT while codexFactory pins
contract-v1.27, and becomes wrong only when it re-pins. No codexFactory file
touched.

PROSE THE FIXES CHANGED. The tick's badge-covering judgement call is REWRITTEN
rather than patched: it states that containment was overturned, quotes both
false-accepts, and says what did and did not survive the correction (the
per-target-badge-objects alternative is still rejected, for the drift reason; the
claim that containment "buys nothing the covering rule does not guarantee" is
withdrawn, because it guaranteed the wrong thing). The tick and the CHANGELOG go
FIVE rules -> SEVEN, drop the false "enforced identically" for a claim a test
actually makes, record F3's sidecar defect and its fix, and record the v1
envelope's structural inability to carry both ids as a LIMITATION rather than
fixing a deprecated closed shape. The CHANGELOG also declares the separator for
consumers and says a renderer may split on it or show the string whole.

Manifest digest repinned and the release inventory REBUILT after every contract
edit: 190 entries, bundle contract-v1.38.

Co-Authored-By: Claude Fable 5 <[email protected]>
…238) into the 11.7 fix branch

Third move of main during this slice, and one of the three commits is directly
relevant: #238 SHIPPED contracts/releases/contract-v1.37.digests.yaml, repairing
the HGR-RELEASE-INVENTORY-MISSING defect this slice found and recorded against
that lane. The record of it is corrected to say so rather than left claiming a
live defect.

The other two realize the promoted working-subject default in the chat views.
One file overlaps with this branch -- tests/ideation-dashboard/test_doxbench_chat_view.py
-- where their change touches the working-subject probes and mine appended the
routing-rule menu probe at the end of the file.

Co-Authored-By: Claude Fable 5 <[email protected]>

# Conflicts:
#	tests/ideation-dashboard/test_doxbench_chat_view.py
The defect this slice found and recorded against another lane -- #235 bumping the
bundle to contract-v1.37 without shipping its digest inventory, so
verify-commit exited 1 on main -- has been repaired by c1ffa0f (PR #238). All
three places this branch recorded it as live now say it was found, recorded, and
fixed by its own lane, which is exactly the outcome recording it asked for. The
record is kept rather than deleted because the habit it earns outlives the
defect: recheck bundle availability against the CHANGELOG at the moment you
allocate, and do not assume the preceding release surface verifies.

Inventory rebuilt after the CHANGELOG edit (190 entries; the arrival of
contract-v1.37.digests.yaml changes no membership -- prior releases' inventories
are not members of a later one). verify-commit passes on HEAD.

Co-Authored-By: Claude Fable 5 <[email protected]>
BRETT RULED 2026-08-21, in-session: "Swap to rule 5'". The adversarial review
upheld rule 5 only WITH RESERVATION -- it permanently capped an `auto` entry's
declared limits at its narrowest destination to compensate for the runtime
computing budgets from the selected (rule) entry. The rule now bounds an
AVAILABLE rule's declared input/output limits against `resolved_model_id`'s
entry ALONE, not the minimum over `routes_to`. Rule 3 is untouched; the rule
count stays seven.

Three reasons, recorded in the type, the validator, the schema, the CHANGELOG
and the tick rather than left in a commit message: under this release's STATIC
resolution the promise that matters is that the menu's declared limits are
honoured by the model that actually answers; the un-resolved destinations are
not load-bearing, because no turn reaches them while the rule resolves
elsewhere; and min-capping would BAKE IN semantics contradicting the sanctioned
future direction -- a per-turn fit-aware router, staged in the next commit as
ideation/staging/doxchat-auto-fit-routing/ and cross-referenced from all five
places.

Unavailable rules are exempt, matching rule 3's existing exemption and keeping
the bridge's degraded projection constructible; the existing test for that still
passes untouched.

EXAMPLES. The rule-5 negative is reworked to the resolved-bound form and RENAMED
(`...wider-than-its-resolution`), and now carries a WIDER non-resolved member to
show the bound is the resolution rather than a minimum. A new PACKAGED POSITIVE
-- `workbench-model-catalog-routing-rule-wider-than-a-non-resolved-member` -- is
the point of the ruling: lawful under 5', REFUSED under the first form. Both
verified on both gates. A test named for the ruling pins it, with its own
other-side assertion so it is a bound and not an absence.

Count pins moved with the corpus (packaged positives 10 -> 11) and the schema
digest repinned in all three places.

Co-Authored-By: Claude Fable 5 <[email protected]>
BRETT RULED "Stage the topic" 2026-08-21, in the same exchange as the rule-5'
swap -- the two are one decision seen from two sides, so the topic is what rule
5' points AT when it says a min-cap would have baked in contradicting semantics.

The fragment carries Brett's requirements as a VERBATIM origin quote, set apart
under its own heading, with the six-claim decomposition beside it so a reader can
check the interpretation against the source rather than taking it on trust.
Claims: per-turn fit-aware resolution; filter out models too small for THIS
turn's packet; no fit is a HUMAN decision (warn and ask); the answer may be
session-sticky, which makes it a standing consent with a scope and a subject;
continuing means COMPRESSING to fit rather than truncating silently; and fit is
multi-dimensional, with multi-modal named and raw size only one axis.

Six open questions, each with the template's four sub-fields and a recommended
answer: where the decision lives (the ROUTE -- the port is ratified at exactly
three members); what happens to the released `resolved_model_id` (stays as the
declared default; removal breaks consumers for no gain); the capability
vocabulary (ONE closed `modalities` set, nothing else until a consumer names
itself, on the roster's admission_surface precedent); whether the consent is a
governed record (the TURN record must state the posture it ran under -- browser
state alone rejected, because §11.7's review found exactly this defect class in
the sidecar); one-change-or-three plus compression's home (three exits, with
compress-to-fit CONSUMING task 10.7's posture-and-reason field); and whether the
union badge survives (yes -- narrowing it would disclose after the fact).

Four conflicts recorded honestly, including two against this very release: the
static `resolved_model_id` becomes a default or a fiction, and rule 5' itself
loses its referent once resolution is per-turn.

Cross-linked both ways: the topic names contract-v1.38 as its floor, task 10.7,
add-doxchat-model-intake, add-model-provider-broker and the sibling
context-compression-runtime; the type, the validator, the schema, the CHANGELOG
and the 11.7 tick all name the topic as the reason rule 5' is not a min-cap.
Template-conformant (checked directly against doc_health's own `_template_gaps`
-- staged after ratification, so conformance is REQUIRED, not opt-in), with the
INDEX row and detail section in the same commit per the maintenance rule.

Co-Authored-By: Claude Fable 5 <[email protected]>
…to the 11.7 branch

Fourth move of main during this slice. One file overlaps -- contracts/CHANGELOG.md
-- and the overlap is textual only: their edit amends install-repo naming inside
the contract-v1.37 entry, mine is the contract-v1.38 entry above it. No contract
file, no bundle version, no schema; contract-v1.38 remains the next available
number.

Co-Authored-By: Claude Fable 5 <[email protected]>
contracts/CHANGELOG.md is an inventory member, and the merge brought main's
amendment to the contract-v1.37 entry's install-repo naming into it. Exactly one
digest moves. verify-commit passes on the merged tip.

Co-Authored-By: Claude Fable 5 <[email protected]>
DOC-HEALTH CAUGHT A REAL AMBIGUITY, and the document is fixed rather than the
rule waived. The location-conformance family reported ERROR
"staged material already cites proposal add-doxbench-editing-phase-b — move
selected material into the proposal supporting-docs folder", class contested,
and it was right to: `_staged_exit_changes` scans the `## Exit` section
precisely for a change a topic EXITS VIA, and my Exit section said "raise the
change AFTER add-doxbench-editing-phase-b closes its obligations" — sequencing
prose that reads exactly like an exit path, in the one section where that
reading is the rule's whole point.

A disposition would have recorded a waiver for a sentence that was genuinely
unclear. Instead the Exit section now states plainly that this topic exits via
its OWN change, which does not exist yet and is named nowhere there on purpose,
and carries the sequencing as an explicitly separate fact pointing at Related
work — where the change id is an evidence citation, which this rule deliberately
does not scan. Both facts survive; the ambiguity does not.

Doc-health: 3 critical / 7 error / 75 warning / 3 info at the branch tip,
IDENTICAL to origin/main, zero new regressions, and the new topic produces no
finding of any kind.

Co-Authored-By: Claude Fable 5 <[email protected]>
…d close a

real accept in the separator diagnostic

N1 (must-land). Three places said `verify-commit` passes on main again after PR
#238. It does not. Reproduced and BISECTED before touching prose: green at
c1ffa0f (#238), red from e11a057 (#242) onward with
HGR-RELEASE-DIGEST-MISMATCH on contracts/CHANGELOG.md -- #242 edited the
CHANGELOG, a v1.37 INVENTORY MEMBER, without rebuilding v1.37's inventory. All
three claims now past-tense the repair and name the new state, plus a fourth
mention in doxbench_contracts' pin comment that the brief did not list. Still
that lane's to fix; still exactly the habit those notes name -- so the ledger
note now earns the habit twice and says REBUILD THE INVENTORY WHENEVER YOU TOUCH
A MEMBER, the CHANGELOG being one. This branch verifies on its own throughout.

N2. `normalized_badge_segment`'s docstring claimed interior characters are never
rewritten. Casefold IS an interior rewrite for the multi-character folds (ß->ss,
the fi ligature). The claim is restated as the one that is actually true and
actually load-bearing: no fold casefold performs can separate or merge two
handling POSTURES, and that is the test a future normalization step must pass.

N3 -- AND IT WAS NOT COSMETIC. The separator-collision arm tested the RAW badge,
so `"read /\nwrite"`, which holds no literal " / ", slipped it AND THEN SATISFIED
THE COVERING CHECK, because the rule's own badge normalizes to exactly that
segment. That is a full ACCEPT of an ill-formed badge, in both gates -- proven by
revert-test (R13: file gate accepted it). Both arms now test the NORMALIZED
badge; three collapsing forms are pinned on the message, and R12 fails exactly
the newline row.

N4. `test_the_packaged_routing_positive_is_accepted_by_BOTH_gates` covered only
the first positive, so the rule-5' instance was never bound to the TYPE gate --
and rule 5' is enforced in both places. Parametrized over both, with a companion
test asserting the list equals what is on disk, so a later positive cannot skip it.

Inventory rebuilt after the CHANGELOG edits; verify-commit passes on HEAD.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 22, 2026 01:10
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR realizes doxBench editing Phase B task 11.7 by cutting contract-v1.38 to let the model catalog declare an auto entry as a ROUTING RULE (additive growth of $defs/model_entry). It updates the catalog schema, digest pins, delegated validator, and runtime catalog typing/validation so routing-rule metadata can be declared and correctly propagated into the v2 wire record and durable sidecar transcript.

Changes:

  • Additive contract growth: routing_rule, routes_to, resolved_model_id (plus conditionals / dependentRequired) in the model-catalog schema; bump bundle to contract-v1.38 and repin digests/refs.
  • Implement routing-rule typing and validation in ModelCatalogEntry / ModelCatalog, plus mirrored enforcement in the standalone validator.
  • Add end-to-end tests (wire + transcript), schema additive assertions against released bytes, gate-parity tests (file vs type), and new example corpus entries (positives + negatives).

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/ideation-dashboard/test_doxbench_thread_wiring.py New route-level E2E tests asserting routed turns record/transcribe the answering model (wire + sidecar).
tests/ideation-dashboard/test_doxbench_routes.py Adds real ModelCatalogEntry routing-rule projection test; clarifies unchanged-route evidence.
tests/ideation-dashboard/test_doxbench_model.py Adds extensive type-level routing-rule construction/validation tests and parity pins with delegated validator.
tests/ideation-dashboard/test_doxbench_contracts.py Repins to contract-v1.38, adds additive-schema tests against released bytes, and asserts file/type gate parity over packaged corpus.
tests/ideation-dashboard/test_doxbench_chat_view.py Adds Node-based probe proving menu rendering/disclosure remains unchanged while offering routing-rule entries.
tests/ideation-dashboard/test_doxbench_bridge.py Adds conformant routing-entry bridge test; updates pins around routing declaration defaults/projection.
scripts/validate-ideation-dashboard-contracts.py Extends delegated validator with routing badge segment grammar + check_routing_rules semantic enforcement.
scripts/ideation_dashboard/serve.py Updates selected-model derivation commentary; hoists derivation before sidecar mirroring and uses resolved id for transcript.
scripts/ideation_dashboard/doxbench_model.py Adds routing-rule fields to ModelCatalogEntry, routing validation (per-entry + cross-entry), and badge segment grammar helpers.
scripts/ideation_dashboard/doxbench_contracts.py Moves contract pin and schema digests to contract-v1.38 with sentinel ref strategy.
scripts/ideation_dashboard/doxbench_bridge.py Updates documentation to reflect contract-v1.38 routing-rule availability and preserved provider-id boundary.
openspec/changes/add-doxbench-editing-phase-b/tasks.md Marks task 11.7 complete and records the realized release/semantics and audit notes.
openspec/changes/add-doxbench-editing-phase-b/proposal.md Updates frontmatter to include the newly realized third contract release (v1.38).
ideation/staging/INDEX.md Registers new staged topic doxchat-auto-fit-routing sequenced after sprint archives.
ideation/staging/doxchat-auto-fit-routing/doxchat-auto-fit-routing.md Adds the staged topic document capturing Brett’s fit-aware routing direction and open questions.
examples/ideation-dashboard/workbench-model-catalog-routing-rule.example.yaml Adds packaged positive example for routing rule catalog.
examples/ideation-dashboard/workbench-model-catalog-routing-rule-wider-than-a-non-resolved-member.example.yaml Adds packaged positive example for rule 5′ (rule wider than a non-resolved member).
examples/ideation-dashboard/workbench-model-catalog-local.example.yaml Updates commentary to reflect additive routing-rule growth while preserving base shape.
examples/ideation-dashboard/README.md Documents new routing-rule positives and routing-related negatives in corpus index.
examples/ideation-dashboard/negative/workbench-model-catalog-routing-self-reference.negative.yaml Adds packaged negative for self-reference routing rule.
examples/ideation-dashboard/negative/workbench-model-catalog-routing-rule-wider-than-its-resolution.negative.yaml Adds packaged negative for rule declaring limits above its resolved model.
examples/ideation-dashboard/negative/workbench-model-catalog-routing-rule-unavailable-resolution.negative.yaml Adds packaged negative for available rule resolving to unavailable model.
examples/ideation-dashboard/negative/workbench-model-catalog-routing-rule-chained.negative.yaml Adds packaged negative for chained routing rule target.
examples/ideation-dashboard/negative/workbench-model-catalog-routing-resolved-outside-routes-to.negative.yaml Adds packaged negative for resolved id not in routes_to.
examples/ideation-dashboard/negative/workbench-model-catalog-routing-dangling-target.negative.yaml Adds packaged negative for dangling routes_to reference.
examples/ideation-dashboard/negative/workbench-model-catalog-routing-badge-inverted-substring.negative.yaml Adds packaged negative reproducing inverted-substring badge covering failure.
examples/ideation-dashboard/negative/workbench-model-catalog-routing-badge-incidental-word.negative.yaml Adds packaged negative reproducing incidental-word badge covering failure.
examples/ideation-dashboard/negative/workbench-model-catalog-routing-badge-holds-the-separator.negative.yaml Adds packaged negative for routed badge containing/collapsing onto separator.
examples/ideation-dashboard/negative/workbench-model-catalog-routing-badge-gap.negative.yaml Adds packaged negative for missing routed badge segment coverage.
examples/ideation-dashboard/negative/workbench-model-catalog-plain-entry-resolves-elsewhere.negative.yaml Adds structural negative for plain entry carrying routing-only fields.
contracts/schemas/xfactory-workbench-model-catalog.schema.yaml Adds optional routing-rule declaration fields + dependentRequired/conditionals and detailed delegated-rule commentary.
contracts/README.md Updates contract family description to reflect v1.38 routing-rule growth.
contracts/manifest.yaml Bumps bundle version to contract-v1.38 and updates schema sha256 for model-catalog.
contracts/CHANGELOG.md Adds v1.38 entry describing additive growth, rules, validation posture, and ref/digest strategy.
Suppressed comments (1)

scripts/ideation_dashboard/doxbench_model.py:458

  • _validate_routing_targets’ docstring says “the four the released schema cannot express…”, but the list immediately below includes 5 cross-entry rules (including rule 5′ limit bounding). Updating the count avoids confusion when maintaining parity with the delegated validator.
        """The CROSS-ENTRY half of the contract-v1.38 routing rules -- the four
        the released schema cannot express and the delegated validator
        (`scripts/validate-ideation-dashboard-contracts.py`) enforces on the
        wire. Both places enforce the same four; neither is the other's
        substitute, because a catalog assembled in-process never becomes a
        validated file and a catalog file is never constructed here.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1 to +5
# VALID (contract-v1.38): an `auto` ROUTING RULE beside the two approved models
# it may route to. Its own badge CARRIES BOTH of theirs verbatim (the ratified
# "carry the handling badge of every model it may route to"), it resolves to one
# of them, that one is available, and its declared limits are the NARROWEST of
# the two — a rule promises no more headroom than its narrowest destination.
Comment on lines +811 to +815
def normalized_badge_segment(text: Any) -> str:
"""One badge segment, in the form the covering rule compares: whitespace
collapsed, case folded, trailing `.;,` dropped. Interior characters are
NEVER rewritten — `on-tenant` and `non-tenant` must stay different, which is
the pair that broke the old substring predicate."""
Comment on lines +224 to +232
class InvalidRoutingRuleError(ModelCatalogError):
"""A routing declaration is not consistent with the catalog it sits in
(contract-v1.38). ONE class for every CROSS-ENTRY routing refusal --
a `routes_to` reference no entry answers to, a target that is itself a
routing rule, an available rule resolving to an unavailable model, and a
rule whose own ``data_handling`` does not carry a target's badge --
because they share one consequence: this catalog cannot honestly offer
this routing rule, so the whole catalog refuses rather than serving a
menu entry that misstates what it routes to.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80cdd55819

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

raise TypeError("routes_to must be an iterable of model ids, not a "
f"single {type(self.routes_to).__name__}")
try:
targets = tuple(self.routes_to)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enforce the 64-target limit in ModelCatalogEntry

When an adapter declares a routing rule with 65 unique, valid targets, this tuple conversion accepts it and ModelCatalog remains selectable even though the released schema caps routes_to at 64. Consequently, GET /workbench/model-catalog rejects the projected catalog during self-validation in serve.py:1845-1853, while a caller that knows the rule ID can still submit it to the turn route, which only checks isinstance(catalog, ModelCatalog) and selectable_entry_for at serve.py:2340-2352 before dispatching. Reject target lists longer than the contract limit during entry construction so the catalog and turn routes cannot disagree about whether the same runtime catalog is valid.

AGENTS.md reference: AGENTS.md:L9-L10

Useful? React with 👍 / 👎.

brettheap and others added 2 commits August 21, 2026 21:38
…model-intake)

Fifth move of main during this slice. One file, that change's proposal.md, and
no overlap with this branch. It does NOT touch that change's task 3.5, whose
"closed seven-field public catalog entry does NOT widen" wording is still the
stale-but-correct-while-unbuilt text this PR reconciles in prose rather than
editing -- so the reconciliation recorded in the CHANGELOG and the 11.7 tick
stands unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 22, 2026 01:54
…a WIP

0c4ac6a's message says "WIP checkpoint before the P2 revert-test", which is why
it was MADE -- the protocol requires a checkpoint before any revert-test -- and
badly undersells what it CONTAINS. The revert-tests (R14, R15) then confirmed it
rather than changing it, so no later commit restates the work. This branch is
change/*, which refuses force-push, so the record is corrected here rather than
rewritten.

0c4ac6a carries all four bot-round dispositions, each reproduced first:

* CODEX P2 (behaviour, confirmed): `ModelCatalogEntry` accepted a `routes_to`
  of 65+ (and 200) while the released schema caps it at maxItems 64 -- the type
  gate weaker than the wire gate, F2's divergence in the other direction. Capped
  per-entry with `MAX_ROUTING_TARGETS`, a literal pinned to the RELEASED BYTES by
  a test rather than restated blind. Boundary asserted both ways, 64 accepted /
  65 refused.
* COPILOT 1 (confirmed): the packaged positive's header still described the old
  min-cap; rewritten to rule 5' with a pointer to the instance that separates the
  two forms.
* COPILOT 2 (confirmed): the validator's `normalized_badge_segment` docstring
  still claimed interior characters are never rewritten -- N2 had landed
  type-side only. Both gates now carry the same corrected claim.
* COPILOT 3 (confirmed): `InvalidRoutingRuleError`'s cross-entry list omitted
  rule 5' and the separator-collision arm; both docstrings now enumerate all six
  and say which refusals are per-entry instead.

Co-Authored-By: Claude Fable 5 <[email protected]>
@brettheap

Copy link
Copy Markdown
Contributor Author

Bot round dispositions — all four confirmed and fixed

Fixes are in 0c4ac6a0 (its message says "WIP checkpoint" because that is why it was made — the protocol requires a checkpoint before a revert-test, and the revert-tests then confirmed it rather than changing it; the record is corrected additively in a11da3dd, since change/* refuses force-push). Branch tip a11da3dd.

Each finding was reproduced before being fixed.

Codex P2 — routes_to 64-target cap unenforced by the type — CONFIRMED, FIXED

Reproduced: routes_to of 64, 65 and 200 were all accepted by ModelCatalogEntry while the released schema caps maxItems: 64. Confirmed the wire refuses 65, so the type gate was strictly weaker than the wire gate — F2's divergence in the other direction, with the concrete consequence Codex described: such a rule constructs, the turn route (which checks only isinstance(catalog, ModelCatalog)) could dispatch it, and GET /workbench/model-catalog refuses to serve the catalog holding it.

Capped in the per-entry validation. Boundary asserted from both sides: 64 accepted, 65 refused with the count and the cap in the message. Revert-tested (R14 removes the cap → 2 failures).

On the bound "by reference": doxbench_model imports only dataclasses and typing and cannot open the schema, so MAX_ROUTING_TARGETS = 64 is a literal — made authoritative the way this module's other restated bounds are, by a test that reads the released bytes and pins them equal (it also pins minItems and uniqueItems while it is there). R15 drifts the constant to 128 and that pin fails, so the two cannot diverge silently.

On the exception class — Codex suggested InvalidRoutingRuleError; declined, and flagged. That class's own docstring says every member of it needs a second entry to see; the cap is visible with no catalog at all. The documented split is by how much context a refusal needs, not by which field it names, so the cap raises InvalidCatalogEntryError like every other over-cap value. The rationale is recorded in the class docstring and in a test named for the question.

Sibling bounds checked, as asked. resolved_model_id and every routes_to member are validated exactly as model_id is — non-blank string, no length, no pattern — so this release followed the existing convention consistently rather than introducing an asymmetry. Two pre-existing gaps found and, per instruction, recorded not fixed: (1) the type enforces neither the 128-char maxLength nor the id pattern on any id-shaped field, model_id included, and that predates the routing fields; (2) the catalog-level models maxItems: 64 is unenforced by ModelCatalog — 100 entries construct fine. Both belong to the seven-field type, not to this release.

Copilot 1 — stale rule-5 header in workbench-model-catalog-routing-rule.example.yaml — CONFIRMED, FIXED

The header still said "its declared limits are the NARROWEST of the two — a rule promises no more headroom than its narrowest destination". Rewritten to rule 5′, noting that the two bounds coincide in this instance because the resolution happens to be the narrower member, and pointing at …routing-rule-wider-than-a-non-resolved-member, which is the instance that separates them.

Copilot 2 — validator docstring still claimed "interior characters are NEVER rewritten" — CONFIRMED, FIXED

The N2 correction had landed type-side only. Both gates now carry the same claim: casefold is an interior rewrite for the multi-character folds (ß→ss, the fi ligature), and the property actually relied on is that no fold casefold performs can separate or merge two handling postures. The parity test compares constants and normalizer behaviour, not docstrings, so it was unaffected and still passes.

Copilot 3 — InvalidRoutingRuleError docstring list incomplete — CONFIRMED, FIXED

The list omitted rule 5′ and the separator-collision arm. Both places now enumerate all six cross-entry refusals, and — per the note about the P2 fix — the docstring states explicitly which refusals are per-entry (InvalidCatalogEntryError: the three fields not travelling together, self-reference, resolved id outside routes_to, a repeated target, and now the cap) and why the cross-entry framing stays honest.

Gates (post-merge; main moved once, merged clean)

tests/ideation-dashboard 3822 passed, 15 skipped · tests/ideation_dashboard 63 passed · tests/doc-health 691 passed · dashboard validator 0 errors / 4 warnings (39 valid, 61 negative, 8 transition pairs) · verify-commit --commit HEAD pass.

Digest stability asserted, not assumed: no file under contracts/ changed this round; the catalog schema's sha256 is byte-identical to the pushed tip (dff513fa…0675), all three pins still agree, and a fresh build of the 190-entry inventory produced no diff. Sentinels unchanged (unpublished:contract-v1.38 in both pins); no tag exists locally or on the remote.

Main's new commit (3fd21686, Brett's five Open Question rulings on add-doxchat-model-intake) touches only that change's proposal.md — no overlap here, and it does not touch that change's task 3.5, so the reconciliation this PR records in prose still stands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 35 out of 35 changed files in this pull request and generated 3 comments.

Comment on lines +1514 to +1518
The RUNTIME was not rebuilt, which was the point: `_apply_model` and
`serve.py doxbench_selected_model` are byte-identical to what §11 and §13
shipped, and each of their pre-existing duck-typed tests is KEPT VERBATIM
and still green — that is the evidence the one-place derivation was written
correctly the first time — with a REAL-`ModelCatalogEntry` sibling added
Comment on lines +3482 to +3485
"""The same derivation on a REAL `ModelCatalogEntry` — the shape
contract-v1.38 made constructible (task 11.7). `doxbench_selected_model` is
byte-identical to what §13 shipped; what changed is that a lawful catalog
can now hand it a routing rule."""
Comment on lines +636 to +640
"""THE RELEASE HALF (contract-v1.38). The same proof as the duck-typed
sibling above, driven through a REAL `ModelCatalogEntry` in a REAL
`ModelCatalog` — which is exactly what task 11.7's release made
constructible — and `_apply_model` is byte-identical to what §11 shipped.

Final review, comment-only. The header said the rule's limits are bounded by
`routed-hosted-zr-1` "THE MODEL IT RESOLVES TO" and that "the resolution IS the
narrower of the two". Both wrong: the rule resolves to `routed-on-tenant-1`
(800000/900000, the WIDER member), and the declared 2048/8192 coincides with
`routed-hosted-zr-1` -- the member it does NOT resolve to.

The conclusion the sentence was supporting is TRUE and unchanged: this instance
is valid under BOTH the old min-over-routes_to form and rule 5', so it does not
discriminate them, and `...wider-than-a-non-resolved-member` is the one that
does. Only the supporting sentence is rewritten, now naming the right model and
the right direction (the rule sits FAR UNDER its 5' bound, and equals the
non-resolved member's limits, which is why the old form accepts it too).

Comment-only and digest-neutral, ASSERTED rather than assumed: the catalog
schema's sha256 is unchanged, `examples/` contributes zero paths to the release
inventory, and verify-commit still passes. Validator 0 errors / 4 warnings.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 22, 2026 02:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 35 out of 35 changed files in this pull request and generated no new comments.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

contracts/schemas/xfactory-workbench-model-catalog.schema.yaml:80

  • The schema comment says the covering comparison uses case folding with “interior characters never rewritten”, but the implementation uses Python casefold() (both in the delegated validator and doxbench_model.normalized_badge_segment), which can rewrite/expand characters (e.g., ß→ss). The comment should match the actual guarantee being relied on (that normalization must not merge distinct postures such as on-tenant vs non-tenant).
      # The covering rule is SEGMENT MEMBERSHIP, not substring containment: for
      # each id in `routes_to`, that entry's own `data_handling` must equal one
      # segment of this one, compared with whitespace collapsed, case folded and
      # trailing `.;,` dropped — and with interior characters never rewritten,
      # so `on-tenant` and `non-tenant` stay different. Extra segments are

Both are defects a squash+tag would have frozen, so they land before the merge.
Reproduced before fixing, as always.

N6 -- THE CAP TEST'S "ACCEPTED" CASE WAS WIRE-REFUSED TWICE. The test built 64
targets PLUS the rule = 65 models, over the schema's `models.maxItems: 64`, with
a per-target badge list 901 bytes long, over `data_handling`'s 500. So a test
whose stated purpose was two-sided boundary parity accepted a catalog the wire
refuses on two grounds. The accepted case is now the largest set a conformant
catalog can express -- 63 targets plus the rule, exactly 64 models, one shared
short badge -- and it is checked THROUGH the projection against the released
schema, which is the only way that assertion means what it says. The 64/65
boundary moves to where it is actually true: the ENTRY SUBSCHEMA, validated
directly (no `$ref`s inside `model_entry`, so no registry needed), parametrized
1/63/64 valid and 65/200 invalid. And the cap's own comment now says the
operative maximum is 63, because `models.maxItems` is 64 and the rule takes a
slot -- 64 is still the right number for the type to enforce, since it is
`routes_to`'s own bound and this type must not invent the catalog-level cap it
has never enforced.

N7 -- THE TWO NEW ID-BEARING FIELDS ESCAPED THE SCHEMA'S ITEM BOUNDS. The cap
landed but `routes_to.items.maxLength`/`pattern` and the identical pair on
`resolved_model_id` did not, so the same type-weaker-than-wire divergence
survived on the two fields THIS release introduced. Both now enforced per-entry
as `InvalidCatalogEntryError`, consistent with the documented split. The pattern
is evaluated WITHOUT importing `re`, so the module's promised two-import list
holds; the `isascii()` guards are load-bearing and revert-tested, because
`"trailing"` with an accent satisfies `str.isalnum()` while the released pattern
refuses it. `model_id`'s IDENTICAL gap is pre-existing and deliberately left --
pinned by a test that says so, and the released-bytes pin now asserts all three
fields carry the same bounds so the sameness is on the record.

Revert-tested: R16 (maxLength), R17 (pattern), R18 (the isascii guard), R19 (the
accepted case back to 64 targets), R20 (per-target badges again). Each fails the
row it guards.

DIGEST-NEUTRAL, ASSERTED: nothing under contracts/ changed, the catalog schema's
sha256 is unmoved, and verify-commit passes.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 22, 2026 02:17
@brettheap

Copy link
Copy Markdown
Contributor Author

Final review — three comment/test fixes folded in, and the residual follow-ups

Landing with 8fe1b2db. Three findings from the final pass were folded into the branch rather than deferred, because a squash+tag would have frozen each as a wrong record.

Fixed on this branch

Example header (5a90fdce) — the routing-rule positive's header named routed-hosted-zr-1 as "the model it resolves to" and called the resolution "the narrower of the two". Wrong twice: it resolves to routed-on-tenant-1 (800000/900000, the wider member), and the declared 2048/8192 coincides with the non-resolved member's limits. The conclusion it supported was correct and is unchanged — this instance is valid under both the old min-cap and rule 5′, so it does not discriminate them, and …wider-than-a-non-resolved-member is the one that does. Only the supporting sentence was rewritten.

N6 — the cap test's accepted case was wire-refused twice (8fe1b2db). It built 64 targets plus the rule = 65 models, over models.maxItems: 64, with a 901-byte rule badge, over data_handling's 500. A test whose stated purpose was two-sided boundary parity was accepting a catalog the wire refuses on two grounds. The accepted case is now the largest set a conformant catalog can express — 63 targets plus the rule, exactly 64 models, one shared short badge — and it is validated through the projection against the released schema. The 64/65 boundary moved to the entry subschema, where it is actually true, parametrized 1/63/64 valid and 65/200 invalid.

N7 — the two new id-bearing fields escaped the schema's item bounds (8fe1b2db). The cap landed but routes_to.items.maxLength/pattern and the identical pair on resolved_model_id did not, so the same type-weaker-than-wire divergence survived on the two fields this release introduced. Both are now enforced per-entry as InvalidCatalogEntryError. The pattern is evaluated without importing re, keeping the module's promised two-import list; the isascii() guards are load-bearing and revert-tested, since "tráiling" satisfies str.isalnum() while the released pattern refuses it.

Two numbers worth carrying forward

  • MAX_ROUTING_TARGETS = 64 mirrors routes_to.maxItems, but 63 is the operative maximum. models.maxItems is also 64 and a routing rule occupies one of those slots, so the largest routable set a wire-conformant catalog can express is rule + 63 targets. 64 remains the right number for the type to enforce — it is routes_to's own bound, and this type must not invent the catalog-level cap it has never enforced — but a reader reasoning about real catalogs should reason about 63. Recorded in the constant's comment.
  • The type now enforces the item bounds on routes_to items and resolved_model_id; model_id's identical gap stays recorded, not closed. model_id has accepted over-length and out-of-pattern values since the seven-field type shipped; tightening it here would be a behaviour change belonging to no release. A test pins that decision, and the released-bytes pin now asserts all three fields carry the same schema bounds, so the sameness is on the record rather than assumed.

Residual follow-ups — reviewer-adjudicated, riding the next slice

None is a shipped-behaviour defect: the route self-validates the projected envelope against the released schema before serving, so every case below is refused in production today.

  1. Catalog-level models.maxItems: 64 is unenforced by ModelCatalog — 100 entries construct fine. Same divergence class as the routes_to cap, one level up, and pre-existing to this release.
  2. model_id's maxLength/pattern are unenforced by the type — pre-existing to the seven-field shape, deliberately out of scope here, and now pinned by a test that names it as a decision.
  3. Both are cheap when someone is next in this file, and the released-bytes pin test already reads the sibling constraints they would need.

Gates at this tip

tests/ideation-dashboard/test_doxbench_model.py + test_doxbench_contracts.py 246 passed · dashboard validator 0 errors / 4 warnings (39 valid, 61 negative, 8 transition pairs) · verify-commit --commit HEAD pass.

Digest-neutral, asserted not assumed: git diff --name-only 5a90fdce..HEAD -- contracts/ is empty, the catalog schema's sha256 is unmoved (dff513fa…0675), and examples/ contributes zero paths to the release inventory. Sentinels still unpublished:contract-v1.38; no tag exists yet.

@brettheap
brettheap merged commit 0f50b35 into main Aug 22, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 35 out of 35 changed files in this pull request and generated 1 comment.

Comment on lines 599 to 601
requested = str(model_entry.model_id)
routing_rule = bool(getattr(model_entry, "routing_rule", False))
resolved = getattr(model_entry, "resolved_model_id", None)
brettheap pushed a commit that referenced this pull request Aug 22, 2026
The annotated tag exists: object 46cd169,
dereferencing to 0f50b35 -- the squash-merge of
PR #244 -- and verified FROM THE REMOTE rather than from the local ref that
created it (`git ls-remote origin 'refs/tags/contract-v1.38^{}'` peels to that
commit). Both release verifications pass at the tag:
`validate-contract-release.py verify-commit --commit contract-v1.38` reproduces
every digest in contracts/releases/contract-v1.38.digests.yaml from the tag's own
objects, and `verify-tag --remote origin --tag contract-v1.38` confirms the
published tag dereferences to that exact commit.

So `doxbench_contracts.CONTRACT_REF` and its test-side mirror `RELEASED_REF` stop
being the `unpublished:contract-v1.38` sentinel and name that commit, in the
spelling the v1.34 and v1.31 pins used -- the tag's DEREFERENCED commit, never
the tag object. The sentinel did its job: across the realization branch there was
no release commit to name, and a value no stack.yaml can declare made a consumer
refuse rather than match by accident.

Every gate reran at the SQUASH before anything was tagged, which is the point of
the policy's realization order -- the squash created a new commit, and main had
moved twice under the branch before the merge, so the tree that got tagged was
one nothing had gated until then.

Nothing under contracts/ changes here, so the digest chain and the tag are
untouched; verify-commit still passes at the tag after this commit.

Co-Authored-By: Claude Fable 5 <[email protected]>
brettheap added a commit that referenced this pull request Aug 22, 2026
…ve contract-v1.40) (#256)

* WIP 10.7: the assembled context's posture, on the schema and in the record

Additive on `$defs/success_v2`: ONE optional property, `context_packet`, a
closed object carrying the packet's own `posture` (`full | reduced`) and its
`reduced_reason`, with two conditionals refusing each half of the truth-pairing
`ContextPacket` enforces at construction -- reduced-without-reason and
reason-on-full. Nothing previously valid becomes invalid: the key is OPTIONAL and
its ABSENCE is not a posture claim.

ONE OBJECT rather than two sibling keys, on the `selected_model` precedent in
the same file: one fact about one thing, the present-iff rule stays local to the
object that owns it, and the ENVELOPE's key set is identical for a full turn and
a reduced one.

`serve.doxbench_context_packet` is the ONE derivation, beside
`doxbench_selected_model`, reading the packet the turn actually ran under --
never re-deriving from "was there a knowledge service?", which would be a second
authority (the packet also reduces when a live backend REFUSES a retrieval). It
is called INSIDE the route's packet boundary, so a lying injected assembler is a
`PacketError` mapped to the fixed `invalid_turn_request` rather than a guessed
posture. The builder takes two named scalars, not a dict, and the posture is
REQUIRED of it.

The v1 lane is untouched and its second limitation is recorded at the arm.

Co-Authored-By: Claude Fable 5 <[email protected]>

* WIP 10.7: the surface states the reduced posture

The browser half the release exists for. `settleTurnSuccess` adopts the record's
`context_packet` instead of projecting it away (the adopter is total by refusal
and FAILS CLOSED on a contradiction -- a `reduced` with no readable reason drops
to null rather than showing the silent degradation with a badge on it), and
`beginTurn` and `adoptThreadTranscript` clear it, so the note only ever
describes the answer currently on screen.

`reducedContextNote` is the one pure selector, and `div.doxchat-context` is one
aria-live note under the transcript. A FULL turn shows nothing new: a standing
"full context" badge is a line operators learn to stop reading, which is how the
reduced one would stop being noticed.

Deliberately a rail-level fact about the LAST ANSWER, not a per-turn badge: a
transcript restored from the server's thread sidecar carries no posture, so
per-turn badges would be present on a lived-through turn and absent on the
identical restored one.

Co-Authored-By: Claude Fable 5 <[email protected]>

* WIP 10.7: the delegated validator, the packaged corpus, and the repin

The validator learns `check_context_packet`: the PAIRING (restated on purpose --
the v1.38 F2 finding was a file gate that had grown weaker than the type gate
while claiming parity, and three gates now assert this one rule) plus the
credential/endpoint spelling scan over the reason, which is the release's one new
free-prose field and the only rule here the shape cannot express. A third rule
was considered and rejected in the docstring: prose-matching the reason.

Packaged: TWO positives (reduced-with-its-reason, explicitly-full) beside the
unchanged pre-release record whose continued validity IS the additive claim, and
FOUR negatives -- reduced-without-reason, reason-on-full, an unknown posture, and
a fourth fact on the closed object. Validator stays 0 errors / 4 warnings;
examples 39 -> 41 valid, 61 -> 65 negative.

Repin: CONTRACT_TAG -> contract-v1.39 with the `unpublished:` sentinel for the
ref, the CHAT-TURN digest moved (the catalog's unmoved -- the mirror image of the
v1.38 repin), the manifest row digest + rewritten consumption_rule, and the
test-side RELEASED_* mirror plus the packaged-positive count 11 -> 13.

The route fixture schema declares `context_packet` and does NOT require it,
mirroring the release: that fixture's job is discriminators and closedness, and
the released bytes hold the value rules.

Co-Authored-By: Claude Fable 5 <[email protected]>

* WIP 10.7: pin the release from four sides

CONTRACTS: the additive-class block against the REAL released bytes -- the
pre-release record still valid with no posture at all, four conformant postures,
eleven refusals (including the reason at its exact 500-byte ceiling and one byte
past it), the S1-vs-S3 read on this shape (each conditional guards a case the
other does not, and the unknown posture is refused by the enum NEITHER touches),
and the blast radius: the v1 success and the v2 failure both refuse the key, so
"one optional property on one shape" is checkable rather than described.

THREE GATES, ONE RULE, asserted: each packaged pairing negative is refused by the
shape, by the delegated validator with the `context-packet` finding code, AND by
`ContextPacket.__post_init__`. The other two negatives are the shape's alone and
the table says so -- the validator does not restate an enum or a closure.

ROUTE: the reduced and full scenarios end to end on the widened lane; the record
and the packet's own declaration pinned equal; a REFUSING backend recording its
own reason (the case a "re-derive from whether a knowledge service existed"
implementation would get exactly backwards); the v1 lane still succeeding and
still unable to say so; and every shipped reduction reason checked against the
released ceiling, because an over-long one would turn a degraded turn into a
`response_invalid` refusal on the one path nobody exercises by hand.

FAIL-CLOSED: four lying-assembler cases through the injected seam, each refused
with the fixed `invalid_turn_request` and nothing dispatched.

SURFACE: a node probe over the SHIPPED bytes -- reduced renders the note and the
reason, full renders nothing, an older record renders no phantom badge, both
self-contradicting records render silence rather than half a statement, and a
new flight clears the note.

Co-Authored-By: Claude Fable 5 <[email protected]>

* contract-v1.39: the doxBench chat-turn's assembled-context posture (additive)

Completes the release surface for tasks.md §10.7 of add-doxbench-editing-phase-b:
the CHANGELOG entry and the release DIGEST INVENTORY. The schema growth, the
manifest row (recomputed digest + rewritten consumption_rule), the bundle bump
and the consuming runtime repin are the preceding commits on this branch; the
branch squashes to one unit, exactly as §11.7's and §13's releases did.

ALLOCATED v1.39, CHECKED AT ALLOCATION. At the branch base 6614061 the
CHANGELOG's newest heading was contract-v1.38 and the bundle read
contract-v1.38, so v1.39 was the next available number. CHANGELOG presence is
the availability test -- the habit the v1.37/v1.38 episode earned.

THE PRECEDING RELEASE SURFACE IS GREEN, checked rather than assumed:
verify-commit --commit origin/main PASSES at 6614061 against
contracts/releases/contract-v1.38.digests.yaml. The v1.37 lane's
HGR-RELEASE-DIGEST-MISMATCH no longer applies now the bundle has moved.
Recorded in the entry, because the two preceding releases both found the
surface broken when they got there.

INVENTORY BUILT AFTER THE BUNDLE BUMP (v1.36's first tag failed on exactly
this): 190 entries, and exactly four digests move -- CHANGELOG, README,
manifest, and the chat-turn schema, which are precisely this cut's
inventory-member files.

A FIFTH PACKAGED NEGATIVE lands with the entry: a reduction reason leaking a
raw endpoint and a bearer credential. It is the ONE case the shape cannot
refuse, which is why it is the one this release delegates -- and the negative
table now records which gate owns each case rather than settling for
"something refused it".

* Tick 10.7 and 13.8: the last release is cut, and the build is closed

10.7 is CHECKED because the ratified `The knowledge service is unavailable`
scenario is claimable in full: the record carries `context_packet` and the rail
states the reduced posture to the HUMAN, which is the half the task stayed open
for. The tick records the release, the one derivation and its four
lying-assembler refusals, the two delegated rules and the third that was
rejected, the five packaged negatives and which gate owns each, the fail-closed
ceiling hazard, and SIX flagged judgement calls: one nested object with the
packet's own names, always stating the posture (the OPPOSITE of 11.7's
disclosure call, and why), omission is not a posture claim, no
`dependentRequired` and why that is not a weakening, the rail-level note rather
than per-turn badges, and the THREAD SIDECAR GAP -- flagged as a gap, refused on
the parser's fixed arity rather than on merit, and named as F3's honest
counterpart.

13.8 is CHECKED because the set it waits on is empty. Its stale sentence
claiming 11.7 owes a model-catalog release is CORRECTED with the citation
(contract-v1.38, PR #244 / 0f50b35, pin resolved at 58e4aec) -- 11.7's own
tick deliberately left that to this task's owner, and this is the owner
arriving. What the tick does NOT claim is spelled out: the squash sha, the
published tag and the sentinel resolution are the post-land step, with a blank
line for the follow-up to fill in.

Ledger: both remaining rows struck with attribution, TWO open rows became ZERO,
and the note says plainly that the archive gate's mechanical refusal no longer
standing is a statement about the gate rather than permission to walk through
it. Nothing archived.

proposal.md `contract_release:` goes THREE releases -> FOUR across three schemas
(the chat-turn schema carries two), and owes none.

Co-Authored-By: Claude Fable 5 <[email protected]>

* 10.7: guard the thread-switch clear, which revert-testing found unguarded

R24 came back GREEN: deleting adoptThreadTranscript's posture clear broke no
test. The probe now asserts it -- switching documents replaces the transcript
with the SERVER's thread record, which carries no posture, so a note left
standing captions one conversation with a fact about another (the same defect
class P2-9 found for the transcript itself).

Co-Authored-By: Claude Fable 5 <[email protected]>

* 10.7: record what revert-testing actually found, and rebuild the inventory

TWO honest corrections to the record, both from the 26-case revert pass:

* the delegated validator's RESTATED pairing arms are a DIAGNOSTIC, not an
  independent guard -- disabling both leaves the validator's own self-test
  green, because the shape refuses the same instances anyway. Same class as
  11.7's separator-collision and self-reference arms, handled the same way
  (pinned on the finding CODE, which is the only guard that fails). Said in
  both the CHANGELOG and the tick rather than left implying a second refusal.
* the tick now carries the revert-test summary, including the ONE case that
  came back GREEN and the test added for it.

The CHANGELOG is a v1.39 INVENTORY MEMBER, so the inventory is REBUILT with it
-- the habit the v1.37 lane's PR #242 miss earned. Still 190 entries, still the
same four moved digests.

* 10.7: state the revert-test count exactly (29 runs, 27 mutations, two GREEN)

Co-Authored-By: Claude Fable 5 <[email protected]>

* 10.7: tighten six claims the record was overstating, and repin

An adversarial reader would have caught every one of these, so they are fixed
before one has to:

* the key-set-equality argument cited "an existing route-level test still passes
  UNCHANGED". The pre-existing test is on the DEPRECATED v1 lane, where the key
  does not exist at all and which therefore says nothing about the nesting. The
  claim now names the NEW widened-lane test that actually carries it -- and says
  why two sibling keys would have made that test unwritable.
* "the packet half shipped at contract-v1.34's slice" -> it shipped with §10
  itself (PR #216). v1.34 was §13.
* "the inventory ships inside this cut, as contract-v1.34 through v1.38 all did"
  -> v1.37 did NOT, which is the defect this very file records against it.
* "the two preceding releases both found the surface broken" -> ONE preceding
  release found it broken, twice.
* the codexFactory chat-turn consumer doc is NOT in this checkout and was NOT
  read. The entry now states the OBLIGATION rather than asserting a finding.
* "1..500 bytes" -> JSON Schema counts `maxLength` in CODE POINTS. The producer's
  guard checks the stricter UTF-8 BYTE count against the same number, which is
  now what both the schema comment and the entry say.

Also: the unchanged pre-release example is unchanged in its INSTANCE (its header
comment grew), the pin-drift revert wording says three surfaces drifted once
rather than "both directions", `check_context_packet`'s own docstring now carries
the diagnostic finding, and 13.8's green numbers are re-measured AFTER the
origin/main merge with the fifteenth skip explained as a checkout-layout artifact.

The CHANGELOG and the SCHEMA both moved, so the digest is repinned on all three
surfaces and the inventory REBUILT after it.

* Review round 1: four should-fixes and three notes, each reproduced first

S1 — THE NOTE WAS WRITTEN WHILE HIDDEN, so "live-announced" was nearly false.
A `hidden` node is out of the accessibility tree; the text mutation landed in a
node no live region observed, and `aria-live` read `polite` either way, which is
why an attribute assertion could not catch it. Order now matches the failure
note beside it (un-hide, then write), and the probe pins the ORDER by recording
`hidden` AT THE MOMENT of the write.

S2 — THE SCHEMA COMMENT CLAIMED A BYTE GUARD THAT DID NOT EXIST, in released
bytes. Reproduced against the RELEASED validators: a 500-code-point CJK reason
(1,500 bytes) SERVED 200; a 501-code-point reason 502 `response_invalid` with
dispatch ALREADY COUNTED. Three fixes: the comment now says CODE POINTS and what
that means for a consumer sizing a buffer; the constants test's docstring names
its unit and why it uses the stricter one; and `doxbench_context_packet` gained
the bound itself, in code points, pre-dispatch -- so it refuses exactly what the
shape refuses and no conformant record more (the CJK case is still served, and a
test says so). The constant is pinned to the released `maxLength`.

S3 — 13.8 ASSERTED "MERGED" PRE-MERGE. The three pending facts (squash sha, tag,
sentinel) are lifted to the HEAD of the block so a reader meets them before any
claim they qualify, and the gate's verb is stated exactly: BUILT AND GATED now,
MERGED at the landing squash.

S4 — A FAILED FOLLOW-UP STRIPPED THE REDUCED ANSWER'S DISCLOSURE. Reproduced
(reduced -> note; FAILED follow-up -> no note, transcript unchanged). Took the
reviewer's SECOND shape: delete the `beginTurn` clear, because a flight starting
replaces no answer and every path that replaces one already replaces the posture
beside it. Restoring in `settleTurnFailure` was rejected -- it would need a stash
plus the same restore in `abortTurn` and `recordLocalFailure`, re-implementing
one invariant at three sites. Both directions probed and revert-tested.

N1 the redaction scan is a LINT with misses in both directions, not a guard --
kept, reworded in the validator docstring, the CHANGELOG and the tick.
N3 one route test drives a reduced turn through the RELEASED schema with the
default validator seam, closing the fixture-schema gap on the posture rules.
N6 `TurnStore` is per-process, in-memory and bounded; nothing durably stores a
v2 body. The durable record is the thread sidecar, which does not carry it.

The schema and the CHANGELOG both moved: digest repinned on all three surfaces,
inventory REBUILT after it.

* S1: assert the order over EVERY write, not the last one

The R27 revert-test came back GREEN with the defect restored. Cause: under the
wrong order a reduced turn produces TWO non-empty writes -- the settling render
writes the text while the node is still hidden (the announcement is lost there)
and a LATER re-render writes the identical text with it already visible. The
probe read writes[length-1] and saw only the benign second one.

Now asserted over every non-empty write: none may happen while hidden, and the
FIRST one is checked explicitly. Exactly the trap the reviewer warned about when
they said attribute assertions cannot catch this.

Co-Authored-By: Claude Fable 5 <[email protected]>

* 10.7: record the review round's nine revert runs, including the third GREEN

The S1 probe itself came back GREEN with the defect restored -- the most useful
result in the table, and the reviewer's own predicted failure mode one level up.
Recorded beside the other two.

Co-Authored-By: Claude Fable 5 <[email protected]>

* 10.7: re-measure 13.8's green numbers after the review round (3896 -> 3903)

Co-Authored-By: Claude Fable 5 <[email protected]>

* Review round 2: the ledger verb, the fourth answer-replacing path, and the snapshot

S3 RESIDUAL — the ledger summary paragraph, which a reader reaches BEFORE the
tick block, still said the release had "landed" and that the archive gate's
sentence "is true ... and it now is". Same overclaim, same correction: built and
gated now; merged and landed become true at the landing squash.

NEW-1 — `restoreChatState` is a FOURTH answer-replacing path and kept a stale
posture. Reproduced: restore a different conversation's snapshot over a reduced
state and the note survives, captioning "a DIFFERENT, un-described answer".
Reachability nil (the sole caller restores onto a freshly mounted rail) but
three enumerations claimed completeness at three paths. Named as the fourth in
all three, probed, revert-tested.

NEW-2 TAKEN AS (a), CLOSE IT, NO VERSION BUMP. `CHAT_SNAPSHOT_VERSION` is a
fail-closed gate -- restoreChatState keeps the FRESH state on an unrecognized
version -- so bumping would discard every stored blob on the first reopen:
composer text, subject, model choice and proposals, spent to add a caption. An
OPTIONAL field invalidates nothing: an old blob restores to posture-unknown (no
note, the pre-release behaviour), and a new blob read by an older build is
ignored because the restore reads named fields and never enumerates. Same
additive reasoning the wire contracts use, applied to a blob. The stored field
is named `context_packet` and carries the released object whole, so ONE
validator serves both readers and a contradictory blob fails closed.

An explicit `full` IS persisted. The first probe called that an oversight; it is
the doctrine -- absent and `full` are different facts everywhere else in this
release, so dropping `full` would restore "unknown" over a posture somebody
checked.

NEW-3 the live region is written only when its text CHANGES (the reviewer
measured seven re-announcements of the same 227-char sentence from composer
keystrokes); probe pins the write count across seven keystrokes.
NEW-4 the CJK conformance test now runs @released_only through _UNSET, so
"conformant" is a claim about the released bytes rather than about the fixture.
Its over-long sibling needs no such treatment: the producer guard fires before
any validator is consulted.

Also corrected: a tick sentence still saying `beginTurn` clears the note.
The CHANGELOG moved, so the inventory is REBUILT with it (the schema did not).

* NEW-2: pin the stored-posture guard on the ADOPTED STATE, not the rendered note

R39 came back GREEN twice. Cause: reducedContextNote holds its own second guard
on the same rule, so a note-level assertion is satisfied even when
restoreChatState trusts the blob whole. The probe now reads the adopted state
across five contradictions and also asserts the honest blob still adopts, so the
guard is shown to be discriminating rather than merely refusing.

(The second GREEN was a process error of mine, not a second defect: revert.py
restores with , which reverted this strengthening because I
had not committed it before running the drive. Committing first from here.)

Co-Authored-By: Claude Fable 5 <[email protected]>

* 10.7: record round 2's eight revert runs and the fourth GREEN

Twice now a probe has been satisfied by a downstream guard rather than by the
thing it names (S1's later re-render, NEW-2's selector second-guard). Recorded
as a habit to check. Also records the harness process note: commit before
revert-testing, because restore() is git checkout -- .

Co-Authored-By: Claude Fable 5 <[email protected]>

* 10.7: re-measure 13.8's green numbers after review round 2 (3903 -> 3908)

Co-Authored-By: Claude Fable 5 <[email protected]>

* Fold the reviewer's last two notes: soften a comment, name a follow-up

The adopter NORMALIZES (drops an unknown key and still adopts) where the
released shape's closure REFUSES the instance. "Exactly the rule a malformed
wire record does" was a shade strong for the closure case, so the comment now
says the PAIRING rule is shared and the verdicts differ -- and why each is right
where it sits. It lives in doxbench-chat-model.js, which is not released bytes,
so the correction lands at the source rather than in a frozen entry.

Recorded, NOT coded: adoptContextPacket applies no length bound to a RESTORED
reason (a tampered browser-local blob renders an arbitrarily long muted note;
browser-local, self-tamper only, nothing reaches the wire, the server or another
viewer). One line is the fix and it belongs to the slice that touches the
function next.

Co-Authored-By: Claude Fable 5 <[email protected]>

* 10.7: re-measure at the final merge (origin/main 0f9e14b, 3930 passed)

Co-Authored-By: Claude Fable 5 <[email protected]>

* Copilot #256: presence is not truthiness — fixed at four gates, not two

BOTH FINDINGS CONFIRMED, reproduced across all five gates before anything was
touched. The released shape forbids `reduced_reason`'s KEY on a `full` posture
(`not: {required: [reduced_reason]}`). Three other gates forbade only a USEFUL
value, so `{posture: "full", reduced_reason: ""}` passed them:

  instance            shape   delegated  ContextPacket  serve    adopter
  key absent            ok       ok           ok          ok       ok
  reduced_reason ""  REFUSES  REFUSES      ACCEPTS*    ACCEPTS*  ACCEPTS*
  reduced_reason null REFUSES ACCEPTS*       n/a         n/a     ACCEPTS*
  a real reason      REFUSES  REFUSES      REFUSES     REFUSES   REFUSES

Copilot 1 (serve.py) and Copilot 2 (doxbench-chat-model.js) are the third and
fifth columns. Fixing them surfaced two more of the same class: the CONSTRUCTION
gate `ContextPacket.__post_init__` had it too — and the release claims in writing
that the type, the shape and the validator "assert this one rule", which was
false at the blank — and the DELEGATED VALIDATOR read `reason is not None` where
the shape reads the key, so `.get()` could not tell a `null` from an absent one.
Copilot named two gates; there were four.

FIXED at each, with the unit matched to what the reader can see: `is not None`
at the type and the derivation (a Python attribute has no key/value distinction,
so that IS presence there), own-key presence in the validator and the adopter,
which read JSON and do.

THE REDUCED ARM IS UNCHANGED, deliberately, and the asymmetry is the shape's
own: `full` refuses the field for BEING THERE, `reduced` refuses it for being
UNUSABLE (`required` plus `minLength: 1`). Two rules, not one predicate — said
at each site, because collapsing them is how this comes back. Pinned both ways:
a blank still refuses on `reduced`, a real reason still passes, an absent key
still adopts on `full`.

Two packaged negatives, one per instance a different gate missed:
`-context-empty-reason-on-full` and `-context-null-reason-on-full`. Six
revert-tests, all RED, including two that loosen the reduced arm to prove the
fix tightened `full` without weakening it.

NO CONTRACT BYTE MOVES — the shape was right all along. Schema digest unchanged
at cc874fef…, inventory untouched, verify-commit passes; asserted rather than
assumed, and the two new examples confirmed NOT inventory members.

Co-Authored-By: Claude Fable 5 <[email protected]>

* 10.7: correct the bot round's revert count (7 runs) and note R43 is no fifth GREEN

The validator revert leaves its own self-test green because its pairing arms are
DIAGNOSTICS -- already recorded, and the finding-code pin that guards them went
RED. Predicted, then observed.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Review N-1 and N-2: correct a "not rebuilt" claim, and make a per-stem table per-stem

N-1: two sites said the PACKET was not rebuilt and that `ContextPacket` is
byte-identical to what §10 shipped. False since the bot round, which tightened
the construction gate's full-arm predicate. Bounded and re-verified before
rewording: `assemble_packet` and both `REDUCED_*` constants have zero hits in
this branch's diff and `test_doxbench_packet.py` is unmodified, so the ASSEMBLY
claim stands as written -- one predicate moved, and it moved to keep the
three-gates-one-rule claim true rather than as a carve-out.

N-2: the type-gate parametrization mapped every non-reduced stem to
`(FULL, _REASON)`, so four parameterisations constructed TWO distinct packets
and the test reported per-stem coverage it did not provide -- the blank stem,
the exact instance the type used to accept, was never constructed there. Now a
per-stem table. The null stem asserts ACCEPTED against a stated representational
limit: a Python attribute has no key/value distinction, so `reduced_reason=None`
IS absence and the wire instance has no counterpart; the shape and the delegated
validator refuse it and are pinned doing so, and
`...agree_on_PRESENCE` is the faithful pin for the type.

A companion test requires every stem to have its OWN instance -- and it earned
itself on its first run, catching that `-reason-on-full` is a suffix of both new
stems, so the table is keyed on whole stems.

No contract byte moves.

Co-Authored-By: Claude Fable 5 <[email protected]>

* 10.7: re-measure 13.8 at the v1.40 re-cut (origin/main 1f45e42)

3940 passed / 15 skipped; doc-health 704 and openspec 66 both move because
#259's tests and its still-active change packet came in with the merge. Counted
fresh, not carried forward.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Bot round 2 on the re-cut: three findings, all real, all from the renumber

Copilot and Codex INDEPENDENTLY caught the same miss, and it is the useful one.

1+2. styles.css:1881 still said contract-v1.39. A genuine miss: the file was not
in the renumber list, AND my own post-renumber audit could not have caught it --
the grep was scoped `--include="*.py" --include="*.md" --include="*.yaml"
--include="*.js"` with no `*.css`, so the one file that needed it was the one
class the audit was blind to. Re-swept with a content-only grep across ALL file
types: styles.css was the only hit, and it is now v1.40.

3. Codex, tasks.md:1085 -- the blanket renumber rewrote a HISTORICAL record into
a false one. That paragraph describes the allocation at branch base 6614061,
where the next available number was v1.39 and this cut took it; renumbering it
made it claim v1.40 "was available" there, which was never true. The CHANGELOG's
re-cut narrative had preserved the sequence correctly and the tick had not. The
paragraph now tells the sequence -- allocated v1.39 at the base, lost it to
PR #259 at landing, re-cut to v1.40 -- and says in as many words that an earlier
version of itself was the false one, rather than quietly correcting it. Swept
for siblings; this was the only historical claim the renumber corrupted.

4. Copilot, the credential-leak negative's header: "bounded at 500 bytes" is the
byte-vs-code-point confusion this release explicitly fixed elsewhere. Now
"`maxLength: 500` (code points, not bytes)".

No contract byte moves: none of the three touches contracts/, the schema digest
is unchanged at d8ee5624..., and the validator holds at 0 errors / 4 warnings
with 41 valid + 68 negative examples.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Codex round 3: the same corrupted-history defect, in the pin comment

Codex found a SIBLING of its own previous finding: doxbench_contracts.py's pin
history carried the same mechanically renumbered historical claim -- "v1.40 WAS
AVAILABLE WHEN THIS SLICE ALLOCATED IT ... at the branch base (6614061)" --
which was never true. v1.39 was available there and this slice allocated it;
v1.40 came only after PR #259 took v1.39.

My previous sweep was scoped to tasks.md and the CHANGELOG. That is twice now
that a scoped sweep has been the thing that missed: first a grep with no *.css,
now a sweep of two files when the claim lives in four. The sweep is now
content-based across EVERY file for the historical phrases (branch base, was
available, next available, mid-flight, and each merge sha), and it finds only
the corrected paragraphs.

Fixed here:
* the pin history now tells the sequence -- allocated v1.39 at the base, lost it
  to #259 at landing, re-cut to v1.40 -- and says outright that a blanket
  renumber had left the false claim, rather than quietly restating the number;
* proposal.md's `contract_release:` frontmatter said only 11.7 had to move a
  number in flight. TWO of the four did: v1.37 -> v1.38 (#235) and v1.39 ->
  v1.40 (#259). Both re-cuts are the availability test working as written.

No contract byte moves; schema digest unchanged at d8ee5624...

Co-Authored-By: Claude Fable 5 <[email protected]>

* Codex round 4: a restored posture must not outlive the answer it describes

A NEW finding and a real one. `restoreChatState` drops malformed turns WHOLE
(P3-6(a)/(b)), so a perfectly valid stored `context_packet` can arrive with no
answer to describe. Three cases reproduced before fixing:

  empty transcript + valid posture      -> note rendered for NO answer
  assistant turn filtered, human kept   -> same
  NEWEST assistant turn dropped         -> the note captioned the OLDER answer
                                           with the NEWER answer's posture

The third is the wrong-answer caption this invariant exists to prevent, arriving
by a THIRD route after the failed follow-up (S4) and the cross-restore (NEW-1).

Fixed at the invariant rather than per-case: the posture is adopted only when
the restored transcript ENDS with an assistant turn, because that is the answer
a posture would be describing. A transcript ending in a human turn has no answer
on screen -- including the ordinary case of a tile closed mid-question. The
honest case still adopts, and the probe asserts that too, so this is a condition
and not a blanket refusal.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Codex round 5: a reduction reason must be a STRING, not merely truthy

Reproduced, and worse than reported. `if not reason:` accepted any truthy value
and `str(reason)` then MANUFACTURED a reason from it:

  123          -> "123"
  ["a","b"]    -> "['a', 'b']"
  {"why": "x"} -> "{'why': 'x'}"
  object()     -> "<object object at 0x71c078978c90>"

A heap address, in a durable record, on the degraded path. Same
silent-normalisation class as the presence findings: malformed collaborator
output turned into a conformant-LOOKING posture instead of a refusal.

Fixed at BOTH gates, as the presence rule was -- the derivation and
`ContextPacket.__post_init__` -- because the released shape says
`type: string` and a truthy non-string is not a reason. The reason is now
carried VERBATIM rather than coerced: `str(reason)` is gone from the return and
from the ceiling measurement.

NOT restated in the delegated validator, deliberately and consistently: that
gate restates the PAIRING and nothing the shape already expresses, exactly as it
restates neither the posture enum nor the object's closure. A type constraint is
the same category. The browser adopter already required `typeof === "string"`.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Codex round 6: the released ceiling on the reading side, and a guard that could not see its own case

TWO findings, both reproduced, both real -- and one of them breaks a guard this
branch added two rounds ago.

F1 -- THE ADOPTER HAD NO CEILING. This was recorded in the tick as a named
follow-up, deliberately deferred, on the grounds that the blob is browser-local
and self-tamper only. That rationale covered the wrong half of the surface: the
same adopter also reads the WIRE, the dispatcher validates only `ok` and `kind`,
so a malformed transport's oversized reason reaches browser state, the live
region and from there the persisted snapshot. Reproduced at 5,000 code points.
The bound is now in, pinned to the released `maxLength` by its own test, with a
reason exactly AT the ceiling still adopting. The tick records this as a
REVERSAL of its own deferral rather than quietly doing it.

F2 -- MY ROUND-4 GUARD COULD NOT SEE ITS OWN CASE. It tested the FILTERED
transcript's tail, which cannot distinguish the original terminal answer from an
earlier retained one: `[human, assistant "older", assistant(malformed)]` filters
to a tail that IS an assistant turn, so the guard passed and captioned the older
answer with the newer answer's posture -- exactly the defect it was added to
prevent, one layer in. Reproduced.

The test is now THE SNAPSHOT'S OWN TERMINAL ROW: adoption asks whether the
answer the posture BELONGS TO survived, using the same well-formedness predicate
the transcript filter uses so the two cannot disagree about what "survived"
means.

THREE restatements of one ceiling now exist (schema, serve, browser) and each
pair has a pinning test, so they cannot drift into three ceilings.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Codex round 7: count the reading-side ceiling in CODE POINTS, not UTF-16 units

Correct, subtle, and the same mistake this release argued against on the server
side -- arriving on the browser side in the other unit.

JavaScript's `String.length` counts UTF-16 code UNITS; JSON Schema's `maxLength`
counts CODE POINTS. Reproduced: a conformant reason of 300 emoji is 300 code
points and `.length === 600`, so the ceiling added one round ago DISCARDED a
record the released contract accepts -- hiding the very disclosure this release
exists to show. `[...reason].length` iterates code points.

This is precisely the reasoning the S2 fix used to reject a BYTE-counting guard
on the server ("a byte-counting guard would refuse a conformant 1,500-byte CJK
reason"); the unit discipline was right there and the browser side got it wrong
anyway, which is worth recording rather than just fixing.

Pinned: 300 code points / 600 UTF-16 units, adopted.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Fix the broken escape my own round-7 test commit introduced

`\u{1F600}` inside the Python-hosted JS harness string is an invalid Python
unicode escape (`\u` wants exactly four hex digits), so the previous commit
left test_doxbench_chat_view.py failing to COLLECT -- caught immediately by the
targeted run, but it was committed broken. `String.fromCodePoint(0x1F600)`
needs no backslash and says the same thing.

Recorded rather than amended away: a commit that cannot be collected is worse
than the defect it was fixing, and the reason it happened is that I ran the
tests AFTER committing rather than before.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Codex round 8: drop the stale byte-guard claim from the tick

The tick's shape description still said the producer's guard "shadows [the code
point bound] with the stricter UTF-8 byte count". That was true of a draft and
is not true of the code: `serve.doxbench_context_packet` counts `len(reason)`
(code points) and the browser adopter counts `[...reason].length`, both pinned
to the released bound; the BYTE count applies only to the shipped `REDUCED_*`
constants, in a test, as a rule about text this repository authors.

The same task already called that claim false 90 lines further down, so the
change packet was contradicting both the implementation AND its own correction.
Now it describes the runtime code-point guard and the separate constants test as
two different things.

The two remaining "500-byte ceiling" mentions are contract-v1.38's, about
`data_handling`, and are not this release's to restate.

No contract byte moves.

Co-Authored-By: Claude Fable 5 <[email protected]>

---------

Co-authored-by: brettheap <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
@brettheap
brettheap deleted the change/doxbench-model-catalog-release branch September 4, 2026 19:25
brettheap added a commit that referenced this pull request Sep 6, 2026
…e act held on #555's ordering (#721)

* admit-deliberation-clearing-operation: tick the realized rows; archive act held on #555's ordering

Verifies and ticks 1.7, 3.1, 3.2, 3.3, 4.1, 4.2, 4.2a, 4.3, 5.1 against
live evidence (codexFactory tasks.md, openxFactory issue #630, tag
contract-v3.4, xFactory issue #244, PR #652, the clearing-dispatch-gate
and pytest/validator runs). Leaves 3.4 open (the release-digest
inventory is scoped to contracts/hermes-runtime/ and has never listed
the clearing family, so the specific "lists the new schema" evidence
could not be confirmed). Leaves 5.2 open with a dated HELD note
(add-clearing-dispatch-boundary / #555 is still active) and 5.3 open
(runs at archive). Does NOT run `openspec archive`.

Lane: hermes-wallet-exercise

* admit-deliberation-clearing-operation: tick 3.4 on the row's own wording; file the digest-inventory scope gap separately

Row 3.4 requires only that contracts/releases/contract-v3.4.digests.yaml
exists at the tag, that contract-v3.4 is an annotated tag at the landed
sha 807a4f4, and that manifest version / changelog heading / tag agree
- not that the clearing schema appear in the digests inventory. All
five checked facts agree. The scope mismatch (release-digest inventory
covers only contracts/hermes-runtime/, never contracts/clearing/, by
design in scripts/hermes_runtime_validation/release.py's FAMILY_PREFIX)
is filed as openxFactory issue #722 and referenced in the row's note.

Lane: hermes-wallet-exercise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants