Skip to content

The publisher declares no pin on itself: unbreak doxBench's model routes - #164

Merged
brettheap merged 2 commits into
mainfrom
change/align-doxbench-contract-pin-to-publisher
Aug 11, 2026
Merged

brettheap merged 2 commits into
mainfrom
change/align-doxbench-contract-pin-to-publisher

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

What was wrong

doxBench's two model routes have been dead since adopt-neutral-tooling-home
(82ae3d8, 2026-08-03) moved the dashboard runtime into openxFactory — for the
reason that change's own tasks.md recorded at lines 155-161 and deferred to a
tranche D that never landed:

OPEN ITEM for Brett/tranche D: doxbench_contracts.verify_stack_pin
requires the HOSTING repo's stack.yaml consumption pin; openxFactory is the
publisher and has none, so from a publisher checkout serve's two doxbench
model routes fail CLOSED … until a ruled publisher-side declaration lands.

verify_stack_pin is the FIRST statement in validators(). openxFactory has no
stack.yaml, has never had one, and under working rule 1 must not grow one —
consumers pin openxFactory, not the reverse. So the check was not failing; it was
asking a question the publisher cannot honestly be asked, and asking it before
any byte is read. Every request, every checkout: 500 catalog_unavailable.

The bytes were never the problem. Both wire schemas pass sha256 and manifest
parity in every candidate checkout and are byte-identical v1.28 → HEAD. The
digest chain — the part that actually proves a release was read as released — has
been green throughout.

The ruling

Publisher mode. A hosting repo carrying all three release markers
(contracts/manifest.yaml, contracts/schemas/, the family validator) consumes
CONTRACT_REF by construction and reads no declaration. All three markers are
required together, which is the distinction manifest parity already draws for one
schema, applied to the checkout as a whole.

Nothing else relaxes. _verified_bytes has a zero diff, runs per request in
both modes, and is anchored to this module's own literals rather than to anything
a checkout claims about itself — which is what makes publisher mode safe rather
than merely convenient. Two new tests pin it: a drifted digest and a disagreeing
manifest each still refuse under publisher mode.

A consumer repo keeps the declared-pin requirement exactly as it stands.

Two adjacent defects the refusal was hiding

  • The pin was three releases stale (v1.28 → v1.31). Digest-neutral, and
    verified so rather than assumed: both schemas are byte-identical across
    v1.28/29/30/31 and HEAD, and v1.31's own manifest records exactly the two
    digests already pinned. No verified byte changes; no conformance question
    reopens.
  • resolve_root could never find the repo it ran in. VALIDATOR_RELPATH
    carries the openxFactory/ prefix, so it searched one level below where it
    stood: from inside the publisher it walked past itself every time onto the
    aggregation's shared submodule. A serve in one worktree was verifying its wire
    shapes against another session's branch (measured: 9fe29a2 on
    staging/topology-handoff). Harmless only by the coincidence of those two
    files not having moved.

Why it survived a week

The released-contract test rung was opt-in behind OPENXFACTORY_ROOT, so every
probe that would have caught this skipped. It is now default-on from a publisher
checkout. Nine previously-skipping tests now execute — including one deferred
behind "the pin advances to the bundle carrying the amendment", a signal that
fired at v1.28 and that nobody could observe because the test lived inside the
opt-in rung.

The same pathology appeared at three levels: the route swallowed its reason, the
rung that would have caught the route was opt-in, and a test inside that rung
waited on a signal no one could see.

Evidence

Gate Result
pytest tests/ideation-dashboard 2850 passed, 5 skipped, exit 0
pytest tests/doc-health tests/notebooklm 692 passed, exit 0
openspec validate --all --strict 58 passed, 0 failed
doc-health 0 new regressions
contract family validator 26 instances, 0 errors, 0 warnings

Exit codes read directly, never through a tailed pipeline.

Live A/B in a real browser, one machine, same request. A serve whose module
loaded after the fix answers 200 {kind: workbench-model-catalog, models: []} —
the conformant empty-catalog success, which also proves the released schema
resolved, since the route self-validates the envelope before sending. The serve
whose module loaded before it still answers 500 catalog_unavailable. Driven on
a second port so the session's existing serve was never disturbed.

The five remaining skips are environmental and enumerated with -rs rather than
assumed: four in test_aggregation_register_instance.py (this worktree's parent
is not the aggregation root) and one empty-parameter-set in
test_doxbench_transport.py.

Reviewer notes

  • Status: draft — the boundary ruling is NOT yet ratified. The code is
    green and the runbook documents the disposition, but publisher-mode-versus-a-
    publisher-stack.yaml is Brett's call and this PR is where it gets made.
  • A design decision was reversed while implementing. A tighter same-tree rule
    (publisher mode only when the resolved checkout is the hosting repo) was
    floated and rejected: the declared-pin check never compared stack.yaml to the
    checkout, only to CONTRACT_REF, so the digest chain already governs which
    release is read from anywhere. It would have added no safety and broken the
    documented OPENXFACTORY_ROOT rung. Recorded in verify_stack_pin's docstring
    and design.md so it is not re-proposed.
  • Known sharp edge, documented not fixed. A pin failure is silent — swallowed
    to None, fixed message, nothing logged. Correct on the wire, but it is why
    this cost a diagnosis session. Runbook §2c documents it and gives the one
    command that makes the seam speak. Whether it gets fixed here or in its own
    change is open.
  • serve.py is untouched. The routes recover because the seam beneath them
    starts succeeding.
  • The second commit annotates the relocation's archived ledger as an append —
    the original open-item sentence stands word for word.

🤖 Generated with Claude Code

brettheap and others added 2 commits August 11, 2026 08:26
doxBench's two model routes have been dead since adopt-neutral-tooling-home
(82ae3d8, 2026-08-03) moved the dashboard runtime into openxFactory, for the
reason that change's own tasks.md recorded at lines 155-161 and deferred to a
tranche D that never landed. verify_stack_pin demands the HOSTING repo declare
xfactory.contract_ref in stack.yaml; openxFactory is the publisher, has none,
and under working rule 1 must not grow one. The check was not failing — it was
asking a question the publisher cannot honestly be asked, and asking it FIRST,
before any byte is read. Every request, every checkout: 500 catalog_unavailable.

The ruling is publisher mode. A hosting repo carrying all three release markers
consumes CONTRACT_REF by construction and reads no declaration. Nothing else
relaxes: the digest and manifest-parity chain in _verified_bytes has a ZERO
diff, runs per request in both modes, and is anchored to this module's own
literals rather than to anything a checkout claims about itself — which is what
makes publisher mode safe rather than merely convenient, and is pinned by two
new tests (drifted digest, disagreeing manifest).

Two adjacent defects the refusal was hiding land with it:

  - The pin was three releases stale (v1.28 -> v1.31). Digest-neutral and
    verified so: both wire schemas are byte-identical across v1.28/29/30/31 and
    HEAD, and v1.31's own manifest records exactly the two digests already
    pinned. No verified byte changes; no conformance question reopens.

  - resolve_root searched one level BELOW where it stood (VALIDATOR_RELPATH
    carries the openxFactory/ prefix), so from inside the publisher it walked
    past itself every time onto the aggregation's shared submodule. A serve in
    one worktree was verifying its wire shapes against another session's
    branch — harmless only by the coincidence of those two files not moving.

The released-contract test rung is now default-on from a publisher checkout.
That is what turns this class of break back into a test failure instead of a
runtime 500; while it was opt-in behind OPENXFACTORY_ROOT, this sat green in CI
for a week. Nine previously-skipping tests now execute, including one that had
been deferred behind "the pin advances to the bundle carrying the amendment" —
a signal that fired at v1.28 and that nobody could observe, because the test
lived inside the opt-in rung.

