Skip to content

§ 3.4 S3: the view registry — ViewBinding + collectViewBindings on the § 2.4/§ 4.3 seams, one view wired - #14

Merged
brettheap merged 11 commits into
mainfrom
build/s3-view-registry
Sep 12, 2026
Merged

brettheap merged 11 commits into
mainfrom
build/s3-view-registry

Conversation

@brettheap

@brettheap brettheap commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-4-opendox-extraction

Refs opensoft/openXfactory#656

The ruling. § 3.4's five open questions were RULED at #656 comment
5642758731
(Brett Heap, 2026-09-12), same sitting: "START S1–S3 NOW, with the note
amended to carry these rulings."
S3 is the view registry, claimed in that same
comment. The note is openDox-spec docs/front-end-package-boundary.md (main
a44ac06d; the amendment carrying the rulings is openDox-spec #9).


The design

§ 4.1 asks for the front-end analogue of route_extension.collect_bindings, and
this is it — the AUTHORITY in Python, its MIRROR in the language the shell is
written in, and one vocabulary held across both by a drift test.

Python side, already ruled and built this slice's front-end twin
route_extension.RouteBinding ViewBinding
route_extension.collect_bindings collect_view_bindings / collectViewBindings
consumer_reach.route_column resolveView / requireView / lookupView
profile_proxy.profile_openxfactory host_view_extensions (the VIEW_EXTENSIONS facet)

The registry API

src/opendox/view_extension.py — the authority (578 lines):

symbol lines what it is
VIEW_CLASSES :120 § 2.1's three destination classes plus the transitional ?
REGIONS :163–178 the shell's declared mount points — nine dom, three shell
PROFILE_FACET :182 "VIEW_EXTENSIONS", beside ROUTE_EXTENSIONS on the ONE profile
ViewBindingError :205 one refusal class, RouteBindingError's reasoning
ViewBinding :216–332 frozen, validated in __post_init__; .slot = (region, id); .as_manifest_entry()
ViewExtension :343–361 a runtime_checkable Protocol, never an ABC
collect_view_bindings :421–475 the four refusals, one flat mount order
dom_regions :478 the regions index.html itself declares
host_view_extensions :488–533 the facet off the lazy proxy; two absences, two answers
view_manifest :536–578 the JSON the client reads; schema_version + kind + the NAMED absence

src/opendox/web/views/view_extension.js — the mirror (387 lines):
VIEW_CLASSES :54, REGIONS :69–83, ViewBindingError :99, viewBinding()
:119–192, collectViewBindings() :233–276, contributedViewBindings()
:292–313, manifestRoutes() :318, lookupView() :328, requireView() :340,
resolveView() :360–375, regionHost() :381–387.

Four refusals, and why each one

  • A non-conforming extension, and a views() yielding anything but a
    binding. Structural conformance, never nominal — RouteExtension's reason: a
    binding authored in the column that PINS openDox must conform without
    importing anything from here, or the seam becomes the dependency it was drawn
    to remove.
  • Two bindings claiming one (region, id) slot. collect_bindings' refusal
    one tier out: "a declared route silently unreachable" becomes "a declared
    panel silently unmounted"
    , and the message names both modules.
  • A non-class-B binding declaring a route another column contributed —
    RULED Q3 made executable: "a route constant travels with the binding that
    calls it, never with the model that declares it."
    Class B is exempt BY
    CONSTRUCTION (§ 4.5 assertion 2: a gate-loop binding naming a gate route is
    the boundary working); class A, class C and the transitional ? are in
    scope. Ownership is read from the RouteBindings another column actually
    CONTRIBUTED, never from a literal table here — a table would be a second copy
    of the routing that drifts the moment a column adds a route.
  • A module specifier that is not bundle-relative. § 4.4's vendor policy is
    "no CDN, no external font, no remote script", and a contributed binding is
    exactly the hole that policy would leak through.

Order is declaration order, flat — and the divergence from collect_bindings
is argued, not inherited: that function puts exact before prefix because an HTTP
dispatcher consults its table until something matches; a panel mounts into the
ONE region it names, and two panels in one region are a refused collision rather
than a race.

The absence semantics (§ 4.2 / § 4.3)

situation answer why
no host registered at all REFUSES — ProfileNotRegistered passes through untouched ASK-2's "refusal, not a default"
host registered, no VIEW_EXTENSIONS facet empty consumer column ProfileFacetMissing subclasses AttributeError so getattr(…, default) answers; a shell with no contributed PANELS is the shell this leg ships today, and refusing would impose a flag day on every host that has not grown the facet — which is every host
absent /capabilities manifest (static image) empty column the same fact from the client's side
malformed manifest REFUSES failing closed is the only safe answer for a payload that decides which code the shell imports
an absent OPTIONAL binding null from lookupView / resolveView consumer_reach's posture: the reach is LATE, NAMED, and the caller decides what absence means
an absent REQUIRED binding REFUSES, naming the layering not a blank panel

And the absence is NAMED, never silent: view_manifest carries
host_facet = "declared" / "absent" with the facet and profile names, which
is § 4.3 point 5's "renders its region empty with a named reason" applied to a
facet rather than to a profile.


The view wired end to end

The DOC LIST — docs.list → region view-docs → ./views/docs.js /
renderDocs, class A. Wired in both directions and proven both ways:

  • through the core arm, mounted by the tab router out of the collected
    registry (test_app_js_wires_the_doc_list_through_the_registry);
  • through the contributed arm, where resolveView loads the REAL
    views/docs.js from a binding read out of a /capabilities manifest and
    hands back its renderDocs export, under node
    (test_js_resolves_the_real_doc_list_module_from_its_binding), and a
    contributed panel mounts into its region under a minimal DOM
    (test_js_mounts_a_contributed_panel_into_its_region).

The gate bar is the second proof, of the opposite property. app.js's line
43 — the shell's ONE direct import of a class-B module — is now the gate.bar
binding: class B, optional: true, declaring /actions/gate/ratify as its own.
A shell assembled without it renders the viewer with no gate bar instead of
failing to load, because views/viewer.js already tolerates a null mountGate
(const mountGate = o.mountGate || null) — the absence was always representable
downstream and was simply unreachable from here, so no second file is touched.
That is § 4.1's sentence realized: "a shell built with no gate binding
registered renders the tab strip WITHOUT the gate bar rather than failing to
load."

Nothing is contributed yet, so the shell renders exactly as today with an
empty extension tuple — the note's own S3 row.


Q-L1

src/opendox/web/app.js is an ARRIVED file (a moved_verbatim row of
openxFactory's docs/opendox-carve-manifest.yaml). Its 37 edited lines are
declared
by openxFactory PR
#1001
, which lands
FIRST: one import rewrites line (43) and 36 adapter calls lines. The row
converts moved_verbatim → moved_with_declared_edit; no referent digest
moves.

verify-carve-arrival.py's own _check_declared_lines over all 123
opendox_code rows against this branch:

src/opendox/web/app.js                     DECLARED
tests/test_bullseye_widget.py              DECLARED
60 moved_verbatim rows                     byte-identical
REFUSALS                                   0

…and the declaration is minimal — all 37 app.js lines touched, none spare;
the three bullseye lines are single-line replaces with no insertion, so no
neighbour is declared either.

A second arrived file turns out to be edited by this slice and is declared
on the same PR: tests/test_bullseye_widget.py asserts app.js's shape by
QUOTING ITS LINES BACK, so three of its quotations name the tab router's field
before the rename (:900, :1781, :1785). They are migrated .view →
.region in the act that invalidated them — the only time anyone can be sure
the migration is a rename and not a behaviour change — and declared as three
adapter calls lines on a row that already carried an edit. That suite is red
today for an unrelated reason (it imports through serve.py, which still
reaches the carved-away ideation_dashboard) and is not in validate's list;
neither fact makes a stale assertion acceptable, because S8 re-homes it. A
diff of every app.js quotation in the leg against base and head found
exactly three newly invalidated, all of them these.

tests/test_consumer_reach.py is leg-assembled, not arrived (created at
da8aae9; it has no manifest row), so its census edit needs no annotation.
The two registry files are created, not arrived — Q-L1's "new files are
created, not arrived".

index.html is NOT touched. A data-region attribute would have been a
second spelling of an id the shell already carries, and an added attribute is in
NONE of the RULED edit_classes (import rewrites | path constants | adapter calls) — declaring it would have meant inventing an edit class rather
than using one. The region contract is held by the registry's own REGIONS
table plus a drift test against the shell's existing ids, and the row stays
moved_verbatim, byte-identical.


Tests

tests/test_view_registry.py, 67 tests, added to validate's explicit
--noconftest list in the SAME commit — the discipline § 4.5 states and the one
its three neighbours already keep.

group what it holds
malformed bindings every field, parametrized, each refusing where it is DECLARED
collection non-conforming extension · slot collision naming both modules · one id in two regions is not a collision · the core arm through an empty column · collecting nothing is an empty tuple, not a refusal
RULED Q3 a class-A binding declaring a gate route is REFUSED · class C and ? in scope · a class-B binding declaring the same route is allowed · nothing to breach with no contributed routes
the host facet the facet off the ONE profile · no facet = empty column · no host = refusal · importing the registry resolves no profile · the manifest names its absence
drift the two halves declare the same regions in the same order and the same classes · every dom region is an element index.html carries · no shell region pretends to have one · app.js no longer imports the gate module · no control byte in either file
under node eight assertions driving the REAL views/view_extension.js, skipped and never failed where node is absent

A real defect, kept as a test rather than a memory. The client's slot key
joins region and id with a separator neither can contain, and it was first
written as a literal NUL byte in the source. Everything parsed and every
other assertion passed — but git, grep, file(1) and every diff viewer
classify a file containing a NUL as binary, so the module would have reached
review as an unreadable blob. Fixed to the escape sequence, and
test_neither_half_carries_a_control_character_a_separator_needs_escaped reads
BYTES, because reading the file as text is exactly what hides it.

Three review findings, all accepted

Copilot's review found three real defects and each is fixed with a test
(2c75f5b):

  1. A refusal that raised instead. REGIONS is a dict, so
    <unhashable> not in REGIONS raised TypeError out of the hash before
    __post_init__ could raise the ViewBindingError this module promises for
    every declaration defect. The type is now checked before the membership, on
    region and view_class both — a seam whose refusal depends on the TYPE of
    what it refuses is not a seam.
  2. A payload that could inject a tab. contributedViewBindings passed
    manifest entries straight to viewBinding, which preserved mount and
    control. control is what makes a binding a TAB, and a contributed entry
    cannot carry the mount FUNCTION the tab router calls — so a manifest
    declaring a control put an entry in the strip whose mount is undefined,
    and the click that selected it threw. Now refused where the payload is READ,
    not stripped: stripping turns a manifest defect into a panel that silently
    never appears, which is what this seam's collision refusal exists to prevent.
  3. An entry that could not be called. resolveView checked only that the
    entry NAME existed, so a module exporting it as a string or a null handed
    back a binding that looked resolved and threw a raw TypeError from inside
    the mount — the dangling-import failure mode this seam replaces. The entry
    must now be a function, and the refusal distinguishes "not exported" from
    "exported as something that cannot be called".

Local run of validate's exact command: 149 passed, 3 xfailed
(test_view_registry.py is 67).


What the later slices touch

slice files this PR's relationship to it
S4 lens-model.js, repo-selector.js, staging-workbench-model.js splits the three RULED SPLIT files so the 10 gate-route constants stop living outside class B. The precondition for S5. This PR's Q3 refusal is what makes their split checkable. routes is deliberately undeclared on every core TAB binding so that S4's answers are not encoded before S4 has done its work.
S5 dispose.js, gate.js, swb-create.js, swb-session.js + serve.py contributes the gate loop. The gate.bar entry in CORE_VIEWS is transitional: S5 deletes it and the identical binding arrives through contributedViewBindings() with nothing else in app.js changing. The server hop is ONE line — capabilities["views"] = view_manifest(…) — inside serve.py's own declared-edit window, which the in-flight ASK-7 act owns; the client already reads caps.views and is tested against a stub payload.
S6 serve_projection.py, serve.py, viewer.js, wheel.js re-homes /source/ per RULED Q4. Untouched here.
S7 the 14 class-C files + three class-A tails + styles.css parameterizes class C off the profile's display facet. This PR adds the context key (views) the same hop will travel on.
S8 48 test files re-homes the suites and un-narrows validate. This PR adds one file to the narrowed list, in the ruled way.

How S2 folds in

S2 (in flight) and S3 do not touch the same files — S2 edits dispose.js,
wheel.js and styles.css; S3 edits app.js and adds two new files.

The fold-in is already provided for: wheel-intent and dispose-intent are
declared shell regions in REGIONS now
, in both halves. Declaring a region
costs nothing and refuses nothing; an UNDECLARED one costs a slice. So when S2's
optional intent-chip binding is contributed, it names a region that already
exists, and the two call sites read it with lookupView(ctx.views, "…") →
null when the column that supplies it is not installed — which is exactly
RULED Q5: "the chips become an OPTIONAL contributed binding; absent, the wheel
and the dispose tray render without them."
ViewBinding.optional is that
ruling made a field. Nothing in this PR needs re-opening when S2 lands; the
landing order is S1 → S2 → S3, the lane merging main into each before landing.


The lane lands this PR — after openxFactory #1001, per Q-L1. This branch
does not merge itself.

🤖 Generated with Claude Code

Summary by Sourcery

Introduce a shared front-end view registry and wire core and contributed panels through it, allowing optional views to be absent safely while enforcing consistent ownership and mounting contracts.

New Features:

  • Add a Python and JavaScript view registry with validated bindings, extension collection, collision detection, route-ownership checks, manifest generation, and late module resolution.
  • Wire the core tab views, document list, and optional gate bar through the registry while supporting contributed views from the capabilities manifest.
  • Define explicit view-region and class vocabularies shared across the Python and JavaScript implementations.

Bug Fixes:

  • Prevent malformed extensions, manifests, module imports, and non-callable exports from producing raw runtime errors or silently disabling registry checks.
  • Remove the shell's direct gate-module import so installations without a gate binding can render without the gate bar instead of failing to load.

Enhancements:

  • Add named absence semantics for missing host view facets and optional or required view bindings.
  • Add drift checks ensuring the registry halves, shell regions, and class declarations remain consistent.

Build:

  • Add an explicit root Node package configuration declaring the web sources as ES modules.

CI:

  • Run the view-registry test suite in the validation workflow alongside the existing boundary tests.

Tests:

  • Add comprehensive Python and Node coverage for binding validation, collection, collisions, route ownership, manifest handling, host facets, module resolution, and contributed-panel mounting.
  • Update boundary and application-shape tests for registry-based tab and document-list wiring.

Chores:

  • Update the web boundary census and ownership/import accounting for the new registry and transitional gate binding.

brettheap and others added 3 commits September 11, 2026 23:01
… halves of one seam

openDox-spec `docs/front-end-package-boundary.md` § 4.1 asks for the front-end
analogue of `route_extension.collect_bindings`, and this is it — the AUTHORITY
in Python, its MIRROR in the language the shell is written in, and one
vocabulary held across both.

THE PROBLEM, in the note's own measurement: `src/opendox/web/` is "42 blobs,
30,585 lines, and NO package boundary at all", while the Python side has
answered the same question three times — a contributed ROUTE
(`route_extension`), a late REACH into the consumer (`consumer_reach`), and a
registered PROFILE (`domain_profile` + `profile_proxy`). § 4.1's instruction is
to reuse those shapes rather than invent a fourth, so:

    route_extension.RouteBinding      ->  ViewBinding
    route_extension.collect_bindings  ->  collect_view_bindings
    consumer_reach.route_column       ->  resolveView / requireView
    profile_proxy.profile_openxfactory -> host_view_extensions

`src/opendox/view_extension.py` is the authority. `ViewBinding` is frozen and
validated where it is CONSTRUCTED, `RouteBinding.__post_init__`'s discipline;
`ViewExtension` is a `runtime_checkable` Protocol and NOT an ABC, for
`RouteExtension`'s reason — an extension authored in the repository that PINS
this one must conform WITHOUT inheriting from anything here, since nominal
conformance would make the seam the dependency it was drawn to remove.
`collect_view_bindings()` flattens contributed bindings into ONE mount order and
refuses four things: a non-conforming extension, a `views()` that yields
anything else, two bindings claiming one (region, id) slot, and a non-class-B
binding declaring a route another column contributed.

THE FOURTH REFUSAL IS RULED Q3 MADE EXECUTABLE (#656 comment 5642758731): "a
route constant travels with the binding that calls it, never with the model that
declares it". It is derived from the assembly rather than asserted about it — the
caller passes the `RouteBinding`s another column actually CONTRIBUTED, because a
literal ownership table here would be a second copy of the routing that drifts
the moment a column adds a route. Class B is exempt BY CONSTRUCTION: a gate-loop
binding naming a gate route is the boundary working (§ 4.5 assertion 2).

ORDER IS DECLARATION ORDER, FLAT, and the difference from `collect_bindings` is
argued rather than inherited: that function re-orders exact before prefix
because an HTTP dispatcher consults its table until something matches. Nothing
here is consulted that way — a panel mounts into the ONE region it names, and
two panels in one region are a refused collision rather than a race — so
re-ordering would only take away the one thing declaration order is good for.

THE HOST FACET, AND TWO ABSENCES WITH TWO ANSWERS. `host_view_extensions()`
reads `VIEW_EXTENSIONS` off the ONE registered profile through the SAME lazy
proxy `build_server()` reads `ROUTE_EXTENSIONS` through (RULED ASK-2 option (2)).
NO HOST AT ALL REFUSES: `ProfileNotRegistered` is a `RuntimeError` and passes
through untouched, which is ASK-2's "refusal, not a default". A HOST WITHOUT THE
FACET gets an EMPTY CONSUMER COLUMN: `ProfileFacetMissing` subclasses
`AttributeError` precisely so `getattr(..., default)` answers, and the empty
answer is correct where an empty `ROUTE_EXTENSIONS` would be a defect — a server
missing its contributed ROUTES looks fine until a path 404s, whereas a shell
with no contributed PANELS is the shell this leg ships today. Refusing there
would impose a flag day on every host that has not yet grown the facet, which is
every host, today. AND THE ABSENCE IS NAMED, NEVER SILENT: `view_manifest()`
carries `host_facet` = "declared" | "absent" with the facet and profile names,
which is § 4.3 point 5's "renders its region empty WITH A NAMED REASON" applied
to a facet.

`src/opendox/web/views/view_extension.js` is the mirror, named by the note's own
S3 row (every other module in that folder is kebab-case; this one is spelled
like the two Python files it mirrors, because three files and one seam should
have one spelling). It reads the manifest back out of `/capabilities` and
applies the SAME four refusals to it, so both halves check the same thing
against the same facts. `lookupView` is the OPTIONAL reach (null, and the caller
decides what absence means); `requireView` is the REQUIRED one (a refusal that
names the layering, `consumer_reach`'s posture); `resolveView` loads the
binding's module at first use and refuses a binding whose named export is
missing, because a binding that cannot be mounted must not look registered.
A malformed manifest REFUSES while an absent one is an empty column: failing
closed is the only safe answer for a payload that decides which code the shell
imports, and § 4.4's vendor policy is why the module specifier is held to a
bundle-relative './…js' — a contributed binding is exactly the hole "no CDN, no
remote script" would otherwise leak through.

BOTH FILES ARE CREATED, NOT ARRIVED: neither has a row in openxFactory's
`docs/opendox-carve-manifest.yaml`, which is what Q-L1 means by "new files are
created, not arrived". The census row in `tests/test_consumer_reach.py` lands in
this same commit because it is a claim about this module — `opendox.view_extension`
imports NOTHING from `openxdox` and reads the host's facet through the proxy, so
it belongs in `NEUTRAL_MODULES` and not in `STILL_REACHING`, and the lawful
direction is that the column CONTRIBUTING a view imports this module rather than
the other way round.

Lane: openxfactory-4-opendox-extraction
Refs opensoft/openXfactory#656

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… a registry lookup

§ 4.1 names this edit by line number: "app.js stops importing class-B modules
directly. Its line 43 becomes a lookup in the collected bindings, and a shell
built with no gate binding registered renders the tab strip WITHOUT the gate bar
rather than failing to load." That is what this commit does, and nothing else.

THE HARDCODED `TABS` TABLE BECOMES THE CORE ARM OF THE REGISTRY. `CORE_VIEWS`
holds the same seven views as `ViewBinding`s and is collected through
`collectViewBindings()` alongside whatever the consumer column contributed —
the same order and the same SINGLE collection `serve.build_server()` uses for
routes, and for the same reason: a collision between a contributed panel and one
of the shell's own must be refused before anything mounts, rather than
discovered as a panel that silently never rendered. A core binding declares its
`module` and `entry` truthfully even though it also carries a `mount` closure,
because a CONTRIBUTED binding carries only those two and is loaded through
`resolveView()` — the core arm always holds its own view modules statically,
since they are the product.

THE TAB STRIP IS DERIVED FROM THE REGISTRY, not declared beside it. A tab is
simply a binding that declared a `control`; a binding with no control — the gate
bar, and every overlay binding after it — is in the collected order and is not a
tab, which is why the filter is one expression in `initTabs` and not a second
list to keep in step.

THE GATE BAR IS A BINDING NOW: class B, `optional: true`, declaring
`/actions/gate/ratify` as RULED Q3's "a route constant travels with the binding
that calls it". Three things are true that were not true before. A shell
assembled without it renders the viewer with NO GATE BAR instead of failing to
load — `views/viewer.js` already tolerates a null `mountGate`
(`const mountGate = o.mountGate || null`), so the absence was always
representable downstream and was simply unreachable from here, and no second
file is touched. `gate.js`:120's route says in one checkable place whose it is.
And the entry sits in the CORE arm TRANSITIONALLY: slice S5 moves the four
class-B files behind a binding openXdox supplies, at which point this entry is
deleted and the identical binding arrives through `contributedViewBindings()`
with nothing else in this file changing — which is the test of whether the seam
was drawn in the right place.

`routes` IS DELIBERATELY UNDECLARED ON EVERY CORE TAB BINDING and that is not an
omission. Q3 makes `routes` a declaration of OWNERSHIP, not a transitive
inventory of every path a module's import graph happens to touch. Exactly one
core binding owns a route that way today: `gate.bar`. The census's eighteen
remaining route-ownership breaches are FILE-level facts (§ 4.5 assertion 2),
measured by slice S1's `tests/test_web_boundary.py` and cleared by S4 and S6;
declaring them here would encode S4's answers before S4 has done its work, and
would refuse this very assembly, since `/source/` is a contributed prefix today.

THE COLLECTED REGISTRY IS HANDED TO EVERY VIEW as the context key `views`, so an
OPTIONAL contributed panel is asked for by id — `lookupView(ctx.views, "…")`,
null when the column that supplies it is not installed. Slice S2's intent chips
are the first such reader: `wheel-intent` and `dispose-intent` are declared
regions already, so S2 adds an optional binding and two `lookupView` calls and
touches nothing here.

The consumer column is read out of the `/capabilities` payload this render
already fetched (§ 4.3's "no new route and no second fetch"). It is EMPTY at
this slice and on every static image, so the shell renders exactly as it did
before — the note's S3 row in its own words: "nothing is contributed yet, so the
shell renders exactly as today with an empty extension tuple". The server-side
line that publishes a manifest (`capabilities["views"] = view_manifest(...)`) is
slice S5's, inside `serve.py`'s own declared-edit window, which the in-flight
ASK-7 act owns this hour.

`index.html` IS NOT TOUCHED. A `data-region` attribute would be a second
spelling of an id the shell already carries, and an added attribute is in none
of the RULED `edit_classes` (`import rewrites | path constants | adapter calls`),
so declaring it would mean inventing an edit class rather than using one. The id
is the declaration; the registry's `REGIONS` table plus a drift test against the
shell's existing ids is what makes it a contract.

Q-L1: `src/opendox/web/app.js` is an ARRIVED file. Its 37 edited lines are
declared on its row of openxFactory's `docs/opendox-carve-manifest.yaml` by
openxFactory PR #1001, which lands FIRST — one `import rewrites` line (43) and
36 `adapter calls` lines. `verify-carve-arrival.py`'s `_check_declared_lines`
over all 123 `opendox_code` rows against this branch: app.js DECLARED, 60
verbatim rows byte-identical, 0 refusals.

Lane: openxfactory-4-opendox-extraction
Refs opensoft/openXfactory#656

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ommit

50 assertions over the seam, and the file is added to `validate`'s explicit
`--noconftest` list in THIS commit rather than a later one — the discipline
§ 4.5 states for slice S1 ("added to that list in the SAME commit") and the one
its three neighbours already keep: `test_leg_shape.py`, `test_consumer_reach.py`
and `test_profile_registration.py` each arrived that way. A test that is not in
the list is not run, and a seam nobody runs is a description.

WHAT IS ASSERTED, in six groups.

1. A malformed binding refuses WHERE IT IS DECLARED and the message says why —
   parametrized over every field: the id grammar, an undeclared region, a module
   specifier that is root-relative / absolute / climbs out of the bundle with
   `..`, an entry that is a callable rather than the NAME of an export, an
   unknown class, non-tuple routes, a route not rooted at '/'.
2. Collection: a non-conforming extension names the member it lacks; two
   bindings in one (region, id) slot refuse and the message names BOTH modules;
   one id in two different regions is NOT a collision; the core arm comes
   through an EMPTY consumer column unchanged; and collecting nothing at all is
   an empty tuple rather than a refusal, which is this slice's own case and
   every static image's.
3. RULED Q3, executable: a class-A binding declaring a gate route another column
   contributed is REFUSED, and the refusal quotes the rule. Class C and the
   transitional `?` are in scope too (§ 4.5 assertion 2's "class A, class C AND
   the transitional `?`, which is where most of the breaches actually sit"); a
   class-B binding declaring the SAME route is allowed, because a gate-loop
   binding naming a gate route is the boundary working. With no contributed
   routes nothing can breach — there is nothing to breach.
4. The host facet through the ONE registered profile: the facet comes off it; a
   host WITHOUT the facet contributes an empty column; NO host at all REFUSES
   rather than answering empty (ASK-2's "refusal, not a default"); and importing
   the registry resolves no profile at all, which is the whole value of the lazy
   proxy. The manifest declares its `schema_version` and `kind` and NAMES the
   absence rather than being silent about it.
5. Drift, so the two halves cannot diverge: both declare the same regions in the
   same order and the same classes; every "dom" region is an element
   `index.html` actually carries (the id IS the declaration — this is what makes
   the unedited shell a contract rather than an assumption); no "shell" region
   pretends to have one; every core tab binding names a dom region, or it would
   be a blank tab; `app.js` no longer imports the gate module, declares the gate
   bar as an OPTIONAL class-B binding, and wires the doc list through the
   registry.
6. The JavaScript half driven by the REAL file under `node`, skipped and never
   failed where node is absent: the core arm collects with an empty consumer
   column; a slot collision and a contributed gate route both refuse; a
   malformed `/capabilities` manifest refuses while an absent one is an empty
   column; ONE VIEW WIRED END TO END — `resolveView` loads the real
   `views/docs.js` from its binding and hands back the `renderDocs` export; a
   contributed panel mounts into its region under a minimal DOM; an absent
   OPTIONAL binding is null and an absent REQUIRED one refuses; and a "shell"
   region asked for a standing element refuses rather than returning a null the
   caller would read as "the column is not installed".

One of the drift assertions is a REAL DEFECT kept as a test rather than a
memory: the client's slot key joins a binding's region and id with a separator
neither can contain, and that separator was first written as a LITERAL NUL BYTE
in the source instead of as the six-character escape sequence a JavaScript
string literal spells it with. Everything parsed and every
other assertion passed — but `git`, `grep`, `file(1)` and every diff viewer
classify a file containing a NUL as BINARY, so the module would have reached
review as an unreadable blob. A separator that cannot occur in a region or an id
is right; spelling it as a raw byte is not. The check reads BYTES, because
reading the file as text is exactly what hides it.

Lane: openxfactory-4-opendox-extraction
Refs opensoft/openXfactory#656

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 12, 2026 03:04
@sourcery-ai

sourcery-ai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implements the S3 front-end view registry as a Python authority and JavaScript mirror, then wires the shell's core views and optional gate bar through the collected registry while preserving empty-column behavior and validating the seam with Python, Node, drift, and end-to-end tests.

Sequence diagram for collecting and resolving a view binding

sequenceDiagram
    participant App as app.js
    participant Registry as view_extension.js
    participant Caps as capabilities payload
    participant Module as View module

    App->>Caps: read probed capabilities
    App->>Registry: contributedViewBindings(caps)
    Registry-->>App: consumer bindings or empty array
    App->>Registry: collectViewBindings(core and consumer bindings)
    alt binding collision or invalid declaration
        Registry-->>App: ViewBindingError
    else valid registry
        Registry-->>App: collected views
        App->>Registry: resolveView(views, gate.bar)
        alt optional binding absent
            Registry-->>App: null
            App->>App: render without gate bar
        else binding present
            Registry->>Module: import binding.module
            Module-->>Registry: binding.entry export
            Registry-->>App: resolved module exports
        end
    end
Loading

Flow diagram for optional and required view lookup

flowchart TD
    Start[Lookup view binding] --> Found{Binding registered?}
    Found -->|yes| Load[resolveView loads module export]
    Found -->|no| Optional{Binding optional?}
    Optional -->|yes| Null[lookupView returns null]
    Optional -->|no| Refuse[requireView refuses with layering error]
    Load --> Mount[Shell mounts resolved view]
Loading

File-Level Changes

Change Details Files
Introduces the Python authority for the front-end view-extension seam, including immutable binding validation, structural extension collection, route-ownership enforcement, host-facet handling, and manifest generation.
  • Adds validated ViewBinding and ViewExtension abstractions.
  • Rejects malformed bindings, non-conforming extensions, slot collisions, and unauthorized route declarations.
  • Defines shared view classes, DOM/shell regions, absence semantics, and JSON manifest metadata.
  • Reads VIEW_EXTENSIONS from the lazy profile proxy without importing or resolving a host at module import time.
src/opendox/view_extension.py
Adds the JavaScript mirror and integrates registry-driven view assembly into the shell.
  • Mirrors binding validation, collection order, collision/Q3 route checks, manifest parsing, optional/required lookup, deferred module resolution, and region-host handling.
  • Replaces the hardcoded tab table with core registry bindings and derives tabs from bindings.
  • Removes the direct gate-module import and resolves the optional gate.bar binding dynamically.
  • Passes the collected registry through render context and wires the docs view through the registry.
src/opendox/web/views/view_extension.js
src/opendox/web/app.js
Adds comprehensive seam, drift, and end-to-end coverage and runs it in validation.
  • Adds Python tests for binding validation, collection/refusal behavior, Q3 ownership, profile facet absence, manifests, and region drift.
  • Executes JavaScript tests under Node for manifest handling, real docs-module resolution, contributed mounting, optional/required lookup, and shell-region behavior.
  • Adds the registry test module to the workflow's explicit --noconftest validation list.
  • Adds the registry to the consumer-reach import census.
tests/test_view_registry.py
.github/workflows/validate.yml
tests/test_consumer_reach.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical and moderate issues remain in test compatibility, binding validation, contributed-view safety, and capability enforcement.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds a Python-authoritative, JavaScript-mirrored view registry and wires core and optional views through it.

Changes:

  • Adds binding validation, collection, manifests, and view resolution.
  • Refactors tab and gate wiring through the registry.
  • Adds registry tests, import census coverage, and CI integration.
File summaries
File Summary
tests/test_view_registry.py Adds registry, validation, manifest, and integration coverage.
tests/test_consumer_reach.py Updates consumer import census coverage.
src/opendox/web/views/view_extension.js Adds the JavaScript registry mirror and contributed-view resolution.
src/opendox/web/app.js Wires core views and optional gate loading through the registry.
src/opendox/view_extension.py Implements the Python registry authority and binding collection.
.github/workflows/validate.yml Integrates registry tests into validation.
Review details

Suppressed comments (4)

src/opendox/view_extension.py:270

  • The Python authority and JavaScript mirror accept different entry names: str.isidentifier() accepts Unicode identifiers and rejects $, while the client regex accepts only ASCII identifier characters plus $. A host can therefore publish a binding that passes server validation but is refused by the browser; use the same ASCII/$ rule on both halves.
        if not isinstance(self.entry, str) or not self.entry.isidentifier():

src/opendox/view_extension.py:456

  • runtime_checkable protocol checks only that the views attribute exists; an extension with a non-callable views member passes this test and then raises raw TypeError here. Likewise, a conforming-looking views() returning None fails in the for loop rather than as the declared ViewBindingError refusal; validate the callable and iterable result explicitly.
        if not isinstance(extension, ViewExtension):
            raise ViewBindingError(
                f"{extension!r} does not conform to ViewExtension: it must "
                f"declare {list(MEMBERS)}")
        declared = extension.views()

src/opendox/web/views/view_extension.js:322

  • This silently converts a missing or malformed contributed_routes field into an empty list. Because collectViewBindings uses that list for Q3 ownership checks, a manifest can omit the route claims and make a class-A/C binding naming another column's route pass validation; malformed manifests are supposed to fail closed. Validate the field and its route entries before returning it.
export function manifestRoutes(capabilities) {
  const manifest = capabilities && capabilities.views;
  const routes = manifest && manifest.contributed_routes;
  return Array.isArray(routes) ? routes : [];

src/opendox/web/views/view_extension.js:162

  • requires is validated and serialized, but no client path reads it: resolveView imports the module and the app mounts it without checking the declared capability/facet. A contributed binding can therefore declare a requirement that is absent and still be loaded/mounted, contradicting the field's stated contract; enforce the requirements at mount or remove the field until that behavior exists.
  const requires = b.requires === undefined ? [] : b.requires;
  if (!Array.isArray(requires) || requires.some((r) => typeof r !== "string" || !r)) {
    refuse("view binding " + JSON.stringify(b.id) + " declares requires "
      + JSON.stringify(requires) + ": every entry is a capability or facet name");
  • Files reviewed: 6/6 changed files
  • Comments generated: 4
  • Review effort level: Lite

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

Comment thread src/opendox/web/app.js Resolved
Comment thread src/opendox/web/views/view_extension.js Resolved
Comment thread src/opendox/view_extension.py Resolved
Comment thread src/opendox/web/views/view_extension.js Resolved
@brettheap
brettheap marked this pull request as ready for review September 12, 2026 03:15

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 5 days and 22 hours by commenting @sourcery-ai review. Upgrade to get a review now.

…at could inject a tab, an entry that could not be called

Copilot's review of PR #14, all three accepted and each kept as a test.

1. A DECLARATION DEFECT MUST NOT DEPEND ON THE TYPE OF WHAT IT REFUSES.
   `REGIONS` is a dict, so `<unhashable> not in REGIONS` raised `TypeError` out
   of the hash BEFORE `ViewBinding.__post_init__` could raise the
   `ViewBindingError` this module promises for every declaration defect — a
   caller written to catch the one refusal class would have met an exception it
   never agreed to handle. The type is now checked before the membership, on
   `region` and on `view_class` both; the second cannot raise today (a tuple
   membership test does not hash) and is guarded anyway, because relying on
   `VIEW_CLASSES` staying a tuple is exactly the quiet dependency this work
   exists to end.

2. A CONTRIBUTED ENTRY MAY NOT CARRY THE CORE ARM'S OWN TWO FIELDS.
   `contributedViewBindings` passed manifest entries straight to `viewBinding`,
   which accepts and preserves `mount` and `control`. `control` is what makes a
   binding a TAB, and a contributed entry arrives as JSON and cannot carry the
   `mount` FUNCTION the tab router calls — so a manifest declaring a `control`
   would have put an entry in the tab strip whose `mount` is `undefined`: the
   tab renders, and the click that selects it throws. Refused where the payload
   is READ rather than ignored, because ignoring it is a crash with a delay on
   it, and `view_manifest()` emits neither field, so no honest payload is
   refused by this. Malformed REFUSES while absent is an empty column — the
   rule that already governs the rest of the manifest.

3. PRESENT IS NOT MOUNTABLE. `resolveView` checked only that the entry NAME
   existed on the module's namespace, so a module exporting it as a string, an
   object or a `null` handed back a binding that looked resolved and threw a raw
   `TypeError` from inside whatever tried to mount it — the "dangling import a
   thousand lines from the call" this seam exists to replace. The entry must now
   be a function, and the refusal distinguishes "not exported" from "exported as
   something that cannot be called", because those are different defects in the
   contributing column.

Five new assertions, in the groups they belong to: an unhashable `region` (as a
list and as a dict) and an unhashable `view_class` refuse as `ViewBindingError`;
a contributed entry carrying `control` or `mount` refuses while the same entry
without them is collected; and an entry exported as a non-function refuses at
resolution. `tests/test_view_registry.py` is 55 assertions; `validate`'s four
files are 127.

Lane: openxfactory-4-opendox-extraction
Refs opensoft/openXfactory#656

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 12, 2026 03:33
…uter's field names

`tests/test_bullseye_widget.py` asserts `app.js`'s shape by QUOTING ITS LINES
BACK, so the view registry's `view` -> `region` rename invalidates three of its
quotations the moment it lands. They are migrated in the SAME act that
invalidated them, which is the only time anyone can be sure the migration is a
rename and not a behaviour change:

  :900   classList.toggle("lensfull", target.view === "view-lens")
  :1781  storeTab(target.view);
  :1785  const remembered = TABS.find((t) => t.view === storedTab());

`.view` -> `.region` in all three, and nothing else on any line. The assertions'
MEANING is unchanged: the lens still takes the whole page, the tab is still
remembered on every activation, and it is still restored only to a view this
plane actually has. The tab router simply calls the field `region` now, because
a binding's mount point is what that string always was.

THE SUITE IS RED TODAY FOR AN UNRELATED REASON — it imports through
`src/opendox/serve.py`, which still reaches `ideation_dashboard`, a module the
§ 3 carve removed — and it is not in `validate`'s narrowed list. Neither fact
makes a stale assertion acceptable: slice S8 re-homes these 48 test files and
un-narrows `validate`, and an assertion describing a shape that no longer exists
is precisely the rot that slice would then have to discover and date. Copilot
found two of the three on PR #14; a sweep of every assertion in the leg that
quotes `app.js` found the third, and found no others anywhere in the suite.

Q-L1: `tests/test_bullseye_widget.py` is an ARRIVED file, already
`moved_with_declared_edit` for its `path constants` line 40. The three lines are
declared as `adapter calls` on the same row by openxFactory PR #1001 — the same
act that declares `app.js`'s 37 — and each is a single-line REPLACE at the carve
numbering, so exactly three lines are declared and no neighbour is.
`verify-carve-arrival.py`'s `_check_declared_lines` over all 123 `opendox_code`
rows: both rows DECLARED, 60 verbatim rows byte-identical, 0 refusals.

Lane: openxfactory-4-opendox-extraction
Refs opensoft/openXfactory#656

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

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

Unresolved moderate findings affect cross-language validation, malformed input rejection, requirement enforcement, and mount-contract checks.

Review details

Suppressed comments (7)

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

src/opendox/view_extension.py:275

  • ViewBinding is the server-side authority for entry names, but str.isidentifier() is not the JavaScript identifier grammar used by the mirror: it rejects valid exports such as $mount while accepting Unicode names such as é that viewBinding() rejects at line 142. A binding can therefore be valid in one half and refused in the other; use the same ASCII JS-compatible predicate in Python.
    src/opendox/view_extension.py:467
  • Because ViewExtension is checked structurally, an object with a callable views() returning None passes the protocol check and then line 467 raises a raw TypeError instead of the module's promised ViewBindingError for malformed extensions. Validate the declared container before iterating, as the JavaScript mirror does for arrays.
    src/opendox/web/app.js:598
  • requires is declared as a client-side mount prerequisite, but no client path reads it: the registry only copies the field and resolveView()/app.js never check the capabilities or facets it names. Thus gate.bar (and any contributed binding) is still resolved and mounted when actions.gate is absent, so the new dependency field has no effect. Enforce requirements before mounting, or defer exposing this field until the resolver has a context-aware implementation.
    src/opendox/web/views/view_extension.js:343
  • A malformed contributed_routes section is silently converted to an empty route set here. In app.js that result is passed to collectViewBindings(), so a class-A/C binding can declare a route owned by another column and bypass Q3 whenever the manifest has a non-array or malformed route list. Since malformed manifests are meant to refuse, validate the route array and each route entry at manifest ingestion instead of treating invalid data as no contributed routes.

src/opendox/web/app.js:940

  • The binding contract validates only entry (mountGateBar), but this call also assumes the dynamically loaded namespace exports isGateBearing. A contributed gate.bar can therefore pass collection and resolution, then throw a raw TypeError whenever a proposal is opened if it omits that undeclared helper. Make the predicate an explicit validated part of the binding or keep this decision in the core arm.
    const gateContext = (tile, entry, key) =>
      tile?.kind === "proposal" && gateView
        && gateView.exports.isGateBearing(entry.path) && key
        ? { changeId: tile.id, repository: key.repository }

src/opendox/web/views/view_extension.js:177

  • control marks a tab, and app.js:initTabs() calls target.mount(...) for every binding with a control. This validator only checks the control's type, so a malformed core binding with a valid control but no mount is accepted and crashes the shell on initial tab activation; reject that field combination here (contributed manifests are already prohibited from carrying both).
  if (b.control !== undefined && typeof b.control !== "string") {
    refuse("view binding " + JSON.stringify(b.id) + " declares a control that "
      + "is not an element id");
  }

src/opendox/web/views/view_extension.js:298

  • A non-null malformed /capabilities response such as JSON [] or a string is treated as an absent manifest: property access produces undefined, so this returns [] instead of refusing. That silently skips contributed modules and the route-ownership checks even though malformed manifest data is supposed to fail closed; reject non-object capabilities before reading views.
export function contributedViewBindings(capabilities) {
  const manifest = capabilities && capabilities.views;
  if (manifest === undefined || manifest === null) return [];
  if (typeof manifest !== "object" || Array.isArray(manifest)) {
    refuse("the /capabilities payload carries a `views` that is not a view "
      + "manifest object");
  }
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

brettheap and others added 2 commits September 12, 2026 11:13
S1 landed tests/test_web_boundary.py, tests/fixtures/web_boundary_census.yaml
and an explicit-test-list addition to .github/workflows/validate.yml on main
while this leg was in flight. The only textual conflict is validate.yml's
pytest invocation; resolved as the UNION of both slices' comment blocks and
both new test files (tests/test_web_boundary.py then tests/test_view_registry.py),
in landing order S1 then S3. S1's census fixture and test module arrive
unmodified from main in this commit; the semantic follow-up they need (a
census row for S3's new file) is the next commit, not this one.

Lane: openxfactory-4-opendox-extraction
Refs opensoft/openXfactory#656
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
S1's census could carry no row for views/view_extension.js because the note
measured the tree before S3's file existed; the merge alone left
test_every_web_file_is_classified_exactly_once failing. Classified A: no
import (so it cannot trip assertion 3), no governance literal (out of
assertion 4's class-C/tail scope regardless), and its one route-shaped
string -- 'gate.bar' in a doc comment -- is an id, not a /actions/... path,
so assertion 2's patterns do not match it. app.js's own row `loc` moves
1155 -> 1282 with the registry wiring; the header totals move with both
rows (43 files, 31,134 lines).

Assertions 2 and 3's xfail `reason=` strings are corrected to the counts
this tree actually measures post-merge, on the module's own stated
"fidelity over tidiness" convention rather than left to cite a shape that
no longer exists:
  * assertion 3 (relative import / class boundary): 7 sites -> 6. S3 closes
    app.js:43 -> views/gate.js, the shell's one direct class-B import and
    exactly the edge slice S3 exists to close. The other 4 class-boundary
    sites and the 2 unresolved intent-feed sites are untouched, so the
    assertion stays red and the marker stays valid.
  * assertion 2 (route ownership): 18 sites -> 20. S3's CORE_VIEWS
    `gate.bar` entry declares `routes: ["/actions/gate/ratify"]` (RULED Q3:
    a route constant travels with the binding that calls it) -- a real
    breach by this assertion's own rule while that entry sits in app.js
    (class A) rather than views/gate.js (class B, exempt by construction).
    Transitional by the same design the CORE arm itself is: slice S5
    deletes this entry from app.js when the binding moves behind a
    host-supplied contribution. app.js's other two projection-route sites
    shift line number (183/184 -> 195/196) with the file's growth; same two
    `/source/` literals, untouched otherwise.

Neither assertion XPASSes -- both stay xfail(strict=True), which is the
thing this commit exists to keep true. Full leg validate invocation
(tests/test_leg_shape.py, tests/test_consumer_reach.py,
tests/test_profile_registration.py, tests/test_web_boundary.py,
tests/test_view_registry.py --noconftest): 129 passed, 3 xfailed, 0 failed.

Lane: openxfactory-4-opendox-extraction
Refs opensoft/openXfactory#656
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 12, 2026 15:13

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

Six unresolved review findings remain in the registry validation and resolution paths.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

src/opendox/view_extension.py:239

  • requires is validated and serialized as a client-enforced dependency, but no client path reads it: resolveView only imports the module/entry and app.js mounts collected bindings without checking capabilities or facets. A contributed binding can declare a missing capability and still be resolved/mounted, so this field is decorative rather than the documented contract. Enforce it at the mount/resolve boundary or remove the field until a consumer exists.
    #: Capability keys (`/capabilities`' `actions`) or profile facets the
    #: binding needs. Consulted by the CLIENT at mount; carried here because the
    #: manifest is what the client reads.
    requires: tuple[str, ...] = ()

src/opendox/web/views/view_extension.js:176

  • A core binding with a string control but no mount passes this validation. initTabs includes every binding with a control and later unconditionally calls target.mount, so a malformed core declaration crashes on first tab activation instead of being refused at assembly. Require a callable mount whenever control is present; contributed entries are already rejected separately.
  if (b.control !== undefined && typeof b.control !== "string") {
    refuse("view binding " + JSON.stringify(b.id) + " declares a control that "
      + "is not an element id");
  • Files reviewed: 9/9 changed files
  • Comments generated: 4
  • Review effort level: Lite

Comment thread src/opendox/web/views/view_extension.js Resolved
Comment thread src/opendox/view_extension.py Resolved
Comment thread src/opendox/view_extension.py Resolved
Comment thread src/opendox/web/views/view_extension.js Resolved
view_extension.js
  * manifestRoutes(): a PRESENT manifest whose contributed_routes is not an
    array (or missing) now refuses instead of silently reading back [] --
    view_manifest() always emits this field as an array, so anything else
    there cannot be trusted for the ownership check it exists to carry.
    Absence of the WHOLE manifest is still an empty column, unchanged.
  * resolveView(): a rejected `await import(...)` (missing file, syntax
    error) is now caught and refused as a ViewBindingError naming the
    binding id and module path, instead of leaking a native error with
    neither.

view_extension.py
  * ViewBinding.entry is now held to the same ASCII identifier grammar
    views/view_extension.js's viewBinding() checks (_ENTRY), not Python's
    own str.isidentifier() -- the two disagreed in both directions
    ("$mount" valid JS, invalid Python identifier; "café" valid Python
    identifier, invalid per the client's ASCII-only regex), so a binding
    could be constructed on one side and refused on the other.
  * collect_view_bindings() now checks views is callable and views() a
    list/tuple before entering the loop. isinstance(extension,
    ViewExtension) is a runtime_checkable Protocol check and verifies only
    that the name exists; `views = 1` or `views()` returning None both
    passed it and then raised a raw TypeError, never the ViewBindingError
    every other declaration defect in this module promises.

Ten new tests (2 Python parametrized + 2 single + 2 JS, tests/test_view_-
registry.py), the census loc for views/view_extension.js corrected for its
growth (422 -> 455) with the header totals moving the same amount. Full
leg validate invocation: 139 passed, 3 xfailed, 0 failed -- the three S1
xfails unaffected (app.js untouched this round; both created files this
commit touches carry no manifest row, RULED OQ-C).

Lane: openxfactory-4-opendox-extraction
Refs opensoft/openXfactory#656
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 12, 2026 15:39

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

Unresolved manifest-validation, lookup, and test-harness issues remain.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (5)

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

src/opendox/web/views/view_extension.js:128

  • This check coerces non-string property keys, so a malformed JSON region such as ["view-docs"] is accepted because it becomes the valid key "view-docs"; the returned binding then carries the array instead of a region string. That bypasses the Python authority's type validation and lets malformed contributed manifests reach mounting. Reject non-string regions before the dictionary lookup, as the Python half does.
    src/opendox/web/views/view_extension.js:177
  • A core binding with a control but no mount passes these checks, is included in initTabs, and then crashes when show() calls target.mount(...). Contributed entries are now forbidden from carrying control, but malformed core declarations still need the same seam-level refusal; require a callable mount whenever a control is present.
    src/opendox/web/views/view_extension.js:358
  • This now rejects a non-array contributed_routes field, but it still returns malformed route entries unchanged. For example, a string is_prefix is later treated as truthy by ownershipBreach, and a malformed route can pass unnoticed when the collected bindings have no non-B routes; that silently disables the Q3 check instead of refusing the manifest. Validate each entry's object shape, rooted pattern, boolean is_prefix, and prefix/path constraints before returning it.
    src/opendox/web/views/view_extension.js:369
  • The registry deliberately defines a slot as (region, id) and even allows the same id in two different regions, but this lookup compares only id and returns the first match. In that valid state the second binding cannot be resolved, and resolveView/requireView inherit the ambiguity; use the full slot for lookup or make ids globally unique instead of mixing the two contracts.

src/opendox/web/views/view_extension.js:294

  • A present manifest with views: null is treated as an absent column here, so render() silently proceeds without contributions instead of refusing malformed input as the manifest contract requires. Distinguish an absent capabilities/views field from a present null manifest and fail closed for the latter.
  const manifest = capabilities && capabilities.views;
  if (manifest === undefined || manifest === null) return [];
  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread tests/test_view_registry.py Resolved
…e scope

The one remaining PR #14 thread (tests/test_view_registry.py:132): this
repository ships no `package.json`, so `_run_node`'s harness and the real
`view_extension.js`/`docs.js` (native `export`/`import`, no bundler) have no
declared module format. Node decides ambiguous `.js` files via
`--experimental-detect-module` (default ON since Node ~20.10, unflagged by
Node 22+): it reparses a file as ESM the moment it sees module syntax, and
warns `To eliminate this warning, add "type": "module" to .../package.json`.

Verified by hand and does not reproduce today: neither locally (Node
v22.22.2) nor in the actual `validate` run for this head (34702880356, Node
24 per the runner's own deprecation notice) does any node-based test fail --
both pass because the heuristic is on by default there. It is still a real
gap, not a false positive: importing the unmodified `view_extension.js` with
`--no-experimental-detect-module` (simulating an older Node, or the flag
disabled) fails outright, proven both by hand and by the new regression test
below (confirmed red on the pre-fix tree, green after).

Fix: an explicit `package.json` (`"type": "module"`) at the repository root
-- an ancestor of `src/opendox/web/**/*.js` for Node's module-scope lookup,
but deliberately NOT inside `src/opendox/web/`, which
`tests/fixtures/web_boundary_census.yaml` classifies file-by-file (verified
`test_every_web_file_is_classified_exactly_once` still passes unchanged) --
plus one written into every `_temp_bundle()` copy, since `tmp_path` sits
outside the repository tree and the root file is not its ancestor.

New test `test_js_module_scope_holds_without_node_s_detection_heuristic`
imports both the real registry and a `_temp_bundle` copy under
`--no-experimental-detect-module` and asserts a clean import -- the positive
assertion that the module format is now a stated fact rather than a Node
default that a future version, downgrade or flag could change again.

Verified: full `validate` invocation (5 files, --noconftest) 140 passed, 3
xfailed -- same xfail set as before (S1's three strict xfails, untouched by
this change).

Lane: openxfactory-4-opendox-extraction
Refs opensoft/openXfactory#656

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 12, 2026 16:04
S2 (#15, "the intent chips become an optional
contributed binding") landed on main while this leg was in flight and
flipped PR #14's mergeStateStatus to DIRTY/CONFLICTING. Two textual
conflicts, both resolved as the UNION of both slices' content rather than
by picking a side:

- `.github/workflows/validate.yml`: both the comment block (S2's paragraph
  then S3's, plus a one-line note that S3's registry test now carries its
  own package.json fix) and the pytest file list (`test_intent_binding_shape.py`
  then `test_view_registry.py`) keep both slices' additions.
- `tests/fixtures/web_boundary_census.yaml`: both slices' own "a 43rd file"
  paragraphs are kept verbatim (each counts its own addition against the
  shared a99eba0 base, independently, and neither claim was wrong on its
  own branch), plus a new RECONCILED paragraph giving the combined total now
  that both land in one tree -- A 22 files/12,398 lines, B 4/1,597, C
  14/11,854, ? 4/5,432, total 44/31,281 -- verified against the merged
  file's own rows (`sum(row["loc"] ...)` by class), not hand-arithmetic left
  unchecked. `views/dispose.js` and `views/wheel.js` (S2's two other touched
  files) are unchanged in `loc` on both branches, so B/C totals carry over
  unmodified.

All other files (src/opendox/cli.py, src/opendox/serve.py,
src/opendox/web/views/dispose.js, src/opendox/web/views/wheel.js, the new
views/intent-binding.js, tests/test_intent_binding_dom.py,
tests/test_intent_binding_shape.py) arrive unmodified from main.

Verified: full `validate` invocation (6 files, --noconftest) 148 passed, 3
xfailed -- the same three S1 strict xfails, same reasons, confirmed still
XFAIL rather than flipped XPASS by S2's edits.

Lane: openxfactory-4-opendox-extraction
Refs opensoft/openXfactory#656

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

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

Seven moderate review findings remain in the registry and application wiring.

Review details

Suppressed comments (7)

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

src/opendox/view_extension.py:191

  • The Python authority uses $ with Pattern.match, which accepts a trailing newline before the end anchor (for example, an id ending in \n); the JavaScript mirror's equivalent regex rejects it. The authority can therefore publish a binding that the client refuses, and the same mismatch applies to _MODULE and _ENTRY; use full-string matching for all three validators and cover a trailing-control-character case.
    src/opendox/web/views/view_extension.js:163
  • requires is validated and copied into bindings, and gate.bar declares actions.gate, but no client path reads it: resolveView imports solely from the binding and app.js never compares requirements with probedCaps. A binding that declares an unavailable capability is therefore still loaded/mounted, making this prerequisite metadata decorative; enforce it at the resolution/mount seam or remove the field until a consumer exists.
    src/opendox/web/views/view_extension.js:357
  • manifestRoutes only checks that contributed_routes is an array, then _route_ownership_breach consumes each entry's is_prefix by truthiness. A present manifest can therefore set is_prefix: 0 (or omit it) for a contributed prefix and let a class-A binding naming that route bypass Q3, even though view_manifest() always emits a validated route binding. Validate each route object's path and boolean/prefix shape here so malformed manifests fail closed.
    src/opendox/web/views/view_extension.js:454
  • For a declared dom region whose element is missing, this returns null instead of refusing. The next contributed mount can then call into null and leak a raw TypeError, contrary to the registry's fail-closed contract; reject a missing host with the region name so an HTML/JS deployment mismatch is diagnosed at the seam.

src/opendox/web/app.js:994

  • This wrapper ignores gateView.binding.entry and hard-codes mountGateBar. A contributed gate.bar binding whose declared entry is a different valid function can pass resolveView()'s validation and then fail here (or invoke the wrong export), so the binding does not actually control the mount entry. Call the validated named export from the binding.
            ? (host, gctx) => gateView.exports.mountGateBar(host, gctx, { caps })

src/opendox/web/views/view_extension.js:369

  • The collision key intentionally permits the same id in different regions (the suite asserts that), but lookupView accepts only id and returns the first match. A valid registry can therefore contain two distinct bindings while lookupView, resolveView, and requireView cannot address the second and may resolve the wrong module; either make IDs global or include the region/slot in these lookup APIs.
export function lookupView(bindings, id) {
  for (const binding of bindings || []) {
    if (binding.id === id) return binding;
  }
  return null;

src/opendox/web/views/view_extension.js:128

  • hasOwnProperty coerces its property-key argument, so a malformed non-string region such as ['view-docs'] is converted to "view-docs" and accepted. The returned binding still carries the array as region, unlike the Python half, and later registry consumers expect a string region; check the type before the dictionary lookup.
  if (!Object.prototype.hasOwnProperty.call(REGIONS, b.region)) {
  • Files reviewed: 10/10 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 12, 2026 16:12
brettheap added a commit to opensoft/openXfactory that referenced this pull request Sep 12, 2026
…e by row, admit S3's new files

Copilot review on openxFactory PR #1001 (three unresolved threads):

- README.md + docs/opendox-cutover-runbook.md carried only the pre-S2
  totals (906 declared lines / 151 edit-carrying rows). Now that #1002
  (§ 3.4 slice S2, dispose.js/wheel.js) is merged into this branch too,
  re-derive the § 2 table and its prose from the parsed manifest for the
  combined S2+S3 state: 909 declared lines / 153 rows carrying `edits:`
  (166 moved_verbatim / 152 moved_with_declared_edit / 138 not_moved),
  `opendox_code` 123 rows at 58/65 verbatim/edited for 336 declared
  lines. Figures are computed from the landed manifest, not transcribed.

- tests/carve_manifest/test_carve_manifest.py: pin the app.js and
  test_bullseye_widget.py rows by disposition and exact (class, lines),
  the same idiom the ASK-7 pins use for cli.py/serve.py, so the
  aggregate assertion is not the only thing standing between a passing
  suite and the S3 edits landing on the wrong row or under the wrong
  class. Also reconciles the aggregate assertion's own merge conflict
  against #1002 to the correct combined (909, 153).

- docs/opendox-carve-admissions.yaml: `verify-carve-arrival.py --phase B
  --destination opendox_code` against the S3 leg's current head
  (opensoft/openDox-code#14 @ 28de9c3b) refuses `arrival-undeclared-file`
  five times over — S3's own `view_extension.py` / `view_extension.js` /
  `test_view_registry.py`, and S1's `test_web_boundary.py` /
  `tests/fixtures/web_boundary_census.yaml` (landed already via
  openDox-code#13; S1 touched no arrived file, so it needed no
  row-annotation PR of its own, but its created files were never
  admitted). This is the first PR to run the verifier against the
  merged S1+S2+S3 tree and need them declared; all five are governed
  admissions now, alphabetical by path, none ad hoc.

Verified: `scripts/validate-carve-manifest.py` OK (166/152/138, 909/153);
`scripts/verify-carve-arrival.py --destination opendox_code --phase B`
against a fresh detached checkout of openDox-code#14 OK with zero ad-hoc
--allow-created flags; `pytest tests/carve_manifest tests/carve_arrival
tests/carve_conformance` 269 passed.

Lane: openxfactory-4-opendox-extraction
Refs #656

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

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

Critical and moderate findings remain in the application wiring, JavaScript mirror, and registry-test isolation.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (5)

src/opendox/web/app.js:598

  • requires: ["actions.gate"] is currently only validated and serialized; resolveView and the rest of the client never inspect binding.requires. The binding is therefore still resolved when probedCaps.actions.gate is absent, despite the Python contract documenting requires as capabilities/facets consulted at mount. Either enforce this metadata before resolving/mounting or remove it until its absence semantics are defined.
    routes: ["/actions/gate/ratify"], requires: ["actions.gate"],

src/opendox/web/app.js:940

  • resolveView validates only the binding's declared entry (mountGateBar), but this path also calls gateView.exports.isGateBearing(...). A contributed module can therefore pass registry resolution while missing or mis-typing that second export, then throw a raw TypeError when a proposal document is opened. Declare/validate all exports this consumer requires, or resolve the classifier through its own validated binding before using it.
    const gateContext = (tile, entry, key) =>
      tile?.kind === "proposal" && gateView
        && gateView.exports.isGateBearing(entry.path) && key
        ? { changeId: tile.id, repository: key.repository }

src/opendox/web/views/view_extension.js:354

  • This only verifies that contributed_routes is an array; entries with a non-boolean is_prefix, an invalid pattern/prefix shape, or even a missing pattern are accepted when no binding happens to iterate them. The later matcher also uses claimed.is_prefix by truthiness, so a malformed capabilities payload can make the client-side Q3 ownership check diverge from Python's validated RouteBinding semantics. Validate each route entry while reading the manifest and refuse malformed entries, regardless of whether a view currently declares routes.
  const routes = manifest.contributed_routes;
  if (!Array.isArray(routes)) {
    refuse("the /capabilities `views` payload declares contributed_routes "
      + JSON.stringify(routes) + ", not an array: view_manifest() always "
      + "emits this field as one, and a manifest that cannot be trusted for "

src/opendox/web/views/view_extension.js:128

  • hasOwnProperty coerces property keys, so a malformed JSON binding such as region: ["view-docs"] passes this check and is returned with a non-string region; slot and regionHost then coerce it again. The Python authority rejects non-string regions, so the client mirror should validate the type before the dictionary lookup.
  if (!Object.prototype.hasOwnProperty.call(REGIONS, b.region)) {

src/opendox/web/views/view_extension.js:177

  • A core tab binding is accepted when it declares control but omits mount. initTabs filters on control and unconditionally calls target.mount(...), so such a declaration reaches the first click as a raw TypeError instead of the registry's refusal contract. Require a callable mount whenever control is present (contributed entries are already rejected before this point).
  if (b.mount !== undefined && typeof b.mount !== "function") {
    refuse("view binding " + JSON.stringify(b.id) + " declares a mount that is "
      + "not a function; a contributed binding declares no mount at all and is "
      + "loaded through resolveView()");
  }
  if (b.control !== undefined && typeof b.control !== "string") {
    refuse("view binding " + JSON.stringify(b.id) + " declares a control that "
      + "is not an element id");
  }
  • Files reviewed: 10/10 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread src/opendox/web/app.js Resolved
Comment thread src/opendox/web/app.js Resolved
Comment thread tests/test_view_registry.py Resolved
… mount, view-registry isolation

tests/test_doc_surfaces.py
  * test_the_doc_tab_is_wired_to_the_one_cross_view_jump located the docs
    tab's block by the pre-S3 `{ tab: "tab-docs"` shape, which no longer
    exists in app.js now that the binding is `{ id, control, region }`
    (§ 3.4 S3). `app.split(...)[1]` on the absent literal raised IndexError
    before the renderDocs assertion ever ran. Migrated to split on the
    registry shape (`{ id: "docs.list", control: "tab-docs",
    region: "view-docs",`) -- the same one-token-class migration the three
    test_bullseye_widget.py `.view` -> `.region` quotations already took in
    this PR (09b42f5).

src/opendox/web/app.js
  * The viewer's `mountGate` adapter called a hard-coded
    `gateView.exports.mountGateBar` instead of the RESOLVED binding's own
    declared `entry` export. `resolveView()` already validates that
    `binding.entry` names a callable export of `binding.module`; a
    contributed `gate.bar` binding declaring a different entry name would
    pass that validation and then either mount the wrong function or throw
    on `undefined` here, because validation and mounting consulted two
    different names. Now
    `gateView.exports[gateView.binding.entry](host, gctx, { caps })` --
    one token changed. New
    test_app_js_mounts_the_gate_bar_through_its_declared_entry
    (tests/test_view_registry.py, S3-created) pins the new expression and
    asserts the old hard-coded call is absent, as a regression guard.

tests/test_view_registry.py
  * Normal (non-`--noconftest`) pytest loads the root conftest.py, which
    registers an empty `_SuiteProfile` at collection time -- a test process
    is a host like any other. This module never cleared that ambient
    registration before asserting against a clean slate:
    `registered()`'s `domain_profile.register()` raised AlreadyRegistered
    against the suite's own profile (reproduced in isolation running
    test_the_facet_comes_off_the_one_registered_profile alone), and
    test_no_host_at_all_refuses_rather_than_answering_empty's
    `assert not domain_profile.is_registered()` saw it registered and
    failed (also reproduced in isolation; the full-file run happened to
    pass it only as a side effect of the PRECEDING test's fixture teardown
    unregistering the conftest profile after its own registration attempt
    raised). New autouse `_empty_registry`, mirroring
    test_profile_registration.py's fixture of the same name: save whatever
    profile is registered (or None), unregister, yield, restore in
    teardown. Both tests now pass standalone and in any order.

Verified: narrowed validate (5 files, --noconftest) 82 passed, 3 xfailed,
unchanged. `node --check src/opendox/web/app.js` clean.

Normal invocation of both touched files still cannot reach any of these
three assertions: `ideation_dashboard` is genuinely absent from this leg by
design (pyproject.toml's own dependency note -- it is a cross-column reach
the BUILD arc removes), and the root conftest's autouse
`declared_human_console` fixture imports `opendox.cli` -> `opendox.serve`,
which imports it at module level. Every test in both files errors at
fixture setup on that ModuleNotFoundError before reaching either file's
body, unchanged by this commit (78 errors before and after -- the
pre-existing 77 plus one new test, same reason). Verified instead with a
scratch-only, uncommitted `ideation_dashboard` stub that satisfies the
import chain with no behavioural stand-in beyond existing, plus isolated
per-test and per-line checks against the real files; the PR thread replies
give the exact commands and tallies.

Also found, NOT fixed here (out of this round's scope and reported to the
orchestrator separately): tests/conftest.py's
`REPO_ROOT = HERE.parent.parent` is off by one directory now that the carve
flattened `tests/ideation-dashboard/` to `tests/` -- it resolves one level
above this repository's own root. That is a second, independent reason
most of test_doc_surfaces.py (and, by the same `REPO_ROOT` import, roughly
three dozen other test files) cannot reach a green normal invocation right
now; it masks nothing this commit fixes, and none of this commit's new or
changed assertions depend on it.

Lane: openxfactory-4-opendox-extraction
Refs opensoft/openXfactory#656
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 12, 2026 17:16
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Unresolved moderate validation, lookup, export, and capability-enforcement issues remain.

Review details

Suppressed comments (6)

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

src/opendox/web/app.js:939

  • resolveView validates only the declared entry, but this call assumes every valid gate.bar module also exports a callable isGateBearing; that second export is neither part of ViewBinding nor checked. A contributed gate module exporting only its declared entry can therefore resolve successfully and then throw a raw TypeError when a proposal is opened. Put this predicate behind an explicitly declared and validated binding capability instead of hard-coding another export name.
    src/opendox/web/views/view_extension.js:357
  • Checking only the container type lets malformed descriptors such as [{}] pass. In the current app the only core binding with routes is class B (which ownershipBreach skips), while all other core bindings declare no routes, so this bad payload is never inspected and a present malformed manifest is accepted instead of failing closed. Validate each descriptor's pattern and is_prefix before returning it.
    src/opendox/web/views/view_extension.js:369
  • The registry deliberately treats (region, id) as the slot and allows the same id in different regions (test_one_id_in_two_different_regions_is_not_a_collision). lookupView/resolveView nevertheless accept only an id and return the first match, so the second valid binding is unaddressable and a consumer can resolve the wrong panel. Either make ids globally unique or make lookup/require/resolve take the region (or slot) as well.

src/opendox/view_extension.py:427

  • This structural route check coerces is_prefix with bool(), so malformed contributors such as is_prefix="false" are treated as a true prefix (and a missing field as false) instead of being refused. RouteBinding validates this field as a real boolean, and this mirror should do the same; otherwise a malformed route can create a false ownership refusal or bypass the Q3 check.
            is_prefix = bool(getattr(contributed, "is_prefix", False))
            if route == pattern or (is_prefix and route.startswith(pattern)):

src/opendox/web/views/view_extension.js:163

  • requires is validated and serialized, but nothing in resolveView, render, or the mount paths reads it against the capabilities object. Consequently the new gate.bar declaration (requires: ["actions.gate"]) is still resolved and mounted when that capability is absent, and any contributed binding can claim unmet requirements without changing behavior. Either enforce these requirements at the client seam or make this field explicitly informational; the current API promises a check that does not exist.
  const requires = b.requires === undefined ? [] : b.requires;
  if (!Array.isArray(requires) || requires.some((r) => typeof r !== "string" || !r)) {
    refuse("view binding " + JSON.stringify(b.id) + " declares requires "
      + JSON.stringify(requires) + ": every entry is a capability or facet name");
  }

tests/test_view_registry.py:551

  • This drift assertion compares only the JavaScript region names, not their dom/shell values. Those values are load-bearing—regionHost refuses shell regions and dom_regions() drives the HTML checks—so the Python and JavaScript halves can disagree about mounting semantics while this test still passes. Compare (name, kind) pairs.
def test_the_two_halves_declare_the_same_regions_in_the_same_order():
    assert _js_object_keys("REGIONS") == list(REGIONS)
  • Files reviewed: 11/11 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

brettheap added a commit that referenced this pull request Sep 12, 2026
…to build/s4-split-route-tails

Lane: openxfactory-4-opendox-extraction

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 12, 2026
…ready does

S3's Copilot re-review (#14, `e176947`) replaced
`gateView.exports.mountGateBar(...)` with
`gateView.exports[gateView.binding.entry](...)`: a contributed binding NAMES
its entry in the manifest, and reading a hardcoded export name here would
silently ignore the name it declared — the binding would resolve, the mount
would be `undefined`, and the panel would fail at the click rather than at
assembly. The same is true of S4's two mounts, so they read the declared entry
too. Census `loc` for app.js refreshed with the change (1331 -> 1337) and the
declared totals re-derived.

Refs opensoft/openXfactory#656
Lane: openxfactory-4-opendox-extraction

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@brettheap
brettheap merged commit c5edac8 into main Sep 12, 2026
4 checks passed
brettheap pushed a commit that referenced this pull request Sep 12, 2026
…e-core-arm

Lane: openxfactory-4-opendox-extraction

Refs opensoft/openXfactory#656

Two conflicts, both resolved keeping this branch's own content over main's
pre-S6 snapshot of the same text (main's side contributed nothing this
branch did not already carry further forward):

- `.github/workflows/validate.yml`: main has no S6 addition at all (its
  comment block + the `tests/test_source_core_arm.py` pytest-list line);
  kept this branch's version whole.
- `tests/test_web_boundary.py` (assertion 2's xfail reason on
  `test_no_ownership_violation_outside_class_b`): main's text is the
  post-S3/pre-S6 snapshot (20 sites); this branch's text is the RE-DERIVED
  post-S6 count (16, the four /source sites cleared) and already accounts
  for S3's own contribution (the CORE_VIEWS `gate.bar` entry, +2, cited by
  name) inside its own narrative. Kept this branch's version; verified
  `app.js` (the file both texts cite line numbers into) is byte-identical
  between this branch and origin/main, so the citations still hold.

`tests/conftest.py` auto-merged to main's #19 depth fix (this branch had
inherited the pre-fix `HERE.parent.parent`, touched by neither slice).
Everything else (view_extension.py/.js, app.js, test_view_registry.py,
test_doc_surfaces.py, test_bullseye_widget.py) merged clean — this branch
never edited those lines.

Narrowed validate (branch's own list, 7 files): 174 passed, 3 xfailed, 0
failed. `git diff origin/main --stat`: only this slice's own files (S6's
serve.py/consumer_reach.py/test_source_core_arm.py + the shared
web_boundary_census.yaml/test_consumer_reach.py/test_web_boundary.py/
validate.yml edits already on this branch before the merge) — no S3
residue.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 12, 2026
…tails

Resolves conflicts limited to S4's own additions layered on S3's landed
content: validate.yml's S4 pytest entry, view_extension.py/.js REGIONS
(lens-gate, repo-projects), app.js's two new gate mounts, and the census/
xfail narratives. Also collapses a duplicate views/view_extension.js
census row (S3's pre-merge 455-loc row vs S4's reconciled 463-loc row)
introduced by the add/add conflict on that file, updating its note to
chain the S3->S4 loc growth; totals now re-derive exactly (A 25/16293,
B 7/2174, C 14/11854, ? 1/1435 = 47 files/31756 loc). tests/conftest.py's
REPO_ROOT depth fix (#19) arrives from main unchanged.

Lane: openxfactory-4-opendox-extraction

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 12, 2026
… the bindings that call them (#17)

Lane: openxfactory-4-opendox-extraction

Refs opensoft/openXfactory#656 (stays OPEN). CLAIM: 5647338637.

**RULED Q3** (Brett Heap, 2026-09-12, opensoft/openXfactory#656 comment
`5642758731`): "a route constant travels with the binding that calls it, never
with the model that happens to declare it." This is § 3.4 slice S4: the
thirteen gate-route constants declared in `lens-model.js`,
`repo-selector.js`, and `staging-workbench-model.js` split to the class-B
bindings that call them (`gate-lens.js`, `gate-projects.js`,
`projection-index.js`, `swb-create.js`, `swb-session.js` — four of them new),
with `/actions/refresh` measured and asserted to stay class A per § 3.2's Q3
row. Two dead parameters (`mountCreateProject`'s `projects`,
`commissionEdit`'s `control`) were dropped rather than carried across the
package boundary unread. The census SPLIT rows move to class B with real
line counts; `requireRouteShape()`-adjacent boundary assertions were
tightened (assertion 1 cutoff, assertion 2 residue) and re-verified against
the merged tree after S4 re-merged main twice (once after S6/#16 landed) —
see the #656 note for the residue arithmetic. Merges after `main` already
carries § 3.4 S3 (#14) and S6 (#16).

Gate evidence: destination gate; `validate` SUCCESS at `f3474843` (run
34722412518); 2 review threads, 0 unresolved (S3's own pre-existing
`isGateBearing` finding on `app.js`, not S4's to fix, replied + registered on
#656; a real test-coverage gap on `route_ownership_exceptions`, fixed in
this branch's own history by adding a mutation-tested assertion). Three
Copilot "suppressed" comments on the post-merge head are not review threads
(GraphQL: 0 unresolved) and are registered on #656 alongside the app.js
finding as the same "resolveView()/postPlan() validates shape, not
behaviour" follow-up class, out of scope here.
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