Skip to content

Prose: the validate-docs.sh citations name a consumer that moved to codexFactory and no longer runs this tree - #403

Merged
brettheap merged 3 commits into
mainfrom
docs/stale-validate-docs-citations
Aug 27, 2026
Merged

brettheap merged 3 commits into
mainfrom
docs/stale-validate-docs-citations

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

What

scripts/validate-docs.sh does not exist in openxFactory. It lives in codexFactory (opensoft/codexFactory, still present at that repo's main), where it still runs codexFactory's own test tree through python3 -m pytest and falls back to python3 -m unittest discover when pytest is unavailable. Since the doc-health tooling relocated to openxFactory (adopt-neutral-tooling-home, archived 2026-08-05 — see openspec/changes/archive/2026-08-05-adopt-neutral-tooling-home/), that script stopped running openxFactory's tests/ directory at all — it only calls openxFactory validator scripts against this repo.

Seven files in this repo still cited scripts/validate-docs.sh as if it were a current consumer of openxFactory's tests/. The historical measurements those citations attach to (PR #49 review finding 17: the tests/notebooklm/conftest.py hijack breaking 18 doc-health modules' from conftest import FakeGit; the unittest-fallback probe reaching a real-binary stand-in twice) are real and unchanged — they were made in codexFactory's script before the relocation. Only the attribution had gone stale.

The live pytest consumer of tests/ today is .github/workflows/pytest-suite.yml — python3 -m pytest tests/ -q -m "not postgres" — a required check on main.

tests/hermetic_unittest.py (the guarded unittest discover runner) is not invoked by any gate, workflow, or script in this repository today (git grep -n hermetic_unittest and a grep of .github/workflows/ for unittest both confirm no consumer besides the module's own usage docstring and the test that exercises it directly). It is retained as the guarded runner for any pytest-less host that runs this tree directly.

Changed

  • pytest.ini:19-21 — attributes the doc-health hijack measurement to codexFactory's scripts/validate-docs.sh, noting it ran this tree's tests before the relocation and runs only codexFactory's own tree now.
  • tests/conftest.py:6-8 — names the current consumer, .github/workflows/pytest-suite.yml's required python3 -m pytest tests/, instead of scripts/validate-docs.sh.
  • tests/hermeticity.py:65-73, 90-93, 168-171 — reattributes the residue-2 measurement to codexFactory's script pre-relocation; states plainly that no gate in this repository currently takes the unittest-discover route.
  • tests/hermetic_unittest.py:1-24 — module docstring reattributes the citation and rewords "the gate invokes THIS" to state no gate in this repository currently does, naming pytest-suite.yml as the live tests/ consumer.
  • tests/ideation-dashboard/test_hermeticity.py:293-295, 366-373 — same reattribution in two docstrings.
  • tests/notebooklm/test_hermeticity_guard.py:9-16 — same reattribution; drops the "guarded runner the gate now uses" claim.
  • tests/notebooklm/test_workbench_sweep_wiring.py:13-17 — same reattribution.

No code changed — comments and docstrings only. Everything under openspec/changes/archive/, docs/domain-neutralization-candidate-register.md, examples/pre-run-simulations/codex.yaml, ideation/, scripts/doc_health/preflight.py, scripts/ideation_dashboard/gate_routes.py, tests/conformance-gate/test_conformance_checks.py, and specs/ were left untouched, as was the conftest flat-slot hazard prose beyond the validate-docs.sh clause itself (parallel branch for #305).

Test plan

Run separately, per issue #305's order-dependence note (never two test directories in one pytest invocation):

  • python3 -m pytest tests/ideation-dashboard/test_hermeticity.py -q → 24 passed
  • python3 -m pytest tests/notebooklm -q → 149 passed, 24 subtests passed

Also smoke-ran python3 tests/hermetic_unittest.py tests/notebooklm/ directly (149 tests, OK) to confirm the reworded module still executes correctly.

Closes #306

🤖 Generated with Claude Code

…h relocation

pytest.ini, tests/conftest.py, tests/hermeticity.py, tests/hermetic_unittest.py,
tests/ideation-dashboard/test_hermeticity.py, tests/notebooklm/test_hermeticity_guard.py,
and tests/notebooklm/test_workbench_sweep_wiring.py cited codexFactory's
scripts/validate-docs.sh as a current consumer of this repo's pytest/unittest
routes. Since adopt-neutral-tooling-home (archived 2026-08-05) relocated the
doc-health tooling to openxFactory, that script only runs codexFactory's own
test tree; it stopped running openxFactory's tests/. The historical PR #49
review finding 17 measurements it cites are unchanged and still real — they
were made in codexFactory's script before the relocation.

Reworded each citation to either name the current consumer
(.github/workflows/pytest-suite.yml's required
`python3 -m pytest tests/ -q -m "not postgres"`) or mark the measurement
historical. Also worded the "third route" (unittest discover fallback) prose
honestly: no gate in this repository currently invokes
tests/hermetic_unittest.py — it is retained as the guarded runner for any
pytest-less host that runs this tree directly. No code changed, only
comments and docstrings.

Closes #306

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 27, 2026 03:10

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

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

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.

Pull request overview

This PR updates internal documentation (docstrings/comments) to correct stale references to scripts/validate-docs.sh as a consumer of this repository’s tests/, reattributing historical measurements to codexFactory and naming the current in-repo CI consumer.

Changes:

  • Reattributes historical validate-docs.sh-based measurements to codexFactory and marks them as pre–doc-health relocation.
  • Updates prose to identify .github/workflows/pytest-suite.yml as the current required pytest consumer of tests/.
  • Clarifies that no gate in this repository currently takes the unittest discover route, while retaining tests/hermetic_unittest.py for pytest-less hosts.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pytest.ini Updates the rootdir-anchor rationale comment to attribute the historical breakage to codexFactory’s scripts/validate-docs.sh.
tests/conftest.py Updates the suite-wide conftest docstring to cite the current CI consumer (pytest-suite workflow).
tests/hermeticity.py Reattributes the historical unittest-fallback measurement to codexFactory and clarifies there is no in-repo gate using unittest fallback.
tests/hermetic_unittest.py Updates module docstring to reflect that no in-repo gate invokes it today; keeps it as a pytest-less host runner.
tests/ideation-dashboard/test_hermeticity.py Updates docstrings to reattribute historical findings to codexFactory and document the current reality.
tests/notebooklm/test_hermeticity_guard.py Updates docstring to reattribute the unittest-discover fallback history and remove “gate now uses” phrasing.
tests/notebooklm/test_workbench_sweep_wiring.py Updates docstring to reattribute unittest-discover fallback history to codexFactory and clarify current usage.

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

Comment thread tests/conftest.py Outdated
Comment on lines +7 to +8
including `.github/workflows/pytest-suite.yml`'s required
`python3 -m pytest tests/`. Directories that have their OWN conftest.py
…fix and relocation dates

Adversarial review of PR #403 found four blockers in the prior pass:

- tests/hermetic_unittest.py stated in the present tense that codexFactory's
  scripts/validate-docs.sh "falls back to python3 -m unittest discover" —
  false since codexFactory commit 5a22cb7 (PR #49 finding 17's fix,
  2026-07-27), which switched that fallback to codexFactory's own copy of
  this guarded runner. Reworded to past tense, anchored on the fix.
- Two other files anchored the bare-unittest-fallback measurement on the
  doc-health relocation (2026-08-03) instead of the fix (2026-07-27), a week
  earlier — the wrong event entirely. Re-anchored on the fix; kept the
  relocation date only where it explains why the script stopped running
  these tests at all.
- Several citations read as if codexFactory's script reaches into
  openxFactory's tree ("ran this tree's tests"), which is backwards and also
  wrong for tests/ideation-dashboard/, never covered by that script at all.
  Reworded to "ran these tests when they lived in codexFactory, before the
  doc-health relocation" everywhere, with the full
  adopt-neutral-tooling-home (ratified 2026-08-03; archived 2026-08-05)
  citation on first use per file.
- The hermetic_unittest.py usage example cited tests/review-lane/, which
  does not exist in openxFactory. Replaced with tests/notebooklm/ and
  tests/proposal-support/, both verified to discover and pass under this
  runner.

Also folded in the reviewer's cheap nits: merged a double parenthetical into
one clause, split a triple-em-dash sentence, gave a dangling clause an
explicit subject, quoted the pytest-suite.yml command identically everywhere
it's cited, stopped calling tests/hermetic_unittest.py itself a "fallback",
and stopped implying codexFactory's own guarded unittest route ended at the
relocation (it didn't — only its reach into this tree did).

python3 -m pytest tests/ideation-dashboard/test_hermeticity.py -q: 24 passed
python3 -m pytest tests/notebooklm -q: 149 passed, 24 subtests passed
python3 tests/hermetic_unittest.py tests/notebooklm/ tests/proposal-support/: OK (149 + 36 tests)

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 27, 2026 03:27

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.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

…ssues

Re-verification of PR #403's fixes found no blockers, but six precision nits:

- N1 (the important one): "codexFactory's own copy of this guarded runner"
  had the provenance backwards at 5 sites. codexFactory created the ORIGINAL
  on 2026-07-27 (commit 5a22cb7); this repo's tests/hermetic_unittest.py is
  the COPY, adopted 2026-08-03 from codexFactory main@e4caa03b. Reworded all
  5 sites to "its own guarded runner (the original this file was later
  copied from)" or equivalent, and made sure no site ties this file's
  existence to the 2026-07-27 fix date.
- N2: "these tests" was globally scoped in the two module docstrings
  (tests/hermetic_unittest.py, tests/hermeticity.py) where codexFactory's
  script only ever ran the doc-health and notebooklm suites among what's
  here now. Named them instead of overclaiming.
- N3: "(measured; adopt-neutral-tooling-home, 2026-08-03)" in
  tests/hermeticity.py made the relocation date read as the measurement.
  Moved "measured" back onto the conftest-hijack breakage clause.
- N4: verified the two bare "2026-08-03" sites (tests/hermeticity.py,
  test_hermeticity.py) both come after the full "ratified ...; archived ..."
  form earlier in the same file — already consistent, no change needed.
- N5: dropped a comma in test_hermeticity.py so "pytest was unavailable"
  reads as a condition, not a second clause.
- N6: restructured test_hermeticity.py's conftest-hijack sentence to avoid
  ending on a nested "))" .

python3 -m pytest tests/ideation-dashboard/test_hermeticity.py -q: 24 passed
python3 -m pytest tests/notebooklm -q: 149 passed, 24 subtests passed

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 27, 2026 03:36

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.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment on lines +10 to +13
`python3 -m unittest discover` when pytest was unavailable; it now falls back
instead to its own guarded runner
(`python3 tests/hermetic_unittest.py tests/review-lane/`) — the original this
file was later copied from, at that same relocation. That bare fallback was
@brettheap
brettheap merged commit ef79163 into main Aug 27, 2026
3 checks passed
brettheap pushed a commit that referenced this pull request Aug 27, 2026
…lisions, pin the real invocation

Adversarial review of #406. Five findings, all closed.

The three prose edits deferred until #403 landed are applied on top of its
wording, leaving its validate-docs.sh sentences byte-identical: the hazard is now
stated as what an UNCLAIMING conftest does.

NIT-1 (the one that could break a run). The precondition keyed on
`namespace["__name__"] != "conftest"`, but under `--import-mode=importlib` or
`consider_namespace_packages=true` — both reachable through PYTEST_ADDOPTS —
pytest names a ROOTLESS conftest `a.conftest` (measured). The guard would have
raised inside conftest collection, aborting the whole run at rc=4 with the FR-043
guard never registered, over a configuration that merely renames modules; main
only collected with errors. It now keys on the conftest directory's missing
`__init__.py`, which is the actual condition for contending for the flat slot. A
real package still raises. Pinned both ways.

NIT-2. The two hooks were written into `globals()` by plain assignment, so a
conftest defining its own `pytest_collectstart` silently defeated the claim in
either order. The helper now returns the hook pair and refuses if either name is
already bound, with a message saying to call the returned function from inside
your own implementation; the define-it-afterwards direction, which no runtime
check can see, is pinned by source against HOOKS_INSTALLED_BY_THE_CLAIM.

The reviewer's real worry: the claim on the shipped conftests was pinned only by
a text grep. `test_the_real_two_directory_invocation_collects_the_same_in_either_order`
now runs the real `pytest --co` over two directory PAIRS, both orders, and
requires the orders to agree — 11.06s, four child collections. Dropping the claim
from doc-health's or ideation-dashboard's conftest reds it (measured);
avatar_runtime's is not observable, since nothing there imports through
`conftest`, and the docstring says so rather than implying coverage it lacks.

NIT-3. "the seven directories that have none" was wrong: measured 2026-08-27, 18
test-bearing directories, 13 with no conftest of their own, 10 of those rootless.
The measurement command is in pytest.ini beside the number, and the pre-existing
"Seven of the nine" on line 11 is corrected the same way. The 184/27/993 counts
are now labelled as measured at f9457d6 and explained as pinning the DIFFERENCE
between two orders, which the behavioural test re-measures on the live tree.

Verification after merging origin/main (ef79163, #403):
tests/ideation-dashboard/test_hermeticity.py 31 passed; the fixed shape
`pytest tests/doc-health tests/avatar_runtime` 1017 passed (it aborted with 27
collection errors at base).

Co-Authored-By: Claude Opus 5 <[email protected]>
brettheap added a commit that referenced this pull request Aug 27, 2026
…n subtree (#305) (#406)

* Each directory conftest claims the ambient `conftest` slot for its own subtree

`conftest` is an ambient top-level module name with exactly one `sys.modules`
entry, and `_importconftest` deletes that entry before importing each rootless
conftest.py (`_pytest/config/__init__.py:753`). `_set_initial_conftests` loads
EVERY path argument's conftest before collection begins (`:615`), so with two
directory arguments the last one loaded owned the slot and the first argument's
~133 `from conftest import AS_OF, FakeGit, ...` sites read the wrong module:
`pytest tests/doc-health tests/avatar_runtime --collect-only` gave 184 collected
with 27 collection errors, the same two arguments swapped gave 993 clean.

`claim_conftest_slot(globals())` (tests/hermeticity.py, beside CONFTEST_HOOKUPS
because every directory conftest already imports that module) installs two hooks
into the calling conftest's namespace, both dispatched through the node's
path-scoped `ihook` (`_pytest/main.py:731`) so a directory's copy can never fire
for a sibling: `pytest_collectstart`, immediately before a Module imports
(`_pytest/runner.py:588`), and `pytest_runtest_setup`, before each test body
(`:241`) — the leg the seven run-time `from conftest import ...` sites need, and
which nothing in the suite covered before. All three rootless directory
conftests call it. `tests/conftest.py` must NOT: pluggy's LIFO hook order would
make its claim the last to run and clobber every directory's.

pytest.ini stays option-free (PR #49 finding 17, FR-043); no import site was
rewritten and no conftest.py added. After: every order collects 993 / 5475 /
5572 clean, `pytest tests/` 6976.

Pinned by four new tests in tests/ideation-dashboard/test_hermeticity.py,
written RED first, including a negative control that reproduces the collision in
a scratch tree without the claim. Both hook-deletion mutants die.

Closes #305

Co-Authored-By: Claude Opus 5 <[email protected]>

* Review round: key the claim's refusal on __init__.py, refuse hook collisions, pin the real invocation

Adversarial review of #406. Five findings, all closed.

The three prose edits deferred until #403 landed are applied on top of its
wording, leaving its validate-docs.sh sentences byte-identical: the hazard is now
stated as what an UNCLAIMING conftest does.

NIT-1 (the one that could break a run). The precondition keyed on
`namespace["__name__"] != "conftest"`, but under `--import-mode=importlib` or
`consider_namespace_packages=true` — both reachable through PYTEST_ADDOPTS —
pytest names a ROOTLESS conftest `a.conftest` (measured). The guard would have
raised inside conftest collection, aborting the whole run at rc=4 with the FR-043
guard never registered, over a configuration that merely renames modules; main
only collected with errors. It now keys on the conftest directory's missing
`__init__.py`, which is the actual condition for contending for the flat slot. A
real package still raises. Pinned both ways.

NIT-2. The two hooks were written into `globals()` by plain assignment, so a
conftest defining its own `pytest_collectstart` silently defeated the claim in
either order. The helper now returns the hook pair and refuses if either name is
already bound, with a message saying to call the returned function from inside
your own implementation; the define-it-afterwards direction, which no runtime
check can see, is pinned by source against HOOKS_INSTALLED_BY_THE_CLAIM.

The reviewer's real worry: the claim on the shipped conftests was pinned only by
a text grep. `test_the_real_two_directory_invocation_collects_the_same_in_either_order`
now runs the real `pytest --co` over two directory PAIRS, both orders, and
requires the orders to agree — 11.06s, four child collections. Dropping the claim
from doc-health's or ideation-dashboard's conftest reds it (measured);
avatar_runtime's is not observable, since nothing there imports through
`conftest`, and the docstring says so rather than implying coverage it lacks.

NIT-3. "the seven directories that have none" was wrong: measured 2026-08-27, 18
test-bearing directories, 13 with no conftest of their own, 10 of those rootless.
The measurement command is in pytest.ini beside the number, and the pre-existing
"Seven of the nine" on line 11 is corrected the same way. The 184/27/993 counts
are now labelled as measured at f9457d6 and explained as pinning the DIFFERENCE
between two orders, which the behavioural test re-measures on the live tree.

Verification after merging origin/main (ef79163, #403):
tests/ideation-dashboard/test_hermeticity.py 31 passed; the fixed shape
`pytest tests/doc-health tests/avatar_runtime` 1017 passed (it aborted with 27
collection errors at base).

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: brettheap <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
@brettheap
brettheap deleted the docs/stale-validate-docs-citations branch August 28, 2026 09:10
brettheap added a commit that referenced this pull request Aug 28, 2026
…e-docs.sh comment reattributed; 021 artifacts carry the #444 superseded-note (#471)

- docs/doc-health.md: "nineteen families" -> "twenty-two"; extend the
  disclosure sentence to name families 20-22 alongside the existing
  13-17/19 lineage gap; append one-sentence lineage notes for
  duplicate-packet (archived 2026-08-25-add-duplicate-packet-check),
  family-enumeration (archived 2026-08-27-add-family-enumeration-check),
  and modified-block-currency (archived
  2026-08-27-add-modified-block-currency-check, ADVISORY at launch, plus
  the fifth `unplaced` class from archived
  2026-08-28-add-unclassified-finding-class), each citing its canon
  requirement in openspec/specs/doc-health/spec.md.
- scripts/ideation_dashboard/gate_routes.py: reword the stale
  "validate-docs.sh" comment (that script lives in codexFactory and no
  longer runs this tree) using the same reattribution PR #403 already
  applied in pytest.ini / tests/hermeticity.py.
- specs/021-modified-block-currency-self-gate/: add a dated 2026-08-27
  (#444) note at the top of quickstart.md's WHEN THE GATE FAILS section
  and one line in tasks.md's Hand-off to F4 section, saying the
  composed-view rename was declared with a `Merged into` marker (not
  `Removed from canon by`) and the scenario-arm test was re-aimed to
  test_the_scenario_arm_reads_zero_since_the_rename_was_declared; the five
  pre-#444 sites (quickstart.md, plan.md, spec.md,
  contracts/self-gate-contract.md, pr-body.md) are left as history per
  precedent (PR #434).

Gates: python3 -m pytest tests/doc-health -q -k "proposal_origin or lifecycle or corpus" (71 passed); python3 -m pytest tests/ideation-dashboard/test_gate_routes.py -q (55 passed); OPENSPEC_TELEMETRY=0 openspec validate --all --strict (75 passed, 0 failed).

Co-authored-by: brettheap <[email protected]>
Co-authored-by: Claude Sonnet 5 <[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.

Stale prose: pytest.ini, tests/conftest.py, tests/hermeticity.py cite scripts/validate-docs.sh, which no longer exists

2 participants