Repository navigation
§ 3.4 S1: declare the web census and measure the boundary defect (three strict xfails) - #13
Conversation
docs/front-end-package-boundary.md (opensoft/openDox-spec #8 -> a44ac06d) § 4.5/§ 5 slice S1: land the src/opendox/web/ census as data (tests/fixtures/web_boundary_census.yaml, 42 files, applying the five rulings of opensoft/openXfactory#656 comment 5642758731 -- only views/explorer.js reclassifies, "?" -> C per Q2) plus tests/test_web_boundary.py with the note's four boundary assertions: 1. the census is complete (unmarked; passes today). 2. no file outside class B names a route another column declares (xfail(strict=True); 18 real sites today). 3. every relative import resolves, and no class-A/C file imports a class-B module (xfail(strict=True); 7 real sites today -- the 2 RULED not_moved intent-feed.js imports plus 5 further class-boundary imports the census itself footnotes). 4. no class-C file, and no declared class-A tail, carries a governance literal (xfail(strict=True); every one of the 17 in-scope files trips at least one hit today). Also adds a companion (unmarked) check that the two declared § 2.2 rule 3 exemptions (composed-model.js's COMPOSED_COLLECTIONS, doxbench-state.js's SCOPE_KINDS) are real and out of assertion 4's scope, per the note's "an exemption that is silence is how a literal survives a vocabulary sweep." .github/workflows/validate.yml adds the new test to its explicit --noconftest list in this same commit, so the required check is never red for a file three of whose four assertions are known-red. Lane: openxfactory-4-opendox-extraction Refs opensoft/openXfactory#656 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reviewer's GuideS1 establishes a checked-in census for all 42 web files and adds four boundary assertions—three strict XFAIL defect measurements plus one passing census ratchet—then runs the new test in CI without changing web sources or route bindings. Flow diagram for S1 boundary checksflowchart TD
Start[Run test_web_boundary.py] --> CensusCheck[Verify every web file is classified once]
CensusCheck --> DefectChecks[Measure boundary defects]
DefectChecks --> Ownership[Ownership violations outside class B\n18 sites — strict XFAIL]
DefectChecks --> Imports[Unresolved or cross-class imports\n7 sites — strict XFAIL]
DefectChecks --> Literals[Governance literals in scoped files\n1,377 hits — strict XFAIL]
Ownership --> Exemptions[Verify declared exemptions are real]
Imports --> Exemptions
Literals --> Exemptions
Exemptions --> Result[Census and exemption checks pass\nDefect checks remain expected failures]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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 15 hours by commenting @sourcery-ai review. Upgrade to get a review now.
There was a problem hiding this comment.
🟡 Changes recommended
Four moderate review findings remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds an executable census and boundary checks for src/opendox/web, with known defects tracked as strict expected failures and wired into CI.
Changes:
- Adds a line-count-verified YAML census.
- Adds boundary, import, governance-literal, and exemption checks.
- Runs the new test module in validation.
File summaries
| File | Reviewed changes and findings |
|---|---|
tests/test_web_boundary.py |
Implements boundary measurements. Four moderate findings remain: the governance scan includes comments and identifiers; ? classifications lack phase enforcement; exemption checks do not verify declarations; and row-level exemptions are not cross-checked. |
tests/fixtures/web_boundary_census.yaml |
Declares the classified frontend file inventory and exemptions. |
.github/workflows/validate.yml |
Adds the boundary test module to CI validation. |
Review details
Suppressed comments (3)
tests/test_web_boundary.py:132
- This unmarked assertion never enforces the second half of its documented contract:
?is accepted byVALID_CLASSESand there is no current-slice/deadline check. After S4, a forgotten transitional row would still pass this ratchet, contrary to § 4.5 point 1; carry an explicit phase/allowlist and reject?once S4 is reached (or update the assertion as part of S4).
bad_class_rows = sorted(row["path"] for row in _ROWS if row["class"] not in VALID_CLASSES)
assert not bad_class_rows, (
f"row(s) with a class outside {sorted(VALID_CLASSES)}: {bad_class_rows}"
)
tests/test_web_boundary.py:379
- Checking
identifier in textdoes not prove that the exempt symbol is still declared: a comment or unrelated string containingCOMPOSED_COLLECTIONS/SCOPE_KINDSwould satisfy this assertion after the real declaration was removed. Match a declaration/export (or parse the module) so this bookkeeping check cannot silently validate a stale exemption.
assert exemption["identifier"] in text, (
f"declared exemption names {exemption['identifier']!r}, which does not "
f"appear in {path} -- the exemption is stale"
tests/test_web_boundary.py:367
- The fixture repeats each exemption in
row.exemptand indeclared_exemptions, but this check only iterates_EXEMPTIONS; it never verifies the row-level fields. Those two sources of truth can drift while the companion test remains green, undermining the stated bookkeeping guarantee. Either remove the unused row fields or assert that the(path, exempt)pairs match the declared list before checking each exemption.
def test_declared_governance_literal_exemptions_are_real_and_out_of_scope() -> None:
in_scope_paths = {row["path"] for row in _assertion_4_scope()}
for exemption in _EXEMPTIONS:
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot (PR review, tests/test_web_boundary.py:330) caught that `_governance_literal_violations` ran the word-boundary regex over each file's raw text, so a `//`, `/* */` or `<!-- -->` comment describing the pipeline in prose counted the same as a real runtime literal. Verified against the live tree: views/model.js:8-9's own "docs -> clusters -> possibles -> staged picks -> proposals -> realized" sentence and views/board.js:1-5's "Four lifecycle columns -- brainstorm, staged, active proposals, realized/archived" both trip six of the eight watched words as pure prose; styles.css carries 197 `/* */` blocks, starting with line 1's own "grown verbatim from the staged mockup". Left unstripped, S7 parameterizing every genuine literal would still not turn the assertion green, which defeats its purpose as the S7 ratchet (note `docs/front-end-package-boundary.md` § 4.5 point 4). `_strip_comments_for_scan` blanks comment syntax per extension (`.js`: `//` + `/* */`, quote-aware so a comment marker inside a string literal is left alone; `.css`: `/* */` only; `.html`: `<!-- -->`) to spaces, preserving every newline so `_line_of` still reports the correct line for a surviving match. Verified this does not silently empty the assertion: comment-stripped hits fall from 1,377 to 841 across the 17 in-scope files, and every file still carries at least one hit (minimum 3, in views/outline-model.js) -- so the assertion keeps failing today for a real, in-code reason and `strict=True` cannot XPASS out from under S1. `validate`'s explicit list (tests/test_leg_shape.py tests/test_consumer_reach.py tests/test_profile_registration.py tests/test_web_boundary.py --noconftest) still reports 73 passed, 3 xfailed, unchanged in shape. Not fixed here, flagged in the xfail reason on the same footing as assertions 2/3's own fidelity-over-tidiness notes: a bare identifier or property access that only reads a snapshot schema key (`s.documents`, `s.clusters`) still trips the sweep even though note § 2.2 rule 3 treats a schema key as distinct from a rendered word. Left for S7 (or a further amendment) to decide against the real sites it parameterizes. 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
The census does not enforce the documented S4 cutoff, and strict xfails accept unexpected exceptions.
Review details
Suppressed comments (4)
Previously missed (1) — in code that hasn't changed since the last review.
tests/test_web_boundary.py:197
- This xfail accepts any exception as an expected failure because
raisesis omitted;strict=Trueonly rejects XPASS, so a bug in_route_ownership_violations()(or a malformed census causing aKeyError/FileNotFoundError) would keep CI green as XFAIL instead of failing the check. Restrict the marker to the known assertion failure so unexpected test errors remain visible, and apply the same guard to the other two strict markers below.
This issue also appears in the following locations of the same file:
- line 273
- line 454
tests/test_web_boundary.py:111
- This assertion never enforces the documented S4 cutoff for transitional
?rows: it only checks path coverage, duplicates, classes, and LOC, so the four current?entries can remain indefinitely while this unmarked test still passes. §4.5 says a?row must fail after S4; add a phase-aware/explicit S4 census guard (or revise the contract so this test no longer claims to enforce that cutoff).
def test_every_web_file_is_classified_exactly_once() -> None:
real = _real_web_files()
declared = set(_ROWS_BY_PATH)
missing_rows = sorted(real - declared)
tests/test_web_boundary.py:275
- As with the other strict marker, omitting
raisesmakes every exception from the import scanner an expected XFAIL; an implementation/parser error could therefore be silently accepted by CI. Addraises=AssertionErrorso only the intended failing assertion is tolerated.
@pytest.mark.xfail(
strict=True,
reason=(
tests/test_web_boundary.py:456
- This strict marker also treats unexpected exceptions from the governance scan as an expected XFAIL because
raisesis unspecified. Addraises=AssertionErrorso scanner regressions or fixture errors fail validation rather than being hidden by the known defect marker.
@pytest.mark.xfail(
strict=True,
reason=(
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite



Lane: openxfactory-4-opendox-extraction
Refs opensoft/openXfactory#656
What
Slice S1 — "Declare the census and measure the defect" of
docs/front-end-package-boundary.md(opensoft/openDox-spec #8 ->a44ac06d), § 5. Applies the five rulings from the governing issue'snewest comment before this PR, opensoft/openXfactory#656 comment
5642758731
(Brett Heap, 2026-09-12T02:07:53Z: "RULED — § 3.4 front-end package
boundary ... every recommended answer adopted" / "RULED, same sitting ->
START S1-S3 NOW, with the note amended to carry these rulings").
No file under
src/opendox/web/moves. No route binding changes. This PRonly adds a declared census, a test that measures the boundary the tree
does not have yet, and the workflow wiring to run it without turning the
required check red.
Files added / changed
tests/fixtures/web_boundary_census.yaml(new) — the declaredcensus: all 42 files under
src/opendox/web/, each with a class(A/B/C/
?), applying the five Q1-Q5 rulings against the note's own§ 3.2 table. Only
views/explorer.jsactually reclassifies here,from
?to C (Q2: "neitherexplorer.jsnor the drill banner isclass B ...
explorer.jsis class C"). The other four rulings (Q1docs.js stays A/tail; Q3 repo-selector.js SPLITS at S4, stays
?here;Q4
/source/moves at S6, viewer.js stays A; Q5 intent-feed.js fixed atS2) don't change any row S1 owns. Totals: A 20 files/11,702 lines, B 4
files/1,597 lines, C 14 files/11,854 lines,
?4 files/5,432 lines —42 files / 30,585 lines total, matching the live tree exactly (verified
by the test itself, not just asserted).
tests/test_web_boundary.py(new) — the note's four boundaryassertions (§ 4.5), plus one companion bookkeeping check:
test_every_web_file_is_classified_exactly_once— unmarked,passes today. The ratchet: a new/renamed/removed file with no
matching census row fails immediately. Also checks the fixture's own
locprovenance against the tree (wc -l-equivalent), so a stalecount is itself caught.
test_no_ownership_violation_outside_class_b—xfail(strict=True).18 real sites today (10 gate prefix + 3 openxFactory adapter
lanes + 5 openXdox projection routes), matching the note's own count
exactly.
test_every_relative_import_resolves_and_stays_in_class—xfail(strict=True). 7 real sites today: the note's ownintent-feed.jsdangling-import example (2 sites) plus 5 furtherclass-A/C-imports-class-B sites the census itself footnotes
(
app.js->gate.js,app.js->swb-session.js,staging-workbench.js->swb-create.jsand ->swb-session.js,wheel.js->dispose.js). See "A finding worth flagging" below —this is more than the note's closing paragraph counts.
test_no_class_c_file_carries_a_governance_literal—xfail(strict=True). 1,377 hits across all 17 in-scope files(the 14 class-C files + the 3 declared class-A tails) against a
closed word list (the eight controlled
Status:words plus thistree's own stage vocabulary —
COLUMN_KEYS,WHEEL_KEYS/WHEEL_LABELS,board.js's four columns,styles.css's four--st-*tokens, evidenced directly against the live tree, notguessed).
test_declared_governance_literal_exemptions_are_real_and_out_of_scope— unmarked, passes today. Not one of the note's four; it gives
the § 2.2 rule 3 exemptions (
composed-model.js'sCOMPOSED_COLLECTIONS,doxbench-state.js'sSCOPE_KINDS) teeth,per the note's "an exemption that is silence is how a literal
survives a vocabulary sweep."
.github/workflows/validate.yml— addstests/test_web_boundary.pyto the explicit
--noconftestpytest list, in this same commit, perthe note's own instruction (§ 4.5 closing paragraph) and matching how
its three neighbours were added.
A finding worth flagging (not resolved unilaterally here)
Implementing assertions 2 and 3 to their FULL stated width (not narrowed
to make a slice-attribution count come out even) surfaced two places
where the note's own text disagrees with itself about which slice(s)
close an assertion:
the 18 sites and "S6" for the remaining 4; the note's own closing
paragraph instead says "2 by S5 and S6." I cited the closing paragraph
in the
xfailreason=, and recorded both readings in the reason textand the test's own comments, rather than picking one silently.
("no class-A/C file imports a class-B module," § 4.5 point 3, with no
narrower scope stated), this assertion has 7 real sites today, not
2 — S2's own scope (
dispose.js,wheel.js,styles.css) closes onlythe 2 unresolved
intent-feed.jsimports; the other 5(
app.js->gate.js,app.js->swb-session.js,staging-workbench.js->swb-create.js/swb-session.js,wheel.js->dispose.js) are the same shape S3's view registry andS5's gate-loop contribution close, per § 4.1/§ 5 — not S2.
Neither disagreement breaks anything mechanically:
xfail(strict=True)only fires on an unexpected pass, so if S2 lands without closing all 7
sites, assertion 3 simply stays XFAIL (green check) rather than going
XPASS-then-red; the risk is only that a future author reads "3 by S2,"
removes the marker after S2 alone, and gets an immediate (and correct) red
check. Flagging it here rather than quietly re-scoping the test to match
the note's summary, since the note is a ruled/adopted record and I did not
want to unilaterally edit it out of S1's scope.
Verification (local run, matching
validate.ymlexactly)strict=Truewas also verified mechanically (not just asserted): athrowaway patch that made assertion 2's check trivially pass while
leaving its marker in place turned it into a hard
FAILEDwith[XPASS(strict)], then the patch was reverted (working tree confirmedclean by diff before committing).
Coordination
Scope is exactly the census data file, the test file, and
validate.yml's explicit list — no file S2 or S3 own. Q-L1: both newfiles are new (no carve-manifest row to check);
.github/workflows/ validate.ymlcarries no manifest row either (leg-assembled, confirmedabsent from
docs/opendox-carve-manifest.yaml).🤖 Generated with Claude Code
Summary by Sourcery
Declare and continuously measure the web front-end package boundary while preserving a green validation check until subsequent slices resolve the known defects.
New Features:
CI:
Tests: