Skip to content

Extract the openXdox and lane serve columns (§ 2.4 PR-3) - #761

Merged
brettheap merged 11 commits into
mainfrom
feat/split-2-4-pr3-extension-columns
Sep 7, 2026
Merged

brettheap merged 11 commits into
mainfrom
feat/split-2-4-pr3-extension-columns

Conversation

@brettheap

@brettheap brettheap commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox)

Realizes split-opendox-two-layer-product § 2.4, PR 3 of 4: the openXdox gate and projection columns and openxFactory's own lane column leave serve.py and arrive through the ROUTE EXTENSION POINT that PR 1 landed. Refs #656.

#748 landed as 7f7ce75 and #742 as 421b52d; this PR was caught up by merging main (conflicts resolved keeping both sides) and now targets main directly.

Fix-round catch-up merge, disclosed here: the base branch advanced past this branch's fork point (686706a) to ca61cf1a ("Exclude dunders by rule, not a hand-listed set, in mixin collision test") while this PR sat for review, and that commit rewrote the same test function this PR also rewrites in place, test_extension_point_parity.py::test_the_mixins_share_no_member_name_with_the_http_server_chain. Corrected here: an earlier note on this PR read the base as an ancestor of HEAD (true at the original push, false once ca61cf1a landed) and said no catch-up was needed. A real merge (git merge --no-edit) was taken instead, and the one conflict was resolved keeping BOTH sides — ca61cf1a's rule-based _non_dunder(...)/_http_server_chain_members() exclusion (never the hand-listed {__module__, __doc__, __qualname__, __dict__, __weakref__} set) AND this PR's five-mixin sweep (WorkbenchRoutes, ProjectRoutes, GateRoutes, ProjectionRoutes, LaneRoutes) plus its own non-vacuity assertion. Taking either side wholesale would have silently reverted the other's hardening inside the merge commit itself.

This is the first slice where the seam carries live traffic rather than an empty tuple: four read arms and five write arms leave the fixed _route/do_POST tables and are dispatched BY NAME against the live DashboardHandler instead — which is what makes every one of them still meet self.loopback, self.capabilities, self.actor and the human-console test by construction rather than by its author's memory.

What moved

Three new column modules, each a mixin class + an extension class + its route constants. Every moved body is byte-identical to the one it replaced (asserted mechanically against HEAD — 18 of 18 functions, including the three that landed in serve_wire.py).

New module Column Handlers Constants
scripts/ideation_dashboard/serve_gate.py openXdox _handle_gate_action, _log_gate_failure ACTIONS_GATE_PREFIX
scripts/ideation_dashboard/serve_projection.py openXdox _query_key, _read_snapshot, _serve_snapshot, _hosted_entry_refused, _serve_index, _keyed_source, _serve_source, _refuse_bare_source (new), module fn resolve_source_path SNAPSHOT_INDEX_ROUTE, SOURCE_PREFIX, BARE_SOURCE_ROUTE (new)
scripts/ideation_dashboard/serve_openxfactory_lanes.py openxFactory adapter (RULING DQ-1 / OQ-3) _handle_dtn_seed, _handle_staging_seed, _handle_apply_register_edits, _handle_refresh_action, _run_refresh, _serve_committed_intents COMMITTED_INTENTS_ROUTE, ACTIONS_REFRESH_ROUTE, ACTIONS_APPLY_REGISTER_EDITS_ROUTE, ACTIONS_DTN_SEED_ROUTE, ACTIONS_STAGING_SEED_ROUTE

Plus:

  • scripts/ideation_dashboard/serve_wire.py gains the hosted-plane confinement — HOSTED_SESSION_REFUSAL, hosted_ref_refused, hosted_index (FR-048) — moved verbatim out of serve.py. CORRECTED (an earlier version of this paragraph over-generalized): the three names are not read alike. hosted_ref_refused is read by the core (_divergence_headers, serve.py) AND by both new columns. HOSTED_SESSION_REFUSAL is read by both columns only — the core never names it. hosted_index has exactly ONE in-tree reader, serve_projection.py's _serve_index (an openXdox FR-048 index-confinement rule; the § 3 carve will have to re-home it out of this shared module with its column). Leaving any of the three in serve.py would have forced at least one column to import serve while serve imported it, which is the cycle serve_wire.py exists to prevent; filing any of them under a column would have made the core or the other column depend on a column. It also gains snapshot_registry as registry_mod for is_publishable_ref (no cycle — snapshot_registry imports no module of the split).
  • scripts/ideation_dashboard/profile_openxfactory.py — created here with the header Split cli.py by column behind the subcommand seam (§ 2.4, PR 4 of 4) #742 already wrote for it (that PR's docstring names this one: "PR 3 of § 2.4 adds ROUTE_EXTENSIONS beside SUBCOMMAND_EXTENSIONS"). It carries ROUTE_EXTENSIONS only; SUBCOMMAND_EXTENSIONS and its cli_gate import arrive with Split cli.py by column behind the subcommand seam (§ 2.4, PR 4 of 4) #742. The two PRs both add this file, so whichever lands second needs a one-hunk conflict resolution that keeps both constants — see "Decisions for Brett". Fix-round correction: the import comment above ROUTE_EXTENSIONS's imports originally copied Split cli.py by column behind the subcommand seam (§ 2.4, PR 4 of 4) #742's CLI-flavoured wording verbatim (referencing cli.py's note and cli_gate._core(), neither of which exists on this branch) so the eventual add/add merge would need only one hunk. It has been rewritten in this fix round to speak in route/server terms instead, on explicit instruction — the tradeoff is that the two branches' copies of this paragraph no longer match byte-for-byte, so the future merge with Split cli.py by column behind the subcommand seam (§ 2.4, PR 4 of 4) #742 will need a one-paragraph resolution (keep this branch's route-flavoured wording) rather than a clean add/add on that paragraph; every other line of the shared header (docstring, ROUTE_EXTENSIONS vs SUBCOMMAND_EXTENSIONS constants) is untouched and still resolves in one hunk.
  • scripts/route_extension.py — edited under RULING A (design decision 9), the ONE landed-seam edit this lane is authorized to make. collect_bindings gains the containment refusal and four private helpers (_claimed_methods, _share_a_method_slot, _sits_under, _overlapping_previous, _containment_message); every pre-existing refusal — literal duplicates, the GET/HEAD slot, missing and non-callable handlers, non-conforming extensions — is unchanged and still asserted, and the module still imports nothing but the standard library (the AST neutrality scan is unmoved). scripts/subcommand_extension.py remains untouched.
  • serve.py's lazy profile_openxfactory import comment is corrected (design decision 10, Copilot review PRRT_kwDOTAvnrs6f_iG1): the stated justification was false on this branch, and the comment now carries only the half that is true. Its neighbouring collect_bindings comment also names the new refusal. No code in build_server changed — both are comment edits, in commit eb1dbee.
  • serve.py re-imports every moved module-level name by name (serve.ACTIONS_GATE_PREFIX, serve.SOURCE_PREFIX, serve.resolve_source_path, serve.hosted_index, … all still resolve), keeps _route/do_POST literally inside class DashboardHandler, keeps CAPABILITIES_ROUTE inline and _session_repository in core, and drops its now-unused import traceback.

Nine contributed bindings, in collect_bindings consult order:

GET  /snapshot-index.json          -> _serve_index
GET  /source                       -> _refuse_bare_source
GET  /committed-intents.json       -> _serve_committed_intents
POST /actions/refresh              -> _handle_refresh_action
POST /actions/dtn-seed             -> _handle_dtn_seed
POST /actions/staging-seed         -> _handle_staging_seed
POST /actions/apply-register-edits -> _handle_apply_register_edits
POST /actions/gate/       (prefix)  -> _handle_gate_action
GET  /source/             (prefix)  -> _serve_source

Design decisions taken

  1. /snapshot.json's HANDLER moved; its ARM stayed core. The arm tests path == self.snapshot_route, a per-server class attribute fed by the public build_server(snapshot_route=…) keyword. A RouteBinding.pattern is a frozen string, so contributing this route would have broken that keyword silently — no in-tree caller overrides it, so nothing would have gone red. The method therefore moved to serve_projection.py with its neighbours and the dispatch arm stayed in _route. This is in tension with design § D2's "contributes snapshot, /source and projection routes", so it is flagged below rather than settled here. Third deviation from the § 2.4 memo, in the same spirit as PR-2's decisions 3 and 4.

  2. The /source pair moved TOGETHER — behaviour would have changed otherwise. if path == "/source" or path == "/source/" was partly dead: path.startswith("/source/") fired first, so /source/ reached _serve_source("") → 404 with divergence headers and a zero-length body, never send_error(404, "no source path"). Moving only the prefix binding would have promoted the surviving core arm above it and turned that answer into an HTML error body — observable, and exercised by test_renderer.py::test_serve_rejects_path_traversal. collect_bindings returns every exact binding before every prefix one, so an exact /source binding plus the /source/ prefix binding reproduces today's order exactly. _refuse_bare_source is the one non-move in this PR: a send_error line lifted out of that if so a binding can name it. Pinned by test_the_exact_source_binding_is_consulted_before_the_prefix_one and by a live-wire test that asserts the two 404s stay different.

  3. Composition is ADDITIVE, not a sentinel — this is a deviation from the slice brief's "preferred" shape, taken on evidence. build_server registers profile_openxfactory.ROUTE_EXTENSIONS first and the caller's route_extensions after, exactly as Split cli.py by column behind the subcommand seam (§ 2.4, PR 4 of 4) #742's build_parser does for SUBCOMMAND_EXTENSIONS. The proposed sentinel (None → profile, () → none) does not work: the only in-tree caller that passes the keyword at all is test_route_extension.py's own serving() helper, which declares route_extensions=() and always forwards it explicitly — under sentinel semantics every server in the file that tests this very seam would lose /snapshot-index.json, /source/, the committed-intent feed and every gate verb, and test_a_contributed_write_route_refuses_off_loopback_exactly_like_a_core_one would 404 where it expects 403. The default-assertion test has to change under either design (see repoint 4), so the sentinel bought nothing and cost a second behavioural break. route_extensions=() and passing nothing now mean the same thing, which is the reading 31 in-tree test build_server(...) call sites across 27 test files already assume (measured by AST walk, corrected from an earlier '35 across 27' figure that counted prose mentions rather than parsed calls; three more call sites live in scripts/ itself — cli.py, doxbench_mcp.py, serve.py — none of which passes route_extensions either).

  4. profile_openxfactory is imported lazily, inside build_server. cli.py names it at module scope because a parser is built from it at import time; a server is not; the profile is a WIRING input read once per build, so it sits beside the composition it feeds. CORRECTED in this fix round (decision 10 below): the two further reasons this decision originally gave are both false and have been struck from the code comment and from here — a module-scope import would NOT pull the contributed columns into a new import graph (serve.py already imports all three, as DashboardHandler's mixin bases), and it would NOT make gate_routes an eager import of serve (serve_gate imports it function-locally, inside _handle_gate_action). What genuinely must stay out of a module the container runs as a plain script is cli_gate, and that is held out at the profile's own end by PEP 562.

  5. Extension classes conform STRUCTURALLY. GateRoutesExtension, ProjectionRoutesExtension and LaneRoutesExtension implement routes() and import nothing from the core they contribute to — the direction the § 3 carve needs. Named uniformly …RoutesExtension (the scout manifest proposed ProjectionExtension for one of the three; a uniform triple reads better and nothing depends on the name).

  6. openxFactory's own lanes reach the seam the same way openXdox does. Nothing stops the repository that owns the extension point from contributing through it, and doing so is what proves the seam is a seam rather than a courtesy extended to one column.

  7. The three doc_health imports. Only two travel (shared_identity, staging_seed, both still function-local, still reaching doc_health directly — nothing re-plumbed through corpus_adapter_openxfactory). The third, _head_of's RealGit, is called by build_server and is core, so serve.py keeps one direct doc_health import. The § 2.4 memo's "all three" claim is wrong; reported below, memo not edited.

  8. The intent feed is a pure move. _serve_committed_intents lands exactly as PR Intent plane 4.4 (PR-1): hosted tray emits intents; pending/applied/refused chips and refusal panel from the inbox plus the committed-intent feed #718 left it, byte for byte.

  9. RULED A (Brett Heap, 2026-09-07): collect_bindings refuses an exact binding under a declared prefix; fixed in eb1dbee. This PR opened the gap by moving the gate console and the projection routes off serve.py's fixed tables: collect_bindings keyed a collision on (method, pattern, is_prefix) alone, so an EXACT binding was never compared against an already-declared PREFIX binding's pattern. Before the move no caller-suppliable binding stood a chance against a hard-coded if; after it, a caller who passes route_extensions could declare an exact binding under ACTIONS_GATE_PREFIX or SOURCE_PREFIX — e.g. POST /actions/gate/<verb> — the build accepted it, and because exact is consulted before prefix it WON the match, so _handle_gate_action and its loopback/capability/actor/human-console refusals never ran for that path. The pushed version disclosed and characterized this rather than fixing it, on the grounds that scripts/route_extension.py was out of this lane's scope; Brett ruled it CLOSED here, which authorizes this lane's one edit to that landed seam (scripts/subcommand_extension.py stays untouched). collect_bindings now refuses ANY pattern that sits under an already-declared prefix pattern (str.startswith — RouteBinding.matches's own test for a prefix hit), in EITHER declaration order, with the same RouteBindingError a literal duplicate raises, and the message names both bindings by their own declared method and pattern (the discipline _collision_message already keeps). Method-aware on the same slot rule the duplicate check uses, reused rather than restated (_claimed_collision_keys -> _claimed_methods): POST-exact under POST-prefix collides; a GET and a HEAD binding collide, because a GET binding answers HEAD; a GET exact under a POST prefix does not, since no live request is offered to both. The containment check runs AFTER the exact-key check, so a literal duplicate keeps reporting itself as a duplicate. Nested prefixes: REFUSED, decided on evidence as the ruling directs. The in-tree profile declares exactly two prefixes, POST /actions/gate/ and GET /source/, and neither sits under the other, so no legitimate declaration needs the case — while which of two nested prefixes answered a path they both cover would be settled by the assembly order this module refuses to depend on, leaving the loser unreachable across a whole subtree. Fail closed; the day a real declaration needs nesting it can be admitted with a rule and a test. What stays legal, and had to: an exact pattern EQUAL to a prefix minus its trailing slash is not under it ("/source".startswith("/source/") is False, and no request path reaches both), which is exactly what the projection column declares — asserted directly and by the nine-binding profile pin, so this assembly still builds. One consequence worth stating: with overlap refused, no two bindings can both answer one live request at all, so the exact-before-prefix grouping now decides nothing a refusal has not already prevented and is kept as defence in depth.

  10. The lazy profile_openxfactory import's justification was false, and is corrected (Copilot review PRRT_kwDOTAvnrs6f_iG1; same commit eb1dbee). The comment above build_server's from ideation_dashboard import profile_openxfactory claimed a module-scope import "would pull every contributed column ... into the import graph of a module the container runs as a plain script". It would not: serve.py already imports all three contributed columns at module scope, because they are DashboardHandler's mixin bases, and the profile imports exactly those three. The dependency that must stay out of the server's import graph is the CLI column — cli_gate reaches authoring -> workbench -> PyYAML, which the hosted image deliberately does not carry — and that is held out at the profile's OWN end, which resolves SUBCOMMAND_EXTENSIONS (and cli_gate) on access through PEP 562. The comment now says that, and decision 4 above is corrected with it: the claim that a module-scope import would make gate_routes an eager import of serve is also false — serve_gate imports gate_routes function-locally, inside _handle_gate_action.

Test repoints

Every repoint below is disclosed per ruling (a): same assertion, same strength, repointed because the code it names moved. Each repoint row's mutation was RUN and observed to fail. Rows 10 and 12-14 are NOT repoints — they are new tests, disclosed here rather than under "Proof" because they bear directly on decisions 3 and 9. Rows 11 and 15 ARE repoints, both forced by RULING A: row 11 inverts an assertion because the behaviour it characterized is now refused, and row 15 rebuilds a setup that the refusal made illegal.

# Test Old target New target Why Mutation that proves it bites
1 test_extension_point_parity.py ROUTE_ARMS / DO_POST_ARMS 10 + 11 arms 6 + 6 The one legitimate narrowing: those arms are no longer in the fixed table. Every surviving arm keeps its exact position, test source and reached-name set; what left is pinned at the same strength by test_serve_column_split.py. swap the WORKBENCH_MODEL_INTAKE_ROUTE and WORKBENCH_THREAD_ROUTE arms in _route → FAILS
2 test_extension_point_parity.py::test_the_mixins_precede_simplehttprequesthandler_in_the_mro mro[:4], 2 mixins mro[:7], 5 mixins WIDENING: the base list grew by three, and the order of all five is now pinned rather than of two. move GateRoutes after SimpleHTTPRequestHandler in the base list → FAILS
3 test_extension_point_parity.py::test_the_mixins_share_no_member_name_with_the_http_server_chain 2 mixins 5 mixins WIDENING: the collision sweep follows the mixins. Fix-round catch-up merge of ca61cf1a kept BOTH this widening AND the base's independent hardening (rule-based _non_dunder exclusion in place of the hand-listed dunder set) — see the disclosure note under "Stacked on" above. add def send_head(self) to LaneRoutes → FAILS; separately, reintroducing the hand-listed dunder set in place of _non_dunder would silently drop __annotations__-carrying members from the check (not independently mutation-proved here — see the base's own commit)
4 test_route_extension.py::test_a_server_built_with_no_extensions_has_an_empty_table → …_carries_exactly_the_in_tree_profile route_bindings == () == collect_bindings(profile_openxfactory.ROUTE_EXTENSIONS) Unavoidable under any composition (see decision 3). STRICTLY HARDER than == (): a stray binding added to the profile, a member dropped from it, or a caller's tuple leaking into a default build all fail. drop profile_openxfactory.ROUTE_EXTENSIONS from build_server's composition → FAILS. (A stray binding ADDED to the profile moves both sides of this equality, so that case is caught instead by the new file's literal 9-tuple pin.)
5 test_route_extension.py::test_a_contributed_write_route_refuses_off_loopback_exactly_like_a_core_one core comparator /actions/gate/ratify serve_mod.ACTIONS_EDIT_ROUTE SILENT WEAKENING otherwise, green either way: the gate verb is now CONTRIBUTED, so the test would compare contributed-against-contributed while its docstring claims contributed-against-CORE. /actions/edit is a fixed core arm with the same if not self.loopback first clause. strip the if not self.loopback guard from _probe_write → FAILS
6 test_session_snapshot.py::test_the_hosted_session_arrival_path_is_recorded_and_not_built serve.py text conftest.serve_surface_source() HARD FAIL then hollow if narrowed: def hosted_ref_refused( moved to serve_wire.py, and the per-route body slices for _serve_snapshot/_serve_source/_handle_refresh_action moved to two more files. Definition, named prose, call-site floor and per-route bodies are all still asserted. delete the hosted_ref_refused( call from _handle_refresh_action → FAILS
7 test_intent_plane_boundary.py::test_serving_pod_is_credential_free one ast.parse of serve.py one AST walk per serve_surface_paths() file, plus a new "found exactly once" assertion _serve_committed_intents moved, so the old next(...) raises StopIteration. The exactly-once clause is new and makes the scan un-hollowable. add os.environ.get("X") inside _serve_committed_intents → FAILS
8 conftest.py SERVE_SURFACE_MODULES 4 names + serve_gate.py, serve_projection.py, serve_openxfactory_lanes.py REQUIRED, else every source-level scan over the serve stops seeing the three new files the moment code moves into them — including the D12 relative-import guard, which is the one that 500s a POST route in production. Widened, never narrowed. two steps: put from . import action_errors in serve_gate.py → test_serve_module_uses_no_relative_imports FAILS; keep that defect and drop serve_gate.py from the tuple → it goes GREEN again. Observed both ways.
9 conftest.py NO_IMPLICIT_PUSH_MODULES 8 names (incl. #741's doxbench_status_exemption.py, kept) + the same three WIDENED per §12.2's own rule. serve_gate.py is load-bearing: _handle_gate_action dispatches the SESSION-BEARING verbs, so a list left at PR-2's set would have let the file move evade the absence. add .push( to serve_gate.py → test_doxbench_share.py FAILS
10 test_route_extension.py — NEW test_a_caller_s_extensions_are_added_to_the_profile_and_never_replace_it (did not exist) asserts route_extensions is ADDITIVE: profile_bindings <= got, PROBE_BINDINGS <= got, len(got) == len(profile) + len(probes) UNDISCLOSED in the version of this table originally pushed — an omission, corrected here. Additive coverage only, not a repoint: proves decision 3's additive-composition claim as a property rather than leaving it to the docstring. make build_server REPLACE the profile with the caller's tuple instead of composing both → FAILS
11 test_route_extension.py::test_an_exact_caller_binding_under_a_contributed_prefix_wins_the_match -> …_refuses_the_build asserted the caller's exact binding under ACTIONS_GATE_PREFIX WON the match (a characterization of the gap decision 9 disclosed) asserts a real build_server REFUSES with RouteBindingError, parametrized over BOTH contributed prefixes (ACTIONS_GATE_PREFIX, SOURCE_PREFIX), and asserts the message names the caller's binding and this assembly's own FLIPPED under RULING A, exactly as the test's own docstring said a tightening would require. The live hijack reproducible at the previous head — a probe answering POST /actions/gate/<verb> with its own 200, no loopback/capability/actor/console check run — is now impossible before the socket opens. revert the containment refusal in collect_bindings -> FAILS (observed: 10 tests red, both parametrizations of this one included)
12 test_route_extension.py — NEW test_a_pattern_under_a_declared_prefix_refuses_the_build (did not exist) four overlapping pairs x BOTH declaration orders (8 cases): the gate prefix + an exact verb under it; a GET prefix + a HEAD exact under it; two NESTED prefixes; a pattern equal to a prefix but declared exact. Message content asserted — each binding named by its own method and pattern, the prefix named AS a prefix RULING A's core. Parametrized over declaration order because a refusal that only fired when the prefix was declared first would be no refusal at all across independent extensions, whose tuple order is an accident. same revert -> all 8 FAIL
13 test_route_extension.py — NEW test_an_exact_binding_under_a_prefix_of_ANOTHER_METHOD_does_not_collide (did not exist) POST-prefix + GET exact, POST-prefix + HEAD exact, GET-prefix + POST exact all collect cleanly The positive control on method-awareness: a refusal that over-fired here would make the seam unusable for the commonest legitimate shape, a read route inside a write prefix's path space. drop _share_a_method_slot from the containment scan -> 4 FAIL (these 3 plus row 15)
14 test_route_extension.py — NEW test_an_exact_pattern_equal_to_a_prefix_minus_its_slash_does_not_collide (did not exist) exact /source beside prefix /source/ collects, AND the whole in-tree profile still yields its 9 bindings The pair this assembly actually declares. It is what fixes the refusal's test as startswith on the raw patterns rather than a segment-wise or same-stem rule, which would have refused the profile itself. make _sits_under compare path SEGMENTS instead of startswith -> FAILS (and test_serve_column_split.py's nine-binding pin with it)
15 test_route_extension.py::test_exact_bindings_are_consulted_before_prefix_bindings a GET prefix /a/ + a GET exact /a/exact a POST prefix /a/ + a GET exact /a/exact REPOINTED, not weakened: the same-method pair this test used to build is precisely what RULING A now refuses, so the test would fail on its own setup. The cross-method pair is the legal one that still exercises the grouping, and it additionally pins that the containment refusal is method-aware rather than fired on patterns alone. swap exact and prefix in collect_bindings' return -> FAILS

Rows 8/9 widen with THREE new files, not four: profile_openxfactory.py is also new and is also part of the serve surface (build_server imports it and its ROUTE_EXTENSIONS tuple determines the whole contributed route table), but it is deliberately left OUT of both tuples and a comment now says why beside SERVE_SURFACE_MODULES in conftest.py — it is relative-import-only by design, so the D12 relative-import guard these tuples feed would fail on it for a reason that guard does not exist to catch. Fix-round correction: an earlier version of this PR left the exclusion undisclosed.

No behavioural test's ASSERTED BEHAVIOUR was changed — one behavioural test's core COMPARATOR was repointed (row 5), because the route it named (/actions/gate/ratify) became contributed; the docstring's claim (contributed-against-CORE) is what the repoint restores, since left alone the test would have compared contributed-against-contributed. No golden was regenerated — fixtures/cli-help-tree.golden.txt is CLI-only and does not appear in this diff; nothing else pins the route table as a fixture.

Proof

  • New: tests/ideation-dashboard/test_serve_column_split.py — (a) every one of the 16 moved handlers resolves on DashboardHandler, is defined on the column mixin this file records, and is NOT also defined on DashboardHandler (a fork would shadow); (b) the profile declares exactly three protocol-conforming extensions in a named order; (c) the flattened 9-binding table, compared whole; (d) the /source ordering trap, at the binding level and over the wire; (e) one off-loopback parity test per moved WRITE route (/actions/refresh, /actions/dtn-seed, /actions/staging-seed, /actions/apply-register-edits, /actions/gate/ratify), each asserting the SAME status and SAME error code the core /actions/edit gives, driven through a real build_server; (f) a negative control proving those five do NOT answer loopback_only on a loopback bind.
  • Byte-identity, asserted mechanically: all 18 moved functions compared to git show HEAD:scripts/ideation_dashboard/serve.py — identical, and none of them still defined in serve.py.
  • Behavioural suites run UNMODIFIED and green: test_repo_selector.py (refresh, index), test_renderer.py / test_source_dot_directories.py / test_explorer_viewer.py (/source), test_session_verbs.py / test_branch_session.py / test_gate_routes.py (gate verbs), test_session_snapshot.py / test_session_confinement.py (FR-048 confinement), test_intent_plane_boundary.py (the feed).
  • python3 -m pytest -q tests/ideation-dashboard tests/doc-health — 1 failed, 6681 passed, 31 skipped in 14m22s, re-run at the RULING A head (eb1dbee). The single failure is the known environmental test_snapshot.py::test_find_validator_locates_pinned_checkout (a worktree has no sibling pinned checkout), the only tolerated one for this slice.
  • OPENSPEC_TELEMETRY=0 openspec validate --all --strict — 98 passed, 1 failed (only the known disposition-codexfactory-declared-renames artifact), re-run at the same head.
  • RULING A mutation checks, both run and observed. Revert the containment refusal in collect_bindings -> 10 tests red (rows 11-12, both parametrizations of each), restore -> green. Drop its method-awareness (_share_a_method_slot) -> 4 red (rows 13 and 15), restore -> green.
  • A third Copilot thread, serve_openxfactory_lanes.py:126 and :194 — _handle_dtn_seed / _handle_staging_seed call _read_json_body() and then body.get(...), which raises AttributeError on a non-dict JSON body (a list). Factual and confirmed, and NOT fixed here: both bodies are byte-identical moves out of serve.py (diffed against origin/main, lines 1126-1199 and 1200-1283), _read_json_body is itself untouched and still in serve.py, so the defect is exactly as reachable on main today. Fixing it here would break this slice's by-function-move invariant and the byte-identity proof that rides on it; a follow-up issue names both sites. The minimal fix already exists in the same file — _handle_refresh_action's isinstance(body, dict) -> 400 invalid_body guard.

CI scoping, stated so "green" is not over-read: this PR targets PR-2's branch, and the heavy gates (pytest-suite, openspec-cli-pin, clearing-dispatch-gate, release-tag-gate, signed-execution-chain-gate, wallet-validation, openreposhape-pin) only trigger on pull requests into main — #748 has all of them. On this PR only lane-line and merge-master-approval ran, both green. The full set runs when this is retargeted to main after the base lands; until then the local run above is the proof.

Not in this PR

Decisions for Brett

  1. /snapshot.json stayed a core arm (decision 1). Design § D2 says openXdox contributes "snapshot, /source and projection routes". The alternatives are (i) accept the loss of the build_server(snapshot_route=…) keyword, or (ii) make the profile expose a factory rather than a constant, which conflicts with Split cli.py by column behind the subcommand seam (§ 2.4, PR 4 of 4) #742's landed shape. I took neither and left the arm core. If you want § D2 read literally, that is a follow-up with one of those two costs.
  2. profile_openxfactory.py is created by BOTH this PR and Split cli.py by column behind the subcommand seam (§ 2.4, PR 4 of 4) #742. Same docstring header, different constants, so the second to land needs a one-hunk add/add resolution keeping SUBCOMMAND_EXTENSIONS + its from . import cli_gate and ROUTE_EXTENSIONS + its three from . import serve_*. Flagging so it is a planned catch-up rather than a surprise. Nothing here touches a line Split cli.py by column behind the subcommand seam (§ 2.4, PR 4 of 4) #742 wrote.
  3. § 2.4 memo drift, reported not edited (the memo is a scratch artifact, not a governed doc): (a) the memo's claim that the lane column carries "all three" of serve.py's direct doc_health imports is wrong — only two travel; (b) every line citation in memo § 2 predates PR-2 and is stale; (c) memo § 3 item 3 names only NO_IMPLICIT_PUSH_MODULES — SERVE_SURFACE_MODULES did not exist when it was written and also had to be widened; (d) tasks.md § 2.4 still cites serve.py (6,733 lines) and § 2.1/2.2/2.2a/2.3 checkboxes still read [ ] though all four landed — bookkeeping for the § 2.6 PR.
  4. RULED A (Brett Heap, 2026-09-07): collect_bindings refuses an exact binding under a declared prefix; fixed in eb1dbee (design decision 9). Kept here rather than deleted so the ruling and its scope stay on the record: your word authorized this lane to edit scripts/route_extension.py, which the pushed version had declared out of scope and had only characterized with a test. The one sub-question the ruling left to evidence — two PREFIXES where one starts with the other — is decided REFUSE (fail closed): the in-tree profile declares no nested pair, so nothing legitimate needs the case. Nothing else about the landed seam moved: scripts/subcommand_extension.py is untouched, and every pre-existing refusal is unchanged and still asserted. The build-time guard the review also offered (refuse in build_server before calling collect_bindings) was NOT taken: the refusal belongs where every assembly passes through it, not where only this repository's server would get it.
  5. The profile_openxfactory.py shared-header comment (decision item under "What moved") no longer matches Split cli.py by column behind the subcommand seam (§ 2.4, PR 4 of 4) #742's copy verbatim after this fix round's rewrite (it spoke in CLI terms that don't apply here). The eventual add/add merge with Split cli.py by column behind the subcommand seam (§ 2.4, PR 4 of 4) #742 will need a one-paragraph resolution on that comment (keep this branch's route-flavoured wording) in addition to the constants merge item 2 above already flags.

Asking for your word on this one; I have merged nothing and will not.

🤖 Generated with Claude Code

https://claude.ai/code/session_017guxvApq5jqB1QXukJUsTQ

brettheap and others added 6 commits September 6, 2026 22:24
`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
#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
…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
… seam (§ 2.4 PR 3)

`split-opendox-two-layer-product` § 2.4, PR 3 of 4 — the first slice where the
route extension point carries live traffic instead of an empty tuple.

Three new column modules, each a mixin class + a structurally-conforming
extension class + its route constants, every moved body byte-identical to the
one it replaced (18 of 18 functions, asserted against HEAD):

  * serve_gate.py             (openXdox) _handle_gate_action, _log_gate_failure
  * serve_projection.py       (openXdox) the snapshot read, the index roster and
                              the /source pass-through, plus resolve_source_path
  * serve_openxfactory_lanes.py (this repository's own adapter column, DQ-1/OQ-3)
                              the DTN and staging seeds, the register-edit lane,
                              both refresh bindings and the committed-intent feed

serve_wire.py gains the hosted-plane confinement (HOSTED_SESSION_REFUSAL,
hosted_ref_refused, hosted_index): the core AND both new columns read it, and
leaving it in serve.py would have forced a column to import serve while serve
imported it — the cycle serve_wire.py exists to prevent.

profile_openxfactory.py is created here with the header PR 4 already wrote for
it, carrying ROUTE_EXTENSIONS alone; build_server registers that profile ahead
of the caller's route_extensions, additively, exactly as build_parser does for
SUBCOMMAND_EXTENSIONS. Nine arms leave the fixed _route/do_POST tables and
arrive as RouteBindings dispatched BY NAME against the live handler, so each
still meets self.loopback and self.capabilities by construction.

Two deliberate exceptions, both disclosed in the PR body: /snapshot.json's
handler moved but its ARM stayed core (its test reads the per-server
build_server(snapshot_route=...) keyword, which a frozen pattern cannot carry),
and the /source pair moved TOGETHER because splitting it would have changed the
answer a trailing-slash request gets. _refuse_bare_source is the one non-move.

Test repoints are per ruling (a), each disclosed with the mutation that proves
it bites: the pinned dispatch table, the MRO and mixin-collision pins, the
default-table assertion, the off-loopback core comparator, the hosted-arrival
source read, the intent-feed AST walk, and both conftest surface tuples
(widened, never narrowed). No behavioural test modified, no golden regenerated.
New: tests/ideation-dashboard/test_serve_column_split.py pins the contributed
table and gives every moved write route its own off-loopback parity test.

Refs #656

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_017guxvApq5jqB1QXukJUsTQ
Copilot AI lite review requested due to automatic review settings September 7, 2026 15:53

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

@brettheap brettheap changed the title Extract the openXdox and openxFactory serve columns through the route seam (§ 2.4 PR-3) Extract the openXdox and lane serve columns (§ 2.4 PR-3) Sep 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It refactors live request dispatch and server assembly (core vs contributed route resolution) across multiple modules, so final human verification is warranted even with strong test pinning.

Pull request overview

This PR implements §2.4 PR-3 of the openDox/openXdox extraction by moving the openXdox gate + projection routes and openxFactory’s lane routes out of serve.py into dedicated mixin modules, and then serving them via the route extension point (by-name dispatch against DashboardHandler) while keeping serve.py’s public surface stable via re-exports.

Changes:

  • Add three new serve “column” modules (serve_gate.py, serve_projection.py, serve_openxfactory_lanes.py) and compose them into DashboardHandler as mixins.
  • Register the in-tree route profile (profile_openxfactory.ROUTE_EXTENSIONS) inside build_server() and flatten contributed bindings via route_extension.collect_bindings(...).
  • Repoint/widen tests to scan the full “serve surface” and add a new test file that pins the contributed binding table and off-loopback parity for moved write routes.
File summaries
File Description
tests/ideation-dashboard/test_session_snapshot.py Repoint source-scan assertions to the full serve surface after handlers moved into new modules.
tests/ideation-dashboard/test_serve_column_split.py New test suite pinning moved handlers’ resolution, profile composition order, contributed binding table, /source ordering trap, and off-loopback parity for moved write routes.
tests/ideation-dashboard/test_route_extension.py Update expectations: default server now includes the in-tree profile bindings; add additive-composition property test; repoint core comparator route.
tests/ideation-dashboard/test_intent_plane_boundary.py Widen AST authority-scan to the full serve surface and assert the handler exists exactly once.
tests/ideation-dashboard/test_extension_point_parity.py Narrow the fixed core arm tables (moved arms now contributed) and widen MRO + collision sweeps to include the three new mixins.
tests/ideation-dashboard/conftest.py Extend serve-surface module lists so all source-level scans include the new serve column files.
scripts/ideation_dashboard/serve.py Compose new mixins, re-export moved names/constants, shift moved routes to contributed binding dispatch, and compose profile route extensions inside build_server().
scripts/ideation_dashboard/serve_wire.py Move hosted-plane confinement helpers (HOSTED_SESSION_REFUSAL, hosted_ref_refused, hosted_index) out of serve.py into shared wire vocabulary.
scripts/ideation_dashboard/serve_projection.py New projection/snapshot column mixin + extension: /snapshot-index.json, /source, /source/, plus moved snapshot/source handlers and resolve_source_path.
scripts/ideation_dashboard/serve_openxfactory_lanes.py New openxFactory lane column mixin + extension: refresh/seeds/apply-register-edits and committed-intents feed routed through the seam.
scripts/ideation_dashboard/serve_gate.py New gate-console column mixin + extension: contributed /actions/gate/ prefix dispatch and logging helper.
scripts/ideation_dashboard/profile_openxfactory.py New in-tree profile defining the assembled ROUTE_EXTENSIONS tuple for build_server() composition.
Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

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
brettheap and others added 2 commits September 7, 2026 13:05
Fix round finding F1/F5 (WF24d r8): the base branch advanced past PR-3's
fork point to ca61cf1 ("Exclude dunders by rule, not a hand-listed set,
in mixin collision test"), which rewrote the same test function this PR
also rewrites in place. Resolved test_extension_point_parity.py's
test_the_mixins_share_no_member_name_with_the_http_server_chain by
keeping BOTH edits: ca61cf1's rule-based `_non_dunder(...)` /
`_http_server_chain_members()` exclusion (never the hand-listed
{__module__, __doc__, __qualname__, __dict__, __weakref__} set) AND
PR-3's five-mixin sweep (WorkbenchRoutes, ProjectRoutes, GateRoutes,
ProjectionRoutes, LaneRoutes) plus its non-vacuity assertion. Taking
either side wholesale would have silently narrowed the other.

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UyynFBwGMQNeNU8D8qhQBW
…ce-gap disclosure

Fixes verified findings from the WF24d parity + gating lenses on PR #761
(§ 2.4 PR 3, r7/r8):

* Arm-count claim corrected: "five read arms" -> "four read arms" (matches
  the measured ROUTE_ARMS 10->6 delta) in the PR body and the test comment
  above ROUTE_ARMS in test_extension_point_parity.py.
* "35 in-tree build_server(...) call sites across 27 files" corrected to
  the measured "31 in-tree test call sites across 27 test files" (AST walk,
  not a grep of prose) in serve.py's build_server docstring,
  profile_openxfactory.py's ROUTE_EXTENSIONS comment, and the PR body.
* serve_wire.py's docstring and the PR body's "Plus" bullet both
  over-generalized the reason HOSTED_SESSION_REFUSAL/hosted_ref_refused/
  hosted_index moved to serve_wire.py, claiming all three are read by the
  core and both columns. Corrected per-name: only hosted_ref_refused is
  read by the core; HOSTED_SESSION_REFUSAL is read by both columns only;
  hosted_index has exactly one in-tree reader (serve_projection.py).
* profile_openxfactory.py's relative-import comment spoke in CLI terms
  copied verbatim from #742 (referencing cli.py/cli_gate, neither of which
  exists on this branch) to keep an eventual add/add merge to one hunk.
  Rewritten for the route/server half; the merge cost (a one-paragraph
  resolution instead of a clean add/add on that paragraph) is disclosed in
  the PR body.
* conftest.py's SERVE_SURFACE_MODULES/NO_IMPLICIT_PUSH_MODULES banner said
  "four files" where the tuple now has seven entries; corrected. Added a
  comment explaining why profile_openxfactory.py (also new, also read by
  build_server) is deliberately excluded from both tuples: it is
  relative-import-only by design, so the D12 relative-import guard would
  fail on it for a reason it does not exist to catch.
* Disclosed an undisclosed test addition (test_route_extension.py's
  test_a_caller_s_extensions_are_added_to_the_profile_and_never_replace_it)
  and corrected "No behavioural test was modified" to name the one
  behavioural comparator repoint (row 5) it was asserted alongside.
* Catch-up merge: origin/feat/split-2-4-pr2-opendox-columns advanced to
  ca61cf1 ("Exclude dunders by rule...") after this branch's original
  push, rewriting the same test function this PR also rewrites. Took a
  real merge and resolved the one conflict keeping BOTH the base's
  rule-based _non_dunder exclusion and this PR's five-mixin sweep,
  disclosed in the PR body in place of the stale "base is an ancestor"
  claim.
* Added test_an_exact_caller_binding_under_a_contributed_prefix_wins_the_match
  to test_route_extension.py, pinning (as a disclosed characterization,
  not a fix) that collect_bindings accepts an exact caller binding whose
  pattern sits inside an already-declared contributed PREFIX binding and
  lets it win the match. The structural remedy is in scripts/route_extension.py,
  which this lane must not touch; raised in the PR body's Decisions for
  Brett instead.

python3 -m pytest -q tests/ideation-dashboard tests/doc-health:
1 failed (known environmental test_find_validator_locates_pinned_checkout),
6635 passed, 31 skipped, 783s.
OPENSPEC_TELEMETRY=0 openspec validate --all --strict: 97 passed, 1 failed
(known disposition-codexfactory-declared-renames artifact).

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UyynFBwGMQNeNU8D8qhQBW
Copilot AI review requested due to automatic review settings September 7, 2026 17:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

It introduces a confirmed authorization-bypass path where exact caller bindings can override security-sensitive contributed prefixes (e.g. /actions/gate/) unless collision rules are tightened.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread scripts/ideation_dashboard/serve.py Resolved
…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
Copilot AI review requested due to automatic review settings September 7, 2026 18:42
@brettheap
brettheap changed the base branch from feat/split-2-4-pr2-opendox-columns to main September 7, 2026 18:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Two lane POST handlers can currently return without sending an HTTP response and can raise on non-dict JSON bodies due to missing body-type validation.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

scripts/ideation_dashboard/serve_openxfactory_lanes.py:197

  • _handle_staging_seed returns early when _read_json_body() is None and assumes the parsed JSON is a dict (uses body.get(...)). Since _read_json_body() can return non-dict JSON or None on malformation, this can raise AttributeError and/or result in no HTTP response being sent. Validate the body type and return a consistent 400 invalid_body response.
        body = self._read_json_body()
        if body is None:
            return
        project = str(body.get("project_id") or "").strip()
  • Files reviewed: 12/12 changed files
  • Comments generated: 1
  • Review effort level: Lite

Brett Heap ruled A on 2026-09-07 over Copilot review PRRT_kwDOTAvnrs6f_iG1:
close the precedence gap this PR opened rather than defer it, which authorizes
this lane's one edit to the landed seam scripts/route_extension.py
(subcommand_extension.py stays untouched).

THE GAP. collect_bindings keyed a collision on (method, pattern, is_prefix)
alone, so an EXACT binding was never compared against an already-declared
PREFIX binding's pattern. Before § 2.4 PR 3 moved the gate console off
serve.py's fixed do_POST table this was unreachable — no caller-suppliable
binding stood a chance against a hard-coded `if`. Once ACTIONS_GATE_PREFIX and
SOURCE_PREFIX became CONTRIBUTED prefix bindings, a caller passing
route_extensions could declare an exact binding under one, the build accepted
it, and — because exact is consulted before prefix — it won the match, so
_handle_gate_action and its loopback/capability/actor/human-console refusals
never ran for that path. Demonstrated live at this branch's head.

THE REFUSAL. collect_bindings now refuses ANY pattern that sits under an
already-declared prefix pattern (str.startswith — RouteBinding.matches's own
test), in EITHER declaration order, with the same RouteBindingError a literal
duplicate raises; the message names both bindings by their own declared method
and pattern, as _collision_message already does. Method-aware on the same slot
rule the duplicate check uses, reused rather than restated
(_claimed_collision_keys -> _claimed_methods): POST-exact under POST-prefix
collides, a GET and a HEAD binding collide because a GET binding answers HEAD,
and a GET exact under a POST prefix does not — no live request is offered to
both. The check runs AFTER the exact-key check so a literal duplicate keeps
reporting itself as a duplicate.

NESTED PREFIXES: REFUSED, decided on evidence as the ruling directs. The
in-tree profile declares exactly two prefixes, POST /actions/gate/ and GET
/source/, and neither sits under the other, so nothing legitimate needs the
case — while which of two nested prefixes answered a path they both cover
would be settled by the assembly order this module refuses to depend on. Fail
closed.

STILL LEGAL, and the profile still builds: an exact pattern EQUAL to a prefix
minus its trailing slash is not under it ("/source".startswith("/source/") is
False, and no request path reaches both), which is exactly what the projection
column declares. Asserted directly and by the nine-binding profile pin.

Tests. test_an_exact_caller_binding_under_a_contributed_prefix_wins_the_match
is FLIPPED to ..._refuses_the_build over a real build_server, parametrized
over both contributed prefixes. New: the containment refusal over four
overlapping pairs x both declaration orders, message content included; the
positive control that a prefix of ANOTHER method does not collide; and the
/source-beside-/source/ pair plus the nine in-tree bindings.
test_exact_bindings_are_consulted_before_prefix_bindings is repointed onto the
legal cross-method pair, since the same-method pair it used to build is now
refused. Mutation-proved twice: dropping the refusal turns 10 tests red;
dropping its method-awareness turns 4 red.

Also corrects the false justification above build_server's lazy
`from ideation_dashboard import profile_openxfactory` (Copilot review
PRRT_kwDOTAvnrs6f_iG1): serve.py already imports all three contributed columns
at module scope, because they are DashboardHandler's mixin bases, so the
profile import pulls in nothing new. What must stay out of a module the
container runs as a plain script is cli_gate, and that is held out at the
profile's own end, which resolves SUBCOMMAND_EXTENSIONS on access (PEP 562).

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q8CkMMAdcUZCqAUTgNjsPy
Copilot AI review requested due to automatic review settings September 7, 2026 19:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It changes core server routing composition and introduces new build-time route-collision semantics for security-sensitive prefixes, warranting a final human review despite strong test coverage.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

tests/ideation-dashboard/conftest.py:228

  • serve_surface_paths()'s docstring says it returns "Every file the dashboard serve is made of", but this helper intentionally excludes profile_openxfactory.py (per the comment immediately above). Updating the docstring avoids misleading future readers about what is (and isn't) being scanned.
  • Files reviewed: 13/13 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

brettheap added a commit that referenced this pull request Sep 7, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants