Skip to content

T050, the plain-documents fixture, spread across the six stations - #53

Merged
brettheap merged 6 commits into
mainfrom
feat/plain-documents-fixture
Sep 29, 2026
Merged

brettheap merged 6 commits into
mainfrom
feat/plain-documents-fixture

Conversation

@brettheap

@brettheap brettheap commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Plan 034, task T050, slice P2-F (fixtures). Plan read at opensoft/openxFactory main 133e37d9 (specs/034-opendox-standalone-operation/tasks.md § "Phase 2 writer slices"), after #1167 (the phase-1 gate) merged, and re-read at main 9d2e5bc3: T050's entry is unchanged. Authored ahead under the phase-2 draft-ahead ruling (openxFactory#656 comment 5857365170, Brett Heap: "Start phase 2's independent tasks (Recommended)" and "Draft ahead in phase 1").

T049 has landed (openxFactory#1204 → 9d2e5bc3, 2026-09-29T16:08:37Z), so phase 2 is open. T050 is After: T049, T009, and both are done. It is the one phase-2 openDox-code task that does not wait for T053. This PR stays a draft until the holder un-drafts it.

Claim: openxFactory#656 comment 5857512479.

What this realizes

Box 5.0 — tests/fixtures/plain-documents/, a handful of .md documents spread across the six stations, per RULED R1Q13 (a) with (c) (5850003126): "A neutral front-matter key names the stage role... and a document that declares nothing is a source, and groups derive from shared topics. The fixture yields at least one group."

  • Three sources (no stage: header at all): notes-rain-barrel-leak.md and notes-rain-barrel-overflow.md share the phrase "rain barrel" verbatim, so a future topic-based grouping pass (T054) has a pair to find; notes-toolshed-inventory.md shares no topic with them, so the fixture doesn't group by accident.
  • One document each declaring stage: grouping, stage: candidate, stage: selection, stage: submission, stage: completion — the exact opendox.display_profile.STAGE_ROLES spellings.
  • Every document carries the small neutral field set the task line names (title, summary).

Falsifier

T050's task line: "A test keeps the fixture free of those words... Falsifier: the vocabulary test." tests/test_plain_documents_fixture.py, passing:

$ python -m pytest -q tests/test_plain_documents_fixture.py --noconftest
....................                                                     [100%]
20 passed in 0.09s

It asserts, over every file in the fixture:

  1. no occurrence (case-insensitive, whole word) of the eight controlled Status: words this project's own root CLAUDE.md names (brainstorm | staged | draft | ratified | standard | superseded | retired | record) or the change/spec/delta nouns (change(s), spec(s), delta(s), openspec, proposal(s)) — the same two families tests/test_default_profile.py, tests/test_web_boundary.py and tests/test_display_facet.py already carry, copied on the same footing (a fixture must be readable as plain prose with no import, exactly as the eventual acceptance harness reads it);
  2. every one of the six stations is occupied, with exactly one document per explicit station;
  3. at least two (but not all) sources share "rain barrel".

Updated after T036 + T031 landed (#52) — merged main in, no conflicts

Opened against a pre-T036 main. main then landed T036 + T031 ("the required check runs the whole suite"): validate.yml's explicit pytest file list is gone, python -m pytest -q now runs testpaths (tests, tests_runtime) whole, and there is no narrowed list left to join. Merged main (5519433) into this branch, no conflicts (only new files were added here). Consequences:

  • tests/test_plain_documents_fixture.py is picked up by the required validate check automatically now — no separate wiring step needed, and the earlier note below about joining an explicit list no longer applies.
  • Re-ran locally post-merge with the full conftest chain active (not --noconftest): python -m pytest -q tests/test_plain_documents_fixture.py → 20 passed in 0.39s.
  • validate's new "Pin the triple" step floors selected/passed at >= and pins skipped at ==13 exactly. This PR only adds 20 new, passing, non-skipped cases, which raises selected/passed (floors permit a rise) and leaves skipped at 13 (unchanged) — so the pin does not need to move.

Original proof, still valid at the pre-merge head (d5d1aa4e), retained for the record:

$ python -m pytest -q tests/test_plain_documents_fixture.py --noconftest
....................                                                     [100%]
20 passed in 0.09s
$ python -m pytest -q tests/test_leg_shape.py tests/test_consumer_reach.py tests/test_profile_registration.py tests/test_web_boundary.py tests/test_intent_binding_shape.py tests/test_view_registry.py tests/test_split_route_tails.py tests/test_source_core_arm.py tests/test_gate_loop_contributed.py tests/test_display_facet.py tests/test_account_menu_dom.py tests/test_doc_wheel.py tests/test_doxbench_accessibility.py tests/test_doxbench_context_panes.py tests/test_doxbench_document_abstract.py tests/test_doxbench_hash.py tests/test_doxbench_knowledge.py tests/test_doxbench_privacy.py tests/test_doxbench_proposal_discard.py tests/test_doxbench_proposals.py tests/test_doxbench_state.py tests/test_doxbench_thread_switch.py tests/test_doxbench_workspace.py tests/test_intent_binding_dom.py tests/test_lens_labels_at_scale.py tests/test_smoke_signals.py tests/test_wheel_paint_and_reach.py tests/test_binding_stylesheets.py tests/test_conformance_corpus.py tests/test_triple_pin.py --noconftest
772 passed, 2 skipped in 30.70s

(That allowlist was validate.yml's own explicit file list at the pre-merge head; it no longer exists as such post-T036, superseded by the whole-suite run above.)

Updated after T049 landed: main merged in, and one stale paragraph corrected

At 521de95, locally, as CI runs it (CI=true, LANG=C.UTF-8, PostgreSQL 16, -e ".[runtime,test]" under the lock):

$ python -m pytest -q tests/test_plain_documents_fixture.py
20 passed in 0.27s
$ python -m pytest -q --junitxml=…          # the whole suite, as `validate` runs it
2488 passed, 11 skipped, 2 warnings in 199.75s (0:03:19)
triple: selected=2499 passed=2488 skipped=11 failures=0 errors=0

That is main's triple plus this PR's 20 passing cases. SKIPPED stays at the pinned 11.

Review rounds after T049: Copilot, two threads, both taken

The claim above, that notes-toolshed-inventory.md "shares no topic with them", was stronger than the case that held it. The case showed only that the note lacks the literal phrase "rain barrel".

  • r4135803935 (at 521de95c): a fixture edit that gave the sources another shared topic would still pass. 7028f613 compared the words of each document's name and direct naming between the two sides.
  • r4135883800 (at 7028f613): that still missed a topic shared through a third document. If both sides name the same other document, both inherit its name words. 4ba410ff takes it.
    • The case now derives each source's whole topic set: the words of its name, plus the name words of every other fixture document it names, whatever that document's station.
    • It then compares whole sets, which catches a common name word, one source naming the other, and both naming the same third document.
    • Only "the" and "and" are dropped, so the comparison is stricter than a topic rule with a longer stop list, never looser.
  • The same review's overview asked that the intended source declaration and count be enforced. The module docstring states both, so the cases now hold them:
    • no document declares stage: source, because a source here is a document that declares nothing (R1Q13 (a) with (c));
    • there are three sources, two of which share "rain barrel".

Six plants each turn the cases red at 4ba410ff:

plant at 4ba410ff at 7028f613
"garden" in the toolshed title and the leak title red red
the toolshed note names notes-rain-barrel-leak.md red red
the overflow note names "What is actually in the toolshed" red red
both the toolshed note and the leak note name grouping-compost-corner.md red passed
stage: source on the toolshed note red red
a fourth source red passed

Sibling task T051

T051 (tests/fixtures/malformed) is this same slice (P2-F). It depends on P2-S/T053 (the neutral snapshot schema, openDox-spec), which was unclaimed when this PR opened, so T051 was held rather than guessed at. T053 is now stable (openDox-spec#16 at cd49eb25, per the holder), and T051 is opened as its own DRAFT PR.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

🤖 Generated with Claude Code

…an 034)

tests/fixtures/plain-documents/ carries eight .md documents: three sources
(no `stage:` header, two sharing the phrase "rain barrel" so a future
topic-based grouping pass has a pair to find) and one document each
declaring `stage: grouping`, `stage: candidate`, `stage: selection`,
`stage: submission` and `stage: completion` (RULED R1Q13 (a) with (c),
openxFactory#656 comment 5850003126). Every document carries the small
neutral field set the default adapter will require regardless of station
(`title`, `summary`).

tests/test_plain_documents_fixture.py is the vocabulary test T050 names as
its falsifier: it asserts the fixture carries none of the eight controlled
`Status:` words or the change/spec/delta nouns, that it covers all six
stations with exactly one document per explicit station, and that at
least two (but not all) sources share the topic fixture code will need to
group on.

Not yet wired into .github/workflows/validate.yml's explicit pytest list:
phase2-ahead scope keeps this PR out of that file, the pin files and
conftest.py/pyproject.toml/README.md, which the phase-1 chain still edits.
This suite runs by node id today.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 27, 2026 16:07
@sourcery-ai

sourcery-ai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds the T050 plain-documents fixture across all six stations and a standalone pytest suite that verifies neutral prose, required metadata, exact station coverage, and the source-topic pattern needed for future grouping.

File-Level Changes

Change Details Files
Add a six-station plain Markdown fixture with neutral metadata and realistic source documents.
  • Add one document for each explicit stage role.
  • Add three undeclared source documents, including two sharing the “rain barrel” topic and one unrelated source.
  • Include title and summary fields across all fixture documents.
tests/fixtures/plain-documents/candidate-toolshed-rebuild.md
tests/fixtures/plain-documents/completion-path-resurfacing.md
tests/fixtures/plain-documents/grouping-compost-corner.md
tests/fixtures/plain-documents/notes-rain-barrel-leak.md
tests/fixtures/plain-documents/notes-rain-barrel-overflow.md
tests/fixtures/plain-documents/notes-toolshed-inventory.md
tests/fixtures/plain-documents/selection-spring-planting-plan.md
tests/fixtures/plain-documents/submission-shed-door-repair.md
Add focused tests that validate the fixture’s neutral vocabulary, metadata, station distribution, and grouping seed.
  • Scan all fixture content case-insensitively for forbidden status and governance terms.
  • Parse leading colon-delimited metadata without importing the production corpus reader.
  • Require title and summary fields and validate explicit stages against STAGE_ROLES.
  • Assert every station is occupied, explicit stations are unique, and source-topic sharing produces both a pair and a nonmatching source.
tests/test_plain_documents_fixture.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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.

Copilot review overview

🔵 Needs a closer look

Add an exact assertion for the intended three-source fixture contract.

Review effort: Lite
Findings: None

What changed in this PR

Adds a neutral Markdown fixture covering six workflow stations, with focused tests for metadata, vocabulary, and source grouping.

Changes:

  • Adds eight representative fixture documents.
  • Adds validation for fixture structure and content.
  • Leaves CI configuration unchanged.
File Reviewed change
tests/​test_plain_documents_fixture.py Validates fixture requirements; should assert exactly three source documents.
tests/​fixtures/​plain-documents/​submission-shed-door-repair.md Adds submission-stage fixture content.
tests/​fixtures/​plain-documents/​selection-spring-planting-plan.md Adds selection-stage fixture content.
tests/​fixtures/​plain-documents/​notes-toolshed-inventory.md Adds an ungrouped source document.
tests/​fixtures/​plain-documents/​notes-rain-barrel-overflow.md Adds a source sharing the rain-barrel topic.
tests/​fixtures/​plain-documents/​notes-rain-barrel-leak.md Adds a source sharing the rain-barrel topic.
tests/​fixtures/​plain-documents/​grouping-compost-corner.md Adds grouping-stage fixture content.
tests/​fixtures/​plain-documents/​completion-path-resurfacing.md Adds completion-stage fixture content.
tests/​fixtures/​plain-documents/​candidate-toolshed-rebuild.md Adds candidate-stage fixture content.

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

Copilot AI review requested due to automatic review settings September 27, 2026 18:17

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.

Copilot review overview

🔵 Needs a closer look

Three moderate validation issues remain in the fixture tests.

Review effort: Lite
Findings: None

brettheap added a commit that referenced this pull request Sep 27, 2026
…what is true now (plan 034)

Copilot's review of 0f42f67 left three threads.

- r4117298988 (neutral_projection.py): a `topics:` header that listed
  nothing fell back to the derived topics, which contradicted the rule
  the module's own docstring states. The header is now a declaration
  even when it is empty. The document carries no topic, nothing is
  derived for it, and it joins no group. That follows the holder's
  literal-copy principle for title and summary. New case:
  test_an_empty_topics_header_declares_no_topic. With the old rule
  restored, it fails.
- r4117299013 and r4117299033 (tests/test_plain_documents_fixture.py,
  T050's file, merged here from #53): its docstring said T052 and T054
  had not landed. It also said the suite was run by node id outside
  validate's explicit list. T054 makes the first false. The second has
  been false since T036 (#52), when validate began running the whole
  suite. Both paragraphs, and the two phrases beside them ("a future
  topic-based grouping pass", "will require"), now say what is true.
  Only the docstring changes.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap and others added 2 commits September 29, 2026 16:14
Phase 1 is closing (T049, openxFactory#1204), and phase-2 PRs go READY
after it. This branch was one commit behind main. The merge brings in
T037's floors and its binding-stylesheet cases, and touches no file this
branch adds.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Since T036 (#52), `validate` runs the whole suite (`python -m pytest -q`
over the configured testpaths) instead of an explicit list of files. So the
paragraph that said this suite was "not yet wired" into that list, and ran
by node id, has been false since T036 landed. It now says that the required
check collects this suite like every other.

The text is #57's correction of the same paragraph, byte for byte. Copilot
raised it on #57 (r4117299033). It is taken here because the paragraph is
already false at main, so it must not land with #53. When #57 takes this
head, that hunk merges clean.

The opening paragraph ("T052 and T054 ... have not landed") stays. It is
true until T054 lands, and #57 corrects it.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 29, 2026 16:19
@brettheap brettheap changed the title DRAFT (phase 2, after T049): T050, the plain-documents fixture, spread across the six stations T050, the plain-documents fixture, spread across the six stations Sep 29, 2026

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.

Copilot review overview

🟡 Changes recommended

Address the unresolved moderate test gaps around non-empty metadata and complete topic derivation assertions.

Review effort: Lite
Findings: 1 Medium severity

Open (1)

Comment thread tests/test_plain_documents_fixture.py Resolved
… phrase

Copilot at 521de95 (r4135803935) is right. The case showed only that the
source outside the rain-barrel pair lacks the literal phrase. A later
fixture edit could give the sources another topic in common and still pass,
which defeats the guarantee the case exists for.

The case now compares the two things a topic that sources share can be
derived from when nobody declares one (R1Q13 (a) with (c)): the words of
each document's name, and the other documents each one names.
- Each rain-barrel note's name carries the pair's topic.
- The source outside the pair shares no name word with either note. Only
  the article and conjunction in FUNCTION_WORDS are dropped.
- No document on either side names one on the other, by title or by file
  name.

It needs no projection, because T054 is not in this tree. T054's projection
test proves the grouping itself over this fixture.

The new case goes red on three plants, and the old one passes all three:
- a shared name word ("garden" in both titles), which is Copilot's scenario;
- the unrelated note naming a pair member by its file name;
- a pair member naming the unrelated note by its title.
The real fixture passes, with 20 cases, so the triple does not move.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 29, 2026 16:27

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.

Copilot review overview

🟡 Changes recommended

The tests do not fully guard against shared third-document topics or enforce the intended source declaration and count.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Comment thread tests/test_plain_documents_fixture.py Resolved
…s shape

Copilot at 7028f61 (r4135883800) is right. Comparing name words and
direct naming misses a topic two sources share through a third document:
if both name the same other document, both inherit its name words.

The case now derives each source's whole topic set: the words of its name,
plus the name words of every other fixture document it names, whatever that
document's station. Then it compares whole sets. That catches a common name
word, one source naming the other, and both naming the same third document.
Only "the" and "and" are dropped, so the comparison is stricter than a
topic rule with a longer stop list, never looser.

The review's overview also asked that the intended source declaration and
count be enforced. The module docstring states both, so the cases now hold
them:
- no document declares `stage: source`, because a source here is a
  document that declares nothing (R1Q13 (a) with (c));
- there are three sources, two of which share "rain barrel".

Six plants each turn the cases red:
- a shared name word;
- the unrelated note naming a pair member;
- a pair member naming the unrelated note;
- both naming grouping-compost-corner.md (the review's scenario);
- `stage: source` on the unrelated note;
- a fourth source.
7028f61's cases pass the third-document plant and the fourth source.
Still 20 cases, all passing, so the triple does not move.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 29, 2026 16:33
@sonarqubecloud

Copy link
Copy Markdown

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.

Copilot review overview

🔵 Needs a closer look

Topic-isolation checks must mirror the projection’s declared-topic and heading/filename fallback behavior.

Review effort: Lite
Findings: None

Resolved since last review (1)

@brettheap
brettheap marked this pull request as ready for review September 29, 2026 16:38
@brettheap

Copy link
Copy Markdown
Contributor Author

READY at 4ba410f — Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

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

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 23 hours and 59 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@brettheap
brettheap merged commit dc3765d into main Sep 29, 2026
4 checks passed
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

LANDED — lane openxfactory-4, 2026-09-29T16:40:13Z, PR #53 → dc3765d (opensoft/openDox-code main; plain gate)

Brett: land the phase 1 PRs when green

brettheap added a commit that referenced this pull request Sep 29, 2026
T051 is After: T050, T053. T050 has landed as dc3765d, and this merge
keeps the branch current with it. It adds only #53's files, and touches
none of this branch's three files. T053 (openDox-spec#16) has not landed
yet, so this PR stays a draft.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 29, 2026
Phase 1 has closed (T049, openxFactory#1204 -> 9d2e5bc3), and T050 has
landed on main as dc3765d. This merge keeps T052's branch current. It
adds only #53's fixture and its test, which this branch does not touch.
T052 is After: T049, T009, T053, and T053 (openDox-spec#16) has not landed
yet, so this PR stays a draft.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 29, 2026
) into T054's branch

#53 moved after T049 landed:
- 8defc37 merges main 2d11641, which this branch already carries;
- 521de95 replaces the stale "not yet wired" paragraph with this branch's
  own text, byte for byte, so that hunk merges clean;
- 7028f61 and 4ba410f make the unrelated source share no derived topic
  with the rain-barrel pair (Copilot r4135803935, r4135883800), and pin the
  fixture's three sources and their undeclared stage.
When #53 lands by squash, this branch must carry its final head, so that
the add/add conflict in tests/test_plain_documents_fixture.py resolves to
this branch's side.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 29, 2026
#53 landed by squash as dc3765d. Its tree equals #53's final head 4ba410f
(e82fab7), which this branch already carries.

The one conflict is add/add, in tests/test_plain_documents_fixture.py. Both
sides added the file: main has T050's text, and this branch has T050's text
plus T054's three docstring corrections, where T054 makes the old
"T052 and T054 ... have not landed" wording false. It is resolved to this
branch's side. Checked: `git diff dc3765d -- <file>` after the merge is
byte-identical to `git diff 4ba410f <pre-merge head> -- <file>`, so nothing
of #53's landed file is lost. Every other #53 file merged with no conflict.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 29, 2026
…tion 8e7da4a) into T057's branch

#57 is this PR's base, and it moved after T049 landed:
- it merged #54's final head (2f515c5), #53's (4ba410f) and #56's
  (44dcc3a);
- it merged main dc3765d, where #53 (T050) landed;
- 8e7da4a is the holder's scaffold decision (openDox's own scaffold carries
  NEUTRAL_FIELDS), with its four tests, plus the no-group assertion owed to
  #53's review.
None of those files is one this branch edits. This merge keeps T057's
branch on its base's head, so its checks run against what #57 will land.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 29, 2026
…tion 8e7da4a) into T055's branch

T055 is After: T054, T057. This branch was cut on #57 at 5a6fe63, and #57
moved after T049 landed:
- it merged #54's final head (2f515c5), #53's (4ba410f), #56's (44dcc3a)
  and main dc3765d, where #53 (T050) landed;
- 8e7da4a is the holder's scaffold decision: openDox's own scaffold carries
  NEUTRAL_FIELDS. That is the mismatch this PR's review raised on #57's
  line (r4126022820) and left to #57.
#58 (T057) is still NOT merged here (the holder, 2026-09-28): the
validator stand-in stays until T058 wires opendox.validator.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 29, 2026
Plan 034, task **T051**, slice P2-F (fixtures). Plan read at opensoft/openxFactory `main` `133e37d9` (`specs/034-opendox-standalone-operation/tasks.md` § "Phase 2 writer slices"), and re-read at `main` `9d2e5bc3`: T051's entry is unchanged. Authored ahead under the phase-2 draft-ahead ruling (`openxFactory#656` comment `5857365170`).

**T049 has landed** (openxFactory#1204 → `9d2e5bc3`), so phase 2 is open. T051 is `After: T050, T053`, and **both have landed**: #53 (T050) → `dc3765dd`, and openDox-spec#16 (T053) → `f7ee3c76`. The landed `contracts/schemas/opendox-snapshot.schema.yaml` is byte for byte the file at `cd49eb25` that this fixture was built against (sha256 `f9e3e111…`), so the fixture and `EXPECTED_RULE` stand as written. This PR stays a draft until the holder un-drafts it.

Claim: `openxFactory#656` comment [`5857512479`](opensoft/openXfactory#656 (comment)) (P2-F, both T050 and T051). Held on opening until T053 (P2-S) was readable; the coordinator confirmed it as **`openDox-spec#16` at `cd49eb25`** (32 rules) and directed the exact rule to violate.

## What this realizes

Box **7.0** — `tests/fixtures/malformed`: exactly one violation of a rule of the neutral snapshot schema T053 adds (R1Q12 (a)), and an `EXPECTED_RULE` file holding that rule's identifier.

Read `openDox-spec#16`'s schema (`contracts/schemas/opendox-snapshot.schema.yaml`) and its own examples directly rather than guessing:

- `documents[].title` and `documents[].summary` are each `"type": ["string", "null"], "minLength": 1`, under `x-rule: title-and-summary-are-text` — *"A document's title and summary are each non-empty text, or null."* openDox-spec's own `opendox-snapshot-no-front-matter.example.yaml` (VALID) shows `title: null, summary: null` for a document with no declared front matter at all; its `negative/opendox-snapshot-title-and-summary-are-text.negative.yaml` (INVALID) is that same shape with one document's `title` changed to `""` — an empty string is the one value that is neither `null` nor non-empty text.
- The holder's decision: T054 (the neutral projection, not yet built) will copy a document's declared `title`/`summary` **verbatim**, never coercing an empty declared value to `null` and never excluding the document because of it — so a plain document whose `title:` header line is present-but-empty carries that exact defect through into the generated snapshot.

This fixture realizes that at the plain-repository level, the only level T051 owns (T054/T057's projection and validator do not exist yet — this PR adds no code, only fixture data + the sentinel file, matching T050's footing before it):

- `tests/fixtures/malformed/notes-bee-boxes.md` — an ordinary, fully valid source document (non-empty `title:` and `summary:`).
- `tests/fixtures/malformed/notes-empty-title.md` — `title:` declared with nothing after the colon (present in the header, empty string once parsed) and an ordinary, valid `summary:`. Exactly one property on exactly one document is wrong; verified by hand-parsing both files with the same `Name: value`-up-to-blank-line convention `LocalGitCorpus._header_of` and T050's fixture use:

```
$ python3 -c "
from pathlib import Path
for name in ['notes-bee-boxes.md', 'notes-empty-title.md']:
    text = Path('tests/fixtures/malformed', name).read_text()
    lines = text.splitlines(); header = {}
    for line in lines:
        if not line.strip(): break
        n, sep, v = line.partition(':')
        if sep: header[n.strip()] = v.strip()
    print(name, '->', header)
"
notes-bee-boxes.md -> {'title': 'Setting up two new bee boxes', 'summary': 'Where the new hives will go, and how far from the path.'}
notes-empty-title.md -> {'title': '', 'summary': 'A short summary is here; only the title line is declared and left empty.'}
```
- `tests/fixtures/malformed/EXPECTED_RULE` — one line, `title-and-summary-are-text`, the holder-directed rule identifier verbatim.

No banned vocabulary either (not this task's own falsifier, but checked against T050's word lists for consistency — zero hits in both `.md` files).

## Falsifier

T051's task line names none of its own: **"Falsifier: used by F7.2"** (a later, not-yet-built falsifier — `tests/test_plain_documents_fixture.py`-style coverage does not apply here). This PR is fixture-only, on the same footing T050 was before it.

## The repo's own suite, unaffected

Only new files under `tests/fixtures/malformed/` are added, and nothing existing changed. This branch is current with `main` `2d116415` (T037, #55), merged as `44dcc3a` after T049 landed. Since T036 (#52) the whole suite runs as one `validate` job, with no explicit file list. New fixture data under `tests/fixtures/` is not collected by pytest (it carries no `test_*.py`), so `validate`'s "Pin the triple" step reads `main`'s triple here. Since T037 its floors are `MIN_SELECTED=2476` and `MIN_PASSED=2465`, with `EXPECT_SKIPPED==11`. The triple it reads at this branch's head is in its PR checks.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

🤖 Generated with [Claude Code](https://claude.com/claude-code)


Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 30, 2026
**Authored ahead, as a phase-2 draft.** Brett ruled on openxFactory#656, comment `5857365170` ("Start phase 2's independent tasks"), that phase-2 tasks are authored as drafts. **T049 has landed** (openxFactory#1204 → `9d2e5bc3`), so phase 2 is open. T054 is `After: T050, T052, T053`:
- T050 has landed, as `dc3765dd` (#53);
- T052 has landed, as `fa8862cc` (#54);
- T053 has landed, as openDox-spec `f7ee3c76` (#16), and the openDox root pins it (opensoft/openDox#14).

#56 (T051), which this branch also carried, has landed as `86647320`. This PR stays a draft until the holder un-drafts it.

This is plan 034's **T054 (5.1–5.3: openDox's small neutral projection)**, phase-2 slice **P2-P**. I read the plan at openxFactory `main` `d90df42d` (`specs/034-opendox-standalone-operation/tasks.md`), and re-read it at `9d2e5bc3`: T054's entry is unchanged. The slice is claimed on openxFactory#656, comment `5859496321`.

## What this branch carries

- It is **built on #54's branch**, `build/034-p2g-t052-generator-seam` (T052, the generator seam). It was cut at `4ca45d27`, and it now carries #54's final head, `2f515c57`. T054 replaces that seam's placeholder default with the projection.
- **#53 (T050) has landed as `dc3765dd`.** Its tree equals #53's final head, `4ba410ff`, which this branch had merged first. So `main`'s merge (`d97a4aa`) had one add/add conflict, in `tests/test_plain_documents_fixture.py`, resolved to this branch's side. That file differs from `dc3765dd` by T054's three docstring corrections and nothing else. `git diff dc3765d -- <file>` after the merge is byte-identical to `git diff 4ba410f <pre-merge head> -- <file>`.
- **#56 (T051)** is merged at `44dcc3a1`. It adds `tests/fixtures/malformed`, which the holder's T051 rule reads.
- **#56 and #54 have landed** (`86647320`, `fa8862cc`), and `main` `fa8862cc` is merged here as `1a603677`. Its two add/add conflicts, `src/opendox/default_generator.py` and `tests/test_generator_seam.py`, are resolved to this branch's side: in each, main's blob is #54's final blob, so `git diff fa8862c <pre-merge head> -- <file>` equals `git diff 2f515c5 <pre-merge head> -- <file>`. The merged tree is the pre-merge head's, `45ddf9ec`.
- So the diff against `main` is now T054's alone: its commits `25fe7526` through `5a6fe637`, `8e7da4a`, `03e06ccd`, `50b0d42b` and `d7954fc6` (below).

## What it builds

`src/opendox/neutral_projection.py` is new code over `CorpusAdapter`, written to openDox's own needs. It is not openXdox's generator re-expressed, and it imports nothing of openXdox's or openxFactory's.

`default_generator.generate()` keeps its signature. It resolves the home corpus through the home-corpus seam and projects it. Standalone, that corpus is T022's `WorkingTreeCorpus`, a `LocalGitCorpus` (5.2). `NeutralProjectionNotBuilt` and its refusal case in `tests/test_generator_seam.py` are retired, as the brief asks.

The projection writes T053's neutral snapshot, `opendox-snapshot`. The rules it follows:

- **What is a document.** A document is an entry the adapter lists AND classifies.
  - An entry it cannot classify, such as a `Makefile` or an image, is left out unread (holder ruling).
  - An entry whose path the schema's `path-is-repo-relative` rule cannot carry is also left out, and it is reported. Examples are a backslash or a control character in the name.
- **Where a document lands (R1Q13 (a) with (c)).**
  - The station is the one its neutral `stage:` key names. That key is the first line of the leading `Name: value` block. `local_git_adapter.leading_header` reads the block, and it is the same reader the default adapter's `classify` uses.
  - A document that declares no `stage:` is a source.
  - A value outside the six role keys is not a declaration. That includes the empty value and another casing such as `Grouping`. The generator reads the document as a source and reports it on standard error. For example: `notice: grouping-compost-corner.md: its stage: value 'shelved' is not one of the six station role keys (source, grouping, candidate, selection, submission, completion), so it is not a declaration; the document is read as a source`.
- **`title` and `summary`** are copied exactly as the header gives them, the empty value included. They are `null` only where the key is absent. Nothing is coerced, and no document is dropped for lacking them. This is the holder's rule on T051.
- **The topic rule** (named here, as the task asks). A document with a `topics:` header carries exactly the topics it lists: split on commas, whitespace collapsed, and case-folded. It carries none where the header lists none, because an empty header is still a declaration. A document without the header carries:
  - the **words of its name**, where the name is its `title:`, else its first `#` heading, else its file name without the suffix;
  - plus the **words of the name of every other document it mentions**, where mentioning means its text holds that document's name, or its file name, as a run of whole words.
  - A word is a run of three or more letters, case-folded, that is not in `STOPWORDS`. Letters and digits are split apart, so `Q3planning` holds the word `planning`. So the rule needs no front matter at all.
- **Groups.** A group forms wherever **two or more sources share a topic**, and topics shared by the same sources form one group, named `a · b`. A document that declares `stage: grouping` is a group of its own: it gathers itself and every source that shares one of its topics. Each group has **one edge per member document**, naming the topics that matched.
- **The other stations.**
  - A declared candidate is `unselected`. It is claimed by each group it shares a topic with, and its `claim` is its summary.
  - A declared selection is a `staged_topics` entry.
  - A declared submission or completion is a `changes` entry, `active` or `archived`.
  - Each of these lists the document as its file. Ids are unique within each section.
- **`keyword_index`** is written, and it counts exactly the documents that carry each topic.
- **The anchors.**
  - `source_revision` is the revision the caller pins, else the corpus HEAD (holder ruling 5). With neither, `ProjectionRefused`, a `GeneratorSeamError`, is raised.
  - `generated_at` is the caller's value, else that revision's own committer date. It is looked up only for a revision spelled as a hexadecimal object id, so git never reads a revision as an option. Nothing reads the clock.
  - A pin labels the snapshot; it does not choose the bytes. The content is the working tree's, as openXdox's governed generator also records a supplied revision and scans the tree it is handed.

It also changes these files:
- **`display_profile.py`, in one place (batch G's 5.3).** `SNAPSHOT_VALUES`' defaults become the neutral snapshot's values:
  - `document_stage`: `captured` is `source`, and `organized` is `grouping` (holder ruling 1);
  - `register_state`: `unselected`, `selected`, `declined` and `replaced`, which are `NEUTRAL_DISPLAY`'s own candidate words, role for role, so no word is re-authored.
  - `display.js`'s mirror moves with it and keeps its line count, so the web census is unchanged. The governed values move to openXdox's facet in T060 (holder ruling 4: T060's block lands before openXdox moves its openDox pin past T054).
- **The default adapter's field set (R1Q13 (a)).**
  - `local_git_adapter.NEUTRAL_FIELDS = ("title", "summary")`, and `WorkingTreeCorpus` defaults to it. `LocalGitCorpus()` still defaults to `()`.
  - The suffix branch of `classify` reports a field as missing when it is absent or empty, but only when fields are required. So `authoring.required_header_fields()` answers `("title", "summary")` through the entry point.
  - A document without those fields is still read, as a source.
- **The wheel (holder ruling 3).** The grouping tile counts a group's edges. `views/wheel-model.js` uses `tallies.document_links` where a group carries one, as the governed snapshot's groups do, and counts `document_edges` otherwise. The schema is not widened, and the file keeps its line count.

What the fixtures project to:

| repository | documents | groups |
|---|---|---|
| T050's `plain-documents` | 8, all six stations | `barrel · rain` (the two rain-barrel notes), and the declared `Compost corner ideas, gathered in one place` |
| AT-R1's repository (b), no front matter | 3 sources | `budget · roadmap` (all three notes), `meeting · notes` (two) |
| T051's `malformed` | 2 (`EXPECTED_RULE` is not a document) | none |

## After T049: openDox's own scaffold carries the small neutral field set (`8e7da4a`)

**The holder's decision of 2026-09-28.** `render_scaffold()`'s output read as missing `title` and `summary` under `NEUTRAL_FIELDS`, for two reasons: the H1 comes first, so `leading_header()` stops at the blank line after it, and its field is the capitalized `Summary:`. So standalone `agent_capture` refused a document `create` had written, and the projection lost the supplied summary. Copilot raised it on #59 as r4126022820 and reproduced it there. It is fixed here.

**What changed.**
- `authoring.SCAFFOLD_LEAD_FIELDS = ("title", "summary")`. These are the fields a scaffold can lead with, filled from the create's own input. The neutral title drops the family suffix, which stays on the H1.
- `render_scaffold(..., lead_fields=())` writes those fields first, as `name: value` lines, then a blank line, then the governed block unchanged. It refuses a field it has no value for. With `()`, the default, its output is byte-identical to before.
- `create_scaffold()` passes `scaffold_lead_fields()`: the fields of `SCAFFOLD_LEAD_FIELDS` that `required_header_fields()` answers. Under openDox's own default adapter, that is both.

**Why it follows the corpus rather than always leading.** openxFactory's gated create and openXdox's authoring suite pin the governed layout with the H1 on the first line:
- `tests/ideation-dashboard/test_gate_routes.py::test_create_document_lands_the_scaffold_and_the_record` asserts `text.startswith("# Lens launch session — Brainstorm\n")`;
- `tests/test_authoring_agent.py` asserts the same for its own title.

openxFactory's adapter obliges only the governed block's own fields (`Status`, `Kind`, `Summary`, …), which it reads over a 15-line window (`STATUS_SCAN_LINES`). So there the answer is `()`, and the created bytes do not change. That adapter's readers (`classify`, `ideation_readiness._parse_header`, `families._h1`) would read a scaffold with the lead block correctly anyway, since they scan the window and `_FIELD_RE` needs a capital letter. The lead is still left out there, because those pins hold the exact bytes.

**One behaviour change.** `create_scaffold` asks the corpus as `agent_capture` does, so with no home registered it now refuses (`CorpusRefused`, `ADAPTER_NOT_REGISTERED`), naming the seam (4.2). Every create path runs after an entry point registers one. No running test in openDox-code, openXdox-code or openxFactory calls it in a bare process. openXdox's `tests/test_authoring_agent.py` does, but it is in openXdox-code's declared exclusion (`doc_health`), so it runs nowhere today. Its `agent_capture` cases already need a registered home, through `missing_required_headers`.

**Also in `8e7da4a`, the half of openDox-code#53's review that needs T054's rule.** T054's falsifier case now also asserts that `notes-toolshed-inventory.md`, the source outside the rain-barrel pair, lands in no group. T050's own test pins what the topics are derived from, and this pins the projection's reading of them.

**Tests** (`tests/test_neutral_projection.py`, 25 → 29 cases):
- `test_openDoxs_own_scaffold_carries_the_small_neutral_field_set`: under openDox's default, `leading_header()` of the created text is exactly `{title, summary}` and `missing_required_headers()` is `[]`. `agent_capture` accepts the same text, and the projection keeps both documents' title and summary.
- `test_a_scaffold_keeps_the_governed_layout_where_the_corpus_obliges_neither`: under a corpus that obliges the governed fields, `scaffold_lead_fields() == ()`, and the created bytes equal `render_scaffold()`'s default, H1 first.
- `test_the_lead_block_is_the_neutral_fields_in_order_then_a_blank_line`: the order is `SCAFFOLD_LEAD_FIELDS`' whatever the request's, the suffix is dropped, an unknown field is refused, and `NEUTRAL_FIELDS ⊆ SCAFFOLD_LEAD_FIELDS`.
- `test_a_scaffold_with_no_corpus_registered_refuses_and_writes_nothing`.

**Mutations: 8 of 8 killed.**

| mutant | cases red |
|---|---|
| `create_scaffold` passes no lead | 2 |
| `render_scaffold` always leads with both | 3 |
| the neutral title keeps the suffix | 1 |
| the lead is chosen without asking the corpus | 2 |
| an unregistered corpus is read as obliging nothing | 1 |
| the lead order follows the request | 1 |
| an unknown lead field is ignored | 1 |
| the projection keeps its stopwords (a group `the` then absorbs the toolshed note) | 1, the new no-group assertion; the pre-change case passes it |

**The whole suite at `8e7da4a`**, as CI runs it (`CI=true`, `LANG=C.UTF-8`, PostgreSQL 16, `-e ".[runtime,test]"` under the lock):
- `2587 passed, 11 skipped`, triple `selected=2598 passed=2587 skipped=11`;
- that is +9 over `5a6fe637`'s 2589: #54's review rounds after `4ca45d27` added 5 seam cases, and this change adds 4;
- F4.1's scan (`scan_deferred_reaches.py`, sha256 `fe116203…`) is 19 before and after, with the same reaches.

## The falsifier

From T054's entry in tasks.md:

> **Falsifier**: an in-process test that the projection over T050's fixture, with neither sibling importable, validates against T053's schema and carries none of F5.3's declared words; the topic-rule test over a copy of repository (b); and a test that a `stage:` value outside the six is reported and read as a source.

All three are in `tests/test_neutral_projection.py`, first, in that order:

- The first runs in a fresh process with `openxdox`, `ideation_dashboard`, `doc_health` and `corpus_adapter_openxfactory` blocked. The process asserts each one fails to import. `cli.build_parser()` registers openDox's own defaults, and the process generates through `generator_seam.generate()` over a fresh git repository of T050's fixture.
- The schema is `tests/fixtures/opendox-snapshot.schema.yaml`. It is a byte-identical copy of openDox-spec#16's file at `cd49eb25`, held to its sha256 `f9e3e111…584a`, until T057 ships the packaged copy.
- The evaluator ports openDox-spec's own: the keywords the contract uses and its seven reference rules. The leg installs no `jsonschema`.

Python 3.12.3, pytest 8.4.2, in a venv installed with `-c constraints-cpython312-linux.txt -e ".[runtime,test]"`:

```text
test_the_schema_copy_is_openDox_specs_contract_and_matches_the_product PASSED
test_the_projection_over_the_plain_documents_fixture_is_a_neutral_snapshot PASSED
test_the_topic_rule_groups_repository_b_which_has_no_front_matter PASSED
test_a_stage_value_outside_the_six_is_reported_and_read_as_a_source[shelved] PASSED
test_a_stage_value_outside_the_six_is_reported_and_read_as_a_source[Grouping] PASSED
test_a_stage_value_outside_the_six_is_reported_and_read_as_a_source[] PASSED
test_the_malformed_fixture_keeps_its_one_violation PASSED
test_title_and_summary_are_copied_exactly_and_null_only_when_absent PASSED
test_an_entry_the_adapter_cannot_classify_is_not_a_document PASSED
test_a_path_the_schema_cannot_carry_is_left_out_and_reported[back\\slash.md-backslash] PASSED
test_a_path_the_schema_cannot_carry_is_left_out_and_reported[tab\tin-name.md-control character] PASSED
test_declared_topics_replace_the_derived_ones PASSED
test_an_empty_topics_header_declares_no_topic PASSED
test_a_word_is_a_run_of_letters_even_beside_digits PASSED
test_a_declared_group_gathers_the_sources_that_share_its_topics PASSED
test_a_declared_group_with_no_topic_forms_no_group_and_is_reported PASSED
test_station_ids_are_unique_within_a_section PASSED
test_the_anchors_come_from_the_source_revision_and_the_bytes_repeat PASSED
test_a_repository_with_no_commit_needs_a_pinned_revision PASSED
test_the_default_adapter_obliges_the_small_neutral_field_set PASSED
test_required_header_fields_answers_the_neutral_set_through_the_entry_point PASSED
test_the_header_reader_keeps_an_empty_value_and_stops_at_a_blank_line PASSED
test_the_display_defaults_are_the_neutral_snapshots_values PASSED
test_the_wheel_counts_a_groups_edges_where_it_carries_no_tally PASSED
test_the_projection_imports_with_no_sibling_and_no_third_party_module PASSED
25 passed in 5.26s
```

The file also passes under `--noconftest`. F5.3 itself runs `python -m opendox.cli generate`, whose verb reaches the consumer's generator until T055 routes it (`cli.py:90`). So T056 and T063 quote F5.3, and T056 tests the verb's own report of a `stage:` value outside the six.

**Cross-checks.** The snapshots were checked outside this suite in two ways: with `jsonschema` 4.26.0 (Draft 2020-12, format checker and `rfc3339-validator` installed), and with openDox-spec's own `tests/test_opendox_snapshot_contract.py` evaluator. Both agree:
- T050's snapshot has no error, and neither does repository (b)'s;
- T051's has exactly one, `title-and-summary-are-text` at `/documents/1/title`.

## The repository's own checks

- **The whole suite, against a `postgres:16` container** (CI's service and DSN shape), so the database-backed cases run:

  | run | passed | skipped |
  |---|---|---|
  | base `b1946db` (the branch before T054's commits) | 2554 | 11 |
  | head `5a6fe637` | 2578 | 11 |

  The test-by-test JUnit diff has **25 added** (all of `tests/test_neutral_projection.py`, all passing) and **1 removed** (the retired `test_openDoxs_own_generator_refuses_until_its_projection_lands`). **0** outcomes changed.
- **The triple pin** reads: selected 2589 (floor 2476), passed 2578 (floor 2465), skipped 11 (pinned exactly 11).
- **F4.1's scan** (`scan_deferred_reaches.py` over `src/opendox`) finds 19 deferred reaches at `main` and 19 at head. The only difference is line numbers, so T054 adds no reach. The projection imports with every sibling blocked and pulls in no third-party module.
- **Mutations: 18 of 18 killed.**
  - Coerce an empty title to null.
  - Drop the out-of-six notice.
  - Admit any `stage:` value.
  - Map `organized` to `selection`.
  - Turn off mention scanning.
  - List unclassifiable entries.
  - Carry any path.
  - Miscount `keyword_index`.
  - Let a declared group gather non-sources.
  - Read `generated_at` from the clock.
  - Make the default adapter oblige nothing.
  - Count an empty field as present.
  - Make the wheel ignore edges.
  - Start candidates `selected`.
  - Let one source form a group.
  - Ignore the heading for a document's name.
  - Treat an empty `topics:` header as absent.
  - Drop a letter run that sits beside a digit.
- **`tests/test_display_facet.py`: four node-harness cases edited.** Their fixtures carried the governed snapshot values:
  - the partial-override collision;
  - the board's stripe classes;
  - the explorer's stage word;
  - the funnel's search haystack.

  Each now reads the value openDox ships (`SNAPSHOT_VALUES`), and each still tests what it tested. The canvas case's neutral assertion now compares against openDox's own word instead of a value the neutral install can never write.

The PR stays out of `conftest.py`, `pyproject.toml`, `validate.yml`, `README.md` and every pin, and it edits neither `cli.py` nor `serve.py` (T055's single-writer chains).

## Files (T054's own commits)

| file | change |
|---|---|
| `src/opendox/neutral_projection.py` | new: the projection |
| `src/opendox/default_generator.py` | `generate()` projects the home corpus; `NeutralProjectionNotBuilt` is retired |
| `src/opendox/display_profile.py` | `SNAPSHOT_VALUES`' defaults become the neutral values |
| `src/opendox/web/views/display.js` | the mirror of the same defaults (line count unchanged) |
| `src/opendox/web/views/wheel-model.js` | the grouping tile counts edges where no tally exists (line count unchanged) |
| `src/opendox/runtime/local_git_adapter.py` | `leading_header()` made public, `NEUTRAL_FIELDS` added, `WorkingTreeCorpus`'s default field set, missing fields reported in the suffix branch |
| `src/opendox/authoring.py` | `8e7da4a`: `SCAFFOLD_LEAD_FIELDS`, `render_scaffold(lead_fields=)`, `scaffold_lead_fields()`, and `create_scaffold` leading with what the corpus obliges |
| `tests/test_neutral_projection.py` | new: 25 cases, then 29 at `8e7da4a` |
| `tests/fixtures/opendox-snapshot.schema.yaml` | new: T053's schema, digest-pinned |
| `tests/test_generator_seam.py` | the refusal case retired, and its docstring point updated |
| `tests/test_display_facet.py` | four fixtures read the shipped values; one assertion made positive |
| `tests/test_plain_documents_fixture.py` | T050's docstring (merged from #53) says what is true once T054 and T036 are in |

## CI and review rounds

- **CI at `0f42f678` failed one case, and `b2f92226` repairs the test.** The case was `test_the_anchors_come_from_the_source_revision_and_the_bytes_repeat`.
  - CI's git prints `%cI` for a zero offset as `2026-09-27T12:00:00Z`, and git 2.43.0 prints `2026-09-27T12:00:00+00:00`.
  - The projection records the stamp exactly as git spells it, and the schema admits both spellings.
  - The test compared the stamp to the fixture's date as a string. It now compares them as instants. Its first assertion still holds `generated_at` to the checkout's own `git show` output.
- **Copilot at `0f42f678`: three threads, all taken in `c0747e96`, answered and resolved.**
  - `r4117298988`: an empty `topics:` header fell back to derived topics, which contradicted the rule the module states. It is now a declaration that carries no topic. The new case is `test_an_empty_topics_header_declares_no_topic`, and it fails under the old rule.
  - `r4117299013` and `r4117299033`: T050's test docstring said T054 had not landed, which T054 makes false. It also said the suite ran outside `validate`'s explicit list, which has been false since T036 (#52). It now says what is true. Only the docstring changes.
- **Copilot at `c0747e96`: one thread, answered and resolved, plus one overview remark taken in `5a6fe637`.**
  - `r4117331489` asked that a supplied `source_revision` be passed into the `CorpusRef`. That is not taken, on the product's own contract:
    - the seam and the CLI define the value as an anchor to pin, and openXdox's governed generator records it and scans the tree it is handed;
    - the holder ruled that content comes from the working tree, per Brett's T022 ruling.
    - `default_generator`'s docstring now states the rule in its own paragraph.
  - The overview's remark that digit-adjacent names were tokenized wrongly was right. Letter runs and digit runs are now separate tokens, as the docstring's "a run of three or more letters" says. The new case is `test_a_word_is_a_run_of_letters_even_beside_digits`, and it fails under the old tokenizer.
  - The same overview says the seam's "replacement-generator tracking can reject valid registrations". That is `generator_seam.py`, which is #54's (T052's) code, with no thread here. It is flagged to the holder, not changed here.
- **Copilot at `1a603677` (the merge of `main`): 1 thread, taken in `03e06ccd`.**
  - r4139383472: the lead block interpolated `title` and `summary` as given, so `summary="ok\nstage: completion"` wrote a line `leading_header()` reads as the document's own `stage:`.
  - `render_scaffold()` now refuses a lead value carrying a control character (`Cc`) or a line or paragraph separator (`Zl`, `Zp`), before anything is rendered, so `create_scaffold` writes nothing. With no lead block nothing new is refused.
  - `test_a_lead_value_that_is_not_one_header_line_is_refused`: 20 cases, all red against `1a603677`. Local whole suite: `selected=2618 passed=2607 skipped=11`.
- **Copilot at `03e06ccd`: 2 threads, both taken in `50b0d42b`.**
  - r4139523226: the `kind_field` vocabulary counted a field with an empty value as present. `_classify_by_header` now uses the suffix path's test, so an empty value is no field in both. `test_an_empty_field_is_missing_whichever_vocabulary_is_in_force`, red against `03e06ccd`.
  - r4139523258: `_commit_date` ran a bare `git`. `LocalGitCorpus` exposes its `executable`, and the date is read with the home corpus's own git. `test_the_commit_date_is_read_by_the_home_corpus_s_own_git`, red against `03e06ccd`.
- **Copilot at `50b0d42b`: 2 threads.**
  - r4139607560, taken in `d7954fc6`: a `DocumentId.key` is opaque to the adapter interface, and the projection read every key as a path. An adapter now declares `document_keys_are_paths = True` (`neutral_projection.PATH_KEYS`), `LocalGitCorpus` does, and `project()` refuses any other with `ProjectionRefused`. `test_an_adapter_whose_keys_are_not_declared_paths_is_refused`, red against `50b0d42b`.
  - r4139607585, not taken: it does not reproduce. A path reaches the invalid-stage notice only after `_unwritable()` refuses every control character, so such a path is named by its `repr` and left out first.
- **Copilot at `d7954fc6`: "Needs a closer look", no findings, 0 threads.** CI is green, with `selected=2621 passed=2610 skipped=11 failures=0 errors=0`.

## What the later tasks need

- **T055** (`cli.py`/`serve.py` single writer):
  - The scaffold mismatch #59 raised (r4126022820) is fixed here, in `8e7da4a`. #59 takes it with this branch's head.
  - Route the generate verbs through `generator_seam.generate()`.
  - `_default_home_factory`'s docstring in `cli.py` (around line 877) and `serve.py` (around line 1520) still says the default adapter has bare defaults and that "T054 sets the neutral fields". `WorkingTreeCorpus()` now carries `NEUTRAL_FIELDS`, so that sentence needs correcting.
  - `_report` prints `project=` from a field that the neutral kind does not have. It reads the field with `.get`, so it shows `<ungrouped>`.
- **T056**:
  - The verb's report of a `stage:` value outside the six is the `notice:` line that `default_generator.generate()` writes to standard error. Once T055 routes the verb, it needs no further plumbing.
  - The F5.3 sweep over T050's snapshot is clean in process.
- **T057**: this PR's schema copy is replaced by the packaged copy once T057 ships it.
- **T058**: the malformed fixture yields exactly one violation, `title-and-summary-are-text` at `/documents/1/title`, and `EXPECTED_RULE` is not a document.
- **T060**: the governed `values` block, as T053's writer listed it.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

🤖 Generated with [Claude Code](https://claude.com/claude-code)


Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 30, 2026
…) (plan 034) (#58)

Plan 034 (`specs/034-opendox-standalone-operation/tasks.md`, read at openxFactory `main` `6b97c601`), phase-2 slice **P2-V**, its one task: **T057** (#1144's 7.1, 7.1a, 7.1b and 7.2, with 7.1 as T007's batch G amends it). Claimed on openxFactory#656 in `5873510118`.

**Authored ahead, as a phase-2 draft** (Brett 2026-09-27: "Start phase 2's independent tasks"). **T049 has landed** (openxFactory#1204 → `9d2e5bc3`), so phase 2 is open. Both steps it waited on are done:
- **T053 has landed**: openDox-spec#16 → `f7ee3c76`;
- **the openDox root pins that commit**: opensoft/openDox#14 (dox-v1.1) → `52005213`. `e94ab323` moves the record and `SPEC_COMMIT` to it (below).

#57 (T054) has landed too, as `a691e4e4`, and `main` is merged here. This PR stays a draft until the holder un-drafts it.

- **Ruled**: R1Q22 (a), `5817152735`; R1Q12 (a), `5850003126`.
- **After**: T049, T009, T053.

## The stack

This PR was **stacked on #57** (T054), and is now based on `main`: it was retargeted before #57 landed, and #57 landed as `a691e4e4`. The diff below is T057's alone. #57's head `8e7da4a2` was merged here as `27bcefc`, after T049 landed. #57 has since merged `main` `fa8862cc` as `1a603677`, which has `8e7da4a2`'s tree.

- #53 (T050), #56 (T051) and #54 (T052) have landed, as `dc3765dd`, `86647320` and `fa8862cc`. #57's branch carried their final heads' content before they landed.
- T057 needs the seam: the validator's neutral kind is held to T052's `generator_seam.NEUTRAL_SNAPSHOT_KIND`, and the in-process checks run openDox's own projection over T050's and T051's fixtures.
- **Before #57's branch is deleted at its landing, retarget this PR to `main`.** A `--delete-branch` on #57 would close this PR. Then merge `main` in.

## What it does

- **`src/opendox/contracts/`: the input set (7.1, 7.1b).** It holds the four packaged copies, which are openDox's own spec leg's four: `ideation-workbench`, `opendox-snapshot`, `xfactory-workbench-chat-turn` and `xfactory-workbench-model-catalog`.
  - Each copy is byte for byte openDox-spec's file at `f7ee3c76`, T053 as landed and the spec commit the openDox root pins. That commit carries all four. It has the tree of #16's last head, `cd49eb25`, where the copies were first taken. Its three older files are the blobs of the root's previous spec pin, `8fe8c4c7`.
  - `copies.yaml` is the record: the spec-leg commit, and each copy's path and sha256. A copy is read only after its sha256 is proved against the record. A changed, absent or unpinned copy is refused before a byte of it is parsed (`neutral-product-pin`'s rule for a vendored contract).
  - `gate-intent` and `ideation-possibles-register` are not in the set, and neither are the other four schemas of the family. A record that names any copy other than the four, or leaves one out, is refused (`COPY_IDS`), so no edit to the record lets one in.
  - The record and the four copies ship as package data, under a new `opendox.contracts` key in `pyproject.toml` (below).
- **`src/opendox/validator.py`: the validator, new surface at the code leg (7.2).**
  - It evaluates JSON Schema 2020-12, exactly the keywords the four copies use. `format: date-time` is asserted, as the consumer's validator asserts it.
  - A copy that uses a keyword, format, dialect or reference it does not evaluate is refused when its validator is built, never evaluated with that keyword left out.
  - So is a keyword holding a value of another shape, an embedded resource, a subschema that contains itself, and a reference cycle that never moves into the instance. A malformed copy is refused as unavailable, never a crash (below). An instance whose keys are not text, which YAML allows, is judged and never crashed on, and so is a value of any size or depth.
  - A refusal names its rule: `[<x-rule>] <where>: <detail>`.
  - It implements the neutral snapshot's seven reference rules. A snapshot validator is refused if the contract's catalog and the implemented rules differ.
  - `validators()` answers one validator per wire kind, with the jsonschema-shaped `iter_errors()` that the doxBench seam's readers use, built as openxFactory's `doxbench_contracts` builds its own (T085).
  - Its docstring records why the consumer's script cannot be reused (7.1a), measured at openXdox-code `4610bca5` (below).
- **`tests/test_validator_input_set.py`** is the falsifier (28 cases). **`tests/test_validator.py`** tests the evaluator (185 cases).
  - `tests/fixtures/spec-examples/` is its corpus, openDox-spec's own examples at `cd49eb25`. It holds 13 positives of three kinds (2 `opendox-snapshot`, 5 chat-turn and 6 model-catalog) and the neutral contract's 32 negatives, one per rule. All 45 are verified as the spec leg's exact blobs.
  - **The spec leg's two `ideation-workbench` examples are not carried.** This leg's committed-manifest guard (`workbench.committed_manifests`, held by `tests/test_workbench.py::test_no_workbench_manifest_is_tracked_in_this_repo`) refuses a workbench manifest tracked anywhere but the root's `examples/` and `contracts/schemas/`. CI went red on them at `97b314a` (run `36450791192`), and `69f2040` removes them.
  - The kind is held instead over the manifests openDox's own `workbench.Workbench` writes: one per seed kind, each with every member route, an exclusion, every action and a notebook binding. An override with no recorded reason is refused as `[required]` at its member. The cross-check below still covers the two examples, read from the spec leg's own tree.

No skip is added, since `EXPECT_SKIPPED` is exactly 11. It touches no `openspec/changes/` path, no `conftest.py`, no workflow, no `README.md` and no pin. Its one `pyproject.toml` change is the package-data key, on the holder's decision (below).

## The falsifier

T057's falsifier is *"the packaged-copy digest test and the 7.1b test"*. At `80b5f9e`:

```
tests/test_validator_input_set.py::test_each_packaged_copy_is_the_spec_legs_file_at_the_pinned_commit PASSED [ 50%]
tests/test_validator_input_set.py::test_gate_intent_and_the_possibles_register_are_not_in_the_set PASSED [100%]
============================== 2 passed in 0.16s ===============================
```

Both go red when they should. In a scratch clone of `ca52182` I changed one byte of the neutral copy (byte 10181, `i` to `I`) and planted a `gate-intent` copy beside the four:

```
E           AssertionError: src/opendox/contracts/schemas/opendox-snapshot.schema.yaml is b9f3074a6d7d7670289e2a6d048169550a8571820dd8dba72acf4cd52ee9b72b, and the record pins f9e3e111af1d4bd4c377c933027d81b582ae2b0a395b66f4e4621992454a584a. A copy is never edited in place
E           AssertionError: a copy of gate-intent is carried under src/opendox/contracts/schemas/, which 7.1b refuses: requirement 1 keeps it with openxFactory
FAILED tests/test_validator_input_set.py::test_each_packaged_copy_is_the_spec_legs_file_at_the_pinned_commit
FAILED tests/test_validator_input_set.py::test_gate_intent_and_the_possibles_register_are_not_in_the_set
2 failed in 0.46s
```

The two tests' assertions that went red there are unchanged since. `9d2cda1` adds one assertion to the 7.1b test: `COPY_IDS` names neither schema.

**The digest test holds each copy to the spec-leg commit the openDox root pins.** The test states the root's digests apart from the record, so a copy and its recorded digest cannot move together unseen.

- All four are the digests the root's `contracts/manifest.yaml` records at its spec pin `f7ee3c76` (the root's `main` at `52005213`, opensoft/openDox#14).
- The three older ones are unchanged from the previous spec pin, `8fe8c4c7` (the root's `main` at `663ac683`).

Read with `git show <commit>:contracts/schemas/<file> | sha256sum` in openDox-spec:

| copy | sha256 at `8fe8c4c7`, `cd49eb25` and `f7ee3c76` | the root's manifest at `52005213` |
|---|---|---|
| ideation-workbench | `d30438491119…faafc` | same |
| xfactory-workbench-chat-turn | `350bfedc0269…1dc1d` | same |
| xfactory-workbench-model-catalog | `e563cc9fc6ed…21635` | same |
| opendox-snapshot | absent at `8fe8c4c7`; `f9e3e111af1d…4a584a` at `cd49eb25` and `f7ee3c76` | same |

## The package-data line (on the holder's decision)

7.1 ships the four as **package data**. `pyproject.toml` used to package only `web/**`. On the holder's decision, this PR now carries the new key: openDox-code's phase-1 work has landed, so no phase-1 writer edits `pyproject.toml` any more. It is its own key beside the bundle's line, which `test_gate_loop_contributed` holds verbatim:

```toml
opendox = ["web/**"]
"opendox.contracts" = ["copies.yaml", "schemas/*.schema.yaml"]
```

`test_the_package_data_ships_the_record_and_every_copy` lands with it. It holds the table to the record: the patterns under `opendox.contracts` ship exactly the record and every copy the record pins. At `ca52182`, where the line landed (the test is unchanged since):

- It passes.
- With only the key line removed, it fails (`KeyError: 'opendox.contracts'`).
- With a stray schema planted under `schemas/`, it fails, because the patterns would ship a file the record does not pin.

The test parses `pyproject.toml` and builds no wheel. The install-level evidence is real wheels: each built with `pip wheel . --no-deps` from a clean clone, installed into a separate venv and probed from outside any source tree. The two module digests are the head's own files. The probe's `opendox from:` lines are left out; each showed the run importing from its venv's site-packages.

```
== wheel built from 80b5f9e
opendox/contracts/__init__.py  sha256 5b85edfe427e
opendox/contracts/copies.yaml
opendox/contracts/schemas/ideation-workbench.schema.yaml
opendox/contracts/schemas/opendox-snapshot.schema.yaml
opendox/contracts/schemas/xfactory-workbench-chat-turn.schema.yaml
opendox/contracts/schemas/xfactory-workbench-model-catalog.schema.yaml
opendox/validator.py  sha256 9e6fc2974398
kinds: ['ideation-workbench', 'opendox-snapshot', 'workbench-chat-turn-v2', 'workbench-chat-turn-v2-failure', 'workbench-chat-turn-v2-success', 'workbench-model-catalog']
six-stations: no violation
title negative: ["[title-and-summary-are-text] /documents/2/title: '' is shorter than 1"]
rc=0
```

Compared with a wheel built without the line, it adds exactly those five data files and removes nothing: 106 entries outside `dist-info` become 111, and the 41 `opendox/web/` entries are unchanged. Without the line, an installed validator refused. That was measured at `69f2040`, before the line landed:

```
== wheel without the held line
opendox/contracts/__init__.py  sha256 b264a03b6f5b
opendox/validator.py  sha256 f620194b0b4f
UNAVAILABLE: opendox.contracts has no copies.yaml: the package was built or installed without it (FileNotFoundError)
rc=3
```

Copilot's two findings, at `97b314a` and again at `69f2040`, were this line. Both threads were answered twice, with the held measurement and then with `ca52182`, and both are resolved.

## The fail-closed build (Copilot's findings at `ca52182`, `bc3470b`, `2b32cbf`, `9d2cda1` and `4474514`)

The module promises that a copy it cannot evaluate is refused when its validator is built, as `SchemaNotEvaluable` (a `ValidatorUnavailable`). Copilot's review at `ca52182` found a hole in that promise, in code unchanged since `d89f252a`: `type: {}` made `set(names)` raise `TypeError` during the build. I probed the same class with 40 malformed values. At `ca52182`:

- 5 crashed the build: `type: {}`, `type: [["string"]]`, `format: {}`, `allOf: 5`, and two non-text unknown keys (a mixed sort). A pattern with an unbounded repetition crashed it too (`OverflowError`).
- 30 built. Of those, 20 then crashed on an instance. The other 10 judged instances by a value draft 2020-12 does not allow: `uniqueItems: "yes"` read as true, `maxLength: -1` refused every string, and `maximum: nan` passed everything.
- 5 were refused.

`bc3470b`'s commit message says twenty-three of them built. The probe's count is thirty.

At `80b5f9e` all 40 are refused, and so are these:

- Every evaluated keyword's value is checked against the shape draft 2020-12's metaschema gives it (`_SHAPES`). A test holds `_SHAPES` to `KEYWORDS`, so no evaluated keyword goes unchecked.
- Every reference's target, and the kind's entry, is walked like the document. A reference can reach a node no walk of the subschemas passes, such as one inside an `enum`.
- An embedded resource (`$id` or `$schema` below the root) is refused, since it would move where its references resolve.
- A subschema that contains itself, which a YAML alias can build, is refused where it loops.
- A JSON-pointer index that is not a plain decimal (`-1`, `01`) names nothing. Python's `int()` would read another element.
- **From Copilot's review at `bc3470b`:** a reference cycle that never moves into the instance, such as `$ref: "#"` or two `$defs` that refer to each other, is refused, naming the cycle. jsonschema 4.26.0 recurses on those until Python's limit. A recursive schema that moves into the instance before it recurs, such as a tree whose children are items, is still evaluated. A copy nested deeper than Python's recursion limit is refused too.
- **From Copilot's review at `2b32cbf`:** a JSON-pointer token whose `~` is not `~0` or `~1` makes no pointer (RFC 6901). A `$ref` carrying `%` is refused as a percent-encoded fragment this module does not decode. At `2b32cbf`, `#/$defs/a%20b` read the literal key `a%20b` and passed `5`, where jsonschema decodes it to `a b` and fails `5`. The same review's record finding is under the input set above.
- **From Copilot's review at `9d2cda1`:** the record's key refusal ran `sorted()` over a record's keys, so a key that is not text raised `TypeError`. It now orders keys by their `repr`. An instance fuzz of the same class found worse at evaluation: under `additionalProperties: false`, the report ran `sorted()` over an instance's extra keys, and 115 of 3,000 odd instances crashed a validator. Those keys are ordered by `repr` too. YAML nested past Python's recursion limit escaped the three YAML reads (the record's, `contracts.load()` and `validator_for()`) as `RecursionError`, and each now refuses it.
- **From Copilot's review at `4474514`:** a bound past a float's range, such as a 400-digit YAML integer, crashed the build in `math.isfinite()`, and every int is now finite. A `const` or `enum` that contains itself is refused. On the instance side, equality was judged on nested tuples, which CPython compares recursively, so an instance value 5000 deep crashed its judgement. The canon is now text, built without recursing and compared as text, and it keeps JSON equality. A violation's detail always shows something, and PyYAML's `ValueError` (an integer past 4300 digits, an impossible date) is refused by all three YAML reads.
- `bc3470b`'s review also found that `enum: []` and `required: []` should be refused. Those two findings are not taken. Both are valid 2020-12 schemas. The metaschema gives `enum` no `minItems` and gives `required` `default: []`; the `minItems: 1` was draft-04's. jsonschema treats both as this validator does, and their threads carry the evidence.

The four copies use none of the refused forms: they have no anchors or aliases, no nested `$id` or `$schema`, only integer counts, and references only into `$defs`. All six kinds build as before. Of the 58 new cases through `2b32cbf`, 57 fail against `ca52182`'s validator and pass here. The 58th, the recursive tree, passes on both, as the guard against over-refusing. `9d2cda1`'s four new refusal cases fail against `2b32cbf`'s code, and its escape case passes on both, as the same kind of guard. `4474514`'s four new cases fail against `9d2cda1`'s code. `80b5f9e`'s six new refusal and depth cases fail against `4474514`'s code. Its canon-equality case passes on both, as the guard that JSON equality is unchanged.

## After T049: Copilot at `27bcefc0`, one thread, taken in `bf51a30a`

- **r4136329332: an instance deeper than the walk raised `RecursionError`.** A recursive schema that moves into the instance (a tree whose children are items of the node) recurs once per level of the instance, and the build accepts such a schema. Measured at `27bcefc0` with this module's own tree schema, at the default limit of 1000: 100 levels judged, and 200, 300, 400, 1000 and 5000 levels raised.
- **Now judged, not crashed on.** `KindValidator.iter_errors()` catches the `RecursionError` from the walk, once the walk's frames have unwound, and yields one violation, `[evaluation-depth] <root>: …`. Its rule, `DEPTH_RULE`, is exported. So the instance is never valid, which fails closed.
  - What the walk found before the limit stands, and the reference rules still run.
  - `violations()`, `is_valid()` and `validate()` all go through it.
  - The evaluator stays recursive, because rewriting it on an explicit stack would put the 0-disagreement cross-check at risk. A tree the walk reaches is judged as before.
- **The regression case** is `test_an_instance_deeper_than_the_walk_is_judged_not_crashed_on`.
  - A 50-level tree is valid.
  - A 5000-level one yields exactly the depth violation, at the root.
  - With a node near the top broken, both `("required", "/children/0")` and the depth violation are named.
  - Against `27bcefc0`'s validator the case raises `RecursionError`. A mutant that swallows the error silently fails it too.
- **The whole suite at `bf51a30a`:** `selected=2812 passed=2801 skipped=11`, which is +1. F4.1 reads 19.

## Copilot at `bf51a30a` ("Needs a closer look", no thread): taken in `6b68e32a`

- **"Previously missed": a bound of any size crashed the violation's detail.** `_is_bound()` admits an integer of any size, so a schema with `minimum: 10**5000` builds. But eight details (`minimum`, `maximum`, `minLength`, `maxLength`, `minItems`, `maxItems`, `minProperties`, `maxProperties`) put the bound into the text directly. So validating `0` against that schema raised `ValueError`, Python's 4300-digit limit on int-to-text, while the violation was being written.
  - Reproduced for `minimum`, `maximum` (at `-10**5000`), `minLength`, `minItems` and `minProperties`. The three max counts cannot fire at such a size.
- **Now each bound is shown through `_brief()`**, as the instance's value already was, so a huge one reads `<an int of 16610 bits>`. An ordinary bound reads exactly as before, since `_brief(5)` is `"5"`.
- **The regression case** is `test_a_violations_detail_shows_a_bound_of_any_size`, five cases, which all fail against `bf51a30a`'s validator, plus an ordinary-bound check.
- **CI at `6b68e32a`:** `validate` and SonarCloud are green, with `selected=2817 passed=2806 skipped=11 failures=0 errors=0`, which is +5.

## Copilot at `6b68e32a`: "Needs a closer look", no findings, 0 threads

- The overview's one line reads *"Require `audit_ref` whenever the `provider_retry` object is present."* It is **not taken, on the holder's ruling** (2026-09-29), and answered in [this comment](#58 (comment)). The note opened no thread.
  - `provider_retry` is in `xfactory-workbench-chat-turn.schema.yaml`, one of the four packaged copies. That copy must stay byte for byte the spec leg's file, now the file at `f7ee3c76`. Its sha256 (`350bfedc…`) is the one `copies.yaml` and the root's manifest record. Requiring `audit_ref` in the copy alone would break the falsifier this PR exists for.
  - `audit_ref` is optional by the contract (`required: [retried, at_most_once]`), and `serve_wire.py` writes it only when it has one. Making it required is a contract change for the spec leg and its owner, not for T057.

## After the root step: `e94ab323`

- **T053 landed** as openDox-spec `f7ee3c76`, a squash of #16 whose tree is `cd49eb25`'s (`7b00d19e`). **opensoft/openDox#14 moved the root's spec pin to it.** The root's `spec` gitlink and `contracts/spec-pin.yaml` name `f7ee3c76`, and its `contracts/manifest.yaml` records the four files at that commit, with the four digests above.
- **`e94ab323` moves `copies.yaml`'s `commit` and the falsifier's `SPEC_COMMIT` from `cd49eb25` to `f7ee3c76`, together**, on the holder's word. No digest moves. Each of the four copies is `cmp`-identical to the file at `f7ee3c76`. The comments that say what the root pins now say it, and `tests/test_validator.py`'s corpus note names the landed commit.
- Moving `SPEC_COMMIT` back alone fails 2 of the falsifier's 28 cases, so the two still move together or not at all.
- The whole suite at `e94ab323`: `selected=2817 passed=2806 skipped=11`, unchanged.

## After #57 landed: `1433234`, `cb40b977` and three review rounds

- **`1433234` merges #57's final head `d7954fc6`**, with no conflict. T057's own diff against it is byte-identical to its diff against `8e7da4a2`: 55 files, +6320. **`cb40b977` merges `main` `a691e4e4`**, whose tree is `d7954fc6`'s, so it adds no content.
- **Copilot at `cb40b977`: 2 threads.**
  - r4139739110, taken in `3351f6a7`: YAML builds values JSON has not (sets, bytes, dates, non-text keys, non-finite numbers), and `const`/`enum` were checked only for self-containment. `_first_non_json()` now refuses them at build. `test_a_const_or_enum_that_holds_a_value_json_has_not_is_refused`, 6 cases, red against `cb40b977`.
  - r4139739167, not taken: four documents in the six-stations example carry `water`, so its count of 4 is right, the validator finds no violation there, and the file is byte for byte openDox-spec's at `f7ee3c76`.
- **The T058 writer's measurement (openDox-code#68, r4139734412), taken in `2b8ad245`:** a packaged record or copy that is present but unreadable raised `PermissionError` out of `validator_for()`. Every `OSError` in `_read_package_file` is now a `CopyRefused`, and a missing file keeps its message. `test_a_present_file_that_cannot_be_read_is_refused_not_raised`, over the record and the snapshot copy at mode 000 (skipped as root), red against `3351f6a7`.
- **Copilot at `2b8ad245`: 3 threads.**
  - r4139823704 and r4139823779, taken in `753ffa19`: an instance key of `10**5000` has no decimal text, so a pointer beneath it, and the unexpected-properties report, raised `ValueError`. Pointer parts fall back to `_shown`, and extra keys are ordered and shown item by item (`_brief_items`). `test_an_instance_key_of_any_size_is_named_not_crashed_on`, red against `2b8ad245`.
  - r4139823750, not taken: a tuple key canonicalizes as an opaque value, and `enum` and `uniqueItems` judge it without crashing. `test_a_non_text_key_that_is_not_a_scalar_is_judged_as_itself` guards it.
- **Copilot at `753ffa19`: "Needs a closer look", no findings, 0 threads.** CI is green, with `selected=2850 passed=2839 skipped=11 failures=0 errors=0`.

## 7.1a, measured

The consumer's `scripts/validate-ideation-dashboard-contracts.py`, run at openXdox-code `4610bca5`:

```
== no CONTRACTS_DIR, one openDox snapshot example
ERROR harness failure: .../contracts/schemas carries none of the family's 10 schemas (this tree carries no contracts/ and CONTRACTS_DIR is not set; export it as the spec leg's contracts directory), so nothing can be validated and no mode may report success
rc=2
== CONTRACTS_DIR = openDox-spec's contracts (all four there), the same example
ERROR [kind] .../opendox-snapshot-six-stations.example.yaml: unrecognized document (no known kind, no 'possibles_register' section)
rc=1
```

The docstring's six reasons are: it finds its schemas from its own position; it names ten schemas of three owners; it is the consumer's file; it needs `jsonschema`, `referencing` and `rfc3339-validator`; it knows no `opendox-snapshot`; and it is a subprocess script, where openDox-code has no `scripts/`.

## Verification

- **CI at `80b5f9e`**: `validate` (run `36471401716`) and SonarCloud are green.
- **The whole suite**, locally, as CI runs it (`CI=true`, `LANG=C.UTF-8`, PostgreSQL 16, `-e ".[runtime,test]"`), at the committed head with a clean tree. The base is #57's head, `5a6fe637`: **2578 passed, 11 skipped**. At `80b5f9e` it is **2791 passed, 11 skipped**. At `27bcefc`, after #57's head `8e7da4a2` was merged in, it is **2800 passed, 11 skipped** (`selected=2811`). That is #57's own 2598 plus these 213.
  - The case-by-case junit diff shows **+213 added** (185 and 28), all passed and all in the two new files. It shows **0 removed and 0 changed outcomes**, and the same 11 skips.
  - `--noconftest` passes too (213).
  - CI was red at `97b314a` on one case: the committed-manifest guard, over the two workbench examples then carried (above). My earlier local whole-suite run had passed because it ran before those files were committed, so these runs are at the committed head.
  - `LANG=C.UTF-8` is set because CI's runner sets it. In a shell with no locale, `test_model_provider_broker::test_the_broker_child_inherits_no_credential_shaped_environment` fails at `ca52182` and here alike, because Python's C-locale coercion (PEP 538) puts `LC_CTYPE` in the broker child's environment. That is the shell, not this PR.
- The cross-check, both fuzzes, the scan and the mutation check below all ran on `80b5f9e`'s committed source.
- **Against jsonschema and the spec leg's own evaluator**, over every one of openDox-spec's 86 examples at `cd49eb25`, all kinds, positives and negatives: **0 disagreements**.
  - jsonschema 4.26.0 ran with its format checker, per kind as openxFactory builds its validators.
  - For the neutral kind, the rules found equal the spec leg's `tests/test_opendox_snapshot_contract.py` evaluator's (rule, place) exactly, and equal jsonschema's read through `error.schema`'s `x-rule`.
  - The two examples whose kind is not openDox's raise `UnknownKind`.
- **Mutation fuzz**: 12,000 seeded random edits of the positive examples, compared as (keyword, place) against jsonschema, gave **0 disagreements** beyond one deliberate divergence, met 26 times. `rfc3339-validator` anchors with `$`, so it admits `...Z` followed by a newline, and this validator refuses it. That divergence is documented in `_is_date_time`, and the snapshot contract's own patterns guard the same tail.
- **Instance fuzz**: 6,000 instances over two seeds, each a positive example with an odd value planted somewhere. The values are non-text keys, sets, timestamps, bytes, NaN and infinity, lists 5000 deep, self-containing lists and mappings, and 5000-digit ints. All six validators gave **0 crashes**, where 115 of the first seed's 3,000 crashed at `9d2cda1`.
- **Mutation check**: 77 mutations of the two new modules, each killed by the new tests (77/77), with the sources restored and verified by sha256. One mutant, the cycle search blind to its own trail, loops allocating. The run caps each mutant at 4 GiB, and that one failed there.
- **F4.1's deferred-reach scan**: 19 at the base and 19 here, with the same list. The two new modules reach nothing. With every sibling blocked, the validator imports and validates, and it adds no third-party module beyond PyYAML.

## For the later tasks

- **T058** (the post-render validator in the generate verbs):
  - call `opendox.validator.validate(snapshot, kind=<the generator's declared contract>)`, and print `validator.report(...)` on stderr;
  - `ValidatorUnavailable` is the "could not run" case, which `--strict` makes fatal;
  - T051's fixture reports `[title-and-summary-are-text] /documents/1/title`;
  - `tests/test_neutral_projection.py` should read this packaged copy (`opendox.contracts`) in place of T054's `tests/fixtures/opendox-snapshot.schema.yaml`.
- **T055** (`validate_manifest` for `ideation-workbench`):
  - This validator checks the manifest against its schema. It does not check the old script's two workbench rules (pinned ⊆ checked, the schema's own VALIDATOR RULE comment; `new_candidates` disjoint from members ∪ excluded), nor its committed-manifest guard. So routing `validate_manifest` here drops those rules unless T055 carries them.
  - `test_every_manifest_openDox_own_workbench_writes_validates` holds the manifests `workbench.Workbench` writes to pass here: every seed kind, every member route and every action, with an exclusion and a notebook binding.
- **T085** (doxBench defaults): register `opendox.validator.validators` at `serve_wire.register_doxbench_validators`. The semantic rules of the two wire kinds are still T085's.
- **T061**: nothing from T057 is needed. The consumer's three schemas stay out of this set.
- **The openDox root**:
  - its `contracts/manifest.yaml` says the code leg *"carries no `contracts/` path at all"*, which is no longer true of `src/opendox/contracts/`;
  - nothing at the root holds these copies to its spec pin, so T062's `make pins` could gain that check.

## Before READY (not this PR's act)

1. ~~T049 lands.~~ Done: openxFactory#1204 → `9d2e5bc3`.
2. ~~T053 lands, and its root step moves the openDox root's spec pin. Then `copies.yaml`'s `commit` and the test's `SPEC_COMMIT` move to that commit together.~~ Done: T053 → `f7ee3c76`, opensoft/openDox#14 → `52005213`, and `e94ab323` moves the two together, with no digest moved.
   - The holder's answer (2026-09-29) stood throughout: T057's falsifier says "the spec-leg commit the openDox root pins", so the record moved only once the root pinned T053's landed commit.
3. ~~#57 (T054) lands, with this PR retargeted to `main` first.~~ Done: retargeted, #57 → `a691e4e4`, and `main` merged in as `cb40b977`.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

🤖 Generated with [Claude Code](https://claude.com/claude-code)


Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 30, 2026
**Authored ahead, as a phase-2 draft.** Brett ruled on openxFactory#656, comment `5857365170` ("Start phase 2's independent tasks"), that phase-2 tasks are authored as drafts. **T049 has landed** (openxFactory#1204 → `9d2e5bc3`), so phase 2 is open. This PR stays a draft until the two tasks below have landed and the holder un-drafts it.

T055 is `After: T054, T057, T022, T038`, and all four have landed (#57 `a691e4e4`, #58 `8ec08e91`, #45, #48). Before they landed:
- T054 is #57, a clean draft. It waits on #54, #56 and T053 (openDox-spec#16).
- T057 is #58, a clean draft. It also waits on the openDox root pinning T053's landed spec commit. See "T057 and the validator default" below.
- T022 (#45) and T038 (#48) have landed.

This is plan 034's **T055 (serve and generate standalone: 5.5, and 4.3 in part)**, phase-2 slice **P2-R**. I read the plan at openxFactory `main` `6b97c60` (`specs/034-opendox-standalone-operation/tasks.md`). The slice is claimed on openxFactory#656, comment `5873583149`.

## What this branch carries

- It is **built on #57's branch**, `build/034-p2p-t054-neutral-projection` (T054, the neutral projection), which is itself built on #54 (T052, the generator seam). It was cut at `5a6fe637`, with #54's head `8d507c5b` merged in as `e8a733d`.
- After T049 landed, **#57's head `8e7da4a2` is merged in as `8cbb1ea`**, clean. That head carries:
  - #54's final head, `2f515c57`;
  - #56's head, `44dcc3a1`;
  - `main` `dc3765dd`, where #53 (T050) landed;
  - the holder's scaffold decision (`8e7da4a`), which answers r4126022820 below.
- **#58 (T057) is not merged in**, on the holder's decision (below).
- Until #54, #56 and #57 land, the diff against `main` carries their changes as well. T055's own change is:
  - its commits `c27eac35` through `f4ef63d3`: the first builds T055, and the other six take Copilot's review rounds;
  - `d7aa9d8c` (the holder's decision on empty source options), and `687d37bf`, `96f18c45` and `e3ef506a` (the next three review rounds), all after T049.

## What it builds

### Four seams, each with an openDox default of its own (R1Q10 (a))

`src/opendox/projection_seams.py` is new and uses the standard library only. It declares four seams:

| seam | what a registration carries | openDox's default |
|---|---|---|
| `registry` | the entry, registry and source types; the key, containment and publishable-ref rules; the data-source readers; the refresh bindings and defaults | `opendox.default_registry` |
| `corpus_root` | `corpus_scan_defect`, `corpus_root_refusal`, `change_rows`, `SCANNED_ROOTS` | `default_projection.CORPUS_ROOT` |
| `writer` | `write_snapshot(snapshot, path, boundary)` | `default_projection.WRITER` |
| `validators` | one validator per KIND: `validate(path, *, strict, search_from)`, answering a `ValidationResult` | `default_projection.VALIDATOR`, for `opendox-snapshot` and `ideation-workbench` |

The rules are the ones the profile and generator seams keep (R1Q3 (a) and (ii); RN-1 (a)):
- **Nothing registered refuses** (4.2). The refusal names the seam, its call and the four entry points. There is never a silent fallback.
- **The entry points register the defaults where no host has.** They are `cli.build_parser()`, `cli.main()`, `serve.build_server()` and `serve.main()`. `register_defaults()` reads nothing.
- **A host's registration replaces a default until a consumer has read it**, and is refused (`SeamAlreadyRegistered`) after that. A host over a host is refused. The same object again is a no-op. `unregister()` makes a swap explicit.
- **Each registration is probed for its names when it is made.** A missing or non-callable name is a `TypeError` naming what is missing. A lookup that raises is chained as the cause (T027's rule).
- **A consumer resolves the seam at each use.** `serve.py` and `serve_workbench.py` bind `registry_mod = projection_seams.registry.proxy`, which resolves on every attribute read. No proxy is read at import time, and a test walks the AST to hold that.

The defaults are new code, not openXdox's modules moved.
- **`default_registry`** is one in-memory registry keyed `(repository, ref)`, with `ref` defaulting to `main`.
  - It keeps `/source`'s containment rule (`resolve_within`).
  - Its `SnapshotSource` serves the snapshot it was handed, and it regenerates that snapshot.
  - It reads **no data source and no index**, because openDox has no index kind (T053). A declared `--data-source-*` or `--local-index` is **refused**, naming the seam, rather than ignored.
  - `compose_view` composes nothing.
- **`CORPUS_ROOT`** asks, structurally, for a git repository's root: a directory holding `.git`, and a worktree's `.git` file counts. Its `SCANNED_ROOTS` is empty, and `change_rows` answers no row.
- **`WRITER`** writes canonical JSON (sorted keys, indent 2, ASCII, a trailing newline) through the interactivity boundary.
- **`VALIDATOR`** is a stand-in until T057 is in this tree. It answers `validator-unavailable`, naming T057, and never answers `validated`.

### The verbs go through the seams (4.3, in part)

- **Generation.** `cli._generate_and_write` and `cli._gate_snapshot` call `generator_seam.generate(...)`, which looks the generator up on each call.
  - Both write through the registered writer.
  - An unset `--project-register` or `--possibles` is not passed.
  - A set one that the registered generator does not declare is refused (`generate refused: …`) before anything is written.
- **The validator is chosen by the written snapshot's `kind`** (`cli._validate_by_kind`). `_locate_validator` is gone.
  - The three outcomes keep their meaning, and so do `--strict` and `--no-validate`.
  - A kind with no validator is *unavailable*. It is never given another kind's validator.
  - A snapshot that declares no kind fails.
  - The remedy line prints only when the validator declares a `dependency_remedy`.
- **The workbench manifest.** `workbench.validate_manifest` asks the lookup for `ideation-workbench`, and no longer calls `consumer_reach.find_validator`. An explicit validator script still runs as before.
- **The regenerate.** The default source's regenerate (`SnapshotSource.refresh`) generates through the seam and writes through the registered writer. It keeps `main` active and never promotes a session ref (FR-014a).
- **`branch_session`.**
  - `session_entry`, `register_session_entry`, `refresh_session_snapshot` and `refresh_main_view` use the registered registry's types.
  - `_change_rows` (the brief's `:1568`) asks the corpus-root seam's `change_rows`, because the generator seam does not carry it.
- **The RFC 3339 check.** `is_rfc3339_datetime` is openDox's own (`src/opendox/rfc3339.py`). It implements the neutral contract's `generated-at-is-rfc3339` rule, which no seam carries, and it agrees with openXdox's check over 20 vectors.
- **The core `/snapshot.json` arm is `serve.py`'s own.**
  - `_query_key`, `_read_snapshot`, `_serve_snapshot` and `_hosted_entry_refused` are now defined on `DashboardHandler`.
  - `hosted_ref_refused` is a function in `serve.py`, over the registry seam's `is_publishable_ref`.
  - While they were forwarded to openXdox, a standalone server refused every `/snapshot.json`, and `_divergence_headers` asks `hosted_ref_refused` on every response.
  - `_checkout_real` and `_refuse_impossible_checkout_root` ask the registered predicate.
- **`_report`** prints `repository=… kind=opendox-snapshot` for the neutral kind, which carries no project. Every other kind's line is unchanged.
- **The empty-projection warning** reads the registered predicate's `SCANNED_ROOTS`. With none, as openDox's own predicate has, it says "it was accepted as a corpus checkout, but nothing in it was read as a document". The governed wording is unchanged.
- **The `_default_home_factory` docstrings** in `cli.py` and `serve.py` now say that the adapter's default `required_fields` is `NEUTRAL_FIELDS` (`title` and `summary`, since T054), as #57 asked. The two copies stay identical apart from each naming the other.
- **`serve.main()` registers the defaults before building its parser**, because its option defaults read the registry.
  - So `--help` now runs in a lone checkout, which research R7 found it could not.
  - `--data-source-path`'s help reads `(default: the source root)`.
  - A seam's refusal prints `serve refused: …` and exits 1.

### Retired from `consumer_reach`

- **The stand-ins.** `snapshot_registry`, `snapshot`, `corpus_root`, `generator`, `find_validator`, `corpus_root_refusal`, `generate_snapshot`, `is_rfc3339_datetime`, `hosted_ref_refused` and `scanned_roots` are gone.
- **The helpers.** The `function` and `constant` stand-in helpers are gone too, since nothing binds through them any more.
- **The projection column.** `LateProjectionRoutes` now forwards ONE method, `_serve_index`, for the column's own `/snapshot-index.json` binding. That binding is T084's.

## The falsifier

From T055's entry in tasks.md:

> **Falsifier**: F4.1's scan, down by these reaches.

The scan is `scan_deferred_reaches.py` from research.md's appendix (sha256 `fe116203…`, as in the remeasure table), run over `src/opendox`. At `e8a733d`, the branch before T055's commit:

```text
src/opendox/branch_session.py:1568: openxdox  [in _change_rows]
src/opendox/branch_session.py:1587: openxdox.register  [in _active_pick_fallbacks]
src/opendox/branch_session.py:2005: openxdox  [in proposal_state_for]
src/opendox/branch_session.py:2105: openxdox.snapshot_registry  [in session_entry]
src/opendox/branch_session.py:2151: openxdox.snapshot_registry  [in register_session_entry]
src/opendox/branch_session.py:2228: openxdox.snapshot_registry  [in refresh_session_snapshot]
src/opendox/branch_session.py:3573: openxdox.snapshot_registry  [in refresh_main_view]
src/opendox/cli.py:632: openxdox.snapshot_registry  [in _session_registry]
src/opendox/serve.py:652: openxdox.corpus_root  [in _checkout_real]
src/opendox/serve.py:2125: openxdox.corpus_root  [in _refuse_impossible_checkout_root]
src/opendox/serve_project.py:246: openxdox.gate_console  [in _serve_project_register]
src/opendox/serve_project.py:247: openxdox.kickoff  [in _serve_project_register]
src/opendox/serve_workbench.py:347: openxdox  [in _is_live_session_ref]
src/opendox/serve_workbench.py:407: openxdox  [in _thread_gate]
src/opendox/serve_workbench.py:408: openxdox  [in _thread_gate]
src/opendox/serve_workbench.py:544: openxdox  [in _handle_workbench_thread]
src/opendox/serve_workbench.py:1215: openxdox  [in _handle_workbench_model_approval]
src/opendox/serve_workbench.py:1665: openxdox  [in _handle_workbench_chat_turn]
src/opendox/serve_workbench.py:2607: openxdox  [in _handle_workbench_document_abstract]
19 deferred reaches
```

At `c27eac35`:

```text
src/opendox/branch_session.py:1592: openxdox.register  [in _active_pick_fallbacks]
src/opendox/branch_session.py:2010: openxdox  [in proposal_state_for]
src/opendox/serve_project.py:246: openxdox.gate_console  [in _serve_project_register]
src/opendox/serve_project.py:247: openxdox.kickoff  [in _serve_project_register]
src/opendox/serve_workbench.py:351: openxdox  [in _is_live_session_ref]
src/opendox/serve_workbench.py:411: openxdox  [in _thread_gate]
src/opendox/serve_workbench.py:412: openxdox  [in _thread_gate]
src/opendox/serve_workbench.py:548: openxdox  [in _handle_workbench_thread]
src/opendox/serve_workbench.py:1219: openxdox  [in _handle_workbench_model_approval]
src/opendox/serve_workbench.py:1669: openxdox  [in _handle_workbench_chat_turn]
src/opendox/serve_workbench.py:2611: openxdox  [in _handle_workbench_document_abstract]
11 deferred reaches
```

- **The eight reaches that are gone** are the ones T055 names:
  - `branch_session`'s `_change_rows`, `session_entry`, `register_session_entry`, `refresh_session_snapshot` and `refresh_main_view`;
  - `cli`'s `_session_registry`;
  - `serve`'s `_checkout_real` and `_refuse_impossible_checkout_root`.
- **The eleven that remain** are all T084's.
- **The census of `consumer_reach` sites** (`census_consumer_reach.py`, sha256 `7f36b848…`) falls from 65 to 29: `gate_console` 27, `LateGateRoutes` 1 and `LateProjectionRoutes` 1. No projection name remains.

**Standalone, end to end:** `tests/test_projection_seams.py::test_generate_and_serve_run_with_no_sibling_importable` runs in a process where `openxdox`, `ideation_dashboard`, `doc_health` and `corpus_adapter_openxfactory` cannot be imported.
- `generate` exits 0 and writes `kind: opendox-snapshot`.
- `serve.build_server` builds.
- The server answers `GET /snapshot.json` 200 (the neutral kind), `/capabilities` 200, `/source/notes-toolshed-inventory.md` 200 and `/source/.git/config` 404.
- No sibling module is loaded.

## The repository's own checks

- **The whole suite, against a `postgres:16` container** (CI's service and DSN shape), on Python 3.12.3 with pytest 8.4.2. The venv was installed with `-c constraints-cpython312-linux.txt -e ".[runtime,test]"`, and `LANG=C.UTF-8`, as the runner sets it.

  | run | passed | skipped |
  |---|---|---|
  | base `e8a733d` (the branch before T055's commit) | 2583 | 11 |
  | head `f4ef63d3` | 2701 | 11 |

  The test-by-test JUnit diff shows **127 added**, all passing:
  - 117 in the new `tests/test_projection_seams.py`;
  - 4 new `NEUTRAL_MODULES` parameters in `test_consumer_reach.py`;
  - 6 in `test_source_core_arm.py`.

  It shows **9 removed**. Each subject is retired or replaced:
  - Four tests exercised `consumer_reach.constant()`, which is retired: `test_a_constant_does_not_forward_attribute_reads`, `test_constructing_a_constant_resolves_nothing`, `test_the_sequence_operations_a_re_exported_constant_meets` and `test_an_unavailable_consumer_refuses_at_the_operation_not_at_the_binding`.
  - `test_a_converted_name_is_never_used_at_import_time[serve.py|serve_workbench.py|workbench.py]`: those modules bind no `consumer_reach` name any more. The import-time property of the proxies they bind instead is held by `test_no_proxy_over_a_seam_is_read_at_import_time`.
  - `test_the_column_keeps_the_rules_the_ruling_did_not_move` asserted that `_serve_snapshot` and `_hosted_entry_refused` stay forwarded, which T055 reverses. It is replaced by `test_the_column_keeps_only_its_own_contributed_route` and `test_the_snapshot_arms_handlers_are_defined_on_this_handler` (four cases).
  - `test_hosted_ref_refused_is_still_reached_through_the_late_seam` is replaced by `test_hosted_ref_refused_asks_the_registered_registrys_rule`.

  **0** outcomes changed.
- **The triple pin** reads: selected 2712 (floor 2476), passed 2701 (floor 2465), skipped 11 (pinned exactly 11). No test ships skipped. CI's own line at `f4ef63d3` reads `triple: selected=2712 passed=2701 skipped=11 failures=0 errors=0`.
- **One environment note.** In a shell with no `LANG`, `test_model_provider_broker.py::test_the_broker_child_inherits_no_credential_shaped_environment` fails. The child Python's PEP 538 locale coercion adds `LC_CTYPE`, which is not in the bridge's allowlist. With `LANG=C.UTF-8` it passes. T055 touches neither the broker nor the bridge, so this predates it.
- **Mutations: 34 of 34 killed.** Twenty-three were run at `c27eac35`:
  - Seams:
    - a host replaces a default after it was read;
    - reading a default does not close its window;
    - `register_defaults` skips the writer;
    - a proxy resolves dunders;
    - a missing kind answers another kind's validator.
  - Validation:
    - the validator is chosen by a fixed kind;
    - the manifest is validated by another kind's validator.
  - Serving:
    - the hosted plane never refuses a session ref;
    - an active session entry is served hosted;
    - the checkout is never real.
  - Containment: files below a dot-directory are served.
  - Regenerate:
    - it promotes a session ref;
    - it bypasses the registered writer.
  - Registry:
    - the neutral source ignores a declared data source;
    - the session entry type is not the registered registry's;
    - the CLI's session registry is not the registered registry's.
  - Routed sites:
    - `_report` prints the governed line for the neutral kind;
    - `_change_rows` ignores the registered predicate;
    - the predicate accepts a directory with no `.git`;
    - `generate` skips the corpus-root guard;
    - the gate snapshot bypasses the seam.
  - RFC 3339:
    - it admits a space for the `T`;
    - it refuses a lower-case `t`.

  One more mutation, admitting second 60, is equivalent, because `datetime` refuses it too.

  Eleven more were run in the review rounds, one or two for each change:
  - a symlink leads to what a name cannot;
  - a declared token variable is dropped;
  - dropping the active entry leaves its key;
  - an explicitly empty URL is dropped for being falsy;
  - an unregistered kind is described as a search;
  - the lookup's refusal is cut before its remedy;
  - the writer writes NaN and Infinity;
  - the snapshot body re-resolves the active entry;
  - the source arm resolves the entry twice;
  - the writer rewrites the snapshot in place;
  - a failed move leaves its temporary sibling.
- **pyflakes over the touched files** finds nothing new: 104 findings at base and 104 at head, all pre-existing re-export F401s.

## T057 and the validator default

- **What T055 asks for.** T055's text makes the lookup's default openDox's own validator (T057).
- **Where T057 is.** When this branch was cut, T057 had no PR. It now has one, #58 (a draft at `ca52182f`, stacked on #57's branch). This PR does **not** merge it, for two reasons:
  - #58 edits `pyproject.toml`, which phase-2 drafts in this lane stay out of;
  - #58 is still in review.
- **What happens meanwhile.** The default for openDox's two kinds is the stand-in, `OwnValidatorNotBuilt`, which names T057.
  - A generate verb warns "validation SKIPPED" and exits 0, or 1 under `--strict`.
  - A manifest saved with `validate=True` is refused as unvalidated. That is what a lone openDox answered before T055 whenever no validator was reachable, except that `validate_manifest` no longer reaches the consumer.
- **The swap is one registration** (see T058 below).
- **The holder's decision (2026-09-28): do NOT merge #58 into #59.** The validator stand-in stays until T058 wires `opendox.validator`. This branch takes #58's code only through `main`, once #58 has landed, and still keeps the stand-in until T058.

## Beyond the task's list: `hosted_ref_refused`

- **Where the plan put it.** T084's list names `hosted_ref_refused` (2 sites).
- **Why T055 routes it.** The core `/snapshot.json` handlers that T055 makes `serve.py`'s own call it, and so does `_divergence_headers`, on every response. Without it, a standalone server could not answer `/snapshot.json` or `/capabilities`.
- **So T084's list is one name shorter.**

## Files (T055's own commits)

- **New:**
  - `src/opendox/projection_seams.py`
  - `src/opendox/default_registry.py`
  - `src/opendox/default_projection.py`
  - `src/opendox/rfc3339.py`
  - `tests/test_projection_seams.py`
- **Changed:**
  - Source: `src/opendox/cli.py`, `serve.py`, `serve_workbench.py`, `workbench.py` and `branch_session.py`.
  - `consumer_reach.py`.
  - Docstrings only: `serve_wire.py`, `generator_seam.py`, `default_generator.py` and `cli_project.py`.
  - Tests: `test_consumer_reach.py`, `test_source_core_arm.py`, `test_route_handler_contribution.py`, `test_doxbench_entrypoint.py`, `test_generator_seam.py`, `test_profile_registration.py`, `test_authoring_seam.py`, `test_reach_sweep.py` and `test_neutral_projection.py`.
- **Not touched:** `conftest.py`, `pyproject.toml`, `.github/workflows/validate.yml`, `README.md`, and every pin. The new modules are created files, with no carve-manifest row (RULED OQ-C).

## What the later tasks need

- **T056** (the standalone generate path, end to end). I probed this at `c27eac35`, with the four siblings blocked by a meta-path blocker, over a copy of T050's fixture. In that copy, `candidate-toolshed-rebuild.md`'s `stage:` is `brainstorming`.
  - `python -m opendox.cli generate` exits 0 and writes the neutral snapshot. It prints `notice: candidate-toolshed-rebuild.md: its stage: value 'brainstorming' is not one of the six station role keys (source, grouping, candidate, selection, submission, completion), so it is not a declaration; the document is read as a source`. The snapshot reads that document as `stage: source`. So the verb's half of F5.3's `stage:` case needs no further plumbing.
  - `generate-and-open --no-open --no-serve` exits 0, builds the server and prints its URL.
  - What remains is T056's own:
    - a test that the server STARTS and answers, run as `generate-and-open` without `--no-serve` (or `serve.main`) in a subprocess with the siblings blocked, polling the printed URL and then stopping the server;
    - F10.1's plain-install run, which is T070's.
- **T058** (the post-render validator in the generate verbs).
  - Replace `default_projection.VALIDATOR` with an adapter over #58's `opendox.validator` that keeps T055's protocol: `validate(path, *, strict=False, search_from=())` answers a `projection_seams.ValidationResult`.
  - How the adapter should work:
    - It reads the file: JSON for `opendox-snapshot`, and YAML for the `ideation-workbench` manifest, which `workbench.py` already parses with PyYAML.
    - It calls `validator_for(kind)`, or `validate(instance, kind=…)`.
  - How its answers should map:
    - No violation is ok, with return code 0.
    - Violations are `not-conformant`, with return code 1 and `report(violations)` on stdout, so each rule id is named. F7.2 needs `EXPECTED_RULE`.
    - `ValidatorUnavailable` and `SchemaNotEvaluable` are `validator-unavailable`, with the reason.
    - `dependency_remedy = None`. No subprocess runs, so F7.2's "no `No such file or directory`" holds by construction.
  - `OWN_KINDS` stays `(opendox-snapshot, ideation-workbench)` unless T058 widens it to #58's `KINDS`. The doxBench wire kinds keep their own path (`serve_wire.register_doxbench_validators`).
  - The stand-in's cases in `tests/test_projection_seams.py` change with it:
    - `test_the_validator_stand_in_concludes_nothing_and_names_T057`;
    - `test_openDoxs_own_kind_meets_the_stand_in_and_strict_makes_it_fatal`;
    - the stand-in half of `test_a_manifest_is_validated_by_the_validator_for_its_kind`.
  - `--strict` and `--no-validate` already mean what T058 says.
- **T059** (openXdox registers its governed mechanisms). It registers everything below at process start, before any entry point reads a default, because a default is sealed once read.
  - `openxdox.snapshot_registry` at `projection_seams.registry`. The module already carries every required name.
  - An adapter at `corpus_root`. It takes `openxdox.corpus_root`'s `corpus_scan_defect`, `corpus_root_refusal` and `SCANNED_ROOTS`, plus a `change_rows` built from `generator.iter_changes` and `declared_origin_state`, which is what `branch_session._change_rows` computed before T055.
  - `openxdox.snapshot` at `writer`.
  - A validator adapter for each governed kind, such as `ideation-dashboard-snapshot`. Its `dependency_remedy` is `snapshot.DEPENDENCY_REMEDY`, and it names `VALIDATOR_RELPATH` in `unavailable_reason`.
  - It lowers `OPENDOX_BACK_IMPORTS` in `tests/test_dependency_direction.py`. `cli.py` and `serve.py` leave the table, and `branch_session.py` goes from `(0, 7)` to `(0, 2)`. `serve_project.py` stays at `(0, 2)` and `serve_workbench.py` at `(0, 7)`.
  - `tests/test_generated_at_anchor.py:223` patches `cli_mod._locate_validator`, which T055 removed. The seam to patch now is `_validate_by_kind`, or a validator registered for the kind.
  - Four gaps that the review rounds closed in openDox's own defaults are still open in the governed mechanisms T059 registers. They are openXdox-code's to close, ideally before T059 registers them:
    - `snapshot_registry.resolve_within` checks the hidden-name rule only against the URL's spelling, so `link -> .git` serves `/source/link/config`, which is `.git/config` (r4125556296).
    - `SnapshotRegistry.drop` leaves the active key pointing at a dropped entry.
    - `snapshot.write_snapshot` writes in place through `write_output`, so a request can read a truncated snapshot (r4126138808). Its `canonical_json` also writes NaN and Infinity (r4125900060).
    - `SnapshotRegistry` reads `active`, `get`, `entries()`, `keys()` and `len()` without its lock, so a reader can answer from the middle of a block `atomically()` holds (r4136863481).
- **T084**: its list no longer includes `hosted_ref_refused`. The eleven reaches the scan still finds are all T084's.

## For the holder

All three earlier items are now decided:
- **The validator default**: #58 is not merged here (above).
- **T054's `NEUTRAL_FIELDS` default missed openDox's own scaffold** (r4126022820): #57's commit `8e7da4a` takes it, and this branch now carries that commit. openDox's own scaffold leads with `title:`/`summary:` where the registered corpus obliges them, and keeps the governed layout where it obliges neither.
- **Empty generator inputs**: the holder ruled that an empty `--project-register`/`--possibles` is REFUSED, fail closed. It is neither dropped nor read as `Path("")`. Taken in `d7aa9d8c`:
  - `cli.SourceOptionRefused`, raised by one helper, `_source_option()`, which both call sites use: `_generate_and_write` for `generate` and `generate-and-open`, and `_gate_snapshot` for the gate verbs. It answers `None` for an option not given, refuses an empty one, and resolves anything else.
  - The guard runs beside the other two, before any generation or write. In `generate-and-open` it runs early too, so a refused run mints no run directory. `main()` prints `<verb> refused: …` and exits 1.
  - `serve.main` refuses an empty `--project-register` the same way, before a socket is bound.
  - Seven new cases. Mutations: 8 of 9 killed. The ninth removes the explicit guard in `_generate_and_write`, and it is equivalent: the argument expression refuses before `generate()` is called. The guard is kept beside the other two, so the order does not rest on argument evaluation.

## CI and review rounds

`validate` is green at every head below, and SonarCloud passed its quality gate. Every thread was answered and resolved, and each change carries a case that its mutation fails.

- **`c27eac35`: 3 threads, all taken in `ea49c424`.**
  - r4125556296: symlinks inside the root could lead into a dot-directory. The canonical path now meets the hidden-name rule too.
  - r4125556360: `token_env` was ignored. Every declared data-source option is now refused by name, an empty one included.
  - r4125556420: an extra "by", in three places.
  - The overview's remarks on `display.js` and the plain-documents fixture test are #57's and #53's files. They have no threads here and are flagged, not changed.
- **`ea49c424`: 1 thread, taken in `bfb9c479`.**
  - r4125666251: `serve.main`'s `or` turned an explicitly empty `--data-source-url`/`--data-source-github` into `None`. Each option is now handed over as given, and a slug that cannot be composed is refused.
  - The overview (no thread) found that `drop` left the active key dangling. That is taken in the same commit.
- **`bfb9c479`: no findings.** The overview (no thread) noted that the unavailable-validator warning described a filesystem search even when nothing is registered for the kind. It is taken in `244d7b7f`: the warning now says which of its two cases happened, and gives the lookup's whole refusal, remedy included.
- **`244d7b7f`: 2 threads, taken in `19c26782`.**
  - r4125900060: the writer wrote NaN and Infinity. It now refuses what JSON cannot carry, with `SnapshotNotWritable`, before writing.
  - r4125900164: the snapshot arm's query-less path read the active entry twice, for the refusal and for the body. It now resolves the entry once. This race came from openXdox's handlers unchanged.
- **`19c26782`: 2 threads.**
  - r4126022918: the source arm resolved its entry twice. It now resolves the entry once and asks for the path by that entry's own pair. Taken in `8c09d74c`.
  - r4126022820: T054's `NEUTRAL_FIELDS` default. It is answered with a reproduction, not changed here, and flagged above.
- **`8c09d74c`: 1 thread, taken in `f4ef63d3`.**
  - r4126138808: the writer wrote in place, so a concurrent read could see a truncated snapshot. It now writes a temporary sibling and moves it over the target with one `os.replace`, and the boundary still decides the destination.
- **`f4ef63d3`**: `validate` is green, with `selected=2712 passed=2701 skipped=11 failures=0 errors=0`. Copilot's review run there ended with "Copilot encountered an error and was unable to review this pull request", so it posted no verdict.
- **After T049: `8cbb1ea` merges #57's head, and `d7aa9d8c` takes the holder's decision on empty source options** (above). CI is green at `d7aa9d8c`, with `selected=2723 passed=2712 skipped=11`: #57's 4 scaffold cases and these 7.
- **Copilot at `d7aa9d8c`: 1 thread, taken in `687d37bf`.**
  - r4136439187: a refresh widened a restricted snapshot. `os.replace` carries the sibling's mode over the target, and the sibling had a new file's ordinary mode.
  - Now, where the target exists, its permission bits go onto the sibling (`os.fchmod`) before a byte is written. A new target keeps the ordinary mode.
  - If the bits cannot be copied, the write fails and nothing is widened. The copy runs inside the stream's `with`, so the descriptor cannot leak.
  - Four new cases, all red against `f4ef63d3`'s writer. Local whole suite: `selected=2727 passed=2716 skipped=11`.
- **Copilot at `687d37bf`: "Changes recommended", 2 threads.** CI is green there, with `selected=2727 passed=2716 skipped=11`.
  - r4136585695, taken in `96f18c45`, and taken again without a lock in `e3ef506a` (next round). The source arm asked `resolve_source` for the path by the entry's pair, and `resolve_source` looks the pair up again. So a refresh that re-registered the same key between the two lookups could put another root behind the path.
    - `96f18c45` ran both lookups under the registry's own lock, `self.source.registry.atomically()`, the lock `register` and `drop` take.
    - Its case ran the refresh on another thread. It was red against `687d37bf`'s arm, and red with the hold removed.
  - r4136585637, not taken: it does not reproduce. `_register_baked` sets `baked_repository` (line 560) before it asks `_source_root_for` (line 561), and has done since `c27eac35`.
    - Measured with `--repository` omitted: the entry is confined to the served checkout, and `/source/notes-toolshed-inventory.md` answers 200, keyed or not.
    - Two existing tests pin the order, and both are red with the two lines swapped: `test_the_source_registers_the_snapshot_it_was_handed` and `test_generate_and_serve_run_with_no_sibling_importable`.
  - Local whole suite at `96f18c45`: `selected=2729 passed=2718 skipped=11`, which is +2.
- **Copilot at `96f18c45`: "Changes recommended", 3 threads, all taken in `e3ef506a`.** CI is green there, with `selected=2729 passed=2718 skipped=11`.
  - r4136863569: the seam does not declare `atomically()`, so a registry that passes the seam's probe could fail every `/source` request.
    - The arm now asks nothing of the registry beyond the one resolution. It confines the path to the resolved entry's own root through `resolve_source_path`, its single entry point and the one the no-registry path already used. That applies the declared per-entry rule, `resolve_within`, as `serve_workbench.py` does for the roots it holds.
    - There is no second lookup, so r4136585695's race stays closed with no lock.
    - `tests/test_source_core_arm.py` pins the shape: one `resolve`, the entry's own root through `resolve_source_path`, and no `resolve_source` or `atomically` call in the arm. It fails against `687d37bf`'s arm and `96f18c45`'s.
    - The race case, now `test_a_refresh_that_replaces_the_key_cannot_move_the_source_arms_root[unkeyed|keyed]`, shows the replacement lands before the path is confined, and the body is still the first entry's file. It is red against `687d37bf`'s arm.
  - r4136863481: `get`, `active` and `len()` read without the registry's lock, so a reader could answer from the middle of a block `atomically()` holds.
    - All three now read under the lock, as `entries()` and `keys()` already did.
    - `test_a_read_waits_for_a_held_read_modify_write[active|resolve|get|len]`: a read on another thread starts while a held block has a session promoted, and it must answer as the block left the registry. Each case is red with its own lock removed.
    - openXdox's registry has the same gap, listed for T059 above.
  - r4136863311: a registered generator owes the seam only `kind` and an integer `schema_version`, and `_report` indexed `repository` and `generation`, so such a snapshot raised `KeyError` after it was written.
    - The report now shows a lacking field, or one in another shape, as `<absent>`. `_stats` counts only a list or a mapping. The verb then goes on to the kind's validator.
    - `test_generate_reports_a_snapshot_whatever_else_its_contract_carries`, over a minimal snapshot and one with other shapes. Both are red against `96f18c45`'s report, with `KeyError`.
  - Local whole suite at `e3ef506a`: `selected=2735 passed=2724 skipped=11`, which is +6. F4.1's scan is unchanged, at 12.

## After #57 and #58 landed

- `92a9167` merges #57's final head `d7954fc6`, and `814516b7` merges `main` `a691e4e4` (#57), resolving its two add/add conflicts to ours: main's blob is `d7954fc6`'s in each. `c2a8ad9f` merges `main` `8ec08e91` (#58) with no conflict, and what it brings is exactly #58's squash. The validator stand-in stays until T058.
- **Copilot at `c2a8ad9f`: 1 thread, taken in `183b40fc`.** r4146219833: `_regenerate` passed `project_register_source` even when unset. It is now passed only when set, as the seam omits an unset input. `test_an_injected_generator_is_handed_the_register_only_when_one_is_set`, red against `c2a8ad9f`.
- **Copilot at `183b40fc`: 1 thread, not taken, made explicit in `0c946f4e`.** r4146370161 asked for `main` to be restored after an already-active session is regenerated. FR-014a forbids promoting a session, and an entry that was already active is not promoted by its own refresh. The docstring now says so, and `test_a_regenerate_promotes_no_session_and_moves_no_active_key` pins both halves.
- **Copilot at `0c946f4e`: "Needs a closer look", no findings, 0 threads.** CI is green, with `selected=2989 passed=2978 skipped=11 failures=0 errors=0`.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

🤖 Generated with [Claude Code](https://claude.com/claude-code)


Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Oct 3, 2026
…plan 034) (#67)

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Arc: neutral-product-standalone-operability

Plan 034 (`specs/034-opendox-standalone-operation/tasks.md`, read at openxFactory `main` `91e4685f`, after T007 batch H landed as openxFactory#1206 → `f99a2097`), phase-3 slice **P3-I, install mode and the bundle**:

- **T070** (#1144's 13.4, 13.5 and 13.6): `OPENDOX_INSTALL_MODE`, and the `--local` flag.
- **Falsifier:** F13.1's refusals, plus a test of the disagreeing pair.
- **After:** T071 (openDox-code#60, landed as `7ff434d9`) and T007 batch H (landed). It was stacked on #60's branch; the holder has retargeted it to `main`, and `25262459` merges main `7ff434d9`, so this diff is T070 alone.

**Ruled:**
- R1Q22 (a), `5817152735`;
- R1Q15 (b), `5850003126` (as batch H's 13.4 addendum reads);
- the phase-3 draft-ahead widening, `5901112350` (*"Install chain + lens (Recommended)"*).

Claimed on openxFactory#656 in [`5901575394`](opensoft/openXfactory#656 (comment)). **Authored ahead as a DRAFT**, which did not go READY before T063 landed and the holder said so. **T063 has landed** (openxFactory#1218 → `a883bbf6`, 2026-10-02 23:37:43Z), which closes phase 2, so phase 3 is open, and #60 ahead of it has landed.

## What it does

- **The selector** (13.4): `OPENDOX_INSTALL_MODE`, values `local` and `hosted`, defaulting to `hosted`. It is a `SETTINGS` entry read in `runtime/config.py`, placed immediately beside `OPENDOX_OIDC_ISSUER`. A blank value reads as unset, which means hosted: *"It is UNSET, not `local`, that must be safe."*
- **The flag** (R1Q15 (b)): `generate-and-open --local` selects local exactly as `OPENDOX_INSTALL_MODE=local` does. With neither, the install is hosted (13.5). The flag belongs to the verb and follows it (10.1).
- **A flag and a setting that disagree are refused, naming both.** Example: `--local` beside `OPENDOX_INSTALL_MODE=hosted`. No explicit selection is silently overridden. **This is plan 034's fail-closed reading (Principle VII), not #1144's text.** No answer rules the pair, batch H does not write it into #1144, and `evidence/analyze-round-2.md` (U2-1, V2-6) records it for Brett.
- **Local needs no broker.** `RuntimeSettings.oidc_issuer` and `oidc_audience` are empty, and `oidc_jwks_url` is `None`. `jwks_url()` and `discovery_url()` return `""` rather than a path glued onto nothing.
- **Local binds loopback only, with no opt-in** (13.4). A non-loopback `--host` on `generate-and-open`, or `OPENDOX_BIND_HOST` for the runtime's own listener, is refused, naming the loopback rule.
  - The set is `serve.py`'s own `LOOPBACK_HOSTS` (`127.0.0.1`, `::1`, `localhost`). 13.4 asks for *"the same judgement at the mode's own boundary"*.
  - `config` cannot import `serve`, so it spells the set, and a test holds the two equal. `127.0.0.2` is therefore refused, because the document server does not treat it as loopback either.
- **Hosted, or unset, with no issuer refuses, naming `OPENDOX_OIDC_ISSUER`** (13.5).
  - `generate-and-open` asks for the issuer first (`require_the_hosted_issuer`), and then loads the whole runtime configuration. The serving process is the one whose settings are the install's (13.4a; R1Q16 (i)).
  - So a hosted run with nothing configured names the issuer and `--local`, not the `OPENDOX_DATABASE_URL` that `load_settings` happens to ask for first (plan 034's requirement-13 scenario 2).
  - `load_settings` keeps its own order for every verb that relies on it.
- **Hosted is otherwise unchanged** (13.6): same broker, same pinned issuer, same order of refusals, and a hosted bind may still be `0.0.0.0`.
- **The shape is resolved first.** `generate-and-open` resolves it before it scans, mints or binds anything, so each refusal exits 1 at once. That covers F13.1's `test "$rc" -ne 124`.

### Holder readings (coordinator, 2026-09-30, on openxFactory#656; Brett may overrule)

1. **`opendox-runtime runtime serve` refuses under `local`** (`refusal: local-mode-has-no-broker`). Every `/api/v1` route verifies a broker-signed token, and a local install is served by `generate-and-open --local`. In release 1 its document surface reads nothing from the store (R1Q16 (ii)).
2. **`runtime status` under `local`** reports `broker_keys: "not configured (local mode)"` and `broker_discovery: null`. It never builds a verifier, and its exit code is the database's verdict alone, so F13.1's `set -e` survives.
3. **A broker setting beside `local` is refused, naming each one**: `OPENDOX_OIDC_ISSUER`, `OPENDOX_OIDC_AUDIENCE` and `OPENDOX_OIDC_JWKS_URL`. The values are never repeated. T072 adds the two DSNs to the list.
4. **An unrecognised value** (`Local`, `single-user` …) **is refused, naming `local` and `hosted`**, and matching is case-sensitive.

### Deliberately NOT here

- **T070 is the identity half; T072 is the datastore half.** Under `local`, `load_settings` still takes the DSNs from the environment, and `generate-and-open --local` loads no database setting. T072 supplies both DSNs from the bundled server (13.1) and refuses operator DSNs beside `local`.
- T073's `install` block is not here. `serve.py` and `pyproject.toml` are untouched.

### Outside `src/` and `tests/`

- **`deploy/` — one line, and the task requires it.** `deploy/compose/.env.example` gains `OPENDOX_INSTALL_MODE=hosted` with its comment. `config.py`'s header makes `.env.example` the place every setting is named, and `tests_runtime/test_deploy_shape.py::test_every_runtime_setting_is_documented_in_env_example` is parametrized over `SETTINGS`, so a new setting without the line is red. Neither the compose file nor the Kubernetes base changes: the default is already hosted.
- **`docs/`: untouched.** 10.3's README line belongs to T076, in the openDox root.
- **One existing test changes, `tests/test_doxbench_entrypoint.py`'s fixture.** It drives `cmd_generate_and_open` with no settings, and the unset default is now hosted, which refuses without an issuer. So it passes `--local` and scrubs the runtime settings first.

## The falsifier

**F13.1's refusal probes**, verbatim from `# LOCAL mode REFUSES a non-loopback bind` to the end of the block, plus T070's own disagreeing pair. Two deviations are forced by the base, and neither weakens a check:
- the install is the working venv's `-e ".[runtime,test]"`;
- the corpus is a two-file stand-in, because `tests/fixtures/plain-documents` arrives with T050 (#53), which this stack's base (`main` `2d116415`) predates.

Each probe on its own. BEFORE is #60's head `f097fd8`; AFTER is this branch:

```
=== BEFORE (f097fd8)
FAIL local-refuses-non-loopback-bind (rc=1): Traceback (most recent call last):   File ".../src/opendox/consumer_reach.py" …
FAIL hosted-no-issuer-names-it (rc=1): Traceback (most recent call last): …
FAIL unset-default-refuses-identically (rc=1): Traceback (most recent call last): …
FAIL disagreeing-flag-and-setting-names-both (rc=2): usage: ideation-dashboard [-h] … (argparse: no --local)
=== AFTER (this branch)
PASS local-refuses-non-loopback-bind (rc=1)
PASS hosted-no-issuer-names-it (rc=1)
PASS unset-default-refuses-identically (rc=1)
PASS disagreeing-flag-and-setting-names-both (rc=1)
```

The whole sequence under `set -euo pipefail` (F13.1's own form), AFTER:

```
probe 1: local refuses a non-loopback bind
  rc=1; stderr: generate-and-open refused: --host '0.0.0.0' is not a loopback address, and a LOCAL install binds LOOPBACK ONLY (127.0.0.1, ::1, localhost). … There is no opt-in: …
probe 2: load_settings (T071's block, unchanged)
probe 3: hosted with no issuer refuses naming it
  rc=1; stderr: generate-and-open refused: OPENDOX_OIDC_ISSUER is required and is not set, and this install is HOSTED …
probe 4: the unset default refuses identically
  rc=1; stderr: generate-and-open refused: OPENDOX_OIDC_ISSUER is required and is not set, and this install is HOSTED (OPENDOX_INSTALL_MODE is unset, and unset means hosted) …
probe 5 (T070's own, not F13.1's): a disagreeing flag and setting are refused naming both
  rc=1; stderr: generate-and-open refused: --local selects the LOCAL install and OPENDOX_INSTALL_MODE=hosted selects the HOSTED one. …
F13.1 REFUSALS + T070 PAIR: ALL PASSED
```

In the suite, the same probes run as bounded child processes of `python -m opendox.cli` (`timeout=30`, and a `TimeoutExpired` fails as "a server that STARTED") in `tests/test_install_mode_entrypoint.py`. The loader-level cases are in `tests_runtime/test_install_mode.py`.

## A mutant of each new refusal, killed

Each mutant was applied alone and the three T070 test files run with `-x`, with a 240 s bound so a hang could not pass for a kill:

| mutant | killed by |
|---|---|
| M1 the disagreeing pair accepted (flag wins) | `test_a_flag_and_a_setting_that_disagree_are_refused_naming_both` |
| M2 an unknown value read as hosted | `test_an_unrecognised_value_is_refused_naming_the_two[Local]` |
| M3 unknown values matched case-insensitively | same, `[Local]` |
| M4 the default flipped to local (the safety) | `test_the_selector_has_two_values_and_its_default_is_hosted` |
| M5 the hosted issuer-first check a no-op | `test_a_hosted_install_with_no_issuer_refuses_naming_it[None]` |
| M6 the local loopback refusal a no-op | `test_a_local_install_refuses_a_non_loopback_bind_naming_the_rule[0.0.0.0]` |
| M7 broker settings beside local accepted | `test_a_broker_setting_beside_the_local_mode_is_refused_by_name[OPENDOX_OIDC_ISSUER]` |
| M8 the local bind set widened (`127.0.0.2`) | `test_a_local_install_refuses_a_non_loopback_bind_naming_the_rule[127.0.0.2]` |
| M9 local still requires the issuer | `test_a_local_install_needs_no_broker[setting]` |
| M10 `runtime serve` serves under local | `test_runtime_serve_refuses_under_the_local_mode` |
| M11 `runtime status` probes a broker under local | `test_runtime_status_under_the_local_mode_probes_no_broker` |
| M12 `generate-and-open` ignores `--local` | `test_the_flag_refuses_a_non_loopback_bind_exactly_as_the_setting_does` |
| M13 `generate-and-open` skips the install shape | `test_local_mode_refuses_a_non_loopback_bind_naming_the_rule` |

M10 at first HUNG rather than failed: the un-stubbed case started a real uvicorn listener. That case now stubs uvicorn and the app, so the mutant fails at once. The table above is the re-run.

## Fix round: the fixture's repository ignores the user's git config (`32683e8`)

Copilot's review at `b50e3b1` ([finding](#67 (comment))) was real. `tests/test_install_mode_entrypoint.py`'s `corpus` fixture ran `git commit` under the caller's global git configuration, so a global `commit.gpgsign=true` failed the setup before any probe ran.

It now sets `GIT_CONFIG_GLOBAL=/dev/null` and `GIT_CONFIG_NOSYSTEM=1`, as `tests/test_checkout_head.py` does. Measured with a hostile global config (`commit.gpgsign = true`, `gpg.program = /bin/false`):
- at `b50e3b1`: `7 passed, 7 errors`;
- at `32683e8`: `14 passed`.

[Replied](#67 (comment)). The probes are unchanged.

## Fix round 2: `runtime migrate` and `reset` refuse what a local install cannot be (`525f61c`)

Copilot's second review, at `32683e8`, raised two points in its overview, with no inline thread. Both are [answered on the PR](#67 (comment)).

1. **Real, and fixed.** `load_migration_settings` recorded `local` but never asked `refuse_what_a_local_install_cannot_be`. So `runtime migrate` and a confirmed `runtime reset` accepted a broker setting, or a non-loopback `OPENDOX_BIND_HOST`, beside `OPENDOX_INSTALL_MODE=local`. They now refuse at configuration, before any database is reached.
   - Seven new cases in `tests_runtime/test_install_mode.py`: the three broker settings × {`migrate`, `reset --confirm …`}, plus the bind.
   - Against `32683e8`'s config they give `7 failed`; here they pass.
2. **Pre-existing, and not changed here: `::1` passes the loopback rule, but the server cannot bind it.** `serve.build_server` is IPv4-only (`ThreadingHTTPServer`), while `serve.LOOPBACK_HOSTS` lists `::1`.
   - Measured at #60's head `f097fd8`, before this PR: `127.0.0.1` binds, and `::1` fails with `gaierror [Errno -9] Address family for hostname not supported`.
   - This PR's rule is `serve.LOOPBACK_HOSTS` itself (13.4's *"same judgement"*). So `::1` is classified exactly as the document server already classifies it, and then fails at the bind exactly as it does in hosted mode today.
   - The fix is a `serve.py` change (address family, and `server_url`'s brackets), outside T070's file set. It is listed below for the holder.

## Fix round 3: `status` reports a local install's broker on its early return too (`02dadc5`)

Copilot's review at `525f61c` raised one point in its overview, with no inline thread. It is real, and it is [answered on the PR](#67 (comment)).
- With the runtime extra absent, `runtime status` returns early, and that return said `broker_keys: "not probed"` for every install.
- Local now gets the full report's answer there: `"not configured (local mode)"`, with `broker_discovery: null`. Both returns write it through one helper.
- Hosted still says `"not probed"` (13.6).
- The new case runs with `opendox.runtime.db` absent from `sys.modules`. `[local]` fails against `525f61c`'s `runtime/cli.py` and passes here; `[hosted]` passes in both.
- Four mutants of the fix are killed.

## Fix round 4: a healthy local `status` is proven to exit 0; `RuntimeSettings`' invariants are scoped (`859b37b6`)

Copilot's review at `02dadc55` opened two threads, both real. Both are answered and resolved.
- [r4139922962](#67 (comment)): both local `status` cases forced a database fault, so nothing proved exit 0.
  - A DB-backed case now runs local `status` against a migrated schema on the suite's server and asserts `ok`, exit 0, and a broker that is not configured and never probed.
  - With the local return mutated to `ok=False`, the new case fails and the module's other 40 pass. Before this commit, that mutant survived.
- [r4139922999](#67 (comment)): the docstring's broker statements hold for `load_settings` only, so they are now scoped to their loader. `load_migration_settings` carries the migration sentinels in either shape. This is documentation only.

## The repo's own suite

Full `python -m pytest -q`, `LANG=C.UTF-8`, `CI=true`, against a `postgres:16` like `validate.yml`'s:

| | selected | passed | skipped | failed | errors |
|---|---|---|---|---|---|
| #60's head `f097fd8` | 2485 | 2474 | 11 | 0 | 0 |
| `b50e3b1` (T070) | 2531 | 2520 | 11 | 0 | 0 |
| `525f61c` (fix round 2) | 2538 | 2527 | 11 | 0 | 0 |
| `02dadc5` (fix round 3) | 2540 | 2529 | 11 | 0 | 0 |
| `859b37b6` (fix round 4) | 2541 | 2530 | 11 | 0 | 0 |
| `3185e7d` (merges #60's `adeb6fed`, which carries main `047bb4fa`), before the callers' edit | 3117 | 3102 | 11 | **4** | 0 |
| `c8fac05e` (the four callers say `--local`) | 3117 | 3106 | 11 | 0 | 0 |
| `cdf7382b` (merges #60's `c39d960e`; the callers inherit no runtime setting) | 3126 | 3115 | 11 | 0 | 0 |
| `d1de1fd9` (the healthy-local status case sets its schema with `make_conninfo`) | 3126 | 3115 | 11 | 0 | 0 |
| `105f2f12` (no exported runtime setting reaches a `tests_runtime` case), clean and with `OPENDOX_INSTALL_MODE=local` exported | 3126 | 3115 | 11 | 0 | 0 |
| this branch, `25262459` (merges main `7ff434d9`: #60, #65 and #71; #71's generate-and-open child gains `--local`) | 3185 | 3174 | 11 | 0 | 0 |

`026f00ea` (fix round 5) is a docstring change. The install-mode module now names its one DB-backed case ([r4146171212](#67 (comment)), resolved), and the module runs 41 passed.

That is +56 cases: this PR's two new files, plus the `.env.example` census's new parameter (+46 at `b50e3b1`), fix round 2's seven, fix round 3's two, and fix round 4's one. `EXPECT_SKIPPED=11` holds exactly, and the floors (`MIN_SELECTED=2476`, `MIN_PASSED=2465`) allow the rise unchanged.

## Merge-from-main round, and what T070 owed once T056 landed (`3185e7d`, `c8fac05e`; 2026-10-02)

Phase 2 has landed. #60 (T071) merged main `047bb4fa` as `adeb6fed`, and `3185e7d` merges that head here.
- **The merge itself.** Git auto-merges `src/opendox/cli.py` and `tests/test_doxbench_entrypoint.py` without a conflict. Main's `_refuse_empty_source_options` sits after the install shape is resolved, and `--local` still precedes `--host`.
- **The edits T070 owed.** Since this PR, an unflagged `generate-and-open` is HOSTED and refuses without its broker's issuer. Four cases that landed with phase 2 relied on the old default, and all four failed on the merged tree with that refusal. Each runs the single-user install, so each now passes `--local` (`c8fac05e`). None means hosted, so none takes a hosted fixture.
  1. **`tests/test_standalone_generate_path.py`** (T056), case 3, `test_generate_and_open_starts_a_server_that_answers_with_no_sibling`. Its module docstring now names the change and moves F10.1's plain-install run to T077.
  2. **`tests/test_post_render_validator.py`** (T058), `test_generate_and_open_gives_the_same_verdicts`, both fixtures.
  3. **`tests/test_projection_seams.py`** (T055), `test_generate_and_open_refuses_an_empty_source_option_before_its_run_dir`.
- **The stand-ins in `tests_runtime/local_entrypoint_driver.py`** go too, but that driver is T072's file and does not exist on this branch. Its edit is named in #69's merge round.
- **Mutants** of the local path, each failing all four cases: `--local` ignored; local refusing its own loopback default; local also asking for the hosted issuer.
- **Full suite:** `3117 selected, 3106 passed, 11 skipped, 0 failed`.

## Fix round: the `--local` callers inherit none of the runner's runtime settings (`9ae5e72`, `cdf7382b`)

`9ae5e72` merges #60's fix round `c39d960e` (a PostgreSQL scheme libpq would not read as a URI is refused), cleanly.

Copilot's review at `c8fac05e` opened three threads, all real and all now answered and resolved. A `--local` caller took the runner's environment along, so an exported `OPENDOX_INSTALL_MODE=hosted` or broker issuer made it refuse before it reached what it tests.
- **`tests/standalone_child.py`:** every child's environment drops each name in `opendox.runtime.config.SETTING_NAMES`.
- **`tests/test_projection_seams.py`:** the in-process empty-option case scrubs them first, as the doxBench entrypoint fixture does.
- **A harness case** exports a hosted install's four settings and asserts that a child sees none of them.

Evidence:
- Under exported hosted settings, all 5 cases fail against `9ae5e72` and pass here.
- Both mutants are killed.
- Full suite: `3126 selected, 3115 passed, 11 skipped, 0 failed`.

## Fix round: the healthy-local status case reads either DSN form (`d1de1fd9`)

Copilot's review at `cdf7382b` opened one thread, which is real and is now answered and resolved.

`OPENDOX_TEST_DATABASE_URL` may be libpq's keyword/value form as well as a URI. `test_runtime_status_of_a_healthy_local_install_exits_zero` appended `?options=…` to it. On the keyword/value form that suffix becomes part of `dbname`, so the case failed while the fixtures connected (measured). The case now sets `options` with `psycopg.conninfo.make_conninfo`, which works on either form. The runtime's `schema_selected_by` reads the schema back out of the result on both forms.

Evidence:
- **Both forms:** `tests_runtime/test_install_mode.py` passes whole under each.
- **Mutant:** dropping the `search_path` option is killed on both forms.
- **Full suite:** `3126 selected, 3115 passed, 11 skipped, 0 failed`.

The same suffix spelling already exists in main's `tests_runtime/test_migrations_apply.py`. It is not this PR's code, so it is left out of scope.

## Fix round: no runtime setting the runner exports reaches a `tests_runtime` case (`105f2f12`)

Copilot's review at `d1de1fd9` opened one thread, which is real and is now answered and resolved. Since this PR the runtime reads `OPENDOX_INSTALL_MODE`. A runner that exported `local` made every hosted case that leaves it unset a configuration refusal: 20 cases, measured. `tests_runtime/conftest.py` gains an autouse fixture that clears every `SETTING_NAMES` entry before each case; `OPENDOX_TEST_DATABASE_URL` is kept, and the production refusal is unchanged.

Evidence:
- **Full suite**, with a local mode and a broker issuer and audience exported and in a clean environment alike: `3126 selected, 3115 passed, 11 skipped, 0 failed`.
- **Mutant:** a scrub that clears nothing is killed.

## Merge of main after #60 landed (`25262459`; 2026-10-02)

#60 (T071) landed as `7ff434d9`, after #65 (T088) and #71 (T085). `25262459` merges that main.
- **`src/opendox/runtime/config.py`'s four conflicts.** Main's side of each is #60's squash, whose `config.py` is byte-identical to `c39d960e`, which this branch already carried (`git diff c39d960 origin/main` on that file is empty). So each resolves to this branch's side: T071 plus T070's install mode.
- **One edit inside the merge commit, because of T070.** #71's `tests/test_doxbench_defaults.py::test_the_served_catalog_route_answers_from_generate_and_open` runs `python -m opendox.cli generate-and-open` as a child. Unflagged, that is now HOSTED, and with no issuer it refused: `generate-and-open refused: OPENDOX_OIDC_ISSUER is required and is not set, and this install is HOSTED`. It now passes `--local`, the single-user install the case means, with a comment saying why.
- **#65's real-serve lens test needs nothing.** `tests/test_lens_seed_actions.py` runs `cli.main(["generate", …])` and `serve.build_server`, never `generate-and-open`, so T070 does not reach it. It passes unchanged.
- **#74 is not on main yet.** Its `tests/test_chat_model_configuration.py` fixtures will need the same `--local` when it lands after this PR.
- **Full suite:** `3185 selected, 3174 passed, 11 skipped, 0 failed`.

## Downstream, for the holder

- **`serve.py` cannot bind `::1`** (pre-existing, measured at `f097fd8`; fix round 2, item 2). `LOOPBACK_HOSTS` lists `::1`, so `--local --host ::1` passes the loopback rule and then fails at the bind with `gaierror`, as `--host ::1` already does in hosted mode. The fix makes the serve path IPv6-aware, which is a follow-up in `serve.py`'s single-writer order. Until then, `::1` could instead be dropped from `LOOPBACK_HOSTS`. That is the holder's call; this PR does neither.
- **The help-tree golden in openxFactory changes at the phase-3 pin.** `tests/ideation-dashboard/fixtures/cli-help-tree.golden.txt` (read by `test_extension_point_parity.py`) snapshots `generate-and-open`'s options, and `--local` is a new one. T094's consumer-pin PR regenerates it. openXdox-code's help-tree case (T042/T008) may need the same.
- **T056 landed before T070**, as the holder ordered. Its edits are done and named in the merge round above.
- **Overlap** (`gh pr diff -R opensoft/openDox-code`): `src/opendox/cli.py` is also rewritten by #59 (T055, +260/−112), in `cmd_generate_and_open` and `build_parser`. `cli.py`'s single-writer order is T055 → T058 → T070. #57, #58 and #59 have landed, and this stack took its merge-from-main round after them. #57 and #61–#64 do not touch these files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Oct 3, 2026
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Arc: neutral-product-standalone-operability

Plan 034, phase-3 slice **P3-B**, task **T079**. The plan was read at openxFactory `main` `e369cb25`, from `specs/034-opendox-standalone-operation/tasks.md`, and read again at `main` `2140f5a7` and, after T063 landed, at `main` `a883bbf6`: T079's entry is unchanged at both. The slice is claimed on openxFactory#656, comment `5875729625`.

**This was drafted ahead, and T063 has now landed.** Brett's phase-3 word, as the holder recorded it (2026-09-28, ~18:00Z), was *"Only the independent ones (Recommended)"*. T079 is `After: T078`, and every phase-3 task comes after T063. T063 landed as openxFactory#1218 → `a883bbf6`, which closes phase 2, and T078 landed as #61 → `8a98e317`. So this PR may go READY. Its READY line is the holder's to post.

**One PR per task, stacked.** T078 (#61) has landed, and the holder retargeted this PR to `main`. T080 is based on this one (#63 (`build/034-p3b-t080-raw-key-refusal`)). Land this, then T080. Retarget #63 to `main` before this branch is deleted, because a merge with `--delete-branch` closes the PR stacked on it.

## What changes

- The binding record gains **`model`**: the model name the provider receives as the request's `model`, in either dialect. It sits after `dialect`, with the route it belongs to, so `BINDING_FIELDS` grows from nine fields to ten. Still no field can hold a secret.
- `model-binding add|edit --model` sets it, and `model-binding list` shows it.
- The catalog handle stays the binding's `id`, so a chosen menu entry still resolves back to its binding. `model` is not an argv placeholder, and `ARGV_PLACEHOLDERS` is unchanged.

Files: `src/opendox/doxbench_binding.py`, `src/opendox/doxbench_provider.py`, `src/opendox/cli_model_binding.py` and `tests/test_model_provider_broker.py`, all inside P3-B's row. One docstring outside the row, `src/opendox/doxbench_intake.py`'s, is corrected and flagged below.

**Realizes**: 16.2. **Ruled**: R1Q22 (a), `5817152735`.

## One choice the plan's text leaves open, which Brett let stand

Brett's word, relayed by the holder on 2026-09-28: `model` stays optional.

**`model` is keyword-only, and it defaults to None, meaning "none declared".** A binding that declares none keeps the meaning it had: the request names the catalog handle, the binding's `id`. Tests pin it: the prompt grammar's request bytes (T078's test, unchanged here), and the handle as the model in both grammars. A stored record may leave `model` out (`OPTIONAL_BINDING_FIELDS`), and every other field stays required. Three things decided it:

1. `serve_workbench.py`'s console intake route builds a `ModelProviderBinding` by keyword, with no model. A required field would break it, and that file belongs to T055 (openDox-code#59, since landed) and T084, not to P3-B. It keeps working unedited. Every existing test in this file builds its binding the same way, by keyword with no model, and all of them pass.
2. Every stored nine-field document still reads, and a test holds it.
3. openXdox-code's `tests/test_doxchat_model_intake.py:1234` builds a nine-field binding by keyword. It keeps working at T086's pin.

A **required** model would have had to move `serve_workbench.py`'s intake route, and a field in its view, in the same act. That would have needed a plan note, not a quiet widening of this slice.

**A consequence, flagged for the owner of `serve_workbench.py`**: the console's intake flow cannot set a model yet, because its closed `INTAKE_QUERY_FIELDS` has no `model`. So an `openai-chat-v1` binding enrolled through the console names its id as the model until that flow learns the field. `model-binding add --model` is the door that sets it today.

## The falsifier: F16.1's `BINDING_FIELDS` assertion

This is F16.1's record block, verbatim from #1144 (the same extract as T078's PR, sha256 `8af3001b5f5fb885…`, unchanged at openxFactory `main` `2140f5a7`):

```python
assert "openai-chat-v1" in b.DIALECTS, f"no OpenAI-compatible dialect: {b.DIALECTS}"
assert "model" in b.BINDING_FIELDS, f"the record names no model: {b.BINDING_FIELDS}"
rec = {f: "stand-in" for f in b.BINDING_FIELDS}
...
b.ModelProviderBinding.from_record(rec)               # the control: a clean record is accepted
```

At T078's head `d07b9371` it stops at the `BINDING_FIELDS` assertion (`the record names no model: (… 'dialect', 'broker_argv')`). At this head `e7f3a7b3` both assertions pass, and so does the control record (ten fields, `model: "stand-in"`). The block then stops at its first keyed URL, which is T080's to refuse:

```
FAIL: a raw key was accepted in ['endpoint']
```

The named test `test_f16_1_the_record_names_a_model` asserts it as #1144 writes it, and pins the ten-field order.

## The repository's own suite

Local runs of the whole suite, as CI runs it (`python -m pytest -q`), use a PostgreSQL 16 service for `tests_runtime` and `LANG=C.UTF-8`, as on the runner:

| tree | passed | skipped | failed |
|---|---|---|---|
| `main` `8a98e317` (T078 landed) | 3138 | 11 | 0 |
| this head `e7f3a7b3` | 3156 | 11 | 0 |

`main` `8a98e317`'s row was run on a trial merge of T078's head `d07b9371` into `main` `7ff434d9`, and that merge's tree is `8a98e317`'s, byte for byte. Before this round, `main` `047bb4fa`, T078's `d07b9371` and this branch's `b04a3a95` read 3044, 3065 and 3083. Before phase 2 landed, the same three read 2468 (`2d116415`), 2489 (`6e1b8942`) and 2507 (`053e207a`).

CI's `validate` at this head (run `37081644588`) reads `selected=3224 passed=3213 skipped=11 failures=0 errors=0`, against the pins 2476, 2465 and exactly 11. That run checked out GitHub's merge of this head into `main` `66ff7257`. T070 (#67) landed there after this round's merge, so the run counts T070's cases too. At the merge `cb059d5d` (run `37080549094`) it read `selected=3167 passed=3156 skipped=11 failures=0 errors=0`.

- The +18 cases are in `tests/test_model_provider_broker.py`. Skipped stays at the pinned 11.
- `tests/test_provider_boundary.py`: 24 passed.
- `validate.yml` is outside this slice, and its floors permit the rise.

## Merging `main` (`cb059d5d`)

`cb059d5d` merges openDox-code `main` `8a98e317`. That is T078's squash (#61), on top of T085 (#71), T088 (#65) and T071 (#60), which landed just before it. This branch carried T078's own commits, so the three files T078 changed met its squash on `main`:

- `main`'s copy of each equals T078's head `d07b9371`.
- Two of them, `src/opendox/doxbench_provider.py` and `tests/test_model_provider_broker.py`, conflicted only where this branch changes T078's lines. Each is resolved to this branch's side.
- So the merge adds exactly what `main` gained beyond T078. `git diff b04a3a9 cb059d5` is `git diff d07b937 8a98e31`: 17 files, none of them this PR's.

The suite above is this merge's, with `e7f3a7b3`'s docstring fix on top. Since then, `main` has moved to `66ff7257` (T070, #67). This head merges into it cleanly, and CI's run above is that merge. Before this round, `b04a3a95` merged T078's head `d07b9371`, which merged `main` `047bb4fa` (phase 2's nine landings), with no conflict.

## Review remarks, answered at `b04a3a95`

- **Copilot's overview** (review `5343385726`, at `7c83c2cd`) noted that *"intake documentation still contradicts the expanded binding contract"*. It did. `doxbench_intake.py`'s module docstring called the binding a *"closed nine-field record"* and its declaration *"not a tenth field on it"*. `053e207a` names each count by its tuple, records that the binding grew once, by `model`, and reads *"not a field on it"*. It is a docstring only.
  - **Flagged**: `src/opendox/doxbench_intake.py` is outside P3-B's row. No plan-034 task names the file. When it was checked, no open PR touched it: #53, #54 and #56 to #60 then, and #60, #65, #67 and #69 again at `b04a3a95`, and phase 2's landings did not touch it either. At `cb059d5d`, `main`'s later landings do not touch it, and two open PRs do: #63, stacked on this one, and T082's #76, which adds 14 lines to it. A trial merge of this head with #76's head `dcdb7554` is clean. If the holder wants that edit made elsewhere, reverting its two commits, `053e207a` and `e7f3a7b3`, changes no behaviour.
- **SonarCloud** reported no findings on this PR.
- **Copilot's re-review run at `053e207a`** (Actions run `36473415338`) finished without posting a review, and its log records no stored comment.
- `a63dcb8b` merges T078's SonarCloud test fix into this branch, so the stack stays one line.
- **Copilot at `b04a3a95`**, the merge of `main`: two reviews, both *Needs a closer look* with `Findings: None` and no thread.
  - The first came with the push (review `5396324583`).
  - The second was asked for through the reviewer API (review `5396377423`).
  - Both summaries ask for a final human review of a change across persistence, provider behaviour and the CLI. The second also names the stacked dependencies, which are the draft flag at the top.
- **SonarCloud at `b04a3a95`**: 0 issues, quality gate OK.
- **Copilot at `cb059d5d`**, the merge of `main` `8a98e317` (review `5398043432`, asked for through the reviewer API): *Needs a closer look*, one low-severity finding. The docstring's *"the catalog's grew"* and *"the binding's grew"* read as possessives used as verbs. Each stood for the shape it named, and the review shows that a reader can miss that, so `e7f3a7b3` names the noun: *"the catalog entry's shape"* and *"the binding's record"*. It is a docstring only. The thread is answered (`4170880327`) and resolved.
- **Copilot at `e7f3a7b3`** (review `5398096928`, asked for through the reviewer API): *Needs a closer look*, `Findings: None`, and no thread. Its summary names the change's reach across persistence, provider behaviour, the CLI and the stacked dependencies.
- **SonarCloud at `e7f3a7b3`**: 0 issues, quality gate OK.

## For the holder

- **Downstream, not edited here**: openxFactory's `cli-help-tree.golden.txt` gains `[--model MODEL]` in the `model-binding add|edit` usage at T094's pin.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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