Repository navigation
T025: the session notebook lists the registered home corpus, under the registered scope (workbench.py:746) - #43
Conversation
…4 T025) workbench.session_documents imported openxFactory's doc_health.corpus inside its body and applied that corpus's own membership rule (workbench.py:746 at 1e4a57f): the last of workbench.py's four deferred reaches into the publisher, which opensoft/openXfactory#1144's task 4.3 routes in phase 1 (plan 034, tasks.md T025; R1Q9 (a)). It now calls the factory corpus_adapter.home() hands back (T020) on the worktree, and lists that corpus under the scope a host registered with opendox.workbench.register_session_notebook_scope(scope), or under `all`, openDox's default, where none is. openDox's core names no host scope; openxFactory registers its adapter's `documents` scope (T046), which lists exactly the notebook's 398 documents at openxFactory c415c3d1 (T006). With no home corpus registered it refuses as 4.2 does (CorpusRefused, ADAPTER_NOT_REGISTERED), and a scope the corpus does not declare refuses SCOPE_UNKNOWN rather than widening. open_session_notebook turns either into the FR-042 notice, so a notebook never blocks a session. Each document is decoded as the replaced reader read it (Path.read_text with errors=replace, so UTF-8 with replacement and universal newlines), and the size bound is measured as before, so no source's text or content hash moves. tests/test_session_notebook_membership.py holds that: the 4.2 refusal and the session's notice, `all` with only openDox's LocalGitCorpus default registered, the registered scope when there is one, the undeclared-scope refusal, the decoding held to Path.read_text itself, the size bound, the scope's one-registration discipline, a booby-trapped doc_health that is never reached, and an ast check that workbench.py now makes no deferred reach at all. Arc: neutral-product-standalone-operability Lane: openxfactory-4 (openXfactory-4-openDox_extraction) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reviewer's GuideSession notebook document discovery is decoupled from openxFactory-specific Sequence diagram for registered session notebook membershipsequenceDiagram
participant Host
participant Workbench
participant CorpusAdapter
participant CorpusFactory
participant Corpus
Host->>Workbench: register_session_notebook_scope(scope)
Workbench-->>Host: scope
Host->>Workbench: session_documents(worktree, repository, max_bytes)
Workbench->>CorpusAdapter: home()
CorpusAdapter-->>Workbench: factory
Workbench->>CorpusFactory: factory(worktree)
CorpusFactory-->>Workbench: adapter, ref
Workbench->>Corpus: adapter.resolve(ref)
Corpus-->>Workbench: resolved
Workbench->>Workbench: session_notebook_scope()
alt scope is not declared
Workbench-->>Host: CorpusRefused(SCOPE_UNKNOWN)
else scope is declared
Workbench->>Corpus: adapter.list_documents(resolved, scope)
Corpus-->>Workbench: document IDs
loop each document
Workbench->>Corpus: adapter.read(resolved, document_id)
Corpus-->>Workbench: content
end
Workbench-->>Host: document keys and decoded text
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The default home factory can read stale or incomplete HEAD content instead of current worktree files.
Review effort: Lite
Findings: 1
What changed in this PR
Routes session notebook membership through the registered home corpus and removes the direct doc_health dependency.
Changes:
- Adds scope registration, validation, and refusal handling.
- Preserves document decoding and size limits.
- Adds membership and hermeticity tests.
| File | Summary |
|---|---|
tests/test_session_notebook_membership.py |
Tests membership, refusals, decoding, limits, and dependency removal. |
src/opendox/workbench.py |
Implements corpus-based notebook membership; default snapshot behavior may omit uncommitted worktree edits and conflicts with existing contract semantics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…napshot session_documents reads every listed document through the registered home corpus's adapter, never by opening <worktree>/<key>: a DocumentId.key is opaque, and a consumer may not parse it. So what the notebook carries is what that corpus serves at the worktree. The docstring still said it read the worktree's files itself, which is true of the host's adapter (it reads the checkout it is pointed at, file by file, uncommitted edits included) and not of a corpus that serves a revision, such as LocalGitCorpus, which serves the worktree's HEAD. It now says both, and where openDox's own flow makes them agree: every governed write is one commit on the session branch, and the notebook is created right after the first one. Two tests pin it. Over a git worktree holding an uncommitted edit and an untracked draft, a checkout-reading corpus serves both, and LocalGitCorpus serves HEAD. And row-id keys over an empty worktree are read in full, so no byte comes from a path built out of a key. A mutant that opens the key as a path fails 14 of the file's 29 tests, both new ones among them. Arc: neutral-product-standalone-operability Lane: openxfactory-4 (openXfactory-4-openDox_extraction) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Arc: neutral-product-standalone-operability Lane: openxfactory-4 (openXfactory-4-openDox_extraction) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
|
Lane: openxfactory-4 (openXfactory-4-openDox_extraction) On Copilot's overview at The observation is right about what the test now needs. With nothing registered at the home seam, It is not a regression this PR can observe or repair, for three reasons:
I have added this to the body's downstream notes for T035: before calling |
There was a problem hiding this comment.
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 1 day and 20 hours by commenting @sourcery-ai review. Upgrade to get a review now.
|
READY at 5b4c877 — Lane: openxfactory-4 (openXfactory-4-openDox_extraction) |
Since the last merge, main gained T025 (#43) and T027 (#41). Neither touches src/route_extension.py, src/opendox/serve.py, the facet's tests or the profile-registration runbook. Arc: neutral-product-standalone-operability Lane: openxfactory-4 (openXfactory-4-openDox_extraction) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
main is 2768302. It carries P1-A's T010 (#40), T011 (#46) and T012 (#47), which T016 waits for, and P1-E's T025 (#43) and T027 (#41). Arc: neutral-product-standalone-operability Lane: openxfactory-4 (openXfactory-4-openDox_extraction) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…into openxFactory at all (#49) Plan 034, task **T032**, 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 T032 through T035 entries there are byte-identical to `0d48231b`'s, which this record was first written against. This PR realizes box **2.3** of the ratified `add-neutral-product-standalone-operability`. - **Ruled:** R1Q22 (a), openxFactory#656 comment `5817152735`. - **Claim:** openxFactory#656 comment `5852380744`. - **After:** T011, T012, T016, T021, T022, T025–T027 ("every lane joins here"). **All have landed.** T022 landed last, as #45 → `255514df`, merged in at `5270acf0`. T038 then landed as #48 → `796838e8`, and `main` at `796838e8` is merged in (`dc8fa87a`, no force-push). Everything below was re-run at this head, `b53b9db2`. ## The sweep (2.3) The four names in import position under `src/`: import statements, and `importlib.import_module(...)` or `__import__(...)` with a literal name. Every hit is classified by when it runs. It was run at the arc's base, openDox-code `1e4a57fb` (ARC_BASE, `evidence/arc-base.md`), and at `main` `796838e8`. That is where the last lane (T022) joined, plus T038's console script. This PR changes nothing under `src/`, so this head gives the same result. | | at `1e4a57fb` | at `796838e8` | |---|---|---| | import-time reaches | 2 (`ideation_dashboard`) | **0** | | deferred reaches into openxFactory | 8 | **0** | | deferred reaches into `openxdox` | 19 | **19** | **Closed: every reach into openxFactory, and every import-time reach.** | reach at `1e4a57fb` | target | closed by | landed | |---|---|---|---| | `serve.py:199`, `:206` (import time) | `ideation_dashboard.serve_openxfactory_lanes` | T011 (2.1), the handler-contribution facet | #46 → `0e88454a` | | `serve.py:713`, `_head_of` | `doc_health.corpus` (`RealGit`) | T012, openDox's own HEAD reader | #47 → `27683028` | | `authoring.py:318`, `_classify_proposal` | `corpus_adapter_openxfactory` | T021, `corpus_adapter.home()` | #44 → `9d13bd16` | | `workbench.py:746`, `session_documents` | `doc_health.corpus` | T025, the registered adapter's `list_documents` | #43 → `c46430fb` | | `workbench.py:1407`, `:1408`, `:1409`, `run_scoped_doc_health` | `doc_health`, `.families`, `.runner` | T026, the health-check seam | #39 → `582ed073` | | `serve_wire.py:1369`, `default_doxbench_validators` | `ideation_dashboard.doxbench_contracts` | T027, the doxBench validator seam | #41 → `8017cd52` | | `doxbench_packet.py:177`, `_status_exemption` | `ideation_dashboard.doxbench_status_exemption` | T027, the status-exemption seam | #41 → `8017cd52` | **Deferred: 19 reaches, all into `openxdox`, each inside a function body.** Each is routed no later than the phase whose surface calls it (research R5, the release map). openXdox-code's `OPENDOX_BACK_IMPORTS` ratchet counts them by module: `branch_session` 7, `serve_workbench` 7, `serve` 2, `serve_project` 2, `cli` 1. | reach at `796838e8` | target | inside | reason it stays, and who routes it | |---|---|---|---| | `branch_session.py:1568` | `openxdox.generator` | `_change_rows` | the snapshot generator is openXdox's column; phase 2, T055 (5.4/5.5) | | `branch_session.py:1587` | `openxdox.register` | `_active_pick_fallbacks` | the cross-reference register; phase 3, T084 | | `branch_session.py:2005` | `openxdox.kickoff` | `proposal_state_for` | the kickoff column; phase 3, T084 | | `branch_session.py:2105`, `:2151`, `:2228`, `:3573` | `openxdox.snapshot_registry` | `session_entry`, `register_session_entry`, `refresh_session_snapshot`, `refresh_main_view` | the snapshot registry; phase 2, T055 | | `cli.py:628` | `openxdox.snapshot_registry` | `_session_registry` | the snapshot registry; phase 2, T055 | | `serve.py:648` | `openxdox.corpus_root` | `_checkout_real`, called by every `build_server` | the corpus-root predicate; phase 2, T055 (research R7) | | `serve.py:2118` | `openxdox.corpus_root` | `_refuse_impossible_checkout_root`, called by `serve.main()` | the corpus-root predicate; phase 2, T055 | | `serve_project.py:246`, `:247` | `openxdox.gate_console`, `openxdox.kickoff` | `_serve_project_register` | the gate console and kickoff; phase 3, T084 | | `serve_workbench.py:347`, `:544`, `:1665`, `:2607` | `openxdox.doxbench_scope` | `_is_live_session_ref`, `_handle_workbench_thread`, `_handle_workbench_chat_turn`, `_handle_workbench_document_abstract` | doxBench scope; phase 3, T084 | | `serve_workbench.py:407`, `:408` | `openxdox.gate_console`, `openxdox.gate_routes` | `_thread_gate` | the gate column; phase 3, T084 | | `serve_workbench.py:1215` | `openxdox.gate_console` | `_handle_workbench_model_approval` | the gate column; phase 3, T084 | The line numbers moved since research R5 (`cli.py:610` → `:628`, `serve.py:629` → `:648`, `serve.py:1993` → `:2118`), with the code that phase 1, T022 and T038 added. The reaches and their functions did not. **The late seam, which the scan cannot read.** `consumer_reach.py` holds seven `module(...)` stand-ins (`gate_console`, `snapshot`, `snapshot_registry`, `corpus_root`, `generator`, `serve_projection`, `serve_gate`). Each resolves `openxdox.<name>` at first use. `module()` refuses a prefixed name, so no stand-in can name another package. Research R6's census is unchanged: 65 use sites, in `serve.py` 22, `branch_session.py` 20, `cli.py` 18, `serve_workbench.py` 4 and `workbench.py` 1. They are deferred too, into `openxdox` alone, and T084 retires the module. **Prose, not import position.** `git grep -w` finds each name in `src/` beyond these: `ideation_dashboard` on 44 lines, `doc_health` on 25, `corpus_adapter_openxfactory` on 2, and the rest of `openxdox`'s 57. Every one of them outside the table above is a comment, a docstring or a string. Several docstrings still describe the pre-carve layout. `serve_project.py:30`, `serve_wire.py:80`, `serve_workbench.py:33` and `doxbench_scope_types.py:40` say *"this module uses ABSOLUTE `ideation_dashboard.*` imports"*. None of them is a reach. They sit in carved files with other writers, so this PR leaves them. A later edit to each file can correct its sentence. ## What changes **`tests/test_reach_sweep.py`**, a new file, so the sweep's result is held and not only recorded here. It parses `src/` whole, the two top-level extension modules included, as F4.1 parses the package, and it asserts four things: 1. no reach into any of the four runs at import time; 2. no reach of any kind names `ideation_dashboard`, `doc_health` or `corpus_adapter_openxfactory`, in either spelling (the pre-carve `scripts.` one too), the phase-1 cut of 4.3; 3. every reach left is deferred and into `openxdox`, the positive form of F4.1 "lists only `openxdox` targets"; 4. no code under `src/` spells an openxFactory package's name at all. That means no string or bytes literal outside documentation, because every import needs the name, however the importer is reached. **It does not pin the count of 19.** openXdox-code's ratchet already counts those reaches, and each one that T055 or T084 routes simply stops being one. So no later task has to edit this file when a reach closes. A reach may not come back at import time, and none may go into openxFactory. No instrument watched that direction (#1144 task 9.2a), and `tests/test_imports_standalone.py` proves only its import-time half, where no sibling is installed. On this tree, the sweep itself finds exactly F4.1's 19, all `openxdox` and all deferred. **How it reads a module.** It reads by syntax, not by grep. Prose names the four packages on purpose. - **Statements.** Import statements, including `from a import b`'s members as the submodules they may be (`from scripts import doc_health`). A star member is named too. - **Calls.** `import_module` and `__import__` calls with a literal name, by position, as `name=`, or spelled out of a literal `*[...]`/`**{...}`, and under an import alias. - **Relative names.** They are resolved against a literal `package`. `__import__` resolves against its `globals`: `globals()` is the module's own, and a literal `{"__package__": ...}` resolves. `__import__`'s literal `fromlist` also counts. - **A module that holds an importer as a value** (assigns, passes, stores it, or looks it up by name) is read strictly. Every call with a literal module name counts there, read as either importer, since it may be bound to either. - **Refused as UNREADABLE:** a call whose module a spread hides; a relative call whose package or context is unknown; a relative call that leans on `globals()` or `__package__` in a module that rebinds them; a `fromlist` that is not a literal; and a star import, in either form, from a package a sibling lives under (`from scripts import *`). A star from `os` names nothing. - **Not refused:** a computed name, which is how `consumer_reach`'s seam imports. - **Timing.** Where position and run time part (`TYPE_CHECKING`, postponed annotations, a generator), it reads position, the stricter reading. PEP 695's lazy positions are read as deferred. - **What it is not.** It is a regression guard for the code this repository writes, not a sandbox. A name built from pieces at run time is review's to hold, and at import time the runtime sweeps (`test_imports_standalone.py`, `test_consumer_reach.py`) hold it too. **`tests/import_scan.py`**, the shared reader, which exists so that no direction check keeps its own copy of the extraction. The node reader `names_imported_by` and its helpers live there, and `imported_modules` reads with it. Every new behaviour is opt-in, so `imported_modules`' output, `bound_names`', and `string_literals`' default output are identical to `main`'s reader over every parsed file in this repository: 141 files, 1524 imports, 0 differ. The three callers of `imported_modules` give the same result with and without the edit. ## The falsifier: F4.1's scan, which lists only `openxdox` targets `scan_deferred_reaches.py`, research.md's appendix, persisted in opensoft/brett-wip. Its sha256 is `fe11620319b02c23dd9a014bc581e1f4867f013f3c26890d43b12dccce5530a0`, which matches the digest `evidence/remeasure-2026-09-25.md` records. Run from this head, `python3 scan_deferred_reaches.py src/opendox`: ``` src/opendox/branch_session.py:1568: openxdox [in _change_rows] src/opendox/branch_session.py:1587: openxdox.register [in _active_pick_fallbacks] src/opendox/branch_session.py:2005: openxdox [in proposal_state_for] src/opendox/branch_session.py:2105: openxdox.snapshot_registry [in session_entry] src/opendox/branch_session.py:2151: openxdox.snapshot_registry [in register_session_entry] src/opendox/branch_session.py:2228: openxdox.snapshot_registry [in refresh_session_snapshot] src/opendox/branch_session.py:3573: openxdox.snapshot_registry [in refresh_main_view] src/opendox/cli.py:628: openxdox.snapshot_registry [in _session_registry] src/opendox/serve.py:648: openxdox.corpus_root [in _checkout_real] src/opendox/serve.py:2118: openxdox.corpus_root [in _refuse_impossible_checkout_root] src/opendox/serve_project.py:246: openxdox.gate_console [in _serve_project_register] src/opendox/serve_project.py:247: openxdox.kickoff [in _serve_project_register] src/opendox/serve_workbench.py:347: openxdox [in _is_live_session_ref] src/opendox/serve_workbench.py:407: openxdox [in _thread_gate] src/opendox/serve_workbench.py:408: openxdox [in _thread_gate] src/opendox/serve_workbench.py:544: openxdox [in _handle_workbench_thread] src/opendox/serve_workbench.py:1215: openxdox [in _handle_workbench_model_approval] src/opendox/serve_workbench.py:1665: openxdox [in _handle_workbench_chat_turn] src/opendox/serve_workbench.py:2607: openxdox [in _handle_workbench_document_abstract] 19 deferred reaches ``` Every target is `openxdox`. At `1e4a57fb` the same tool printed 27, eight of them into openxFactory. F4.1 WHOLE, *"no deferred reach names the consumer or the publisher"*, is T089's, after T084 routes the last 19 and retires `consumer_reach.py`. **The new test.** `python -m pytest -q tests/test_reach_sweep.py` at this head gives `35 passed`, with the root conftest and under `--noconftest`. The same file, with this head's `tests/import_scan.py`, run over `1e4a57fb`'s tree fails the three reach assertions: ``` AssertionError: 2 reach(es) into a sibling run at IMPORT time, so the module cannot be imported without it (#1144 task 2.1's defect): src/opendox/serve.py:199: ideation_dashboard (AT IMPORT TIME, in <module>); src/opendox/serve.py:206: ideation_dashboard.serve_openxfactory_lanes (AT IMPORT TIME, in <module>) AssertionError: 10 reach(es) into openxFactory, which openDox can never install (#1144 task 4.3's phase-1 cut), or imports the source does not spell out (behind a spread, a star, or a context that is not a literal), which could be: src/opendox/authoring.py:318: corpus_adapter_openxfactory (deferred, in _classify_proposal); … 3 failed, 32 passed ``` **83 mutations, and each fails its assertion.** Each is a copy of this tree with one change. Roughly a third plant a reach in `src/`, and the rest weaken the reader or the sweep. The list is in the review record below, and the spec is kept with the slice's tools. Every finding in the review record was also planted at the head it was raised on, where it passed, before its fix. ## The repository's own check `.github/workflows/validate.yml`'s three report-producing pytest steps, run as the file writes them, and summed as `Pin the triple` sums them. The venv was Python 3.12.3 with `-c constraints-cpython312-linux.txt -e ".[test]"`: ``` triple: selected=1155 passed=1152 skipped=3 failures=0 errors=0 pins: selected>=1114 (margin 41) passed>=1111 (margin 41) skipped==3 ``` This matches `main`. The new file is not on the workflow's list, and neither is any caller of `tests/import_scan.py`. T036 owns `validate.yml` and makes the whole suite the required run. **The whole suite, with the root conftest**, in the same venv: `main` `796838e8` gives `19 failed, 1454 passed, 13 skipped, 66 errors`, and this head gives `19 failed, 1489 passed, 13 skipped, 66 errors`. A test-by-test JUnit diff shows no changed outcome, nothing gone, and 35 new cases, all this file's and all passing. The 85 red cases are research R3's nine files and T030's `.[test]`-only case. T034 repairs the nine. ## Review record (Copilot) There were eighteen threads over fifteen rounds, plus four findings raised without a thread. Every thread is answered with its evidence and resolved. Copilot's review at `19b0ecc2` recommends approval, with no findings. Every finding was a way to reach a sibling that the reader did not follow. Each was planted at the head it was raised on, where it passed, and it fails since its fix. | round, at | finding | fixed in | |---|---|---| | 1, `61b308ed` | `import_module(name=...)`; PEP 695 type parameters; one shared reader | `ae82e2b5` | | 2, `ae82e2b5` | an import alias of `import_module` | `eece371e` | | 3, `eece371e` | a relative `import_module` against a literal `package` | `9862669f` | | 4, `9862669f` | "matched by the name it spells" (docstring) | `ab022702` | | 5, `ab022702` | a destructured alias; a lawful consumer case | `d9d3f3f9` (a module holding an importer as a value is read strictly) | | 6, `d9d3f3f9` | literal `*[...]` and `**{...}` | `981fce65` | | 7, `5270acf0` | nested literal spreads | `e6bd5ef5` (UNREADABLE for any other spread) | | 8, `e6bd5ef5` | an alias looked up by name; a keyword an unreadable entry overwrites | `4b0cb725` | | 9–10, `4b0cb725`, `aa92f71a` | a bound package; custom `globals` | `aa92f71a` (the spelling check), `6cf729ef`, `c3283e55` | | 11, `6cf729ef` | the `scripts.` spelling; the full-name match; a concatenated lookup key | `c3283e55` | | 12, `c3283e55` | a shadowed `globals`; a rebound `__package__` | `1fdd7fbb` | | 13, `1fdd7fbb` | `from scripts import doc_health` | `a5a7f745` | | 14, `a5a7f745` | `__import__`'s `fromlist` | `0f7af1a1` | | 15, `0f7af1a1` | a star import from `scripts`; with it, found in measuring, a strict module's calls read by one importer's rule only | `19b0ecc2`; `b53b9db2` names UNREADABLE for each case it stands for | ## Landing - T022 (#45) and T038 (#48) have landed, and `main` `796838e8` is merged in. Everything above was re-run at this head. - T034 comes after it: T034 re-derives `tests/test_consumer_reach.py`'s record against this sweep. - Squash or merge, never rebase. Each commit message 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>




Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Plan 034, slice P1-E, task T025. The plan is
specs/034-opendox-standalone-operation/tasks.mdin opensoft/openxFactory. I read it at #1167's head42f34ab7, which landed asa65230f6, and it is unchanged onmainat79a720a2. The claim is opensoft/openXfactory#656 comment5850107036.Realizes: 4.3, 1 of its 8 reaches into openxFactory.
Ruled: R1Q9 (a) and R1Q22 (a), comment
5817152735.After: both dependencies are on
main.e295b1a9.workbench.pyedit: T026: the health-check seam -- run_scoped_doc_health resolves the registered check (workbench.py:1407-1409) #39, landed as582ed073.This branch was cut from
mainat582ed073and mergesmainata435aecf(T015), so it carries both.What it does
workbench.session_documentsimported openxFactory'sdoc_health.corpusinside its body and applied that corpus's own membership rule, its governed roots plus a declaredStatus:header (workbench.py:746at1e4a57fb). That was the last ofworkbench.py's four reaches into the publisher.Membership comes from the registered home corpus. The function calls the factory that
corpus_adapter.home()hands back (T020) on the worktree. Its adapter lists that corpus under the scope a host registered, or underall, openDox's default, where none is registered.opendox.workbench.register_session_notebook_scope(scope), in the same one-registration idiom as T026. The same name again (compared by value) does nothing, a different name is refused,unregister_session_notebook_scope()resets it, andsession_notebook_scope()reads it.documentsscope (T046). At openxFactoryc415c3d1that scope lists exactly the notebook's 398 documents, wherealllists 794 (T006).Refusals. With no home corpus registered, the function refuses as 4.2 does:
CorpusRefusedof kindADAPTER_NOT_REGISTERED, naming the seam andregister_home. A scope the resolved corpus does not declare refusesSCOPE_UNKNOWNbefore anything is listed, and is never widened toall.branch_session.open_session_notebookturns either refusal into the FR-042 notice, so a notebook never blocks a session.The bytes are the corpus's. Each listed document is read through the same adapter (
adapter.read), never by opening<worktree>/<key>, because aDocumentId.keyis opaque.corpus_adapter.DocumentIdsays a consumer "may compare it, sort it and hand it back, and may not parse it". So the function takes no snapshot of its own, and the notebook carries what the corpus serves at the worktree.LocalGitCorpusserves the worktree'sHEADinstead (see T022 below).Copilot's review raised this, and the thread is answered with evidence.
The text is unchanged. Each document is decoded as the reader this replaced read it:
Path.read_text(encoding="utf-8", errors="replace"), which means UTF-8 with replacement characters and universal newlines. The size bound is measured the same way. So no source's text, and no content hash its re-sync is diffed by, moves.repositoryis still accepted for the two callers that pass it:branch_session._session_notebook_documents, and openxFactory'ssync-notebooklm-books.py. The registered factory names its own corpus, so the argument no longer selects anything.Files:
src/opendox/workbench.py, and a newtests/test_session_notebook_membership.py.validate.ymlis not touched, because no slice edits it before T036.Falsifier 1: F4.1's scan
This is #1144's Group 4
FALSIFIED BYast block, run from the checkout aspython3 - src/opendox. The whole scan stays red until T089. This task's hit is gone,workbench.pyappears nowhere in the list, and nothing else moved:At
mainthe scan finds24 deferred reach(es). At this head it finds23 deferred reach(es), listed here:(T027, openDox-code#41, removes
serve_wire.py:1369anddoxbench_packet.py:177separately.)Falsifier 2: the session-notebook membership test
The test is
tests/test_session_notebook_membership.py. The two membership cases the plan names:test_with_only_the_default_registered_the_notebook_lists_all: with only a factory over openDox'sLocalGitCorpusregistered, as T022's entry points will register it, over a real git repository, the notebook listsall. That includes a document with noStatus:header and a non-Markdown file, because openDox's default carries no host rule.test_a_registered_scope_is_the_one_the_notebook_lists: withdocumentsregistered over a two-scope stand-in, the notebook lists that scope and nothing else.Two more cases pin whose bytes the notebook carries:
test_the_notebook_carries_what_the_corpus_serves_at_the_worktreeuses a real git worktree holding an uncommitted edit and an untracked draft.LocalGitCorpusservesHEAD.test_a_key_is_handed_back_and_never_openeduses row-id keys over an empty worktree, and they are read in full.A mutant that opens
<worktree>/<key>in place of the adapter's read fails 14 of the file's 29 cases, both of these among them.The run is in a fresh venv with
pip install ".[test]". It first asserts that the four siblings are absent:Red at
main. With the same file copied ontoa435aecf, the run gives28 failed, 1 passed. The decisive failures:The first is the 4.2 case:
mainraises a module-not-found error from inside the function, which is the failure requirement 5 retires. The case that passes atmainis the negative control.Why
--noconftest. The plan requires it (tasks.md § Phase 1). With the root conftest in play, the file errors 29 times onModuleNotFoundError: No module named 'ideation_dashboard'. The autousedeclared_human_consolefixture raises it when it importsopendox.cli, and it stops once T011 lands. With the Group 2 shim on the path, which simulates T011, the whole suite runs with the root conftest, and these 29 cases pass there.The repository's own checks
validate, replayed locally. Its three pytest steps give the same results asmain:pytest745 passed, 2 skippedpytest (S7 residue)13 passedpytest (runtime, hermetic)360 passed, 1 skippedThe triple is unchanged: selected 1121, passed 1118, skipped 3. The new file is in none of
validate's lists, so it moves no floor. The CIvalidatecheck on this PR is the gate.The whole suite, with the Group 2 shim:
maina435aecf20 failed, 1258 passed, 13 skipped, 66 errors20 failed, 1287 passed, 13 skipped, 66 errorsI compared the two JUnit reports test by test. No outcome changed. The 86 red results are the same 86, and the 29 new cases pass.
For the tasks downstream
T046 (P1-K). The host makes both registrations once, in its process-start call (
scripts/opendox_host.register_openxfactory()):scripts/sync-notebooklm-books.py:2091callswb.session_documents(...)for--session-ref, so that script's process needs the same registration.home_corpusitself, which builds a fresh adapter on every call.OpenxFactoryCorpusAdaptercaches each listing per(location, revision, scope)for as long as the instance lives, and an uncommitted add does not moveHEAD. So a factory that returned one shared adapter would give a re-sync a stale listing.documentsscope has noStatus:filter of its own; the rule it replaces had one. Atc415c3d1every governed document carries aStatus:header, so the two sets are equal (T006:load_docsgives 398, anddocumentslists 398). T046's proof that the hosted notebook is unchanged has to hold that equality, or register a scope that carries the filter.T022 (P1-D). Once an entry point registers the
LocalGitCorpusfactory, the standalone notebook listsall: every blob at the worktree'sHEAD, read atHEAD, becauseLocalGitCorpusreads a repository through its history. The host's adapter reads the working tree instead.T035 (P1-G).
tests/test_hermeticity.py::test_the_violation_survives_open_session_notebooks_degradation_clausecallsbs.open_session_notebook(wb.NotebookAdapter(), ...)directly.ADAPTER_NOT_REGISTERED, which is swallowed into the FR-042 notice, and never reaches the runner.conftest.py'scollect_ignoretoday, so no run shows this. Run by path with the Group 2 shim, the module fails the same 14 cases atmaina435aecfand at this head.tests/integration/. Copilot's overview at5b4c8774raised this, and comment5851370880answers it.Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
🤖 Generated with Claude Code
Summary by Sourcery
Decouple session notebook document membership from openxFactory by resolving documents through the registered home corpus and scope.
New Features:
allscope.Bug Fixes:
doc_healthpackage.Enhancements:
Tests: