Repository navigation
Move the openDox column out of serve.py (split § 2.4, PR 2 of 4) - #748
Conversation
`serve.py` (6,914 lines) carried the doxBench workbench surface, the
project/notebook/edit routes and the shared wire vocabulary in one file.
This is the pure move that separates them, ahead of the openDox carve:
* `serve_workbench.py` — the seven workbench route handlers and their
private helpers, composed back as the `WorkbenchRoutes` mixin.
* `serve_project.py` — `_serve_project_register`, `_handle_notebook_action`
and `_handle_edit_action`, composed back as `ProjectRoutes`.
* `serve_wire.py` — the wire vocabulary and body bounds the core AND both
columns read, so the import graph is a DAG rather than a cycle.
Every moved symbol is byte-identical to its previous text (142 of them,
verified by an AST comparison against the parent commit); the only edits are
the mechanical import and binding lines the shape requires. Mixins precede
`SimpleHTTPRequestHandler`, so `_route` and `do_POST` stay literally inside
`class DashboardHandler` in `serve.py`, the CAPABILITIES arm stays inline, and
`build_server` and its `BoundDashboardHandler` construction are untouched.
Every moved module-level name is imported back by name, so `serve.X` resolves
for every reader that already had it.
Ten source-level tests are repointed from `serve.py` to the whole serve
surface — same assertion, strictly more code scanned — and one monkeypatch
follows its name to the module that now resolves it. Each is disclosed in the
PR body with the mutation that proves it still bites.
Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_019sa33gYhfLF1F1MkS7Xrd6
Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_019sa33gYhfLF1F1MkS7Xrd6
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
🟡 Changes recommended
The new serve-surface test helper’s boundary claim is incorrect (risking false-positive source matches) and the relative-import guard regex misses from ..-style imports, weakening the intended protection.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR continues the §2.4 “split serve.py by column” work by extracting the openDox-facing route handlers and shared wire vocabulary out of scripts/ideation_dashboard/serve.py into three new modules, and then widening source-level test assertions to scan the full “serve surface” (now four files) instead of just serve.py.
Changes:
- Split the dashboard server implementation into
serve_wire.py(shared wire vocabulary/bounds),serve_workbench.py(doxBench workbench routes), andserve_project.py(project/notebook/edit routes), while composing them back via mixins inDashboardHandler. - Add “serve surface” helpers in
tests/ideation-dashboard/conftest.pyso tests can scan all serve modules consistently. - Repoint multiple tests that previously read only
serve.pysource to instead read/scan the full serve surface.
File summaries
| File | Description |
|---|---|
| scripts/ideation_dashboard/serve.py | Composes DashboardHandler from the new route mixins while retaining the core routing spine. |
| scripts/ideation_dashboard/serve_workbench.py | Hosts the extracted doxBench workbench route handlers as a mixin. |
| scripts/ideation_dashboard/serve_project.py | Hosts the extracted project/notebook/edit route handlers and helpers. |
| scripts/ideation_dashboard/serve_wire.py | Hosts shared wire vocabulary/constants and shared request/response helpers to avoid import cycles. |
| tests/ideation-dashboard/conftest.py | Adds serve_surface_paths() / serve_surface_source() and widens NO_IMPLICIT_PUSH_MODULES. |
| tests/ideation-dashboard/test_repo_selector.py | Widens the “no relative imports” check to scan all serve-surface modules. |
| tests/ideation-dashboard/test_doxbench_* / test_doxchat_model_intake.py | Update source-scanning assertions to use serve_surface_source() / serve_surface_paths(). |
Review details
- Files reviewed: 11/13 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
#748) Fixes verified findings from independent review of § 2.4 PR-2 (serve.py openDox-column extraction): - F1: decision 1's "mixins precede SimpleHTTPRequestHandler" ordering claim was never checked. Added test_extension_point_parity.py tests pinning DashboardHandler.__mro__ and asserting WorkbenchRoutes/ ProjectRoutes share no member name with the http.server chain, plus a negative control; both mutation-verified. - F2/Copilot: serve_surface_source()'s docstring overstated its boundary guarantee (a "\n\n" join defeats a blank-line pattern, not just a single-newline one). Corrected the docstring. - F3: test_session_snapshot.py's apply_lane absence was still narrowed to serve.py alone after this PR made the serve four files; repointed that negative clause to serve_surface_source() (positives stay pinned to serve.py, forward-flagged for PR-3). Mutation-verified. - Scope-lens (wf24b r12.json): corrected row 2's bound-buffer counts (40 total: 0/36/4/0 across the surface, not "26 in serve_workbench.py"); disclosed row 11's second, undisclosed widening of three positive import anchors; removed the now-dead SERVE_PY constant in test_doxbench_bound_buffer.py. - Copilot: widened the relative-import guard regex (test_repo_selector.py) from `\.\w*` to `\.+\w*` so it also catches parent-relative imports (`from .. import x`); added a parametrized test over dot depths 1-3. Nothing weakened, deleted, skipped or made vacuous; all repoints disclosed. Full suite + validators re-run green (one pre-existing environmental failure plus one confirmed unrelated flake, both disclosed in the PR body). Refs #656 Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_019sa33gYhfLF1F1MkS7Xrd6
There was a problem hiding this comment.
🟡 Changes recommended
The updated relative-import guard regex still misses valid multi-segment relative imports (e.g. from .pkg.sub import x), weakening the safety net intended to prevent script-mode 500s.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
tests/ideation-dashboard/test_repo_selector.py:673
test_the_relative_import_guard_catches_every_dot_depthcurrently only exercises 0 or 1 module segment after the leading dots, so the same regex bug (missing.pkg.substyle imports) could regress without a failing test. Add nested-module cases and update the regex to match them.
@pytest.mark.parametrize("line", [
"from . import x",
"from .pkg import x",
"from .. import x",
"from ..pkg import x",
" from ... import x",
])
def test_the_relative_import_guard_catches_every_dot_depth(line):
"""A prior version of this guard's regex (`\\.\\w*`, one dot only) matched
`from . import x` and `from .pkg import x` but silently missed a
PARENT-relative import (`from .. import x`, `from ..pkg import x`) —
which fails identically once serve.py runs as a plain script. Pinned here
so a future narrowing of the regex is caught by a red test, not by a
production 500."""
assert re.match(r"\s*from\s+\.+\w*\s+import\b", line), (
f"the relative-import guard does not match {line!r}")
- Files reviewed: 13/15 changed files
- Comments generated: 2
- Review effort level: Lite
…mport guard (PR #748) Two open Copilot review threads: - conftest.py:178 — SERVE_SURFACE_MODULES claimed "import-graph order" but started with serve.py (the module that imports the other three). Reordered to serve_wire.py -> serve_workbench.py -> serve_project.py -> serve.py, matching the actual import DAG, and documented in the docstring why no reader depends on the order. - test_repo_selector.py:642 — the relative-import guard regex (\.+\w*) matched a single module segment only, so `from .pkg.sub import x` and `from ..pkg.sub import x` slipped through. Widened to \.+[\w.]*. r9 LOW: test_the_relative_import_guard_catches_every_dot_depth restated the guard's pattern as an independent literal copy rather than exercising the production regex, so narrowing the production pattern would have left the test green. Hoisted a shared RELATIVE_IMPORT_RE module-level constant used by both the production scan and the (renamed, now segment-depth-covering) parametrized test; mutation-verified that narrowing the shared constant now turns both red. Both threads replied to and resolved separately after push. Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_017guxvApq5jqB1QXukJUsTQ
…-columns One real conflict, in tests/ideation-dashboard/conftest.py's NO_IMPLICIT_PUSH_MODULES tuple: this branch widens it by serve_workbench.py/serve_project.py/serve_wire.py (§ 2.4 PR 2), main's #741 widens it by doxbench_status_exemption.py (§ 2.4 OQ-1). Resolved by keeping both sides' additions and both comment blocks. Nothing else conflicted. Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_017guxvApq5jqB1QXukJUsTQ
There was a problem hiding this comment.
🟢 Approval recommended
The changes are a structural refactor with supporting test widenings to prevent vacuous source-level assertions, and the only noted adjustment is a small robustness tweak to the new collision test.
Review details
- Files reviewed: 13/15 changed files
- Comments generated: 1
- Review effort level: Lite
The mixin-vs-SimpleHTTPRequestHandler collision check subtracted a fixed
list of five dunder names from the intersection. WorkbenchRoutes already
carries __annotations__ (from INTAKE_QUERY_FIELDS's class annotation),
and a future stdlib release could add a dunder to the http.server chain
that the hand-listed set doesn't name -- making the test fail for a
reason unrelated to what it guards.
Both the real check and its negative control now filter dunders by the
general name.startswith("__") and name.endswith("__") rule via a shared
_non_dunder() helper, applied to both the mixin side and the chain side
before intersecting, so the assertion's strength (no shared non-dunder
member between the mixins and the whole http.server MRO chain) is
unchanged. Added a non-vacuity floor asserting the mixin member set is
non-empty, so a reader bug that resolves to the wrong classes can't pass
by producing an empty set on both sides.
Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_017guxvApq5jqB1QXukJUsTQ
There was a problem hiding this comment.
🔵 Needs a closer look
The updated relative-import guard can still miss a valid backslash-continued from .pkg \\\n import x form, leaving a loophole in the intended “no relative imports” safety net.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
tests/ideation-dashboard/test_repo_selector.py:652
test_serve_module_uses_no_relative_importsscans each file line-by-line, so it can miss a valid relative import split with a backslash continuation (e.g.from .pkg \\n import x). That would still break whenserve.pyruns as a plain script, but it would not be reported as an offender here.
Consider expanding the offenders scan to also check backslash-continued from ... lines (or switch to an AST-based check) so the guard can’t be bypassed by formatting.
- Files reviewed: 13/15 changed files
- Comments generated: 0 new
- Review effort level: Lite
…3-extension-columns Six conflicts, all from the squash-merge identity problem (#748/#742 landed as squash commits, so git treats PR-3's pre-existing work against them as a fresh collision rather than a fast-forward): - scripts/ideation_dashboard/profile_openxfactory.py (add/add): the only real splice. Kept the shared module docstring (#742's landed header, which already anticipated PR 3 adding ROUTE_EXTENSIONS), rewrote the "Relative, like the core's own imports..." comment to speak for both verbs and routes, and kept BOTH extension tuples: SUBCOMMAND_EXTENSIONS (#742/main) alongside ROUTE_EXTENSIONS + `from . import serve_gate, serve_openxfactory_lanes, serve_projection` (this branch). DISCOVERED WHILE RUNNING THE FULL SUITE, not part of either side's original text: a plain top-level `from . import cli_gate` (#742's own spelling) turned into a regression the moment ROUTE_EXTENSIONS joined it in the same module. `serve.py`'s `build_server` imports `profile_openxfactory` on every startup, hosted included, to reach ROUTE_EXTENSIONS; `cli_gate` pulls in `authoring` -> `workbench` -> PyYAML, which the hosted image deliberately does not carry (`test_repo_selector.py::test_hosted_posts_do_not_load_notebook_only_dependencies`, green on `main` and on this branch's pre-merge tip, red after a naive splice). Fixed by resolving `SUBCOMMAND_EXTENSIONS` and the `cli_gate` submodule attribute lazily, via a module-level `__getattr__` (PEP 562) — the same pattern `authoring.py` already uses for `REQUIRED_HEADER_FIELDS` and for the same reason (a shared module should not carry a dependency only one caller needs). `cli.py`'s read of `SUBCOMMAND_EXTENSIONS`, the `len(...)==1`/`isinstance(...)` pins in `test_cli_column_split.py`, and the `profile.cli_gate is gate` identity check in `test_a_library_caller_gets_the_columns_of_its_own_core` (module `__getattr__` still answers through `sys.modules`, so identity holds) all still pass — verified by re-running the full targeted suite. - scripts/ideation_dashboard/serve.py (7 hunks): resolved by keeping our side throughout, verified hunk by hunk rather than assumed: * `import traceback` (main) dropped — the only caller of the module (`_log_gate_failure`, T092 defect-3 logging) already lives in `serve_gate.py` on this branch, which imports `traceback` itself; the name would be dead/unused in `serve.py` after the extraction. * the split docstring + import block, the `serve_projection` import + widened `serve_wire` import list, the `fresh_ledger_events`/ `hosted_index`/`hosted_ref_refused` import line, and the `DashboardHandler` mixin base list: our side is a strict superset of main's (main's text is a subset written before PR 3 added its three columns). * the `_handle_dtn_seed`/`_handle_staging_seed`/`_handle_apply_register_edits`/ `_handle_refresh_action`/`_run_refresh` block and the `_read_snapshot`/`_serve_snapshot`/`_hosted_entry_refused`/`_serve_index`/ `_serve_committed_intents`/`_keyed_source`/`_serve_source` block: main still carries these as fixed core methods; this branch already moved them (byte-diffed to confirm) into `serve_openxfactory_lanes.py` and `serve_projection.py` respectively, so keeping our side (empty) is the correct resolution, not a loss. - scripts/ideation_dashboard/serve_wire.py (add/add, 3 hunks): our side only — the hosted-plane confinement paragraph, the `HOSTED_SESSION_REFUSAL`/ `hosted_ref_refused`/`hosted_index` additions and the `snapshot_registry` import are PR-3-only content; main's side of every hunk was empty. - tests/ideation-dashboard/conftest.py (3 hunks), test_extension_point_parity.py (3 hunks), test_session_snapshot.py (1 hunk): our side throughout — each is the "seven files"/five-mixin widened version of an assertion main still states at PR 2's "four files"/two-mixin count; no assertion was dropped, every one got strictly broader (NO_IMPLICIT_PUSH_MODULES and SERVE_SURFACE_MODULES tuples are the union, in dependency-first order). Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01UyynFBwGMQNeNU8D8qhQBW
…idence; record the § 2 carried items (#769) split-opendox-two-layer-product group-2 bookkeeping: tick § 2.1 (#724 e2b8f62), § 2.2/2.2a (#725 ea4e6ff), § 2.3 (#728 1a2ea82), § 2.4 (#736 a83eb93, #741 75467fe, #748 7f7ce75, #742 421b52d, #761 7992b87), § 2.6 (gate re-run on the branch: 6681 passed, the environmental snapshot test and the tolerated disposition artifact identical on main); § 2.5 stays open (Path A D-2). Records the twelve § 2 carried items for the § 3.1 carve manifest; repoints two doc_health sweep-record strings to doxbench_status_exemption. Landed under a Rule 6 window on Brett Heap's word "merge 769 when green" (2026-09-07). Refs #656. Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q8CkMMAdcUZCqAUTgNjsPy
Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox)
This realizes
split-opendox-two-layer-product§ 2.4 PR 2 of 4: the openDox column moves out ofserve.pyintoserve_workbench.pyandserve_project.py, with the wire vocabulary both columns and the core share landing in a third module,serve_wire.py. It is a pure move — every one of the 142 moved symbols is byte-identical to its previous text, the routes stay fixed core arms of_route/do_POSTrather than becoming contributed ones, and no behaviour changes. Refs #656.Stack note: this PR targets
maindirectly and does not stack on anything. PR-1 (#736,a83eb93a) is already onmain;origin/mainmoved to04a6e107mid-run and is merged in.What moved
serve.py6,914 → 2,473 lines. The three new modules total 4,776._handle_workbench_threadserve.pyDashboardHandlerserve_workbench.pyWorkbenchRoutes_handle_workbench_model_catalog_handle_workbench_model_intake_surface_handle_workbench_model_intake_handle_workbench_model_approval_handle_workbench_chat_turn_handle_workbench_document_abstract_workbench_model_port,_indexed_sources,_knowledge_service_and_coverage,_thread_plane,_thread_capability_absence,_session_worktree_for,_is_live_session_ref,_read_thread,_document_threads,_thread_gate,_mirror_turn_into_sidecar,_write_thread_after_mirror_failure, the four_doxbench_*static/classmethods,_workbench_declaration_store,_intake_console_refusal,_intake_refusal,_intake_query_facts,_send_error_or_intake,_approval_binding,_wire_valid_turn_id,_refuse_turn, the three parse helpers,_refuse_abstract,_deadline_bound_dispatch, and theMAX_INDEXED_SOURCES/MAX_CREDENTIAL_BYTES/INTAKE_QUERY_FIELDSclass attributes_serve_project_registerserve.pyDashboardHandlerserve_project.pyProjectRoutes_handle_notebook_action,_run_notebook_action,_log_action_failure_handle_edit_action_launch_editor,_listed_source_paths,_edit_request_fields,_resolved_listed_edit_entryserve.pymodule levelserve_project.pymodule levelJSON_CTYPE,JSON_OBJECT_BODY_REQUIRED,AGENT_INVOCATION_REFUSAL,_MAX_BODY_BYTES,_MAX_REFUSED_DRAIN_BYTES,_drain_refused_body,_CredentialStream, the wholeDOXBENCH_*catalog and_DOXBENCH_MSG_*prose, the_ABSTRACT_REASON_*set, and thedoxbench_*_body/doxbench_*_statusbuilders incl.doxbench_context_packet— 93 module-level namesserve.pymodule levelserve_wire.pymodule levelComposed back as
class DashboardHandler(serve_workbench.WorkbenchRoutes, serve_project.ProjectRoutes, http.server.SimpleHTTPRequestHandler). All 108DashboardHandlermembers still resolve, withstaticmethod/classmethoddescriptors intact, and every moved module-level name is imported back intoserve.pyby name soserve.Xresolves for every reader that already had it.Design decisions taken
@staticmethod/@classmethodsurvive a mixin untouched (test_doxbench_routes.pycallsDashboardHandler._doxbench_invalid_turn_messageas a classmethod), the unbound-call idiomhandler._workbench_model_port(handler)used at 18 test sites keeps working through the MRO, and per-test attribute overrides still take. The mixins precedeSimpleHTTPRequestHandlersodo_GETresolution is unchanged.serve_wire.py, rather than a bottom-import or a late-bound_serve.Xrewrite. The columns need ~60 module-level names that lived inserve.py, andserve.pyneeds the columns — a cycle. Hoisting the shared vocabulary makes the graph a DAG (serve_wire ← serve_workbench/serve_project ← serve). It is genuinely shared, not openDox-only:_handle_gate_action(openXdox, PR-3) already readsdoxbench_error_body/_statusandDOXBENCH_MAX_REQUEST_BYTES, so parking it inserve_workbench.pywould have made the core depend on the openDox column — backwards for the carve.CAPABILITIES_ROUTEhandling stays inline in_route, against the memo's § 2, which assigns it toserve_project.py. Two green tests forbid the move:test_extension_point_parity.py'sROUTE_ARMSpins that arm's reached names exactly, andtest_bullseye_widget.py:1674asserts the block's contents between two literal route comparisons inserve.py. PR-2 registers no capabilities change._session_repositorystays inserve.pycore, also against the memo's § 2. The memo's own § 1 lists it among the central gating primitives; it is called by the pinned CAPABILITIES arm and by_handle_gate_action, which is PR-3's column. § 1 wins._make_adapterstays inserve.pyeven though_handle_notebook_actionmoved:_session_notebook(openXdox/gate) also calls it, andtest_session_notebook.pycallshandler._make_adapter(handler)directly._routeanddo_POSTare byte-identical and stay literally insideclass DashboardHandlerinserve.py, astest_extension_point_parity._method()requires — it looks for them asFunctionDefs inside that class node.build_server's signature, itstype("BoundDashboardHandler", …)construction and theresolve_handlerscall are untouched.serve.pyruns as a plain script, so afrom . import …anywhere it reaches would 500 a route in production while module-invoked tests stayed green.NO_IMPLICIT_PUSH_MODULESwidened by all three filenames.serve_workbench.pyis required — it carries the TURN, which is exactly that rule's scope, and a list left at"serve.py"would have let a file move evade the absence silently.serve_project.pyandserve_wire.pycarry no turn, save, compaction or scheduled task and are added anyway, recorded in the conftest comment: a sweep over three of four files is a sweep with a seam in it.Test repoints
Under the standing ruling for this slice: a test that pins WHERE code lives may be repointed to the module that now holds it — same assertion, same strength, wider file set. Nothing is weakened, deleted, skipped or made vacuous; behavioural tests (those driving routes and asserting responses) are untouched. The new
conftest.serve_surface_source()/serve_surface_paths()readers spanserve.py + serve_wire.py + serve_workbench.py + serve_project.py, so every scan below sees strictly more code than before, never less.test_doxbench_bound_buffer.py::test_the_route_reads_the_declared_binding_rather_than_an_adjacent_fieldserve.pysourcebound_buffer_key=bound_buffer_keyliteral is inside_handle_workbench_chat_turn=active_document_pathinserve_workbench.py→ FAILEDtest_doxbench_bound_buffer.py::test_no_runtime_module_stores_a_bound_buffer_on_the_envelopeserve.py+doxbench_turns.pydoxbench_turns.pyserve.pynow contains zero occurrences ofbound_buffer; all 40 are now on the surface (36 inserve_workbench.py, 4 inserve_wire.py), so the negative kept passing while asserting nothing about the code it is named forbound_buffer: str | Nonetoserve_workbench.py→ FAILEDtest_doxbench_knowledge_service.py::test_the_route_reads_the_declaration_and_never_selects_a_backendserve.pysourcedoxbench_knowledge.build_backend(declaration)is inside_knowledge_service_and_coveragebuild_backend(payload)→ FAILEDtest_doxbench_routes.py::test_the_v1_canonical_form_is_untouched_by_the_reorder_fixserve.pysource_handle_workbench_chat_turncanonical_buffer_order = turn_buffersto= list(turn_buffers)→ FAILEDtest_doxbench_thread_wiring.py::test_the_liveness_question_has_ONE_spelling_and_it_normalises_refsserve.pysourcedoxbench_scope.is_live_session_ref(is inside_is_live_session_reflive_session_branches(→ FAILEDtest_doxbench_blank_reason.py::test_f5_no_str_coercion_survives_on_the_posture_pathserve.pysourcedef doxbench_turn_v2_success_body(and the nextdef; the builder moved toserve_wire.pystr(context_posture)into that function → FAILEDtest_doxbench_blank_reason.py::test_a_builder_refusal_answers_on_the_routes_fixed_400_shapemonkeypatch.setattr(serve_mod, …)monkeypatch.setattr(serve_workbench, …)doxbench_turn_v2_success_bodyin its own module globals, so a patch onserveno longer reaches it — the test would have driven the real builder and proven nothing. The assertion is unchanged.serve_mod→ FAILED (i.e. the retarget is load-bearing, not cosmetic)test_doxbench_blank_reason.py::test_the_builder_call_site_is_inside_a_packet_error_handlerserve.pyserve_workbench.py;assert callswould have failed outrightglobals()['doxbench_turn_v2_success_body'](so noast.Namecall remains → FAILED on"the builder is never called"test_doxbench_bridge.py::test_the_de_facto_adapter_surface_is_declared_even_though_the_ban_is_notserve.pysourcegetattr(port, …)sites moved, soduck_typedwould compute the empty set and the subset assertion would be vacuously true. Measured: againstserve.pyaloneduck_typed == ∅; against the surface it is{conversation_key, dereference, dispatch, for_conversation, mirror}.getattr(port, "shake")toserve_workbench.py→ FAILEDtest_doxchat_model_intake.py::test_a_turn_naming_the_affordance_refuses_through_the_existing_refusalserve.pysource__doxchat_intake__literal toserve_workbench.py→ FAILEDtest_repo_selector.py::test_serve_module_uses_no_relative_importsserve.pylinesserve.py.from . import doxbench_scopetoserve_workbench.py→ FAILEDtest_session_snapshot.py::test_the_hosted_session_arrival_path_is_recorded_and_not_builtserve.pysource (theapply_laneabsence clause only)serve.py— 36% of the surface this PR created. The positive anchors in the same test (thehosted_ref_refused(marker, its count, and the three route-body checks) stay pinned toserve.pyon purpose: they are POSITIVES that will go red, not hollow, when PR-3 moves_handle_refresh_action— already forward-flagged below for PR-3, unchanged by this fix.apply_laneliteral toserve_workbench.py→ FAILEDtest_repo_selector.py::test_serve_module_uses_no_relative_imports(second mechanism)SERVE_PY.read_text()for three positive import anchors (notebook_action,workbench,gate_routes)notebook_actionactually moved (nowserve_project.pyonly);workbenchandgate_routesstill resolve inserve.pyat their pre-split lines, so the widening was harmless — under-disclosed, not hollow.Rows 2, 9 and 12 were not in the slice's original repoint list: they are silent weakenings found while verifying (row 12 in the fix round below), and all three are widened rather than left green-and-hollow. Row 13 is a disclosure of an already-widened, harmless assertion found in the same fix round.
conftest.py'sNO_IMPLICIT_PUSH_MODULESis widened only (decision 8);test_doxbench_share.py's own widen-never-narrow self-assertion over that tuple passes untouched.Proof
python3 -m pytest -q tests/ideation-dashboard tests/doc-health— see the run recorded below; the only tolerated failure is the known environmentaltest_snapshot.py::test_find_validator_locates_pinned_checkout.OPENSPEC_TELEMETRY=0 openspec validate --all --strict→ 96 passed, 1 failed, the failure being only the knowndisposition-codexfactory-declared-renamesartifact.test_doxbench_routes.py,test_edit_action.py,test_doxbench_document_abstract.py,test_extension_point_parity.py,test_doxbench_bound_buffer.py,test_doxbench_blank_reason.py,test_doxbench_bridge.py,test_doxbench_knowledge_service.py,test_doxbench_thread_wiring.py,test_repo_selector.py,test_doxchat_model_intake.py,test_doxbench_share.py,test_bullseye_widget.py,test_notebook_action.py,test_project_aggregates.py.DashboardHandlermember and no old module-level name unaccounted for, and no symbol left inserve.pychanged — the sole difference inserve.py's remainder is theclass DashboardHandlerbase list.serve.pyexposed still resolve on the module, except six imports used only by moved code (os,subprocess,threading,time,doxbench_threads,states_something); a repo-wide grep confirms nothing reads any of them offserve. All 108DashboardHandlermembers resolve, and the eightstaticmethod/classmethoddescriptors are still those kinds.--helpgolden byte-identical:tests/ideation-dashboard/fixtures/cli-help-tree.golden.txtdoes not appear in the diff againstmainat all. No golden was regenerated; none needed to be.serve, and none uses a relative import (verified by AST, not grep).serve.py6,914 → 2,473;serve_workbench.py3,146;serve_wire.py1,316;serve_project.py314.Fix round (Sonnet)
Verified findings from independent review, fixed:
SimpleHTTPRequestHandlersodo_GETresolution is unchanged" was a claim nothing enforced — today the 46 mixin members share zero names with the wholehttp.serverchain, so the order is currently unobservable, but a later member colliding withsend_head/list_directory/log_message/etc. would silently lose tohttp.server. Added three tests totest_extension_point_parity.py: one pinsDashboardHandler.__mro__[:4], one assertsWorkbenchRoutes/ProjectRoutesshare no member name with theSimpleHTTPRequestHandlerMRO, and a negative control proves the collision check fires on a real shared name (send_head). Both positive tests mutation-checked: inverting the base list and adding a colliding method each turned the respective test red.serve_surface_source()'s docstring overstated its guarantee (conftest.py; also Copilot's first review comment on this PR). It claimed a multi-line literal "can never match across a file boundary that does not exist"; in fact each file already ends in\nand the join adds one more, leaving\n\nat every boundary — which defeats a single-newline literal but not a pattern containing a blank line. Corrected the docstring to say exactly what is guaranteed. No caller ofserve_surface_source()uses a blank-line pattern today, so no behaviour changed.apply_laneabsence intest_session_snapshot.pywas narrower than the serve it names.test_the_hosted_session_arrival_path_is_recorded_and_not_built's comment says "no apply-lane binding exists anywhere in the serve", but the assertion still readserve.pyalone — 36% of the surface this PR created. Repointed just that negative clause toserve_surface_source()(row 12); mutation-checked by adding anapply_laneliteral toserve_workbench.py, which turned it red.test_repo_selector.py::test_serve_module_uses_no_relative_imports; also Copilot's second review comment on this PR).\s*from\s+\.\w*\s+import\bmatchesfrom . import x/from .pkg import xbut notfrom .. import x/from ..pkg import x, which fail identically onceserve.pyruns as a plain script. Widened to\.+\w*and addedtest_the_relative_import_guard_catches_every_dot_depth, parametrized over dot depths 1–3.serve_workbench.py"; measured,serve.pybase had 40, and head has 0/36/4/0 acrossserve.py/serve_workbench.py/serve_wire.py/serve_project.py. Row 2 corrected above.notebook_action,workbench,gate_routes) toserve_surface_source(); onlynotebook_actionhad actually moved, soworkbench/gate_routeswere widened without needing to be. Harmless (nothing is hollow either way), but undisclosed — added row 13 and an inline comment at the assertion.SERVE_PYconstant removed fromtest_doxbench_bound_buffer.py— no reader remained after its own two repoints (rows 1 and 3 above).Both Copilot review threads on this PR are addressed above (the docstring correction and the regex widening, respectively) and replied to inline. Nothing was weakened, deleted, skipped or made vacuous; no behavioural test changed. Re-ran targeted suites plus the full validators:
python3 -m pytest -q tests/ideation-dashboard tests/doc-health→ 6,550 passed, 31 skipped, 2 failed — the two failures are the pre-existing toleratedtest_snapshot.py::test_find_validator_locates_pinned_checkoutandtest_session_gates.py::test_archived_exact_origin_releases_cleanup_after_the_tile_disappears, the latter an order-dependent flake in the full run (untouched by this PR, passes in isolation — confirmed).OPENSPEC_TELEMETRY=0 openspec validate --all --strict→ 96 passed, 1 failed, the knowndisposition-codexfactory-declared-renamesartifact only.Fix round 2 (Sonnet)
Two new Copilot review threads at
27ad5a86, plus one carried-over LOW and one WORDING item from re-verification, fixed:SERVE_SURFACE_MODULES's order contradicted its own docstring (conftest.py:178, Copilot).serve_surface_paths()claims the tuple is "in import-graph order," but it started("serve.py", "serve_wire.py", "serve_workbench.py", "serve_project.py")—serve.pyis the module that imports the other three (serve.pyimportsserve_project,serve_workbenchandserve_wire;serve_workbench.pyandserve_project.pyeach import fromserve_wire;serve_wire.pyimports no sibling), so the real dependency-first order is the reverse. Reordered to("serve_wire.py", "serve_workbench.py", "serve_project.py", "serve.py")and documented in the docstring why no reader ofserve_surface_paths()/serve_surface_source()depends on the order (every consumer is a per-file loop, a joined-source substring/absence check, or an.index()search that resolves within one file's own content).test_repo_selector.py:642, Copilot). Round 1's widening (\.+\w*) caught parent-relative imports (from .. import x) but still stopped at the first dot for the module path, sofrom .pkg.sub import xandfrom ..pkg.sub import xslipped through — both fail identically onceserve.pyruns as a plain script. Widened to\.+[\w.]*.test_the_relative_import_guard_catches_every_dot_depthre-stated the pattern as its own independent literal rather than exercisingtest_serve_module_uses_no_relative_imports's actual regex, so narrowing the production pattern would have left the test green. Hoisted a shared module-levelRELATIVE_IMPORT_REconstant used by both the production scan and the test (renamed totest_the_relative_import_guard_catches_every_dot_and_segment_depth, with the two multi-segment cases added to its parametrize list). Mutation-verified: narrowingRELATIVE_IMPORT_REback to the round-1 pattern now turns both the production-scan test and 5 of the 7 parametrized cases red; afrom ..pkg.sub import xprobe planted inserve_project.pyis caught by the widened production scan and missed by the round-1 pattern.WorkbenchRoutesandProjectRoutescontribute 41 and 5 non-common-dunder members respectively, a union of 46, not 45 (45 waslen(vars(WorkbenchRoutes))alone, including its own dunders). Corrected above in the decision-1 bullet; no code changed, the assertion was already correct either way.Both new Copilot threads replied to and resolved (commit
42934b8d).Catch-up merge:
origin/mainhad advanced to include #741 (§ 2.4 OQ-1), which widens the sameconftest.pyNO_IMPLICIT_PUSH_MODULEStuple this PR also widens (this PR addsserve_workbench.py/serve_project.py/serve_wire.py, #741 addsdoxbench_status_exemption.py). Mergedorigin/mainin (git merge, not a rebase) — commit686706a0; the one resulting conflict, confined to that tuple, resolved by keeping both sides' additions and both comment blocks. Nothing else conflicted.Re-ran the targeted tests (
test_doxbench_share.py::test_no_implicit_path_reaches_a_push,test_extension_point_parity.py) and the full validators at686706a0:python3 -m pytest -q tests/ideation-dashboard tests/doc-health→ 6,607 passed, 31 skipped, 1 failed (957.78s) — the only failure is the known environmentaltest_snapshot.py::test_find_validator_locates_pinned_checkout.OPENSPEC_TELEMETRY=0 openspec validate --all --strict→ 97 passed, 1 failed, the knowndisposition-codexfactory-declared-renamesartifact only.Not in this PR
PR-3 (openXdox + openxFactory-adapter columns, through the route-extension point) and PR-4 (
cli.py, Split cli.py by column behind the subcommand seam (§ 2.4, PR 4 of 4) #742).Forward flags for PR-3 — two currently-green tests that PR-3's moves will break, flagged now rather than discovered then:
test_session_snapshot.py::test_the_hosted_session_arrival_path_is_recorded_and_not_builtcountshosted_ref_refused(inserve.pyand inspects_handle_refresh_action's body (the fix round above already widened this test's separateapply_laneabsence clause to the surface — see row 12 — but these two positive checks are untouched and still pinned toserve.py); PR-3 moves that handler.test_intent_plane_boundary.py:568requires_serve_committed_intentsas aFunctionDefinserve.py; PR-3 moves it toserve_openxfactory_lanes.py.Both are safe today and both will need the same widening treatment.
No
openspec/,contracts/,docs/, README ortasks.mdedits; no change toscripts/route_extension.pyorscripts/subcommand_extension.py.Decisions for Brett
CAPABILITIES_ROUTEand_session_repositorywere assigned toserve_project.py). I kept both in the core on the scout's evidence. Worth a nod if you want the memo's § 2 corrected to match before the § 3.1 carve manifest is drafted.This one is ready for your word — it is not merged and I have not enabled auto-merge.
🤖 Generated with Claude Code
https://claude.ai/code/session_017guxvApq5jqB1QXukJUsTQ