Skip to content

T034: repair the nine files that go red once 2.1 lands (research R3; 16.6's phase-1 repair) - #50

Merged
brettheap merged 9 commits into
mainfrom
build/034-p1f-t034-nine-file-repair
Sep 27, 2026
Merged

brettheap merged 9 commits into
mainfrom
build/034-p1f-t034-nine-file-repair

Conversation

@brettheap

@brettheap brettheap commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Plan 034, task T034, slice P1-F (the sweep and the nine-file repair). The plan is specs/034-opendox-standalone-operation/tasks.md at opensoft/openxFactory main 468863d1, where round 2 (#1176) has landed. The T034 entry there is byte-identical to 0d48231b's, which this record was first written against. This PR realizes box 9.1 (part) and 16.6 (the phase-1 repair) of the ratified add-neutral-product-standalone-operability.

For T007's batch E and T047: what this PR moves to openxFactory

Four test cases leave openDox-code and become NAMED openxFactory composition tests (R1Q2 (a)). T007's batch E adds each destination path to F11.1's named set (COMPOSITION_TESTS) before T047 lands. T047's openxFactory PR lands the cases there, and T049 checks that they arrived. tests/test_session_harness.py is not moved here. It is in collect_ignore, and it is T035's.

The holder's decision on the three memory-gateway cases: accepted under R1Q2 (a) (relayed to this lane's writer, 2026-09-27). T034's text names only the outline case. The memory-gateway cases take the same route because the spec they read exists only in openxFactory.

moved case from (openDox-code) to (openxFactory), proposed why it cannot stay
test_the_model_and_the_doc_health_family_agree_on_the_contract tests/test_outline_model.py tests/ideation-dashboard/test_outline_template_agreement.py It holds views/outline-model.js's REQUIRED_SECTIONS and QUESTION_SUBFIELDS equal to openxFactory's doc_health.families (_TEMPLATE_SECTIONS, _QUESTION_SUBFIELDS). It imports doc_health, which openDox can never install. openDox has no checker of its own until Group 6 (release 2), so there is no openDox contract to rewrite it against.
test_the_roster_is_exactly_the_promoted_capabilitys_requirements tests/test_doxbench_memory_gateway.py tests/ideation-dashboard/test_memory_gateway_roster.py It reads openspec/specs/memory-gateway/spec.md, the promoted capability that doxbench_memory_gateway.CAPABILITY_REQUIREMENTS is transcribed from. That spec is openxFactory's, and no openDox repository carries a copy (checked in openDox-spec, openDox, openXdox-spec, openXdox and openXdox-code). It failed on FileNotFoundError.
test_the_tier_column_is_TRANSCRIBED_not_invented same same the same spec's tier block
test_the_untiered_requirement_really_is_absent_from_the_tier_block same same the same spec's tier block

Both destinations compose openDox at openxFactory's pin, which scripts/carved_reach.py already puts on the path for tests/ideation-dashboard/. The outline case then reads openDox/code/src/opendox/web/views/outline-model.js from the pin, and the memory-gateway cases import opendox.doxbench_memory_gateway. The paths are proposals. If T047's writer chooses others, batch E records what T047 lands. The cases' own text, verbatim from main 19370adc, is below, so no archaeology is needed.

The outline-template agreement case (from tests/test_outline_model.py)
def test_the_model_and_the_doc_health_family_agree_on_the_contract():
    """The surface and the checker must mean the same thing by conformance."""
    import sys
    sys.path.insert(0, str(REPO_ROOT / "scripts"))
    from doc_health import families

    js = MODEL_JS.read_text(encoding="utf-8")
    for _needle, label in families._TEMPLATE_SECTIONS:
        assert f'label: "{label}"' in js, f"model omits required section {label}"
    for field in families._QUESTION_SUBFIELDS:
        assert f'"{field}"' in js, f"model omits sub-field {field}"

MODEL_JS was REPO_ROOT / "src/opendox/web/views/outline-model.js". At openxFactory it is the pinned leg's copy of that file.

The three memory-gateway roster cases (from tests/test_doxbench_memory_gateway.py)
SPEC_PATH = REPO_ROOT / "openspec" / "specs" / "memory-gateway" / "spec.md"


# ===========================================================================
# THE ROSTER — transcribed, and asserted against the capability itself
# ===========================================================================


def test_the_roster_is_exactly_the_promoted_capabilitys_requirements():
    """The declaration is only complete if the roster it is complete OVER is
    the capability's own. Read from the promoted spec, so a requirement added
    upstream fails here rather than becoming a silent gap in the declaration."""
    published = {
        line[len("### Requirement: "):].strip()
        for line in SPEC_PATH.read_text(encoding="utf-8").splitlines()
        if line.startswith("### Requirement: ")
    }
    assert published == set(mg.CAPABILITY_REQUIREMENTS)


def _published_tiers() -> dict[str, str]:
    """The spec's OWN tier block, parsed: requirement name -> the tier line it
    is named on."""
    spec = SPEC_PATH.read_text(encoding="utf-8")
    block = spec.split("```text", 1)[1].split("```", 1)[0]
    published: dict[str, str] = {}
    for match in re.finditer(r"(M\d):((?:.|\n)*?)(?=\nM\d:|\Z)", block):
        tier, body = match.group(1), " ".join(match.group(2).split())
        for name in body.split(";"):
            published[name.strip().rstrip(".")] = tier
    return published


def test_the_tier_column_is_TRANSCRIBED_not_invented():
    """RE-PINNED (adversarial review, F7). The roster test checked NAMES only,
    so two wrong tier values sat in the column unchallenged: one requirement
    carried `M0` although the spec's tier block never tiers it at all, and
    `Expert Memory And Knowledge DBs Are Gateway-Governed` was FLATTENED to
    `M4` although the spec says in as many words that it follows the tier of
    the operation it mirrors. Both are now transcribed, and this test reads the
    spec's own block so neither error can recur silently."""
    published = _published_tiers()
    for requirement, declared in mg.CAPABILITY_REQUIREMENTS.items():
        named = [line for line in published
                 if line.lower().startswith(requirement.lower())]
        if not named:
            # Not tiered by the spec at all -- which the column must SAY.
            assert declared == mg.TIER_UNTIERED, requirement
            continue
        line = named[0]
        if line != requirement:
            # The spec qualifies this row rather than tiering it outright.
            assert declared == mg.TIER_MIRRORS_OPERATION, requirement
            assert "follows the tier of the operation it mirrors" in line
            continue
        assert declared == published[line], requirement


def test_the_untiered_requirement_really_is_absent_from_the_tier_block():
    published = _published_tiers()
    untiered = [name for name, tier in mg.CAPABILITY_REQUIREMENTS.items()
                if tier == mg.TIER_UNTIERED]
    # TWO since 2026-08-22: add-doxbench-editing-phase-b's archive promoted
    # `Subject-Free Local Consumers…` into the capability, and the spec's tier
    # block does not tier it either. The list stays EXACT rather than becoming
    # a membership check — an untiered requirement is a fact about the spec, so
    # a third one appearing should fail here and be looked at.
    assert untiered == [
        "Derived memory bindings validate against the neutral schema",
        "Subject-Free Local Consumers Declare Their Inapplicable Rails"]
    for name in untiered:
        assert not any(line.lower().startswith(name.lower())
                       for line in published)

mg is opendox.doxbench_memory_gateway, and the helper needs import re. At openxFactory, REPO_ROOT is openxFactory's own root, where the spec is (22 requirements at 0d48231b, and CAPABILITY_REQUIREMENTS holds 22).

The nine files (research R3), at main 68be484a and at this head

With the root conftest in play, Python 3.12.3, -c constraints-cpython312-linux.txt -e ".[test]". The nine files give the same results on main at 68be484a as at 19370adc:

file main this head cause repair
test_doxbench_abstract_pane.py 18 passed, 28 errors 46 passed § 3.4 slice S5 moved the workbench gate column out of the bundle, so a shell mounted with no column withholds the canvas, and the generate control with it The harness is the host, so it contributes the column app.js resolves. It imports _CONTRIBUTED_GATE from test_doxbench_view.py, whose S7 note gives the reason, the way it already imports the DOM shim. The column answers createGateLive off the same caps, so the ungated and hosted mounts still have no gate.
test_outline_tab.py 3 passed, 25 errors 28 passed the same the same, and the pre-template sentence reads the SELECTION role's word from NEUTRAL_DISPLAY. It spelled openxFactory's "staged" before S7 parameterized it.
test_doxbench_composition.py 13 errors 13 passed the same the same
test_provider_boundary.py 16 passed, 12 failed 24 passed 16.6's three stale reasons See below.
test_doxbench_memory_gateway.py 36 passed, 3 failed 36 passed read openxFactory's openspec/specs/memory-gateway/spec.md the three cases move to openxFactory (above)
test_consumer_reach.py 31 passed 36 passed none left after T011, whose bullet says "T034 re-derives the rest of the file" re-derived: see below
test_boundary.py 27 passed, 1 failed 28 passed the surface scan kept names whose __module__ was the literal "output_boundary", so after the carve every class fell out of the census the guard's home is read off output_boundary.__name__
test_doxbench_mcp.py 23 passed, 1 failed 24 passed the child was started as -m ideation_dashboard.doxbench_mcp with PYTHONPATH=scripts/ -m opendox.doxbench_mcp with PYTHONPATH=src/
test_outline_model.py 47 passed, 1 failed 47 passed imported doc_health the case moves to openxFactory (above)
total 201 passed, 18 failed, 66 errors 282 passed

test_provider_boundary.py, for 16.6's three reasons. None of the twelve failures was a crossing. The file's docstring now records each reason.

  1. It read snapshot_registry.py, its second HTTP-client holder, which the carve sent to openXdox-code. It is no holder in this package now, and the claim about it is not this leg's to make.
  2. It pinned seven per-module scan suites by filename. The carve manifest sent five to openXdox-code (test_doxbench_turns.py, test_doxbench_packet.py, test_doxbench_threads.py, test_doxbench_bridge.py and test_doxbench_mutation_boundary.py) and left two in openxFactory (test_doxbench_model.py and test_doxbench_status_exemption.py, stays_openxfactory_adapter). PRESERVED_SCANS now pins the three this checkout carries. PRESERVED_ELSEWHERE records the seven with their homes, and a case asserts that none of them is here, so the record cannot go stale.
  3. Its sweep reached the runtime (§ 3.5). runtime/app.py spells Authorization and Bearer for the identity broker's token, which it checks on the way in. runtime/oidc.py, which verifies that token, spells Authorization in prose. Both are named as tier-two holders in place of snapshot_registry.py, and the provider tier is asserted absent from each, as it was from that module. The named list is an exemption, so it is not its own authority. Since review round 5, test_the_identity_surface_is_the_runtimes_two_modules holds it to exactly these two modules, and a third holder has to be argued on its own PR. runtime/config.py names access_token in SECRET_PARAMETER_KEYS, the credential names the runtime refuses and redacts. It gets one permit: that needle, in that module, only while that tuple still names it (read with ast), and no other provider-tier spelling there. Since review round 1, the permit covers only the tuple and the module's prose. The sweep asks _spelled_in_code, which reads every identifier, attribute name and string literal off the syntax tree outside the declaration and the documentation. A spelling there fails with its line. A case also holds the table to that one entry, not only to its size, so a second permit, or one moved to another module or needle, has to be argued on its own PR.

The boundary is still one module wide for anything that holds a provider credential. 16.6's own measurement agrees: only doxbench_provider.py reaches a model provider.

test_consumer_reach.py, re-derived over the whole package. T011 emptied STILL_REACHING by moving its only two entries.

  • test_the_record_is_the_whole_packages_own now derives the record on every run. It imports every module the package's files define, in one interpreter, with all four siblings blocked. It follows the exception chain, because a stand-in resolved at import time raises ConsumerReachUnavailable with the ModuleNotFoundError as its cause. The modules that fail on a sibling must be exactly the record. Before this, a module outside NEUTRAL_MODULES, which names nine, could start needing openxdox at import time and pass the whole file. At this head none fails.

  • Every other failure is classified, not dropped. The one read past is a module of opendox.runtime missing a package of the runtime extra, where the extra is not installed. In a .[test]-only venv, that is app, db and oidc, on fastapi, psycopg and httpx. Anything else fails the test by name: a syntax error, a broken module of openDox's own, an undeclared dependency, or a runtime package needed outside opendox.runtime. RUNTIME_EXTRA tables the extra's distributions with their import names, and test_the_runtime_extra_is_the_one_pyproject_declares holds its keys to pyproject.toml's runtime list. test_the_runtime_extras_modules_are_the_runtimes_own holds the import names to two independent authorities, the runtime's own imports and the installed metadata. Each tabled name is one that a module of opendox.runtime imports. Every third-party package the runtime imports is tabled, or comes from one of the package's required dependencies. Where a tabled distribution is installed, each of its names is installed by it or by a distribution it requires.

  • CONVERTED_SITES had fallen behind the tree by five names in two files: branch_session.py's gate_console, the module whose nine default-argument reads the guard is named for, and cli.py's corpus_root_refusal, generate_snapshot, is_rfc3339_datetime and SCANNED_ROOTS. They join the table. test_every_name_bound_to_the_seam_is_guarded holds the table equal to the names each module binds to the seam. None of the five is read at import time. The census reads every spelling of the seam:

    • Y = <seam>.X, its annotated form, and Y = <seam>.module(...);
    • <seam> spelled as an alias of the module, as opendox.consumer_reach after import opendox or import opendox.consumer_reach, or through from .. import consumer_reach in a subpackage;
    • each of these wherever the module runs it at import time, a module-level if or try included.

    A wildcard import from the seam fails with its own message.

Thirty-seven mutations, each a copy of this tree with one planted change, and each fails the assertion it targets. One more runs in the .[runtime,test] venv. The first thirteen:

  • an unlisted module gains a module-level from openxdox import …;
  • an unlisted module resolves a stand-in at import time, which is caught through the exception chain;
  • a new name is bound to the seam;
  • branch_session.py reads gate_console at import time;
  • a provider endpoint appears in a non-provider module;
  • a Bearer header appears in an unnamed module;
  • the identity surface gains MintedToken;
  • SECRET_PARAMETER_KEYS stops naming access_token;
  • the redaction module gains client_secret;
  • a carved-away scan suite comes back;
  • the guard gains a public class the shim does not re-export;
  • the pre-template sentence goes back to "staged topic";
  • the abstract-pane harness loses its contributed column.

The twelve added in review round 1:

  • an import-time import doc_health where a doc_health is installed;
  • a module importing a missing module of openDox's own;
  • a module that raises while importing;
  • an undeclared dependency;
  • import fastapi outside opendox.runtime;
  • a runtime module importing a package the extra does not declare;
  • a distribution added to pyproject's runtime extra and not tabled;
  • Y: T = consumer_reach.X;
  • Y = consumer_reach.module(...);
  • runtime/config.py spelling access_token in a dict key, in an attribute read, and in an f-string.

Eight more came from review rounds 2 and 3:

  • import opendox.consumer_reach then opendox.consumer_reach.module(...);
  • import opendox then opendox.consumer_reach.snapshot;
  • an alias of the seam module;
  • a subpackage's from .. import consumer_reach;
  • the seam imported inside a module-level try;
  • a stand-in bound inside a module-level if;
  • a wildcard import from the seam;
  • a second redaction permit.

Two came from review round 4, and one more runs in the .[runtime,test] venv:

  • an invented module in a RUNTIME_EXTRA row;
  • a runtime module importing a package nothing declares, read statically;
  • in .[runtime,test], a module tabled under a distribution that does not install it.

Two came from review round 5:

  • a third identity holder listed, with Authorization in its code;
  • the one redaction permit moved to another needle, with runtime/config.py spelling that name instead.

Two controls pass, as they must: a new comment and a new docstring in runtime/config.py that name access_token.

The falsifier: python -m pytest -q over the nine files

$ python -m pytest -q tests/test_doxbench_abstract_pane.py tests/test_outline_tab.py tests/test_doxbench_composition.py tests/test_provider_boundary.py tests/test_doxbench_memory_gateway.py tests/test_consumer_reach.py tests/test_boundary.py tests/test_doxbench_mcp.py tests/test_outline_model.py
282 passed in 22.93s

It also passes under --noconftest, file by file, and in a .[runtime,test] venv.

The repository's own check

.github/workflows/validate.yml's three report-producing steps, run as the file writes them and summed as Pin the triple sums them, in the .[test] venv above:

triple: selected=1160 passed=1157 skipped=3 failures=0 errors=0
pins:   selected>=1114 (margin 46) passed>=1111 (margin 46) skipped==3

main at 68be484a gives 1155/1152/3. The five new cases are test_consumer_reach.py's, which the required job runs by name. test_provider_boundary.py's new cases are not on the job's list. No skip was added.

The whole suite, with the root conftest. A test-by-test JUnit diff against main in the same venv:

venv main this head
.[test] 19 failed, 1489 passed, 13 skipped, 66 errors 1 failed, 1570 passed, 13 skipped
.[runtime,test] (F2.1's install) 18 failed, 1490 passed, 13 skipped, 66 errors 1571 passed, 13 skipped
  • 69 cases go from red to passed, all in the nine files.
  • 15 are gone: the 4 moved cases, and 11 of test_provider_boundary.py's old ids. Nine were PRESERVED_SCANS rows for files this checkout does not carry, one was the renamed tier-two case, and one was the snapshot_registry.py case.
  • 12 are new, all passing: 5 in test_consumer_reach.py and 7 in test_provider_boundary.py.
  • No other outcome changed.
  • The .[test] venv's one failure is T030's test_every_module_imports_with_no_sibling, which needs the runtime extra there, as Remove serve.py's two import-time reaches into openxFactory (plan 034 T011, with T030) #46 recorded. T036 gives the test extra those packages.

Review round 1 (Copilot, at 6898748a)

Each finding was planted at 6898748a first, and every plant passed there. Each is fixed in 86b8f522, where every plant fails, and each thread is answered with its evidence and resolved.

  • The derivation blocked only openxdox. With a doc_health on the path, a module gaining import doc_health dropped out of the census. The derivation, and the record entry check that reads the same failure, now block all four.
  • The derivation dropped every failure that named no sibling. They are classified now (above).
  • The access_token permit covered the whole of runtime/config.py. It covers the declaration and the prose now (above).
  • The review's overview also named annotated assignments in the seam census, with no thread. That is done too (above).

Review rounds 2 and 3 (Copilot, at 86b8f522 and 9d52122b), no threads

  • Round 2: one previously missed finding. import opendox.consumer_reach binds opendox, so a stand-in bound through opendox.consumer_reach went unseen. Three sibling forms were unseen the same way. All four are read since 9d52122, and each passed as a plant at 86b8f52.
  • Round 3: a summary line only, "seam-alias and wildcard-import gaps, and the single provider-boundary permit invariant." Since 9a9b21a:
    • the census reads a module-level if or try, where both plants passed at 9d52122;
    • a wildcard import fails with its own message;
    • the permit table is held at one entry.
  • At 9a9b21ae Copilot reports "Needs a closer look", with no finding and no thread.

Review round 4 (Copilot, at 7867614c, the first merge of main)

  • RUNTIME_EXTRA's import names were checked only through its keys. Adding "planted" to fastapi's row left the whole of test_consumer_reach.py green at 7867614, and a missing planted import in opendox.runtime would then have been read past as an absent extra. Fixed in 383b3232 by the new case above, which holds the names to the runtime's imports and to the installed metadata. The thread is answered with that evidence and resolved.
  • At 383b3232 Copilot reports "Needs a closer look", with no finding and no thread.

Review round 5 (Copilot, at 7e3dc9ff, the merge of T032)

  • IDENTITY_MODULES was its own authority. holders_seen == permitted proves only that each listed module holds a needle. Planted at 7e3dc9ff, runtime/db.py added to the tuple, with an Authorization string in its code, passed the whole file (24 passed). The thread also names line 318, the permit table's pin, which held REDACTION_PERMITS by its size only. Planted there, the permit moved to refresh_token, with runtime/config.py spelling that name in place of access_token, passed too (23 passed). Fixed in bc6b168d: each table is held to the surface it names (above), and both plants fail. The thread is answered with that evidence and resolved. All five threads on this PR are resolved.

Landing

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

🤖 Generated with Claude Code

Summary by Sourcery

Repair the standalone openDox test inventory and package-boundary checks after the carve so the affected suites accurately validate the new repository ownership and runtime behavior.

Bug Fixes:

  • Repair the nine post-carve test files so the targeted suite passes across the standalone package layout.
  • Correct browser harness setup, module paths, neutral display wording, boundary scans, provider-boundary exemptions, and consumer-reach census behavior.

Enhancements:

  • Re-derive consumer reach and seam bindings across the complete package, including runtime dependency classification and mutation-resistant coverage.
  • Align provider-boundary checks with the carved repository structure and explicitly track identity-surface and credential-redaction exceptions.
  • Move cross-repository specification-integration checks out of openDox tests for validation in openxFactory.

Tests:

  • Update and strengthen boundary, consumer-reach, provider-boundary, and browser composition tests for the standalone package.

Chores:

  • Record carved test suites and integration cases that now belong to openxFactory or openXdox-code.

Research R3's nine files, each red for a stale harness, a stale record or a
reach the carve left behind in a test, and none for a product defect:

- test_doxbench_abstract_pane, test_outline_tab, test_doxbench_composition:
  the harnesses mount the shell as its host, so they contribute the
  workbench gate column app.js resolves (slice S5 moved it out), imported
  from test_doxbench_view's _CONTRIBUTED_GATE with the DOM shim. The outline
  tab's pre-template sentence reads the SELECTION role's neutral word (S7).
- test_provider_boundary, for 16.6's three reasons: snapshot_registry.py
  went to openXdox-code; the seven carved-away per-module scans are
  recorded with their homes and asserted absent; the runtime's identity
  surface is named for tier two, and config.py's redaction key is a permit
  held to its declared reason.
- test_boundary: the census reads the guard's home off the module.
- test_doxbench_mcp: the child runs as opendox.doxbench_mcp from src/.
- test_consumer_reach: STILL_REACHING is derived over the whole package on
  every run, and CONVERTED_SITES is held equal to the names the tree binds
  to the seam (branch_session.py's gate_console and cli.py's four other
  aliases join it).
- Moved out, as named openxFactory composition tests (R1Q2 (a)):
  test_outline_model's doc_health agreement case and
  test_doxbench_memory_gateway's three spec-reading cases. T007's batch E
  names their paths; T047 lands them.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 27, 2026 04:24
@sourcery-ai

sourcery-ai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR repairs the nine post-2.1 red test files by aligning harnesses and subprocess imports with the carved openDox layout, moving openxFactory-owned integration checks out of openDox, and replacing stale hand-maintained boundary/import inventories with package-wide derived assertions and explicit carve records.

File-Level Changes

Change Details Files
Re-derived standalone import and seam-guard inventories across the entire package.
  • Enumerate every package-defined module in a consumer-blocked subprocess and compare sibling failures with STILL_REACHING.
  • Derive top-level names bound to the consumer-reach seam and require an exact match with CONVERTED_SITES.
  • Expand the consumer-reach census with corrected module-level aliases and mutation-focused safeguards.
tests/test_consumer_reach.py
Repaired package-wide provider-boundary checks for the post-carve repository layout.
  • Replace stale snapshot and missing per-module scan assumptions with runtime identity holders and explicit elsewhere records.
  • Permit and validate runtime/config.py's refusal-only access_token spelling while keeping provider-tier scans strict.
  • Use package-relative paths and AST inspection for subpackage modules and redaction permits.
tests/test_provider_boundary.py
Updated browser and composition test harnesses to provide the post-carve workbench gate contract.
  • Import the shared contributed gate column alongside the DOM shim.
  • Mount the contributed column so canvas and generate-control behavior is exercised under the host contract.
  • Read the neutral selection display term instead of the obsolete staged wording.
tests/test_doxbench_abstract_pane.py
tests/test_doxbench_composition.py
tests/test_outline_tab.py
Removed cross-repository integration assertions from openDox tests and relocates them to openxFactory composition coverage.
  • Delete the doc-health agreement case and three memory-gateway spec roster/tier cases from this repository.
  • Document the proposed named openxFactory destinations and preserve openDox-local behavior checks.
tests/test_outline_model.py
tests/test_doxbench_memory_gateway.py
Fixed the MCP child-process test for the carved package and import root.
  • Launch opendox.doxbench_mcp with src/ on PYTHONPATH instead of the pre-carve ideation_dashboard module.
tests/test_doxbench_mcp.py
Made boundary re-export discovery independent of the package's hard-coded module name.
  • Derive the guard's home from output_boundary.name when identifying public definitions and reporting missing re-exports.
tests/test_boundary.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

🟡 Changes recommended

Four unresolved moderate findings remain in the consumer-reach and provider-boundary checks.

Review effort: Lite
Findings: 3 Medium severity

Open (3)
What changed in this PR

Repairs post-carve standalone validation tests and relocates openxFactory-specific assertions.

Changes:

  • Updates browser, MCP, provider-boundary, and package-boundary tests.
  • Re-derives consumer-reach and seam-binding inventories.
  • Removes cross-repository tests from OpenDox coverage.

Four unresolved moderate findings remain.

File Summary
tests/​test_provider_boundary.py Updates provider/runtime boundary scans. Moderate finding (2 votes): restrict the access_token exemption to its declaration.
tests/​test_outline_tab.py Adds contributed gate support and updated vocabulary checks.
tests/​test_outline_model.py Removes the cross-repository checker agreement test.
tests/​test_doxbench_memory_gateway.py Removes openxFactory spec-dependent tests.
tests/​test_doxbench_mcp.py Uses the standalone package module path.
tests/​test_doxbench_composition.py Adds contributed gate support.
tests/​test_doxbench_abstract_pane.py Adds contributed gate support.
tests/​test_consumer_reach.py Re-derives package reach and seam inventories. Moderate findings: block all sibling roots (3 votes), reject unclassified import failures (2 votes), and include annotated assignments (1 vote).
tests/​test_boundary.py Derives the boundary module name dynamically.

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

Comment thread tests/test_consumer_reach.py Resolved
Comment thread tests/test_consumer_reach.py Resolved
Comment thread tests/test_provider_boundary.py Resolved
… and hold the access_token permit to its declaration (plan 034 T034)

Four review findings on the repair, each planted at 6898748 first, where
all eleven plants passed, and each failing now.

The record's derivation blocked only openxdox. With a doc_health on the
path, a module gaining `import doc_health` imported, and dropped out of the
census. The derivation, and the record entry check that reads the same
failure, now block all four SIBLINGS.

The derivation dropped every failure that named no sibling: a missing
module of openDox's own, a module that raises while importing, an
undeclared dependency. Each is now a failure of the test, by name. It reads
past one failure only: a module of opendox.runtime that cannot find a
package of the runtime extra, where that package is not installed. That is
what validate.yml's .[test] install meets, for app, db and oidc.
RUNTIME_EXTRA tables the extra's distributions with the modules each puts
on the path. A new case holds its keys to pyproject.toml's own list (PEP
503 names), so the one exemption cannot drift from what the package
declares.

The access_token permit covered the whole of runtime/config.py. It now
covers the SECRET_PARAMETER_KEYS declaration and the module's prose. A
spelling in code anywhere else fails the sweep with its line: a dict key,
an attribute read, or an f-string. A comment or a docstring does not (two
controls).

The seam census now also reads `Y: T = consumer_reach.X` and
`Y = consumer_reach.module(...)`. The tree binds neither today, so the
table is unchanged.

Falsifiers: the nine files, 279 passed; validate.yml's triple
1147/1144/3, PASS; the whole suite under .[test], 1 failed (T036's
test_imports_standalone, as before) / 1526 passed / 13 skipped, with one
new passing case and no other change; 25 of 25 mutations bite.

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

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 27, 2026 05:22

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

A moderate gap remains in bare-import seam-binding detection and requires coverage.

Review effort: Lite
Findings: None

Resolved since last review (3)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Track bare package imports in the seam binding census

tests/​test_consumer_reach.py:952

The binding census only recognizes import opendox.consumer_reach as alias; a normal import opendox.consumer_reach binds the name opendox, so a later top-level assignment such as X = opendox.consumer_reach.module(...) is not included in derived. A future module can therefore introduce an import-time seam binding in a valid Python form while test_every_name_bound_to_the_seam_is_guarded still passes. Track the bare-import package alias and its nested consumer_reach attribute (and add a mutation for this form).

Review round 2 named a form the census missed, as a previously missed
finding with no thread. `import opendox.consumer_reach` binds `opendox`,
so `X = opendox.consumer_reach.module(...)` bound a stand-in that
`test_every_name_bound_to_the_seam_is_guarded` never saw. Three more forms
were missed the same way: `import opendox`, then
`opendox.consumer_reach.snapshot`; an alias of the seam module
(`cr = consumer_reach`); and a subpackage's `from .. import
consumer_reach`, because the relative level was fixed at one. Each of the
four, planted at 86b8f52, passed. Each fails now.

The census now tracks the names bound to the `opendox` package, reads
`opendox.consumer_reach` as the seam, follows an assignment of the seam
module in statement order, and reads the relative level from the file's
depth under the package. The tree binds none of these forms today, so the
table is unchanged.

Falsifiers: the nine files, 279 passed; the triple 1147/1144/3, PASS;
29 of 29 mutations bite, and both prose controls still pass.

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

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 27, 2026 05:35

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

Address the unresolved seam-alias and wildcard-import gaps, and enforce the single provider-boundary permit invariant.

Review effort: Lite
Findings: None

… and hold the permit to one (plan 034 T034)

Review round 3 left three hints, with no thread and no finding.

The census read only a module's top-level statements. So an import of
the seam inside a module-level `try`, and a stand-in bound inside a
module-level `if`, went unread, and both run at import time. Planted at
9d52122, both passed. It now walks every statement the module runs at
import time, through if/try/with/for/while/match and their handlers,
but not a function's or a class's body.

A wildcard import from the seam binds stand-ins the guard cannot read
name by name. It already failed the census as a mismatch, with a message
that invited adding "*" to the table. It now fails with its own message.

`REDACTION_PERMITS` is ONE spelling in ONE module, as its comment says.
A new case holds the count at one, so a second permit has to be argued
on its own PR.

Falsifiers: the nine files, 280 passed; the triple 1147/1144/3, PASS
(test_provider_boundary.py is not on validate.yml's list); 33 of 33
mutations bite, and both prose controls still pass.

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

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 27, 2026 05:46

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

Three moderate issues remain in the consumer-reach and provider-boundary validation logic.

Review effort: Lite
Findings: None

T022 has landed, so this takes main at 255514d and re-verifies the nine
files, the triple and the whole suite over it. T034 stays after T032
(#49), and takes main again once T032 lands.

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

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 27, 2026 06:23

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

Four unresolved moderate findings weaken the consumer-reach and provider-boundary safeguards.

Review effort: Lite
Findings: 1 Medium severity

Open (1)

Comment thread tests/test_consumer_reach.py Resolved
… to the installed metadata (plan 034 T034)

Review round 4's thread. The pyproject check held RUNTIME_EXTRA's
distributions, but not the module names the exemption reads. So adding
"planted" to a row exempted a missing `planted` import from
opendox.runtime. Planted at 7867614, the whole file stayed green. It
fails now.

A new case, `test_the_runtime_extras_modules_are_the_runtimes_own`,
holds the names three ways:
1. each tabled name is imported by a module of opendox.runtime, read with
   tests/import_scan.py's shared scanner, so an invented entry fails;
2. every third-party package opendox.runtime imports is tabled, or comes
   from one of the package's required dependencies (read from its
   installed metadata), so an undeclared dependency fails too, wherever
   it sits in the import order;
3. where a tabled distribution is installed, each of its names is
   installed by it or by a distribution it requires, per the metadata.
   In `.[runtime,test]` that places pydantic under fastapi and
   psycopg_pool under psycopg. Moving pydantic to httpx's row fails
   there.

Falsifiers: the nine files, 281 passed in both venvs; the triple
1159/1156/3, PASS; 35 of 35 mutations bite, plus the runtime-venv one;
both prose controls pass.

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

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 27, 2026 06:38

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

Three moderate findings remain in the consumer-reach and provider-boundary checks.

Review effort: Lite
Findings: None

Resolved since last review (1)

brettheap and others added 2 commits September 27, 2026 14:35
T038 landed after T022, so this takes main at 796838e and re-verifies
the nine files, the triple and the whole suite over it, in both venvs.
T034 stays after T032 (#49), and takes main again once T032 lands.

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

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
T032 has landed, so T034's After is met. This takes main at 68be484,
which adds only the sweep and its reader, and re-verifies the nine
files, the triple and the whole suite over it, in both venvs. The sweep
itself passes on this tree, and its import inventory is the one the
re-derived censuses hold.

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

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 27, 2026 14:54

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

Unresolved critical and moderate findings remain in the boundary and consumer-reach checks.

Review effort: Lite
Findings: 1 High severity

Open (1)

Comment thread tests/test_provider_boundary.py Resolved
…y name (plan 034 T034)

Review round 5's thread, at the merged head. `IDENTITY_MODULES` was its
own authority: `holders_seen == permitted` proves only that each listed
module holds a needle. Planted at 7e3dc9f, `runtime/db.py` added to the
tuple, with an `Authorization` string in its code, passed the whole of
`tests/test_provider_boundary.py` (24 passed).

`test_the_identity_surface_is_the_runtimes_two_modules` holds the tuple
to the runtime's identity surface, `runtime/app.py`, which takes the
caller's bearer token, and `runtime/oidc.py`, which verifies it. A third
holder has to be argued on its own pull request.

The same thread names the permit table's pin. It held
`REDACTION_PERMITS` to one entry by its size only. Planted at 7e3dc9f,
the permit moved to `refresh_token`, with `runtime/config.py` spelling
that name in place of `access_token`, passed too (23 passed). The case
now holds the table to its one entry.

Falsifiers: the nine files give 282 passed in both venvs; the triple is
1160/1157/3; both plants fail now; 37 of 37 mutations bite, plus the
runtime-venv one, and both prose controls pass.

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

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 27, 2026 15:11
@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

🔵 Needs a closer look

Four moderate review findings remain unresolved.

Review effort: Lite
Findings: None

Resolved since last review (1)

@brettheap
brettheap marked this pull request as ready for review September 27, 2026 15:17

@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

Copy link
Copy Markdown
Contributor Author

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

@brettheap
brettheap merged commit 71b631b 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-27T15:22:52Z, PR #50 → 71b631b (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
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) <[email protected]>
brettheap added a commit that referenced this pull request Sep 27, 2026
…(plan 034) (#51)

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

- **Ruled:** R1Q2 (a), R1Q6 (d) and R1Q22 (a), openxFactory#656 comments `5817152735` and `5850003126`. All seven modules are carved rows, and none needs a declared-edit act.
- **Claim:** openxFactory#656 comment `5856501803`.
- **After:** T034, which landed as #50 → `71b631bc`. T032 landed as #49 → `68be484a`, and this branch was cut from it. `main` at `71b631bc` is merged in at `81f93777` (no force-push). Three review rounds followed, each in its own section at the end. Every figure below is re-measured at this head, `b173a970`.

## 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`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_workbench.py#L119-L126) | `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`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_workbench.py#L129-L140) | same | same |
| [`test_committed_manifest_is_rejected_by_the_pinned_validator`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_workbench.py#L212-L224) | same | same, in `--repo` mode |
| [`test_scoped_doc_health_runs_real_machinery_over_the_fixture`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_workbench.py#L456-L466) | `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`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_workbench.py#L469-L475) | same | same |
| [`test_scoped_doc_health_ignores_out_of_scope_docs`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_workbench.py#L478-L486) | same | same. Here it passed only because an empty findings list satisfies its `all(...)`. |
| [`test_worktree_container_is_gitignored_in_the_aggregation_repo`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_session_harness.py#L248-L260), with [`find_aggregation_root`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_session_harness.py#L229-L238) | `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`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_session_harness.py#L279-L329) | same | `scripts/sync-notebooklm-books.py`, loaded by spec as the module did ([lines 37–45](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_session_harness.py#L37-L45)) |
| [`test_pinned_factory_paths_never_admits_a_worktree_container`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_session_harness.py#L332-L347) | same | same |
| [`test_the_browser_ceiling_is_pinned_to_the_RELEASED_maxLength`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_doxbench_chat_view.py#L4148-L4166) | `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`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_hermeticity.py#L604-L621), with [`_probe_run`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_hermeticity.py#L595-L601) | `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`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_hermeticity.py#L640-L660) | same | `tests/hermetic_unittest.py` (`not_moved`, present) |
| [`test_the_bare_unittest_route_is_detected_as_unguarded`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_hermeticity.py#L663-L674) | 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`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_hermeticity.py#L226-L240) | `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`](https://github.com/opensoft/openDox-code/blob/68be484ad8a3cb218b6cd217292c11736aa1c9b4/tests/test_hermeticity.py#L262-L275) | 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](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) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants