Skip to content

Level the leg scaffold, round 2: runtime dependencies, package install in validate, and the disclosed collect_ignore list (RULED Q-L2/Q-L3(b)) - #5

Merged
brettheap merged 3 commits into
mainfrom
chore/level-round-2-deps-and-ignore-list
Sep 10, 2026
Merged

brettheap merged 3 commits into
mainfrom
chore/level-round-2-deps-and-ignore-list

Conversation

@brettheap

@brettheap brettheap commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

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

Refs opensoft/openXfactory#656

Round 2 of the levelling pass for the carve. Scaffold files only — three of
them, and no carved row is touched, because the arrival verifier admits a
scaffold file only when its bytes equal origin/main's copy. This must land
BEFORE leg 1 is re-cut.

The ruling this lands on

RULED (Brett Heap, 2026-09-10 — verbatim "rule Q-L1 approve, Q-L2 approve, Q-L3 (b), Q-L4 re-cut"):

Q-L2 APPROVED — levelling, round 2, on opensoft/openDox-code. Scaffold
files only: runtime dependencies declared in pyproject.toml,
validate.yml installs the package; no carved row touched.

Q-L3 = (b) — the disclosed collect_ignore list. The scaffold
conftest.py names exactly the tests awaiting the openXdox-code leg and the
BUILD arc (the verifier's named list), each with its reason, so validate is
green on what can run. The list is a levelling artefact, removed by the BUILD
arc (§ 3.5/3.6); it lands in the same round-2 levelling PR.

Cause 4 of the four reds recorded on openxFactory#656 is the only one of the
four that is a levelling gap rather than carve-arc work: validate.yml
installed pytest alone and pyproject.toml declared no dependencies, so the
first carved commit (#4) failed the one required check with
No module named 'yaml'.

1. pyproject.toml — the runtime dependency set (Q-L2)

Derived, not guessed: an ast walk over all 88 .py files under
src/opendox/ and tests/ in the carve leg's tree (#4, head cfabe3c4),
collecting every Import/ImportFrom in the module body and in
module-level if/try/with blocks, discarding explicitly-relative imports,
then partitioning the top-level names against sys.stdlib_module_names.
37 names are standard library. Exactly two are third-party:

declared distribution where imported by
PyYAML>=6.0 runtime, dependencies module level (3) src/opendox/branch_session.py, canvas_drafts.py, workbench.py
function level (5) src/opendox/doxbench_binding.py, doxbench_intake.py, serve_project.py, tests/test_doxbench_chat_view.py, tests/test_model_provider_broker.py
pytest>=8,<9 test extra, [project.optional-dependencies] test module level (41) 41 test modules

Every other non-stdlib name is a file this repository already supplies: the
opendox package itself; the test-tree helpers that arrive as rows or declared
replicas (conftest, session_fixtures, staging_shapes, hermeticity,
import_scan, smoke_signals, test_doxbench_view); and Q-L1's two
extension-point modules, both stdlib-only (route_extension imports
dataclasses/typing, subcommand_extension imports typing), so neither
adds a dependency.

openxdox and ideation_dashboard are deliberately NOT declared. They are
the cross-column reaches the BUILD arc removes (split-opendox § 3.5/3.6), not
dependencies. Declaring either would buy a green check by pinning openxFactory's
tree shape into this leg's dependency set.

Lower bounds only, and the floor is stated rather than guessed. The carved
modules use two PyYAML entry points — yaml.safe_load (9 sites) and
yaml.safe_dump (5, with sort_keys / default_flow_style /
allow_unicode) — and the newest of those is sort_keys=, carried since
PyYAML 5.1. So >=6.0 is not the oldest release that would work; it is
the floor this leg has been exercised against, and what openxFactory itself runs
(requirements/hermes-runtime-contracts.lock at the carve commit pins
pyyaml==6.0.3). Deliberately not done: a --require-hashes lockfile —
pinning this leg's supply chain by digest has a real owner and is not something a
levelling PR should invent for a destination's validate.

2. .github/workflows/validate.yml — install the package (Q-L2)

python -m pip install -e ".[test]" replaces pip install "pytest>=8,<9".
The pytest range round 1 chose is unchanged — pytest>=8,<9, still the only
upper bound — but its home moves into the extra, so it is declared once and the
workflow reads it instead of carrying a second copy that can drift while both
keep passing. permissions: contents: read, both triggers, and the
python -m pytest -q step are untouched; the install step is the only change.

3. conftest.py — the disclosed collect_ignore list (Q-L3 (b))

Two reasons qualify and nothing else. Counts, measured against the carve
leg's own tree:

collection errors tests collected
leg 1 as it stands (#4) 8 965
+ deps installed + Q-L1's two replicas placed 8 965
+ this collect_ignore list 1 965
+ Q-L1's test_boundary.py:14 rewrite simulated 0 993
entry reason
tests/test_doxbench_chat_view.py awaits openXdox-code leg (imports openxdox.*)
tests/test_doxbench_entrypoint.py awaits openXdox-code leg (imports openxdox.*)
tests/test_hermeticity.py awaits openXdox-code leg (imports openxdox.*)
tests/test_model_provider_broker.py awaits openXdox-code leg (imports openxdox.*)
tests/test_subcommand_extension.py awaits openXdox-code leg (imports openxdox.*)
tests/test_workbench.py awaits openXdox-code leg (imports openxdox.*)
tests/test_session_harness.py awaits BUILD arc (execs openxFactory-only script)

Six reach openxdox.*, directly or through opendox.workbench /
branch_session / cli. tests/test_session_harness.py is a
moved_verbatim row that execs scripts/sync-notebooklm-books.py, an
openxFactory-only file with no row that never travels, so no leg can satisfy
it — only the BUILD arc's rework. Deleting an entry is the whole of the removal;
nothing else in the repository refers to it.

Mechanics checked against pytest's own source rather than assumed:
_getconftest_pathlist resolves a conftest's collect_ignore against that
conftest's own parent directory
and walks the conftest chain most-specific
first, returning the first module that defines the name. The arrived
tests/conftest.py defines no collect_ignore, so this root list is the one
pytest reads, and its entries are repository-relative.

tests/test_boundary.py is deliberately ABSENT — a FINDING, not an entry

It fails to import on a bare import output_boundary at line 14, an
UNDECLARED line the leg could not rewrite. That is cause 3 of #656, and
RULED Q-L1 has the manifest amendment declare exactly that line, after which
the row rewrites to from opendox import output_boundary and the module
imports — simulated above, and collection goes to 0 errors. It is fixed
upstream, not ignored.

If the Q-L1 amendment lands without declaring tests/test_boundary.py:14,
this list is one entry short and the re-cut leg's validate will be red on
it.

The replica-placement assumption

Computing the list needs Q-L1's two modules present, so this PR had to decide
where the leg's imports expect them. Determined from evidence, not assumed:
the importing lines are bare, top-level imports on lines the leg did not
rewrite —

src/opendox/serve.py:117            import route_extension        # noqa: E402
src/opendox/cli.py:65               import subcommand_extension   # noqa: E402
tests/test_subcommand_extension.py:38  import subcommand_extension  # noqa: E402

— and edit-plan.txt confirms no declared line touches any of them (cause 1's
lines are undeclared, and Q-L1 declares cause 3's lines, not these). A bare
top-level name resolves only against a sys.path root, so the modules were
placed at src/route_extension.py and src/subcommand_extension.py —
directly on this leg's src/ import root, one level above src/opendox/,
which mirrors their openxFactory home (scripts/route_extension.py, one level
above scripts/ideation_dashboard/) exactly. Both then resolved; neither
appears in any remaining error.

FINDING for the Q-L1 manifest lane: src/opendox/route_extension.py
would not work. Inside the package the modules resolve only as
opendox.route_extension, and the importing lines are undeclared, so the
re-cut leg cannot rewrite them to reach it. The two
replicated_at_destination rows should target src/<name>.py.

FINDING — this list does not make the re-cut leg's validate green

Disclosed rather than discovered later. With the list active, Q-L1's replicas
placed and its test_boundary line simulated, the leg's suite reports:

993 collected, 0 collection errors
0 passed, 0 failed, 11 skipped, 982 errors      exit 1
every one: ModuleNotFoundError: No module named 'openxdox'

The remaining failure is not a collectible file. The arrived
tests/conftest.py re-exports two autouse fixtures from
tests/session_fixtures.py (line 106, from session_fixtures import …), and
their bodies import opendox.cli / opendox.actor_identity:

tests/session_fixtures.py:413  declared_human_console  ->  from opendox import cli
src/opendox/cli.py:68         ->  from opendox import authoring
src/opendox/authoring.py:60   ->  from .workbench import slug
src/opendox/workbench.py:70   ->  from openxdox.snapshot import find_validator
E                                 ModuleNotFoundError: No module named 'openxdox'

Autouse applies to every test under tests/ — including the scaffold's own
tests/test_leg_shape.py, which reports 12 setup errors when it is the only
file collected. collect_ignore removes files from collection; it cannot remove
a fixture. Both files are carved rows this PR may not touch.

So Q-L3 (b) is necessary but not sufficient: it converts an interrupted
collection into a suite that runs, and it documents exactly which suites await
which arc, but validate on the re-cut leg stays red until the openXdox-code
leg lands or the BUILD arc inverts the direction. This needs Brett Heap's word
before the re-cut
— the options are Q-L3 (a) (land red on his word) for leg 1
only, or an additional scaffold act that neutralises the two autouse fixtures,
which is beyond both this PR's fence and the ruling as written.

Verification

Computed in a throwaway worktree of #4's head (cfabe3c4) with this branch's
pyproject.toml installed — Python 3.12.3, PyYAML 6.0.3, pytest 8.4.2, all
within the declared ranges. Nothing was written to #4 or its branch.

This branch's own validate, run locally exactly as the workflow does:

$ python -m pip install -e ".[test]"   ->  Successfully installed … opendox-0.0.0
$ python -m pytest -q                 ->  12 passed in 0.04s          exit 0

tests/test_leg_shape.py is untouched and green; its assertions forbid nothing
this PR needs (it fixes the role directory, requires pyproject.toml and
conftest.py to exist, and says nothing about their contents). collect_ignore
entries naming files absent from this branch are inert.

Not done, deliberately

Copilot round

Two threads, both on conftest.py, both replied to and resolved.

  1. "there is no tests/conftest.py in this repo" — correct about this
    branch, and the header said "arrived" where it meant "arrives with the
    carve". tests/conftest.py is one of leg 1's eight declared replicas.
    FIXED in a0358ac (comment text only): the header now states the tense
    outright. The underlying claim was verified rather than assumed — in the
    leg's tree that file defines no collect_ignore, pytest_ignore_collect or
    pytest_collect_*, which is what keeps this root list the one pytest reads.
  2. "filter the list to only existing paths" — declined, with reasons. The
    answer would be zero entries, because the list is necessarily
    forward-declared: the arrival verifier admits a scaffold file only when its
    bytes equal main's copy, so conftest.py cannot be edited during or after
    the re-cut. Staleness is bounded by each entry's named removal condition
    rather than by presence on disk — a filtered list would silently drop an
    entry the moment its path moved, which is the masking the comment warns
    about. Documented in a0358ac.

Sourcery skipped (account review budget exhausted). SonarCloud Code Analysis
is red and is NOT a required check
— validate is the only one
(repos/opensoft/openDox-code/rules/branches/main); it reports no description
on the commit status, and this PR adds one comment block and two declarations to
three scaffold files. Disclosed rather than silently passed over.

Rollback

Revert the two commits. The scaffold returns to what #3
left, and the leg pins nothing and is pinned by nothing until Phase 3.

Lands on Brett Heap's rulings Q-L2/Q-L3 (b), via the lane's gate; must land
BEFORE leg 1 is re-cut.

Head: a0358ac3d9c9a0bef69df90eeb2df131b26a8919 (three commits)

🤖 Generated with Claude Code

…idate (RULED Q-L2)

Round 1 of this levelling pass built the import root and stopped. So
`pyproject.toml` declared no dependencies and `validate.yml` installed the test
runner alone, and the first carved commit (#4) failed the one required check
with `No module named 'yaml'` — cause 4 of the four reds recorded on
openxFactory#656, and the only one of the four that is a levelling gap rather
than carve-arc work.

`dependencies` now names every third-party module the arrived rows import,
derived by an `ast` walk over all 88 `.py` files under `src/opendox/` and
`tests/` in the carve leg's tree (#4, head `cfabe3c4`) — module body plus
module-level `if`/`try`/`with` blocks, relative imports discarded, top-level
names partitioned against `sys.stdlib_module_names`. 37 names are standard
library; exactly two are third-party. `yaml` (PyYAML) is the runtime one, and
`pytest` moves into a `test` extra. Everything else non-stdlib is a file this
repository already supplies: the `opendox` package, the test-tree helpers that
arrive as rows or declared replicas, and Q-L1's two stdlib-only extension-point
modules.

`openxdox` and `ideation_dashboard` are deliberately NOT declared. They are the
cross-column reaches the BUILD arc removes (split-opendox § 3.5/3.6), not
dependencies; declaring either would buy a green check by pinning
openxFactory's tree shape into this leg's dependency set.

Lower bounds only. The floor is stated rather than guessed: the carved modules
use `yaml.safe_load` (9 sites) and `yaml.safe_dump` (5, with `sort_keys` /
`default_flow_style` / `allow_unicode`), and the newest of those is
`sort_keys=`, carried since PyYAML 5.1 — so `>=6.0` is not the oldest release
that would work, it is the floor this leg has been exercised against and what
openxFactory itself runs (`pyyaml==6.0.3` in its lockfile at the carve commit).

`validate.yml` installs `-e .[test]` in place of the bare runner. The pytest
range round 1 chose is unchanged — `pytest>=8,<9`, still the only upper bound —
but its home moves into the extra, so it is declared once and the workflow
reads it rather than carrying a second copy that can drift while both keep
passing. `permissions: contents: read` and the `python -m pytest -q` step are
untouched; the install step is the only workflow change.

Scaffold files only. No carved row is touched: the arrival verifier admits a
scaffold file only when its bytes equal `origin/main`'s copy, so this lands
BEFORE leg 1 is re-cut.

Refs opensoft/openXfactory#656

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 10, 2026 03:36
@sourcery-ai

sourcery-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Reviewer's Guide

This round levels runtime dependency handling by declaring PyYAML and the existing pytest range in pyproject.toml, then updating validation to install the package and test extra via pip install -e '.[test]'. The metadata also documents how dependencies were derived, why cross-column imports are excluded, and why versions are lower-bounded without introducing a lockfile.

File-Level Changes

Change Details Files
Declare the carved package’s runtime and test dependencies in project metadata, and install them through the validation workflow.
  • Add PyYAML as the runtime dependency based on the carve’s import analysis and exercised version floor.
  • Move the existing pytest range into a test optional dependency.
  • Change CI installation to editable-install the package with its test extra, ensuring package dependencies are available during tests.
pyproject.toml
.github/workflows/validate.yml
Document the dependency derivation, versioning rationale, and intentionally excluded cross-column imports.
  • Explain the AST-based import inventory and distinguish third-party dependencies from repository-local modules.
  • Record why openxdox and ideation_dashboard are not package dependencies.
  • Defer hash-pinned supply-chain locking as a separate follow-up.
pyproject.toml

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

The PR description indicates it is still a draft with a second planned commit (the disclosed collect_ignore list) that has not landed yet.

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

Pull request overview

This PR levels the openDox “code leg” scaffold by formally declaring runtime/test dependencies in pyproject.toml and updating the validate GitHub Actions workflow to install the package (and its test extra) before running the test suite.

Changes:

  • Declare PyYAML>=6.0 as a runtime dependency and move the pytest range into a test optional extra.
  • Update validate.yml to pip install -e ".[test]" before executing python -m pytest -q.
File summaries
File Description
pyproject.toml Adds runtime deps (PyYAML) and defines a test extra containing the pytest version range.
.github/workflows/validate.yml Installs the package plus .[test] in CI so runtime deps are present during validation.
Review details
  • Files reviewed: 2/2 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.

…ox leg and the BUILD arc (RULED Q-L3 (b))

Seven arrived test modules cannot import at this leg's position in the runbook
§ 5.1 order, because they reach across the carve for something not yet carved.
Six import `openxdox.*`, directly or through `opendox.workbench` /
`branch_session` / `cli` — the ruled § 5.5 rewrite pointing at the
next-but-one leg. One, `tests/test_session_harness.py`, is a `moved_verbatim`
row that `exec`s `scripts/sync-notebooklm-books.py`, an openxFactory-only file
with no row that never travels, so no leg can ever satisfy it. Naming them here
turns 8 collection errors into 0, which is the difference between a suite that
is interrupted at collection and one that runs.

Each entry carries its reason and its removal condition. The list is a
levelling artefact removed by the BUILD arc (split-opendox § 3.5/3.6) or by the
openXdox-code leg, whichever reaches it first; deleting an entry is the whole
of the removal.

`tests/test_boundary.py` is deliberately ABSENT, and the header says why. It
fails to import on a bare `import output_boundary` at its line 14 — an
UNDECLARED line, so the leg could not rewrite it. That is cause 3 of
openxFactory#656, and RULED Q-L1 has the manifest amendment declare exactly
that line; with the rewrite simulated, collection is clean. It is fixed
upstream, not ignored. Only two reasons qualify for this list, and any other
failure is a finding reported on the pull request rather than added here.

Verified against the carve leg's own tree (#4, head `cfabe3c4`) in a throwaway
worktree with this branch's `pyproject.toml` installed and Q-L1's two
extension-point modules placed: 8 collection errors before, 1 after (the
finding above), 0 with that line's declared rewrite applied; 993 tests
collected.

FINDING, disclosed on the pull request: this list does NOT make `validate`
green on the re-cut leg, because the remaining failure is not a collectible
file. The arrived `tests/conftest.py` re-exports two AUTOUSE fixtures from
`tests/session_fixtures.py`, and their bodies import `opendox.cli` /
`opendox.actor_identity`, which reach `openxdox.snapshot` through
`authoring` -> `workbench`. Autouse applies to every test under `tests/`,
including the scaffold's own `tests/test_leg_shape.py` — 12 setup errors when it
is the only file collected. `collect_ignore` removes files from collection and
cannot remove a fixture, and both files are carved rows this pull request may
not touch.

Scaffold file only: the root `conftest.py`, which carries no manifest row
(RULED OQ-C).

Refs opensoft/openXfactory#656

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 10, 2026 03:39
@brettheap
brettheap marked this pull request as ready for review September 10, 2026 03:41

@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.

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 20 hours and 50 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

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 new conftest.py documentation and collect_ignore configuration are currently inconsistent with the repository contents (nonexistent tests/conftest.py mention and ignore entries for missing files), which should be corrected to avoid misleading behavior as the carve progresses.

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

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

Comment thread conftest.py Resolved
Comment thread conftest.py Resolved
… round)

Copilot read the list against this branch, where none of the seven files exist
yet, and reported the header as misleading on two counts: it calls
`tests/conftest.py` "arrived" when this repository has only a root
`conftest.py`, and it names test modules absent from `tests/`.

Both observations are correct about this branch, and both were the intended
meaning stated in a tense that did not carry it. The header now says outright
that nothing the list names exists here yet and why that is the point: every
path arrives with the carve, and the file has to be carrying the list already
when they do, because the arrival verifier admits a scaffold file only when its
bytes equal `main`'s copy — so `conftest.py` cannot be edited during or after
the re-cut. It also records that a `collect_ignore` entry naming an absent file
is inert, so the list is a no-op here and takes effect when the rows land, and
that `tests/conftest.py` likewise arrives with the carve, as a declared replica.

Comment text only. The seven entries are unchanged, and filtering them to
paths that exist today would empty the list and defeat RULED Q-L3 (b).

Refs opensoft/openXfactory#656

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 10, 2026 03:43
@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

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.

🟢 Approval recommended

The changes are limited to scaffold configuration/docs and correctly align CI installation with declared dependencies without introducing functional code-path risk.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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