Repository navigation
BUILD slice 2b: openDox stops naming its consumer at import time — the nine, through the § 2.4 seams and openDox-owned defaults - #10
Conversation
… need `src/opendox/defaults.py` (CREATED) owns the three values eleven of openDox's own signatures defaulted to `<consumer module>.<CONSTANT>` — the default arguments openDox-code #9 § 3 converted, measured and REVERTED because a default runs at import time and the openXdox-side ratchet, an AST census over Import nodes, cannot see one. `src/opendox/consumer_reach.py` grows the three module stand-ins, the four callables and the ONE constant the remaining reaches need, each with the reason it still points that way. `_LateConsumerValue` is new and is the family's narrowest member: `cli.py`'s `SCANNED_ROOTS` is read at a line the carve manifest does not declare, so the NAME has to keep behaving like the tuple it was. No carved file is touched by this commit. Refs opensoft/openXfactory#656 Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Reviewer's GuideThis slice removes nine remaining import-time Sequence diagram for deferred consumer resolutionsequenceDiagram
participant OpenDox
participant Reach as consumer_reach
participant Consumer as openxdox
OpenDox->>Reach: module()
Reach-->>OpenDox: late stand-in
OpenDox->>Reach: generate_snapshot()
Reach->>Consumer: resolve()
Consumer-->>Reach: callable
Reach-->>OpenDox: invoke callable
OpenDox->>Reach: scanned_roots iteration
Reach->>Consumer: resolve()
Consumer-->>Reach: SCANNED_ROOTS
Reach-->>OpenDox: iterate value
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
🟡 Changes recommended
Consumer bindings and defaults must be wired into call sites, and constant-proxy behavior needs tests.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds lazy consumer reach abstractions and openDox-owned defaults to remove import-time openxdox dependencies.
Changes:
- Adds lazy module, callable, and constant proxies.
- Adds mirrored openDox-owned default values.
- Registers consumer reach points for corpus, snapshots, projections, and scanned roots.
File summaries
| File | Summary |
|---|---|
src/opendox/defaults.py |
Defines mirrored defaults, but existing implementation call sites remain unwired. |
src/opendox/consumer_reach.py |
Adds lazy reach support, but CLI/serve bindings remain unwired and constant-proxy behavior lacks test coverage. |
Review details
Suppressed comments (2)
src/opendox/consumer_reach.py:349
- These late callables are only declared here;
cli.pystill imports and callscorpus_root_refusal,generate_snapshot, andis_rfc3339_datetimedirectly fromopenxdoxat module scope. Consequentlyimport opendox.clistill requires the consumer, so this seam does not implement the advertised lazy reach. Rebind the CLI names to these helpers (and itsSCANNED_ROOTSuse toscanned_roots) in the same change.
corpus_root_refusal = function(corpus_root, "corpus_root_refusal")
src/opendox/consumer_reach.py:360
hosted_ref_refusedis also not wired intoserve.py, which still imports it directly fromopenxdox.serve_projectionat module scope and calls that binding. Thusopendox.serveremains import-time dependent on the consumer despite this new reach; replace the re-export/import with this lazy binding as part of the conversion.
hosted_ref_refused = function(serve_projection, "hosted_ref_refused")
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…sole at import time `from openxdox import gate_console` (:77, declared) becomes `from .consumer_reach import gate_console` — the same NAME, bound to the late stand-in step 1 added, so all thirty-odd `gate_console.X` call sites below are unchanged and only the DIRECTION at import time goes (`design.md`:243). The nine `records_dir: str = gate_console.DEFAULT_RECORDS_DIR` DEFAULT ARGUMENTS (:1740, :1859, :1878, :4179, :4217, :4254, :4287, :4504, :4991 — the nine lines the Q-L1 row annotation declares) become `DEFAULT_RECORDS_DIR` from `opendox.defaults`. No stand-in can serve them: a default argument is evaluated where the `def` sits, at import time, which is what openDox-code #9 § 3 measured and reverted. `import opendox.branch_session` now succeeds with `openxdox` unimportable. Every edited line is one the row declares — carve 77 (replaced by the import plus its reason) and the nine annotated default lines; the arrival verifier reports no undeclared line. Refs opensoft/openXfactory#656 Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…time — three of the nine `from openxdox.corpus_root import (SCANNED_ROOTS, corpus_root_refusal)` (:79, continued :80-81) and `from openxdox.generator import (generate_snapshot, is_rfc3339_datetime)` (:82, continued :83-84) become bindings to the `consumer_reach` stand-ins, in the idiom `gate_mod` and `snapshot_mod` two lines above already use. Every call site is unchanged — the three callables resolve on first CALL, and `SCANNED_ROOTS` keeps its NAME because :239 iterates it at a line no row declares. The NINETEEN-VERB gate re-export (:979, continued :980-987) is DELETED rather than proxied. The verbs are a CONTRIBUTION: `cli_gate.GateSubcommands.register()` attaches them to this parser's own subparsers action through `subcommand_extension` (§ 2.4), so `args.func` carries the function OBJECT and `openxdox.cli_gate.cmd_gate_*` is the name that holds it. A stand-in would have answered the call and broken `args.func is cli_mod.cmd_gate_edit_document` — the identity the re-export existed to keep — so it would have looked like it worked. No module under `src/opendox/` read any of the nineteen. DISCLOSED, in the comment that replaces the block: four carved suites at openXdox-code still spell four verbs through this module at lines that repository's rows do not declare. None is collected there today, so the respelling is owed to the act that un-ignores them. `import opendox.cli` no longer fails on its OWN reaches; it still fails through `opendox.serve`, which is the next commit. Every edited line is declared — carve 79-84 and 979-987, the Q-L1 row annotation's own lines; the arrival verifier reports none undeclared. Refs opensoft/openXfactory#656 Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Consumer-dependent call sites and validation updates remain incomplete, with additional default integration and coverage gaps.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (5)
src/opendox/consumer_reach.py:355
- These new consumer reaches are not wired into their existing call sites:
cli.pystill importscorpus_root_refusal,generate_snapshot, andis_rfc3339_datetimedirectly fromopenxdox(and still readsSCANNED_ROOTSdirectly), so importingopendox.clistill requires the consumer and these proxies have no effect. Rebind those names to the late reaches here, or defer adding them until the call sites are changed.
corpus_root_refusal = function(corpus_root, "corpus_root_refusal")
#: `generator.generate_snapshot` and `generator.is_rfc3339_datetime` —
#: `cli.py`'s two generate verbs (:184, :501) and its `--generated-at` shape
#: check (:156).
generate_snapshot = function(generator, "generate_snapshot")
is_rfc3339_datetime = function(generator, "is_rfc3339_datetime")
src/opendox/consumer_reach.py:360
hosted_ref_refusedis also still imported directly fromopenxdox.serve_projectioninserve.py:188-194, so this new callable is unused andopendox.servekeeps its import-time consumer dependency. Rebind the existing handler/re-export to this late reach together with the correspondingserve.pychanges.
#: `serve_projection.hosted_ref_refused` — `serve.py:760` must never NAME a
#: session ref on a hosted response (FR-048), and the predicate that decides it
#: travelled to the projection column with its neighbours.
hosted_ref_refused = function(serve_projection, "hosted_ref_refused")
src/opendox/consumer_reach.py:198
- The new
_LateConsumerValueprotocol has no coverage intests/test_consumer_reach.py, even though its custom dunder forwarding is the only behavior that makes the re-exported sequence constant usable. Add tests with the consumer blocked and present that exerciseconstant()resolution/caching and iteration (the productionSCANNED_ROOTSuse), so a regression in this proxy cannot pass unnoticed.
class _LateConsumerValue:
"""One CONSTANT of a consumer module, resolved on first use.
THE NARROWEST MEMBER OF THIS FAMILY, and the one that needs an argument for
existing at all. A constant cannot be deferred the way a module or a
function can: a module stand-in defers until an attribute is read and a
callable stand-in defers until it is called, but a name bound to a VALUE is
read by whatever the value is handed to. So this proxy defers to the first
OPERATION on the value — iteration, length, membership, subscript,
comparison, truthiness, `str()` — and forwards it to the resolved object.
src/opendox/defaults.py:75
- The snapshot server defaults declared here are currently unused:
serve.build_serverstill evaluatesregistry_mod.DEFAULT_INDEX_NAMEandregistry_mod.PEEK_TTL_SECONDSin its signature, and the CLI parser still reads those consumer constants. As a result these values are neither openDox-owned in behavior nor sufficient to remove the import-time reach; wire the server call sites to these defaults (or a late registry reach) in the same change.
#: The default snapshot-index filename, carried by `opendox.serve.build_server`'s
#: `index_name` parameter (:1279). Mirrors
#: `openxdox.snapshot_registry.DEFAULT_INDEX_NAME`.
DEFAULT_INDEX_NAME = "index.json"
src/opendox/defaults.py:70
- This introduces a second source of truth for the gate-records prefix even though
session_git.GATE_RECORDS_PREFIXis already the repository's shared prefix (src/opendox/session_git.py:79-83) and is used by session code. If either literal changes, the new consumer drift guard will not catch the openDox-side mismatch; derive this default fromGATE_RECORDS_PREFIXinstead of duplicating the string.
DEFAULT_RECORDS_DIR = "ideation/dashboard/gate-records/"
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
Unresolved moderate issues affect validation, proxy correctness, and remaining import-time dependencies.
Review details
Suppressed comments (6)
Previously missed (1) — in code that hasn't changed since the last review.
src/opendox/defaults.py:75
- These local index/TTL constants are not wired into the code that owns the corresponding signatures:
src/opendox/serve.py:1279,1283still evaluatesregistry_mod.DEFAULT_INDEX_NAMEandregistry_mod.PEEK_TTL_SECONDSat function definition time, and its parser uses the same module at :1696-1703. Consequentlyimport opendox.servestill requiresopenxdox, while these new constants remain dead; replace those uses (and the eager registry import) or omit these values until that slice lands.
src/opendox/branch_session.py:90
- This removes the last import-time default-argument reach from
branch_session, so the subprocess import intests/test_consumer_reach.pynow succeeds withopenxdoxblocked. That suite still listsopendox.branch_sessioninSTILL_REACHING(and asserts that its import must fail), so the validation workflow will fail; move it toNEUTRAL_MODULESand remove the stale reason in the same change.
from .defaults import DEFAULT_RECORDS_DIR
src/opendox/cli.py:993
- Deleting this import leaves the preceding "MOVED SURFACE, RE-EXPORTED" header incorrect: it still says the gate verbs are bound back onto
cliand thatargs.func is cli_mod.cmd_gate_edit_documentremains an identity guarantee, but that attribute no longer exists. Please update or remove that header so the module documentation matches the new public surface.
# THE NINETEEN GATE VERBS ARE NO LONGER RE-EXPORTED HERE (BUILD slice 2b). The
# block was `from openxdox.cli_gate import (...)` — nineteen names bound back
# onto this module at import time, which is the single largest reason
# `import opendox.cli` required the layer that PINS openDox.
src/opendox/consumer_reach.py:237
- The new
constant/_LateConsumerValueseam has no test coverage intests/test_consumer_reach.py, even though that suite covers the neighboring module and callable seams. Add cases that construct it without resolving the consumer, exercise the tuple operations used bySCANNED_ROOTS, and verify the missing-consumer refusal; otherwise this import-critical proxy can regress while the dedicated validation remains green.
def __iter__(self):
return iter(self.resolve())
def __len__(self) -> int:
return len(self.resolve())
src/opendox/consumer_reach.py:249
- When the resolved constant is a tuple, comparing this proxy with itself or another
_LateConsumerValuecan recurse:self.resolve() == otherasks the tuple to compare against a non-tuple, which dispatches back to this__eq__;__ne__has the same problem. Unwrap_LateConsumerValueoperands before forwarding the comparison.
def __eq__(self, other: Any) -> bool:
return self.resolve() == other
def __ne__(self, other: Any) -> bool:
return self.resolve() != other
src/opendox/consumer_reach.py:340
- This newly added reach is not used by
serve.pyor any other in-tree caller;serve.py:170,188still directly imports and re-exportsopenxdox.serve_projection, includinghosted_ref_refused. The late seam is therefore dead and the serve import-time dependency remains. Wire the serve names through this reach, or defer adding it until the corresponding serve change lands.
serve_projection = module(
"serve_projection",
reason="the snapshot, index and /source routes are openXdox's column "
"(design.md § D3); this core dispatches them through the § 2.4 "
"route extension point instead of inheriting them")
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Lite
… own test asked for `tests/test_consumer_reach.py` keeps two halves — the modules ASSERTED to import with `openxdox` unimportable (`NEUTRAL_MODULES`) and the modules RECORDED as still reaching (`STILL_REACHING`) — and the second half's test is written to FAIL when a module starts importing, because a slice landing is not a regression and the record then has to move. Step 2 made `import opendox.branch_session` succeed with no consumer present, and `test_the_reaching_modules_are_recorded_as_reaching[opendox.branch_session]` did exactly what it says: *"Move it from STILL_REACHING into NEUTRAL_MODULES in the same act, so the claim is asserted rather than merely no longer contradicted."* This is that move, one commit late — `validate` was red at d1d070b for this and nothing else. `opendox.cli` is checked and STAYS in the record, which is the more interesting half. Step 3 removed the last statement in `cli.py` that names the consumer at import time, so the module itself is clean; it still imports `opendox.serve`, which names two consumer classes as MIXIN BASES, and an importing module inherits its imports' reaches. Its entry is rewritten to say so, and to say that it leaves the list the moment `serve` does — one act, two modules — so that the record reads as a derived fact rather than as unfinished work of its own. `serve`'s entry drops the two clauses that are no longer the obstacle (the multi-line re-export blocks, the undeclared continuation lines) and names the two that are: the mixin bases, and `build_server`'s two default arguments. Refs opensoft/openXfactory#656 Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved findings cover census coverage, constant-proxy tests, unwired serve reaches, and defaults integration, plus an inconsistent census note.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (4)
Previously missed (1) — in code that hasn't changed since the last review.
src/opendox/cli.py:93
- The import-time AST guard in
tests/test_consumer_reach.pystill lists onlygate_modandsnapshot_modforcli.py, so these four new late-bound names are not checked for import-time reads. Addcorpus_root_refusal,generate_snapshot,is_rfc3339_datetime, andSCANNED_ROOTSto that census; otherwise a future eager use can lower the dependency count without the guard detecting it.
src/opendox/consumer_reach.py:243
- The new constant proxy has no focused runtime coverage: the existing seam tests exercise module and callable reaches, but not
constant()construction without importing the consumer, iteration/length forwarding, or the blocked-consumer refusal. Since_warn_on_empty_projectionnow depends onfor root in SCANNED_ROOTS, add a test covering that value path before relying on this facade.
def __iter__(self):
return iter(self.resolve())
def __len__(self) -> int:
return len(self.resolve())
def __contains__(self, item: Any) -> bool:
return item in self.resolve()
def __getitem__(self, key: Any) -> Any:
return self.resolve()[key]
src/opendox/consumer_reach.py:337
- This reach is not wired into the current code:
serve.pystill importsopenxdox.serve_projectiondirectly, usesserve_projection.ProjectionRoutesas a mixin, and re-exports/callshosted_ref_refused. Thus this new binding is dead and the rationale that slice 2b stopped naming the projection column is false; either convertserve.pyin this change or defer/remove these entries.
#: The projection's HTTP column. openDox's `serve` core keeps one reach into it
#: — `hosted_ref_refused`, below — after slice 2b stopped naming the column as
#: a mixin base and stopped re-exporting its names.
serve_projection = module(
"serve_projection",
src/opendox/defaults.py:75
- These constants are documented as the defaults carried by
build_server, butserve.pystill bindsbuild_server'sindex_nameandpeek_ttl_secondsdefaults directly toregistry_mod.DEFAULT_INDEX_NAMEandregistry_mod.PEEK_TTL_SECONDS. As written, the new snapshot defaults are unused exported values and do not provide the claimed openDox-owned defaults; either wire both call sites when the carve permits it or document these as intentionally deferred mirrors.
#: The default snapshot-index filename, carried by `opendox.serve.build_server`'s
#: `index_name` parameter (:1279). Mirrors
#: `openxdox.snapshot_registry.DEFAULT_INDEX_NAME`.
DEFAULT_INDEX_NAME = "index.json"
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
…t time — the last of the nine The four remaining import-time reaches in this module, in the order the file meets them, and the shape each needed: `from openxdox import snapshot_registry as registry_mod` (:135) becomes a binding to the `consumer_reach` stand-in, so every `registry_mod.X` read in the body below is unchanged and only the MOMENT of the reach moves — the idiom steps 2 and 3 already used. `build_server`'s two DEFAULT ARGUMENTS (:1304, :1308) could not take that shape, and they are the reason this slice needed `defaults.py` at all: a default is evaluated where the `def` sits, which is at import time, so no stand-in can defer it. They read `defaults.DEFAULT_INDEX_NAME` and `defaults.PEEK_TTL_SECONDS` — openDox's own spelling of values openDox owns — and openXdox-code's drift guard holds the two spellings together. Same act as `branch_session.py`'s seven, same argument. The two MIXIN BASES (`serve_gate.GateRoutes`, `serve_projection.ProjectionRoutes` on `DashboardHandler`) are the hard case and the one this step adds machinery for. A base expression is evaluated when the class statement runs, and a class needs its bases before its first instance exists, so a base cannot be deferred by any stand-in in the family. `consumer_reach.route_column` builds a stand-in BASE instead: one forwarding method per name the consumer's column defines, each calling `getattr(<consumer class>, name)(self, *args, **kwargs)` — the same function object with the same `self`, which is the live request handler. So `/snapshot.json`'s core arm still finds `self._serve_snapshot`, and a contributed binding naming `_handle_gate_action` or `_serve_index` still resolves against the bound class at wiring time, which is the check that refuses an unservable route BEFORE a socket. There is deliberately no `__getattr__`: a handler is probed for absent attributes constantly, and a base that answered those by importing openXdox would fire the reach at a moment no verb chose. The two RE-EXPORT blocks go, with one correction to the first draft of this step. Four of the six projection names and the one gate name have no reader in this repository and stay reachable at `openxdox.serve_projection` / `openxdox.serve_gate`. Two do have readers and KEEP their names here, bound to late stand-ins: `hosted_ref_refused`, which decides at :785 that a hosted response must never name a session ref (FR-048), and — the one the first draft dropped — `resolve_source_path`, which `notebook_action.py`:52 imports `from .serve` and :139 re-checks every resolved document through before a notebook action may name a path. Dropping that one would have turned a path-containment check into an ImportError, which is the one class of removal this slice must not make. `build_server` also stops reaching `profile_openxfactory.ROUTE_EXTENSIONS`, which is a REPAIR rather than a removal: openxFactory's carve manifest files `profile_openxfactory.py` as `deleted_at_carve` — "the one file the § 3 carve deletes rather than moves" — and the deferred import that fed this reach went with it while the reach itself was left behind, so `build_server()` raised `NameError: profile_openxfactory` for every caller. A server is now assembled from exactly what its caller hands it, which is what the § 2.4 seam is for. The docstring above it still describes the in-tree profile and is NOT corrected here: those lines are not ones the carve manifest declares for this row, and an edit outside the declared lines is an undeclared movement the arrival verifier refuses (RULED OQ-1). The comment beside it is the correction until an act that declares them lands. CENSUS. `openxdox` import-time reaches across `src/`: 0, from 9 at the head of this slice. 19 deferred reaches remain and are not this slice's business — they resolve inside verbs, which is the direction working, not the direction surviving. `opendox.serve` does NOT move into `NEUTRAL_MODULES`, and the record says why in a field this step adds. It is now blocked by `ideation_dashboard`, not by `openxdox` — openxFactory's pre-carve package name, a `stays_openxfactory_adapter` row (RULING DQ-1) present at neither carve destination, already censused in this file at 2 sites and owed to a later act. `STILL_REACHING` therefore records the BLOCKING PACKAGE per module and the test asserts it by name, plus — for a row whose blocker is not the consumer — that `openxdox` is NOT what the failure names. Without that, the substitution would have passed unread: the test would have stayed green on a nonzero exit while the thing it was written to measure had been fixed. `opendox.cli` is the same row, derived: it names no consumer itself since step 3 and inherits serve's. Refs opensoft/openXfactory#656 Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The seam's three members were not tested alike. `_LateConsumerModule` and the late callable had run-time tests from slice 2 — laziness, forwarding, caching, the dunder rule, the refusal naming the layering — and `_LateConsumerValue`, added in step 1 of this slice for `SCANNED_ROOTS`, had only its construction exercised by importing the module. A review pass on this pull request named the gap; these are the tests it asked for, one per claim the class makes. CONSTRUCTION RESOLVES NOTHING. `scanned_roots` is built while `consumer_reach` itself is importing, inside a package that must import with no consumer present, so a constant that resolved eagerly would make the module written to remove import-time reaches into one. `repr` is asserted not to resolve either, for the reason the class comments give: a debugger, a logging call and pytest's own assertion rewriting all reach for it. THE SEQUENCE OPERATIONS FORWARD. Iteration (`cli.py`:228's `for root in SCANNED_ROOTS`, the site the class exists for), length, membership both ways, indexing from each end, slicing, equality and inequality against the real tuple, truth, `str`, and `hash` — the last because a re-exported constant can land in a set or as a dict key. The assertions are written as INDISTINGUISHABILITY from the tuple, because that is the actual requirement: the read at :228 is not a line openxFactory's carve manifest declares, so the name had to keep behaving as what it was rather than be respelled. THE ATTRIBUTE READ IS REFUSED. `__getattr__` is deliberately absent — an attribute read on a constant is almost always a caller who wanted the module — and that refusal is now asserted rather than merely commented, as a plain `AttributeError`, which is what the tuple would have raised. THE UNAVAILABLE-CONSUMER PATH, AT EVERY OPERATION. With no consumer installed the binding is still constructed, so the refusal must arrive at first USE and must name which way the pin runs. Each of the ten operations is checked to raise `ConsumerReachUnavailable`, to name `openxdox.<module>`, to cite RULED OQ-2, and to chain the original `ModuleNotFoundError` so a reader still gets the import machinery's own account beneath the layering one. The fixture installs a pretend `openxdox.corpus_root` in `sys.modules` rather than importing one, so the tests hold both on a machine with openXdox-code present and in CI where it is absent, and it removes the fake PARENT only if it created it — the rule the slice-2 forwarding test already follows, because leaving an empty `openxdox` package behind would make every later test in the process see an importable-but-empty consumer. Refs opensoft/openXfactory#656 Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…onstant, not seven and two A review pass on this pull request caught a wrong number in a comment slice 2b wrote and a wrong constant name beside it. Both are corrected, and so is the inherited error behind them. THE COUNT. `branch_session.py` carries NINE `records_dir: str = DEFAULT_RECORDS_DIR` default arguments (:1740, :1859, :1878, :4179, :4217, :4254, :4287, :4504, :4991 — the line numbers step 2's own comment beside the import already lists), not seven. Seven is slice 2's number, written into this file's docstring when the conversion was reverted and repeated into openXdox-code's ratchet file; slice 2b copied it forward without counting. The docstring is corrected here and says that it was wrong, because a number a later reach-removal audit reads off a comment is worth no more than the count behind it. openXdox-code's copy is corrected in the ratchet act that lowers the census. THE NAME. There is no `DEFAULT_BRANCH_PREFIX` in this. It is ONE constant at nine sites — `gate_console.DEFAULT_RECORDS_DIR`, now `defaults.DEFAULT_RECORDS_DIR` — and `defaults.py` carries three values in total, the other two being `serve.py`'s `DEFAULT_INDEX_NAME` and `PEEK_TTL_SECONDS`. The comment now says so explicitly rather than leaving a reader to infer a second constant that does not exist. The eleven default-argument sites across the two modules therefore read three values, which is the sentence the docstring now makes. No behaviour changes: this act edits comments in `tests/test_consumer_reach.py` and nothing else. Refs opensoft/openXfactory#656 Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Route registration is broken in normal launches, and several new forwarding and import-isolation behaviors remain insufficiently tested.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
tests/test_consumer_reach.py:311
- The import-time-use guard still tracks only
gate_modandsnapshot_modforcli.py; it omits the four new stand-ins bound just above (corpus_root_refusal,generate_snapshot,is_rfc3339_datetime, andSCANNED_ROOTS)._import_time_usesonly examines names listed inCONVERTED_SITES, so a future module-level read of any of these could reintroduce an import-time consumer reach without this test detecting it.
src/opendox/consumer_reach.py:237
- None of the added tests exercises
_LateConsumerValue: the currentSCANNED_ROOTScoverage only checks import isolation, so the tuple-like forwarding and lazy resolution are unverified. A missing sequence operation or an eager resolve would pass the suite while breakingcli._warn_on_empty_projection; add a fake consumer-module test for the intended iteration/operation behavior.
def __iter__(self):
return iter(self.resolve())
def __len__(self) -> int:
return len(self.resolve())
tests/test_consumer_reach.py:94
- This rationale says slice 2b has seven default-argument reads, but
branch_session.pynow changes ninerecords_dirdefaults (the nine replacement sites are listed in that file's comments). Leaving the count at seven makes the census explanation inaccurate; update it to nine.
"opendox.workbench",
"opendox.serve_workbench",
"opendox.consumer_reach",
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Lite
…tion A review pass on this pull request made the right objection: the import-isolation tests prove the generated bases can be BUILT, and nothing called through one. The forwarders are `getattr(<consumer class>, name)(self, *args, **kwargs)`, so a wrong method list or a forwarding signature that dropped an argument would leave every import green and break requests — and `route_extension` resolves a contributed handler BY NAME against the bound class, which is the check that refuses an unservable route before a socket is opened. Six tests, one per claim: CONSTRUCTION RESOLVES NOTHING. The class statement runs at import time, which is the entire reason this member of the family exists; a base that resolved while being built would defer nothing. The `LATE_COLUMN` triple is asserted here too, because that is the surface openXdox-code's drift guard reads to hold the two sides together, and the forwarder is asserted to keep the method's `__name__` — a contributed binding is resolved by name. THE FORWARDING CONTRACT, against a fake column whose methods read state off `self`. That is the assertion that matters: `self` must be the live request HANDLER and not the column, so the fake's methods return `self.marker`, which only the handler carries. Positional and keyword arguments, the return value, and the fact that the bound method is the forwarder rather than the column's own function. ONLY THE NAMES IT WAS GIVEN. `__getattr__` is deliberately absent, and the absence is now asserted: a probe for `do_PUT` raises `AttributeError`, and so does a method the consumer's column really defines but the NAMED list leaves out. A base that answered those by importing openXdox would fire the reach at a moment no verb chose, and would raise `ConsumerReachUnavailable` where the caller was testing for `AttributeError`. THE UNAVAILABLE-CONSUMER PATH fires at the CALL, names `openxdox.<module>`, cites RULED OQ-2 and chains the original `ModuleNotFoundError`. An empty method list is refused, because a column standing in for nothing would inherit nothing and hide it. THE TWO LIVE COLUMNS are held against the names `serve.py` and the § 2.4 bindings actually dispatch. `_serve_snapshot` is the one to watch: `/snapshot.json`'s HANDLER travelled to the projection column while its dispatch ARM stayed core, so `serve.py` itself calls `self._serve_snapshot` and dropping it from the list would leave every import green and that route broken. Refs opensoft/openXfactory#656 Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
There was a problem hiding this comment.
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 4 days and 17 hours by commenting @sourcery-ai review. Upgrade to get a review now.
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved CLI and route-profile issues remain, and route-column forwarding lacks coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (3)
src/opendox/consumer_reach.py:324
- The new
route_columnforwarding mechanism is not covered by the added tests: they exercise_LateConsumerValue, but never constructLateGateRoutes/LateProjectionRoutesor call their generated methods with an available and unavailable consumer. A typo in one of the manually restated method names or in theselfforwarding would therefore only surface on a live route; add tests for lazy construction, successful forwarding, and the unavailable-consumer error.
def forward(self, *args: Any, **kwargs: Any) -> Any:
column = getattr(holder.resolve(), class_name)
return getattr(column, attr)(self, *args, **kwargs)
src/opendox/serve.py:1426
- This drops the in-tree route profile, but every current
build_servercaller (cli.py:403andserve.py:1631) still relies on the defaultroute_extensions=(). Since_route/do_POSTconsult onlyroute_bindingsafter the core arms, the server now starts without/snapshot-index.json,/source/, gate, or lane bindings, so those routes 404 or fall through to the unknown-action response. Keep the profile bindings supplied by the entrypoint/consumer (or otherwise include them) before removing this merge.
route_bindings = route_extension.collect_bindings(route_extensions)
src/opendox/serve.py:207
- This removal leaves the module-level re-export contract immediately above it stale:
serve.pystill says every moved name is imported back and thatserve.hosted_indexresolves, but this block no longer binds that name (nor the other four removed names). Update the contract documentation and the corresponding cross-module statement, or preserve compatibility aliases, so the documented API does not contradict the new namespace.
# `serve_projection`'s six re-exported names are no longer bound by an import
# statement here (BUILD slice 2b): the statement named openXdox at import time.
# FOUR of the six had no reader anywhere in this repository — `BARE_SOURCE_ROUTE`,
# `SNAPSHOT_INDEX_ROUTE` and `SOURCE_PREFIX` are the patterns
# `ProjectionRoutesExtension.routes()` declares and travel with it, and
# `hosted_index` is the column's own verb. All four stay reachable at
# `openxdox.serve_projection`, which is where they live.
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
Unresolved moderate issues remain in CLI wiring, route validation, defaults consistency, serving compatibility, and test coverage.
Review details
Suppressed comments (6)
Previously missed (1) — in code that hasn't changed since the last review.
tests/test_consumer_reach.py:607
- The new CLI aliases are not included in
CONVERTED_SITES: itscli.pyentry still checks onlygate_modandsnapshot_mod. Consequently_import_time_useswill not catch a later module-level read ofcorpus_root_refusal,generate_snapshot,is_rfc3339_datetime, orSCANNED_ROOTS, so these new late-bound names can regress without the guard failing. Add all four names to that entry.
src/opendox/cli.py:993
- Removing the direct
cli_gatere-exports does not leave this parser usable:build_parser()still executesprofile_openxfactory.SUBCOMMAND_EXTENSIONSat line 927, butprofile_openxfactoryis not imported or assigned anywhere in this file. Anybuild_parser()/CLI entrypoint therefore raisesNameErrorbefore registering the contributed commands. Please wire the profile seam here or remove/replace this registration consistently; otherwise this slice leaves the CLI broken.
# THE NINETEEN GATE VERBS ARE NO LONGER RE-EXPORTED HERE (BUILD slice 2b). The
# block was `from openxdox.cli_gate import (...)` — nineteen names bound back
# onto this module at import time, which is the single largest reason
# `import opendox.cli` required the layer that PINS openDox.
src/opendox/consumer_reach.py:324
route_columncreates a callable forwarder for every listed name, soroute_extension.resolve_handlerswill approve the generatedDashboardHandlerattribute even when the installed consumer class is missing that method (or the consumer is absent). The realgetattr(column, attr)only runs on the first request, violating the build-time refusal contract and turning a method-list/version mismatch into a live request failure. Validate the late column's underlying class/methods during wiring, or add a validation hook thatresolve_handlersinvokes without resolving during module import.
def forward(self, *args: Any, **kwargs: Any) -> Any:
column = getattr(holder.resolve(), class_name)
return getattr(column, attr)(self, *args, **kwargs)
src/opendox/defaults.py:70
DEFAULT_RECORDS_DIRduplicatessession_git.GATE_RECORDS_PREFIX, even though that module declares it as the one canonical gate-records prefix andSessionGituses it as its default (src/opendox/session_git.py:79-83,475-485). Keeping a second literal lets future path changes make branch-session defaults disagree with session-git record handling; derive this value from the existing openDox constant instead of mirroring it.
DEFAULT_RECORDS_DIR = "ideation/dashboard/gate-records/"
src/opendox/serve.py:207
- This removal contradicts the module-level namespace contract above: lines 174-178 say every moved name is imported back and explicitly promise
serve.hosted_index(and “the rest”) still resolve, but this block removeshosted_indexalong with the other projection constants. Callers following that documentedserve.*surface now getAttributeError; either preserve compatibility bindings or update the namespace contract and its dependent tests/documentation in the same slice.
# `serve_projection`'s six re-exported names are no longer bound by an import
# statement here (BUILD slice 2b): the statement named openXdox at import time.
# FOUR of the six had no reader anywhere in this repository — `BARE_SOURCE_ROUTE`,
# `SNAPSHOT_INDEX_ROUTE` and `SOURCE_PREFIX` are the patterns
# `ProjectionRoutesExtension.routes()` declares and travel with it, and
# `hosted_index` is the column's own verb. All four stay reachable at
# `openxdox.serve_projection`, which is where they live.
tests/test_consumer_reach.py:197
- This checks only the final traceback line, so it cannot detect a consumer import reintroduced after the expected
ideation_dashboardimport: execution stops at the earlier blocker andlaststill contains noopenxdox, letting the test pass. Check the complete stderr (or scan the module's import-time imports) forCONSUMER_PACKAGEinstead.
assert CONSUMER_PACKAGE not in last, (
f"`import {module}` is recorded as blocked by {blocker!r} with its "
f"consumer reach removed, but the failure names "
f"{CONSUMER_PACKAGE!r}:\n{done.stderr}")
- Files reviewed: 6/6 changed files
- Comments generated: 0 new
- Review effort level: Lite
…f1f2e5 This PR was STACKED on `build/remove-back-imports-2b`; that branch landed as openDox-code #10, squashed onto `main` as `0f1f2e59`. The stack therefore had to be brought onto `main` before the ruled serve.py half (ASK-6 -> 1) could be authored against the file main actually carries. A REBASE was the intended act and IS what fixes this tree: `git rebase --onto origin/main cc1d806 build/section-4-3-profile-lazy-proxy` replayed all seven § 4.3 commits with ZERO conflicts and produced a diff against `main` that is BYTE-IDENTICAL to the pre-rebase diff against `cc1d806b` — proof that main's squash of 2b and this branch's 2b ancestry are the same content, and that § 4.3 touches nothing 2b left unsettled. It could not be PUSHED as a rebase. The `opensoft` org-level ruleset 8981805 applies `non_fast_forward` to EVERY branch of this repository, not just `main`, so history replacement is refused for this branch by policy (`GH013 ... Cannot force-push to this branch`). The lane's permitted single force is unavailable, and bypassing an org ruleset is not this author's act. So the same result arrives append-only: this is `main` merged INTO the branch, with the merge resolved to EXACTLY the verified rebase's tree (`16cf0c43` = `ef67c83`^{tree}, the rebase head's tree). The two conflicted files — `src/opendox/cli.py` and `tests/test_consumer_reach.py`, the two the § 4.3 commits edit on top of 2b — take the rebase's resolution, which is main's 2b shape with the § 4.3 intent re-applied on top, because that is what the conflict-free rebase computed. `git diff origin/main...HEAD` is unchanged by this commit. Landing is unaffected: #9 and #10 both landed as SQUASHES (`da8aae96`, `0f1f2e59`), so the merge commit and the duplicated 2b ancestry do not reach `main` — the squash carries this tree and nothing else. Lane: openxfactory-4-opendox-extraction Refs opensoft/openXfactory#656 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…st at process start, read by BOTH composition points (RULED ASK-2; routes half RULED ASK-6 → 1) (#11) Lane: openxfactory-4-opendox-extraction Refs opensoft/openXfactory#656 § 4.3 of split-opendox-two-layer-product at the openDox-code leg, on RULED ASK-2 (5628886636: the lazy proxy is this slice; refusal, not a default) and ASK-6 → 1 (5635150678: the same author adds the serve.py binding after the rebase). profile_openxfactory becomes a lazy proxy that the host registers once at process start; cli.py's build_parser() and now serve.py's build_server() resolve the profile through it and REFUSE without a host, with the proxy's facet→reader map keeping the refusal precise under two readers. The census is unmoved: import-time 0, deferred 19 over five modules; the only added import is openDox's own opendox.profile_proxy. Every edited arrived line is declared in openxFactory's carve manifest (cli.py and serve.py rows, moved_with_declared_edit; checked with the arrival verifier's own _check_declared_lines against the b075fd91 blobs — undeclared: none); the four new files are created, not arrived. Seven review threads taken: a fixture teardown that stripped the process-start registration (collection order decided the suite), both composition points now lifted by AST and executed against seam stand-ins, and conftest's broad except narrowed to ModuleNotFoundError. Rebased onto main after #10 (0f1f2e5) as a merge resolved to the verified rebase's tree, because the org ruleset forbids force-push on every branch; landed as a squash so the duplicated 2b ancestry never reaches main. validate 71 passed at 585f907. Owed: the openxFactory half — the real engineering profile and ONE process-start opendox.domain_profile.register() for every process that builds a parser OR a server; ASK-7's four stale docstring lines at the next declared-edit window. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>



Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox)
BUILD slice 2b of
split-opendox-two-layer-product: the NINE remainingimport-time
openxdoxreaches at this leg, on Brett Heap's rulings of2026-09-11 — "BUILD arc: start now, land each slice when green"
(
5626260214)and "rule the two Q-L1 annotations, fold into PR-2"
(
5628560136),which declares the carve-manifest lines these nine need.
Refs opensoft/openXfactory#656
The census, which is the claim
openxdoxis no longer named at import time anywhere undersrc/. The 19deferred reaches are not this slice's business and are not a lesser version of
the same problem: they resolve inside verbs, which is the direction working
rather than the direction surviving — "What must not survive is the direction,
not the calls" (
design.md:243).The five steps
21f98f6e).consumer_reach.pygains the two members of the seam the remaining reachesrequire —
constant/_LateConsumerValue, for a re-exported sequenceconstant whose read site cannot be respelled, and the bindings the later
steps consume — and
defaults.pyarrives carrying openDox's own spelling ofthe three values that are read as DEFAULT ARGUMENTS. Those could not be
deferred by any stand-in: a default is evaluated where the
defsits, sothe reach has to be removed at the site, and removing it at the site means
openDox must own the value. openXdox-code's drift guard holds the two
spellings together.
branch_session.pystops naming the gate console at import time(
3138a8e4).from openxdox import gate_consolebecomes the same NAMEbound to the late stand-in, so all thirty-odd call sites are unchanged, and
the NINE
records_dir: str = gate_console.DEFAULT_RECORDS_DIRdefaultsread
defaults. (Nine, not the seven slice 2 recorded — the count wascorrected in
e07e3de8after a review pass caught it, along with aDEFAULT_BRANCH_PREFIXthat does not exist: it is one constant at ninesites.)
cli.pystops naming its consumer at import time (d1d070b8). The twomulti-line
from openxdox.…statements become bindings to the stand-ins, inthe idiom the two lines above them already used.
6fa9364a).opendox.branch_sessionmoves from
STILL_REACHINGintoNEUTRAL_MODULES— which is what thesuite's own failure message asks for, and what
validatewas red on atd1d070b8.serve.pystops naming its consumer at import time (0f683252) — thelast of the nine, and the one that needed new machinery. See below.
Plus
3d62025d, which covers theconstantmember of the seam: it was addedin step 1 with only its construction exercised, and a review pass on this pull
request named the gap.
Step 5, which is the interesting one
Four reaches, four different shapes:
registry_mod.Xread below is unchanged and only the moment of the reach moves.
build_server's two default arguments readdefaults.DEFAULT_INDEX_NAMEand
defaults.PEEK_TTL_SECONDS. Same argument asbranch_session.py'snine — eleven default-argument sites across the two modules, reading the
three values
defaults.pycarries.serve_gate.GateRoutes,serve_projection.ProjectionRoutesonDashboardHandler) are the hard case.A base expression is evaluated when the class statement runs, and a class
needs its bases before its first instance exists, so a base cannot be
deferred by any stand-in in the family.
consumer_reach.route_columnbuildsa stand-in BASE instead: one forwarding method per name the consumer's column
defines, each calling
getattr(<consumer class>, name)(self, …)— the samefunction object with the same
self, which is the live request handler. So/snapshot.json's core arm still findsself._serve_snapshot, and acontributed binding naming
_handle_gate_actionor_serve_indexstillresolves against the bound class at wiring time, which is the check that
refuses an unservable route BEFORE a socket. There is deliberately no
__getattr__: a handler is probed for absent attributes constantly, and abase that answered those by importing openXdox would fire the reach at a
moment no verb chose.
Five of the seven re-exported names have no reader in this repository and
stay reachable at
openxdox.serve_gate/openxdox.serve_projection. Two dohave readers and KEEP their names here, bound to late stand-ins:
hosted_ref_refused, which decides that a hosted response must never name asession ref (FR-048), and
resolve_source_path, whichnotebook_action.pyimports
from .serveand re-checks every resolved document through before anotebook action may name a path. Dropping that one would have turned a
path-containment check into an
ImportError.build_serveralso stops reachingprofile_openxfactory.ROUTE_EXTENSIONS,which is a repair rather than a removal: openxFactory's carve manifest files
profile_openxfactory.pyasdeleted_at_carve, the deferred import that fedthis reach went with it, and the reach itself was left behind — so
build_server()raisedNameError: profile_openxfactoryfor every caller. Aserver is now assembled from exactly what its caller hands it, which is what
the § 2.4 seam is for.
What this does NOT claim
opendox.serveandopendox.clido not move intoNEUTRAL_MODULES, andthe suite now records WHY in a field this slice adds. Both are blocked by
ideation_dashboard— openxFactory's pre-carve package name, astays_openxfactory_adapterrow (RULING DQ-1) present at neither carvedestination, already censused in
tests/test_consumer_reach.pyat 2 sites andowed to a later act.
STILL_REACHINGtherefore records the BLOCKING PACKAGEper module, and the test asserts it by name plus — for a row whose blocker is
not the consumer — that
openxdoxis NOT what the failure names. Without thatthe substitution would have passed unread: the test would have stayed green on
a nonzero exit while the thing it was written to measure had been fixed.
The § 4.3 lazy proxy for
profile_openxfactoryis a LATER slice and is notbuilt here (ASK-2,
5628886636).And
cli.pycarries the same defectserve.py's profile reach was, stillunrepaired.
build_parser()evaluatesprofile_openxfactory.SUBCOMMAND_EXTENSIONSat :926-927 with no binding, so itraises
NameErrorfor every caller — found by a review pass on this pullrequest. It is NOT fixed here because that line is not one the carve manifest
declares for
cli.py's row (serve.py's profile reach IS declared, at referent1380-1381, which is why this slice could repair that one), and an edit outside
the declared lines is an undeclared movement the arrival verifier refuses
(RULED OQ-1). The finding is carried to openxFactory#656
(
5633826227)for a declared-edit ruling, which is the route BUILD slice 2's nine took. It
predates this pull request and is unchanged by it.
The openXdox half
openXdox-code's
OPENDOX_BACK_IMPORTSratchet refuses an unrecorded FALLexactly as it refuses a rise, so its half must land in the same window. It
lowers the table to 0 / 19 over five modules and re-pins
opendoxto thispull request's MERGE sha.
🤖 Generated with Claude Code