Skip to content

T035: empty collect_ignore; the seven modules run in a lone checkout (plan 034) - #51

Merged
brettheap merged 5 commits into
mainfrom
build/034-p1g-t035-empty-collect-ignore
Sep 27, 2026
Merged

brettheap merged 5 commits into
mainfrom
build/034-p1g-t035-empty-collect-ignore

Conversation

@brettheap

@brettheap brettheap commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Plan 034, task T035, slice P1-G (the whole suite in CI). The plan is specs/034-opendox-standalone-operation/tasks.md at opensoft/openxFactory main 133e37d9. This PR realizes boxes 9.1 (part) and 9.3 (part) of the ratified add-neutral-product-standalone-operability.

What changes

The root conftest.py's collect_ignore is empty. It held seven modules under RULED Q-L3 (b). Requirement 9 (FR-006) asks this leg for no exclusion, so an entry there now would be an undeclared one, and the block's comment says so.

Each of the seven is rewritten in place as a neutral openDox test that imports no sibling. No module leaves whole. Fifteen cases test another repository's tree, contract or verb. They leave this suite, and the next section lists each one with its destination. One case is added.

module before after cause repair
test_subcommand_extension.py 3 failed, 13 passed 16 passed CORE_COMMANDS still listed gate, which the host profile contributes since the carve (research R8) five core verbs
test_model_provider_broker.py 4 failed, 68 passed 72 passed Two source paths under scripts/ideation_dashboard/. __import__("ideation_dashboard.doxbench_bridge"), a string the carve's import rewrite could not see. from test_doxbench_model import FORBIDDEN_PORT_MEMBERS, a test module that stayed in openxFactory. src/opendox/ paths; opendox.doxbench_bridge; the 16-name set carried in verbatim, with its provenance
test_doxbench_entrypoint.py 4 passed, 4 errors 8 passed fixture setup reached openxdox.corpus_root (ConsumerReachUnavailable) cmd_generate_and_open runs for real, with the six phase-1 reaches stood in (below)
test_hermeticity.py 14 failed, 17 passed 26 passed Layer 2 of the guard was off (below). The layout pins described openxFactory's tree. Five cases test other trees. layer 2 on; the pins rewritten for this layout; five cases move
test_doxbench_chat_view.py 1 failed, 123 passed 124 passed read contracts/schemas/xfactory-workbench-chat-turn.schema.yaml, which the carve sent to openDox-spec that case moves; a browser/server pair pin is added
test_workbench.py 2 failed, 26 passed, 3 skipped 25 passed openxFactory's validator (the skips) and its doc-health check (the failures) six cases move
test_session_harness.py 1 collection error 17 passed loaded openxFactory's scripts/sync-notebooklm-books.py at import time the load and three cases move
total 24 failed, 4 errors, 1 collection error, 251 passed, 3 skipped 288 passed

"Before" is main 71b631bc, each file named on the command line, which pytest collects despite collect_ignore. "After" is 81f93777. Since then the review rounds added one case to test_hermeticity.py (27 passed at this head) and one assertion to a test_doxbench_chat_view.py case. Python 3.12.3, .[runtime,test] under constraints-cpython312-linux.txt.

Three findings fixed on the way

  1. Layer 2 of the hermeticity guard was OFF in this suite. tests/hermeticity.py's runner_seams() probed find_spec("ideation_dashboard.session_pr"). This leg has no such package, so the probe returned no seams, and workbench._default_runner and session_pr.SubprocessCommandRunner.run stayed real in every test. Layer 1 (the PATH shim) was still on. But a non-zero exit is the very degradation the notebook adapter swallows, so an escape through the default runner would have passed green. The carve manifest's row for the helper records the probe resolving "to nothing at a destination that lacks them". The seams now name opendox.workbench and opendox.session_pr, with no probe. With the layer on, the whole tests/ directory stays green, so no test was escaping.
  2. The BaseException handler scan read nothing. It walked scripts/ideation_dashboard/, which does not exist here, and passed on zero files. It now reads src/opendox/ (58 modules, 9 BaseException handlers, all re-raising), and it fails if it reads no module.
  3. The rootdir-anchor case matched a substring. rootdir: <repo> also matches rootdir: <repo>/tests. Planted: a tests/pyproject.toml with a pytest table makes tests/ the rootdir, which cuts the root conftest out, and it still prints configfile: pyproject.toml. Both of the old checks pass on that. The case now matches the whole value.

And the P1-E hand-off. The open-session-notebook case registers a home corpus first. Without one, the worktree listing refuses ADAPTER_NOT_REGISTERED before the runner is reached. Whether a registration was present depended on test order, because cli.build_parser() registers openDox's default process-wide. The case now registers that default itself, over a one-document scratch worktree instead of this checkout, and monkeypatch restores the previous registration.

The entrypoint's stand-ins

test_doxbench_entrypoint.py tests what the entrypoint DECLARES: the model port (doxbench_install.declared_model_port_factory), its one process-lifetime adapter, and the session root. It never reads the snapshot. Plan 034's phase-1 limit (plan.md; research R7) is that generate-and-open still reaches openXdox for the snapshot and its generator, so exactly these are stood in:

  • cli: corpus_root_refusal, generate_snapshot and snapshot_mod.write_snapshot. SCANNED_ROOTS is read only for a snapshot with no document, and the stand-in snapshot has one.
  • serve: T011's three (tests/test_route_handler_contribution.py, section 6).
    • The snapshot source goes in through build_server's own snapshot_source= seam. The fixture asserts that the entrypoint passes none, so when phase 2 gives it one the fixture fails instead of standing in over it.
    • _checkout_real answers true, where T011's answers false. The model port is gated on the session verdict (loopback, a real checkout, a resolved actor), and the carve's base-repo fixture these cases served was a real checkout.

For T007's batch E, T041 and T047: the fifteen cases this PR moves

Each destination task lands exactly its part of this list, and T049 checks that every case arrived. The links are line ranges at main 68be484a, so the cases' own text needs no archaeology.

Thirteen become NAMED openxFactory composition tests (T047; R1Q2 (a)). T007's batch E adds each destination path to F11.1's named set before T047 lands. The paths are proposals. If T047's writer chooses others, batch E records what T047 lands. openxFactory's tests/ideation-dashboard/conftest.py already reaches each moved file at the pin, through carved_reach.

moved case (68be484a) proposed openxFactory destination what it needs there
test_saved_manifest_validates_clean_against_the_pinned_validator tests/ideation-dashboard/test_workbench_manifest_validation.py The validator. The script lives in openXdox-code now, and openxFactory's conftest composes it (find_openxfactory_validator → doxbench_contracts._composed_validator), so there these cases run instead of skipping.
test_recipe_seeded_manifest_carries_the_recipe_block_and_validates same same
test_committed_manifest_is_rejected_by_the_pinned_validator same same, in --repo mode
test_scoped_doc_health_runs_real_machinery_over_the_fixture tests/ideation-dashboard/test_workbench_scoped_doc_health.py openxFactory's doc_health check registered with T026's seam (T046, in T047's PR), and its base-repo fixture
test_scoped_doc_health_finds_a_real_missing_status same same
test_scoped_doc_health_ignores_out_of_scope_docs same same. Here it passed only because an empty findings list satisfies its all(...).
test_worktree_container_is_gitignored_in_the_aggregation_repo, with find_aggregation_root tests/ideation-dashboard/test_session_worktree_book_scan.py the aggregation checkout's ignore file, found by the parent walk (it skips where there is none)
test_session_worktrees_never_reach_a_lifecycle_book same scripts/sync-notebooklm-books.py, loaded by spec as the module did (lines 37–45)
test_pinned_factory_paths_never_admits_a_worktree_container same same
test_the_browser_ceiling_is_pinned_to_the_RELEASED_maxLength tests/ideation-dashboard/test_doxbench_chat_ceiling.py The released xfactory-workbench-chat-turn.schema.yaml, which the carve sent to openDox-spec (moved_verbatim → opendox_spec), and doxbench-chat-model.js, both through carved_source(...) at the pin
test_a_pytest_run_started_inside_a_conftestless_directory_is_guarded, with _probe_run tests/ideation-dashboard/test_hermeticity_probe_routes.py openxFactory's tests/notebooklm/test_hermeticity_guard.py and pytest.ini, both not_moved and both present at 133e37d9
test_the_unittest_fallback_route_installs_the_same_guard same tests/hermetic_unittest.py (not_moved, present)
test_the_bare_unittest_route_is_detected_as_unguarded same the same probe

Two join openXdox-code's declared doc_health exclusion (T041; R1Q6 (d)).

moved case (68be484a) proposed openXdox-code destination why the exclusion, not tests/integration/
test_an_unguarded_cli_scoped_create_is_refused tests/test_hermeticity_gate_verbs.py, listed in T041's exclusion Both drive gate create-document. gate is the host profile's verb (openXdox's cli_gate.GateSubcommands), so this suite's empty profile has none to parse. cli_gate imports gate_console, which does from doc_health import corpus at module level (:63), so F9.2 could not run them in tests/integration/.
test_the_cli_seam_with_a_fake_port_reaches_no_binary same same

The guard itself is still proved here, through the default adapter and through open_session_notebook.

Notes for the destinations (none blocks this PR)

  • The three hermeticity route cases are not compositions. They test openxFactory's own tree and touch no openDox file. Batch E's admission should say whether they join F11.1's named set or land as plain openxFactory tests.
  • openxFactory's own tests/hermeticity.py has the same find_spec probe. When scripts/ideation_dashboard/ leaves openxFactory, its layer 2 goes off just as silently as it was off here.
  • The serve-side twin of the chat ceiling is broken at its destination too. openXdox-code's tests/test_doxbench_knowledge_service.py::test_the_serve_side_ceiling_is_pinned_to_the_RELEASED_maxLength reads REPO_ROOT/contracts/schemas/xfactory-workbench-chat-turn.schema.yaml, which openXdox-code does not carry. It is hidden today because that file is in T041's doc_health exclusion. The pair pin added here, test_the_browser_ceiling_equals_the_servers_ceiling, holds one side of the triangle whatever happens to that one.
  • Until T047 and T041 land, these fifteen cases run nowhere. At 133e37d9, openxFactory's tests/ideation-dashboard/ has none of the four source files (test_workbench.py, test_session_harness.py, test_hermeticity.py, test_doxbench_chat_view.py); they moved at the carve.

The falsifier: python -m pytest -q tests/, with the root conftest in play and collect_ignore empty

At this head, b173a970, .[runtime,test]:

$ python -m pytest -q tests/
1860 passed, 13 skipped in 134.84s (0:02:14)

main 71b631bc gives 1571 passed, 13 skipped. A test-by-test JUnit diff at 81f93777 (1859 passed): 288 cases go from not collected to passed, all in the seven modules, and no other outcome changes. This head adds the 289th. The 13 skips are main's:

  • 2 in test_binding_stylesheets.py (T037's pair);
  • 8 in test_doxbench_bridge_live.py (no omp);
  • 3 in test_openprofiler_broker_e2e.py (no broker).

In a .[test]-only venv the same run gives 1 failed, 1859 passed, 13 skipped. The one failure is test_imports_standalone.py::test_every_module_imports_with_no_sibling, T030's. It needs the runtime extra and fails in that venv on main too (#46 recorded it). T036 cures it by giving the test extra those packages. (At 81f93777 there were two failures in that venv. The second was the two-directory case, and Copilot's third round below took it out.)

Fourteen planted mutations, each caught

Each plant is one change to a scratch copy of this head, and each fails the cases it targets. A control run of all 17 targets passes first.

  1. runner_seams() returns no seams again: the four layer-2 cases fail.
  2. The open-session case loses its home-corpus registration: it fails, because the refusal becomes a notice.
  3. The handler scan points back at scripts/ideation_dashboard/: it fails, having read no module.
  4. A production except BaseException: pass: the scan names it.
  5. The root conftest claims the slot: tests/test_hermeticity.py stops collecting, with cannot import name 'REPO_ROOT' from 'conftest' naming the root conftest.
  6. tests/conftest.py stops claiming: the two-directory case fails, and so does the source pin. pytest --co tests tests_runtime gives 34 collection errors, each cannot import name 'REPO_ROOT' from 'conftest' (tests_runtime/conftest.py).
  7. pyproject.toml loses its pytest table: the anchor case fails.
  8. A tests/pyproject.toml with a pytest table: the anchor case fails, on the whole-value match alone.
  9. The entrypoint declares no model port: the four fixture cases fail.
  10. The browser ceiling becomes 501: the new pair pin fails.
  11. The brokered port grows generate: the forbidden-member case fails.
  12. doxbench_binding.py imports yaml at module scope: the lazy-import case fails.
  13. The provider client spells shell=True: the shell case fails.
  14. cli gains a sixth core verb: the core-command case fails.

One correction the plants forced. pytest 8.4.2 still falls back to a pyproject.toml with no pytest table, when it finds no other config file above it (_pytest/config/findpaths.locate_config). The helper's comment and the anchor case's docstring say so, and say why the table is still checked: without it, a pytest.ini in any enclosing directory would take the rootdir.

Copilot's review at 81f93777: two cases added

The review found nothing and asked for two cases ("Add an independent released-contract assertion and a nested-rootdir regression case"), with no thread. Both are in 4e5c89a9, and each was planted against first:

  • The released ceiling. The pair pin holds the browser's constant to the server's, and it cannot see both move together. The case now also holds the server's constant to the released maxLength, 500, carried with its source (xfactory-workbench-chat-turn.schema.yaml in openDox-spec, read at openDox-spec main 8fe8c4c7). Planted: both constants at 600. The pair still passes, and this line fails.
  • A nested rootdir. test_a_nested_rootdir_is_refused_by_the_whole_value_match is the negative control for the anchor case's match, on a scratch tree. A nested tests/pyproject.toml with a pytest table makes tests/ the rootdir, and the header still prints configfile: pyproject.toml. The substring match and the configfile check both accept that header, and the whole-value match refuses it. With the nested file gone, the whole-value match accepts the tree's own root. Planted: the substring match put back, and the control fails.

Copilot's review at 4e5c89a9: no leak, measured

The review said the open-session case "leaks the registered home factory because the monkeypatch does not restore the original state". It does not. monkeypatch.setattr(ca, "_home_factory", ca._home_factory) records the current value for teardown, and teardown restores it after register_home replaces it. Measured with a probe that reads corpus_adapter._home_factory before setup and after teardown of that one case:

  • It is the same object afterwards, both from nothing registered and from a different registration.
  • With that line deleted, it is not, in either state.

The answer is on this PR as a comment. 4100cee8 puts a comment on the line and changes nothing else.

Copilot's review at 4100cee8: one finding, fixed

"The cross-suite hermeticity check fails in the declared test-only environment." That is true of a .[test]-only venv, where tests_runtime/test_oidc_verifier.py cannot import httpx until T036. The required workflow at this head does not run the case, so CI was green, but the case did turn a missing package into a slot failure. Since b173a970 it compares the whole collection outcome of the two orders: the count, and the files that failed to collect.

  • A missing package fails the same way in both orders, so the case passes in both venvs.
  • With tests/conftest.py's claim removed, it fails in both venvs.
  • Any collection error is still refused by the suite itself, and after T036 by the pinned triple.

The thread is answered with this evidence and resolved.

The repository's own check

validate.yml is unchanged. Its steps name none of the seven modules, and they run with --noconftest, so the root conftest's list never reached them. The triple is main's. T036 re-pins it for the whole suite.

Landing

  • T034 has landed, and everything above is re-run at the merged head.
  • T036 (with T031) follows this PR, then T037.
  • Squash or merge, never rebase. The commit carries both trailers, and so does this body.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

🤖 Generated with Claude Code

…(plan 034 T035)

The root conftest's collect_ignore held seven test modules under RULED
Q-L3 (b). It is empty now, and requirement 9 (FR-006) is why: an entry
there is an undeclared exclusion.

Each module is rewritten in place as a neutral openDox test. Fifteen
cases that test another repository's tree leave this suite, and the PR
body lists each with its destination: thirteen become named openxFactory
composition tests (T047), and two join openXdox-code's declared
doc_health exclusion (T041).

- tests/hermeticity.py: layer 2 of the guard was OFF in this suite.
  runner_seams() probed ideation_dashboard.*, a package this leg does not
  have, and returned no seams. It now names opendox.workbench and
  opendox.session_pr directly. The hookup set, the exempt set and the
  rootdir anchor (pyproject.toml) now describe this leg's layout.
- test_hermeticity.py: the open-session-notebook case registers a home
  corpus first (the P1-E hand-off), over a scratch worktree. The slot,
  hookup, two-directory and anchor cases describe this layout. The
  handler scan reads src/opendox (it read nothing before) and fails if it
  reads no module. The anchor case matches the whole rootdir value.
- test_doxbench_entrypoint.py: cmd_generate_and_open runs for real, with
  the six phase-1 reaches stood in (plan.md "Phase-1 limit"; T011's
  standalone fixture).
- test_model_provider_broker.py: two carve-residue source paths, one
  import string, and the forbidden-member set carried in.
- test_subcommand_extension.py: five core verbs; gate is host-contributed.
- test_doxbench_chat_view.py: the browser/server ceiling pair is pinned
  here; the released-schema pair moves to openxFactory.
- test_workbench.py, test_session_harness.py: the cases that read
  openxFactory's validator, doc-health check, sync script or aggregation
  checkout move to openxFactory.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 27, 2026 15:02
@sourcery-ai

sourcery-ai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR empties the root pytest exclusion list and rewrites the seven previously ignored modules to run in a lone openDox checkout, replacing cross-repository dependencies with standalone paths, explicit phase-1 seams, and stronger hermeticity/collection guards while documenting fifteen cases for their declared destination repositories.

Sequence diagram for phase-1 generate-and-open test seams

sequenceDiagram
    participant Test as Test
    participant CLI as opendox.cli
    participant Serve as opendox.serve
    participant Model as declared_model_port_factory
    participant Session as Session root

    Test->>CLI: cmd_generate_and_open
    CLI->>Model: declared_model_port_factory
    CLI->>Session: corpus_root_refusal
    CLI->>CLI: generate_snapshot
    CLI->>Serve: build_server
    Serve->>Serve: _checkout_real
    Serve-->>CLI: server with phase-1 seams
    CLI-->>Test: declared model port and session-root behavior
Loading

State diagram for hermeticity guard activation

stateDiagram-v2
    [*] --> Layer1
    Layer1: PATH shim active
    Layer1 --> Layer2
    Layer2: runner_seams names opendox.workbench and opendox.session_pr
    Layer2 --> Guarded: default runner and session runner intercepted
    Guarded --> Green: tests remain hermetic
    Green --> [*]
Loading

Flow diagram for emptying pytest collection exclusions

flowchart TD
    Start["pytest collects tests/"] --> Ignore["collect_ignore = []"]
    Ignore --> Modules["Seven rewritten test modules"]
    Modules --> Standalone["Neutral standalone execution"]
    Standalone --> Result["288 additional cases pass"]
    Standalone --> Destinations["Cross-repository cases move to declared destinations"]
Loading

File-Level Changes

Change Details Files
Removes the root-level test collection exclusion and makes all seven formerly ignored modules runnable in a standalone checkout.
  • Changes root collect_ignore to an explicitly empty list to enforce full-suite collection.
  • Rewrites tests to use standalone opendox paths and removes dependencies on openxFactory-only fixtures, scripts, schemas, validators, and host-profile verbs.
  • Moves fifteen openxFactory- or host-composition-specific cases out of this suite, documenting their planned destinations in openxFactory or openXdox-code.
  • Adds one standalone test case while preserving coverage for the remaining openDox behavior.
conftest.py
tests/test_doxbench_chat_view.py
tests/test_doxbench_entrypoint.py
tests/test_hermeticity.py
tests/test_model_provider_broker.py
tests/test_session_harness.py
tests/test_subcommand_extension.py
tests/test_workbench.py
Repairs hermeticity and collection-guard coverage for the standalone repository layout.
  • Makes layer-2 runner seams import opendox.workbench and opendox.session_pr directly instead of silently disabling themselves when the old package probe is absent.
  • Updates conftest hookup expectations, rootdir anchoring, and two-directory collection-order checks for the flat tests/ layout and pyproject.toml pytest configuration.
  • Strengthens the rootdir assertion to match the complete rootdir value and verify the pytest configuration table.
  • Points the BaseException scan at src/opendox/ and fails when no modules are scanned.
  • Makes the open-session hermeticity case explicitly register and verify a scratch home corpus before exercising the runner.
tests/hermeticity.py
tests/test_hermeticity.py
Replaces unavailable cross-repository integration dependencies with narrowly scoped phase-1 stand-ins while retaining entrypoint and contract assertions.
  • Stands in the documented CLI snapshot/corpus reaches and serve-side checkout, registry, and snapshot-source dependencies.
  • Runs generate-and-open against a scratch checkout and adds a tripwire to detect when the entrypoint gains its own snapshot source.
  • Pins the browser ceiling to the server-side constant within this standalone package.
  • Carries the forbidden model-port member set locally and updates source/import probes to src/opendox and opendox.
tests/test_doxbench_entrypoint.py
tests/test_doxbench_chat_view.py
tests/test_model_provider_broker.py
Updates standalone test expectations and removes tests that only prove openxFactory-owned behavior.
  • Limits core command assertions to the five verbs declared by the empty host profile.
  • Keeps local workbench CRUD, boundary, and safety coverage while removing validator and doc-health cases requiring openxFactory.
  • Retains the synthetic worktree ignore-pattern test while removing aggregation-repository and NotebookLM script tests.
  • Removes openxFactory-specific hermeticity route tests and the import-time sync-script dependency.
tests/test_subcommand_extension.py
tests/test_workbench.py
tests/test_session_harness.py
tests/test_hermeticity.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.

Copilot review overview

🔵 Needs a closer look

The broad test-suite changes warrant final human review, with one documentation nit remaining.

Review effort: Lite
Findings: None

What changed in this PR

Adapts the openDox test suite for standalone operation by removing collection exclusions and updating repository-specific tests.

Changes:

  • Empties collect_ignore.
  • Updates standalone paths, seams, fixtures, and command expectations.
  • Strengthens hermeticity, entrypoint, and browser/server consistency coverage.
File Summary
tests/​test_workbench.py Retains standalone workbench coverage.
tests/​test_subcommand_extension.py Updates standalone command expectations.
tests/​test_session_harness.py Preserves standalone ignore-pattern coverage.
tests/​test_model_provider_broker.py Retargets paths and provider checks.
tests/​test_hermeticity.py Updates standalone fixtures and rootdir checks.
tests/​test_doxbench_entrypoint.py Adds phase-one dependency stand-ins.
tests/​test_doxbench_chat_view.py Pins browser/server ceiling consistency.
tests/​hermeticity.py Updates standalone guard configuration.
conftest.py Removes collection exclusions.

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

T034 landed after T032, so this takes main at 71b631b. No file
overlaps: #50 repaired nine other modules. The seven modules and the
whole tests/ directory re-run at this merged head.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 27, 2026 15: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.

Copilot review overview

🔵 Needs a closer look

Add an independent released-contract assertion and a nested-rootdir regression case.

Review effort: Lite
Findings: None

…ked (plan 034 T035)

Copilot's review at 81f9377 asked for two cases.

- The chat ceiling: the pair pin holds the browser's constant to the
  server's, and cannot see both move together. The case now also holds
  the server's to the released maxLength, 500, carried with its source
  (openDox-spec's xfactory-workbench-chat-turn.schema.yaml, read at
  openDox-spec main 8fe8c4c7). Planted: both constants at 600, and only
  this line fails.
- The rootdir anchor: a negative control on a scratch tree. A nested
  tests/pyproject.toml with a pytest table makes tests/ the rootdir,
  and the header still prints configfile: pyproject.toml. The substring
  match and the configfile check both accept that; the whole-value
  match refuses it, and accepts the tree's own root once the nested
  file is gone. Planted: the substring match back, and the control fails.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 27, 2026 15:39

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.

Copilot review overview

🔵 Needs a closer look

tests/test_hermeticity.py leaks the registered home factory because the monkeypatch does not restore the original state.

Review effort: Lite
Findings: None

…4 T035)

Copilot's review at 4e5c89a read the case as leaking the registered
home factory. It does not, and this was measured. In a pytest run whose
only item is this case, `corpus_adapter._home_factory` is the same
object after teardown as before, both when nothing was registered and
when a different factory was. With the recording line removed, it is
not, in either state.

The line that does the restoring, `monkeypatch.setattr` handed the
current value, now says so in a comment. No behaviour changes.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 27, 2026 15:56
@brettheap

Copy link
Copy Markdown
Contributor Author

Copilot's review at 4e5c89a9 said "tests/test_hermeticity.py leaks the registered home factory because the monkeypatch does not restore the original state". It had no finding and no thread. The case does not leak, and this was measured.

The two lines are:

monkeypatch.setattr(ca, "_home_factory", ca._home_factory)
ca.register_home(cli_mod._default_home_factory)

Handing monkeypatch.setattr the current value records that value for teardown. register_home then replaces it, and teardown puts the recorded value back.

The probe. It runs pytest with this case as the only item. A pytest_runtest_protocol hookwrapper reads corpus_adapter._home_factory before setup and again after teardown, and compares the two by identity. It ran in both starting states:

preregister=False rc=0 before_unset=True  after_unset=True  restored=True
preregister=True  rc=0 before_unset=False after_unset=False restored=True

The same probe with the monkeypatch.setattr line deleted:

preregister=False rc=0 before_unset=True  after_unset=False restored=False
preregister=True  rc=0 before_unset=False after_unset=False restored=False

So that line is what prevents the leak. 4100cee8 adds a comment on it, saying so. Nothing else changes.

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

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.

Copilot review overview

🟡 Changes recommended

The cross-suite hermeticity check fails in the declared test-only environment because required runtime dependencies are not installed.

Review effort: Lite
Findings: 1 High severity

Open (1)

Comment thread tests/test_hermeticity.py Resolved
…lan 034 T035)

Copilot's review at 4100cee found the two-directory case failing in a
.[test]-only venv. There tests_runtime/test_oidc_verifier.py cannot
import httpx, because the test extra gains the runtime packages only in
T036. That error is the same in both argument orders, so it is not a
slot defect. The case required a clean exit, and so turned a missing
package into a slot failure.

The case now compares the whole outcome of the two orders: the count,
and the files that failed to collect. It fails when they differ, which
is the only thing it can see that the whole-suite run cannot. Any
collection error is still refused by the suite itself and by the pinned
triple.

Measured:
- It passes in the full venv and in the lean one.
- With tests/conftest.py's claim removed, it fails in both.
- In the lean venv, `python -m pytest -q tests/` is now down to T030's
  pre-existing failure alone (1 failed, 1859 passed, 13 skipped).
- All fourteen planted mutations are still caught.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 27, 2026 16:08
@sonarqubecloud

Copy link
Copy Markdown

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.

Copilot review overview

🟢 Approval recommended

All substantive changes are covered; the remaining comment is a non-blocking documentation nit.

Review effort: Lite
Findings: None

Resolved since last review (1)

@brettheap
brettheap marked this pull request as ready for review September 27, 2026 16:14
@brettheap

Copy link
Copy Markdown
Contributor Author

READY at b173a97 — Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

@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 3 days and 2 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@brettheap
brettheap merged commit 80acead into main Sep 27, 2026
5 checks passed
@brettheap

Copy link
Copy Markdown
Contributor Author

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

LANDED — lane openxfactory-4, 2026-09-27T16:15:05Z, PR #51 → 80acead (opensoft/openDox-code main; plain gate)

Brett: land the phase 1 PRs when green

brettheap added a commit that referenced this pull request Sep 27, 2026
T035 emptied collect_ignore, so the seven modules it repaired now join
the whole suite this branch's `validate` runs. The pins are re-read from
CI's own run over this merge, not derived.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 27, 2026
…hy it was narrowed (plan 034) (#52)

Plan 034, task **T036**, with **T031** in the same PR (its "Lands with: T036"), slice P1-G (the whole suite in CI). The plan is `specs/034-opendox-standalone-operation/tasks.md` at opensoft/openxFactory `main` `a9e7db75`; its T031, T035, T036 and T037 entries are unchanged since `133e37d9`. This PR realizes boxes **2.5**, **9.1** and **9.2a** (a required check now runs T030) of the ratified `add-neutral-product-standalone-operability`, and T031 realizes **2.6**.

- **Ruled:** R1Q8 (a), openxFactory#656 comment `5817152735`: `tests_runtime/` is part of the whole suite, with PostgreSQL in the required job.
- **Claim:** openxFactory#656 comment `5856501803`.
- **After:** T035 (#51, landed as `80acead1`) and T038 (#48, landed). This branch merged that `main` at `56d51edc`, with no force-push.

## What changes

**`.github/workflows/validate.yml`.** The three pytest steps are gone, with their file lists, their comment blocks and every line that named the flag that switched the conftest chain off. The one required job now does four things:
1. It installs `.[runtime,test]` under the lock, with `--only-binary :all:`. That is R1Q8 (a)'s install, the one the `runtime` job used.
2. It runs a `postgres:16` service.
3. It runs `python -m pytest -q --junitxml=pytest-report.xml` with the DSN exported. No file list: `testpaths` is the suite.
4. It pins the triple from that one report.

**The `runtime` job is folded in**, which T036 allows ("may then be folded in"). It was advisory under RULED Q-R3 (`5701772032`) "until a separate DECLARED act", and R1Q8 (a) is that act. Keeping it would run every DB-backed case twice, once required and once not. Under `CI` those cases fail rather than skip (`tests_runtime/conftest.py`), so a job whose service did not start is red, not green.

**`pyproject.toml`.**
- `testpaths = ["tests", "tests_runtime"]`.
- The `test` extra gains `opendox[runtime]`. F9.1 installs `.[test]` alone, so without the runtime packages half of `tests_runtime/` would fail under `CI` and skip elsewhere. The extra is named rather than copied, so the runtime's list is still declared once.
- The runtime extra's comment now says why the required job may install it. `tests_runtime/test_runtime_surface.py` measures the import-weight contract in a fresh interpreter by what lands in `sys.modules`, so a leak is named with the extra installed and fails to import without it.

**`Pin the triple`.**
- It reads one report. A missing report now stops the step with one refusal that names the file, instead of failing a zero read from nothing against every floor.
- The skip refusal's message names no test file, which F9.1's second assertion requires. It also no longer lists "an edit to one of the three explicit lists", because there are none.
- **The floors are CI's own reading: `2481` / `2468`, and SKIPPED exactly `13`.** Each move names its run:

| head | run (job) | CI printed | why it moved |
|---|---|---|---|
| `56d51edc` | 36333569456 (108660020012) | `selected=2459 passed=2446 skipped=13` | T035's merge. Its 289 cases are the whole difference from the pre-T035 local replica (2170 / 2157) |
| `485e085a` | 36334996991 (108664042314) | `selected=2471 passed=2458 skipped=13` | twelve run-count cases (below) |
| `db3e8a4f` | 36337919108 (108672216615) | `selected=2481 passed=2468 skipped=13` | ten more, for runs hidden inside a wrapper |
| `13383a6f` | 36338192590 (108672985586) | `selected=2481 passed=2468 skipped=13`, `margin 0` | the floors at that reading |
| `1808146a` | 36339036146 (108675365224) | `selected=2481 passed=2468 skipped=13`, `margin 0` | this head; since `13383a6f`, comments, docstrings and one assertion message only |

**The pins that held the old shape**, rewritten for this one:
- `tests/test_triple_pin.py` covers one report. It gains `test_the_pin_reads_the_report_the_pytest_step_writes`, which holds the `--junitxml` target and `REPORTS` equal, so a rename of either cannot leave the pin reading a file nothing writes.
- `tests_runtime/test_deploy_shape.py`:
  - `test_the_workflow_declares_the_required_job_and_its_steps`: one job, and one pytest run across every step, with no positional argument after it.
  - The run count is `_pytest_runs`. It splits each script on every shell separator (`&&`, `||`, `;`, a pipe, a background `&`, a newline, a subshell and a command substitution). It counts the word `pytest` wherever it stands in a command, so `env`, `timeout`, `uv run`, `xargs`, `sh -c`, `bash -c` and `pytest.main(` cannot hide a second run. It errs toward counting, and says so. `test_the_run_count_sees_every_shell_separator` drives the count over 22 scripts, including the two that pin that direction.
  - `test_the_required_job_supplies_a_postgres_service_and_the_extras`.
  - `test_the_required_job_installs_the_runtime_and_test_extras`, which replaces `…installs_only_the_test_extra`. Its docstring gives the measured reason the old premise no longer holds.
  - The lock case counts one workflow install instead of two.

**Prose the fold made false:**
- `tests_runtime/conftest.py`'s header, and its `_skip_or_fail` text and message;
- `docs/runtime.md`: the tree line, the § 8 table, and § 9's two residue bullets, now CLOSED;
- the header of `constraints-cpython312-linux.txt`, comments only, with no pin moved;
- every statement that the required job installs `.[test]` and not `.[runtime]`, or that the case runs in "BOTH jobs". These are in `src/opendox/runtime/__init__.py`, `config.py`, `db.py`, `identity.py`, `migrations.py` (twice) and `cli.py`, and in `tests_runtime/test_runtime_cli.py`, `test_runtime_surface.py`, `test_migration_shape.py`, `test_schema_shape.py`, `test_oidc_verifier.py`, `test_deploy_shape.py` and `test_local_git_adapter.py`. There are two more in `tests/test_consumer_reach.py`, and one in a `pyproject.toml` comment. The import-weight contract itself is unchanged;
- the three DB-backed modules' headers, which said they run in the `runtime` CI job: `tests_runtime/test_api_endpoints.py`, `test_migrations_apply.py` and `test_repository_act.py`. They run in `validate`, and under `CI` they fail rather than skip without a database;
- the lock test's missing-lock message, which named "the three installs". There are two: the required job's and the image's.

**T031, `README.md`:** box 2.6. The paragraph gave the narrowing's reason as the openDox → openXdox dependency. It now says what `validate` runs (the whole suite, no exclusion), and that the live cause of the old narrowing was the carved code's reaches into `ideation_dashboard`. The dependency itself was inverted at import time first.

## The falsifier: F9.1 (openDox-code), both assertions, with the database DSN exported

This is F9.1 verbatim from #1144's `tasks.md`, after one line that exports the DSN, quoted, the way the job does. The database is a private `postgres:16` container. The run is at this head, `1808146a`:

```
export OPENDOX_TEST_DATABASE_URL='postgresql://opendox:opendox@host.docker.internal:55471/opendox'
set -euo pipefail
W=$(mktemp -d)
python -m venv --clear "$W/v9"
. "$W/v9/bin/activate"
pip install ".[test]"
python -m pytest -q                                   # NOT --noconftest, NOT a file list
test "$(grep -c -- --noconftest .github/workflows/validate.yml)" -eq 0
python - <<'EOF' … EOF                                # the named-file check, verbatim
```

It exits 0:

```
2468 passed, 13 skipped, 1 warning in 313.37s (0:05:13)
```

It exited 0 at `13383a6f` too, with the same counts. That was before the last two commits, which change comments, docstrings and one assertion message only.

`pip install ".[test]"` brings FastAPI, psycopg, PyJWT and httpx through `opendox[runtime]`. The flag count is `0`. The named-file check finds no `tests/test_*.py` or `tests_runtime/test_*.py` path outside a comment.

The 13 skips are all in `tests/`:
- 2 in `test_binding_stylesheets.py`: T037's pair, the two that need openXdox's modules or its sheets;
- 8 in `test_doxbench_bridge_live.py`: no `omp` harness;
- 3 in `test_openprofiler_broker_e2e.py`: no broker binary.

`tests_runtime/` skips none with the database up.

## Planted mutations, each caught

Each plant is one change to a scratch copy of the head. A control run of the targets passes first.

**T036's seven:**
1. The pytest step writes its report under another name: the join case fails.
2. The pytest step names a test file: the shape case fails.
3. A second pytest run chained onto the step: the shape case fails.
4. The job installs `.[test]` alone: both extras cases fail.
5. The service is renamed away: the service case fails.
6. The pytest step names a bare `tests_runtime`: the shape case fails.
7. The pin sums on past a missing report: the missing-report case fails.

**Nine more, for the run count.** A second run is added after the step with each of these, and each turns the shape case red:
- `||`
- `|` (into `xargs pytest`)
- a bare `pytest`
- `env CI=true pytest`
- `timeout 600 pytest`
- `uv run pytest`
- `sh -c "python -m pytest …"`
- `bash -c 'pytest -q'`
- `python -c '… pytest.main([]) …'`

The first version of the count read `||` as one run, and the second read the `env` form as one.

## Copilot's reviews

| head | overview | what it found | where it went |
|---|---|---|---|
| `4e0056d4` | Changes recommended | `collect_ignore` still listed the seven | T035 landed and was merged at `56d51edc`; answered with CI's reading, resolved |
| `83fb977e` | Changes recommended | the count missed `\|\|`; two stale "`.[test]` alone" statements | fixed at `485e085a`; the same claim swept everywhere else (comment `5857867635`); resolved |
| `485e085a` | Needs a closer look | runs hidden in a wrapper | fixed at `db3e8a4f` |
| `b8623bf9` | Needs a closer look | `env CI=true pytest`; this body's floors did not match the file | fixed at `db3e8a4f`; this body now carries the table above |
| `13383a6f` | Changes recommended | this body still carried the pre-T035 figures; a note above the separators still described the first count | this body rewritten; the note corrected at `ab862032` |
| `ab862032` | Needs a closer look | three DB-backed headers still named the `runtime` job; two statements in `test_deploy_shape.py` | fixed at `1808146a`, with the rest of that claim's instances |
| `1808146a` | **Approval recommended** | no findings | |

## Two timing-sensitive cases, seen red once each on this machine

Neither case is new, and neither file is changed here. T036 brings both into the required job for the first time. CI ran both green at every head above.
- `tests_runtime/test_migrations_apply.py::test_the_draft_page_budget_does_not_read_the_bodies_it_sizes` asserts a timing ratio above 4x. It read 3.87x once, under a full local run against a Docker Postgres. It passes alone 3 of 3. It was in the advisory `runtime` job before.
- `tests/test_model_provider_broker.py::test_a_token_past_its_declared_expiry_is_discarded_and_re_minted` (T035's module) gives a token a wall-clock expiry one second in the past, at whole-second precision. It failed once in an F9.1 run. One of five module runs right after also went red, and I did not capture which case; the next 42 module runs were all green. The code compares `now >= expires_at`, so a red needs the wall clock to step back more than a second, which this WSL2 host can do. A follow-up could widen the margin (`time.time() - 3600`); that file is not this task's.

## Left as it is, and why

- **Test docstrings that call a module "`--noconftest` safe, like every file `validate` runs today"** (about 25 files under `tests/`). Each file is still safe to run with no conftest, so the claim about the file holds. Only the "`validate` runs today" framing is dated. A sweep through 25 carved files is not this task's to make, and F9.1 counts `validate.yml` alone.
- **`src/opendox/cli.py:1120`** names the flag about openXdox-code's own `validate`, not this one's.

## Landing

- T037 follows this PR, and P1-R (the openDox root pin) waits on T037.
- Squash or merge, never rebase. Each commit carries both trailers, and so does this body.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

🤖 Generated with [Claude Code](https://claude.com/claude-code)


Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit to opensoft/openXfactory that referenced this pull request Sep 28, 2026
… guarded unittest runner (#1195)

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

## Update — review round 1 (commit `2ba81209`)

Copilot found a real bug: a bare `find_spec("opendox.workbench")` ERRORS
(doesn't skip) on a checkout where the openDox/openXdox gitlinks are
genuinely uninitialized, because `carved_reach.install()`'s `_LegMissing`
finder raises `CarveReachUnavailable` for a carved root name instead of
returning `None`. Fixed with `try/except ImportError` around both lookups
(`opendox.session_pr` and `opendox.workbench`), mirroring
`runner_seams()`'s own guard exactly — reproduced with both legs hidden
before and after (now skips cleanly instead of erroring).

That fix exposed a second, separate, pre-existing bug in the recovered
`tests/domain_profile/test_hermeticity_probe_routes.py`'s own negative
control: its bare-unittest child inherits the OUTER pytest session's own
hermeticity-guard PATH shim via `subprocess.run`'s default environment
inheritance (this file's own 3 tests are collected under `tests/`, so that
guard is already active). Previously masked because the OTHER bug above
always made that same child report FAILED regardless. Fixed with
`_bare_environ()` (PATH minus any entry under the system temp directory).
Full details, including re-measurement of both fixes together across three
directories, are in the commit message.

Both CI (all 12 checks, including `pytest-suite` at 19m59s) and Copilot's
next review round (`Findings: None`, prior finding marked "Resolved since
last review") are green at this head.

## What was broken

`tests/notebooklm/test_hermeticity_guard.py:87`'s layer-2 case probed
`find_spec("ideation_dashboard.workbench")` to decide whether the dashboard
package had arrived yet (pre-shed, self-healing design). The § 5.2 shed moved
`workbench.py` and `session_pr.py` to the pinned openDox leg and repointed
`tests/hermeticity.py`'s own `runner_seams()` to `find_spec("opendox.*")`
accordingly — but this probe, one file over, was not repointed with it. It has
answered `None` FOREVER since the shed instead of self-healing, so the case has
been **skipping silently** rather than asserting anything: one of
`pytest-suite.yml`'s `EXPECT_SKIPPED` skips (P1-G decision 5, "the find_spec
probe goes silent"; surfaced concretely by plan 034 T047's re-measurement,
which held the recovered route-cases test rather than land it, per T007 batch
E's finding that it belongs in its own, separate, non-Arc PR — this one).

## The repair (4 commits)

1. **Repoint the probe** — `find_spec("ideation_dashboard.workbench")` →
   `find_spec("opendox.workbench")`, the same name the two imports three lines
   down already use and the same name `runner_seams()` itself already patches.
2. **Install the same carved reach in `tests/hermetic_unittest.py`.**
   `runner_seams()` can't find `opendox.workbench`/`opendox.session_pr` to
   patch unless the openDox leg's `src/` is already on `sys.path`. The pytest
   route gets that for free from `tests/conftest.py`
   (`carved_reach.install(tests=True)`, run before any test module imports
   anything); the guarded-`unittest` runner had no conftest to load it from,
   so it silently guarded **less** than the pytest route over the identical
   tree — measured before this fix: `python3 tests/hermetic_unittest.py
   tests/notebooklm/` **ERRORED** (`ModuleNotFoundError: No module named
   'opendox'`) on exactly the case that needs it, rather than running it or
   skipping cleanly. `install_guard()` now calls the identical
   `carved_reach.install(tests=True)` before building the binary shim or
   reading `runner_seams()`.
3. **Add the recovered hermeticity route-cases test** (three cases, held at
   `p1/P1-K/held/test_hermeticity_probe_routes.py`, carried out of
   `tests/test_hermeticity.py` when that file moved to openDox-code by T035 —
   opensoft/openDox-code#51, landed `80acead1`). See "Where it landed, and why"
   below for the one adaptation from #51's text.
4. **Move `EXPECT_SKIPPED` 6 → 5** in `.github/workflows/pytest-suite.yml`,
   with the full accounting (including the two sibling files explicitly left
   alone) recorded beside the pin.

## Where the recovered test landed, and why

Not at the pre-shed `tests/ideation-dashboard/`: that directory is a declared
`moved_paths:` prefix in `docs/opendox-carve-manifest.yaml`, and
`scripts/validate-carve-manifest.py` refuses (`carve-file-undeclared`) any
file under a `moved_paths:` prefix that carries no manifest row — the same
reason T034/T035's four sibling relocated cases land under
`tests/domain_profile/` instead (T007 batch E finding 5). I measured this
directly (committed the file at the original location first, in a scratch
check, re-ran the validator, got the refusal; moved it, re-ran, got `OK`) and
placed it at `tests/domain_profile/test_hermeticity_probe_routes.py` instead.
That directory has no manifest row and no conftest of its own, so `REPO_ROOT`
is computed locally (`Path(__file__).resolve().parents[2]`, the same pattern
`tests/domain_profile/test_openxfactory_profile.py` already uses in this same
directory) rather than imported `from conftest import REPO_ROOT` as #51's text
does — that import resolved through `tests/ideation-dashboard/conftest.py`,
which this directory doesn't have. The three test bodies are otherwise
verbatim. It is **not** added to `docs/opendox-carve-manifest.yaml`'s
`COMPOSITION_TESTS` — T007 batch E (openxFactory#1183) already reversed this
file's provisional membership there after a Copilot finding (it pins nothing
about the composition, and that set is a permanent allow-list) — and it is not
an F11.1 surface.

## Scope discipline: two siblings left alone, on purpose

While measuring, I found `tests/notebooklm/test_workbench_sweep_wiring.py` and
`tests/notebooklm/test_sync_notebooklm_books.py` carry the **identical**
stale-name defect (`find_spec("ideation_dashboard.workbench")` /
`find_spec("ideation_dashboard.branch_session")`, both raised as a
module-level `unittest.SkipTest` at import time). Both target modules
(`opendox.branch_session`, `opendox.session_git`, `opendox.workbench`) exist
at the pinned leg — I checked. Fixing them is real, valuable, low-risk
follow-up work (each file's several test methods currently collapse into a
single silent module-level skip), but it's outside this task's declared scope
("the hermeticity-probe repair" — the one file, the one runner, the one pin),
so I left them alone and am flagging them here explicitly rather than quietly
expanding the diff. This is also *why* `EXPECT_SKIPPED` moves to exactly 5 and
not further: those two skips are still present in the new total.

## Measured (all three routes; no background runs left going)

Isolated probe file, before → after (pytest route):
```
# before
.s
1 passed, 1 skipped in 0.06s
# after
..
2 passed in 0.04s
```

`tests/notebooklm/` (full directory), before → after (pytest route):
```
# before: 107 passed, 3 skipped, 30 subtests passed
# after:  108 passed, 2 skipped, 30 subtests passed
```
(the 2 remaining skips are the two sibling files above, unchanged)

`tests/hermetic_unittest.py` route, before → after, same directory:
```
# before: FAILED (errors=1, skipped=2)   [ModuleNotFoundError: No module named 'opendox']
# after:  OK (skipped=2)
```

Bare `python3 -m unittest discover` (the negative control), unchanged by
design — still correctly detects the unguarded route:
```
FAILED (failures=1, errors=1)
```

The recovered test file itself, at its final location:
```
$ python3 -m pytest tests/domain_profile/test_hermeticity_probe_routes.py -q
...
3 passed in 2.48s
```

`scripts/validate-carve-manifest.py` at the final commit: `OK ... 456 file(s)
in the declared surface with none undeclared`.

Full local suite, all three routes, at HEAD (no background runs left going):
- **pytest** (`python3 -m pytest tests/ -q -m "not postgres"
  --junitxml=pytest-report.xml`, matching `pytest-suite.yml` exactly):
  `selected=9238 passed=9216 skipped=20 failures=2 errors=0` in 1435s. Both
  numbers that aren't `5`/`0` are accounted for, not hand-waved:
  - **2 failures**, both in `test_dashboard_source_seal.py` ("reads nothing
    outside the render/serve unit"), both citing
    `.venv-hermetic/lib/.../yaml` — my own venv sits *inside* this scratch
    clone (CI's Python comes from `actions/setup-python`, outside the
    checkout). Reproduced **identically on `origin/main`** with none of this
    PR's 4 commits applied (`git checkout --detach origin/main`, same venv,
    same 2 failures, same file). Not this PR's doing.
  - **20 skipped, not 5** — 15 of the 20 are two more artifacts of running
    outside real CI, not of this PR: 13 are `find_openxfactory_validator`/
    `find_cross_reference_validator` walking up for a directory literally
    named `openxFactory` (this scratch clone is named `repo`; confirmed by
    re-running the same lookups from a `git worktree` literally named
    `openxFactory` — both resolve non-`None` there), and 2 are
    `review_lane_pin`'s `TheFreshnessVerifier`/`TheVectorReplay` skipping for
    lack of `PINNED_CORE_CHECKOUT` (I have no token for the private
    `codeXfactory/codexFactory` cross-org checkout CI mints; both are
    documented in `pytest-suite.yml` itself as skipping under exactly this
    condition). The remaining **5** are real and match the pin exactly: the
    2 conformance-gate self-gate tests that always skip in openxFactory's own
    checkout (`DOMAIN_SHAPED = (REPO_ROOT / "stack.yaml").is_file()` — always
    `False` here by construction), the 1 `test_set_domain_openxfactory_pin`
    LedgerxFactory guard this pin's own history already names as the
    surviving post-shed skip, and the 2 known `tests/notebooklm/` siblings
    from the section above.
- **`tests/hermetic_unittest.py`**, run per-directory (its own documented
  usage — the whole `tests/` tree in one process hits pre-existing,
  unrelated `unittest.discover()` cross-package collisions with mixed
  package/non-package directories; verified identical with and without this
  PR's changes via `git stash`): 48/48 directories completed; the 6
  directories with non-zero results (`avatar_runtime` and its two
  subpackages, `hermes_runtime_contracts` and its `postgres` subdirectory,
  `intent-compliance`) fail identically on `origin/main` with none of this
  PR's changes applied (`ModuleNotFoundError: No module named 'xfactory'` for
  the `avatar_runtime` case, checked directly) — this runner's own
  pre-existing gap in replicating pytest's import-path setup, not something
  this PR touches or changes.
- **bare `python3 -m unittest discover`** (negative control), same
  per-directory method: most directories report `NO TESTS RAN` (this repo's
  suite is overwhelmingly pytest-style, not `unittest.TestCase`-style, which
  bare `unittest discover` simply can't see); `tests/notebooklm` is the one
  directory where the negative control matters and it fails as designed.

## Constraints honored

- Fresh clone under scratch, never `/workspace/projects/xFactory/*`.
- Checked `git diff --stat origin/main...` against the T047 branch
  (`p1/P1-K/oxf`, `build/034-p1k-t045-t046-host-wiring`) before editing: zero
  file overlap with any of the 25 files it touches.
- No force-push; no closing keywords anywhere; explicit pathspecs on every
  commit; never `git add -A`.
- Opened as **DRAFT**.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
brettheap added a commit to opensoft/openXfactory that referenced this pull request Sep 29, 2026
…(plan 034, for T049) (#1203)

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

**T035's held aggregation ignore-file case lands, and `EXPECT_SKIPPED` moves 5 → 6.** This is a prerequisite of plan 034's phase-1 checkpoint, T049. It is not an arc landing, so it carries no `Arc:` trailer, and F11.1 never reads it. It touches no `openspec/changes/` path, so it needs no Rule 6 window. Claim: #656 comment `5891975603`.

## Why now

T049 checks that every case T034 and T035 moved out of openDox-code arrived where its PR sent it, "so none is dropped from both suites (requirement 9, second scenario)". It found 18 of 19. The missing one was opensoft/openDox-code#51's (T035) `test_worktree_container_is_gitignored_in_the_aggregation_repo`. T035 moved it out of openDox-code, where a lone checkout had only ever skipped it. T007 batch E (#1144's `tasks.md`) then held it out of #1181 so that `pytest-suite`'s `EXPECT_SKIPPED` could stay put: "Held, not decided against; a later task takes it up." `git grep` found its `def` in none of openxFactory `e81eed62`, openXdox-code `6158151e` and openDox-code `2d116415`.

The holder's decision (2026-09-29), relayed to T049's writer, is option (b). A moved case that exists in no suite breaks requirement 9's second scenario, and "a later task" is now. It only skips on a runner, so nothing risky lands with it. T049's own PR follows this one, and its evidence quotes all 19 cases found.

## The change (2 files, against `main` `e81eed62`)

- **`tests/domain_profile/test_session_worktree_book_scan.py`**, on F11.1's `HOST_TESTS` surface, beside T035's other two session cases:
  - the case, with `find_aggregation_root` and `_check_ignore`, verbatim from openDox-code `68be484a` `tests/test_session_harness.py:229-260`, and the two imports they need (`subprocess`, `pytest`);
  - the module docstring's hold note, which now records the landing, why the case skips on a runner, and where its synthetic half stayed (`test_the_worktrees_pattern_covers_the_sessions_sub_path`, still in openDox-code's `tests/test_session_harness.py`).
- **`.github/workflows/pytest-suite.yml`**: `EXPECT_SKIPPED` `"5"` → `"6"`, with a `MOVED 5 -> 6` paragraph beside the pin, in the form of the entries above it. `MIN_SELECTED` and `MIN_PASSED` are floors and do not move: the case adds one selected test and no passed one.

## Measured

**On a runner's layout** (this checkout beside the pinned decision core, and no `.gitmodules` above it), the case SKIPS with the guard string `pytest-suite.yml`'s header names. `pytest tests/domain_profile -q -m "not postgres" -rs`:

| tree | result |
|---|---|
| `main` `e81eed62` | `80 passed` |
| this change | `80 passed, 1 skipped`: `SKIPPED [1] tests/domain_profile/test_session_worktree_book_scan.py:90: no aggregation checkout reachable from this tree` |

**Inside a real aggregation checkout it PASSES.** The checkout was a fresh clone of opensoft/xFactory (`main` `6c4032fc`), with this change as its `openxFactory` submodule and that submodule's `openXwallet`, `openXdox` and `openDox` initialized as `pytest-suite` initializes them. The aggregation was only read, never written: its `git status` was ` M openxFactory` (the submodule HEAD set up for the run) before and after. `python3 -m pytest tests/domain_profile/test_session_worktree_book_scan.py -v -rA`:

```
tests/domain_profile/test_session_worktree_book_scan.py::test_worktree_container_is_gitignored_in_the_aggregation_repo PASSED [ 33%]
tests/domain_profile/test_session_worktree_book_scan.py::test_session_worktrees_never_reach_a_lifecycle_book PASSED [ 66%]
tests/domain_profile/test_session_worktree_book_scan.py::test_pinned_factory_paths_never_admits_a_worktree_container PASSED [100%]
============================== 3 passed in 0.16s ===============================
```

What the case reads there, and it is exactly the finding it encodes (research R7: the existing `*-worktrees/` pattern covers the container):

```
git check-ignore -v xFactories/codexFactory-worktrees/ -> .gitignore:9:*-worktrees/	xFactories/codexFactory-worktrees/
git check-ignore -v xFactories/codexFactory-worktrees/sessions/draft__demo-topic/ -> .gitignore:9:*-worktrees/	xFactories/codexFactory-worktrees/sessions/draft__demo-topic/
git check-ignore -v xFactories/codexFactory-worktrees/sessions/draft__demo-topic/a.md -> .gitignore:9:*-worktrees/	xFactories/codexFactory-worktrees/sessions/draft__demo-topic/a.md
git check-ignore -v openxFactory-worktrees/sessions/draft__demo-topic/ -> .gitignore:9:*-worktrees/	openxFactory-worktrees/sessions/draft__demo-topic/
```

**It can fail.** In that same throwaway clone, with the aggregation's `*-worktrees/` line deleted, the case fails: `AssertionError: xFactories/codexFactory-worktrees/ is NOT gitignored — FR-005 broke` (`1 failed, 2 deselected`). The file was then restored, and its sha256 (`9790ff86…`) was the same as before.

**The whole suite, as `pytest-suite` runs it.** Both trees were in the job's layout: `openxFactory/` with `openXwallet` initialized, `openXdox` and `openDox` initialized recursively, and the decision core `b21f0100` beside it as `PINNED_CORE_CHECKOUT`. The suite ran from the lock's venv, with the pinned OpenSpec CLI 1.12.0 on `PATH`, under `python3 -m pytest tests/ -q -m "not postgres" --junitxml=…`:

| tree | pytest's summary line | JUnit totals |
|---|---|---|
| `main` `e81eed62` | `8907 passed, 5 skipped, 338 deselected, 9 warnings, 412 subtests passed in 1910.89s (0:31:50)` | `tests=9324 failures=0 errors=0 skipped=5` |
| this change (`a41bd6d5`, see the note below) | `8907 passed, 6 skipped, 338 deselected, 9 warnings, 412 subtests passed in 1842.47s (0:30:42)` | `tests=9325 failures=0 errors=0 skipped=6` |
| this change, pushed head `bfcc50b3` | `8907 passed, 6 skipped, 338 deselected, 9 warnings, 412 subtests passed in 1551.79s (0:25:51)` | `tests=9325 failures=0 errors=0 skipped=6` |

`main`'s five skipped nodes, as JUnit `classname::name` with each skip's message:

```
tests.notebooklm.test_sync_notebooklm_books  [collection skipped]
tests.notebooklm.test_workbench_sweep_wiring  [collection skipped]
tests.conformance-gate.test_conformance_checks::test_inventory_real_repo_is_consistent  [publisher checkout is not a domain repo; the self-gate runs in domain repos]
tests.conformance-gate.test_conformance_checks::test_parity_all_real_pairs_pass  [publisher checkout is not a domain repo; the self-gate runs in domain repos]
tests.domain_pin_setter.test_set_domain_openxfactory_pin::test_the_fixture_still_matches_the_live_ledgerx_shape  [no sibling LedgerxFactory checkout reachable from this tree]
```

`diff` of the skipped lines, `main` → this change. Node for node, it is `main`'s 5 and this case:

```
5a6
>   SKIP tests.domain_profile.test_session_worktree_book_scan::test_worktree_container_is_gitignored_in_the_aggregation_repo  [no aggregation checkout reachable from this tree]
```

Across every testcase node in the two reports, this change adds exactly one (8912 → 8913), and none is found only in `main`. `passed` stays at 8907, so neither floor moves.

*Note on the head.* `a41bd6d5` was this branch's first cut, and it was never pushed. The pushed head `bfcc50b3` differs from it in `pytest-suite.yml` only: two comment passages that summarize the runner number (the file header's, and the pin's first comment line) now end at 6 as well. A grep finds no test that reads either passage. The whole suite was run again at `bfcc50b3`, from a fresh clone of this branch (the table's third row), and it skipped the same six nodes as `a41bd6d5`. The held case was also re-run inside the aggregation with its submodule at `bfcc50b3`, fetched from this branch: `3 passed`, with the same four `check-ignore` lines.

**This PR's own `pytest-suite` run at `bfcc50b3`** (run `36585369006`, green in 22m48s) prints the same test line, and the pin step reads:

```
selected=9325 passed=9319 skipped=6 failures=0 errors=0
floors: selected>=7050 (margin 2275) passed>=7044 (margin 2275) skipped==6
```

## Checks

- `.github/workflows/pytest-suite.yml` parses as YAML, and its pin step's env reads `EXPECT_SKIPPED=6`, `MIN_SELECTED=7050`, `MIN_PASSED=7044`. The floors are unchanged.
- Every added line in the diff is at most 80 columns.
- The diff and the commit message contain no host path. The commit message has no closing keyword.
- `lane-line`: the body's first non-empty line is the Lane line.

No closing keyword appears in this body or in the commit.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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