Evidence: 2850 passed / 5 skipped / exit 0 (tests/ideation-dashboard); 692
passed (doc-health + notebooklm); openspec --all --strict 58/58; doc-health 0
new regressions; contract validator 26 instances clean. Live A/B in a real
browser on one machine: a serve loaded after the fix answers 200
{kind: workbench-model-catalog, models: []} — the conformant empty-catalog
success — while the serve whose module was loaded before it still answers 500.

The OpenSpec change is Status: draft and NOT yet ratified; runbook 2c documents
the ruling, the two postures, and the fact that a contract failure is silent.

Co-Authored-By: Claude Opus 5 <[email protected]>
…ewriting

The relocation recorded that verify_stack_pin wanted the HOSTING repo's
stack.yaml, that openxFactory is the publisher and has none, and that serve's
two doxbench model routes therefore fail closed "until a ruled publisher-side
declaration lands". That ruling is align-doxbench-contract-pin-to-publisher, so
the item is annotated resolved.

Done as an APPEND at Brett's instruction, after I first declined it. The
original open-item sentence stands word for word and the resolution follows it,
so the ledger still says what was true when the tranche closed — an archived
change's task ledger is the record of a landed change, and a record that gets
edited into agreement with the present stops being evidence of anything. The
annotation names the change, the ruled disposition, and the week the routes
were dead.

Checked rather than assumed: doc-health's record-immutability family is
unmoved (3 pre-existing criticals, all in docs/domain-ontology-*, 0 new
regressions), so archived change ledgers are not governed by it — the caution
was about the governance, not the gate. openspec --all --strict 58/58.

Co-Authored-By: Claude Opus 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 11, 2026 12:27

@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 ✨

@brettheap
brettheap merged commit 5d8e963 into main Aug 11, 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

This PR restores doxBench’s two model routes by adjusting contract verification and checkout resolution for the case where the runtime is hosted inside the contract publisher (openxFactory). It introduces “publisher mode” (verify released bytes without requiring a stack.yaml consumption pin), repins the contract ref/tag to the current release (v1.31), and makes the released-contract integration rung run by default from a publisher checkout to prevent regressions from hiding behind skips.

Changes:

  • Add publisher-mode handling to contract verification and adjust resolve_root() precedence to prefer the running publisher checkout.
  • Repin CONTRACT_REF / CONTRACT_TAG to contract-v1.31 (digest-neutral).
  • Expand and unskip integration coverage; document the ruling in OpenSpec records and the ops runbook.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/ideation_dashboard/doxbench_contracts.py Adds publisher-mode logic (is_publisher_checkout, verify_stack_pin behavior) and resolves checkout from the hosting repo before walking to aggregation.
tests/ideation-dashboard/test_doxbench_contracts.py Adds publisher-mode tests and resolution-precedence tests; updates integration-rung behavior and pin constants.
tests/ideation-dashboard/test_doxbench_routes.py Makes released-contract rung runnable by default from a publisher checkout; re-enables a previously deferred released-schema conformance test.
README.md Adds an OpenSpec Records entry summarizing the change and its motivation.
openspec/changes/archive/2026-08-05-adopt-neutral-tooling-home/tasks.md Appends a resolution note for the previously deferred tranche item.
openspec/changes/align-doxbench-contract-pin-to-publisher/tasks.md New task ledger describing implementation and verification gates.
openspec/changes/align-doxbench-contract-pin-to-publisher/specs/shared-contract-ownership/spec.md New requirements spec for publisher-vs-consumer verification posture.
openspec/changes/align-doxbench-contract-pin-to-publisher/specs/ideation-dashboard/spec.md New requirements spec for checkout resolution and route behavior expectations.
openspec/changes/align-doxbench-contract-pin-to-publisher/proposal.md New proposal documenting the problem statement, ruling, and scope.
openspec/changes/align-doxbench-contract-pin-to-publisher/design.md New design record with measurements and rationale for the chosen approach.
docs/ideation-dashboard-session-runbook.md Documents the new “fourth prerequisite” (contract resolution) and the silent-failure diagnostic.

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

Comment on lines +2347 to +2351
# Runs by DEFAULT from a publisher checkout: this suite is hosted inside
# openxFactory, so the released bytes are present and the rung has no reason to
# be opt-in. `OPENXFACTORY_ROOT` still selects a different checkout when one is
# wanted. While this was env-gated ONLY, the publisher-mode refusal that killed
# both model routes sat green here for a week — every one of these probes
Comment on lines +155 to +163
def is_publisher_checkout(root: Path | str) -> bool:
"""True when `root` IS a release rather than a consumer of one.

Every marker in `PUBLISHER_MARKERS` must be present; see that constant for
why all three and not any one. This is a STRUCTURAL question about a
directory — it reads no digest and grants no trust, it only decides which of
the two verification postures applies."""
base = Path(root)
return all((base / marker).exists() for marker in PUBLISHER_MARKERS)
@brettheap
brettheap deleted the change/align-doxbench-contract-pin-to-publisher branch August 11, 2026 19:05
brettheap pushed a commit that referenced this pull request Aug 13, 2026
…her four

`release-realization`'s archive gate says a change with a non-empty code surface
archives when realization evidence exists — merged on the implemented target,
plus a green run — and that promoted specs then describe what the code does. Six
active changes were ratified (not seven; my earlier count was wrong). Checked one
at a time against the gate rather than archived as a batch, because they do not
all pass it:

ARCHIVED — evidence exists, no task left open:

  * align-doxbench-contract-pin-to-publisher — 0 open tasks, `Realized:` recorded
    (5d8e963, PR #164, green + live browser proof). Promotes 1 requirement each
    into `ideation-dashboard` and `shared-contract-ownership`.
  * add-session-notebook-reconciliation — its ONLY open task was 4.3, "Archive on
    realization evidence per release-realization", so archiving is the act that
    closes it. Realization is 1b964ba (PR #163) with the suite green; the evidence
    is now recorded as a `Realized:` line, because the gate requires it to EXIST
    rather than merely to be true. Promotes 1 requirement each into
    `ideation-dashboard` and `lifecycle-notebook-projection`.

LEFT ACTIVE, with the reason:

  * add-shared-identity-seeds — task 5.1 is unbuilt WORK (promote the detector to
    a fifth neutrality-drift signal), not a dogfood step. Not realized.
  * add-hermes-customer-subject-runtime-contract — 10 of 13 tasks open.
  * add-lens-document-selection — one open task, and it is Brett's own first real
    staging seed from the lens.
  * add-composed-view-authoring — same shape: Brett's first real create from a
    project view.

The last two are a DISPOSITION CALL rather than a gate failure: their code is
merged and green, and what remains is a human validation. Archiving them would
promote their deltas while the person who asked for the feature has not yet used
it once, so they stay active until Brett says otherwise.

Two defects the gate caught, both mine:

  * The change I authored had NO `.openspec.yaml`, so it carried no origin
    declaration and `proposal-origin` failed the moment it archived (errors 5 ->
    6). Added at the archive gate, declared ad_hoc with the real authoring dates
    and an explicit note that only the file is late — the alternative, back-dating
    silently, would have made the record lie about itself.
  * The README still listed both changes under "Active changes". Retired both
    entries; 45 lines.

Also flagged, not fixed: `target_release: none` is not a legal value — the axis
allows `implemented` or a named release, and `none` belongs to `code_surface`.
Five sibling changes carry the same mis-spelling, so it is recorded in the
archived task ledger rather than corrected under cover of an archive commit.

Gates: `openspec validate --all --strict` 56 passed / 0 failed; doc-health back
to its pre-existing 5 errors with 0 new regressions.

Co-Authored-By: Claude Opus 5 <[email protected]>
brettheap added a commit that referenced this pull request Sep 7, 2026
…mitted bytes

The flag this packet raised in the previous commit is ANSWERED, not open.
Measured by lane hermes-wallet-exercise and re-verified against OpsxFactory
origin/main:

  git cat-file -p origin/main:tenants/opensoft-codexfactory-mcp-hosting-plan.yaml \
    | sha256sum
  -> 4e1a4b763cf911134ac222e0ee7ee52afb2f902b36fabc1dbe4b3e2d7ac9f992

The plan's own `plan_digest` block (lines 880-892) defines the digest exactly
that way — algorithm sha256, "over: the exact bytes of this file, as committed",
"canonicalization: none — the raw file bytes", computed_by sha256sum — and
DELIBERATELY DOES NOT STORE THE VALUE: `value_recorded_here: false`, reason "a
digest over this file's bytes cannot be a line in this file". Self-referential,
so the absence is arithmetic rather than an omission. The bytes at a83e1d95 (the
last amendment, committed 2026-09-05T18:32:59-04:00 = 22:32:59Z, ~34 minutes
before the 23:06Z approval) hash to exactly that value today.

8abb0e96... is NOT a live digest of anything. It is the superseded orphan that
codexFactory #164's review/ratification.md once named for a document that never
existed (measured across 1,732 tree paths, OpsxFactory, and gh search code over
the opensoft owner: one occurrence, in that record itself). It survives only as
history at plan header lines 10 and 24, at plan_digest.supersedes.digest (904)
and in owed_acts seq 2 (1167) — an owed act codexFactory PR #240 (a4aa41b0,
2026-09-06) discharged, that ratification.md now citing 4e1a4b76 as superseding
it. THE 4.2 TICK'S PHRASE "the digest offered by codexFactory" DESCRIBES THE
SUPERSEDED INPUT, NOT THE APPROVAL, which the same tick names two sentences
later. 8abb0e96 must never be reused or cited as "offered".

Consequence for the ceremony: the re-approval after the org-move amendment is
taken over the NEW sha256sum of the amended bytes, computed the same way. The
runbook's step 9.2a therefore COMPUTES AND PRINTS it and Brett's re-approval
word quotes the printed value — an approval is over bytes, and a ruling quoting
a stale digest approves a document that no longer exists.

openspec validate --strict green; --all --strict 98 passed / 1 failed
(unchanged); validate-sequenced-after.py green.

Lane: provenance-autonomous-merge
brettheap added a commit that referenced this pull request Oct 7, 2026
…c537, the commit that realizes 5.2 (#1260)

Task 5.3 of the ratified change prefer-triad-project-shape. contracts/openreposhape-pin.yaml moves from e9c4827b to 1a9fc537bcce37301c85fc108fabd8a599b02000. That is openRepoShape #164, the commit that realizes 5.2, so the move also carries the 56 openRepoShape commits before it. Each file is classified by the pin's own digested-or-path-only rule. The result is 37 digested and 67 path-only members over a 104-file surface: 28 files are new since e9c4827b (6 digested, 22 path-only), 21 of the 31 earlier digests moved, and nothing was removed or renamed upstream. Template .gitattributes files are path-only, following the .gitignore, Makefile and validate.yml precedent. docs/project-repo-schema.md gains a dated currency note in the form its 2026-09-04 and 2026-09-05 notes set, and no doctrine sentence changes. The verifier's test constants move with the pin. tasks.md ticks 5.2 (openRepoShape #164 → 1a9fc537), 5.3 (this PR), 5.4 (workBenches #139 → 9fbe609c and #140 → d86ba59b) and 5.5 (brettheap/new-workstation #52 → e081c5ab and #53 → cb411460). 5.6 stays open with lane openRepoProject-1 (openRepoProject#3, #5). Checks: openreposhape-pin-gate is green, the pinned OpenSpec CLI result equals main's, doc-health finds nothing new, and every required check is green, merge-master-approval included.

Merged on Brett Heap's word "merge the 5.3 pin PR when green" (2026-10-07).

Copilot review not requested (Brett Heap, 2026-10-06).

Lane: codeXfactory-5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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