Skip to content

T027: the doxBench seams -- the schema validators and the status-exemption rail (serve_wire.py:1369, doxbench_packet.py:177) - #41

Merged
brettheap merged 5 commits into
mainfrom
build/034-p1e-doxbench-seams
Sep 27, 2026
Merged

brettheap merged 5 commits into
mainfrom
build/034-p1e-doxbench-seams

Conversation

@brettheap

@brettheap brettheap commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

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

Plan 034, slice P1-E, task T027. The plan is specs/034-opendox-standalone-operation/tasks.md in opensoft/openxFactory. I read it at #1167's head 42f34ab7, which landed as a65230f6, and it is unchanged on main at 79a720a2. The claim is opensoft/openXfactory#656 comment 5850107036.

  • Realizes: 4.3, 2 of its 8 reaches into openxFactory.
  • Ruled:
    • R1Q22 (a), comment 5817152735: the carved files need no declared-edit act.
    • R1Q24 (a), comment 5850003126: this task stays as planned. Each seam fails closed, and the standalone defaults are T085's, phase 3, where R1Q10 (a) fills them.
  • After: T006, which is done. This PR depends on nothing that is still open, so it can leave draft once its checks and review are clean. The branch merges main at a435aecf, which carries T020 (e295b1a9), T026 (582ed073) and T015 (a435aecf).

What it does

Two deferred reaches into openxFactory's ideation_dashboard package, at 1e4a57fb:

reach function imported for
serve_wire.py:1369 default_doxbench_validators ideation_dashboard.doxbench_contracts the doxBench schema validators
doxbench_packet.py:177 _status_exemption ideation_dashboard.doxbench_status_exemption the Status: read that the packet assembler's exemption rail marks sources with

Each is now a seam that a host fills with one registration at process start. Both follow opendox.domain_profile's one-registration idiom:

  • registering the same object again does nothing;
  • registering a different one is refused (...AlreadyRegistered);
  • registering a non-conforming object is a TypeError;
  • unregister_...() and ..._registered() sit beside each seam.

The validators seam is serve_wire.register_doxbench_validators(factory).

  • factory() answers the released per-kind validators. It is called per request and never cached, so a factory that re-verifies its pin keeps a mid-run repin observable.
  • With nothing registered, default_doxbench_validators() refuses DoxbenchValidatorsNotRegistered, naming the seam and the call. WorkbenchRoutes._doxbench_validators turns that into None, as it does every factory failure, so the two model routes refuse with their fixed codes and no text reaches the wire.
  • build_server's default binding, and serve.py, are unchanged.

The rail seam is doxbench_packet.register_status_exemption(rail).

  • rail is a module or an object that carries callable lifecycle_status and is_compression_exempt. A rail without both is refused at registration, not at the first assembly.
  • A lazy rail whose lookup of either name raises, with a ModuleNotFoundError for example, is refused in the same way. Its failure is chained to the TypeError and never escapes as itself.
  • The same rail registered again is answered by identity, before any probe, so a registered rail is never probed twice. Both of these came from Copilot's review.
  • With nothing registered, the assembler refuses StatusExemptionNotRegistered before any source is marked. The refusal names the seam and the call, and it is a PacketError, so a caller that maps packet refusals to a fixed code maps this one too.
  • The rail's seven names still answer on the packet module. With a rail registered they are the rail's own objects: registering openxFactory's module gives identity, as its tests read today. With none registered they raise an honest AttributeError, so hasattr stays False. A rail's lazy ModuleNotFoundError, and a name the rail does not carry, are translated the same way.

Files: src/opendox/serve_wire.py, src/opendox/doxbench_packet.py, and a new tests/test_doxbench_seams.py. validate.yml is not touched, because no slice edits it before T036.

Falsifier 1: F4.1's scan

This is #1144's Group 4 FALSIFIED BY ast block, run from the checkout as python3 - src/opendox. The whole scan stays red until T089. This task's two hits are gone, and nothing else in the list moved:

$ diff <(scan at main a435aecf) <(scan at this head)
10d9
<   src/opendox/doxbench_packet.py:177: ideation_dashboard.doxbench_status_exemption
16d14
<   src/opendox/serve_wire.py:1369: ideation_dashboard

