Repository navigation
§ 3.4 S2: the intent chips become an optional contributed binding (RULED Q5; OQ-F kept) - #15
Conversation
…; OQ-F kept) docs/front-end-package-boundary.md (openDox-spec main a44ac06d) RULED Q5, 2026-09-12 comment 5642758731: `views/intent-feed.js` stays `not_moved` (RULING OQ-F, docs/opendox-carve-manifest.yaml:1807-1810 unchanged) — the committed-intent feed is openxFactory's own apply lane made visible. What was wrong is that `dispose.js`:26 and `wheel.js`:75-76 imported it UNCONDITIONALLY, so the whole static module graph (app.js -> wheel.js -> the absent file) failed to resolve at this leg (note § 1.2(b)). New `views/intent-binding.js` makes the chips an OPTIONAL contributed binding: a dynamic `import()` of "./intent-feed.js", top-level-awaited so it is always settled before dispose.js or wheel.js finish evaluating, forwarding to the real module when a deployment contributes it and answering the same way an unregistered hosted plane already does (no chips, no error, no dead import) when it does not. dispose.js and wheel.js now import the same seven names from "./intent-binding.js" instead of "./intent-feed.js" directly — one line changed in each file, nothing else. Deliberately NOT the note's § 4.1 ViewBinding registry: that is slice S3's job. This is the smaller, narrower late-lookup S3 can fold in later. styles.css:1278-1295 needs no change — its "intent-feed chips" heading is a comment, and the .intentchips/.intentchip* rules are inert-but-harmless CSS when the binding is absent (no import statement in CSS to fail to resolve). Tests: - tests/test_intent_binding_shape.py (added to validate.yml's explicit list): pure text/regex shape assertions, --noconftest safe — no static import of intent-feed.js survives in dispose.js/wheel.js, both import the seven names from intent-binding.js, intent-binding.js's own reference to intent-feed.js is exclusively the dynamic import(), and every static relative import across the three touched files resolves to a real file. - tests/test_intent_binding_dom.py (Node, pytest.mark skip when node is absent; NOT added to validate.yml, on the same footing as the narrowed test_intent_tray_dom.py / test_wheel_verbs_dom.py this pair of views already carries, RULED Q-L5 (b')): drives the real dispose.js/wheel.js module graph and the mounted dispose tray under node, both with intent-feed.js absent (this leg, today) and contributed (a fake fixture standing in for openxFactory's real module), proving the graph resolves and the tray renders with no chips when absent and real forwarded chips when contributed. Q-L1: dispose.js and wheel.js are moved_verbatim rows with no declared edits, so this pairs with an openxFactory row-annotation PR (chore/s2-intent-feed-declared-edits) that declares dispose.js:26 and wheel.js:75-76 as declared import-rewrite lines, plus admissions for the three new files. That PR lands first. Lane: openxfactory-4-opendox-extraction Refs opensoft/openXfactory#656 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…-optional-binding # Conflicts: # .github/workflows/validate.yml
…eep the seam's own comment from misreporting itself S1's census (`tests/fixtures/web_boundary_census.yaml`) was measured at `a99eba03`, before S2 added `views/intent-binding.js`. Merging main onto S2 (330cf81) therefore leaves `test_every_web_file_is_classified_exactly_once` (assertion 1, unmarked) genuinely red -- a new file with no row, exactly the ratchet's own stated purpose. Adds the row: class A (no governance word, no owned route, no class-B import), 114 lines, with provenance back to 330cf81. While computing assertion 3's violation set to confirm S2 does not accidentally XPASS the still-open `test_every_relative_import_resolves_and_ stays_in_class` xfail, found a second, more interesting defect: the new file's own explanatory comment (`... used to \`import ... from "./intent-feed.js"\` UNCONDITIONALLY ...`) quotes the OLD import verbatim, and assertion 3's regex does not distinguish a real import from one named inside a `//` comment -- so intent-binding.js was misreporting itself as still carrying the very static import it exists to remove. Reworded the comment to describe the old specifier in prose instead of quoting it, which drops assertion 3's violation count from the expected 6 (5 real class-boundary sites + this false positive) to the documented 5, with no change to the file's behaviour. Census `loc` updated 107 -> 114 for the reworded comment's extra lines. Verified: `python -m pytest -q tests/test_leg_shape.py tests/test_consumer_reach.py tests/test_profile_registration.py tests/test_web_boundary.py tests/test_intent_binding_shape.py --noconftest` (validate.yml's exact invocation) -- 81 passed, 3 xfailed (strict), same three markers as S1 landed, none XPASSing: `test_every_relative_import_ resolves_and_stays_in_class`'s own violation set is now exactly the 5 class-boundary sites its xfail reason names (app.js->gate.js, app.js->swb-session.js, staging-workbench.js->swb-create.js/swb-session.js, wheel.js->dispose.js) -- the 2 intent-feed sites S2 closes are gone, as expected, and no new violation survives. Lane: openxfactory-4-opendox-extraction Refs opensoft/openXfactory#656 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…-optional-binding
Reviewer's GuideThis PR preserves the ruled-in-place intent-feed module while replacing dangling static consumer imports with a top-level-awaited optional binding, allowing dispose.js and wheel.js to load and render normally without chips when the contributed module is absent and to forward real behavior when it is present. Required shape tests, optional Node DOM probes, workflow coverage, and census metadata document and verify the seam. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
🟡 Changes recommended
Moderate review findings remain in forwarding coverage and static-import validation, alongside minor cleanup items.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Makes the intent-feed integration optional so dispose.js and wheel.js work without the contributed module.
Changes:
- Adds optional dynamic binding with safe fallbacks.
- Routes view imports through the binding.
- Adds shape, DOM, census, and CI coverage.
File summaries
| File | Summary |
|---|---|
tests/test_intent_binding_shape.py |
Validates the optional binding’s static structure. |
tests/test_intent_binding_dom.py |
Probes module loading and DOM behavior. |
tests/fixtures/web_boundary_census.yaml |
Registers the new web binding file. |
src/opendox/web/views/wheel.js |
Uses the optional intent binding. |
src/opendox/web/views/intent-binding.js |
Provides optional intent-feed forwarding and fallbacks. |
src/opendox/web/views/dispose.js |
Uses the optional intent binding. |
.github/workflows/validate.yml |
Runs the required shape validation. |
Review details
Suppressed comments (1)
tests/test_intent_binding_shape.py:50
_STATIC_IMPORT_REonly matches named imports with double-quoted specifiers. A regression such asimport feed from './intent-feed.js', a namespace import, or a side-effect import would makenot _static_imports(text)pass while still creating the same dangling static dependency, so this required seam invariant is not fully enforced. Add a generic static-relative-import matcher for the binding guard while retaining the named-import parser for the importer assertions.
_STATIC_IMPORT_RE = re.compile(
r'import\s*\{([^}]*)\}\s*from\s*"(\./[^"]+)"\s*;', re.MULTILINE)
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 2 days and 2 hours by commenting @sourcery-ai review. Upgrade to get a review now.
- tests/test_intent_binding_dom.py: add a direct forwarding probe for the five exports the existing tests never exercise (feedActor, refusalLine, startIntentFeed, statesByTarget, emitIntent) — only intentCapable and renderIntentChips were previously reached, so a wrapper could forward one of the other five wrong and every test here would still pass. Two new tests cover both the absent-binding fallback and the contributed-module forward for all five; the fake statesByTarget is made to depend on `rows` so its contributed answer is distinguishable from the absent case's own empty-Map fallback (an unconditional empty Map on both sides would let the new test pass without proving anything). - tests/fixtures/web_boundary_census.yaml: the S2 amendment paragraph still said "107 lines" after the loc column below it was corrected to 114 — fixed the stale prose figure. - tests/test_intent_binding_shape.py: renamed test_the_absent_module_still_exists_on_disk_as_a_check to test_the_absent_module_is_still_absent_from_disk_as_a_check — the old name said the opposite of what the assertion checks. Verified: the explicit validate.yml pytest list (81 passed, 3 xfailed, unchanged) and tests/test_intent_binding_dom.py --noconftest (8 passed, including the two new forwarding tests, node v22.22.2 locally). Lane: openxfactory-4-opendox-extraction Refs opensoft/openXfactory#656 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Moderate test coverage and import-validation issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (3)
Previously missed (2) — in code that hasn't changed since the last review.
src/opendox/web/views/dispose.js:26
- This import changes the dependency closure used by the existing Node DOM probes:
tests/test_intent_tray_dom.py:_run(lines 310-311) andtests/test_wheel_verbs_dom.py:_run(lines 310-311) still copyintent-feed.jsbut notintent-binding.js, so importingdispose.jsfrom either temporary tree now fails withMODULE_NOT_FOUND. Although those probes are currently narrowed out ofvalidate, they are the hand-runnable/future DOM coverage described in the repository; add the new binding to both copied-file lists while retaining the contributed feed fixture.
tests/test_intent_binding_shape.py:50 _STATIC_IMPORT_REonly matches named imports of the formimport { ... } from ...; it misses default and side-effect relative imports. A futureimport feed from "./intent-feed.js"in this binding would make the optional module mandatory while both shape checks still pass, so extend the scanner to cover every static relative-import form (or use a parser).
tests/test_intent_binding_dom.py:54
- This closure description is inaccurate:
settings.jsis not an import-free leaf; it importswheel-model.jsandhelpers.jsatsettings.js:26-27. Keep the dependency-closure documentation aligned with the actual graph so future updates do not omit a dependency based on this explanation.
# file's own `^import` lines: wheel-model.js, helpers.js, notebook.js and
# settings.js are import-free leaves; dispose.js imports only helpers.js and
# (after this slice) intent-binding.js. A file added to this set by a future
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
…lot) tests/test_intent_binding_dom.py: the round-1 fakes for feedActor and startIntentFeed ignored their own caps/opts argument, so the new contributed-path forwarding test could not have caught intent-binding.js dropping or substituting either argument on its way to the real module -- it would pass no matter what was actually forwarded. Both fakes now carry a caller-supplied marker (caps.marker / opts.marker) into their answer, and the probe/assertions check it; refusalLine/statesByTarget/emitIntent were already argument-dependent in round 1 and are unchanged. Verified: tests/test_intent_binding_dom.py --noconftest, 8 passed (node v22.22.2); the required validate.yml list unaffected, 81 passed/3 xfailed. Lane: openxfactory-4-opendox-extraction Refs opensoft/openXfactory#656 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Critical harness and boundary-check issues remain, along with a moderate test gap and documentation nit.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (2)
tests/test_intent_binding_dom.py:54
- The closure explanation is inaccurate:
settings.jsis not an import-free leaf; it statically imports bothwheel-model.jsandhelpers.js(src/opendox/web/views/settings.js:26-27). The copied closure is currently complete, but this comment will mislead anyone updating it after another dependency change.
# file's own `^import` lines: wheel-model.js, helpers.js, notebook.js and
# settings.js are import-free leaves; dispose.js imports only helpers.js and
# (after this slice) intent-binding.js. A file added to this set by a future
tests/test_intent_binding_shape.py:114
- This assertion does not actually enforce the optional-import contract for all static import forms:
_STATIC_IMPORT_REonly matches double-quoted named imports (import { … } from …). A regression to a default, namespace, or side-effect static import of./intent-feed.jswould still pass this test and fail the module graph;test_web_boundary.pycannot catch it here because its assertion remains an expected failure for the five unrelated class-boundary violations. Add a check covering every static import form (or parse the import syntax) for this binding.
def test_intent_binding_reaches_intent_feed_only_dynamically() -> None:
text = BINDING.read_text(encoding="utf-8")
assert not _static_imports(text), (
"intent-binding.js carries a static `import { … } from \"./…\"` "
"clause; the whole point of this file is that its ONE reference to "
"the possibly-absent module is a dynamic import() a missing file "
"cannot make fail to resolve"
)
- Files reviewed: 7/7 changed files
- Comments generated: 2
- Review effort level: Lite
…m" in intent-binding.js's own comment Verified against the actual assertion-3 regex (`_IMPORT_FROM` in tests/test_web_boundary.py) that this specific phrase — "from" at the end of one // line, the quoted path at the start of the next — does NOT bridge across the "// " comment-marker prefix and was not producing a sixth violation (5 violations, exactly the documented class-boundary sites, both before and after this edit). Rewording anyway, defensively, to remove any textual read of "from \"./intent-feed.js\"" from this file regardless of how a reviewer (bot or human) scans it, on the same rationale as the round-1 comment fix a few lines above this one. No line count change (114, unchanged); no behavior change. Verified: required validate.yml list 81 passed/3 xfailed; tests/test_intent_binding_dom.py --noconftest 8 passed. Lane: openxfactory-4-opendox-extraction Refs opensoft/openXfactory#656 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
There was a problem hiding this comment.
🔵 Needs a closer look
Three moderate findings remain, including missing harness setup and incomplete import/forwarding coverage.
Review details
Suppressed comments (4)
src/opendox/web/views/dispose.js:26
- This import adds a dependency that the existing Node DOM harnesses do not copy into their isolated
views/directory:tests/test_intent_tray_dom.pyandtests/test_wheel_verbs_dom.pystill copydispose.js,helpers.js, andintent-feed.jsonly. With Node available, loadingdispose.jsnow fails withERR_MODULE_NOT_FOUNDforintent-binding.jsbefore those probes exercise the tray; update those harness copy lists (and their setup comments) for the new module.
import { emitIntent, renderIntentChips } from "./intent-binding.js";
src/opendox/web/views/intent-binding.js:102
- The contributed-path probe only checks that
renderIntentChipsleft a marker, not that this wrapper forwardedtargetId,rows, anderrorcorrectly. A binding that passes substituted values would still pass, so this new forward is not actually covered; expose those fields from_TRAY_PROBEand assert them for the contributed case.
export function renderIntentChips(container, targetId, rows, error) {
return MODULE
? MODULE.renderIntentChips(container, targetId, rows, error)
: container;
tests/test_intent_binding_dom.py:54
- The closure description is factually wrong:
settings.jsis not an import-free leaf; it statically importswheel-model.jsandhelpers.js(src/opendox/web/views/settings.js:26-27). The copied closure happens to include those dependencies, but this comment should describe the actual graph so future updates do not omit them.
# file's own `^import` lines: wheel-model.js, helpers.js, notebook.js and
# settings.js are import-free leaves; dispose.js imports only helpers.js and
# (after this slice) intent-binding.js. A file added to this set by a future
tests/test_intent_binding_shape.py:50
- The shape test's
_STATIC_IMPORT_RErecognizes only named imports with double-quoted specifiers. A side-effect import such asimport './intent-feed.js';, or a single-quoted named import, would make_static_imports(text)empty while the dynamic-import assertion still passes, so the required suite could miss a static dependency on the optional module. Extend the matcher or add an explicit assertion covering bare and both quote styles.
_STATIC_IMPORT_RE = re.compile(
r'import\s*\{([^}]*)\}\s*from\s*"(\./[^"]+)"\s*;', re.MULTILINE)
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Lite
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>



Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox)
Refs opensoft/openXfactory#656
RULED Q5 (opensoft/openXfactory#656 comment 5642758731, Brett Heap, 2026-09-12): keep RULED OQ-F (
views/intent-feed.jsstaysnot_moved,docs/opendox-carve-manifest.yaml:1807-1810 unchanged — the committed-intent feed is openxFactory's own apply lane made visible) and fix the importers instead.split-opendox-two-layer-product§ 3.4 slice S2 makes the intent-feed chips an OPTIONAL contributed binding, sodispose.jsandwheel.jsrender without them when a deployment does not contribute the real module.Lands after S1 (already landed, openDox-code
e86deb2d) and after openxFactory #1002 (the Q-L1 row-annotation PR that declares this leg's two import-rewrite lines and its three new-file admissions; #1002 is open, not yet merged, at the time this PR was opened — the lane lands it first, then this PR).The seam
src/opendox/web/views/intent-binding.js(new, 114 lines): a single top-level-awaited dynamicimport("./intent-feed.js"), caught if it rejects. Every namedispose.js/wheel.jsneed (emitIntent,renderIntentChips,feedActor,intentCapable,refusalLine,startIntentFeed,statesByTarget) forwards to the real module when a deployment contributes it beside this one, and answers the same way an unregistered hosted plane already does (no chips, no thrown error, no dead import) when it does not.src/opendox/web/views/dispose.js:26— the one changed import line:from "./intent-feed.js"→from "./intent-binding.js"(declared by openxFactory #1002 againstdocs/opendox-carve-manifest.yaml).src/opendox/web/views/wheel.js:75-76— the same rewrite, two-lineimport { … } from "…";statement (line 75 unchanged, only line 76'sfromclause differs; declared as[75, 76]by #1002 since both lines are one statement).styles.css:1278-1295 needs no change — its "intent-feed chips" heading is a comment and the.intentchips/.intentchip*rules are inert-but-harmless CSS when the binding is absent.Deliberately not the note's § 4.1
ViewBindingregistry — that is slice S3's job. This is the smaller, narrower late-lookup S3 can fold in later.Tests, and what they prove
tests/test_intent_binding_shape.py(added tovalidate.yml's explicit list,--noconftestsafe): pure text/regex shape assertions — no static import ofintent-feed.jssurvives indispose.js/wheel.js, both import the seven names fromintent-binding.js,intent-binding.js's own reference tointent-feed.jsis exclusively the dynamicimport(), and every static relative import across the three touched files resolves to a real file.tests/test_intent_binding_dom.py(Node,pytest.mark.skipifwhen node is absent; not added tovalidate.yml, on the same footing as the narrowedtest_intent_tray_dom.py/test_wheel_verbs_dom.pythis pair of views already carries, RULED Q-L5 (b′)): drives the realdispose.js/wheel.jsmodule graph and the mounted dispose tray under node, both withintent-feed.jsabsent (this leg, today) and contributed (a fake fixture standing in for openxFactory's real module) — proving the graph resolves and the tray renders with no chips when absent and real forwarded chips when contributed.Merge from main (S1 e86deb2, then #12 78d5e7a) and the follow-up commit
Merging
origin/mainonto 330cf81 conflicted only in.github/workflows/validate.yml(both S1 and S2 appended their own comment block + pytest line at the same spot); resolved by keeping both blocks (S1'stest_web_boundary.pyline first, S2'stest_intent_binding_shape.pyline second) and both pytest arguments. A secondorigin/maincommit (#12,78d5e7a, unrelated docstring re-description inside the ASK-7 declared-edit window) merged clean with no conflicts.S1's census (
tests/fixtures/web_boundary_census.yaml) was measured ata99eba03, before S2 addedviews/intent-binding.js— so after the merge, assertion 1 (test_every_web_file_is_classified_exactly_once, unmarked) was genuinely red: a new file with no census row, exactly the ratchet's stated purpose. Follow-up commite1fcd34adds the row (class A — no governance word, no owned route, no class-B import — 114 lines).While computing assertion 3's violation set to confirm S2 does not accidentally XPASS the still-open
test_every_relative_import_resolves_and_stays_in_classxfail, found thatintent-binding.js's own explanatory comment quoted the old import verbatim (`import … from "./intent-feed.js"`) — and assertion 3's regex does not distinguish a real import from one merely named inside a//comment, so the file was misreporting itself as still carrying the very static import it exists to remove. Reworded the comment to describe the old specifier in prose instead of quoting it (no behavior change); censuslocupdated 107 → 114 for the reworded comment's extra lines.Verified at head
ceb69f3(validate.yml's exact invocation)S1's three
xfail(strict=True)markers all still XFAIL — none XPASSed:test_no_ownership_violation_outside_class_b— untouched by S2, still red (18 sites, S4–S6 work).test_no_class_c_file_carries_a_governance_literal— untouched by S2, still red (S7 work).test_every_relative_import_resolves_and_stays_in_class— this is the one S2 touches. Its xfailreason=text already predicted this: S2 closes only the 2intent-feed.jsUNRESOLVED sites, leaving 5 CLASS-BOUNDARY sites (S3/S5 work) standing, so the assertion "stays red after S2 alone." Confirmed directly (_import_violations()): before the census/comment follow-up, 6 violations (the 5 documented class-boundary sites + the comment false-positive above); after, exactly the 5 sites the xfail reason names (app.js→gate.js,app.js→swb-session.js,staging-workbench.js→swb-create.js/swb-session.js,wheel.js→dispose.js). No xfail marker needed changing.tests/test_leg_shape.py tests/test_consumer_reach.py tests/test_profile_registration.py tests/carve_manifest tests/carve_arrival: unaffected by this diff (not re-run beyond the explicitvalidatelist above;tests/carve_conformanceneeds theopenDoxsubmodule over SSH, not available in this environment).🤖 Generated with Claude Code
Summary by Sourcery
Make the intent-feed integration optional so dispose and wheel views remain functional when the contributed module is unavailable.
New Features:
Bug Fixes:
Enhancements:
CI:
Tests: