Skip to content

§ 3.4 RULED Q7 row annotation: the CSS extraction — one row, 89 declared deletions - #1068

Merged
brettheap merged 36 commits into
mainfrom
chore/q7-css-extraction-declared-edits
Sep 17, 2026
Merged

brettheap merged 36 commits into
mainfrom
chore/q7-css-extraction-declared-edits

Conversation

@brettheap

@brettheap brettheap commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Refs #656 (stays OPEN).
CLAIM: 5699629486 (openxFactory#656 comment 5699629486)

LANDING ORDER — this act is three pull requests and they land in this order:

  1. openxFactory chore/q7-css-extraction-declared-edits — the Q-L1 row annotation. LANDS FIRST: it is what makes the openDox-code leg's 89 removed lines a DECLARED edit instead of an arrival-undeclared-edit refusal, and it carries the created-file admissions for both legs.
  2. openDox-code build/q7-binding-stylesheets — the ViewBinding.styles slot, the <link> injection, and the 59 rule blocks leaving src/opendox/web/styles.css.
  3. the pin advance — openXdox-code's pyproject.toml pins opendox @ …@a99eba03, which has no styles field. The bump to an openDox carrying leg 2 is what turns the sheets on.
  4. openXdox-code build/q7-binding-stylesheets — the four sheets beside the modules. Safe to land at ANY point after 1: it feature-detects the pinned ViewBinding and its sheets are inert until the pin moves.

THIS PR IS STEP 1.


RULED openxFactory#656 comment 5700475319 (Brett Heap, 2026-09-16, by interactive multi-choice) — the two questions this act put to him, both answered as this act already does them, and both now CITED where the decision is stated (a decision recorded without its ruling reads, one act later, as the author's preference):

  1. FOUR sheets for six bindings stands — a single styles specifier, href de-duplication LOAD-BEARING. Refused: a tuple-valued styles with a seventh shared sheet; six sheets duplicating the eleven blocks both workbench modules name.
  2. The 13 NON---st- custom properties MOVE VERBATIM, with the coupling REGISTERED BY MEASUREMENT in openxdox.view_extensions.STYLE_RESIDUE["open_coupling"], asserted by openXdox-code's suite. Refused: widening the stable surface by ruling; a second declared token family; deferring to the BUILD arc.

RULED Q7 (Brett Heap, 2026-09-12, #656 comment 5648049748): "a contributed
binding's CSS lives WITH THE BINDING, in its own sheet; openDox's declared
design tokens (the --st-* family, S7) are the one stable styling surface;
nothing else in styles.css is."
This is the declared-edit window for the
extraction #1023 § 6 registered as owed and the S7 LANDED note (5688498049)
register item 1 carried forward. It lands FIRST, per RULED Q-L1
(5628560136).

ONE ROW. scripts/ideation_dashboard/web/styles.css gains ONE adapter calls
entry of 89 carve-commit lines. The row was already moved_with_declared_edit
and already a carrier — slice S7 converted it — so rows (456), dispositions
(143 / 175 / 138), the carrier count (176) and the replica count (20) all stand
where the pre-existing openxdox_code annotation (#1031) left them. Three
absolutes move and are re-derived at every site that states them: 2454 ->
2543
declared lines, adapter calls 1482 -> 1571, opendox_code
1667 -> 1756. (This branch was opened on a main that has since taken #1031
and #1032; main was merged in and every figure re-derived over the MERGED
document, so 2454 + 89 = 2543 is a CHECK on that derivation and not its
source.)

THE FLOOR QUESTION, SETTLED BY MEASUREMENT BEFORE A LINE OF EITHER LEG WAS
WRITTEN. #1023 § 6 recorded that "a stylesheet block leaves for another leg"
fits none of RULING OQ-1's three classes, and it was right about the document it
read: that row was moved_verbatim, carrying no edits: at all. Slice S7
(#1030 -> b3a75537) converted it and declared 152 of its lines
adapter calls, so the wall is gone and the surviving question is narrower — is
a DELETION declarable? The floor answers twice. BY PRECEDENT: the § 3.4 slice-S6
annotation declared the /source re-homing's 122 serve_projection.py
DELETIONS under this same class and landed. BY MEASUREMENT:
scripts/verify-carve-arrival.py --destination opendox_code --phase B, run
against a throwaway prototype of the extraction with § 5.5's four --replica-at
flags, REFUSES arrival-undeclared-edit and names exactly these 89 carve lines;
the same run against a scratch manifest carrying them answers OK ... 119 row(s) arrived, 35 digest(s) verified, 84 declared-edit row(s) within their lines, 1 unapplied; 4 of 4 declared replica(s). Every line below is that refusal's own
output, re-derived by _check_declared_lines' algorithm against the leg head
and never transcribed.

WHAT THE 89 ARE. 88 DELETIONS AND ONE REPLACEMENT IN PLACE, measured by the
same opcode walk that produced the line numbers: 59 rule blocks leave openDox's
stylesheet for four sheets
openXdox-code ships beside the bindings that own them. A block leaves only when
EVERY class in its selector is named by openXdox's six contributed modules and
by no file of openDox's own bundle — scripts/measure_opendox_css_census.py,
added to this repository by this act and driven by
tests/carve_manifest/test_css_census.py at openDox-code 0b4e8bbf / openXdox-code 0a0265f7: 54 exclusive
classes, 18 shared (18, NOT 21: Copilot's rounds 5-6 narrowed the census's gate-side scan again — an assignment counts only where the target is class-named, and a .token only inside a literal SHAPED like a selector with the dot in selector POSITION — so "e.g. Field Pilots", "gate.lens: ..." and btn.title = "... this staging topic " stop naming g, lens and topic. WHAT LEAVES IS UNCHANGED: the same 54 gate-exclusive classes, the same 59 blocks at the same extents, the same 89 lines — a class moving from SHARED to openDox's own is a class that stays either way), and the shared ones stay, as does every --st-* token in
all four theme blocks. The tool reproduces STYLE_RESIDUE's 51 / 24 EXACTLY
at cb343ae8 under its literal-only scan, which is how the 51 is known to have
been three short: .dispose-accepted, .dispose-rejected and
.dispose-deferred are built by "disposebtn dispose-" + v.outcome
(dispose.js:275) and no literal search can see a class name that is never
written down.

FIVE ADMISSIONS (docs/opendox-carve-admissions.yaml, alphabetical, each
since: its file's introducing leg commit): tests/test_binding_stylesheets.py
at opendox_code (144a4a33), and src/openxdox/web/views/{dispose, gate-projects,gate,swb}.css at openxdox_code (b18687ce). FOUR sheets for
six bindings, both departures measured: gate-lens.js owns no selector of its
own, and the two workbench bindings name ONE sheet because eleven of its
nineteen blocks are named by both.

RE-DERIVED, CELL BY CELL: the runbook § 2 disposition table and class totals,
its per-destination table, its "one replica line" paragraph, its Q-L8 (c)
paragraph, the manifest header's movement log (this act appended), and the three
scripts' docstrings that carry the absolute (carve_lines.py,
validate-carve-manifest.py, verify-carve-arrival.py) plus README's runbook
entry. The round-10/11 tests that read those blocks against the manifest were
RED until each was updated, which is what they are for.

THE PIN: Q7_WINDOW / Q7_CONVERTED, read off the literal with ast (round
8's rule) so a repeated key cannot hide, asserting the entry as a contiguous run
occurring exactly once AND following slice S7's on the same row, refusing a
repeated line number over the WHOLE row (S7's 152 and this act's 89 must be 241
distinct numbers), and re-deriving 89 / 1 entry / {"adapter calls": 89} /
2454 + 89 = 2543. Slice S7's own § 2 conversion check is AMENDED in the same
act, for the reason its § 1 was amended by S8: a conversion claims S7's entries
are the row's FIRST, not its ONLY — the second half was true only while S7 was
the newest act on all seventeen.

GATE EVIDENCE, re-measured at the current head: python3 scripts/validate-carve-manifest.py -> OK ... 456 row(s) ... 143 moved_verbatim, 175 moved_with_declared_edit, 138 not_moved; 318 digest(s) recomputed; 4 row(s) RE-DESTINED. tests/carve_manifest/ -> 236 passed, 1
skipped
; tests/carve_arrival/ -> 158 passed;
tests/carve_manifest/test_css_census.py -> 55 passed, 1 skipped; and the
pinned census RE-DERIVED against checkouts of both cited revisions -> 1
passed
. Arrival re-proved from THIS branch's manifest against openDox-code
#27's head 9e25f684: OK ... 119 row(s) arrived, 35 digest(s) verified, 84 declared-edit row(s) within their lines, 1 unapplied; 4 of 4 declared replica(s); 150 file(s) under src/opendox, tests with none undeclared; 22 declared admission(s) used.

THE REVIEW ARC: 18 Copilot rounds, every finding fixed or answered by
measurement and every thread resolved. They found nothing wrong with WHAT
LEAVES and a great deal wrong with the SCANNER that decides it, and every
repair was checked the same way — the FULL per-token census at 0b4e8bbf /
0a0265f7, diffed before and after. It is BYTE-IDENTICAL across all of them
(md5 e881976a2f437b3f63fec9be93defc00): 54 gate-exclusive classes, 18
shared, 59 exclusive blocks, an 89-line union, 10 reading an
--st-* token — and 0 blocks / 0 lines at the two leg heads, which is the
extraction working.

THE WINDOW IS 89 CARVE LINES AND THE CENSUS'S UNION IS 89 LEG LINES, SAME SIZE
AND NOT THE SAME SET (round 17, now decomposed in the row note): measured
0b4e8bbf -> 9e25f684 against carve blob b075fd91dc8f, 99 lines of the
leg's file change and 89 have a carve counterpart — exactly this window,
symmetric difference []. Of them 78 sit inside the 59 exclusive blocks, 9 are
the comment and brace lines the moved rules carry out, and 2 are the mixed pair
(carve :161 split, carve :2514 moved whole); the other 10 changed lines are
lines slice S7 created and have no carve counterpart at all.

WHAT THIS PR DOES NOT DO. It moves no byte at either leg — the legs are
opensoft/openDox-code build/q7-binding-stylesheets and
opensoft/openXdox-code build/q7-binding-stylesheets, both DRAFT, both landing
after this. It converts no row, admits no replica, and touches no digest. It
does NOT annotate the three PRE-EXISTING openxdox_code undeclared-edit rows
(gate_console.py 25, generator.py 14, test_generator.py 2): measured
identical at this branch's leg head and at openXdox-code main 0a0265f7, they
are oxF #1031's act and this one adds no line to them. It does NOT close the
coupling RULED Q7's own sentence leaves open — the four sheets read 13 of
openDox's NON-token custom properties, which Q7 says are not a stable surface;
the count is pinned by openXdox-code's own suite and registered in
STYLE_RESIDUE.open_coupling rather than hidden.

Summary by Sourcery

Declare the Q7 stylesheet extraction on the existing carve row and provide the measurements, admissions, documentation, and tests needed to validate its ordered arrival.

New Features:

  • Add a reproducible CSS census tool and fixture coverage for identifying binding-owned stylesheet rules and validating the extraction boundary.

Bug Fixes:

  • Correct carve-line accounting and validation references to include the 89 newly declared stylesheet edits.

Enhancements:

  • Annotate the existing stylesheet row with 89 declared adapter calls edits, covering 88 deletions and one selector replacement.
  • Record five destination-side file admissions for the binding stylesheet test and four contributed CSS sheets.
  • Re-derive and pin manifest totals, per-destination counts, landing-order metadata, and disposition invariants for the Q7 CSS extraction.

Documentation:

  • Update the carve manifest, admissions record, cutover runbook, README, and validation documentation for the Q7 CSS extraction.

Tests:

  • Add manifest and arrival assertions for the Q7 declared-edit window, admissions, totals, and unchanged dispositions.
  • Add comprehensive CSS census tests covering selector ownership, token preservation, parsing, line numbering, and extraction safety.

brettheap and others added 2 commits September 16, 2026 14:04
…red deletions

RULED Q7 (Brett Heap, 2026-09-12, `#656` comment `5648049748`): *"a contributed
binding's CSS lives WITH THE BINDING, in its own sheet; openDox's declared
design tokens (the `--st-*` family, S7) are the one stable styling surface;
nothing else in `styles.css` is."* This is the declared-edit window for the
extraction `#1023` § 6 registered as owed and the S7 LANDED note (`5688498049`)
register item 1 carried forward. It lands FIRST, per RULED Q-L1
(`5628560136`).

ONE ROW. `scripts/ideation_dashboard/web/styles.css` gains ONE `adapter calls`
entry of 89 carve-commit lines. The row was already `moved_with_declared_edit`
and already a carrier — slice S7 converted it — so rows (456), dispositions
(143 / 175 / 138), the carrier count (176) and the replica count (20) all stand
where slice S8 left them. Three absolutes move and are re-derived at every site
that states them: 2406 -> 2495 declared lines, `adapter calls` 1438 -> 1527,
`opendox_code` 1667 -> 1756.

THE FLOOR QUESTION, SETTLED BY MEASUREMENT BEFORE A LINE OF EITHER LEG WAS
WRITTEN. `#1023` § 6 recorded that "a stylesheet block leaves for another leg"
fits none of RULING OQ-1's three classes, and it was right about the document it
read: that row was `moved_verbatim`, carrying no `edits:` at all. Slice S7
(`#1030` -> `b3a75537`) converted it and declared 152 of its lines
`adapter calls`, so the wall is gone and the surviving question is narrower — is
a DELETION declarable? The floor answers twice. BY PRECEDENT: the § 3.4 slice-S6
annotation declared the `/source` re-homing's 122 `serve_projection.py`
DELETIONS under this same class and landed. BY MEASUREMENT:
`scripts/verify-carve-arrival.py --destination opendox_code --phase B`, run
against a throwaway prototype of the extraction with § 5.5's four `--replica-at`
flags, REFUSES `arrival-undeclared-edit` and names exactly these 89 carve lines;
the same run against a scratch manifest carrying them answers `OK ... 119 row(s)
arrived, 35 digest(s) verified, 84 declared-edit row(s) within their lines, 1
unapplied; 4 of 4 declared replica(s)`. Every line below is that refusal's own
output, re-derived by `_check_declared_lines`' algorithm against the leg head
and never transcribed.

WHAT THE 89 ARE. 59 rule blocks leave openDox's stylesheet for four sheets
openXdox-code ships beside the bindings that own them. A block leaves only when
EVERY class in its selector is named by openXdox's six contributed modules and
by no file of openDox's own bundle — `measure-css-census.py` (persisted with
this act) at openDox-code `0b4e8bbf` / openXdox-code `0a0265f7`: 54 exclusive
classes, 22 shared, and the shared ones stay, as does every `--st-*` token in
all four theme blocks. The tool reproduces `STYLE_RESIDUE`'s `51 / 24` EXACTLY
at `cb343ae8` under its literal-only scan, which is how the 51 is known to have
been three short: `.dispose-accepted`, `.dispose-rejected` and
`.dispose-deferred` are built by `"disposebtn dispose-" + v.outcome`
(`dispose.js`:275) and no literal search can see a class name that is never
written down.

FIVE ADMISSIONS (`docs/opendox-carve-admissions.yaml`, alphabetical, each
`since:` its file's introducing leg commit): `tests/test_binding_stylesheets.py`
at `opendox_code` (`144a4a33`), and `src/openxdox/web/views/{dispose,
gate-projects,gate,swb}.css` at `openxdox_code` (`b18687ce`). FOUR sheets for
six bindings, both departures measured: `gate-lens.js` owns no selector of its
own, and the two workbench bindings name ONE sheet because eleven of its
nineteen blocks are named by both.

RE-DERIVED, CELL BY CELL: the runbook § 2 disposition table and class totals,
its per-destination table, its "one replica line" paragraph, its Q-L8 (c)
paragraph, the manifest header's movement log (this act appended), and the three
scripts' docstrings that carry the absolute (`carve_lines.py`,
`validate-carve-manifest.py`, `verify-carve-arrival.py`) plus README's runbook
entry. The round-10/11 tests that read those blocks against the manifest were
RED until each was updated, which is what they are for.

THE PIN: `Q7_WINDOW` / `Q7_CONVERTED`, read off the literal with `ast` (round
8's rule) so a repeated key cannot hide, asserting the entry as a contiguous run
occurring exactly once AND following slice S7's on the same row, refusing a
repeated line number over the WHOLE row (S7's 152 and this act's 89 must be 241
distinct numbers), and re-deriving 89 / 1 entry / `{"adapter calls": 89}` /
2406 + 89 = 2495. Slice S7's own § 2 conversion check is AMENDED in the same
act, for the reason its § 1 was amended by S8: a conversion claims S7's entries
are the row's FIRST, not its ONLY — the second half was true only while S7 was
the newest act on all seventeen.

GATE EVIDENCE: `python3 scripts/validate-carve-manifest.py` -> `OK ... 456
row(s) ... 143 moved_verbatim, 175 moved_with_declared_edit, 138 not_moved; 318
digest(s) recomputed; 4 row(s) RE-DESTINED`. `pytest -q tests/carve_manifest
tests/carve_arrival tests/carve_conformance tests/opendox_pin tests/openxdox_pin`
-> 425 passed. Arrival re-proved from THIS branch's manifest against the leg
head: `OK ... 84 declared-edit row(s) within their lines ... 22 declared
admission(s) used`.

WHAT THIS PR DOES NOT DO. It moves no byte at either leg — the legs are
opensoft/openDox-code `build/q7-binding-stylesheets` and
opensoft/openXdox-code `build/q7-binding-stylesheets`, both DRAFT, both landing
after this. It converts no row, admits no replica, and touches no digest. It
does NOT annotate the three PRE-EXISTING `openxdox_code` undeclared-edit rows
(`gate_console.py` 25, `generator.py` 14, `test_generator.py` 2): measured
identical at this branch's leg head and at openXdox-code main `0a0265f7`, they
are oxF #1031's act and this one adds no line to them. It does NOT close the
coupling RULED Q7's own sentence leaves open — the four sheets read 13 of
openDox's NON-token custom properties, which Q7 says are not a stable surface;
the count is pinned by openXdox-code's own suite and registered in
`STYLE_RESIDUE.open_coupling` rather than hidden.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot-shaped defect, found before the push: the row note and the movement
log both cited `measure-css-census.py` as "persisted with this act", which
names a file no reader of this repository can open. The figure it produces —
54 gate-exclusive classes over 59 rule blocks — is the whole basis of which
lines this act declares, so a reader must be able to check it somewhere other
than in a helper directory.

Both citations now name the two places it IS checkable: the tool source posted
on this pull request, and openDox-code `tests/test_binding_stylesheets.py`,
which re-derives the same 54-class set from the six contributed modules
wherever an assembly has placed them and refuses a drift. No line number, no
count and no declared edit moves.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 16, 2026 15:02
@sourcery-ai

sourcery-ai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR performs only the Q7 manifest-side preparation: it records 89 stylesheet deletion lines on the already-edited styles.css row, admits the downstream test and four binding sheets, and updates validation tests and documentation to maintain consistent totals. It does not move implementation bytes, advance pins, or add the stylesheet runtime behavior; those changes land in subsequent PRs.

Flow diagram for Q7 CSS extraction preparation

flowchart LR
    A["Existing styles.css manifest row"] --> B["Measure 59 exclusive CSS rule blocks"]
    B --> C["Declare 89 deletion lines as adapter calls"]
    C --> D["Validate carve manifest and arrival"]
    D --> E["Downstream openDox-code and openXdox-code PRs"]
Loading

Flow diagram for Q7 manifest validation

flowchart LR
    A["Carve manifest"] --> V["validate-carve-manifest.py"]
    V --> D["318 rows and 2495 declared lines"]
    A --> R["verify-carve-arrival.py"]
    R --> P["Declared edits confined to listed lines"]
    E["Five downstream file admissions"] --> R
Loading

File-Level Changes

Change Details Files
Annotate the existing stylesheet manifest row with the 89 declared deletions introduced by the Q7 CSS extraction.
  • Append one adapter calls edit entry covering the 89 extracted styles.css lines.
  • Add manifest tests that pin the row, class, ordering, uniqueness, totals, and unchanged disposition counts.
  • Amend S7 assertions to allow later entries appended to a previously converted row.
docs/opendox-carve-manifest.yaml
tests/carve_manifest/test_carve_manifest.py
Admit the extraction's newly created proof and stylesheet files for the two downstream legs.
  • Admit the openDox stylesheet integration test.
  • Admit the four openXdox binding sheets: dispose, gate-projects, gate, and swb.
  • Document the admissions and their introducing commits.
docs/opendox-carve-admissions.yaml
Reconcile runbook, documentation, and script metadata with the new declared-edit totals.
  • Update totals from 2406 to 2495 declared lines and adapter calls from 1438 to 1527.
  • Update the openDox destination subtotal from 1667 to 1756.
  • Refresh line-count descriptions and the README runbook reference.
README.md
docs/opendox-cutover-runbook.md
scripts/carve_lines.py
scripts/validate-carve-manifest.py
scripts/verify-carve-arrival.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

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

THE CENSUS TOOL, in full — the manifest's two citations promise it here.

docs/opendox-carve-manifest.yaml says of this act's figures that the tool's "source is posted on this pull request, and openDox-code's own tests/test_binding_stylesheets.py RE-DERIVES the same 54-class set from the six contributed modules wherever an assembly has placed them". This comment is the first half of that; the second half is test_the_gate_exclusive_set_is_re_derived_where_the_modules_are_present on opensoft/openDox-code#27.

HOW TO RE-RUN IT. Clone openDox-code and openXdox-code side by side and:

python3 measure-css-census.py <openDox-code> <openXdox-code> --json census.json

At openDox-code 0b4e8bbf / openXdox-code 0a0265f7 it prints
class_counts_narrow {"gate_exclusive": 54, "shared": 22, "opendox_only": 520, "unreferenced": 30},
59 exclusive blocks and 89 lines. THE CONTROL RUN — the one that shows the method is the S5
author's and not a new one — points it at the commit STYLE_RESIDUE was measured at, with the
six modules taken from openDox's own views/ where they still lived:

git -C <openDox-code> worktree add ../dox-cb343ae8 cb343ae8 --detach
mkdir gate-cb && for f in gate.js gate-lens.js gate-projects.js dispose.js swb-create.js swb-session.js; do
  cp ../dox-cb343ae8/src/opendox/web/views/$f gate-cb/; done
python3 measure-css-census.py ../dox-cb343ae8 <openXdox-code> --gate-dir gate-cb

Without the concatenation rule that run answers 51 / 24 — STYLE_RESIDUE's own figures,
reproduced exactly. With it, 54 / 24: the three the literal scan could not see.

measure-css-census.py (click to expand)
#!/usr/bin/env python3
"""RE-MEASURE the gate loop's CSS census — RULED Q7 (`opensoft/openxFactory#656`
comment `5648049748`): *"a contributed binding's CSS lives WITH THE BINDING, in
its own sheet; openDox's declared design tokens (the `--st-*` family, S7) are
the one stable styling surface; nothing else in `styles.css` is."*

    measure-css-census.py <opendox-code checkout> <openxdox-code checkout> [--json out.json]

`openxdox.view_extensions.STYLE_RESIDUE` records 51 exclusive / 24 shared
classes MEASURED at openDox-code `cb343ae8` — three slices ago. This re-derives
both halves at whatever heads it is pointed at, and adds the two things the old
figure did not carry: WHICH RULE BLOCKS the exclusive classes own (so an
extraction has bytes to move, not just names), and which of those blocks READ a
`--st-*` token (so the sheet that leaves can be checked against Q7's "the one
stable styling surface" rule).

THE SCANNER IS THE LEG'S OWN. String literals come from `_js_spans`, copied
verbatim in behaviour from openDox-code `tests/test_web_boundary.py` (slice S7's
regex-literal-aware span walk) rather than from a fresh regex, so a token this
tool says a module names is a token that leg's own suite would see.

CLASSIFICATION, per class token declared as a real selector in `styles.css`:
  gate_exclusive  named by >=1 of openXdox's six contributed modules and by NO
                  file of openDox's own bundle (app.js, index.html, views/*.js)
  shared          named by both columns
  opendox_only    named by openDox's bundle and not by the six
  unreferenced    named by no file on either side (a literal search cannot see a
                  token built by concatenation; these NEVER leave)
"""
from __future__ import annotations

import json
import re
import sys
from pathlib import Path

# --------------------------------------------------------------------------
# openDox-code tests/test_web_boundary.py's span walk, behaviour-for-behaviour.
# --------------------------------------------------------------------------
_JS_REGEX_PREFIX = re.compile(
    r"(?:[=(,:;!&|?{}\[\+\-*%<>~^]|^|\breturn\b|\btypeof\b|\bcase\b|\bin\b|\bof\b"
    r"|\bnew\b|\bdelete\b|\bvoid\b|\binstanceof\b|\bdo\b|\belse\b|\byield\b"
    r"|\bawait\b)\s*$"
)


def _js_spans(text: str) -> list[tuple[str, int, int]]:
    spans: list[tuple[str, int, int]] = []
    i, n = 0, len(text)
    while i < n:
        c = text[i]
        nxt = text[i + 1] if i + 1 < n else ""
        if c == "/" and nxt == "/":
            j = text.find("\n", i)
            j = n if j < 0 else j
            spans.append(("comment", i, j)); i = j; continue
        if c == "/" and nxt == "*":
            j = text.find("*/", i + 2)
            j = n if j < 0 else j + 2
            spans.append(("comment", i, j)); i = j; continue
        if c in "\"'`":
            quote, j = c, i + 1
            while j < n:
                if text[j] == "\\":
                    j += 2; continue
                if text[j] == quote:
                    break
                if quote == "`" and text[j] == "$" and j + 1 < n and text[j + 1] == "{":
                    depth, k = 1, j + 2
                    while k < n and depth:
                        if text[k] == "{":
                            depth += 1
                        elif text[k] == "}":
                            depth -= 1
                        k += 1
                    j = k; continue
                j += 1
            end = min(j + 1, n)
            spans.append(("string", i, end)); i = end; continue
        if c == "/":
            before = text[max(0, i - 40):i]
            if _JS_REGEX_PREFIX.search(before):
                j, in_class = i + 1, False
                while j < n:
                    ch = text[j]
                    if ch == "\\":
                        j += 2; continue
                    if ch == "[":
                        in_class = True
                    elif ch == "]":
                        in_class = False
                    elif ch == "/" and not in_class:
                        break
                    elif ch == "\n":
                        break
                    j += 1
                if j < n and text[j] == "/":
                    spans.append(("regex", i, j + 1)); i = j + 1; continue
        i += 1
    return spans


def js_literal_text(text: str) -> str:
    """Every string literal of a module, concatenated — comments and regexes out."""
    return "\n".join(text[a + 1:b - 1] for kind, a, b in _js_spans(text)
                     if kind == "string")


# --------------------------------------------------------------------------
# TWO SCANS, and the census publishes the second while the extraction obeys the
# first.
#
# BROAD  — the token appears anywhere inside a string literal, on the class
#          alphabet's own word boundary. It cannot MISS a reference, so a class
#          it says openDox does not name is a class openDox does not name: this
#          is the scan the "does this block leave?" decision runs on, and being
#          over-inclusive on openDox's side is exactly the direction an
#          extraction wants to err in.
# NARROW — the token appears in a CLASS-BEARING position: after a `.` (a
#          selector string, `div.foo`, `.foo.bar`), inside a `class="…"`
#          attribute of a template literal or of `index.html`, or as one of a
#          literal that is a bare class list. This is what `STYLE_RESIDUE`'s
#          51 / 24 at `cb343ae8` counted — reproduced exactly by this tool at
#          that commit — so it is the figure the record moves forward.
# --------------------------------------------------------------------------
_CLASSTOK = re.compile(r"^[A-Za-z_][A-Za-z0-9_-]*$")

#: A class token BUILT BY CONCATENATION — `el("button", "disposebtn dispose-" +
#: v.outcome, …)` (`dispose.js`:275) — is named by no literal a word-boundary
#: search can see, and `STYLE_RESIDUE`'s 51 is exactly what that blindness
#: costs: `.dispose-accepted`, `.dispose-rejected` and `.dispose-deferred` are
#: the gate column's own and were counted `unreferenced` at `cb343ae8`. A
#: literal ENDING in a class-alphabet fragment that ends in `-`, or one whose
#: fragment runs straight into a `${…}` substitution, is a PREFIX: every
#: declared token starting with it is named by that file.
_PREFIX = re.compile(r"^([A-Za-z_][A-Za-z0-9_-]*-)(?:\$\{|$)")


def _literals(text: str, suffix: str) -> list[str]:
    if suffix == ".js":
        return [text[a + 1:b - 1] for kind, a, b in _js_spans(text)
                if kind == "string"]
    return (re.findall(r'class\s*=\s*"([^"]*)"', text)
            + re.findall(r"class\s*=\s*'([^']*)'", text))


def prefix_refs(text: str, suffix: str) -> set[str]:
    """Every class-name PREFIX this file concatenates onto."""
    out: set[str] = set()
    for s in _literals(text, suffix):
        for piece in s.split():
            m = _PREFIX.match(piece)
            if m:
                out.add(m.group(1))
    return out


def narrow_refs(text: str, suffix: str) -> set[str]:
    """Every class token `text` names in a class-bearing position."""
    out: set[str] = set()
    if suffix == ".js":
        literals = [text[a + 1:b - 1] for kind, a, b in _js_spans(text)
                    if kind == "string"]
    else:
        literals = (re.findall(r'class\s*=\s*"([^"]*)"', text)
                    + re.findall(r"class\s*=\s*'([^']*)'", text))
    for s in literals:
        out.update(re.findall(r"\.([A-Za-z_][A-Za-z0-9_-]*)", s))
        for m in re.finditer(r'class\s*=\s*"?([A-Za-z0-9_ -]*)', s):
            out.update(p for p in m.group(1).split() if _CLASSTOK.match(p))
        parts = s.split()
        if parts and all(_CLASSTOK.match(p) for p in parts):
            out.update(parts)
    return out


# --------------------------------------------------------------------------
# The stylesheet, parsed into RULE BLOCKS with their line extents.
# --------------------------------------------------------------------------
_TOKEN = re.compile(r"\.([A-Za-z_][A-Za-z0-9_-]*)")


def _blank_comments(css: str) -> str:
    out, i, n = [], 0, len(css)
    while i < n:
        if css[i] == "/" and i + 1 < n and css[i + 1] == "*":
            j = css.find("*/", i + 2)
            j = n if j < 0 else j + 2
            out.append(re.sub(r"[^\n]", " ", css[i:j]))
            i = j
            continue
        out.append(css[i]); i += 1
    return "".join(out)


def parse_blocks(css: str) -> list[dict]:
    """Every rule block, with its at-rule ancestry and 1-based line extent.

    A block is `{selector, at_rule, start, end, body}` where `start`/`end` are
    the first and last line of the whole construct AS IT SITS IN THE FILE
    (a nested rule's extent is its own, never its `@media`'s).
    """
    scan = _blank_comments(css)
    blocks: list[dict] = []
    stack: list[str] = []
    i, n, seg_start = 0, len(scan), 0

    def line_of(off: int) -> int:
        return css.count("\n", 0, off) + 1

    while i < n:
        c = scan[i]
        if c == "{":
            prelude = scan[seg_start:i].strip()
            pre_off = seg_start + (len(scan[seg_start:i]) - len(scan[seg_start:i].lstrip()))
            depth, j = 1, i + 1
            while j < n and depth:
                if scan[j] == "{":
                    depth += 1
                elif scan[j] == "}":
                    depth -= 1
                j += 1
            inner = scan[i + 1:j - 1]
            if prelude.startswith("@") and "{" in inner:
                stack.append(prelude)
                blocks.extend(parse_nested(css, scan, i + 1, j - 1, prelude, line_of))
                stack.pop()
                blocks.append({"selector": prelude, "at_rule": None,
                               "kind": "at_rule_wrapper",
                               "start": line_of(pre_off), "end": line_of(j - 1),
                               "body": css[i + 1:j - 1]})
            else:
                blocks.append({"selector": prelude, "at_rule": None,
                               "kind": "rule",
                               "start": line_of(pre_off), "end": line_of(j - 1),
                               "body": css[i + 1:j - 1]})
            i = j
            seg_start = j
            continue
        if c == ";" :
            seg_start = i + 1
        i += 1
    return blocks


def parse_nested(css: str, scan: str, lo: int, hi: int, at_rule: str,
                 line_of) -> list[dict]:
    out: list[dict] = []
    i, seg_start = lo, lo
    while i < hi:
        if scan[i] == "{":
            prelude = scan[seg_start:i].strip()
            pre_off = seg_start + (len(scan[seg_start:i]) - len(scan[seg_start:i].lstrip()))
            depth, j = 1, i + 1
            while j < hi + 1 and depth:
                if scan[j] == "{":
                    depth += 1
                elif scan[j] == "}":
                    depth -= 1
                j += 1
            out.append({"selector": prelude, "at_rule": at_rule, "kind": "rule",
                        "start": line_of(pre_off), "end": line_of(j - 1),
                        "body": css[i + 1:j - 1]})
            i = j
            seg_start = j
            continue
        if scan[i] == ";":
            seg_start = i + 1
        i += 1
    return out


def selector_tokens(selector: str) -> dict:
    """What a selector list is MADE of — the census's whole discrimination."""
    classes = sorted(set(_TOKEN.findall(selector)))
    without = _TOKEN.sub(" ", selector)
    ids = sorted(set(re.findall(r"#([A-Za-z_][A-Za-z0-9_-]*)", without)))
    without = re.sub(r"#[A-Za-z_][A-Za-z0-9_-]*", " ", without)
    without = re.sub(r"\[[^\]]*\]", " ", without)
    without = re.sub(r"::?[A-Za-z-]+(\([^)]*\))?", " ", without)
    elements = sorted({t for t in re.findall(r"[A-Za-z][A-Za-z0-9-]*", without)})
    return {"classes": classes, "ids": ids, "elements": elements}


def main() -> int:
    dox = Path(sys.argv[1]).resolve()
    xdox = Path(sys.argv[2]).resolve()
    out_json = None
    if "--json" in sys.argv:
        out_json = Path(sys.argv[sys.argv.index("--json") + 1])

    web = dox / "src" / "opendox" / "web"
    css_path = web / "styles.css"
    css = css_path.read_text(encoding="utf-8")

    gate_dir = xdox / "src" / "openxdox" / "web" / "views"
    if "--gate-dir" in sys.argv:
        gate_dir = Path(sys.argv[sys.argv.index("--gate-dir") + 1]).resolve()
    gate_files = sorted(p for p in gate_dir.glob("*.js"))
    #: A gate module is NEVER counted on openDox's side of the census, wherever
    #: it physically sits. Before slice S5 landed the six lived in openDox's own
    #: `views/`, so a name-blind sweep would call every gate class `shared` and
    #: the tool would answer differently at `cb343ae8` for a reason that is not
    #: about the stylesheet at all.
    gate_names = {p.name for p in gate_files}
    dox_files = [web / "app.js", web / "index.html"] + sorted(
        p for p in (web / "views").glob("*.js") if p.name not in gate_names)

    def haystack(path: Path) -> str:
        text = path.read_text(encoding="utf-8", errors="replace")
        if path.suffix == ".js":
            return js_literal_text(text)
        return text                      # index.html: attributes are the hooks

    gate_text = {p.name: haystack(p) for p in gate_files}
    dox_text = {p.name: haystack(p) for p in dox_files}
    gate_narrow = {p.name: narrow_refs(p.read_text(encoding="utf-8",
                                                   errors="replace"), p.suffix)
                   for p in gate_files}
    dox_narrow = {p.name: narrow_refs(p.read_text(encoding="utf-8",
                                                  errors="replace"), p.suffix)
                  for p in dox_files}
    gate_prefix = {p.name: prefix_refs(p.read_text(encoding="utf-8",
                                                   errors="replace"), p.suffix)
                   for p in gate_files}
    dox_prefix = {p.name: prefix_refs(p.read_text(encoding="utf-8",
                                                  errors="replace"), p.suffix)
                  for p in dox_files}

    def by_prefix(token: str, table: dict[str, set[str]]) -> list[str]:
        return sorted(n for n, ps in table.items()
                      if any(token.startswith(p) for p in ps))

    blocks = parse_blocks(css)
    rules = [b for b in blocks if b["kind"] == "rule"]
    declared = sorted({t for b in rules for t in selector_tokens(b["selector"])["classes"]})

    def namers(token: str, corpus: dict[str, str]) -> list[str]:
        pat = re.compile(rf"(?<![A-Za-z0-9_-]){re.escape(token)}(?![A-Za-z0-9_-])")
        return [name for name, text in corpus.items() if pat.search(text)]

    def classify(g: list[str], d: list[str]) -> str:
        if g and not d:
            return "gate_exclusive"
        if g and d:
            return "shared"
        return "opendox_only" if d else "unreferenced"

    census: dict[str, dict] = {}
    for token in declared:
        pg, pd = by_prefix(token, gate_prefix), by_prefix(token, dox_prefix)
        g = sorted(set(namers(token, gate_text)) | set(pg))
        d = sorted(set(namers(token, dox_text)) | set(pd))
        ng = sorted({n for n, s in gate_narrow.items() if token in s} | set(pg))
        nd = sorted({n for n, s in dox_narrow.items() if token in s} | set(pd))
        census[token] = {"class": classify(g, d), "gate": g, "opendox": d,
                         "narrow_class": classify(ng, nd),
                         "narrow_gate": ng, "narrow_opendox": nd,
                         "by_concatenation": bool(pg or pd)}

    def block_class(b: dict) -> str:
        t = selector_tokens(b["selector"])
        if not t["classes"]:
            return "no_class"
        kinds = {census[c]["class"] for c in t["classes"] if c in census}
        if kinds == {"gate_exclusive"} and not t["ids"]:
            return "exclusive"
        if "gate_exclusive" in kinds or "shared" in kinds:
            return "mixed"
        return "opendox"

    for b in rules:
        b["block_class"] = block_class(b)
        b["tokens"] = selector_tokens(b["selector"])
        b["reads_st_token"] = bool(re.search(r"var\(\s*--st-", b["body"]))
        b["declares_st_token"] = bool(re.search(r"^\s*--st-", b["body"], re.M))

    kinds = ("gate_exclusive", "shared", "opendox_only", "unreferenced")
    counts = {k: sum(1 for v in census.values() if v["class"] == k) for k in kinds}
    narrow_counts = {k: sum(1 for v in census.values() if v["narrow_class"] == k)
                     for k in kinds}
    exclusive_blocks = [b for b in rules if b["block_class"] == "exclusive"]
    mixed_blocks = [b for b in rules if b["block_class"] == "mixed"]

    report = {
        "styles_css": {"path": "src/opendox/web/styles.css",
                       "lines": css.count("\n"),
                       "rule_blocks": len(rules),
                       "declared_class_tokens": len(declared)},
        "gate_modules": [p.name for p in gate_files],
        "opendox_bundle_files": len(dox_files),
        "class_counts_broad": counts,
        "class_counts_narrow": narrow_counts,
        "narrow_shared": sorted(t for t, v in census.items()
                                if v["narrow_class"] == "shared"),
        "gate_exclusive": sorted(t for t, v in census.items()
                                 if v["class"] == "gate_exclusive"),
        "shared": sorted(t for t, v in census.items() if v["class"] == "shared"),
        "unreferenced": sorted(t for t, v in census.items()
                               if v["class"] == "unreferenced"),
        "exclusive_blocks": [
            {"selector": b["selector"], "at_rule": b["at_rule"],
             "start": b["start"], "end": b["end"],
             "reads_st_token": b["reads_st_token"],
             "declares_st_token": b["declares_st_token"]}
            for b in exclusive_blocks],
        "mixed_blocks": [
            {"selector": b["selector"], "at_rule": b["at_rule"],
             "start": b["start"], "end": b["end"],
             "gate_exclusive_tokens": [c for c in b["tokens"]["classes"]
                                       if census.get(c, {}).get("class") == "gate_exclusive"],
             "shared_tokens": [c for c in b["tokens"]["classes"]
                               if census.get(c, {}).get("class") == "shared"]}
            for b in mixed_blocks],
        "exclusive_block_lines": sum(b["end"] - b["start"] + 1 for b in exclusive_blocks),
        "exclusive_blocks_reading_st": sum(1 for b in exclusive_blocks if b["reads_st_token"]),
        "census": census,
    }

    print(json.dumps({k: v for k, v in report.items() if k != "census"}, indent=1))
    if out_json:
        out_json.write_text(json.dumps(report, indent=1), encoding="utf-8")
        print(f"\nfull census (with per-token namers) -> {out_json}", file=sys.stderr)
    return 0


if __name__ == "__main__":
    raise SystemExit(main())

…pin between them

A BRANCH NAME IS NOT A CITATION A READER CAN FOLLOW. The row note and the
movement-log entry both said "Realized at opensoft/openDox-code
`build/q7-binding-stylesheets` (DRAFT PR)" — a parenthesis promising a pull
request that had no number when the sentence was written, which is the same
defect as a count nobody ran a command to get. Every slice annotation before
this one names its leg by number (`DRAFT PR #21`, `DRAFT PR #17`), and these
now do: **openDox-code #27** and **openXdox-code #22**.

AND THE STEP BETWEEN THEM IS NAMED, because it is the one thing the landing
order cannot be read off the two PRs alone: openXdox-code pins an `opendox`
older than `ViewBinding.styles`, so its four sheets are DECLARED but INERT
until that pin advances — which is what its `specs_for()` feature detection is
for. The order is this annotation, then #27, then the pin bump, then #22 live.

No line number, no count, no declared edit and no digest moves.
`scripts/validate-carve-manifest.py` -> `OK ... 456 row(s) ... 143
moved_verbatim, 175 moved_with_declared_edit, 138 not_moved; 318 digest(s)
recomputed`. `pytest -q tests/carve_manifest tests/carve_arrival
tests/carve_conformance tests/opendox_pin tests/openxdox_pin` -> 425 passed.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>

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

Correct the admissions ordering, add exact assertions for all five admissions, and update the remaining stale or unsupported documentation claims.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR records the Q7 CSS extraction as an 89-line declared edit without moving source bytes.

Changes:

  • Adds Q7 manifest declarations and updated totals.
  • Adds five governed admissions.
  • Updates validators, tests, README, runbook, and documentation.
File summaries
File Summary Review findings
tests/carve_manifest/test_carve_manifest.py Pins Q7’s edit window and totals. Nit (2): stale aggregate-value docstring.
scripts/verify-carve-arrival.py Updates declared-line documentation. —
scripts/validate-carve-manifest.py Updates line-bound documentation. —
scripts/carve_lines.py Updates line-count documentation. —
README.md Updates runbook totals. —
docs/opendox-cutover-runbook.md Updates totals and extraction rationale. Nit (3): status block omits Q7.
docs/opendox-carve-manifest.yaml Records Q7’s declared edit window. Nits (1 each): misleading smallest-window wording and unavailable measurement-tool source.
docs/opendox-carve-admissions.yaml Adds five destination admissions. Critical (1): created: ordering fails validation. Moderate (2): add exact path/since assertions.
Review details

Suppressed comments (2)

docs/opendox-carve-manifest.yaml:673

  • This statement is misleading as written: the preceding S8 annotation added 40 declared lines (runbook lines 157-158; manifest lines 643-648), so Q7's 89-line window is not the smallest by line count. Please either remove the comparison or qualify it explicitly as the smallest one-row window.
# `5547060378`). ONE ROW, and it is the smallest window since the Q-L1 rounds:

docs/opendox-carve-manifest.yaml:710

  • This new manifest narrative says the measure-css-census.py source is posted on this pull request, but that file is not part of this repository or the supplied diff (the only matches are these prose references). As written, a reader cannot reproduce the claimed 54-class measurement from this PR; either include the tool or replace the claim with the exact external repository path/commit.
# WHAT SELECTS THE 59 BLOCKS is measured and re-measurable:
# `measure-css-census.py` (its source is posted on this pull request, and openDox-code's own `tests/test_binding_stylesheets.py` RE-DERIVES the same 54-class set from the six contributed modules wherever an assembly has placed them — so the figure is checkable IN TREE and not only in a tool) classifies every class token
# `styles.css` declares in a selector by which side of the seam names it, and a
# block leaves only when EVERY class in its selector is named by openXdox's six
# contributed modules and by no file of openDox's own bundle. At openDox-code
# `0b4e8bbf` / openXdox-code `0a0265f7`: 54 exclusive, 22 shared. The tool
  • Files reviewed: 8/8 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 docs/opendox-carve-admissions.yaml Resolved
Comment thread docs/opendox-carve-admissions.yaml Resolved
Comment thread docs/opendox-cutover-runbook.md Resolved
Copilot AI review requested due to automatic review settings September 16, 2026 15:09
…1032 left

WHY THE MERGE WAS NOT OPTIONAL AND WHY IT WAS FOUND BY MEASUREMENT. This branch
reported `mergeable=CONFLICTING`, and GitHub does not run `pull_request`
workflows on a pull request whose merge commit it cannot compute — so `validate`,
`lane-line`, `pytest-suite` and the rest never fired at all, while
`merge-master-approval` (a `pull_request_target` workflow, which needs no merge
commit) did. A required check that is ABSENT reads like a required check that
has not finished, which is why this was diagnosed off `gh pr view --json
mergeable` rather than off the check list.

WHAT MAIN BROUGHT, and it is exactly the two acts this window overlaps:
openxFactory **#1031** (the pre-existing `openxdox_code` rows: +48 declared
lines, four rows, and the conftest replica's second line) and **#1032** (the
`retired:` row form, runbook § 5.8). Both edit § 2's totals, the per-destination
table, the three scripts' docstrings and README's runbook entry — every
document this act also touches.

EVERY CONFLICT RESOLVED THE SAME WAY: TAKE MAIN'S PROSE, RE-DERIVE THE NUMBER.
None of the six conflicting files was resolved by choosing a side and moving on.
For each, main's text is the base — it carries #1031's and #1032's sentences,
which are theirs and newer — and this act's +89 was re-applied on top of the
figure main states, then checked against the merged manifest rather than
arithmetic:

  `measure_totals.py` over the MERGED document -> 456 rows, 143/175/138,
  **2543** declared lines, 176 carriers, `import rewrites` 726 / `path
  constants` 246 / `adapter calls` **1571**, `opendox_code` **1756**,
  `openxdox_code` 750, 20 replicas.

So 2454 + 89 = 2543 is a check on the re-derivation, not its source. Re-derived
at every site: § 2's totals sentence, the two-replica-line paragraph
(2452 -> 2541), the per-destination table's `opendox_code` cell
(1667 -> 1756) with its own sentence saying what moved and what did not, the
Q-L8 (c) paragraph, `carve_lines.py`, `validate-carve-manifest.py`,
`verify-carve-arrival.py` and README's runbook entry.

THE TEST FILE KEEPS BOTH PARAGRAPHS. `test_the_real_manifest_carries_the_ruled_
q_l7_amendment`'s running narrative is the record of how the aggregate got where
it is, so #1031's paragraph and this act's both stand, in landing order, with
one assertion at the end: `(2543, 176)`.

`scripts/validate-carve-manifest.py` -> `OK ... 456 row(s) ... 143
moved_verbatim, 175 moved_with_declared_edit, 138 not_moved; 318 digest(s)
recomputed`. `pytest -q tests/carve_manifest tests/carve_arrival
tests/carve_conformance tests/opendox_pin tests/openxdox_pin` -> **482 passed**
(main's 481 plus this act's own window test).

No declared line, no digest, no disposition and no admission moves in this
commit — only the figures that count them.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>

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

Four moderate findings remain unresolved.

Review details

Suppressed comments (4)

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

docs/opendox-carve-manifest.yaml:706

  • This new reproducibility claim names measure-css-census.py as persisted/posted and says tests/test_binding_stylesheets.py re-derives the 54-class set, but the referenced Q7 commit contains no census tool and that test uses a hard-coded GATE_EXCLUSIVE tuple, only checking those listed tokens. A newly introduced exclusive selector omitted from the tuple could remain in styles.css and pass, so this does not provide the claimed proof; either commit a real census or rewrite the claim to match the actual test semantics.
# INFERS that the files must move. An `ast` walk of every module-level

docs/opendox-carve-admissions.yaml:108

  • The committed-admissions regression test is not amended for these new Q7 entries: it still pins only through the S8 tests/opendox_bundle.py record (tests/carve_arrival/test_verify_carve_arrival.py:3936-4004), while its generic checks accept any sorted 40-hex entries. A typo, omission, or wrong since for any of these five files would therefore pass the suite and only surface when a leg arrives. Add exact path/destination/provenance assertions for the Q7 admissions.
      - path: tests/test_binding_stylesheets.py
        reason: "added by opensoft/openDox-code `build/q7-binding-stylesheets` (split-opendox § 3.4, RULED Q7, `#656` comment `5648049748`) — the CSS extraction's own running proof, on `validate.yml`'s explicit list: the `ViewBinding.styles` slot refused at BOTH halves of the seam, the absent case carried onto `/capabilities`, the `<link>` injector driven under `node` against the real `views/view_extension.js` (one link per resolved href, `document.head` and never `document.body` per RULED Q8, the failed sheet NAMED and non-fatal), and the extraction itself measured against `styles.css` — no gate-exclusive selector survives there, every `--st-*` token and every shared selector does, and where an assembly has placed openXdox's six modules the 54-class set is RE-DERIVED from them rather than trusted"
        since: "144a4a338f3e1017662fbde0f2e3e7916231baea"

docs/opendox-cutover-runbook.md:162

  • This update makes Q7 the current totals, but the later runbook section still says it is current only through S7 and that the S7 annotation is the last act/list-complete (lines 231-261). That leaves the runbook internally contradictory and omits Q7 from the history it claims is complete; update that section or mark it explicitly as historical.
carrier count stand where slice S7 left them. **RULED Q7's CSS extraction moves
ONE FIGURE AND ONE ROW**: +89 `adapter calls` lines on the single
`web/styles.css` row, which slice S7 had already converted, so nothing else in
this paragraph moves — and that is the act's own point. The 89 are DELETIONS:

tests/carve_manifest/test_carve_manifest.py:3340

  • This updates the live aggregate to 2495, but the S7 test's own docstring still calls (2406, 176) the aggregate assertion (at line 3222). That value is now only a pre-Q7 historical total; label it as such or update the documentation so the test does not describe a stale current invariant.
        # proved every one of those rows ABSENT, so the number is a claim
        # about the tree and not a row count copied out of the document.
  • Files reviewed: 8/8 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 16, 2026 15:18

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 admission-provenance, manifest consistency, chronology, and stale test-documentation issues remain.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (5)

docs/opendox-carve-admissions.yaml:108

  • The generic admissions checks validate only shape, sorting, and 40-hex since values; the existing exact assertions stop at the S7 entries. Removing or replacing one of these five Q7 admissions would therefore still pass this repository's suite and only surface when a destination leg arrives. Add exact presence and provenance assertions for all five new paths.
      - path: tests/test_binding_stylesheets.py
        reason: "added by opensoft/openDox-code `build/q7-binding-stylesheets` (split-opendox § 3.4, RULED Q7, `#656` comment `5648049748`) — the CSS extraction's own running proof, on `validate.yml`'s explicit list: the `ViewBinding.styles` slot refused at BOTH halves of the seam, the absent case carried onto `/capabilities`, the `<link>` injector driven under `node` against the real `views/view_extension.js` (one link per resolved href, `document.head` and never `document.body` per RULED Q8, the failed sheet NAMED and non-fatal), and the extraction itself measured against `styles.css` — no gate-exclusive selector survives there, every `--st-*` token and every shared selector does, and where an assembly has placed openXdox's six modules the 54-class set is RE-DERIVED from them rather than trusted"
        since: "144a4a338f3e1017662fbde0f2e3e7916231baea"

docs/opendox-carve-manifest.yaml:813

  • This says measure-css-census.py is posted on this pull request, but no such file exists in this repository and this PR does not add it. Point to the actual openDox-code artifact/commit or include the tool here; otherwise the claimed 54-class measurement is not reproducible from this record.
# `measure-css-census.py` (its source is posted on this pull request, and openDox-code's own `tests/test_binding_stylesheets.py` RE-DERIVES the same 54-class set from the six contributed modules wherever an assembly has placed them — so the figure is checkable IN TREE and not only in a tool) classifies every class token

docs/opendox-carve-manifest.yaml:781

  • This calls the 89-line window the “smallest” since the Q-L1 rounds, but the immediately preceding S8 record documents a 40-line window (and the earlier ASK-7 window is smaller still). That makes the manifest history factually incorrect; remove the superlative or qualify it.
# `5547060378`). ONE ROW, and it is the smallest window since the Q-L1 rounds:
# `scripts/ideation_dashboard/web/styles.css` gains ONE `adapter calls` entry of

docs/opendox-cutover-runbook.md:168

  • The history here places Q7 before the pre-existing openxdox annotation, but the later per-destination derivation and test_carve_manifest.py:3867-3876 use 2454 (the +48 annotation result) as Q7's baseline and then add 89. Reconcile this chronology; otherwise the document gives two different landing orders for the same 2543 total.
carrier count stand where slice S7 left them. **RULED Q7's CSS extraction moves
ONE FIGURE AND ONE ROW**: +89 `adapter calls` lines on the single
`web/styles.css` row, which slice S7 had already converted, so nothing else in
this paragraph moves — and that is the act's own point. The 89 are DELETIONS:
the 59 rule blocks the gate loop's own selectors occupied, leaving for the four
sheets openXdox-code ships beside the bindings that name them. A deletion has
been a declared edit in this vocabulary since § 3.4 slice S6 declared 122
`serve_projection.py` deletions under the same class and landed; what `#1023`
§ 6 called a wall was the `moved_verbatim` disposition, which slice S7 had
already taken this row past.

tests/carve_manifest/test_carve_manifest.py:3881

  • This new final-total assertion leaves current-total prose stale elsewhere: the S7 test docstring at test_carve_manifest.py:4213 and the arrival test at test_verify_carve_arrival.py:3329 still say that the manifest aggregate is (2454, 176), although this assertion now pins (2543, 176). Update those descriptions so the tests do not contradict the data they validate.
    assert (lines, carrying) == (2543, 176), (lines, carrying)
  • Files reviewed: 8/8 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread docs/opendox-carve-manifest.yaml Resolved
…ive admissions, and refute the ordering finding by measurement

ONE CRITICAL FINDING REFUTED BY MEASUREMENT, FOUR TAKEN.

**REFUTED — the `created:` ordering.** The review says `gate.css` "sorts before
`gate-lens.js`", so "every default admissions read will fail with
`arrival-unreadable`". MEASURED, three ways, and the finding is inverted:

* `verify-carve-arrival.py`'s own rule is `sorted(parsed, key=lambda e:
  e["path"])` — plain byte order, in which `-` is 45 and `.` is 46, so
  `…/gate-lens.js` sorts BEFORE `…/gate.css`. The committed order is what
  `sorted()` returns.
* The run the finding predicts would fail, PASSES: `verify-carve-arrival.py
  --destination opendox_code --phase B` reads this file by default and answers
  `OK … 22 declared admission(s) used (opendox-carve-admissions.yaml)`.
* MUTATION: move `gate.css` to the position the review asks for and the SAME
  run refuses `arrival-unreadable`. The suggested order is the one that breaks.

No change made, because the change asked for is the defect.

**TAKEN — the measurement tool is IN THIS REPOSITORY.** Round 1 rejected the
earlier repair (a pull-request comment) on the correct ground that a comment is
not the diff: "a reader cannot reproduce the claimed 54-class measurement from
this PR". `scripts/measure_opendox_css_census.py` is added, and both citations
now name the command AND the commits to run it at — openDox-code `0b4e8bbf`
(the BASE of the leg that applies this window) and openXdox-code `0a0265f7`,
because at the leg's own HEAD the blocks have already left and the tool
answers 0, which is the extraction working. At the base it prints exactly the
figures this document states: 54 gate-exclusive, 22 shared, 59 blocks, 89
lines.

**TAKEN — the five admissions are pinned by path AND `since`.** The generic
shape/sort/hex checks would pass a dropped entry, a swapped one or a wrong
introducing commit, and this file's own docstring already records that every
bump owes exact assertions. All five are now asserted in
`test_the_committed_admissions_file_keeps_the_ruled_seed_and_stays_well_formed`,
with the count pinned at five so a sixth cannot ride in, and with the reason
`since` does not move when a leg takes a review round: it is the file's OWN
introducing commit, not the branch tip.

**TAKEN — "the smallest window since the Q-L1 rounds" was a claim about lines
and false as one.** Slice S8's 40 lines are fewer than this act's 89. The
sentence now says NARROWEST IN ROWS and says that rows is the only count on
which it is narrowest.

**TAKEN — the runbook's status block named slice S7 as the current act** while
§ 2's totals had moved twice past it. It now names RULED Q7's CSS extraction as
the act the figures are current to, with the pre-existing `openxdox_code`
annotation and slice S8 behind it, and says what makes this act different:
it is the one window on this document that is entirely a DELETION.

**TAKEN — the S7 window docstring's aggregate was stale for the second time.**
It said `(2406, 176)`, then `(2454, 176)`; it now carries both figures and
today's `(2543, 176)`, and says why it keeps going stale — the aggregate moves
with every annotation and a window does not, which is the whole reason the two
are asserted separately.

`scripts/validate-carve-manifest.py` -> `OK … 456 row(s) … 143 moved_verbatim,
175 moved_with_declared_edit, 138 not_moved; 318 digest(s) recomputed`.
`pytest -q tests/carve_manifest tests/carve_arrival tests/carve_conformance
tests/opendox_pin tests/openxdox_pin` -> **482 passed**.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 16, 2026 15:30
brettheap and others added 2 commits September 16, 2026 15:31
…erge

Copilot round 1, and it is the one finding of the round that the merge commit
missed rather than pre-dated. Merging main re-derived § 2's totals, the
per-destination table, the three scripts' docstrings, README and the aggregate
test — and left this header's own sentence saying `2406 -> 2495` and
`1438 -> 1527`, the figures from before `#1031` added 48 declared lines to the
baseline. A number in prose that no test reads is exactly the failure class § 2's
re-derivation tests were written for, one document over.

All four figures are `measure_totals.py`'s over the MERGED document: declared
lines 2454 -> 2543, `adapter calls` 1482 -> 1571, `opendox_code` 1667 -> 1756,
and the counts that do NOT move now name the act they stand unchanged from (the
pre-existing `openxdox_code` annotation, not slice S8). `2454 + 89 = 2543` is a
check on the derivation, not its source, and the paragraph says so.

No declared line, no digest and no admission moves.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…tic already puts it

Copilot round 2, and the only finding of that review not already taken at
`2a79b6c2`/`86831086`. § 2's history paragraph is in LANDING ORDER and every
figure below it is read off that order — and this act narrated itself between
slice S8 and the pre-existing `openxdox_code` annotation while adding its 89 to
that annotation's 2454. Two landing orders for one total, in one document.

The Q7 sentences move to the end of the paragraph, where they belong, and now
say so: "and it moves them LAST — this paragraph is in LANDING ORDER and the
arithmetic below is read off it". `2454 + 89 = 2543` is stated in the paragraph
itself rather than only in the per-destination derivation two screens down.

The review's three other findings were taken before it was written: the census
tool is `scripts/measure_opendox_css_census.py` in this repository, the five
admissions are pinned by path and `since`, and the "smallest window" superlative
is now NARROWEST IN ROWS with slice S8's forty lines named as the reason it is
not smallest by lines.

No figure, no declared line and no admission moves.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>

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 moderate issues remain in the CSS census logic and manifest totals, with stale rationale comments and a documentation path error.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (5)

docs/opendox-carve-manifest.yaml:790

  • These running totals omit the +48 lines from the pre-existing #1031 annotation that is already present in this manifest. The landed manifest, tests, and runbook are at 2454 total lines and 1482 adapter calls before Q7, so this act reaches 2543 and 1571; the 2406→2495 and 1438→1527 claims here contradict the current row data.
# `5656688910`) left them; the only absolutes that move are the declared-line
# total (2454 -> 2543), `adapter calls` (1482 -> 1571) and `opendox_code`'s

scripts/measure_opendox_css_census.py:173

  • This fallback treats every whitespace-separated string literal whose pieces match _CLASSTOK as a bare class list, so ordinary values such as "accepted" or "error" become CSS references. Because narrow_refs feeds narrow_class and narrow_counts, the claimed STYLE_RESIDUE 51/24 reproduction can vary with labels/status values rather than class-bearing positions; restrict this path to a proven class-list context or remove it in favor of explicit class-builder handling.
        parts = s.split()
        if parts and all(_CLASSTOK.match(p) for p in parts):
            out.update(parts)

scripts/measure_opendox_css_census.py:340

  • namers() searches every JS string literal, and this result is used for both sides of the ownership decision below. That is not conservative for the gate side: an unrelated label, route, or error string equal to a selector token makes a class gate_exclusive, so an openDox-only rule can be classified for deletion. Build gate references from actual class-bearing sites (with explicit concatenation handling) rather than treating all literals as class names.
    def namers(token: str, corpus: dict[str, str]) -> list[str]:
        pat = re.compile(rf"(?<![A-Za-z0-9_-]){re.escape(token)}(?![A-Za-z0-9_-])")
        return [name for name, text in corpus.items() if pat.search(text)]

tests/carve_arrival/test_verify_carve_arrival.py:5134

  • This adds the Q7 admission assertions without updating the earlier test docstring at line 3329, which still says the manifest aggregate pinned by the referenced test is (2454, 176). After this annotation the aggregate is 2543, so the rationale is now stale; update it or label 2454 as the historical pre-Q7 value.
    # RULED Q7's CSS EXTRACTION (`#656` comment `5648049748`) — FIVE new
    # admissions, each pinned by PATH AND `since` (Copilot review of this act,
    # round 1: the generic shape/sort/hex checks above would pass a dropped
    # entry, a swapped one, or an incorrect introducing commit, and this file's
    # own docstring already records that every bump owes exact assertions).

tests/carve_manifest/test_carve_manifest.py:3876

  • This updates the executed aggregate to 2543, but the same file still has the S7 and S8 window rationale comments at lines 3357 and 3904 saying the aggregate is (2454, 176). Those comments explain what the hard-coded windows protect, so they now describe an obsolete assertion; update them or explicitly label 2454 as the historical pre-Q7 value.
    # 2454 + 89 = 2543 on the same 176 rows. Five new files are admitted: one
  • Files reviewed: 10/10 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread scripts/measure_opendox_css_census.py Resolved
Comment thread scripts/measure_opendox_css_census.py Resolved
Copilot AI review requested due to automatic review settings September 16, 2026 15:39
brettheap and others added 2 commits September 16, 2026 15:43
… two over-inclusions are not the same error

ONE FINDING TAKEN, ONE ANSWERED BY MEASUREMENT, ONE ALREADY FIXED IN THE
COMMIT THE REVIEW WAS WRITTEN AGAINST.

**TAKEN — the extraction decision is asymmetric now, and says so.**
`scripts/measure_opendox_css_census.py` decided which blocks leave from the
BROAD scan on BOTH sides, and the review is right that this is not conservative
on the gate's side: a route, label or error string that happens to equal a
selector token could make a class `gate_exclusive` and send an openDox rule to
another leg. The two errors are not the same error — over-including on
openDox's side KEEPS a rule, over-including on the gate's side MOVES one — so
the rule is now `extract_class`: the GATE side must be a CLASS-BEARING position
(or a concatenation prefix), the openDox side stays BROAD. `class` and
`narrow_class` are still reported beside it, so the difference is visible
rather than asserted.

MEASURED, at openDox-code `0b4e8bbf` / openXdox-code `0a0265f7`: the asymmetric
rule and the all-broad one both answer **54 classes over 59 blocks and 89
lines**, the same two mixed blocks, the same 22 shared. The narrowing changes
no byte of this act, and it is made anyway because "it happens not to bite
here" is not a guarantee.

**ANSWERED BY MEASUREMENT — the bare-class-list branch is not noise, it is how
this bundle writes a class.** The review asks to remove or restrict the path
that treats a whitespace-separated literal of class-shaped tokens as class
references, on the ground that `"accepted"` or `"error"` would qualify. Removing
it drops the gate-exclusive set from **54 to 5**, because these modules build
their classes as `el("button", "gatebar", …)` and `el("span", "intentchips")` —
a bare single-token class ARGUMENT is the dominant class-bearing form here, and
a scan without it sees almost nothing. The over-inclusion it can cause cannot
reach the extraction either: a token openDox names in ANY literal is kept by
the BROAD side above, and the 51/24 reproduction at `cb343ae8` is what shows the
scan is the S5 author's rather than a new one. Kept, with the reason written
where it is computed.

**ALREADY FIXED — the `2406 -> 2495` totals.** The review quotes the CORRECTED
text (`2454 -> 2543`, `1482 -> 1571`) while describing the figures it replaced:
that was taken at `86831086`, and `measure_totals.py` over the merged document
answers 2543 / 1571 / 1756 with 456 rows, 143/175/138, 176 carriers, 20
replicas.

`scripts/validate-carve-manifest.py` -> `OK ... 456 row(s) ... 318 digest(s)
recomputed`. `pytest -q tests/carve_manifest tests/carve_arrival
tests/carve_conformance tests/opendox_pin tests/openxdox_pin` -> 482 passed.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
COPILOT ROUND 3, THE TWO FINDINGS ON THE TOOL ITSELF.

**A BARE LITERAL IS A CLASS ONLY WHERE A CLASS IS PASSED OR ASSIGNED.** The
review is right that treating every whitespace-separated class-shaped literal
as a class reference lets `{ kind: "summary" }` name a selector — and on the
GATE side that is the error that MOVES an openDox rule to another leg, not the
one that keeps it. And it cannot be answered by dropping the rule: MEASURED,
46 of the 54 classes this census finds rest on a bare literal and nothing else,
because this bundle's element helper takes the class as its SECOND ARGUMENT
(`el(tag, className, text)`) — a scan without bare literals answers **5** where
the truth is **54**.

So the rule is bounded by POSITION instead, parser-free: a bare literal counts
after `(`, after `,`, after an `=` that is an assignment and not a comparison
(`==`, `!=`, `<=`, `>=` all end in `=`), or as the value of a CLASS-NAMING KEY.
That last clause is not decoration: `dispose.js`:202-206 declares its five
outcome classes as `{ ok: { label: "applied", cls: "is-ok" } }` — a table of
classes where the key says what the value is — and without it the census loses
exactly those five and answers 49.

MEASURED AT `0b4e8bbf` / `0a0265f7`: **the exclusive set is UNCHANGED** — 54
classes, 59 blocks, 89 lines, the same two mixed blocks. Not one declared line
of this act moves.

**THE SHARED HALF MOVES BY ONE, 22 -> 21**, and that is the rule working: `why`
was shared only because a gate module carried it as a value in a non-class
position (`gate.js`:82's CLI placeholder among them). It is openDox's alone.
Re-derived here, in `openxdox.view_extensions.STYLE_RESIDUE` and its test, and
in openDox-code's `SHARED_CLASSES` — all three from the same run.

**THE TOOL HAS A TEST SUITE.** `tests/carve_manifest/test_css_census.py`, 12
assertions over fixtures small enough to read rather than over two checkouts
this repository does not carry: the block parser's extents (a nested rule's own,
never its `@media`'s) and its blindness to a selector named in a comment, the
selector split, the class-bearing scan, the concatenation-prefix rule that
`STYLE_RESIDUE`'s 51 was three short without, the position rule with its four
admitted contexts and its two refusals, and — the one that matters — the
ASYMMETRY, driven both ways: a stray gate value cannot move an openDox rule, and
an openDox mention anywhere keeps one.

**AND THE USAGE LINE NAMED A FILE THAT DOES NOT EXIST**: it still said
`measure-css-census.py`, the name the tool had before it was committed here. It
names `scripts/measure_opendox_css_census.py`, and a test asserts it.

`scripts/validate-carve-manifest.py` -> `OK ... 456 row(s) ... 318 digest(s)
recomputed`. `pytest -q tests/carve_manifest tests/carve_arrival
tests/carve_conformance tests/opendox_pin tests/openxdox_pin` -> **494 passed**
(482 + the twelve above).

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>

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 remain in the CSS census, Q7 documentation/tests, and admission-count validation.

Review details

Suppressed comments (11)

docs/opendox-carve-manifest.yaml:2303

  • Carve line 161 is the in-place selector-list replacement: this note itself says the list at :161 is split so .filterpop[hidden] remains, and Q7_WINDOW includes 161. It is not one of the 59 whole rule blocks that leaves, so the Q7 window is not accurately described as 89 deletions/all lines occupied by leaving blocks; describe the replacement separately and update the mirrored runbook/test prose so the governance record matches the leg diff.
    sha256: "642fdcdc91d93074f51620c7dcb7f563b3987bf6df0ad61ec4165aa2f5b1e4da"

docs/opendox-carve-manifest.yaml:801

  • measure_totals.py does not exist in this repository, and the new CSS census utility does not calculate these manifest aggregates, so this provenance statement points readers to an unavailable source. Name the actual aggregate assertions (for example, the manifest test) or remove the reference.
# now `measure_totals.py`'s over the MERGED document, and `2454 + 89 = 2543` is
# a CHECK on that derivation rather than its source.

docs/opendox-carve-manifest.yaml:791

  • The PR description still publishes the pre-#1031 aggregate and adapter-call deltas (2406 -> 2495 and 1438 -> 1527), while this branch's landed records re-derive 2454 -> 2543 and 1482 -> 1571; only the opendox_code destination delta remains 1667 -> 1756. Please update the description so the stated landing evidence matches the reviewed branch.
# total (2454 -> 2543), `adapter calls` (1482 -> 1571) and `opendox_code`'s
# per-destination figure (1667 -> 1756).

docs/opendox-cutover-runbook.md:180

  • The :161 selector is split in place so .filterpop[hidden] remains, rather than being a whole rule block that leaves; the Q7 window includes that line. Therefore the statement that all 89 lines are deletions from the 59 leaving blocks is inaccurate. Please account for this replacement separately and keep the mirrored totals/prose aligned with the actual leg diff.
count moves with them. **2454 + 89 = 2543.** The 89 are DELETIONS: the 59 rule
blocks the gate loop's own selectors occupied, leaving for the four sheets
openXdox-code ships beside the bindings that name them. A deletion has been a

scripts/measure_opendox_css_census.py:7

  • The usage line names measure-css-census.py, but this PR adds scripts/measure_opendox_css_census.py; following the script's own usage from this repository therefore fails because that filename does not exist. Rename the usage target to the file introduced here so the re-measurement command is self-contained.
    python3 scripts/measure_opendox_css_census.py \\

scripts/measure_opendox_css_census.py:387

  • css.count("\n") undercounts a valid CSS file whose final record is not newline-terminated, while this module's line_of() logic and the carve floor count that final record. The JSON report can therefore publish a line total inconsistent with the block extents; apply the same final-record rule here.
    scripts/measure_opendox_css_census.py:201
  • This new 428-line census is the measurement source for the exact CSS extraction, but no test in this repository imports or runs it; the Q7 test only compares a separately hard-coded Q7_WINDOW with the manifest. Changes to _js_spans, nested-rule parsing, selector ownership, or line accounting could therefore silently change the measured set while the current tests remain green. Add focused fixtures or integration coverage for those helpers and the CLI report.
    for s in _literals(text, suffix):
        for piece in s.split():
            m = _PREFIX.match(piece)
            if m:
                out.add(m.group(1))
    return out

scripts/measure_opendox_css_census.py:313

  • index.html is fed to the broad ownership scan as raw text, so a class name appearing only inside an HTML comment is counted as an openDox reference. That can reclassify a gate-exclusive selector as shared/openDox-owned and suppress a required extraction; the paired stylesheet proof explicitly blanks HTML comments before this scan. Normalize HTML comments before adding this file to dox_text (while preserving real attributes).
                    depth -= 1

tests/carve_arrival/test_verify_carve_arrival.py:5173

  • This assertion counts the hard-coded q7_expected dictionary, not the parsed admissions, so it stays equal to 5 even if a sixth Q7 admission is added. The preceding presence checks do not reject extra entries; count the actual entries bearing this ruling and compare that count with the expected set.
    assert sum(len(v) for v in q7_expected.values()) == 5

tests/carve_manifest/test_carve_manifest.py:5022

  • This test's explanatory contract says the 89-line window consists entirely of deletions from 59 leaving blocks, but the pinned window also contains carve line 161, the mixed selector-list line that is changed in place so .filterpop[hidden] stays. Update the docstring to distinguish that replacement from the whole-block deletions; otherwise the test documents the wrong evidence for the declaration.
    WHY THIS WINDOW IS THE FLOOR'S FIRST WHOLE-BLOCK REMOVAL, and why it is
    lawful. RULED Q7 (`#656` comment `5648049748`) sends a contributed
    binding's CSS to the binding's own sheet; 59 rule blocks therefore LEAVE
    `src/opendox/web/styles.css`, and every line they occupied is a DELETION.

tests/carve_manifest/test_carve_manifest.py:5068

  • The suffix assertion makes this window test fail as soon as a later annotation legitimately appends another edits entry to styles.css, even though the Q7 run remains intact. The preceding S7 test was amended to use a unique contiguous-run check for this exact reason; this test should likewise avoid requiring Q7 to remain the row's last entry.
        assert runs[0] == len(landed) - len(entries), (source_path, landed)
  • Files reviewed: 11/11 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 16, 2026 15:51
brettheap and others added 2 commits September 16, 2026 15:56
…ority for the totals

COPILOT ROUND 4, TWO FINDINGS, BOTH TAKEN.

1. THE WINDOW IS NOT "89 DELETIONS". Measured by the same opcode walk that
   produced the line numbers: 88 of the 89 carve lines are a `delete` opcode —
   the lines the 59 rule blocks occupied — and carve `:161` is a `replace`, the
   one SELECTOR LIST this act splits rather than moves (`.filterpop[hidden],
   .projectform.projectpanel[hidden]` becomes `.filterpop[hidden]`, and
   openXdox-code re-states the gate half). Two acts, one declared-line set. The
   manifest row note, the header entry, the runbook paragraph and the window
   test all said DELETIONS and now say 88 + 1, with the test asserting the
   split.

2. `measure_totals.py` IS NOT IN THIS REPOSITORY. It is a lane helper, and
   citing it as the provenance of 2543 / 1571 / 1756 sends a reader to a file
   they cannot open — the same defect as the census tool citation two rounds
   ago, and the same repair: name what is IN TREE.
   `test_the_real_manifest_carries_the_ruled_q_l7_amendment` re-derives the
   line and carrier totals from these rows and asserts `(2543, 176)`, and
   `test_the_runbook_per_destination_table_is_the_manifests_own_sum` does it
   for the per-destination cells. Both named where the figures are stated.

No figure, no declared line, no digest and no admission moves.

`scripts/validate-carve-manifest.py` -> `OK ... 456 row(s) ... 318 digest(s)
recomputed`. `pytest -q tests/carve_manifest tests/carve_arrival
tests/carve_conformance tests/opendox_pin tests/openxdox_pin` -> 494 passed.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Both questions this act put to Brett Heap are now answered, and both answers
are what the three pull requests already do — so the work is CITATION, not
change: a decision recorded without the ruling that made it reads, one act
later, as the author's own preference.

**RULED openxFactory#656 comment `5700475319` (Brett Heap, 2026-09-16, by
interactive multi-choice):**

1. **FOUR sheets for six bindings stands** — a single `styles` specifier per
   binding, with openDox's href de-duplication LOAD-BEARING rather than
   decorative. Refused: a tuple-valued `styles` with a seventh shared sheet,
   and six sheets duplicating the eleven blocks both workbench modules name.
   Cited in the movement-log entry and in the `web/styles.css` row note here,
   on `ViewBinding.styles` itself at openDox-code, and on `VIEW_SHEET_NAMES` at
   openXdox-code — the three places the shape is declared.

2. **The 13 NON-`--st-` custom properties MOVE VERBATIM, with the coupling
   REGISTERED BY MEASUREMENT** in
   `openxdox.view_extensions.STYLE_RESIDUE["open_coupling"]` and asserted by
   that leg's own suite. Refused: widening the stable surface by ruling, a
   second declared token family for contributed chrome, and deferring to the
   BUILD arc. The only alternative that removes the coupling is inlining the
   colour values, which would end dark mode for this column on every install —
   recorded with the ruling, so the residue reads as a ruled open question
   rather than an unnoticed one.

Every leg carries a test that pins its own citation, so a successor changing
either decision has to move the reference with it.

No figure, no declared line, no digest and no admission moves.

`scripts/validate-carve-manifest.py` -> `OK ... 456 row(s) ... 318 digest(s)
recomputed`. `pytest -q tests/carve_manifest tests/carve_arrival
tests/carve_conformance tests/opendox_pin tests/openxdox_pin` -> 494 passed.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 17, 2026 12:52

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

The required pytest workflow will count the new census re-derivation as an unconditional skip, exceeding its pinned skip total and failing CI.

Get a fresh assessment by requesting another Copilot review.

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

Comment thread tests/carve_manifest/test_css_census.py Resolved
brettheap added a commit that referenced this pull request Sep 17, 2026
…pwire

Copilot round 2's one finding, accurate: `assert 2454 + lines == 2461` is a
PRE-Q7 base, and RULED Q7's annotation (#1068, 89 further lines on
`web/styles.css`) lands FIRST, so the merge from `main` makes 2454 -> 2543,
2461 -> 2550, and `docs/opendox-cutover-runbook.md`'s `opendox_code` cell
1667 -> 1756 -> 1763.

TAKEN AS A COMMENT AND NOT AS A LOOSER ASSERTION, because the hard-coded base
is what MAKES the re-derive compulsory. A window total in this file is "a DELTA
against the document the act found", and a form that floated with whatever the
manifest happened to sum would let the merge land silently with every
synchronized document stale — the transcription failure § 2 of the runbook
exists to end, and the one round 10 of #1030 found in the per-destination
table. The assertion now names the base, names the successor act, and names the
two figures it must become.

Refs #656 (stays OPEN).

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Sep 17, 2026
`main` moved under this branch: RULED 5656343213's retirement act (#1043 ->
`7e074ac9`) declared +167 `adapter calls` lines on one `openxdox_code` row and
retired two `opendox_code` rows. Seven files conflicted, every one of them on a
FIGURE this act and that one both re-state — which is the merge the window's
hard-coded base exists to force.

RESOLVED BY RE-DERIVING FROM THE MERGED MANIFEST, never by adding the two
sides' numbers:

  declared edit lines        2461 | 2621  ->  **2628**
  `adapter calls`            1489 | 1649  ->  **1656**
  `import rewrites` 726, `path constants` 246, carriers 176, dispositions
  143 / 175 / 138             unchanged on both sides
  runbook `opendox_code`     **1674** (this act's, untouched by the retirement)
  runbook `openxdox_code`    **917**  (the retirement's, untouched by this act)
  the four destination cells  sum **2626**, + the replica row's two = **2628**

THE TWO ACTS ARE DISJOINT BY DESTINATION AND BY ROW, so neither figure depends
on which landed first; the runbook's per-destination narrative now carries both
sentences in landing order and says so. README's doc-index line and the three
script docstrings (`carve_lines.py`, `verify-carve-arrival.py`,
`validate-carve-manifest.py`) are re-derived with them.

THE TRIPWIRE FIRED, WHICH IS WHAT IT IS FOR. The S7-residue window's
`assert 2454 + lines == 2461` went red on this merge and is now
`assert 2621 + lines == 2628`, with its comment recording the firing and naming
the NEXT act that will fire it — RULED Q7's #1068, 89 further lines on
`web/styles.css`, which makes the base 2710 and the runbook's `opendox_code`
cell 1763. A base that floated with whatever the manifest summed would have let
this merge land green with every one of those documents stale.

Re-measured at the merged head:
  scripts/validate-carve-manifest.py                     OK
  pytest -q tests/carve_manifest tests/carve_arrival     342 passed

ARRIVAL IS NOW THE RETIREMENT LEG'S TO SATISFY, NOT THIS ONE'S, and that is
measured rather than asserted: `verify-carve-arrival.py --phase B` against this
leg answers `arrival-not-retired` for `tests/test_intent_tray_dom.py`, and it
answers the SAME finding against openDox-code `main` `0b4e8bbf` with none of
this leg applied. The deletion is openDox-code#24's (still open); every finding
this act owns is `OK`.

Refs #656 (stays OPEN).

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…down

The merge of main put this branch's one conditional skip beside the six a
runner already measures, and `.github/workflows/pytest-suite.yml` pins the sum
EXACTLY: run 105209771859 at dc2aa45 read `selected=8181 passed=8174
skipped=7 failures=0 errors=0` — the suite clean, the floor script red on
`skipped 7, pinned exactly 6`. The seventh skip was this act's, and the only
one it adds: `git diff 98b172e..HEAD -- tests scripts` shows exactly one
`pytest.skip` added and none removed, in
`test_the_pinned_census_re_derives_at_the_cited_revisions`.

MOVING THE PIN WOULD HAVE BEEN THE WRONG HALF OF ITS OWN RULE. This test family
states the rule plainly — `tests/carve_arrival/test_verify_carve_arrival.py`:
the real-repository test "does not skip … a skip reports as a green bar,
indistinguishable from a pass to every reader, and `pytest-suite.yml` pins the
skip count EXACTLY, so a conditional skip here would red the required job"; and
`tests/openxdox_pin/test_openxdox_pin_verifier.py`: "a check that cannot be
reached reports as satisfied" is the defect class this suite exists to close.
`tests/ideation-dashboard/conftest.py` did the same thing the same way when the
§ 5.2 shed turned four modules into skips: it resolved them rather than losing
the assertions. So the skip goes, the pin does not move, and
`.github/workflows/pytest-suite.yml` is untouched by this commit.

THE SEAT ASSERTS THE RE-DERIVATION'S OWN INPUTS, which is what this repository
can check without the two checkouts: the fixture's FILENAME, `PINNED_AT`, the
manifest row's citation and the census tool's own source all name `0b4e8bbf`
and `0a0265f7`, so a census re-pinned at another pair fails here until all four
move together instead of leaving an instruction nobody can follow. It also
asserts the thing a missing checkout must never do — the documented invocation
against paths that are not there REFUSES BY NAME (`is not a directory … a
census of zero`) rather than reporting an empty census, which is the reading
that would otherwise look exactly like a completed extraction.

AND THE REAL PATH IS UNCHANGED: hand it `Q7_OPENDOX_CODE` / `Q7_OPENXDOX_CODE`
and the whole report is re-derived and compared field for field — run here
against checkouts of both cited revisions: 1 passed. What it still cannot do is
re-derive unaided, and that stays REGISTERED rather than hidden (Copilot rounds
15 and 17): it needs a cross-repository checkout job whose home is
`.github/workflows/openxdox-consumer-gate.yml`.

MUTATED, not merely run: with `PINNED_AT` changed to a wrong revision the seat
FAILS, so it is asserting and not decorating.

GATE AT THIS HEAD: `tests/carve_manifest/test_css_census.py` 56 passed, **0
skipped**; `tests/carve_manifest/` 238 passed, 0 skipped; `tests/carve_arrival/`
158 passed; `scripts/validate-carve-manifest.py` OK, 456 rows. The module
docstring's own "would be a skip on every run here" moved with the code.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 17, 2026 13:28

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

The census has a raw-source classification bug, and CI does not execute its external-checkout re-derivation path.

Get a fresh assessment by requesting another Copilot review.

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

Comment thread scripts/measure_opendox_css_census.py Resolved
Comment thread tests/carve_manifest/test_css_census.py Resolved
main moved three commits under this branch after the coordinator's
`gh pr update-branch` — pin lockstep #3 (dc015d7), tasks.md amendment #4
(ec5069b) and the retirement act's first use of the `retired:` form
(7e074ac) — and the pull request read CONFLICTING, which runs no required
check at all: only `merge-master-approval` (a `pull_request_target` workflow)
reported at eee6de6, because GitHub fires no `pull_request` workflow on a head
whose merge commit it cannot compute.

SEVEN FILES CONFLICTED AND EVERY NUMBER IN THEM IS RE-DERIVED, NOT CHAINED.
The retirement act declared +167 lines (2454 -> 2621, `adapter calls`
1482 -> 1649) and this act declares +89 on one row, so the totals are summed
over the MERGED manifest with `scripts/`-side tooling rather than added up in
prose: **2710 declared lines** (`import rewrites` 726, `path constants` 246,
`adapter calls` 1738) over the same 456 rows, 143/175/138 dispositions, 176
carriers and 20 replicas; per destination `opendox_code` 1756 (this act's) and
`openxdox_code` 917 (the retirement act's), the four destination figures
summing to 2708 and the replica row's two lines making 2710. `2621 + 89 = 2710`
is the CHECK on that derivation, never its source.

WHERE BOTH ACTS WROTE THE SAME PLACE, BOTH TEXTS SURVIVE IN LANDING ORDER:
§ 2's chronology now runs the retirement act's paragraph and then this act's,
as ONE paragraph — `test_the_runbook_disposition_table_and_totals_are_the_
manifests_own` bounds § 2 to EXACTLY TWO paragraphs (the table and the totals
sentence), so a blank line between the narratives is a red, and it caught this
resolution before the commit. The same for § 2's per-destination narrative
(the retirement act's cell, then this act's, then one arithmetic close) and for
the currency sentence, where this act is now the newest and the retirement act
is named behind it.

THE AGGREGATE IN PROSE IS DATED WHEREVER IT IS HISTORICAL (Copilot round 19's
repair, carried through the merge): the two window-pin arguments read
`(2710, 176)` today and `(2454, 176)` when those notes were written, the
carve-arrival docstring reads `(2710, 176)` since this act and `(2621, 176)`
before it, and the Q7 window pin asserts `lines + 2621 == 2710` — the baseline
moved under this branch when the retirement act landed; the window did not,
which is why the two pins are split.

MEASURED ON THE MERGED TREE: `scripts/validate-carve-manifest.py` OK, 456 rows,
143/175/138, 318 digests, 4 RE-DESTINED; `tests/carve_arrival/` +
`tests/carve_manifest/` **398 passed, 0 skipped**; and the full per-token census
at openDox-code 0b4e8bbf / openXdox-code 0a0265f7 is BYTE-IDENTICAL to the
pre-merge report (md5 e881976a2f437b3f63fec9be93defc00) — 54 gate-exclusive,
18 shared, 59 exclusive blocks, an 89-line union, 10 reading an `--st-*` token.
The gitlinks are main's (pin lockstep #3) and were taken from the merge, never
staged by hand.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 17, 2026 13:41

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

The cited-revision census test is not executed in CI because its checkout variables are not wired into any workflow.

Review details

Suppressed comments (1)

tests/carve_manifest/test_css_census.py:1098

  • This branch is never exercised in the repository's configured CI: pytest-suite.yml runs tests/ and openxdox-consumer-gate.yml materializes the two gitlinks, but neither workflow sets Q7_OPENDOX_CODE/Q7_OPENXDOX_CODE. Consequently every CI run takes this fallback and returns without invoking the census against the cited revisions, so a regression in the scanner can pass while the committed fixture remains unchanged. Wire the test to the existing pinned checkouts (and fail closed on a partial environment) or add a CI step that supplies both paths.
    dox, xdox = os.environ.get("Q7_OPENDOX_CODE"), os.environ.get("Q7_OPENXDOX_CODE")
    if not dox or not xdox:
        assert PINNED_CENSUS.name == "q7-css-census-{}-{}.json".format(*PINNED_AT)
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot review round 21 on openxFactory #1068 (thread PRRT_kwDOTAvnrs6jYCsW),
and it is round 18's rule reaching the OTHER reader that walks backwards from a
literal. `_bare_literal_is_class_bearing` searched the RAW source for its
forty-character window, so

    const values = [ // cls =
      "gatebar" ];

put `cls =` in that window from inside a COMMENT and an array VALUE read as a
class write. On the gate side that is the direction which MOVES an openDox rule
— the one error this census exists to refuse — so the window is taken from
`_code_view` now, where comments, strings and regexes are blanked to spaces of
the same length and the offsets still index it.

MEASURED at openDox-code 0b4e8bbf / openXdox-code 0a0265f7, over all 44 scanned
files and every literal span of each: the raw window and the code window answer
the SAME in every case — 0 differences. So the repair is a guarantee about the
next contributed module, not a correction to this one, and the FULL per-token
census report is BYTE-IDENTICAL again (md5 e881976a2f437b3f63fec9be93defc00):
54 gate-exclusive, 18 shared, 59 exclusive blocks, an 89-line union, 10 reading
an `--st-*` token.

The regression carries Copilot's own layout and the whole-tree case with it: a
gate module whose only claim on `.gatebar` is that commented `cls =` leaves the
rule where it is (`exclusive_blocks == []`), while `node.className = "gatebar"`
and `el("div", "gatebar")` are untouched.

GATE AT THIS HEAD: `tests/carve_manifest/test_css_census.py` 57 passed, 0
skipped; `tests/carve_manifest/` 240 passed, 0 skipped; and the pinned census
re-derived against checkouts of both cited revisions -> 1 passed.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Copilot round 21 (review 5236489069) — one finding TAKEN at 7b6f9341, one answered and registered; and the SonarCloud advisory, measured

TAKEN — _bare_literal_is_class_bearing read the RAW source (thread PRRT_kwDOTAvnrs6jYCsW). Round 18 gave _is_concatenation a code-only view; the other backwards reader kept the raw one, so const values = [ // cls = followed by "gatebar" put cls = in its forty-character window from inside a COMMENT and an array VALUE read as a class write — on the gate side, the direction that MOVES an openDox rule. The window is _code_view's now. MEASURED over all 44 scanned files and every literal span of each at 0b4e8bbf / 0a0265f7: the raw window and the code window answer the SAME in every case, 0 differences, and the full per-token census is BYTE-IDENTICAL (md5 e881976a2f437b3f63fec9be93defc00).

ANSWERED AND REGISTERED — the re-derivation is not run in CI (thread PRRT_kwDOTAvnrs6jYCtJ, and the same ask as rounds 15 and 17). It is true, and the repair the round proposes is one gitlink away from being possible: openDox's code gitlink on this head is 0b4e8bbf, exactly the openDox revision this census cites (pin lockstep #3 brought it), but openXdox's is 2529c10a where the cited revision is 0a0265f7. Wiring the test to the materialized gitlinks would therefore measure the wrong pair against a fixture pinned at the right one. The job must CHECK OUT both cited revisions, which is a cross-repository act whose home is .github/workflows/openxdox-consumer-gate.yml — registered, not hidden.

THE SKIP IS GONE RATHER THAN PINNED. The merge of main put this act's one conditional skip beside the six a runner already measures and pytest-suite.yml pins that sum EXACTLY — skipped=7 against 6, run 105209771859, the suite otherwise clean. This family's own rule is that a skip "reports as a green bar" (tests/carve_arrival/test_verify_carve_arrival.py), so the branch now holds its seat with assertions: the fixture's filename, PINNED_AT, the manifest's citation and the tool's source must name the same two revisions, and the documented invocation against absent paths must refuse BY NAME. Mutated with a wrong PINNED_AT, the seat FAILS. At a077c2f0 the pin reads selected=8185 passed=8179 skipped=6 failures=0 errors=0 (run 35228691740) — .github/workflows/pytest-suite.yml is untouched by this act.

THE SONARCLOUD QUALITY GATE, MEASURED. It is ADVISORY here — the required checks on this repository are pytest-suite, lane-line, wallet-validation, release-tag-gate, openspec-cli-pin, signed-execution-chain-gate, clearing-dispatch-gate, merge-master-approval, openreposhape-pin, former-id-arrival-gate and openxdox-consumer-gate, all SUCCESS at this act's heads. The failing condition is "C Security Rating on New Code", and it is ONE issue, the same one since it first appeared on 2026-09-16T15:29Z (the head that first carried the tool): AaCq29PYSsEsoGZcwhpc, rule pythonsecurity:S8707, MAJOR, scripts/measure_opendox_css_census.py:1399 — "Path Traversal via faulty LLM-supplied CLI arguments in measure_opendox_css_census.main()". The two arguments it flags are THE TWO CHECKOUT ROOTS the runbook's documented invocation passes by hand (python3 scripts/measure_opendox_css_census.py <openDox-code at 0b4e8bbf> <openXdox-code at 0a0265f7>); main() already .resolve()s both and refuses BY NAME when either is not a directory, and no CI job runs this tool at all — the job that would is the registered one above. Same class, same single issue, every head of this pull request; openDox-code #27 carries the same advisory FAIL as #21 did.

Refs #656 (stays OPEN). CLAIM: 5699629486.

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

The census has selector-context and mixed-block reporting bugs that can produce incorrect extraction analysis.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

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

scripts/measure_opendox_css_census.py:1391

  • block_class() determines whether a block is mixed from each token's extract_class, but these fields are labeled from census[c]["class"], the broad gate scan. A token mentioned only in a message can therefore be reported as gate_exclusive_tokens even though extract_class intentionally excludes it, making the mixed-block explanation contradict the extraction decision. Use extract_class for both lists and add a fixture where the broad and extraction classifications differ.
  • Files reviewed: 12/12 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/measure_opendox_css_census.py Resolved
Copilot review round 22 on openxFactory #1068: one finding half refuted and
half taken, one taken outright, and the second is the first time a round has
moved the committed report — by ONE LABEL.

TAKEN — THE REPORT'S TWO LISTS READ THE BROAD SCAN (`:1391`). `block_class()`
calls a block mixed on `extract_class`, the gate side read NARROW, while
`mixed_blocks`' `gate_exclusive_tokens` and `shared_tokens` read `class`, the
broad one. A token the extraction deliberately excludes could therefore be
printed as the block's own reason, and the explanation would contradict the
decision it explains. Both lists are `extract_class` now. MEASURED at
openDox-code 0b4e8bbf / openXdox-code 0a0265f7: 15 of the 626 declared tokens
are classified differently by the two scans and exactly ONE reaches this report
— `.tile .s`, whose `s` printed `shared` where the extraction reads
`opendox_only`. The pinned fixture moves by that one line and nothing else: one
deletion, no insertion. THE DECISION DOES NOT MOVE — the per-token census is
identical, the 59 exclusive blocks are identical selector for selector and
extent for extent, and the figures are still 54 gate-exclusive / 18 shared / 59
blocks / an 89-line union / 10 reading an `--st-*` token.

HALF REFUTED, HALF TAKEN — THE SELECTOR-API WINDOW (`:855`, thread
PRRT_kwDOTAvnrs6jY6-b). The 60-character look-back is not a free search: the
pattern ends `\(\s*$`, so its anchor IS the literal, and the round's own
example measures as already refused — `root.querySelector("div");
showError(".gatebar")` names `div` and nothing else. What the window did NOT
refuse was the call arriving from a COMMENT: `const sel = // querySelector(`
on one line and `".gatebar"` on the next put the call in the window from text
the parser never sees. It reads `_code_view` now, the same repair rounds 18 and
21 made for the two backwards readers beside it, and the comment case answers
`set()` while a real `querySelector(…)` or `?.closest(…)` still names its class.

GATE AT THIS HEAD: `tests/carve_manifest/test_css_census.py` 59 passed, 0
skipped (two new regressions, one of them a tree where the broad and extraction
classifications DIFFER); `tests/carve_manifest/` + `tests/carve_arrival/` 401
passed, 0 skipped; `scripts/validate-carve-manifest.py` OK, 456 rows; and the
pinned census RE-DERIVED against checkouts of both cited revisions — which is
what proves the regenerated fixture is the tool's own answer and not a hand
edit.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>

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

The census accepts an existing empty own-view directory, and the re-derivation test silently falls back when only one checkout variable is configured.

Review details

Suppressed comments (2)

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

scripts/measure_opendox_css_census.py:1155

  • This validates that src/opendox/web/views exists but not that it contains any .js files. An incomplete checkout with an empty existing views directory therefore reaches the census, omits all of openDox's own view references, and can misclassify shared CSS as gate-exclusive; reject an empty own-view scan (and adjust the intentionally empty test fixtures) before computing the census.
    tests/carve_manifest/test_css_census.py:1192
  • When exactly one environment variable is set, if not dox or not xdox takes the fallback path and the test passes without re-deriving anything. That masks a partially wired CI invocation; the fallback should be allowed only when both variables are absent, and a one-sided configuration should fail closed.
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

… a seat

Copilot review round 23 on openxFactory #1068 (review 5237201626): two
suppressed findings, both about an INCOMPLETE INPUT reading as a measurement,
both taken.

`:1155` — AN EMPTY `views/` IS A REFUSAL TOO. Round 6 made that directory's
ABSENCE a named refusal; a directory that exists and carries no `.js` passed
the check and then scanned nothing, so every class only openDox's own views
name read as named by nobody and a SHARED class would look gate-exclusive —
this census's one forbidden error direction, arriving through an incomplete
checkout rather than through a parse. The gate side has refused its own empty
scan since round 5; the side that KEEPS rules now refuses its own. The file
list the check builds is the one the scan uses, so the two cannot disagree.

`:1192` — A ONE-SIDED ENVIRONMENT FAILS CLOSED. `if not dox or not xdox` took
the seat when exactly ONE of `Q7_OPENDOX_CODE` / `Q7_OPENXDOX_CODE` was set, so
a half-wired CI job would pass without re-deriving anything and its green would
say the census had been checked. Both or neither now, with the name of the one
that was set in the message.

THE FIXTURE HELPER GIVES openDox A VIEW MODULE EVEN WHERE A CASE NAMES NONE —
a placeholder that names no class — so the seventeen cases that pass `own={}`
still measure "openDox references nothing" rather than becoming refusals, and
the round-6 test that removes the directory removes it rather than emptying it.

MEASURED: the full per-token census at openDox-code 0b4e8bbf / openXdox-code
0a0265f7 is BYTE-IDENTICAL to the round-22 report — 54 gate-exclusive, 18
shared, 59 exclusive blocks, an 89-line union, 10 reading an `--st-*` token —
so both repairs are guarantees about the next checkout rather than corrections
to this measurement.

GATE AT THIS HEAD: `tests/carve_manifest/test_css_census.py` 61 passed, 0
skipped (two new regressions); `tests/carve_manifest/` + `tests/carve_arrival/`
403 passed, 0 skipped; and the pinned census re-derived against checkouts of
both cited revisions -> the same 61 green with both variables set.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Copilot round 23 (review 5237201626) — both suppressed findings TAKEN at 4ead674a

Both are the same shape, and it is the shape this tool is most careful about: an incomplete input reading as a measurement.

:1155 — an empty views/ is a refusal too. Round 6 made that directory's ABSENCE a named refusal; a directory that exists and carries no .js passed the check and then scanned nothing, so every class only openDox's own views name read as named by nobody and a SHARED class would look gate-exclusive. That is this census's one forbidden error direction, arriving through an incomplete checkout rather than through a parse. The gate side has refused its own empty scan since round 5; the side that KEEPS rules now refuses its own, and the file list the check builds is the one the scan uses, so the two cannot disagree.

:1192 — a one-sided environment fails closed. if not dox or not xdox took the seat when exactly ONE of Q7_OPENDOX_CODE / Q7_OPENXDOX_CODE was set, so a half-wired CI job would pass without re-deriving anything and its green would say the census had been checked. Both or neither now, and the refusal names the one that was set.

The fixture helper gives openDox a view module even where a case names none — a placeholder that names no class — so the seventeen cases that pass own={} still measure "openDox references nothing" rather than becoming refusals, and round 6's own test removes the directory rather than emptying it.

MEASURED: the full per-token census at 0b4e8bbf / 0a0265f7 is BYTE-IDENTICAL to the round-22 report — 54 gate-exclusive, 18 shared, 59 exclusive blocks, an 89-line union, 10 reading an --st-* token — so both repairs are guarantees about the next checkout, not corrections to this measurement.

GATE AT 4ead674a: tests/carve_manifest/test_css_census.py 61 passed, 0 skipped; tests/carve_manifest/ + tests/carve_arrival/ 403 passed, 0 skipped; the pinned census re-derived against checkouts of both cited revisions with both variables set — the same 61 green. At the previous head ded534c2 every required check was SUCCESS with pytest-suite reading skipped=6 against its pin.

Refs #656 (stays OPEN). CLAIM: 5699629486.

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

The census parser still mishandles quoted parentheses in pseudo-functions and JavaScript optional-call concatenations, which can produce incorrect CSS ownership decisions.

Review details

Suppressed comments (2)

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

scripts/measure_opendox_css_census.py:212

  • The call-parenthesis guard does not recognize optional-call syntax: in valid fn?.("ga") + "te", the ( is preceded by ., so this check treats the call's closing ) as grouping and synthesizes gate from a call result. The gate-side scan can then claim a class that is not a literal concatenation and move its CSS block; include . as a call predecessor and regression-test optional calls.

This issue also appears on line 1090 of the same file.

scripts/measure_opendox_css_census.py:1094

  • The pseudo-function depth walk treats every ) as syntax, including one inside a quoted attribute value. For a valid selector such as div:not([data-label=")"]).gatebar, it closes :not early and leaves div]).gatebar; the anchor check can then accept gatebar as top-level and extract an element-qualified rule. Make this walk quote/attribute-aware (or remove attribute selectors before counting) and add an end-to-end regression for this shape.
        m = re.match(r"::?[A-Za-z-]+\(", selector[i:])
        if m:
            depth, j = 1, i + m.end()
            while j < n and depth:
                if selector[j] == "(":
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot review round 24 on openxFactory #1068 (review 5237523340), the one of
its two suppressed findings that is not already registered.

`:1094` — `_outside_pseudo_functions` counted every `)` as syntax, including one
inside a QUOTED attribute value, so `div:not([data-label=")"] .gatebar)` closed
`:not` at the quoted parenthesis and left `.gatebar` — the class the rule
EXCLUDES — looking like the hook the branch hangs on. That is the extraction
direction: a rule styling nearly every element EXCEPT the gate's could leave on
the strength of what it excludes, which is exactly what round 12 closed for the
unquoted case and what round 15 closed for the attribute stripper.

Attribute selectors are removed BEFORE the walk now, by
`_without_attribute_selectors` — quote- and escape-aware since round 15, and
already shared with `selector_class_tokens`, so the anchor question and the
class question agree by construction rather than by inspection. Measured:

    div:not([data-label=")"] .gatebar)   anchor {gatebar} -> set()
    div:not([data-label=")"]).gatebar    'div"]).gatebar' -> 'div.gatebar'
    .gatebar:hover                       anchor {gatebar}, unchanged
    div[data-state].gatebar              anchor set(), unchanged

and the whole-tree case with it: the rule whose only gate class is EXCLUDED
stays, while the plain `.gatebar` rule beside it leaves.

MEASURED at openDox-code 0b4e8bbf / openXdox-code 0a0265f7: the full per-token
census is BYTE-IDENTICAL to the round-23 report — 54 gate-exclusive, 18 shared,
59 exclusive blocks, an 89-line union, 10 reading an `--st-*` token — so the
repair is a guarantee about the next stylesheet, not a correction to this one.

THE ROUND'S OTHER FINDING (`:212`, the optional call `fn?.("ga") + "te"`) IS
ALREADY REGISTERED, not open: round 20's answer (`#1068` comment 5705622467)
measured that class, refused the repair as stated because it would misread
`return (` as a call and lose openDox's own `doc-` prefix on the KEEP side, and
wrote down the shape the later act must take — skip whitespace AND exclude
`_JS_REGEX_PREFIX`'s keyword set, plus `?.(`, in one pass. The optional call is
named there by name.

GATE AT THIS HEAD: `tests/carve_manifest/test_css_census.py` 62 passed, 0
skipped; `tests/carve_manifest/` + `tests/carve_arrival/` 404 passed, 0 skipped;
`scripts/validate-carve-manifest.py` OK, 456 rows.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Copilot round 24 (review 5237523340) — one finding TAKEN at fb19d31c, one ALREADY REGISTERED

TAKEN — :1094, a quoted parenthesis closed a pseudo-function. _outside_pseudo_functions counted every ) as syntax, including one inside a QUOTED attribute value, so div:not([data-label=")"] .gatebar) closed :not at the quoted parenthesis and left .gatebar — the class the rule EXCLUDES — looking like the hook the branch hangs on. That is the extraction direction: a rule styling nearly every element EXCEPT the gate's could leave on the strength of what it excludes, which is what round 12 closed for the unquoted case. Attribute selectors are removed BEFORE the walk now, by _without_attribute_selectors (quote- and escape-aware since round 15, and already shared with selector_class_tokens, so the anchor question and the class question agree by construction).

selector anchor before anchor after
div:not([data-label=")"] .gatebar) {gatebar} set()
div:not([data-label=")"]).gatebar 'div"]).gatebar' 'div.gatebar', anchor set()
.gatebar:hover {gatebar} {gatebar}
div[data-state].gatebar set() set()

…plus the whole-tree case: the rule whose only gate class is EXCLUDED stays, while the plain .gatebar rule beside it leaves.

ALREADY REGISTERED — :212, the optional call fn?.("ga") + "te". Round 20 measured this class and wrote down what the repair must be (comment 5705622467): the repair AS STATED — skip whitespace, then test the character before the ( — misreads return (sanitised || "doc") + "-" in openDox's own doxbench-editor.js as a call and loses the doc- prefix on the KEEP side, which is the direction that EXTRACTS a rule openDox uses. The registered shape is: skip whitespace and comments back from the ( and exclude _JS_REGEX_PREFIX's keyword set (return, typeof, case, in, of, new, delete, void, instanceof, do, else, yield, await), plus ?.( — the optional call named there by name — in one pass. Measured then and unchanged: 331 joined pairs at the cited revisions, one with a separated opener and it is that return (, zero in the six contributed gate modules, which is the only side where a wrong join can move a rule.

MEASURED at 0b4e8bbf / 0a0265f7: the full per-token census is BYTE-IDENTICAL to the round-23 report — 54 gate-exclusive, 18 shared, 59 exclusive blocks, an 89-line union, 10 reading an --st-* token.

GATE AT fb19d31c: tests/carve_manifest/test_css_census.py 62 passed, 0 skipped; tests/carve_manifest/ + tests/carve_arrival/ 404 passed, 0 skipped; scripts/validate-carve-manifest.py OK, 456 rows. At the previous head 4ead674a every required check was SUCCESS (pytest-suite skipped=6 against its pin), and this commit touches the census tool and its own suite only — no manifest byte, no runbook line.

Refs #656 (stays OPEN). CLAIM: 5699629486.

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

The CSS census can misclassify namespaced attributes such as x:class as real class attributes, affecting extraction decisions.

Review details

Suppressed comments (1)

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

scripts/measure_opendox_css_census.py:708

  • _CLASS_ATTR still recognizes class= when it is the suffix of a namespaced attribute such as <x:node x:class="gatebar">; : is not excluded by the lookbehind, even though x:class is not the HTML class attribute. On the gate side this false class-bearing hit can make a CSS rule appear exclusive and move it. Treat namespace punctuation as part of the preceding attribute name (and add a namespaced-attribute regression).
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Copilot round 25 (review 5238568808) — MEASURED, and REGISTERED FOR A LATER DECLARED ACT

The finding is true. _CLASS_ATTR's lookbehind excludes - (round 9's data-class) but not :, so <x:node x:class="gatebar"> yields gatebar where <div data-class="gatebar"> correctly yields nothing. Measured on this head:

markup runs
<div class="gatebar"> ['gatebar']
<div data-class="gatebar"> [] (round 9)
<x:node x:class="gatebar"> ['gatebar'] — the finding

And it is INERT at the cited revisions: zero *:class= occurrences across the 45 scanned files ([A-Za-z0-9_-]+:class\s*= over openXdox-code 0a0265f7's six contributed modules and openDox-code 0b4e8bbf's bundle, index.html included).

It is REGISTERED rather than taken because this is the FIFTH head-moving round on one finding class, and this lane's review discipline allows two: the markup-attribute matcher has already taken round 7 (class= in prose is not markup), round 8 (class= inside another attribute's VALUE), round 9 (data-class, and either quote), and round 10 (an unquoted value running into the next attribute name). The register entry carries the repair's exact shape so the later act does not have to re-derive it: treat namespace punctuation as part of the preceding attribute name — extend _CLASS_ATTR's lookbehind from [A-Za-z0-9_-] to include : (and ., which Angular-style bindings use) — in ONE place, since the prefix scan and the token scan share that pattern by construction (round 9), with a namespaced-attribute regression beside the data-class one.

This joins the register already on this pull request: the CI job that re-derives the census across two checkouts (rounds 15, 17, 21 — home .github/workflows/openxdox-consumer-gate.yml); _is_concatenation's spaced/optional call, with the keyword-set caveat that makes the naive repair a regression (round 20, comment 5705622467, re-cited at round 24); the ${…} brace walk copied behaviour-for-behaviour from openDox-code's tests/test_web_boundary.py (round 5); and a class-bearing template whose part is a whole substitution (round 17).

STATE AT fb19d31c: every required check SUCCESS — pytest-suite selected=8331 passed=8325 skipped=6 failures=0 errors=0 with the skip pin met and .github/workflows/pytest-suite.yml untouched by this act — threads 32 / 0, MERGEABLE. SonarCloud advisory FAIL, measured and answered above (comment 5715677270): one issue, pythonsecurity:S8707, the two checkout roots the documented invocation passes by hand.

Refs #656 (stays OPEN). CLAIM: 5699629486.

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