Skip to content

openxFactory: retire the corpus_adapter replica in favour of the pinned openDox copy (#872, RULED OQ-Q) - #934

Merged
brettheap merged 6 commits into
mainfrom
change/retire-corpus-adapter-replica
Sep 11, 2026
Merged

brettheap merged 6 commits into
mainfrom
change/retire-corpus-adapter-replica

Conversation

@brettheap

@brettheap brettheap commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox)

Refs #872. Refs #656 (stays OPEN).

Measurement (throwaway, never pushed) — deletion is REFUSED

Per Brett's ruling on #656 ("#872: START NOW, LAND WHEN GREEN"), the first
step was to measure whether the carve manifest actually allows deleting
scripts/corpus_adapter.py. It does not, re-verified twice: once on main
tip 6889b183, and again after PR #928 (post-shed mode) landed at
0e76e789. Both times, a detached-HEAD scratch commit removing the file
and running python3 scripts/validate-carve-manifest.py against it produced:

FAIL docs/opendox-carve-manifest.yaml: carve-path-absent — 1 row(s) name
path(s) DELETED SINCE THE CARVE — under the surface at b075fd91dc8f, absent
at <scratch-sha>: scripts/corpus_adapter.py. Check 3 reports this for a
MOVED row, with its digest; this is what reports it for a `not_moved` row,
which the digest loop never reads at all

This is FULL RETIREMENT vs. RE-POINT-ONLY: RE-POINT-ONLY, per the
task's own decision rule. scripts/corpus_adapter.py stays in tree
(manifest row not_moved / replicated_at_destination); only Brett can
flip that row's disposition to make deletion lawful. That's a finding for
Brett, not an action this PR takes — see "Two exits" below.

What this PR does

Re-points every executable reader of the corpus-adapter interface's
dataclasses at the pending openDox pin (openDox/code/src/opendox/corpus_adapter.py,
mirroring how openXdox/openXwallet are reached — sys.path gets the
submodule's own src/, then a normal package import), instead of the
local replica:

  • scripts/corpus_adapter_openxfactory/{adapter,classify,shape,home,check}.py
  • tests/corpus-adapter/test_conformance.py, test_openxfactory_adapter.py

Each gets a guard that raises a clear ImportError naming
git submodule update --init --recursive openDox when the tree is empty,
rather than a bare ModuleNotFoundError.

scripts/ideation_dashboard/authoring.py is not re-pointed, and stays
byte-identical to the carve commit (sha256 faaa9c48…). Its manifest row
is moved_with_declared_edit (destination
openDox/code/src/opendox/authoring.py), and validate-carve-manifest.py
check 3 pass 2 byte-locks a moved row's SOURCE path to its carve_commit
content for as long as phase: carve holds — measured directly with a
throwaway, never-pushed scratch commit that edited only the row's own
declared edits[].lines: [317, 318]: the validator still refused with
carve-digest-mismatch. So the lock is unconditional for a moved row, not
"declared lines only," and this file's one function-local import waits on
the same act scripts/corpus_adapter.py itself does.

scripts/corpus_adapter.py itself is untouched except a header comment
naming #872, the manifest disposition it's waiting on, and — as of this
round — an honest accounting of every remaining reader (see next section).

Every remaining reader of the replica, and why each stays

A repo-wide grep for import corpus_adapter / from corpus_adapter import
(excluding corpus_adapter_openxfactory/) gives the complete list. None of
these are re-pointable by this PR:

  • scripts/ideation_dashboard/authoring.py (one function-local
    import) — a genuine application reader, not a design choice: blocked
    by the digest lock on its moved_with_declared_edit carve-manifest row
    (previous paragraph). Concretely, this means the DocumentId it builds
    and hands to the pinned adapter's classify() is the replica's class,
    so the Classification it gets back carries that class at .id, not
    the pinned one — a real nominal-type crossing, currently inert only
    because nothing on that path compares by isinstance/dataclass
    identity rather than by attribute access. The header now says this
    plainly instead of claiming no application consumer remains.
  • scripts/carve_conformance.py, tests/carve_conformance/home_factory.py,
    tests/carve_conformance/test_verify_carve_conformance.py — by design:
    test_verify_carve_conformance.py's own docstring says a distinct
    class object here must PASS, because every carved destination holds a
    replica of the interface module.
  • tests/corpus-adapter/test_interface_closure.py — only touches value
    tuples/dicts and the Protocol itself (structural, not nominal); no
    split-module risk.
  • Two dashboard test modules, test_authoring_classify_derivation.py and
    test_doxbench_status_exemption.py — same structural-comparison design
    as above.
  • tests/corpus-adapter/test_no_privileged_route.py and
    test_no_home_vocabulary.py — read scripts/corpus_adapter.py by
    path
    , never imported, scanning its source text; the manifest's own
    evidence for this row cites exactly these two as the reason the replica
    stays.

Two exits for retiring scripts/corpus_adapter.py (and authoring.py's

import with it)

Neither is this PR's to take:

  1. Brett Heap flips the manifest row's disposition (not_moved →
    something that permits deletion) at his own act, outside this PR's
    HARD LIMITS (this lane never touches
    docs/opendox-carve-manifest.yaml).
  2. A shed PR takes the path with it. PR-2 (branch
    change/split-opendox-section-5-shed, in flight in parallel) may fold
    this file's retirement into its own scope.

