Repository navigation
Split lens: add_as_cluster and its human_seen reach into lens_submission.py (pre-carve S-2, § 3.1) - #836
Conversation
…ion.py (pre-carve S-2, § 3.1) `AddAsClusterResult` and `add_as_cluster` move out of `lens.py` UNCHANGED, byte for byte (lens.py:228-282 at 56e69a1 -> lens_submission.py:55-109, 3,014 bytes, sha256 7c12c6df73b437e1d84bbd36d66c3fe847916de5207d5b78fa28394a7acc4223), with the `human_seen` import they use. `lens.py` is openDox (design D3: "the keyword-query half of `lens` ... PULL UP"); submitting a human-seen cluster proposal into openxFactory's cross-reference queue is adapter-column work, and the scout memo measured `lens -> human_seen` as the single openDox -> openxFactory import edge in the whole package. It is now gone. No re-export back into `lens.py`, deliberately: that would re-import `human_seen` transitively and put the edge back with every test still green. The two in-tree callers are repointed instead — `gate_routes.execute_lens_add_as_cluster` (which keeps importing `lens` for `build_workbench_from_recipe`) and four call sites in `test_lens.py`. The re-export at lens.py:58 had no in-tree reader at all. Consequential edits, all of them: `Path`, `ACTION_ADD_AS_CLUSTER`, `OutputBoundary` and `save` dropped from `lens.py`'s imports (no reader left); five lines appended to the docstring's add-as-cluster paragraph naming where the verb went; two one-word prose fixes in the browser half, which named a Python symbol that no longer resolves. `PENDING_PROPOSAL_NOTE` stays in `lens.py` and is imported back, so its byte-identity cross-check against `web/views/lens-model.js` stays inside one column after the carve. Refs #656. Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_012LiNG5Ume1boEfxSNeCmpu
…arve S-2) The only point of split S-2 is a removed import DIRECTION, so a test holds it rather than a note. Named after `test_cli_column_split.py`, the § 2.4 split's own precedent, and small: three tests. PARSED, NOT GREPPED, and the difference is load-bearing here exactly as it is in `tests/doc-health/test_import_direction.py`: `lens.py`'s docstring and its `PENDING_PROPOSAL_NOTE` comment both still NAME `human_seen.py` in prose, and must keep doing so — they document where the submission path went. A substring grep would call both violations, and the pressure to make it green would be pressure to delete true documentation. The scan is local rather than `tests/import_scan.py`'s because `imported_modules` skips relative imports by design: it polices a direction BETWEEN packages, and this one is inside one. Three assertions: no import of `human_seen` from `lens.py` in any spelling, lazy function-local ones included; a negative control over the SAME input, asserting the scanner recognises all six spellings of a restoration rather than passing vacuously; and that `add_as_cluster` is not re-exported from `lens` — the failure mode this file exists for, because a convenience re-export puts the edge back transitively with every behavioural test still green. Refs #656. Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_012LiNG5Ume1boEfxSNeCmpu
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
🟢 Approval recommended
The change is a mechanical relocation with repointed call sites and a dedicated regression test, and only a minor documentation-comment tweak remains.
Pull request overview
This PR performs the pre-carve S-2 “lens split” by relocating the add-as-cluster submission verb (and its human_seen reach) out of lens.py into a new lens_submission.py, and repointing in-tree callers so lens.py no longer imports human_seen.
Changes:
- Move
AddAsClusterResultandadd_as_cluster(byte-identical) fromlens.pytolens_submission.py, removinglens.py → human_seenimport edges. - Repoint the Python caller (
gate_routes.py) and the add-as-cluster tests to calllens_submission.add_as_cluster. - Update browser-side prose comments to reference
lens_submission.add_as_cluster, and add a dedicated test preventing the edge/regression.
File summaries
| File | Description |
|---|---|
| tests/ideation-dashboard/test_lens.py | Repoint add-as-cluster tests to call lens_submission.add_as_cluster. |
| tests/ideation-dashboard/test_lens_column_split.py | Add AST-based import scan guarding against lens.py importing human_seen and against re-exporting add-as-cluster from lens. |
| scripts/ideation_dashboard/web/views/lens.js | Update comment reference from lens.add_as_cluster to lens_submission.add_as_cluster. |
| scripts/ideation_dashboard/web/views/lens-model.js | Update comment reference from lens.add_as_cluster to lens_submission.add_as_cluster. |
| scripts/ideation_dashboard/lens.py | Remove human_seen imports and delete the moved add-as-cluster block; document the relocation in the module docstring. |
| scripts/ideation_dashboard/lens_submission.py | New module containing the relocated add-as-cluster implementation and its human_seen dependency. |
| scripts/ideation_dashboard/gate_routes.py | Repoint the gate route implementation to call lens_submission.add_as_cluster. |
Review details
Suppressed comments (1)
scripts/ideation_dashboard/lens.py:70
- The comment above
PENDING_PROPOSAL_NOTEstill describesadd_as_clusteras if it lives in this module, but the verb was moved tolens_submission.py. This can mislead future readers about where the submission behavior is implemented.
# add_as_cluster SUBMITS the human-seen cluster proposal into the cross-reference
# recommendation queue (change 3.5 / T028). The T028 blocker cleared 2026-07-14
# when add-ideation-cross-reference-readiness realized the pending_review intake
# contract in ideation-cross-reference.schema.yaml; the submission path lives in
# human_seen.py (build -> refuse-if-incomplete -> write -> validate against the
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ilot round 1) The docstring was updated by the split commit; this comment block was not, and it still opened "add_as_cluster SUBMITS ..." as though the verb lived in this module. Copilot's one finding on #836, and a fair one. The block now names `lens_submission.add_as_cluster`, records that the verb left with pre-carve split S-2, and says why the NOTE did not follow it: its byte-identity cross-check is against this module's own browser half (`web/views/lens-model.js`), so both halves of that pair stay in the openDox column. Prose only — no import, no behaviour, no name. Refs #656. Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_012LiNG5Ume1boEfxSNeCmpu
|
Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox) Copilot round 1 — taken. The review recommended approval with 0 posted The finding ( Fixed in The import-direction test is unaffected by design — it is PARSED, not GREPPED, 🤖 Generated with Claude Code |
There was a problem hiding this comment.
🟡 Changes recommended
The PR description asserts “no public-name change,” but the diff removes the lens.add_as_cluster module-level surface (callers must now use lens_submission), so the stated contract should be corrected/clarified before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
|
Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox) Adversarial re-measurement by a verifier who did not author this PR, against the Nothing in the relocation is wrong. The block is byte-identical, the removed The twelve items
2 — the relocation, re-measured by symbol (item (b) of the tasking)Located by symbol, not by the memo's line numbers. In base Confirmed: the 5 — my own edge scanIndependent AST script; columns from memo § 2.2 plus § 4's split dispositions. Under the author's own convention (relative imports plus * I count 11 at base and 11 at head, not 12 — an unchanged row, so a single Under a full-spelling scan (adding Removed, verified present at base and absent at head — both of them: No new edge in a forbidden direction. Added, and all three are named in the body: The three added edges — item (a) of the tasking
My recommendation: keep it as landed. An import edge is expressible in the manifest — DefectsNOTE-1 — the body's "Six changes ... nothing else" list is incomplete at head NOTE-2 — the body's size table is stale at head (body accuracy). It states NOTE-3 — one stale prose reference left in Python (cosmetic). NOTE-4 — "the single NOTE-5 — the guard measures the DIRECT edge only. Evidence for the rest
Shared checkout
Verification only — no merge, no approval, no push to this branch, no ruleset or 🤖 Generated with Claude Code |
…sion; widen the column-split guard to every import spelling NOTE-3: `build_workbench_from_recipe`'s docstring at lens.py:213 still named bare `add_as_cluster` as if it lived in this module; it now reads `lens_submission.add_as_cluster`, matching the fix already applied to lens.js:152 and lens-model.js:1024. NOTE-5: `test_lens_imports_nothing_from_human_seen` only scanned lens.py for imports of `human_seen`, so a restoration spelled `from . import lens_submission` (or either absolute spelling) would restore the transitive `lens -> lens_submission -> human_seen` reach while passing all three tests in test_lens_column_split.py. The scan now also covers the `lens_submission` sibling, using the same `_imports_sibling` scanner (which already recognizes all three import spellings for any given sibling name). Refs #656. Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_012LiNG5Ume1boEfxSNeCmpu
|
Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox) Fix round 1 — taken. New head
NOTES 1/2/4 were taken in the PR body (this comment does not repeat them): Diff: 2 files changed, 11 insertions(+), 4 deletions(-) 🤖 Generated with Claude Code |
There was a problem hiding this comment.
🟢 Approval recommended
The change is a contained mechanical relocation with callers and tests updated to enforce the intended import-graph split.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
scripts/ideation_dashboard/lens.py:60
wbis imported as a module alias but never referenced inlens.py(andlens.pyalready imports the specific names it needs from.workbench). Keeping this unused import adds an extra module-level side effect and is easy to misread as a supported public surface (lens.wb).
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Lite
The module's "WHAT STAYED BEHIND" paragraph made two claims that are no longer true. It said the scout memo "files all of them under § 7 OQ-B, unruled" — OQ-B was RULED by Brett Heap on 2026-09-09 (`#656`, "rule all OQs as recommended") — and it justified leaving this module's two `stays -> openDox` reaches alone on the grounds that `human_seen.py:46` "already reaches `workbench.slug` the same way", which stops being the reason the moment B-1 lands: `human_seen` reads `slug` from the neutral `scripts/path_slug.py` (PR #843), so the sibling reach this paragraph leaned on is being re-plumbed while these two are not. The reworded paragraph states the ruling's actual disposition for THIS module: `add_as_cluster` is adapter->core by construction, so the carve reaches it THROUGH openXdox as an `import rewrites` edit and it is kept in-tree until then — the verifier's recommendation on #836, which the ruling adopted. It then names where the two re-plumbed siblings went (B-1 = `slug` to `path_slug.py`, PR #843; B-2 = the four `serve_wire` names) so the next reader is not sent back to a memo's open-question list for an answer that exists. DOCSTRING ONLY. No import, no name, no signature, no behaviour. The paragraph grows by six lines, which moves this module's two `stays -> openDox` import statements from `:51-52` to `:57-58`; nothing in the tree cites those line numbers (grepped: zero `lens_submission.py:<n>` citations), so the growth stales no citation. The RULING comment on #656 cites `:51-52` and, as a record of what was measured when it was written, is left as it stands. Refs #656 Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]>
Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox)
Refs #656 — pre-carve split S-2 of three (scout memo § 4; the § 3.1 carve
manifest files every path with ONE disposition, so a file whose halves belong to
two columns cannot be filed). Mechanical relocation inside
openxFactory: nobehaviour change, no renamed symbol, no changed signature. Base
56e69a11c59d473da23eab455cb9848dc083fac3.What DOES change is the import PATH of the two moved names, and that is the
point of the split, not a side effect.
lens.add_as_clusterandlens.AddAsClusterResultno longer resolve, and neither does the unreadHumanSeenSubmission/SubmissionRefusedre-export that sat atlens.py:58;all of them are
lens_submission.*now, and both in-tree callers are repointedbelow. A compatibility re-export is exactly what this split cannot have — it
would re-import
human_seenintolens.pyand put the removed edge straightback, which is why
test_lens_column_split.pyasserts the absence. Nothingoutside this repository imports
scripts/ideation_dashboard/, and no changelogor release note names the moved symbols (checked:
contracts/CHANGELOG.mdisthe contract-release record and names neither); the § 3.1 carve manifest is
what will record the move, and it is authored later by design.
What moved
AddAsClusterResult+add_as_clusterand thehuman_seenimport they use, outof
lens.py(column oD, design D3: "the keyword-query half oflens… PULLUP") into a new
scripts/ideation_dashboard/lens_submission.py(column stays=
openxFactory's own engineering adapter, D3's third column under RULING DQ-1 —the same column as
human_seen.py).lens.py:228-282— 55 lines, 3,014 byteslens_submission.py:55-109— 55 lines, 3,014 bytes7c12c6df73b437e1d84bbd36d66c3fe847916de5207d5b78fa28394a7acc42237c12c6df73b437e1d84bbd36d66c3fe847916de5207d5b78fa28394a7acc4223lens.pylens_submission.pycmpon the two extracts is clean: the relocated text is byte-identical, notmerely equivalent. The memo measured this block at
:229-282ond758a6df; the@dataclassdecorator on:228is part of the same statement and travels withit, which is the only drift against the memo's numbers.
Every line that is NOT the relocation
Eight changes, all of them consequences of the move; nothing else in the tree was
renamed, reordered or reformatted.
lens.py:54—from pathlib import PathDELETED.Pathhad no remainingreader in
lens.py(its four uses were all inside the moved block).lens.py:57—from . import human_seen, workbench as wb→from . import workbench as wb. This is the removed edge.lens.py:58—from .human_seen import HumanSeenSubmission, SubmissionRefused # noqa: F401 (re-export)DELETED, and moved verbatim tolens_submission.py:50. The re-export had no in-tree reader (scanned:every consumer imports both names from
human_seendirectly, ashs), so nocaller is affected — but leaving it would have kept
human_seenonlens'simport graph, which is the whole edge.
lens.py:59-62—ACTION_ADD_AS_CLUSTER,OutputBoundaryandsavedropped from the
from .workbench import (…)block; the remaining six nameskeep their order and the block keeps its shape. All three had no reader left
in
lens.py.lens.py:48— five lines APPENDED to theadd-as-clusterparagraph of themodule docstring (an addition, not a rewrite — the RECIPE SEMANTICS list is
otherwise untouched), in the spirit of
serve_wire.py:37-39's own recordedobligation:
Two stale prose references in the browser half, one word each — they named
a Python symbol that no longer resolves:
web/views/lens.js:152the tested engine lens.add_as_cluster submits it)→
…lens_submission.add_as_cluster submits it)web/views/lens-model.js:1024lens.add_as_cluster submits it via human_seen.py→lens_submission.add_as_cluster submits it via human_seen.py(the sentence rewraps onto the next comment line; no otherword changed)
lens-model.js:951("MUST be byte-identical tolens.PENDING_PROPOSAL_NOTE")is still true and untouched — see below.
lens.py:64-75— thePENDING_PROPOSAL_NOTEcomment block rewritten(Copilot round 1,
67eabd32): it still opened "add_as_cluster SUBMITS …" asthough the verb lived in this module. Now names
lens_submission.add_as_cluster, records that the verb left with pre-carvesplit S-2, and states why the NOTE itself did not follow it (its
byte-identity cross-check is against this module's own browser half,
web/views/lens-model.js, so both halves of that pair stay in the openDoxcolumn). Prose only — no import, no behaviour, no name.
lens.py:213— one word in thebuild_workbench_from_recipedocstring(fix round 1): "the caller persists it via
save/add_as_cluster" →"…
save/lens_submission.add_as_cluster" —add_as_clusterno longerresolves in this module, the same class of stale reference already fixed in
lens.js:152andlens-model.js:1024.Deliberately NOT changed:
from . import workbench as wbinlens.pyis nowa lone unused alias. It was already unused before this PR (introduced by
82ae3d8c, 2026-08-03; nolens.wbreader and nosetattr(lens, "wb", …)anywhere in the tree), so removing it would be unrelated cleanup rather than part
of the relocation, and it is left exactly as it was.
Repointed callers — the repoint IS the split
No re-export back into
lens.py. The obvious kindness (from .lens_submission import add_as_cluster) would re-importhuman_seenintolens.pytransitivelyand put the edge straight back, with every behavioural test still green. So both
in-tree callers were repointed instead:
gate_routes.py:950—from . import lens, workbench as wb→from . import lens, lens_submission, workbench as wb;:960lens.add_as_cluster(→lens_submission.add_as_cluster(.gate_routeskeeps importinglensbecausethe same function still calls
lens.build_workbench_from_recipe(oD).tests/ideation-dashboard/test_lens.py— one import line added, four callsites repointed (
:489, :533, :550, :562). Repointed rather than moved to anew test module (the brief's preference, and the smaller diff): the four
add-as-cluster tests sit inside a file whose fixtures,
_snapshot(),_submission()and node harness the rest of the file shares.AddAsClusterResulthad no reader outsidelens.pyat all.test_human_seen.pyimports
lensonly forbuild_workbench_from_recipe, which stayed — untouched.Cross-column import edges, BEFORE and AFTER
AST scan over all 60 modules in
scripts/ideation_dashboard/, columns from thescout memo § 2.2 table (which supersedes design.md D3's 48-row list for the twelve
§ 2.4 modules);
core= D3's four "residue that splits BY FUNCTION" modules(
serve,cli,workbench,authoring);lens_submissionis tagged stays.Counts are per import STATEMENT, so they do not line up with the memo's
per-module-pair figures — the delta is what this table is for.
Removed (both of them, and they were the only two):
lens.py:57 from . import human_seenlens.py:58 from .human_seen import HumanSeenSubmission, SubmissionRefusedThe surviving
oD → oxFedge under this PR's own relative-import-plus-import ideation_dashboard.Xscan isdoxbench_packet.py:177 import ideation_dashboard.doxbench_status_exemption as rail(transcribed as itactually reads; the known § 2.4 item (a) seam, not mine) — but it is not the
only one: an independent verifier's full-spelling scan (adding
from ideation_dashboard import X/from ideation_dashboard.X import …) finds twofurther pre-existing edges this PR's scanner spelling misses —
serve_wire.py:1333 → doxbench_contracts(a secondoD → oxFedge, and theS-3 lane's own file) and
cli_gate.py:49(anoXd → oxFedge). Both arepre-existing, neither is touched by this PR, and neither changes any delta
above; the scanner-spelling gap itself is carried to the manifest author.
lens.pynow imports nothing fromhuman_seenin any spelling.Added, and recorded as residuals for the manifest author rather than solved
here (all three are the same OQ-B shape as
human_seen.py:46's existingfrom .workbench import slug, which the memo files as unruled):lens_submission.py:52 from .workbench import ACTION_ADD_AS_CLUSTER, OutputBoundary, Workbench, save— unavoidable:add_as_clusterpersiststhrough the engine, and memo § 4 S-4 sends
workbench.pywhole to openDox.lens_submission.py:51 from .lens import PENDING_PROPOSAL_NOTE— deliberate,and the reason is a landed cross-check. The constant carries a byte-identity
contract with
web/views/lens-model.js's constant of the same name, asserted bytest_js_and_python_persistence_constants_agree. Both halves of that pair arethe openDox lens, so leaving the constant in
lens.pykeeps the cross-checkinside one column after the carve; moving it would have split a
cross-checked pair across a repository boundary. One import edge is the cheaper
of the two prices, and it is declared rather than hidden.
gate_routes.py:950 from . import lens_submission— openXdox's gate loopreaching the adapter verb, which is what the verb now is.
Net total +1: the block's dependencies (
workbench,PENDING_PROPOSAL_NOTE) nowcross the boundary from the other side. That is inherent to the S-2 design as
specified, not a choice made here; the direction that mattered — openDox
reaching openxFactory — is gone.
Tests
python3 -m pytest -q tests/ideation-dashboard— 5,096 passed, 31 skipped,1 failed in 663s. The one failure is
test_snapshot.py::test_find_validator_locates_pinned_checkout, and it ispre-existing and environmental, not this change: it asserts that a
sibling
openxFactorycheckout is reachable from the repo root, and thiswork was done in a
git worktreeunder/tmpthat has no such sibling.Proven rather than asserted — a clean
origin/mainworktree at56e69a11, in the same directory, fails the same single test with the sameassert None is not None. It passes on CI, where the checkout is asubmodule of the aggregation.
python3 -m pytest -q -p no:cacheprovider tests/): not ausable local signal, and that is stated rather than papered over. This work
was done in a
git worktree, where theopenXwalletsubmodule is notchecked out; the
pytest-suiteworkflow doesgit submodule update --init openXwalletand puts the pinnedopenspecCLI onPATHbefore it runs, andwithout that setup the local run takes 50 collection ERRORS in one band at
6-7%, none of them near this change. It was stopped rather than reported as
if it meant something. The
pytest-suitecheck on this PR is theauthority — it runs
pytest tests/on a clean checkout with that setup, andit is GREEN on head
67eabd32(run34328587320), together with the othernine checks:
lane-line,clearing-dispatch-gate,merge-master-approval,openreposhape-pin,openspec-cli-pin,release-tag-gate,signed-execution-chain-gate,wallet-validationandcopilot-pull-request-reviewer— allsuccess.tests/ideation-dashboard/test_lens_column_split.py(114 lines, 3 tests),named after
test_cli_column_split.py, the § 2.4 split's own precedent. Itholds the removed edge: an AST scan (PARSED, NOT GREPPED —
lens.py's docstringand its
PENDING_PROPOSAL_NOTEcomment both still NAMEhuman_seen.pyinprose and must keep doing so) over
lens.pyfor every spelling of the edgeincluding lazy function-local imports; a negative control measuring the same
input that asserts the scanner catches all six spellings of a restoration;
and an assertion that
add_as_clusteris NOT re-exported fromlens.tests/import_scan.py'simported_modulesskips relative imports by design(it polices a direction BETWEEN packages), which is why the scan is local.
this PR is the four-call-site repoint above.
Doc-health and proposal-support parity
python3 scripts/doc-health.py --single-repo .— 10 critical, 9 error, 57warning, 16 info; canon share 39.3%. Identical to a clean base worktree at
56e69a11: the two reportsdiffto zero lines after normalising theworktree-derived
Repo-Identity.python3 scripts/proposal-support.py . verify—proposal support verification ok(exit 0).NOT DONE
No carve. No
docs/opendox-carve-manifest.yaml(it does not exist and was notcreated). No
openspec/**,contracts/**or.github/**edit — D3's columntable and the ratified packet are untouched, and the manifest author re-measures
later. No behaviour change, no renamed or re-signed public name. The three
OQ-B edges are untouched:
human_seen.py:46from .workbench import slug,intent_apply_lane.pybranch_session.bootstrap_sessions, andserve_openxfactory_lanes.py's fourserve_wirenames — all unruled. Splits S-1(
doxbench_scope) and S-3 (serve_wire.hosted_index) belong to sibling PRs;doxbench_scope.pyandserve_wire.pyare not touched here.Asking for Brett Heap's separate word to land this.
🤖 Generated with Claude Code
https://claude.ai/code/session_012LiNG5Ume1boEfxSNeCmpu