At main the scan finds 24 deferred reach(es). At this head it finds 22 deferred reach(es), listed here:

  src/opendox/authoring.py:318: corpus_adapter_openxfactory
  src/opendox/branch_session.py:1568: openxdox
  src/opendox/branch_session.py:1587: openxdox.register
  src/opendox/branch_session.py:2005: openxdox
  src/opendox/branch_session.py:2105: openxdox.snapshot_registry
  src/opendox/branch_session.py:2151: openxdox.snapshot_registry
  src/opendox/branch_session.py:2228: openxdox.snapshot_registry
  src/opendox/branch_session.py:3573: openxdox.snapshot_registry
  src/opendox/cli.py:610: openxdox.snapshot_registry
  src/opendox/serve.py:1993: openxdox.corpus_root
  src/opendox/serve.py:629: openxdox.corpus_root
  src/opendox/serve.py:713: doc_health.corpus
  src/opendox/serve_project.py:246: openxdox.gate_console
  src/opendox/serve_project.py:247: openxdox.kickoff
  src/opendox/serve_workbench.py:1215: openxdox
  src/opendox/serve_workbench.py:1665: openxdox
  src/opendox/serve_workbench.py:2607: openxdox
  src/opendox/serve_workbench.py:347: openxdox
  src/opendox/serve_workbench.py:407: openxdox
  src/opendox/serve_workbench.py:408: openxdox
  src/opendox/serve_workbench.py:544: openxdox
  src/opendox/workbench.py:746: doc_health

(T026, openDox-code#39, removed workbench.py:1407-1409 and is on main. T025, openDox-code#43, removes workbench.py:746 separately.)

Falsifier 2: the seam tests

The run is in a fresh venv with pip install ".[test]". It first asserts that the four siblings are absent:

the four siblings are absent
$ python -m pytest -q tests/test_doxbench_seams.py --noconftest
37 passed in 0.19s

Red at main. With the same file copied onto a435aecf, the run gives 35 failed, 2 passed. The decisive failures are the booby-trapped ideation_dashboard modules in sys.modules, which main reaches through both functions:

AssertionError: the validators reached the publisher's package: ['ideation_dashboard.doxbench_contracts', 'ideation_dashboard.doxbench_contracts', 'ideation_dashboard.doxbench_contracts.validators']
AssertionError: the rail reached the publisher's package: ['ideation_dashboard.doxbench_status_exemption', 'ideation_dashboard.doxbench_status_exemption.lifecycle_status', ...]

The two cases that pass at main are the negative control, and the check that the model routes' resolver answers None with nothing registered. That check held at main too, through the missing module, and this PR keeps it true through the named refusal.

Why --noconftest. The plan requires it (tasks.md § Phase 1). With the root conftest in play, the file errors 37 times on ModuleNotFoundError: No module named 'ideation_dashboard'. The autouse declared_human_console fixture raises it when it imports opendox.cli, and it stops once T011 lands. With the Group 2 shim on the path, which simulates T011, the whole suite runs with the root conftest, and these 37 cases pass there.

The repository's own checks

validate, replayed locally. Its three pytest steps give the same results as main:

step result
pytest 745 passed, 2 skipped
pytest (S7 residue) 13 passed
pytest (runtime, hermetic) 360 passed, 1 skipped

The triple is unchanged: selected 1121, passed 1118, skipped 3. The new file is in none of validate's lists, so it moves no floor. The CI validate check on this PR is the gate.

The whole suite, with the Group 2 shim (research R3's measurement):

tree result
main a435aecf 20 failed, 1258 passed, 13 skipped, 66 errors
this head 20 failed, 1295 passed, 13 skipped, 66 errors

I compared the two JUnit reports test by test. No outcome changed. The 86 red results are the same 86, and the 37 new cases pass.

The consumer's negative space. The 11 spellings that openXdox-code's tests/test_doxbench_packet.py::_FORBIDDEN_MODULE_NEEDLES forbids in this module (import os, open(, write_text, subprocess, urllib, socket, [:MAX_PACKET_BYTES, [:MAX_PACKET_SOURCES, textwrap, sqlite3, def promote) each have 0 hits in the new doxbench_packet.py.

For the tasks downstream

  • T046 (P1-K). The host registers both of its implementations, once, in the same process-start call that registers its profile (scripts/opendox_host.register_openxfactory()). openxFactory's tests read both through the conftest's registration:

    from ideation_dashboard import doxbench_contracts, doxbench_status_exemption
    from opendox import doxbench_packet, serve_wire
    serve_wire.register_doxbench_validators(doxbench_contracts.validators)
    doxbench_packet.register_status_exemption(doxbench_status_exemption)

    For example, tests/ideation-dashboard/test_doxbench_routes.py:2644 calls serve_mod.default_doxbench_validators(). tests/ideation-dashboard/test_doxbench_status_exemption.py:245-262 reads the seven names off the packet module and checks identity with the rail module's own objects. That identity holds when the module itself is registered, and registering the same module again, from a second entry point, is a no-op by identity.

  • T047 and T007 batch E (P1-K). tests/ideation-dashboard/test_doxbench_status_exemption.py::test_the_dependence_on_the_carved_rail_sits_at_exactly_one_line asserts exactly one import of ideation_dashboard.doxbench_status_exemption in the pinned packet module. At the new pin there is none, so that test goes red at T047's pin and is a candidate for batch E's named composition tests. test_the_carved_away_case_is_an_ordinary_attribute_error_too stays green, because __getattr__ still translates a ModuleNotFoundError.

  • T041, T043 and T019 (P1-J). At the phase-1 pin, openXdox-code's class-H files no longer fail on No module named 'ideation_dashboard.doxbench_status_exemption'. Those files are test_doxbench_packet.py (54 cases), test_doxbench_turns.py (32) and test_doxbench_abstract_envelope.py (1), per T005. With no rail registered they fail on StatusExemptionNotRegistered, whose message names this seam. R1Q24 (a) puts them in the declared exclusion. The reason each entry carries, and classify_whole_suite.py's class-H rule, should read the new message.

  • The chat-turn route, for T085. In a process where neither seam is filled (standalone, in phase 1), the route refuses model_capability_unavailable at the validators seam, before it assembles a packet. A host that fills the validators seam but not the rail meets StatusExemptionNotRegistered inside the route's packet boundary. The route maps that, as it maps every packet refusal it does not name, to its fixed invalid_turn_request code, and it frees the turn's slot (turn_store.fail) instead of dropping the connection mid-lease. The mapping lives in serve_workbench.py, which is not this slice's file, and T085's standalone default removes the case.

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

🤖 Generated with Claude Code

Summary by Sourcery

Decouple doxBench validation and status-exemption behavior from openxFactory by replacing deferred imports with explicit host registration seams that fail closed when unconfigured.

New Features:

  • Add process-start registration seams for doxBench schema validators and status-exemption rails, with explicit registration state and lifecycle controls.

Bug Fixes:

  • Remove deferred dependencies on openxFactory's ideation_dashboard package so standalone openDox no longer reaches publisher modules at request or packet-assembly time.
  • Fail closed with explicit seam errors when validators or status-exemption rails are unavailable, preventing unvalidated routes and unmarked packets.

Enhancements:

  • Preserve existing validator and status-exemption interfaces while supporting idempotent registration, conflicting-registration protection, validation of registered rails, and lazy alias access.

Tests:

  • Add comprehensive seam tests covering registration behavior, fail-closed handling, publisher-isolation checks, packet marking, route resolution, and static deferred-reach detection.

…n 034 T027)

Two of the eight deferred reaches into the publisher that
opensoft/openXfactory#1144's task 4.3 routes in phase 1 (plan 034, tasks.md
T027), both into openxFactory's ideation_dashboard package at 1e4a57f:

- serve_wire.py:1369, default_doxbench_validators, imported
  ideation_dashboard.doxbench_contracts for the doxBench schema validators;
- doxbench_packet.py:177, _status_exemption, imported
  ideation_dashboard.doxbench_status_exemption, the Status: read the
  packet assembler's exemption rail marks sources with.

Each now resolves what a host registered, once, at process start:
serve_wire.register_doxbench_validators(factory), called per request, and
doxbench_packet.register_status_exemption(rail), a module or object carrying
the reader's names. With nothing registered each fails closed, naming itself
and its registration call (4.2's discipline): the validators factory refuses
DoxbenchValidatorsNotRegistered, so the two model routes refuse with their
fixed codes, and the assembler refuses StatusExemptionNotRegistered, a
PacketError, rather than assembling a packet with its sources unmarked. The
rail's seven names still answer on the packet module, as the registered
rail's own objects, and as an honest AttributeError with none registered.
build_server's default binding and serve.py are unchanged. openxFactory
registers its own (T046); the standalone defaults are T085's.

tests/test_doxbench_seams.py holds both seams to that: the named refusals,
the fail-closed readers, a booby-trapped ideation_dashboard that is never
reached, registered stand-ins answering through the seams, the
one-registration discipline, and an ast check that neither seam makes a
deferred reach.

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 26, 2026 22:18
@sourcery-ai

sourcery-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR removes the two remaining deferred reaches into openxFactory by introducing explicit validators and status-exemption registration seams, with fail-closed behavior, per-request validator resolution, lazy rail aliases, and comprehensive regression tests validating isolation and registration semantics.

Sequence diagram for registered doxBench validators resolution

sequenceDiagram
    participant Request
    participant WorkbenchRoutes
    participant serve_wire
    participant HostFactory

    Request->>WorkbenchRoutes: _doxbench_validators()
    WorkbenchRoutes->>serve_wire: default_doxbench_validators()
    serve_wire->>HostFactory: factory()
    HostFactory-->>serve_wire: validators
    serve_wire-->>WorkbenchRoutes: validators
    WorkbenchRoutes-->>Request: schema validators

    alt no factory registered
        serve_wire-->>WorkbenchRoutes: DoxbenchValidatorsNotRegistered
        WorkbenchRoutes-->>Request: None and fixed route refusal
    end
Loading

Sequence diagram for status-exemption rail during packet assembly

sequenceDiagram
    participant Caller
    participant doxbench_packet
    participant Rail
    participant Sources

    Caller->>doxbench_packet: exemption_rail(sources)
    doxbench_packet->>doxbench_packet: _status_exemption()
    doxbench_packet->>Rail: lifecycle_status(text)
    Rail-->>doxbench_packet: status
    doxbench_packet->>Rail: is_compression_exempt(text)
    Rail-->>doxbench_packet: exemption decision
    doxbench_packet->>Sources: mark exemption
    doxbench_packet-->>Caller: marked sources

    alt no rail registered
        doxbench_packet-->>Caller: StatusExemptionNotRegistered
    end
Loading

File-Level Changes

Change Details Files
Replace the two deferred openxFactory imports with explicit process-start registration seams that fail closed when unconfigured.
  • Add one-registration APIs, idempotent same-object registration, conflict detection, unregister helpers, and registration-state queries for validators and the status rail.
  • Resolve validators through a per-call registered factory; preserve route-level failure mapping and avoid caching.
  • Resolve packet status-exemption behavior through a registered rail; reject invalid rails at registration and refuse packet assembly when absent.
  • Preserve lazy packet-module aliases for the rail's seven exported names, translating missing or lazy-loading attributes into ordinary AttributeError responses.
  • Add focused seam, fail-closed, no-deferred-import, identity, lifecycle, and registration-discipline tests.
src/opendox/serve_wire.py
src/opendox/doxbench_packet.py
tests/test_doxbench_seams.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

🟡 Changes recommended

Fix rail validation failures and ensure the new seam tests run in required CI.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR replaces deferred openXfactory imports with explicit registration seams for doxBench validators and status-exemption behavior.

Changes:

  • Adds fail-closed validator registration and per-request resolution.
  • Adds status-exemption rail registration and lazy aliases.
  • Adds seam, isolation, and dependency tests.
File Summary
tests/​test_doxbench_seams.py Adds registration and fail-closed behavior tests; should be included in required CI coverage.
src/​opendox/​serve_wire.py Adds the doxBench validator registration seam.
src/​opendox/​doxbench_packet.py Adds the status-exemption rail seam; attribute-probe failures need normalization, and one docstring needs updating.

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

Comment thread src/opendox/doxbench_packet.py Resolved
brettheap and others added 2 commits September 26, 2026 22:38
register_status_exemption() probed the rail's two required names with
getattr(rail, name, None). That default absorbs AttributeError only, so a
lazy rail whose lookup raised anything else (a ModuleNotFoundError from
what it loads on first use, say) escaped the registration as that failure
instead of the seam's own refusal. Every probe failure now marks the name
missing, and the TypeError that names what the rail lacks is chained to
the first such failure. A plainly non-conforming rail is refused as before,
with no cause.

The alias docstring named a reader that no longer exists; it now names the
two outside test files that bind this module as pk.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s branch

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 27, 2026 00:18
@brettheap

Copy link
Copy Markdown
Contributor Author

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

On Copilot's overview at a720a720: "ensure the new seam tests run in required CI", and, for tests/test_doxbench_seams.py, "should be included in required CI coverage".

This is deliberate, and #39 received the same answer. Plan 034's tasks.md § Phase 1 says:

No slice edits openDox-code's validate.yml before T036, which removes its file lists. A new test first runs in the required check there.

The plan lives at opensoft/openxFactory specs/034-opendox-standalone-operation/. Those files are unchanged between the gate's merge a65230f6 and main at 79a720a2.

The rule comes from T006's analyze, finding U2 (evidence/analyze-round-1a.md). Four G1 slices run in parallel, and if each appended its test to validate.yml's one --noconftest list, they would collide on it. T036 then makes the required validate job run the whole suite, with no file lists, and that run collects this file.

Until T036, this PR quotes the run the plan asks for. At head 0b16b17f (main merged in), python -m pytest -q --noconftest tests/test_doxbench_seams.py gives 36 passed.

The other two items in the overview are addressed at 0b16b17f: the rail's attribute-probe failures now become the seam's TypeError, and the stale docstring is updated. The thread is answered with evidence and resolved.

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

Fix repeated same-object rail registration and ensure the new seam tests run in required CI checks.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Comment thread src/opendox/doxbench_packet.py Resolved
brettheap and others added 2 commits September 27, 2026 00:34
register_status_exemption() probed both required names on every call, and
only then compared the rail with the one already registered. So the SAME
rail registered again was probed again, and a lazy rail whose second lookup
failed turned an idempotent host start into a TypeError. The same object is
now answered first, by identity, and only a new registration is validated.

A rail whose is_compression_exempt resolves once and then raises is
registered twice in the new test. At the previous head the repeat was
refused with TypeError; now it returns the rail, and the property was read
once.

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

The new seam tests are not gated by the required validate job.

Review effort: Lite
Findings: None

Resolved since last review (1)

@brettheap
brettheap marked this pull request as ready for review September 27, 2026 00:46

@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 3 days and 16 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@brettheap

Copy link
Copy Markdown
Contributor Author

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

@brettheap
brettheap merged commit 8017cd5 into main Sep 27, 2026
5 checks passed
@brettheap

Copy link
Copy Markdown
Contributor Author

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

LANDED — lane openxfactory-4, 2026-09-27T00:48:35Z, PR #41 → 8017cd5 (opensoft/openDox-code main; plain gate)

Brett: land the phase 1 PRs when green

brettheap added a commit that referenced this pull request Sep 27, 2026
Since the last merge, main gained T025 (#43) and T027 (#41). Neither
touches src/route_extension.py, src/opendox/serve.py, the facet's tests or
the profile-registration runbook.

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 27, 2026
main is 2768302. It carries P1-A's T010 (#40), T011 (#46) and T012 (#47),
which T016 waits for, and P1-E's T025 (#43) and T027 (#41).

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 27, 2026
…into openxFactory at all (#49)

Plan 034, task **T032**, slice P1-F (the sweep and the nine-file repair). The plan is `specs/034-opendox-standalone-operation/tasks.md` at opensoft/openxFactory `main` `468863d1`, where round 2 (#1176) has landed. The T032 through T035 entries there are byte-identical to `0d48231b`'s, which this record was first written against. This PR realizes box **2.3** of the ratified `add-neutral-product-standalone-operability`.

- **Ruled:** R1Q22 (a), openxFactory#656 comment `5817152735`.
- **Claim:** openxFactory#656 comment `5852380744`.
- **After:** T011, T012, T016, T021, T022, T025–T027 ("every lane joins here"). **All have landed.** T022 landed last, as #45 → `255514df`, merged in at `5270acf0`. T038 then landed as #48 → `796838e8`, and `main` at `796838e8` is merged in (`dc8fa87a`, no force-push). Everything below was re-run at this head, `b53b9db2`.

## The sweep (2.3)

The four names in import position under `src/`: import statements, and `importlib.import_module(...)` or `__import__(...)` with a literal name. Every hit is classified by when it runs. It was run at the arc's base, openDox-code `1e4a57fb` (ARC_BASE, `evidence/arc-base.md`), and at `main` `796838e8`. That is where the last lane (T022) joined, plus T038's console script. This PR changes nothing under `src/`, so this head gives the same result.

| | at `1e4a57fb` | at `796838e8` |
|---|---|---|
| import-time reaches | 2 (`ideation_dashboard`) | **0** |
| deferred reaches into openxFactory | 8 | **0** |
| deferred reaches into `openxdox` | 19 | **19** |

**Closed: every reach into openxFactory, and every import-time reach.**

| reach at `1e4a57fb` | target | closed by | landed |
|---|---|---|---|
| `serve.py:199`, `:206` (import time) | `ideation_dashboard.serve_openxfactory_lanes` | T011 (2.1), the handler-contribution facet | #46 → `0e88454a` |
| `serve.py:713`, `_head_of` | `doc_health.corpus` (`RealGit`) | T012, openDox's own HEAD reader | #47 → `27683028` |
| `authoring.py:318`, `_classify_proposal` | `corpus_adapter_openxfactory` | T021, `corpus_adapter.home()` | #44 → `9d13bd16` |
| `workbench.py:746`, `session_documents` | `doc_health.corpus` | T025, the registered adapter's `list_documents` | #43 → `c46430fb` |
| `workbench.py:1407`, `:1408`, `:1409`, `run_scoped_doc_health` | `doc_health`, `.families`, `.runner` | T026, the health-check seam | #39 → `582ed073` |
| `serve_wire.py:1369`, `default_doxbench_validators` | `ideation_dashboard.doxbench_contracts` | T027, the doxBench validator seam | #41 → `8017cd52` |
| `doxbench_packet.py:177`, `_status_exemption` | `ideation_dashboard.doxbench_status_exemption` | T027, the status-exemption seam | #41 → `8017cd52` |

**Deferred: 19 reaches, all into `openxdox`, each inside a function body.** Each is routed no later than the phase whose surface calls it (research R5, the release map). openXdox-code's `OPENDOX_BACK_IMPORTS` ratchet counts them by module: `branch_session` 7, `serve_workbench` 7, `serve` 2, `serve_project` 2, `cli` 1.

| reach at `796838e8` | target | inside | reason it stays, and who routes it |
|---|---|---|---|
| `branch_session.py:1568` | `openxdox.generator` | `_change_rows` | the snapshot generator is openXdox's column; phase 2, T055 (5.4/5.5) |
| `branch_session.py:1587` | `openxdox.register` | `_active_pick_fallbacks` | the cross-reference register; phase 3, T084 |
| `branch_session.py:2005` | `openxdox.kickoff` | `proposal_state_for` | the kickoff column; phase 3, T084 |
| `branch_session.py:2105`, `:2151`, `:2228`, `:3573` | `openxdox.snapshot_registry` | `session_entry`, `register_session_entry`, `refresh_session_snapshot`, `refresh_main_view` | the snapshot registry; phase 2, T055 |
| `cli.py:628` | `openxdox.snapshot_registry` | `_session_registry` | the snapshot registry; phase 2, T055 |
| `serve.py:648` | `openxdox.corpus_root` | `_checkout_real`, called by every `build_server` | the corpus-root predicate; phase 2, T055 (research R7) |
| `serve.py:2118` | `openxdox.corpus_root` | `_refuse_impossible_checkout_root`, called by `serve.main()` | the corpus-root predicate; phase 2, T055 |
| `serve_project.py:246`, `:247` | `openxdox.gate_console`, `openxdox.kickoff` | `_serve_project_register` | the gate console and kickoff; phase 3, T084 |
| `serve_workbench.py:347`, `:544`, `:1665`, `:2607` | `openxdox.doxbench_scope` | `_is_live_session_ref`, `_handle_workbench_thread`, `_handle_workbench_chat_turn`, `_handle_workbench_document_abstract` | doxBench scope; phase 3, T084 |
| `serve_workbench.py:407`, `:408` | `openxdox.gate_console`, `openxdox.gate_routes` | `_thread_gate` | the gate column; phase 3, T084 |
| `serve_workbench.py:1215` | `openxdox.gate_console` | `_handle_workbench_model_approval` | the gate column; phase 3, T084 |

The line numbers moved since research R5 (`cli.py:610` → `:628`, `serve.py:629` → `:648`, `serve.py:1993` → `:2118`), with the code that phase 1, T022 and T038 added. The reaches and their functions did not.

**The late seam, which the scan cannot read.** `consumer_reach.py` holds seven `module(...)` stand-ins (`gate_console`, `snapshot`, `snapshot_registry`, `corpus_root`, `generator`, `serve_projection`, `serve_gate`). Each resolves `openxdox.<name>` at first use. `module()` refuses a prefixed name, so no stand-in can name another package. Research R6's census is unchanged: 65 use sites, in `serve.py` 22, `branch_session.py` 20, `cli.py` 18, `serve_workbench.py` 4 and `workbench.py` 1. They are deferred too, into `openxdox` alone, and T084 retires the module.

**Prose, not import position.** `git grep -w` finds each name in `src/` beyond these: `ideation_dashboard` on 44 lines, `doc_health` on 25, `corpus_adapter_openxfactory` on 2, and the rest of `openxdox`'s 57. Every one of them outside the table above is a comment, a docstring or a string. Several docstrings still describe the pre-carve layout. `serve_project.py:30`, `serve_wire.py:80`, `serve_workbench.py:33` and `doxbench_scope_types.py:40` say *"this module uses ABSOLUTE `ideation_dashboard.*` imports"*. None of them is a reach. They sit in carved files with other writers, so this PR leaves them. A later edit to each file can correct its sentence.

## What changes

**`tests/test_reach_sweep.py`**, a new file, so the sweep's result is held and not only recorded here. It parses `src/` whole, the two top-level extension modules included, as F4.1 parses the package, and it asserts four things:
1. no reach into any of the four runs at import time;
2. no reach of any kind names `ideation_dashboard`, `doc_health` or `corpus_adapter_openxfactory`, in either spelling (the pre-carve `scripts.` one too), the phase-1 cut of 4.3;
3. every reach left is deferred and into `openxdox`, the positive form of F4.1 "lists only `openxdox` targets";
4. no code under `src/` spells an openxFactory package's name at all. That means no string or bytes literal outside documentation, because every import needs the name, however the importer is reached.

**It does not pin the count of 19.** openXdox-code's ratchet already counts those reaches, and each one that T055 or T084 routes simply stops being one. So no later task has to edit this file when a reach closes. A reach may not come back at import time, and none may go into openxFactory. No instrument watched that direction (#1144 task 9.2a), and `tests/test_imports_standalone.py` proves only its import-time half, where no sibling is installed. On this tree, the sweep itself finds exactly F4.1's 19, all `openxdox` and all deferred.

**How it reads a module.** It reads by syntax, not by grep. Prose names the four packages on purpose.
- **Statements.** Import statements, including `from a import b`'s members as the submodules they may be (`from scripts import doc_health`). A star member is named too.
- **Calls.** `import_module` and `__import__` calls with a literal name, by position, as `name=`, or spelled out of a literal `*[...]`/`**{...}`, and under an import alias.
- **Relative names.** They are resolved against a literal `package`. `__import__` resolves against its `globals`: `globals()` is the module's own, and a literal `{"__package__": ...}` resolves. `__import__`'s literal `fromlist` also counts.
- **A module that holds an importer as a value** (assigns, passes, stores it, or looks it up by name) is read strictly. Every call with a literal module name counts there, read as either importer, since it may be bound to either.
- **Refused as UNREADABLE:** a call whose module a spread hides; a relative call whose package or context is unknown; a relative call that leans on `globals()` or `__package__` in a module that rebinds them; a `fromlist` that is not a literal; and a star import, in either form, from a package a sibling lives under (`from scripts import *`). A star from `os` names nothing.
- **Not refused:** a computed name, which is how `consumer_reach`'s seam imports.
- **Timing.** Where position and run time part (`TYPE_CHECKING`, postponed annotations, a generator), it reads position, the stricter reading. PEP 695's lazy positions are read as deferred.
- **What it is not.** It is a regression guard for the code this repository writes, not a sandbox. A name built from pieces at run time is review's to hold, and at import time the runtime sweeps (`test_imports_standalone.py`, `test_consumer_reach.py`) hold it too.

**`tests/import_scan.py`**, the shared reader, which exists so that no direction check keeps its own copy of the extraction. The node reader `names_imported_by` and its helpers live there, and `imported_modules` reads with it. Every new behaviour is opt-in, so `imported_modules`' output, `bound_names`', and `string_literals`' default output are identical to `main`'s reader over every parsed file in this repository: 141 files, 1524 imports, 0 differ. The three callers of `imported_modules` give the same result with and without the edit.

## The falsifier: F4.1's scan, which lists only `openxdox` targets

`scan_deferred_reaches.py`, research.md's appendix, persisted in opensoft/brett-wip. Its sha256 is `fe11620319b02c23dd9a014bc581e1f4867f013f3c26890d43b12dccce5530a0`, which matches the digest `evidence/remeasure-2026-09-25.md` records. Run from this head, `python3 scan_deferred_reaches.py src/opendox`:

```
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:628: openxdox.snapshot_registry  [in _session_registry]
src/opendox/serve.py:648: openxdox.corpus_root  [in _checkout_real]
src/opendox/serve.py:2118: 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
```

Every target is `openxdox`. At `1e4a57fb` the same tool printed 27, eight of them into openxFactory. F4.1 WHOLE, *"no deferred reach names the consumer or the publisher"*, is T089's, after T084 routes the last 19 and retires `consumer_reach.py`.

**The new test.** `python -m pytest -q tests/test_reach_sweep.py` at this head gives `35 passed`, with the root conftest and under `--noconftest`. The same file, with this head's `tests/import_scan.py`, run over `1e4a57fb`'s tree fails the three reach assertions:

```
AssertionError: 2 reach(es) into a sibling run at IMPORT time, so the module cannot be imported without it (#1144 task 2.1's defect): src/opendox/serve.py:199: ideation_dashboard (AT IMPORT TIME, in <module>); src/opendox/serve.py:206: ideation_dashboard.serve_openxfactory_lanes (AT IMPORT TIME, in <module>)
AssertionError: 10 reach(es) into openxFactory, which openDox can never install (#1144 task 4.3's phase-1 cut), or imports the source does not spell out (behind a spread, a star, or a context that is not a literal), which could be: src/opendox/authoring.py:318: corpus_adapter_openxfactory (deferred, in _classify_proposal); …
3 failed, 32 passed
```

**83 mutations, and each fails its assertion.** Each is a copy of this tree with one change. Roughly a third plant a reach in `src/`, and the rest weaken the reader or the sweep. The list is in the review record below, and the spec is kept with the slice's tools. Every finding in the review record was also planted at the head it was raised on, where it passed, before its fix.

## The repository's own check

`.github/workflows/validate.yml`'s three report-producing pytest steps, run as the file writes them, and summed as `Pin the triple` sums them. The venv was Python 3.12.3 with `-c constraints-cpython312-linux.txt -e ".[test]"`:

```
triple: selected=1155 passed=1152 skipped=3 failures=0 errors=0
pins:   selected>=1114 (margin 41) passed>=1111 (margin 41) skipped==3
```

This matches `main`. The new file is not on the workflow's list, and neither is any caller of `tests/import_scan.py`. T036 owns `validate.yml` and makes the whole suite the required run.

**The whole suite, with the root conftest**, in the same venv: `main` `796838e8` gives `19 failed, 1454 passed, 13 skipped, 66 errors`, and this head gives `19 failed, 1489 passed, 13 skipped, 66 errors`. A test-by-test JUnit diff shows no changed outcome, nothing gone, and 35 new cases, all this file's and all passing. The 85 red cases are research R3's nine files and T030's `.[test]`-only case. T034 repairs the nine.

## Review record (Copilot)

There were eighteen threads over fifteen rounds, plus four findings raised without a thread. Every thread is answered with its evidence and resolved. Copilot's review at `19b0ecc2` recommends approval, with no findings. Every finding was a way to reach a sibling that the reader did not follow. Each was planted at the head it was raised on, where it passed, and it fails since its fix.

| round, at | finding | fixed in |
|---|---|---|
| 1, `61b308ed` | `import_module(name=...)`; PEP 695 type parameters; one shared reader | `ae82e2b5` |
| 2, `ae82e2b5` | an import alias of `import_module` | `eece371e` |
| 3, `eece371e` | a relative `import_module` against a literal `package` | `9862669f` |
| 4, `9862669f` | "matched by the name it spells" (docstring) | `ab022702` |
| 5, `ab022702` | a destructured alias; a lawful consumer case | `d9d3f3f9` (a module holding an importer as a value is read strictly) |
| 6, `d9d3f3f9` | literal `*[...]` and `**{...}` | `981fce65` |
| 7, `5270acf0` | nested literal spreads | `e6bd5ef5` (UNREADABLE for any other spread) |
| 8, `e6bd5ef5` | an alias looked up by name; a keyword an unreadable entry overwrites | `4b0cb725` |
| 9–10, `4b0cb725`, `aa92f71a` | a bound package; custom `globals` | `aa92f71a` (the spelling check), `6cf729ef`, `c3283e55` |
| 11, `6cf729ef` | the `scripts.` spelling; the full-name match; a concatenated lookup key | `c3283e55` |
| 12, `c3283e55` | a shadowed `globals`; a rebound `__package__` | `1fdd7fbb` |
| 13, `1fdd7fbb` | `from scripts import doc_health` | `a5a7f745` |
| 14, `a5a7f745` | `__import__`'s `fromlist` | `0f7af1a1` |
| 15, `0f7af1a1` | a star import from `scripts`; with it, found in measuring, a strict module's calls read by one importer's rule only | `19b0ecc2`; `b53b9db2` names UNREADABLE for each case it stands for |

## Landing

- T022 (#45) and T038 (#48) have landed, and `main` `796838e8` is merged in. Everything above was re-run at this head.
- T034 comes after it: T034 re-derives `tests/test_consumer_reach.py`'s record against this sweep.
- Squash or merge, never rebase. Each commit message carries both trailers, and so does this body.

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