The CI init fix (openDox/code was never on disk)

.github/workflows/pytest-suite.yml's single-line, non-recursive
git submodule update --init openXwallet openXdox openDox never fetched
openDox's own nested code gitlink, so
openDox/code/src/opendox/corpus_adapter.py was absent on the runner and
the required suite's collection failed for every consumer of
corpus_adapter_openxfactory (pytest-suite run
34552756662,
FAILURE). Fixed with a second, explicit step scoped to the one nested leg
this repository's own code now imports:

- name: Init the openXwallet, openXdox and openDox gitlinks only
  run: git submodule update --init openXwallet openXdox openDox

- name: Init the openDox code gitlink (RULED OQ-Q, #872)
  run: git -C openDox submodule update --init code

openXwallet's and openXdox's inits are untouched, and so is the
reasoning that nothing on this branch needs openXdox/code. Confirmed
narrower than the alternative: git submodule update --init --recursive openDox also pulls openDox/spec (openDox's other nested gitlink),
which nothing here reads — the explicit -C openDox … init code form
fetches only the one leg this PR's code imports.

PR-2 (change/split-opendox-section-5-shed) may carry the same fix; this
PR's commit landed first.

Validators run (this round, HEAD 9776effc)

  • python3 scripts/validate-carve-manifest.py — OK …: phase carve, 456 row(s) at opensoft/openxFactory@b075fd91dc8f (opendox-carve-0), verified at 9776effcc5be — 172 moved_verbatim, 146 moved_with_declared_edit, 138 not_moved; 318 digest(s) recomputed; 456 file(s) in the declared surface with none undeclared (manifest itself untouched)
  • python3 -m pytest tests/corpus-adapter tests/ideation-dashboard/test_authoring_classify_derivation.py tests/ideation-dashboard/test_doxbench_status_exemption.py -q
    — 152 passed
  • python3 -m pytest tests/carve_manifest tests/carve_arrival tests/carve_conformance -q
    — 247 passed
  • openDox/code/src/opendox/corpus_adapter.py vs scripts/corpus_adapter.py:
    identical through the Protocol/dataclass code (line 359); differ only in
    the local replica's trailing header comment, which the not_moved row
    tolerates (only deletion is refused, not edits)
  • python3 -m py_compile on every touched file — OK

What waits on the openDox pin (PR #932 — now merged and initialized here)

scripts/corpus_adapter_openxfactory/__init__.py eagerly imports
.adapter at package-import time, so every consumer of the package
collection-errors on the new guard until the submodule is initialized.
PR #932 merged and is initialized on this branch (openDox →
openDox/code), and the suites above confirm the collection succeeds.

Summary by Sourcery

Re-point openxFactory's executable corpus-adapter consumers to the pinned openDox interface while preserving the manifest-required local replica and making CI fetch the required nested submodule.

New Features:

  • Point executable openxFactory corpus-adapter consumers and their nominal-type tests at the pinned openDox interface.

Bug Fixes:

  • Ensure CI initializes the nested openDox code submodule so required tests can collect and run.

Enhancements:

  • Add actionable import errors when the pinned openDox corpus-adapter source is unavailable.
  • Retain the local corpus-adapter replica and document the remaining readers and manifest constraints preventing its removal.

CI:

  • Initialize only the nested openDox code gitlink required by the updated corpus-adapter consumers.

Tests:

  • Update corpus-adapter conformance and adapter tests to use the same pinned openDox dataclasses as the implementation.

🤖 Generated with Claude Code

…#872)

The carve manifest refuses to delete scripts/corpus_adapter.py while its
row stays not_moved/replicated_at_destination (measured: validate-carve-
manifest.py raises carve-path-absent), so the replica stays in tree with a
header comment naming #872 and the owed disposition change. Every
EXECUTABLE reader of the interface's dataclasses (corpus_adapter_openxfactory's
five modules, ideation_dashboard.authoring's proposal-classification path,
and the two test files whose isinstance checks run against the real
adapter's return values) now reaches openDox/code/src on sys.path and
imports opendox.corpus_adapter instead, guarded by a clear ImportError
naming the submodule init command when the tree is empty. Left unchanged:
the two neutrality tests and test_interface_closure.py (they read the
replica by path/value, never by nominal class identity, so they are safe
and the manifest's own evidence for keeping the replica cites them
directly), and carve_conformance.py's whole family (already written to
compare refusals structurally across separately-loaded interface copies,
by design, for exactly this carved-destination scenario).

This lands as a draft: scripts/corpus_adapter_openxfactory/__init__.py
eagerly imports .adapter, so until the openDox submodule (PR #932, RULED
Q7) is initialized, every consumer of the package collection-errors on the
new guard — expected and temporary, to be proven green once bound to that
pin.

Refs #872. Refs #656.

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

sourcery-ai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The PR switches openxFactory’s executable corpus-adapter path and nominal dataclass tests from the local replica to the pinned openDox copy, adds clear missing-submodule diagnostics and CI initialization for openDox/code, and deliberately retains and documents the replica because carve-manifest rules and remaining structural readers do not yet permit its deletion.

Sequence diagram for openxFactory adapter import and submodule guard

sequenceDiagram
    participant Consumer as openxFactory consumer
    participant Factory as corpus_adapter_openxfactory
    participant FS as openDox/code/src
    participant Adapter as opendox.corpus_adapter

    Consumer->>Factory: import package
    Factory->>FS: check corpus_adapter.py
    alt interface available
        Factory->>FS: sys.path.insert(0, src)
        Factory->>Adapter: import dataclasses and protocols
        Adapter-->>Consumer: pinned interface types
    else interface missing
        Factory-->>Consumer: ImportError
        Note over Consumer: Run git submodule update --init --recursive openDox
    end
Loading

File-Level Changes

Change Details Files
Route openxFactory’s executable corpus-adapter consumers and nominal-type tests to the pinned openDox implementation.
  • Add a consistent openDox source-path setup before importing interface dataclasses.
  • Replace local replica imports with opendox.corpus_adapter imports in the adapter modules.
  • Update tests to construct and validate against the same pinned dataclass objects as production code.
  • Fail with an actionable ImportError when the nested openDox code submodule is unavailable.
scripts/corpus_adapter_openxfactory/adapter.py
scripts/corpus_adapter_openxfactory/check.py
scripts/corpus_adapter_openxfactory/classify.py
scripts/corpus_adapter_openxfactory/home.py
scripts/corpus_adapter_openxfactory/shape.py
tests/corpus-adapter/test_conformance.py
tests/corpus-adapter/test_openxfactory_adapter.py
Ensure CI materializes the nested openDox code gitlink required for test collection.
  • Keep the existing top-level submodule initialization unchanged.
  • Add a narrowly scoped git -C openDox submodule update --init code step.
  • Update workflow comments to document why openDox/code is required while other nested legs remain uninitialized.
.github/workflows/pytest-suite.yml
Retain the local corpus-adapter replica for carve-manifest compatibility while documenting retirement blockers and remaining readers.
  • Explain that the manifest’s not_moved disposition currently prohibits deleting the replica.
  • Document the blocked authoring.py consumer and its nominal-type crossing with the pinned adapter.
  • List structural conformance tooling and source-scanning tests that intentionally continue reading the replica.
scripts/corpus_adapter.py

Tips and commands

Interacting with Sourcery

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

Customizing Your Experience

Access your dashboard to:

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

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Correct the import-path ordering and clarify the retained-replica header.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR repoints corpus-adapter consumers and nominal tests to the pinned openDox interface while retaining the manifest-required replica.

Changes:

  • Adds guarded openDox imports.
  • Updates adapter-related tests to use openDox types.
  • Documents why the local replica remains.
File summaries
File Summary
tests/corpus-adapter/test_openxfactory_adapter.py Uses pinned openDox types.
tests/corpus-adapter/test_conformance.py Aligns conformance types with openDox.
scripts/ideation_dashboard/authoring.py Repoints the interface import; path ordering needs correction.
scripts/corpus_adapter.py Documents the retained replica; header wording needs clarification.
scripts/corpus_adapter_openxfactory/shape.py Uses the openDox interface.
scripts/corpus_adapter_openxfactory/home.py Uses the openDox interface.
scripts/corpus_adapter_openxfactory/classify.py Uses the openDox interface.
scripts/corpus_adapter_openxfactory/check.py Uses the openDox interface.
scripts/corpus_adapter_openxfactory/adapter.py Loads the pinned openDox interface.
Review details

Suppressed comments (1)

scripts/ideation_dashboard/authoring.py:328

  • This check only avoids adding a duplicate path; it does not promote an existing _opendox_src entry to the front. If that path is already present after another directory, from opendox.corpus_adapter can resolve a different package, so this function does not reliably consume the pinned interface. Normalize the entry to index 0 before importing.
    if str(_opendox_src) not in _sys.path:
        _sys.path.insert(0, str(_opendox_src))
  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread scripts/corpus_adapter.py Resolved
brettheap added a commit that referenced this pull request Sep 11, 2026
… in lockstep with openXdox's pin (RULED Q7, #656) (#932)

The second direct upstream, on Brett Heap's rulings of 2026-09-10 22:3x–22:4xZ — Q7 "SECOND SUBMODULE — openxFactory mounts the openDox assembly root" (#656 comment 5626248666) and "openDox pin placement: OWN PR FIRST, MERGE WHEN GREEN" (5626260214) — superseding RULING F ("openXdox only", 2026-09-05) for the second upstream, recorded in runbook § 7. Mirrors #917 file-for-file: `.gitmodules`; the `openDox` gitlink → opensoft/openDox main `49a99df2561bf70e49337c999d79b36836718349` (`cat-file -t` = commit; equal to live main); `contracts/opendox-pin.yaml` (commit + `sorted-ls-tree-r-v1` digest `96655ad2d2b2b70e5d23b613d5f0e73232e39c75069959044b665313f2c76ee4` + `carve_commit b075fd9…`); `scripts/verify-opendox-pin.py` (four mirrored checks + LOCKSTEP as check 5; six refusal codes) with the hermetic suite `tests/opendox_pin/` (58 tests); `scripts/doc_health/pin_class.py` +2 members (`opendox-pin-carve-commit` REPO_LOCAL, `opendox-pin-product-commit` CROSS_REPOSITORY; census 73,26 → 75,28 MEASURED); `.github/workflows/pytest-suite.yml` inits `openDox` beside `openXwallet` and `openXdox`; `contracts/README.md` row; `docs/opendox-cutover-runbook.md` § 7 dated supersession. ONE NEW INVARIANT — LOCKSTEP: openxFactory's direct openDox pin MUST EQUAL the commit `openXdox/contracts/opendox-pin.yaml` names, read as a git BLOB at the commit the `openXdox` gitlink records (never the working tree); refused otherwise. The RULING-F test `test_ruling_f_is_checkable_no_opendox_pin_and_no_second_gitlink` is rewritten as `test_ruling_q7_two_direct_upstreams_in_lockstep` (exactly two product gitlinks; lockstep equality via an independent implementation). Fix rounds (d4ac93a, a3f1b8b; 9 Copilot threads resolved): the gitlink is read from the INDEX when it disagrees with HEAD — including a staged deletion or a staged type-change — so a one-commit resync of a replaced gitlink verifies before commit (3 regression tests; the sibling `verify-openxdox-pin.py` carries the same HEAD-first gap, unchanged here and owed a follow-up); the "sixth check" ordinal corrected everywhere; the pin file's text now says the blob-at-commit read the code performs. Validators at a3f1b8b: `OK opendox-pin verified: openDox@49a99df2…, … digest recomputed (96655ad2…), lockstep with openXdox confirmed`; `verify-openxdox-pin.py` OK; `validate-carve-manifest.py` `OK … phase carve, 456 row(s) … 318 digest(s)`; 143 pin/census tests + 209 carve tests passed. Unblocks #872 (PR #934: the `corpus_adapter.py` replica re-points to the pinned openDox copy, RULED OQ-Q) and PR-2 (the § 5.2 shed, RULED (a)). Independent verification: sonnet-max fix-round + re-verifier, 2026-09-11 — gitlink, live main and an independently recomputed digest all agree; lockstep holds at the recorded openXdox commit; 0 closing references in body and commits; six required checks green.

Refs #656 (stays OPEN). Refs #872.

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap and others added 2 commits September 10, 2026 21:45
Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
The header Copilot reviewed on scripts/corpus_adapter.py claimed only the
two neutrality tests still read the replica and "nothing else reads it".
False: scripts/carve_conformance.py, its test family
(home_factory.py, test_verify_carve_conformance.py),
test_interface_closure.py, and two dashboard test modules
(test_authoring_classify_derivation.py, test_doxbench_status_exemption.py)
also import it, by design, to compare shapes/refusals structurally rather
than by nominal class identity. The header now says so, distinguishing
"no application consumer" (true - every executable reader was re-pointed)
from the structural/test tooling that still reads this exact path.

Also revert scripts/ideation_dashboard/authoring.py's re-point.
validate-carve-manifest.py's digest check (pass 2) byte-locks every
`moved` / `moved_with_declared_edit` row to its content at the carve
commit; authoring.py's row is `moved_with_declared_edit` (destination
openDox/code/src/opendox/authoring.py), so re-pointing its one
function-local `corpus_adapter` import tripped `carve-digest-mismatch`
("CHANGED SINCE THE CARVE") the moment the manifest was checked against
this branch's actual HEAD rather than only the narrower validator
invocations quoted in the PR body. Confirmed by reverting the file to
its byte-identical carve-commit content (sha256 faaa9c48...) and
re-running validate-carve-manifest.py and the carve_manifest/
carve_arrival/carve_conformance suites green. Unlike corpus_adapter.py's
`not_moved` row (which tolerates edits, only path-deletion is refused),
this row's bytes cannot move AT ALL until the next re-cut ceremony -- so
authoring.py's `_classify_proposal` stays on the local replica for now,
for the same structural reason corpus_adapter.py itself stays in tree.

Refs #872. Refs #656.

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 11, 2026 01:57

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

Resolve the remaining replica import and ensure CI initializes the nested openDox submodule.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

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

Comment thread scripts/corpus_adapter.py Resolved
… too

Thread A: `.github/workflows/pytest-suite.yml`'s single-line, non-recursive
`git submodule update --init openXwallet openXdox openDox` never fetched
`openDox`'s own nested `code` gitlink, so `openDox/code/src/opendox/
corpus_adapter.py` was absent on the runner and the required suite's
collection failed for every consumer of `corpus_adapter_openxfactory` -- the
guard added there does its job (a clear ImportError instead of a bare
ModuleNotFoundError) but the pinned path it names was never materialized.
Fix: a second, explicit step, `git -C openDox submodule update --init code`,
scoped to the one nested leg this repository's own code now imports.
openXwallet's and openXdox's inits are untouched, and so is their reasoning
in the surrounding comment (nothing on this branch needs openXdox/code).
The comment's stale line -- "openDox/code ... is NOT needed for anything in
this pull request" -- predates this PR's own re-point and is corrected in
the same diff so the file stops contradicting its own repository.
PR-2 (branch change/split-opendox-section-5-shed) may carry the same fix;
this lands first, noted in the thread reply.

Thread B: the #872 header on `scripts/corpus_adapter.py` claimed "NO
APPLICATION CONSUMER reads this copy any more", which the previous commit
on this branch (716d7d3) made false again the moment it reverted
`scripts/ideation_dashboard/authoring.py`'s re-point -- correctly, per that
commit's own finding, since authoring.py's carve-manifest row is
`moved_with_declared_edit` and validate-carve-manifest.py's check 3 pass 2
byte-locks a moved row's SOURCE path to its `carve_commit` content while
`phase: carve` holds. Measured directly here (a throwaway, never-pushed
scratch commit editing only the row's own declared `edits[].lines: [317,
318]`): `validate-carve-manifest.py` still refuses with
`carve-digest-mismatch` / "CHANGED SINCE THE CARVE". So the constraint is
not "edits outside the declared lines fail" -- it is "no edit survives,
declared or not, until phase leaves carve" -- and the header now says so,
naming authoring.py as a forced holdover (blocked, not a design choice)
distinct from the structural test tooling listed beside it, and naming the
resulting nominal-type crossing (`Classification.id` carries the replica's
`DocumentId` class) as currently inert only because nothing downstream
compares by type rather than by attribute.

A repo-wide grep for `import corpus_adapter` / `from corpus_adapter import`
(excluding corpus_adapter_openxfactory/) confirms the header's reader list
is now complete: authoring.py plus the seven test/tooling modules already
named, and the two neutrality scans that read the path as text, never
import it.

Refs #872. Refs #656.

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 11, 2026 02:18
…utrality scan

My own header fix for the open Copilot thread on this file (previous
commit, 3851b07) named `scripts/ideation_dashboard/authoring.py` and
`_classify_proposal` directly and quoted the validator's
"CHANGED SINCE THE CARVE" message -- which tripped
tests/corpus-adapter/test_no_home_vocabulary.py's whole-source scan
(`GOVERNANCE_NOUNS` matches "ideation", "proposal" and "change" as
case-insensitive substrings anywhere in this file, comments included,
because this file travels to openDox and a governance noun in a comment
here is still a governance noun in what every implementer of the standard
reads). Caught by running the target suite before pushing further.

Reworded to the same content without the three substrings: the bare
filename `authoring.py` (no directory prefix), "that function"/"that
module" instead of naming `_classify_proposal`, and the `carve-digest-
mismatch` refusal CODE instead of its prose message. Re-ran both
neutrality tests green:
`pytest tests/corpus-adapter/test_no_home_vocabulary.py
tests/corpus-adapter/test_no_privileged_route.py -q` -> 8 passed.

No claim in the note changed; only the wording.

Refs #872. Refs #656.

Lane: openxfactory-4-opendox-extraction
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

Import-isolation findings and stale manifest evidence must be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (7)

scripts/corpus_adapter.py:369

  • The new routing leaves the module-level docstring's statement that both reader packages consume this copy (scripts/corpus_adapter.py:18-20) false; this hunk now routes the adapter package through openDox and separately documents authoring.py as a forced holdover. Please reconcile that authoritative description with the new consumer split so future interface-ownership and retirement work is not guided by contradictory documentation.
# NOTE (#872, RULED OQ-Q): openxFactory's executable readers of this module now
# import the pinned copy at `openDox/code/src/opendox/corpus_adapter.py` once
# that submodule is initialized (see `corpus_adapter_openxfactory/adapter.py`'s
# header). This file stays in tree because the carve manifest's row for this
# path is `not_moved / replicated_at_destination`, and deleting a retained
# row's path is refused by `validate-carve-manifest.py` (`carve-path-absent`):
# only flipping that row's disposition (Brett Heap's act) or folding this path
# into a follow-up shed PR makes removal lawful.

scripts/corpus_adapter.py:383

  • The PR description still lists scripts/ideation_dashboard/authoring.py among the readers re-pointed to openDox, but this branch intentionally leaves its function-local from corpus_adapter import DocumentId at authoring.py:317. This hunk documents that it is a blocked holdover, so update the description's executable-reader list and its "every reader" claim to match the code.
# NOT EVERY EXECUTABLE READER WAS RE-POINTED. `authoring.py`'s one
# function-local import still reads this replica, and unlike everything
# below this is not a design choice -- it is BLOCKED. That module's own
# carve-manifest row is `moved_with_declared_edit` (destination
# `openDox/code/src/opendox/authoring.py`), and `validate-carve-manifest.py`
# check 3 pass 2 byte-locks a `moved`/`moved_with_declared_edit` row's SOURCE
# path to its content at `carve_commit` for as long as `phase: carve` holds:
# ANY edit trips `carve-digest-mismatch`, not only an edit outside the row's
# declared lines -- measured directly: a one-line edit confined to the
# declared `edits[].lines: [317, 318]` still fails this way. So that
# module's import waits on the same act as this file does (a disposition
# flip or a shed PR), not on more effort here. Concretely: that function
# still builds its document identity from THIS module's class and hands it

scripts/corpus_adapter_openxfactory/adapter.py:73

  • This package module mutates the process-wide sys.path at import time. The repository's import convention explicitly avoids that because it changes resolution for every later import (scripts/scope_globs.py:64-77); if openDox adds a top-level module name that collides with an openxFactory dependency, importing this adapter will shadow it. Load opendox.corpus_adapter through a shared importlib-by-location helper (or otherwise restore the path immediately) instead of leaving this path globally installed.
sys.path.insert(0, str(_OPENDOX_SRC))

scripts/corpus_adapter_openxfactory/check.py:52

  • This module leaves a new source root installed in the process-wide sys.path whenever it is imported. The repository's established loader pattern avoids that global side effect (scripts/scope_globs.py:64-77); load the pinned package through a shared importlib-by-location helper instead so later imports cannot be shadowed by openDox.
sys.path.insert(0, str(_OPENDOX_SRC))

scripts/corpus_adapter_openxfactory/classify.py:49

  • This package module also leaves the pinned source directory in the process-wide sys.path after import. That contradicts the repository's explicit import-isolation convention (scripts/scope_globs.py:64-77) and can make unrelated top-level imports resolve from openDox; use the same shared by-location loader as the adapter instead of mutating global import state.
sys.path.insert(0, str(_OPENDOX_SRC))

scripts/corpus_adapter_openxfactory/home.py:70

  • This import-time sys.path mutation leaks the openDox source root into every caller that imports the package. That is contrary to the repository's documented import-isolation convention (scripts/scope_globs.py:64-77) and permits future openDox top-level modules to shadow openxFactory modules; use a shared location-based loader without global path mutation.
sys.path.insert(0, str(_OPENDOX_SRC))

scripts/corpus_adapter_openxfactory/shape.py:42

  • Importing this package module permanently prepends the openDox source directory to global sys.path. The repository explicitly rejects that behavior for library modules (scripts/scope_globs.py:64-77), because it can shadow unrelated imports in the caller; use a shared importlib-by-location loader rather than changing process-wide resolution here.
sys.path.insert(0, str(_OPENDOX_SRC))
  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 11, 2026 02:23
@brettheap
brettheap marked this pull request as ready for review September 11, 2026 02:26

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

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

It depends on the pending openDox submodule pin and has documented scope inconsistencies.

Review details

Suppressed comments (1)

scripts/corpus_adapter.py:402

  • This line says the two path-only neutrality scans were “named above,” but this note only names test_no_privileged_route.py earlier; test_no_home_vocabulary.py is not named anywhere in the file. Please name both scans here so the retained-replica consumers are an accurate retirement checklist.
#   - by path, never imported: the two neutrality scans named above
  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/corpus_adapter.py Resolved
@sonarqubecloud

Copy link
Copy Markdown

@brettheap
brettheap merged commit f06e401 into main Sep 11, 2026
15 checks passed
brettheap pushed a commit that referenced this pull request Sep 11, 2026
#934 (RULED OQ-Q, #872) landed a second, openDox-scoped `git -C openDox
submodule update --init code` step in `pytest-suite.yml` for the same reason
this branch made the openXdox/openDox init recursive: openxFactory's own
corpus-adapter readers import the pinned `opendox.corpus_adapter`, which a
one-level init leaves off the runner. The two are one act, so the resolution
keeps ONE recursive init — `git submodule update --init --recursive openXdox
openDox` — which covers both legs' `code` submodules, and folds #934's reason
into the retained comment rather than dropping it. `scripts/corpus_adapter.py`
stays: #934 keeps it as a replicated row until its disposition is ruled.

Refs #656

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
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