You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
T032: 2.3, the sweep -- no reach into a sibling at import time, none 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 main468863d1, 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.
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 main796838e8. 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.
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)
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:
no reach into any of the four runs at import time;
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;
every reach left is deferred and into openxdox, the positive form of F4.1 "lists only openxdox targets";
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:
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]":
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: main796838e8 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
…an 034 T032)
#1144 task 2.3's sweep, taken where phase 1's lanes joined: every import of
ideation_dashboard, corpus_adapter_openxfactory, doc_health or openxdox in
import position under src/, classified by when it runs. The pull request
records each hit with its reason. At this tree no reach runs at import time,
none goes into openxFactory, and the 19 left are deferred reaches into
openxdox, routed in phases 2 and 3.
tests/test_reach_sweep.py holds the first two facts: it parses src/ whole
and refuses a reach into any sibling at import time, and a reach of any kind
into openxFactory's packages. It does not pin the 19: openXdox-code's
OPENDOX_BACK_IMPORTS ratchet counts them, so a later task that routes one
needs no edit here. A specimen and a planted reach prove the scanner bites.
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Introduces tests/test_reach_sweep.py, an AST-driven contract for standalone operability: imports under src/ must not reach siblings at import time, must never reach openxFactory, and may only retain deferred reaches into openxdox. The test suite validates parser semantics with representative specimens and mutation-style negative cases without pinning the currently expected count of deferred openxdox reaches.
File-Level Changes
Change
Details
Files
Adds an AST-based source sweep that enforces standalone import boundaries across the entire src/ tree.
Parses absolute imports and literal dynamic-import calls while ignoring prose, relative imports, lookalike names, and nonliteral calls.
Classifies module-level execution versus deferred function-body execution, including decorators, defaults, annotations, class bodies, lambdas, and nested functions.
Asserts that no sibling reach occurs at import time, no reach targets openxFactory packages, and all remaining reaches are deferred into openxdox.
Scans extension modules outside the package directory through a recursive src/ traversal.
tests/test_reach_sweep.py
Adds focused regression coverage proving the scanner detects forbidden reaches and correctly handles representative syntax positions.
Uses a specimen module to pin expected classifications and line-level findings.
Runs each policy assertion against a temporary source tree containing a forbidden reach and verifies failure.
Keeps the deferred openxdox reach count flexible so later seam work can remove reaches without editing this test.
tests/test_reach_sweep.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!
Adds an AST-based reachability sweep for src/, preventing import-time sibling dependencies and direct openxFactory access while permitting deferred openxdox integration.
Changes:
Scans imports and literal dynamic imports.
Classifies import-time versus deferred reaches.
Adds regression and mutation tests for forbidden dependencies.
File
Summary and findings
tests/test_reach_sweep.py
Implements the reachability scanner. Findings: reuse the shared import helper (moderate, 2 votes); support keyword-only dynamic-import arguments (critical, 3 votes); model generator-expression timing (moderate, 1 vote); traverse type-parameter bounds and constraints (critical, 3 votes); account for postponed annotations (nit, 1 vote); clarify TYPE_CHECKING and annotation runtime semantics (nit, 1 vote).
…ns, through the shared node reader (plan 034 T032)
Three review findings on the sweep, each measured before it was fixed.
The name= keyword. `importlib.import_module(name="doc_health")` and
`__import__(name=...)` are valid literal imports, and the sweep read only
the first positional argument. Planted in src/opendox/lens.py at 61b308e,
the openxFactory ban passed; it fails now. A nonzero literal `level` makes
`__import__` relative, and it no longer names a sibling.
PEP 695's type parameters. A def's early return skipped `type_params`, so
`def f[T: __import__("doc_health")]()` was invisible (planted: passed at
61b308e). A class's parameters and a `type` alias's value were found but
called import-time. All three are evaluated lazily, when something reads
them (measured on 3.12.3), so they are now swept as deferred, and each is
in the new specimen.
One reader. tests/import_scan.py exists so that no direction check keeps
its own copy of the extraction. It gains `names_imported_by(node, *,
calls=False)`, which `imported_modules` now reads with; its output is
unchanged over every parsed file of this repository (141 files, 1497
imports, 0 differ), and its three callers' results are the same with and
without this edit. The sweep reads each node with it and matches with
`names_a_forbidden_package`.
The docstring now says where position and run time part (a TYPE_CHECKING
block, postponed annotations, a generator), that the sweep reads position,
the stricter reading, and that a call at import time is the runtime
sweeps' to prove.
Falsifiers: 8 passed; 3 fail at 1e4a57f as before; 15 of 15 mutations
bite.
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…032)
Review round 2's finding. The reader matched a call by its final
identifier, so `from importlib import import_module as load` followed by
`load("doc_health")` named nothing. The same was true of
`fetch = il.import_module`. Planted at ae82e2b, both passed the
openxFactory ban. Both fail now.
tests/import_scan.py gains `importing_calls(tree)`, which maps
`IMPORTING_CALLS` and every name a module gives one of them (an import
alias from importlib or builtins, an assignment, and an assignment of an
alias, to a fixed point) to the call each is. `names_imported_by` takes
that mapping as `calls=`, and so a `__import__` alias keeps its relative
`level` reading. The sweep builds it once per module. A callable reached
through getattr, a functools.partial or a parameter cannot be read off the
source, and the docstrings say so. `imported_modules` passes no mapping,
and its output is still identical to main's over every parsed file (141
files, 1498 imports, 0 differ).
A third specimen holds the alias forms. Falsifiers: 9 passed; 3 fail at
1e4a57f as before; 20 of 20 mutations bite.
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The name.startswith(".") path treats every relative import_module call as package-local, but the package= argument can explicitly name a forbidden sibling: importlib.import_module(".corpus", package="doc_health") resolves to doc_health.corpus. The helper therefore returns no reach and the sweep can miss a literal openxFactory dependency; resolve literal package plus the relative name (and add a regression specimen).
…4 T032)
Review round 3 named a form the reader missed, as a previously missed
finding with no thread. Every relative `import_module` name was read as
package-local, but `import_module(".corpus", package="doc_health")`
imports doc_health.corpus. Planted at eece371, it passed the openxFactory
ban. It fails now.
A relative name is resolved where the call itself says what it is
relative to: a literal `package`, by position or keyword, through
importlib.util.resolve_name. Relative to anything else (`__package__`, or
`__import__` with a nonzero `level`), it is relative to the calling
module's own package and names nothing here. The lazy specimen holds the
keyword form, the positional form and the `__package__` form.
`imported_modules` is unchanged (141 files, 1499 imports, 0 differ from
main's).
Falsifiers: 9 passed; 3 fail at 1e4a57f as before; F4.1's scan still
lists 19, all openxdox; 22 of 22 mutations bite.
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
The scanner has unresolved false-positive and missed-alias cases, plus a test coverage gap.
Review effort: Lite Findings: None
Previously missed (1)
In code that hasn't changed since last review
Import detection misclassifies shadowed and attribute callables
tests/import_scan.py:68
calls is seeded with bare import_module/__import__ names, and _called_name also accepts any attribute with those final names, so non-import callables are reported as imports. For example, def f(import_module): import_module("doc_health") is classified as a forbidden reach even though the parameter shadows the importer (and obj.import_module(...) has the same problem). This contradicts the helper's documented exclusion of parameter/getattr-style callables and can make the sweep reject valid source; resolve bindings with scope awareness or restrict calls to names proven to refer to the standard import functions.
… T032)
Review round 4 read the reader's docstring as a contradiction, with no
thread and no finding. It said that a callable reached through a
parameter cannot be read, yet a parameter spelled `import_module` is read
as the importer.
Both are true, and the docstring now says which is which. A call is
matched by the name it spells, so a parameter, a local or another
object's attribute spelled `import_module` counts as the importer. That
is the stricter reading the sweep takes wherever it cannot tell, and it
can only refuse a module, never pass one. Nothing under src/ spells
either name for anything else: the sweep is green. What cannot be read
is the importer under a name the module never gives it by an import or an
assignment. No code 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>
… T032)
Review round 5's thread. Alias tracking followed only simple Name
targets, so `load, unused = (importlib.import_module, object)` followed by
`load("doc_health")` named nothing. Planted at ab02270, it passed the
openxFactory ban, and so did an assignment expression and a getattr by
the importer's name. All three fail now.
Chasing each binding form one at a time cannot end: a value can also
travel through a container, a default, a return value or a loop target.
So the reader stops chasing. `importer_escapes(tree, calls)` asks whether
a module mentions an importer anywhere other than as the callable of a
call, or names it as a string outside documentation. Where it does, the
module is read strictly: every call whose module argument is a literal
counts, whatever it calls (`names_imported_by(..., any_call=True)`).
Where it does not, the module is still read call by call, the importers
and the names an import gives them, so a call such as `print(...)` names
nothing there. The assignment-chain tracking round 2 added is subsumed,
and removed. Nothing under src/ holds an importer as a value, and no call
there passes a sibling's name as a literal: the sweep is still green, and
F4.1's scan still lists 19, all openxdox.
New cases: six ways to hold the importer as a value (an assignment, a
destructuring, `:=`, a container, getattr by name, a default value), each
counting the later literal call. The alias specimen now shows that
without a value, a non-importer call names nothing. A lawful-case check
plants a deferred `from openxdox import gate_console` in a scratch src/
and passes all three assertions, so the line holds after the last real
reach is routed.
Falsifiers: 16 passed; 3 fail at 1e4a57f as before; 29 of 29 mutations
bite; `imported_modules` unchanged (141 files, 1499 imports, 0 differ).
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… (plan 034 T032)
Review round 6 named star expansions, in a summary line, with no thread
and no finding. `importlib.import_module(*["doc_health"])` and
`import_module(**{"name": "ideation_dashboard"})` are literal module
names, and the reader looked only at `node.args[0]` and named keywords.
Planted at d9d3f3f, both passed the openxFactory ban. Both fail now.
`_arguments(call)` spells out a literal `*[...]` or `*(...)` in place,
and a literal `**{...}`'s string keys. Past a `*` of anything else,
positions are unknown, so nothing after it counts as positional, and a
`*NAMES` is not a literal. Every positional read (the name, `__import__`'s
level, `import_module`'s package) goes through it.
The review's other note, that a module naming an importer in a string is
read strictly, is the documented stricter reading. It can only refuse a
module, and nothing under src/ does it.
Falsifiers: 16 passed; 3 fail at 1e4a57f as before; F4.1's scan still
19, all openxdox; 33 of 33 mutations bite; `imported_modules` unchanged
(141 files, 1499 imports, 0 differ).
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
T022 was the last task T032 comes after. This takes main at 255514d, so
the sweep and F4.1's scan run over the tree where every phase-1 lane has
joined.
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…weep (plan 034 T032)
Review round 13's two threads, which are one gap. `from scripts import
doc_health` imports `scripts.doc_health`, but the reader named only the
statement's module, `scripts`. Planted at 1fdd7fb as a deferred import,
it passed the openxFactory ban. It fails now.
`names_imported_by` gains an opt-in `members`. With it, `from a.b import
c` also names `a.b.c`, after `a.b`, because a name imported from a
package may be its submodule. `imported_modules` does not ask for it, so
its parent-module contract is unchanged (141 files, 1523 imports, 0
differ from main's). The sweep asks for it and records one reach per
statement: the module, or the first member that is a sibling's where the
module is not. So `from openxdox import gate_console` is still one
`openxdox` reach, and the sweep still finds exactly F4.1's 19. The
specimen holds `from scripts import ideation_dashboard, doc_health`.
Falsifiers: 34 passed; 3 fail at 1e4a57f as before; F4.1's scan and
the sweep itself both find 19, all openxdox and deferred; 72 of 72
mutations bite.
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…4 T032)
Review round 14's thread. `__import__("scripts", globals(), None,
("doc_health",), 0)` imports `scripts.doc_health`, but the reader named
only `scripts`. Planted at a5a7f74 in a function, it passed the
openxFactory ban. The spelling check already refused its literal
`"doc_health"`, and now the ban does too.
With `members`, `_dunder_import` reads a literal `fromlist` (a tuple,
list or set of strings) as members after the module, as a `from`
statement's are read. A `fromlist` that is not a literal adds
UNREADABLE. The sweep records one reach per call, as it does per `from`
statement: the module, or the first member that is a sibling's where the
module is not. So `__import__("openxdox", ..., ("gate_console",), 0)` is
one `openxdox` reach. The specimen holds a literal fromlist, an unknown
one, and a consumer one.
Falsifiers: 34 passed; 3 fail at 1e4a57f as before; F4.1's scan and
the sweep both find 19, all openxdox and deferred; 75 of 75 mutations
bite; `imported_modules` and `string_literals` unchanged by default.
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
T038 landed after T022, so this takes main at 796838e. The sweep and
F4.1's scan re-run over the console-script entry point it 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>
…calls as either importer (plan 034 T032)
Review round 15's thread. `from scripts import *` imports whatever
`scripts.__all__` lists, which may be an openxFactory package, but the
reader dropped the star member and named only `scripts`. Planted at
0f7af1a at module level in `src/opendox/lens.py`, it passed all four
sweep assertions, the spelling check included, since it holds no
literal.
With `members`, a star member is now named `a.b.*`, from a `from`
statement or from `__import__`'s literal `fromlist`. The sweep turns it
into UNREADABLE wherever a sibling lives under `a.b`: `from scripts
import *` is refused, and `from os import *` names nothing.
`imported_modules` passes no `members`, so its parent-module contract
holds: over the repository's 141 files it yields the same 1524 names as
main's reader, and `string_literals` and `bound_names` are unchanged.
The measurement found a neighbour. In a module that holds an importer
as a value, a call was read by one importer's rule only: its spelling's,
or `import_module`'s under any other name. So `__import__`'s `fromlist`
members went unread there, and so did a relative `import_module`
spelled `__import__`. Such a call is now read as either importer, its
own spelling's first. No module under `src/` is read that way, so the
sweep's findings are unchanged. The alias specimen gains a spread call
to a non-importer, which names nothing.
Falsifiers: 35 passed; 3 fail at 1e4a57f as before; F4.1's scan and
the sweep both find 19, all openxdox and deferred; the new cases fail
against the scanner at 0f7af1a; 83 of 83 mutations bite.
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…n 034 T032)
UNREADABLE printed as "<an importing call's spread arguments>", and its
comment named only a spread that hides the name or the package. Since
the relative-context, fromlist and star readings, it also stands for a
non-literal `globals`, `level` or `fromlist`, and for a star import
from a package that may hold a sibling. A refused `from scripts import
*` printed as a spread. It now prints as "<an import the source does
not spell out>", and its comment and the openxFactory assertion's
message name each case. No reading changes.
Falsifiers: 35 passed; 3 fail at 1e4a57f as before; 83 of 83
mutations bite; `imported_modules`, `string_literals` and `bound_names`
unchanged against main's reader.
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
T038 landed after T022, so this takes main at 796838e and re-verifies
the nine files, the triple and the whole suite over it, in both venvs.
T034 stays after T032 (#49), and takes main again once T032 lands.
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
T032 has landed, so T034's After is met. This takes main at 68be484,
which adds only the sweep and its reader, and re-verifies the nine
files, the triple and the whole suite over it, in both venvs. The sweep
itself passes on this tree, and its import inventory is the one the
re-derived censuses hold.
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…16.6's phase-1 repair) (#50)
Plan 034, task **T034**, 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 T034 entry there is byte-identical to `0d48231b`'s, which this record was first written against. This PR realizes box **9.1 (part)** and **16.6 (the phase-1 repair)** of the ratified `add-neutral-product-standalone-operability`.
- **Ruled:** R1Q2 (a) and R1Q22 (a), openxFactory#656 comment `5817152735`. Eight of the nine files are carved `moved_with_declared_edit` rows, and `tests/test_consumer_reach.py` has no row. None needs a declared-edit act.
- **Claim:** openxFactory#656 comment `5852380744`.
- **After:** T032, "whose sweep fixes the import inventory that the re-derived censuses must match". **It has landed**, as #49 → `68be484a`, after T022 (#45 → `255514df`) and T038 (#48 → `796838e8`). `main` at `68be484a` is merged in (`7e3dc9ff`, no force-push). Everything below was re-run at this head, `bc6b168d`. The inventory the sweep fixes is the one the re-derived record holds. At `68be484a` the sweep finds no reach at import time, and `STILL_REACHING`, which the record now derives on every run, is empty. The sweep's 19 deferred reaches sit in `branch_session`, `cli`, `serve`, `serve_project` and `serve_workbench`, the five modules openXdox-code's ratchet counts. The sweep's own file passes on this tree (`35 passed`).
## For T007's batch E and T047: what this PR moves to openxFactory
**Four test cases leave openDox-code and become NAMED openxFactory composition tests (R1Q2 (a)).** T007's batch E adds each destination path to F11.1's named set (`COMPOSITION_TESTS`) before T047 lands. T047's openxFactory PR lands the cases there, and T049 checks that they arrived. **`tests/test_session_harness.py` is not moved here.** It is in `collect_ignore`, and it is T035's.
**The holder's decision on the three memory-gateway cases: accepted under R1Q2 (a)** (relayed to this lane's writer, 2026-09-27). T034's text names only the outline case. The memory-gateway cases take the same route because the spec they read exists only in openxFactory.
| moved case | from (openDox-code) | to (openxFactory), proposed | why it cannot stay |
|---|---|---|---|
| `test_the_model_and_the_doc_health_family_agree_on_the_contract` | `tests/test_outline_model.py` | `tests/ideation-dashboard/test_outline_template_agreement.py` | It holds `views/outline-model.js`'s `REQUIRED_SECTIONS` and `QUESTION_SUBFIELDS` equal to openxFactory's `doc_health.families` (`_TEMPLATE_SECTIONS`, `_QUESTION_SUBFIELDS`). It imports `doc_health`, which openDox can never install. openDox has no checker of its own until Group 6 (release 2), so there is no openDox contract to rewrite it against. |
| `test_the_roster_is_exactly_the_promoted_capabilitys_requirements` | `tests/test_doxbench_memory_gateway.py` | `tests/ideation-dashboard/test_memory_gateway_roster.py` | It reads `openspec/specs/memory-gateway/spec.md`, the promoted capability that `doxbench_memory_gateway.CAPABILITY_REQUIREMENTS` is transcribed from. That spec is openxFactory's, and no openDox repository carries a copy (checked in openDox-spec, openDox, openXdox-spec, openXdox and openXdox-code). It failed on `FileNotFoundError`. |
| `test_the_tier_column_is_TRANSCRIBED_not_invented` | same | same | the same spec's tier block |
| `test_the_untiered_requirement_really_is_absent_from_the_tier_block` | same | same | the same spec's tier block |
Both destinations compose openDox at openxFactory's pin, which `scripts/carved_reach.py` already puts on the path for `tests/ideation-dashboard/`. The outline case then reads `openDox/code/src/opendox/web/views/outline-model.js` from the pin, and the memory-gateway cases import `opendox.doxbench_memory_gateway`. **The paths are proposals.** If T047's writer chooses others, batch E records what T047 lands. The cases' own text, verbatim from `main` `19370adc`, is below, so no archaeology is needed.
<details><summary>The outline-template agreement case (from <code>tests/test_outline_model.py</code>)</summary>
```python
def test_the_model_and_the_doc_health_family_agree_on_the_contract():
"""The surface and the checker must mean the same thing by conformance."""
import sys
sys.path.insert(0, str(REPO_ROOT / "scripts"))
from doc_health import families
js = MODEL_JS.read_text(encoding="utf-8")
for _needle, label in families._TEMPLATE_SECTIONS:
assert f'label: "{label}"' in js, f"model omits required section {label}"
for field in families._QUESTION_SUBFIELDS:
assert f'"{field}"' in js, f"model omits sub-field {field}"
```
`MODEL_JS` was `REPO_ROOT / "src/opendox/web/views/outline-model.js"`. At openxFactory it is the pinned leg's copy of that file.
</details>
<details><summary>The three memory-gateway roster cases (from <code>tests/test_doxbench_memory_gateway.py</code>)</summary>
```python
SPEC_PATH = REPO_ROOT / "openspec" / "specs" / "memory-gateway" / "spec.md"
# ===========================================================================
# THE ROSTER — transcribed, and asserted against the capability itself
# ===========================================================================
def test_the_roster_is_exactly_the_promoted_capabilitys_requirements():
"""The declaration is only complete if the roster it is complete OVER is
the capability's own. Read from the promoted spec, so a requirement added
upstream fails here rather than becoming a silent gap in the declaration."""
published = {
line[len("### Requirement: "):].strip()
for line in SPEC_PATH.read_text(encoding="utf-8").splitlines()
if line.startswith("### Requirement: ")
}
assert published == set(mg.CAPABILITY_REQUIREMENTS)
def _published_tiers() -> dict[str, str]:
"""The spec's OWN tier block, parsed: requirement name -> the tier line it
is named on."""
spec = SPEC_PATH.read_text(encoding="utf-8")
block = spec.split("```text", 1)[1].split("```", 1)[0]
published: dict[str, str] = {}
for match in re.finditer(r"(M\d):((?:.|\n)*?)(?=\nM\d:|\Z)", block):
tier, body = match.group(1), " ".join(match.group(2).split())
for name in body.split(";"):
published[name.strip().rstrip(".")] = tier
return published
def test_the_tier_column_is_TRANSCRIBED_not_invented():
"""RE-PINNED (adversarial review, F7). The roster test checked NAMES only,
so two wrong tier values sat in the column unchallenged: one requirement
carried `M0` although the spec's tier block never tiers it at all, and
`Expert Memory And Knowledge DBs Are Gateway-Governed` was FLATTENED to
`M4` although the spec says in as many words that it follows the tier of
the operation it mirrors. Both are now transcribed, and this test reads the
spec's own block so neither error can recur silently."""
published = _published_tiers()
for requirement, declared in mg.CAPABILITY_REQUIREMENTS.items():
named = [line for line in published
if line.lower().startswith(requirement.lower())]
if not named:
# Not tiered by the spec at all -- which the column must SAY.
assert declared == mg.TIER_UNTIERED, requirement
continue
line = named[0]
if line != requirement:
# The spec qualifies this row rather than tiering it outright.
assert declared == mg.TIER_MIRRORS_OPERATION, requirement
assert "follows the tier of the operation it mirrors" in line
continue
assert declared == published[line], requirement
def test_the_untiered_requirement_really_is_absent_from_the_tier_block():
published = _published_tiers()
untiered = [name for name, tier in mg.CAPABILITY_REQUIREMENTS.items()
if tier == mg.TIER_UNTIERED]
# TWO since 2026-08-22: add-doxbench-editing-phase-b's archive promoted
# `Subject-Free Local Consumers…` into the capability, and the spec's tier
# block does not tier it either. The list stays EXACT rather than becoming
# a membership check — an untiered requirement is a fact about the spec, so
# a third one appearing should fail here and be looked at.
assert untiered == [
"Derived memory bindings validate against the neutral schema",
"Subject-Free Local Consumers Declare Their Inapplicable Rails"]
for name in untiered:
assert not any(line.lower().startswith(name.lower())
for line in published)
```
`mg` is `opendox.doxbench_memory_gateway`, and the helper needs `import re`. At openxFactory, `REPO_ROOT` is openxFactory's own root, where the spec is (22 requirements at `0d48231b`, and `CAPABILITY_REQUIREMENTS` holds 22).
</details>
## The nine files (research R3), at `main` `68be484a` and at this head
With the root conftest in play, Python 3.12.3, `-c constraints-cpython312-linux.txt -e ".[test]"`. The nine files give the same results on `main` at `68be484a` as at `19370adc`:
| file | `main` | this head | cause | repair |
|---|---|---|---|---|
| `test_doxbench_abstract_pane.py` | 18 passed, 28 errors | 46 passed | § 3.4 slice S5 moved the workbench gate column out of the bundle, so a shell mounted with no column withholds the canvas, and the generate control with it | The harness is the host, so it contributes the column `app.js` resolves. It imports `_CONTRIBUTED_GATE` from `test_doxbench_view.py`, whose S7 note gives the reason, the way it already imports the DOM shim. The column answers `createGateLive` off the same `caps`, so the ungated and hosted mounts still have no gate. |
| `test_outline_tab.py` | 3 passed, 25 errors | 28 passed | the same | the same, and the pre-template sentence reads the SELECTION role's word from `NEUTRAL_DISPLAY`. It spelled openxFactory's "staged" before S7 parameterized it. |
| `test_doxbench_composition.py` | 13 errors | 13 passed | the same | the same |
| `test_provider_boundary.py` | 16 passed, 12 failed | 24 passed | 16.6's three stale reasons | See below. |
| `test_doxbench_memory_gateway.py` | 36 passed, 3 failed | 36 passed | read openxFactory's `openspec/specs/memory-gateway/spec.md` | the three cases move to openxFactory (above) |
| `test_consumer_reach.py` | 31 passed | 36 passed | none left after T011, whose bullet says *"T034 re-derives the rest of the file"* | re-derived: see below |
| `test_boundary.py` | 27 passed, 1 failed | 28 passed | the surface scan kept names whose `__module__` was the literal `"output_boundary"`, so after the carve every class fell out of the census | the guard's home is read off `output_boundary.__name__` |
| `test_doxbench_mcp.py` | 23 passed, 1 failed | 24 passed | the child was started as `-m ideation_dashboard.doxbench_mcp` with `PYTHONPATH=scripts/` | `-m opendox.doxbench_mcp` with `PYTHONPATH=src/` |
| `test_outline_model.py` | 47 passed, 1 failed | 47 passed | imported `doc_health` | the case moves to openxFactory (above) |
| **total** | **201 passed, 18 failed, 66 errors** | **282 passed** | | |
**`test_provider_boundary.py`, for 16.6's three reasons.** None of the twelve failures was a crossing. The file's docstring now records each reason.
1. **It read `snapshot_registry.py`**, its second HTTP-client holder, which the carve sent to openXdox-code. It is no holder in this package now, and the claim about it is not this leg's to make.
2. **It pinned seven per-module scan suites by filename.** The carve manifest sent five to openXdox-code (`test_doxbench_turns.py`, `test_doxbench_packet.py`, `test_doxbench_threads.py`, `test_doxbench_bridge.py` and `test_doxbench_mutation_boundary.py`) and left two in openxFactory (`test_doxbench_model.py` and `test_doxbench_status_exemption.py`, `stays_openxfactory_adapter`). `PRESERVED_SCANS` now pins the three this checkout carries. `PRESERVED_ELSEWHERE` records the seven with their homes, and a case asserts that none of them is here, so the record cannot go stale.
3. **Its sweep reached the runtime (§ 3.5).** `runtime/app.py` spells `Authorization` and `Bearer ` for the identity broker's token, which it checks on the way in. `runtime/oidc.py`, which verifies that token, spells `Authorization` in prose. Both are named as tier-two holders in place of `snapshot_registry.py`, and the provider tier is asserted absent from each, as it was from that module. The named list is an exemption, so it is not its own authority. Since review round 5, `test_the_identity_surface_is_the_runtimes_two_modules` holds it to exactly these two modules, and a third holder has to be argued on its own PR. `runtime/config.py` names `access_token` in `SECRET_PARAMETER_KEYS`, the credential names the runtime refuses and redacts. It gets one permit: that needle, in that module, only while that tuple still names it (read with `ast`), and no other provider-tier spelling there. Since review round 1, the permit covers only the tuple and the module's prose. The sweep asks `_spelled_in_code`, which reads every identifier, attribute name and string literal off the syntax tree outside the declaration and the documentation. A spelling there fails with its line. A case also holds the table to that one entry, not only to its size, so a second permit, or one moved to another module or needle, has to be argued on its own PR.
The boundary is still one module wide for anything that holds a provider credential. 16.6's own measurement agrees: only `doxbench_provider.py` reaches a model provider.
**`test_consumer_reach.py`, re-derived over the whole package.** T011 emptied `STILL_REACHING` by moving its only two entries.
- `test_the_record_is_the_whole_packages_own` now derives the record on every run. It imports every module the package's files define, in one interpreter, with all four siblings blocked. It follows the exception chain, because a stand-in resolved at import time raises `ConsumerReachUnavailable` with the `ModuleNotFoundError` as its cause. The modules that fail on a sibling must be exactly the record. Before this, a module outside `NEUTRAL_MODULES`, which names nine, could start needing `openxdox` at import time and pass the whole file. At this head none fails.
- Every other failure is classified, not dropped. The one read past is a module of `opendox.runtime` missing a package of the runtime extra, where the extra is not installed. In a `.[test]`-only venv, that is `app`, `db` and `oidc`, on `fastapi`, `psycopg` and `httpx`. Anything else fails the test by name: a syntax error, a broken module of openDox's own, an undeclared dependency, or a runtime package needed outside `opendox.runtime`. `RUNTIME_EXTRA` tables the extra's distributions with their import names, and `test_the_runtime_extra_is_the_one_pyproject_declares` holds its keys to `pyproject.toml`'s `runtime` list. `test_the_runtime_extras_modules_are_the_runtimes_own` holds the import names to two independent authorities, the runtime's own imports and the installed metadata. Each tabled name is one that a module of `opendox.runtime` imports. Every third-party package the runtime imports is tabled, or comes from one of the package's required dependencies. Where a tabled distribution is installed, each of its names is installed by it or by a distribution it requires.
- `CONVERTED_SITES` had fallen behind the tree by five names in two files: `branch_session.py`'s `gate_console`, the module whose nine default-argument reads the guard is named for, and `cli.py`'s `corpus_root_refusal`, `generate_snapshot`, `is_rfc3339_datetime` and `SCANNED_ROOTS`. They join the table. `test_every_name_bound_to_the_seam_is_guarded` holds the table equal to the names each module binds to the seam. None of the five is read at import time. The census reads every spelling of the seam:
- `Y = <seam>.X`, its annotated form, and `Y = <seam>.module(...)`;
- `<seam>` spelled as an alias of the module, as `opendox.consumer_reach` after `import opendox` or `import opendox.consumer_reach`, or through `from .. import consumer_reach` in a subpackage;
- each of these wherever the module runs it at import time, a module-level `if` or `try` included.
A wildcard import from the seam fails with its own message.
**Thirty-seven mutations, each a copy of this tree with one planted change, and each fails the assertion it targets.** One more runs in the `.[runtime,test]` venv. The first thirteen:
- an unlisted module gains a module-level `from openxdox import …`;
- an unlisted module resolves a stand-in at import time, which is caught through the exception chain;
- a new name is bound to the seam;
- `branch_session.py` reads `gate_console` at import time;
- a provider endpoint appears in a non-provider module;
- a `Bearer ` header appears in an unnamed module;
- the identity surface gains `MintedToken`;
- `SECRET_PARAMETER_KEYS` stops naming `access_token`;
- the redaction module gains `client_secret`;
- a carved-away scan suite comes back;
- the guard gains a public class the shim does not re-export;
- the pre-template sentence goes back to "staged topic";
- the abstract-pane harness loses its contributed column.
The twelve added in review round 1:
- an import-time `import doc_health` where a `doc_health` is installed;
- a module importing a missing module of openDox's own;
- a module that raises while importing;
- an undeclared dependency;
- `import fastapi` outside `opendox.runtime`;
- a runtime module importing a package the extra does not declare;
- a distribution added to pyproject's runtime extra and not tabled;
- `Y: T = consumer_reach.X`;
- `Y = consumer_reach.module(...)`;
- `runtime/config.py` spelling `access_token` in a dict key, in an attribute read, and in an f-string.
Eight more came from review rounds 2 and 3:
- `import opendox.consumer_reach` then `opendox.consumer_reach.module(...)`;
- `import opendox` then `opendox.consumer_reach.snapshot`;
- an alias of the seam module;
- a subpackage's `from .. import consumer_reach`;
- the seam imported inside a module-level `try`;
- a stand-in bound inside a module-level `if`;
- a wildcard import from the seam;
- a second redaction permit.
Two came from review round 4, and one more runs in the `.[runtime,test]` venv:
- an invented module in a `RUNTIME_EXTRA` row;
- a runtime module importing a package nothing declares, read statically;
- in `.[runtime,test]`, a module tabled under a distribution that does not install it.
Two came from review round 5:
- a third identity holder listed, with `Authorization` in its code;
- the one redaction permit moved to another needle, with `runtime/config.py` spelling that name instead.
Two controls pass, as they must: a new comment and a new docstring in `runtime/config.py` that name `access_token`.
## The falsifier: `python -m pytest -q` over the nine files
```
$ python -m pytest -q tests/test_doxbench_abstract_pane.py tests/test_outline_tab.py tests/test_doxbench_composition.py tests/test_provider_boundary.py tests/test_doxbench_memory_gateway.py tests/test_consumer_reach.py tests/test_boundary.py tests/test_doxbench_mcp.py tests/test_outline_model.py
282 passed in 22.93s
```
It also passes under `--noconftest`, file by file, and in a `.[runtime,test]` venv.
## The repository's own check
`.github/workflows/validate.yml`'s three report-producing steps, run as the file writes them and summed as `Pin the triple` sums them, in the `.[test]` venv above:
```
triple: selected=1160 passed=1157 skipped=3 failures=0 errors=0
pins: selected>=1114 (margin 46) passed>=1111 (margin 46) skipped==3
```
`main` at `68be484a` gives `1155/1152/3`. The five new cases are `test_consumer_reach.py`'s, which the required job runs by name. `test_provider_boundary.py`'s new cases are not on the job's list. No skip was added.
**The whole suite, with the root conftest.** A test-by-test JUnit diff against `main` in the same venv:
| venv | `main` | this head |
|---|---|---|
| `.[test]` | 19 failed, 1489 passed, 13 skipped, 66 errors | 1 failed, 1570 passed, 13 skipped |
| `.[runtime,test]` (F2.1's install) | 18 failed, 1490 passed, 13 skipped, 66 errors | **1571 passed, 13 skipped** |
- 69 cases go from red to passed, all in the nine files.
- 15 are gone: the 4 moved cases, and 11 of `test_provider_boundary.py`'s old ids. Nine were `PRESERVED_SCANS` rows for files this checkout does not carry, one was the renamed tier-two case, and one was the `snapshot_registry.py` case.
- 12 are new, all passing: 5 in `test_consumer_reach.py` and 7 in `test_provider_boundary.py`.
- No other outcome changed.
- The `.[test]` venv's one failure is T030's `test_every_module_imports_with_no_sibling`, which needs the `runtime` extra there, as #46 recorded. T036 gives the `test` extra those packages.
## Review round 1 (Copilot, at `6898748a`)
Each finding was planted at `6898748a` first, and every plant passed there. Each is fixed in `86b8f522`, where every plant fails, and each thread is answered with its evidence and resolved.
- **The derivation blocked only `openxdox`.** With a `doc_health` on the path, a module gaining `import doc_health` dropped out of the census. The derivation, and the record entry check that reads the same failure, now block all four.
- **The derivation dropped every failure that named no sibling.** They are classified now (above).
- **The `access_token` permit covered the whole of `runtime/config.py`.** It covers the declaration and the prose now (above).
- The review's overview also named annotated assignments in the seam census, with no thread. That is done too (above).
## Review rounds 2 and 3 (Copilot, at `86b8f522` and `9d52122b`), no threads
- **Round 2: one previously missed finding.** `import opendox.consumer_reach` binds `opendox`, so a stand-in bound through `opendox.consumer_reach` went unseen. Three sibling forms were unseen the same way. All four are read since `9d52122`, and each passed as a plant at `86b8f52`.
- **Round 3: a summary line only, "seam-alias and wildcard-import gaps, and the single provider-boundary permit invariant."** Since `9a9b21a`:
- the census reads a module-level `if` or `try`, where both plants passed at `9d52122`;
- a wildcard import fails with its own message;
- the permit table is held at one entry.
- **At `9a9b21ae` Copilot reports "Needs a closer look", with no finding and no thread.**
## Review round 4 (Copilot, at `7867614c`, the first merge of `main`)
- **`RUNTIME_EXTRA`'s import names were checked only through its keys.** Adding `"planted"` to fastapi's row left the whole of `test_consumer_reach.py` green at `7867614`, and a missing `planted` import in `opendox.runtime` would then have been read past as an absent extra. Fixed in `383b3232` by the new case above, which holds the names to the runtime's imports and to the installed metadata. The thread is answered with that evidence and resolved.
- **At `383b3232` Copilot reports "Needs a closer look", with no finding and no thread.**
## Review round 5 (Copilot, at `7e3dc9ff`, the merge of T032)
- **`IDENTITY_MODULES` was its own authority.** `holders_seen == permitted` proves only that each listed module holds a needle. Planted at `7e3dc9ff`, `runtime/db.py` added to the tuple, with an `Authorization` string in its code, passed the whole file (`24 passed`). The thread also names line 318, the permit table's pin, which held `REDACTION_PERMITS` by its size only. Planted there, the permit moved to `refresh_token`, with `runtime/config.py` spelling that name in place of `access_token`, passed too (`23 passed`). Fixed in `bc6b168d`: each table is held to the surface it names (above), and both plants fail. The thread is answered with that evidence and resolved. All five threads on this PR are resolved.
## Landing
- T032 (#49) and T022 (#45) have landed, and `main` `68be484a` is merged in. Everything above was re-run at this head.
- `tests/test_consumer_reach.py` has one writer at a time (T011 → T034), and this is its second.
- P1-G (T035–T037, T031) follows this PR.
- 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>
…(plan 034) (#51)
Plan 034, task **T035**, slice P1-G (the whole suite in CI). The plan is `specs/034-opendox-standalone-operation/tasks.md` at opensoft/openxFactory `main` `133e37d9`. This PR realizes boxes **9.1 (part)** and **9.3 (part)** of the ratified `add-neutral-product-standalone-operability`.
- **Ruled:** R1Q2 (a), R1Q6 (d) and R1Q22 (a), openxFactory#656 comments `5817152735` and `5850003126`. All seven modules are carved rows, and none needs a declared-edit act.
- **Claim:** openxFactory#656 comment `5856501803`.
- **After:** T034, which landed as #50 → `71b631bc`. T032 landed as #49 → `68be484a`, and this branch was cut from it. `main` at `71b631bc` is merged in at `81f93777` (no force-push). Three review rounds followed, each in its own section at the end. Every figure below is re-measured at this head, `b173a970`.
## What changes
The root `conftest.py`'s `collect_ignore` is empty. It held seven modules under RULED Q-L3 (b). Requirement 9 (FR-006) asks this leg for no exclusion, so an entry there now would be an undeclared one, and the block's comment says so.
Each of the seven is rewritten in place as a neutral openDox test that imports no sibling. **No module leaves whole.** Fifteen **cases** test another repository's tree, contract or verb. They leave this suite, and the next section lists each one with its destination. One case is added.
| module | before | after | cause | repair |
|---|---|---|---|---|
| `test_subcommand_extension.py` | 3 failed, 13 passed | 16 passed | `CORE_COMMANDS` still listed `gate`, which the host profile contributes since the carve (research R8) | five core verbs |
| `test_model_provider_broker.py` | 4 failed, 68 passed | 72 passed | Two source paths under `scripts/ideation_dashboard/`. `__import__("ideation_dashboard.doxbench_bridge")`, a string the carve's import rewrite could not see. `from test_doxbench_model import FORBIDDEN_PORT_MEMBERS`, a test module that stayed in openxFactory. | `src/opendox/` paths; `opendox.doxbench_bridge`; the 16-name set carried in verbatim, with its provenance |
| `test_doxbench_entrypoint.py` | 4 passed, 4 errors | 8 passed | fixture setup reached `openxdox.corpus_root` (`ConsumerReachUnavailable`) | `cmd_generate_and_open` runs for real, with the six phase-1 reaches stood in (below) |
| `test_hermeticity.py` | 14 failed, 17 passed | 26 passed | Layer 2 of the guard was off (below). The layout pins described openxFactory's tree. Five cases test other trees. | layer 2 on; the pins rewritten for this layout; five cases move |
| `test_doxbench_chat_view.py` | 1 failed, 123 passed | 124 passed | read `contracts/schemas/xfactory-workbench-chat-turn.schema.yaml`, which the carve sent to openDox-spec | that case moves; a browser/server pair pin is added |
| `test_workbench.py` | 2 failed, 26 passed, 3 skipped | 25 passed | openxFactory's validator (the skips) and its doc-health check (the failures) | six cases move |
| `test_session_harness.py` | 1 collection error | 17 passed | loaded openxFactory's `scripts/sync-notebooklm-books.py` at import time | the load and three cases move |
| **total** | **24 failed, 4 errors, 1 collection error, 251 passed, 3 skipped** | **288 passed** | | |
"Before" is `main` `71b631bc`, each file named on the command line, which pytest collects despite `collect_ignore`. "After" is `81f93777`. Since then the review rounds added one case to `test_hermeticity.py` (27 passed at this head) and one assertion to a `test_doxbench_chat_view.py` case. Python 3.12.3, `.[runtime,test]` under `constraints-cpython312-linux.txt`.
### Three findings fixed on the way
1. **Layer 2 of the hermeticity guard was OFF in this suite.** `tests/hermeticity.py`'s `runner_seams()` probed `find_spec("ideation_dashboard.session_pr")`. This leg has no such package, so the probe returned no seams, and `workbench._default_runner` and `session_pr.SubprocessCommandRunner.run` stayed real in every test. Layer 1 (the `PATH` shim) was still on. But a non-zero exit is the very degradation the notebook adapter swallows, so an escape through the default runner would have passed green. The carve manifest's row for the helper records the probe resolving "to nothing at a destination that lacks them". The seams now name `opendox.workbench` and `opendox.session_pr`, with no probe. With the layer on, the whole `tests/` directory stays green, so no test was escaping.
2. **The `BaseException` handler scan read nothing.** It walked `scripts/ideation_dashboard/`, which does not exist here, and passed on zero files. It now reads `src/opendox/` (58 modules, 9 `BaseException` handlers, all re-raising), and it fails if it reads no module.
3. **The rootdir-anchor case matched a substring.** `rootdir: <repo>` also matches `rootdir: <repo>/tests`. Planted: a `tests/pyproject.toml` with a pytest table makes `tests/` the rootdir, which cuts the root conftest out, and it still prints `configfile: pyproject.toml`. Both of the old checks pass on that. The case now matches the whole value.
**And the P1-E hand-off.** The open-session-notebook case registers a home corpus first. Without one, the worktree listing refuses `ADAPTER_NOT_REGISTERED` before the runner is reached. Whether a registration was present depended on test order, because `cli.build_parser()` registers openDox's default process-wide. The case now registers that default itself, over a one-document scratch worktree instead of this checkout, and `monkeypatch` restores the previous registration.
### The entrypoint's stand-ins
`test_doxbench_entrypoint.py` tests what the entrypoint DECLARES: the model port (`doxbench_install.declared_model_port_factory`), its one process-lifetime adapter, and the session root. It never reads the snapshot. Plan 034's phase-1 limit (plan.md; research R7) is that `generate-and-open` still reaches openXdox for the snapshot and its generator, so exactly these are stood in:
- **`cli`:** `corpus_root_refusal`, `generate_snapshot` and `snapshot_mod.write_snapshot`. `SCANNED_ROOTS` is read only for a snapshot with no document, and the stand-in snapshot has one.
- **`serve`:** T011's three (`tests/test_route_handler_contribution.py`, section 6).
- The snapshot source goes in through `build_server`'s own `snapshot_source=` seam. The fixture asserts that the entrypoint passes none, so when phase 2 gives it one the fixture fails instead of standing in over it.
- `_checkout_real` answers **true**, where T011's answers false. The model port is gated on the `session` verdict (loopback, a real checkout, a resolved actor), and the carve's `base-repo` fixture these cases served was a real checkout.
## For T007's batch E, T041 and T047: the fifteen cases this PR moves
Each destination task lands exactly its part of this list, and T049 checks that every case arrived. The links are line ranges at `main` `68be484a`, so the cases' own text needs no archaeology.
**Thirteen become NAMED openxFactory composition tests (T047; R1Q2 (a)).** T007's batch E adds each destination path to F11.1's named set before T047 lands. **The paths are proposals.** If T047's writer chooses others, batch E records what T047 lands. openxFactory's `tests/ideation-dashboard/conftest.py` already reaches each moved file at the pin, through `carved_reach`.
| moved case (`68be484a`) | proposed openxFactory destination | what it needs there |
|---|---|---|
| [`test_saved_manifest_validates_clean_against_the_pinned_validator`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_workbench.py#L119-L126) | `tests/ideation-dashboard/test_workbench_manifest_validation.py` | The validator. The script lives in openXdox-code now, and openxFactory's conftest composes it (`find_openxfactory_validator` → `doxbench_contracts._composed_validator`), so there these cases run instead of skipping. |
| [`test_recipe_seeded_manifest_carries_the_recipe_block_and_validates`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_workbench.py#L129-L140) | same | same |
| [`test_committed_manifest_is_rejected_by_the_pinned_validator`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_workbench.py#L212-L224) | same | same, in `--repo` mode |
| [`test_scoped_doc_health_runs_real_machinery_over_the_fixture`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_workbench.py#L456-L466) | `tests/ideation-dashboard/test_workbench_scoped_doc_health.py` | openxFactory's `doc_health` check registered with T026's seam (T046, in T047's PR), and its `base-repo` fixture |
| [`test_scoped_doc_health_finds_a_real_missing_status`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_workbench.py#L469-L475) | same | same |
| [`test_scoped_doc_health_ignores_out_of_scope_docs`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_workbench.py#L478-L486) | same | same. Here it passed only because an empty findings list satisfies its `all(...)`. |
| [`test_worktree_container_is_gitignored_in_the_aggregation_repo`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_session_harness.py#L248-L260), with [`find_aggregation_root`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_session_harness.py#L229-L238) | `tests/ideation-dashboard/test_session_worktree_book_scan.py` | the aggregation checkout's ignore file, found by the parent walk (it skips where there is none) |
| [`test_session_worktrees_never_reach_a_lifecycle_book`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_session_harness.py#L279-L329) | same | `scripts/sync-notebooklm-books.py`, loaded by spec as the module did ([lines 37–45](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_session_harness.py#L37-L45)) |
| [`test_pinned_factory_paths_never_admits_a_worktree_container`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_session_harness.py#L332-L347) | same | same |
| [`test_the_browser_ceiling_is_pinned_to_the_RELEASED_maxLength`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_doxbench_chat_view.py#L4148-L4166) | `tests/ideation-dashboard/test_doxbench_chat_ceiling.py` | The released `xfactory-workbench-chat-turn.schema.yaml`, which the carve sent to **openDox-spec** (`moved_verbatim` → `opendox_spec`), and `doxbench-chat-model.js`, both through `carved_source(...)` at the pin |
| [`test_a_pytest_run_started_inside_a_conftestless_directory_is_guarded`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_hermeticity.py#L604-L621), with [`_probe_run`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_hermeticity.py#L595-L601) | `tests/ideation-dashboard/test_hermeticity_probe_routes.py` | openxFactory's `tests/notebooklm/test_hermeticity_guard.py` and `pytest.ini`, both `not_moved` and both present at `133e37d9` |
| [`test_the_unittest_fallback_route_installs_the_same_guard`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_hermeticity.py#L640-L660) | same | `tests/hermetic_unittest.py` (`not_moved`, present) |
| [`test_the_bare_unittest_route_is_detected_as_unguarded`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_hermeticity.py#L663-L674) | same | the same probe |
**Two join openXdox-code's declared `doc_health` exclusion (T041; R1Q6 (d)).**
| moved case (`68be484a`) | proposed openXdox-code destination | why the exclusion, not `tests/integration/` |
|---|---|---|
| [`test_an_unguarded_cli_scoped_create_is_refused`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_hermeticity.py#L226-L240) | `tests/test_hermeticity_gate_verbs.py`, listed in T041's exclusion | Both drive `gate create-document`. `gate` is the host profile's verb (openXdox's `cli_gate.GateSubcommands`), so this suite's empty profile has none to parse. `cli_gate` imports `gate_console`, which does `from doc_health import corpus` at module level (`:63`), so F9.2 could not run them in `tests/integration/`. |
| [`test_the_cli_seam_with_a_fake_port_reaches_no_binary`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_hermeticity.py#L262-L275) | same | same |
The guard itself is still proved here, through the default adapter and through `open_session_notebook`.
### Notes for the destinations (none blocks this PR)
- **The three hermeticity route cases are not compositions.** They test openxFactory's own tree and touch no openDox file. Batch E's admission should say whether they join F11.1's named set or land as plain openxFactory tests.
- **openxFactory's own `tests/hermeticity.py` has the same `find_spec` probe.** When `scripts/ideation_dashboard/` leaves openxFactory, its layer 2 goes off just as silently as it was off here.
- **The serve-side twin of the chat ceiling is broken at its destination too.** openXdox-code's `tests/test_doxbench_knowledge_service.py::test_the_serve_side_ceiling_is_pinned_to_the_RELEASED_maxLength` reads `REPO_ROOT/contracts/schemas/xfactory-workbench-chat-turn.schema.yaml`, which openXdox-code does not carry. It is hidden today because that file is in T041's `doc_health` exclusion. The pair pin added here, `test_the_browser_ceiling_equals_the_servers_ceiling`, holds one side of the triangle whatever happens to that one.
- **Until T047 and T041 land, these fifteen cases run nowhere.** At `133e37d9`, openxFactory's `tests/ideation-dashboard/` has none of the four source files (`test_workbench.py`, `test_session_harness.py`, `test_hermeticity.py`, `test_doxbench_chat_view.py`); they moved at the carve.
## The falsifier: `python -m pytest -q tests/`, with the root conftest in play and `collect_ignore` empty
At this head, `b173a970`, `.[runtime,test]`:
```
$ python -m pytest -q tests/
1860 passed, 13 skipped in 134.84s (0:02:14)
```
`main` `71b631bc` gives `1571 passed, 13 skipped`. A test-by-test JUnit diff at `81f93777` (`1859 passed`): 288 cases go from not collected to passed, all in the seven modules, and no other outcome changes. This head adds the 289th. The 13 skips are `main`'s:
- 2 in `test_binding_stylesheets.py` (T037's pair);
- 8 in `test_doxbench_bridge_live.py` (no `omp`);
- 3 in `test_openprofiler_broker_e2e.py` (no broker).
In a `.[test]`-only venv the same run gives `1 failed, 1859 passed, 13 skipped`. The one failure is `test_imports_standalone.py::test_every_module_imports_with_no_sibling`, T030's. It needs the `runtime` extra and fails in that venv on `main` too (#46 recorded it). T036 cures it by giving the `test` extra those packages. (At `81f93777` there were two failures in that venv. The second was the two-directory case, and Copilot's third round below took it out.)
## Fourteen planted mutations, each caught
Each plant is one change to a scratch copy of this head, and each fails the cases it targets. A control run of all 17 targets passes first.
1. `runner_seams()` returns no seams again: the four layer-2 cases fail.
2. The open-session case loses its home-corpus registration: it fails, because the refusal becomes a notice.
3. The handler scan points back at `scripts/ideation_dashboard/`: it fails, having read no module.
4. A production `except BaseException: pass`: the scan names it.
5. The root conftest claims the slot: `tests/test_hermeticity.py` stops collecting, with `cannot import name 'REPO_ROOT' from 'conftest'` naming the root conftest.
6. `tests/conftest.py` stops claiming: the two-directory case fails, and so does the source pin. `pytest --co tests tests_runtime` gives 34 collection errors, each `cannot import name 'REPO_ROOT' from 'conftest' (tests_runtime/conftest.py)`.
7. `pyproject.toml` loses its pytest table: the anchor case fails.
8. A `tests/pyproject.toml` with a pytest table: the anchor case fails, on the whole-value match alone.
9. The entrypoint declares no model port: the four fixture cases fail.
10. The browser ceiling becomes 501: the new pair pin fails.
11. The brokered port grows `generate`: the forbidden-member case fails.
12. `doxbench_binding.py` imports `yaml` at module scope: the lazy-import case fails.
13. The provider client spells `shell=True`: the shell case fails.
14. `cli` gains a sixth core verb: the core-command case fails.
**One correction the plants forced.** pytest 8.4.2 still falls back to a `pyproject.toml` with no pytest table, when it finds no other config file above it (`_pytest/config/findpaths.locate_config`). The helper's comment and the anchor case's docstring say so, and say why the table is still checked: without it, a `pytest.ini` in any enclosing directory would take the rootdir.
## Copilot's review at `81f93777`: two cases added
The review found nothing and asked for two cases ("Add an independent released-contract assertion and a nested-rootdir regression case"), with no thread. Both are in `4e5c89a9`, and each was planted against first:
- **The released ceiling.** The pair pin holds the browser's constant to the server's, and it cannot see both move together. The case now also holds the server's constant to the released `maxLength`, 500, carried with its source (`xfactory-workbench-chat-turn.schema.yaml` in openDox-spec, read at openDox-spec `main` `8fe8c4c7`). Planted: both constants at 600. The pair still passes, and this line fails.
- **A nested rootdir.** `test_a_nested_rootdir_is_refused_by_the_whole_value_match` is the negative control for the anchor case's match, on a scratch tree. A nested `tests/pyproject.toml` with a pytest table makes `tests/` the rootdir, and the header still prints `configfile: pyproject.toml`. The substring match and the configfile check both accept that header, and the whole-value match refuses it. With the nested file gone, the whole-value match accepts the tree's own root. Planted: the substring match put back, and the control fails.
## Copilot's review at `4e5c89a9`: no leak, measured
The review said the open-session case "leaks the registered home factory because the monkeypatch does not restore the original state". It does not. `monkeypatch.setattr(ca, "_home_factory", ca._home_factory)` records the current value for teardown, and teardown restores it after `register_home` replaces it. Measured with a probe that reads `corpus_adapter._home_factory` before setup and after teardown of that one case:
- It is the same object afterwards, both from nothing registered and from a different registration.
- With that line deleted, it is not, in either state.
The answer is on this PR as a comment. `4100cee8` puts a comment on the line and changes nothing else.
## Copilot's review at `4100cee8`: one finding, fixed
"The cross-suite hermeticity check fails in the declared test-only environment." That is true of a `.[test]`-only venv, where `tests_runtime/test_oidc_verifier.py` cannot import `httpx` until T036. The required workflow at this head does not run the case, so CI was green, but the case did turn a missing package into a slot failure. Since `b173a970` it compares the whole collection outcome of the two orders: the count, and the files that failed to collect.
- A missing package fails the same way in both orders, so the case passes in both venvs.
- With `tests/conftest.py`'s claim removed, it fails in both venvs.
- Any collection error is still refused by the suite itself, and after T036 by the pinned triple.
The thread is answered with this evidence and resolved.
## The repository's own check
`validate.yml` is unchanged. Its steps name none of the seven modules, and they run with `--noconftest`, so the root conftest's list never reached them. The triple is `main`'s. T036 re-pins it for the whole suite.
## Landing
- T034 has landed, and everything above is re-run at the merged head.
- T036 (with T031) follows this PR, then T037.
- Squash or merge, never rebase. The commit 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan 034, task T032, slice P1-F (the sweep and the nine-file repair). The plan is
specs/034-opendox-standalone-operation/tasks.mdat opensoft/openxFactorymain468863d1, where round 2 (#1176) has landed. The T032 through T035 entries there are byte-identical to0d48231b's, which this record was first written against. This PR realizes box 2.3 of the ratifiedadd-neutral-product-standalone-operability.5817152735.5852380744.255514df, merged in at5270acf0. T038 then landed as 10.1: [project.scripts] opendox = "opendox.cli:main" (plan 034 T038) #48 →796838e8, andmainat796838e8is 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, andimportlib.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-code1e4a57fb(ARC_BASE,evidence/arc-base.md), and atmain796838e8. That is where the last lane (T022) joined, plus T038's console script. This PR changes nothing undersrc/, so this head gives the same result.1e4a57fb796838e8ideation_dashboard)openxdoxClosed: every reach into openxFactory, and every import-time reach.
1e4a57fbserve.py:199,:206(import time)ideation_dashboard.serve_openxfactory_lanes0e88454aserve.py:713,_head_ofdoc_health.corpus(RealGit)27683028authoring.py:318,_classify_proposalcorpus_adapter_openxfactorycorpus_adapter.home()9d13bd16workbench.py:746,session_documentsdoc_health.corpuslist_documentsc46430fbworkbench.py:1407,:1408,:1409,run_scoped_doc_healthdoc_health,.families,.runner582ed073serve_wire.py:1369,default_doxbench_validatorsideation_dashboard.doxbench_contracts8017cd52doxbench_packet.py:177,_status_exemptionideation_dashboard.doxbench_status_exemption8017cd52Deferred: 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'sOPENDOX_BACK_IMPORTSratchet counts them by module:branch_session7,serve_workbench7,serve2,serve_project2,cli1.796838e8branch_session.py:1568openxdox.generator_change_rowsbranch_session.py:1587openxdox.register_active_pick_fallbacksbranch_session.py:2005openxdox.kickoffproposal_state_forbranch_session.py:2105,:2151,:2228,:3573openxdox.snapshot_registrysession_entry,register_session_entry,refresh_session_snapshot,refresh_main_viewcli.py:628openxdox.snapshot_registry_session_registryserve.py:648openxdox.corpus_root_checkout_real, called by everybuild_serverserve.py:2118openxdox.corpus_root_refuse_impossible_checkout_root, called byserve.main()serve_project.py:246,:247openxdox.gate_console,openxdox.kickoff_serve_project_registerserve_workbench.py:347,:544,:1665,:2607openxdox.doxbench_scope_is_live_session_ref,_handle_workbench_thread,_handle_workbench_chat_turn,_handle_workbench_document_abstractserve_workbench.py:407,:408openxdox.gate_console,openxdox.gate_routes_thread_gateserve_workbench.py:1215openxdox.gate_console_handle_workbench_model_approvalThe 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.pyholds sevenmodule(...)stand-ins (gate_console,snapshot,snapshot_registry,corpus_root,generator,serve_projection,serve_gate). Each resolvesopenxdox.<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, inserve.py22,branch_session.py20,cli.py18,serve_workbench.py4 andworkbench.py1. They are deferred too, intoopenxdoxalone, and T084 retires the module.Prose, not import position.
git grep -wfinds each name insrc/beyond these:ideation_dashboardon 44 lines,doc_healthon 25,corpus_adapter_openxfactoryon 2, and the rest ofopenxdox'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:33anddoxbench_scope_types.py:40say "this module uses ABSOLUTEideation_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 parsessrc/whole, the two top-level extension modules included, as F4.1 parses the package, and it asserts four things:ideation_dashboard,doc_healthorcorpus_adapter_openxfactory, in either spelling (the pre-carvescripts.one too), the phase-1 cut of 4.3;openxdox, the positive form of F4.1 "lists onlyopenxdoxtargets";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.pyproves only its import-time half, where no sibling is installed. On this tree, the sweep itself finds exactly F4.1's 19, allopenxdoxand all deferred.How it reads a module. It reads by syntax, not by grep. Prose names the four packages on purpose.
from a import b's members as the submodules they may be (from scripts import doc_health). A star member is named too.import_moduleand__import__calls with a literal name, by position, asname=, or spelled out of a literal*[...]/**{...}, and under an import alias.package.__import__resolves against itsglobals:globals()is the module's own, and a literal{"__package__": ...}resolves.__import__'s literalfromlistalso counts.globals()or__package__in a module that rebinds them; afromlistthat is not a literal; and a star import, in either form, from a package a sibling lives under (from scripts import *). A star fromosnames nothing.consumer_reach's seam imports.TYPE_CHECKING, postponed annotations, a generator), it reads position, the stricter reading. PEP 695's lazy positions are read as deferred.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 readernames_imported_byand its helpers live there, andimported_modulesreads with it. Every new behaviour is opt-in, soimported_modules' output,bound_names', andstring_literals' default output are identical tomain's reader over every parsed file in this repository: 141 files, 1524 imports, 0 differ. The three callers ofimported_modulesgive the same result with and without the edit.The falsifier: F4.1's scan, which lists only
openxdoxtargetsscan_deferred_reaches.py, research.md's appendix, persisted in opensoft/brett-wip. Its sha256 isfe11620319b02c23dd9a014bc581e1f4867f013f3c26890d43b12dccce5530a0, which matches the digestevidence/remeasure-2026-09-25.mdrecords. Run from this head,python3 scan_deferred_reaches.py src/opendox:Every target is
openxdox. At1e4a57fbthe 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 retiresconsumer_reach.py.The new test.
python -m pytest -q tests/test_reach_sweep.pyat this head gives35 passed, with the root conftest and under--noconftest. The same file, with this head'stests/import_scan.py, run over1e4a57fb's tree fails the three reach assertions: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 asPin the triplesums them. The venv was Python 3.12.3 with-c constraints-cpython312-linux.txt -e ".[test]":This matches
main. The new file is not on the workflow's list, and neither is any caller oftests/import_scan.py. T036 ownsvalidate.ymland makes the whole suite the required run.The whole suite, with the root conftest, in the same venv:
main796838e8gives19 failed, 1454 passed, 13 skipped, 66 errors, and this head gives19 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
19b0ecc2recommends 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.61b308edimport_module(name=...); PEP 695 type parameters; one shared readerae82e2b5ae82e2b5import_moduleeece371eeece371eimport_moduleagainst a literalpackage9862669f9862669fab022702ab022702d9d3f3f9(a module holding an importer as a value is read strictly)d9d3f3f9*[...]and**{...}981fce655270acf0e6bd5ef5(UNREADABLE for any other spread)e6bd5ef54b0cb7254b0cb725,aa92f71aglobalsaa92f71a(the spelling check),6cf729ef,c3283e556cf729efscripts.spelling; the full-name match; a concatenated lookup keyc3283e55c3283e55globals; a rebound__package__1fdd7fbb1fdd7fbbfrom scripts import doc_healtha5a7f745a5a7f745__import__'sfromlist0f7af1a10f7af1a1scripts; with it, found in measuring, a strict module's calls read by one importer's rule only19b0ecc2;b53b9db2names UNREADABLE for each case it stands forLanding
main796838e8is merged in. Everything above was re-run at this head.tests/test_consumer_reach.py's record against this sweep.Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
🤖 Generated with Claude Code
Summary by Sourcery
Enforce standalone operability by detecting import-time sibling dependencies and forbidding all openxFactory package reaches from source code.
New Features:
src/are deferred when appropriate and target only the standalone consumer package.Bug Fixes:
Enhancements:
Tests: