Skip to content

§ 5.4 FLOOR PART 2 clause (d), openDox leg: pin the collection triple on the required check - #29

Merged
brettheap merged 3 commits into
mainfrom
floor2/pin-the-triple-opendox-leg
Sep 18, 2026
Merged

brettheap merged 3 commits into
mainfrom
floor2/pin-the-triple-opendox-leg

Conversation

@brettheap

@brettheap brettheap commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Sub-act under split-opendox-two-layer-product § 5.4's standing claim 5705086862; this PR's own CLAIMED note is 5736488087.

§ 5.4 FLOOR PART 2, clause (d) — the openDox LEG, and that leg only

The clause in its own words, from the ledger at openspec/changes/split-opendox-two-layer-product/tasks.md:2768-2775:

(d) PINNED BY TEST at each destination and in openxFactory (which under RULING DQ-1 includes the adapter's own tests), the way pytest-suite.yml already pins this repository's collection triple — SKIPPED exactly, SELECTED and PASSED as FLOORS, failures and errors zero. Per destination, never as one cross-repository equality: an equality pin on a sum goes RED on merge refs that add tests for reasons the candidate cannot fix, which is the deadlock class pytest-suite.yml already refuses by name.

That last sentence is why this is ONE leg in ONE repository and not a cross-repository sum.

Why it is takeable now

The ledger records the blocker in its own words at tasks.md:2843-2846: "clause (d)'s LEG half is BLOCKED on the BUILD arc (§ 3.5 / § 3.6). Both legs' validate.yml run a NAMED FILE LIST under --noconftest with no JUnit and no triple … openxFactory's half is already pinned."

Both of those boxes are now [x] — tasks.md:1237 (§ 3.5, #25 → aca94ecb) and :1259 (§ 3.6, #26 → 4f8ae01e). The named blocker is discharged for this leg.

What changes, and where

ONE file, .github/workflows/validate.yml, and only inside the required validate job. This file says why that boundary matters:

validate is this repository's one REQUIRED status check (openDox-code#2, "Enforce validate as a required status check") … So the required job stays hermetic and this one carries the dependencies

so the DB-backed runtime job is untouched — clause (d) pins the required check, not the directory-wide non-required run.

--junitxml=pytest-report-main.xml on the pytest step
--junitxml=pytest-report-s7.xml on pytest (S7 residue)
--junitxml=pytest-report-runtime.xml on pytest (runtime, hermetic)
Pin the triple a new final step in the same job, summing the three

Three reports and not one because the job runs pytest three times and a single --junitxml path would have each run overwrite the last.

Mirrors openxFactory/.github/workflows/pytest-suite.yml — :599 (the report), :671-672 (MIN_SELECTED / MIN_PASSED floors), :782 (EXPECT_SKIPPED, exact), :829 (the XML parse), :877-881 (the assertions).

The pin is measured on CI, not here

Two commits, deliberately. The first emits the reports and PRINTS the triple; the second turns that into the pin using the numbers from the first commit's own run, whose URL is recorded below. The reference implementation gives the reason this leg shares, in its own header: "THE PIN IS TAKEN FROM CI'S OWN RUN, NOT FROM A DEVELOPER MACHINE" — self-skip guards resolve differently on a runner than in a developer worktree, so a locally measured SKIPPED is knowably the wrong number to pin. Committing a guessed pin and correcting it would put a wrong number in the history of the file whose whole purpose is that its numbers are right.

Measuring run: 35397867526, job 105770720097 — green, and its Measure the triple step printed:

pytest-report-main.xml:    tests=714  skipped=2  failures=0  errors=0
pytest-report-s7.xml:      tests=13   skipped=0  failures=0  errors=0
pytest-report-runtime.xml: tests=349  skipped=1  failures=0  errors=0
TRIPLE selected=1076 passed=1073 skipped=3 failures=0 errors=0

So MIN_SELECTED: "1076", MIN_PASSED: "1073" as floors, EXPECT_SKIPPED: "3" exactly, failures and errors zero.

The step was proved, not assumed — its own script extracted from the YAML and run against fixtures in three states:

state result
the measured state exit 0
one report fails to appear exit 1, 3 errors, names the missing file
one collected test silently turns into a skip exit 1, skipped 4, pinned exactly 3

That middle row is a refusal a simpler step would have missed: three reports are summed, so a step that failed to write one would otherwise present two thirds of the suite as a smaller-but-passing sum. A missing report is its own refusal, not a smaller number.

The collect_ignore caveat, written into the step

This repository's root conftest.py carries a collect_ignore list of 7 entries — 6 awaiting the openXdox-code leg (they import openxdox.*) and 1 awaiting the BUILD arc (tests/test_session_harness.py). Ignored files never reach the JUnit report at all, so the floors and the exact SKIPPED are honest today; when those ignores lift, SELECTED and PASSED rise (floors may only rise) and SKIPPED moves with the reason, which is the referent's own documented procedure (pytest-suite.yml:800). That is recorded in the step's comment so the next reader does not have to rediscover it.

What this does NOT do

It does not tick § 5.4. The openXdox leg is still owed and is blocked on openXdox-code #23 @5b8e527a (§ 4.5a, tasks.md:1873); the box stays [ ] and its tick rides the packet bookkeeper's amendment. No byte of openspec/changes/split-opendox-two-layer-product/ is touched here. Follow-up: the openXdox leg, after #23.

Coordination

The § 3.5/§ 3.6 runtime actor has a follow-up owed on this same file (the S8544 pin around validate.yml:1195). This change is kept in its own step and takes git merge origin/main before READY if that lands first.

🤖 Generated with Claude Code

Summary by Sourcery

Pin the required validation check’s pytest collection triple to prevent silent test loss, unexpected skips, failures, and errors.

New Features:

  • Pin the required validation job’s aggregate pytest collection triple using CI-generated JUnit reports, with selected and passed floors, an exact skipped count, and zero failures or errors.

Enhancements:

  • Preserve separate reports for the job’s three pytest runs and reject missing reports or changes that violate the pinned collection metrics.

CI:

  • Add JUnit report generation and triple validation to the required validate workflow without changing the database-backed runtime job.

…triple

First of two commits. This one makes the required `validate` job's three
pytest invocations emit JUnit XML and prints the collection triple; the
PIN lands in the next commit of this same pull request, with the numbers
taken from THIS step's own CI run.

Two commits rather than one deliberately. The clause being satisfied is
about numbers being right; committing a pin whose values were guessed on
a developer machine and then corrected would put a wrong number in the
history of the file whose entire purpose is that its numbers are right.
The reference implementation says the same thing in its own words —
"THE PIN IS TAKEN FROM CI'S OWN RUN, NOT FROM A DEVELOPER MACHINE"
(openxFactory/.github/workflows/pytest-suite.yml) — and gives the reason
this leg shares: self-skip guards resolve differently on a runner than in
a developer worktree, so a locally measured SKIPPED is knowably the wrong
number to pin.

Three reports and not one, because the required job runs pytest three
times and a single `--junitxml` path would have each run overwrite the
last: `pytest-report-main.xml`, `pytest-report-s7.xml` and
`pytest-report-runtime.xml`, summed in the step. The DB-backed `runtime`
job is deliberately untouched — this file says `validate` is this
repository's one REQUIRED status check and that the DB-backed half lives
in its own job for that reason, and clause (d) pins the required check.

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

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

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

@sourcery-ai

sourcery-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR updates the required validate job to produce separate JUnit reports for its three pytest runs and adds a final, always-run CI measurement step that aggregates and prints the selected/passed/skipped/failure/error triple. It intentionally measures rather than pins values in this change, leaving the runtime job and specification ledger untouched.

Sequence diagram for CI collection triple measurement

sequenceDiagram
    participant CI as GitHub Actions validate
    participant Main as pytest main
    participant S7 as pytest S7 residue
    participant Runtime as pytest runtime hermetic
    participant Reports as JUnit XML reports
    participant Measure as Measure the triple

    CI->>Main: python -m pytest --junitxml=pytest-report-main.xml
    Main-->>Reports: write pytest-report-main.xml
    CI->>S7: python -m pytest --junitxml=pytest-report-s7.xml
    S7-->>Reports: write pytest-report-s7.xml
    CI->>Runtime: python -m pytest --junitxml=pytest-report-runtime.xml
    Runtime-->>Reports: write pytest-report-runtime.xml
    CI->>Measure: run if always()
    Measure->>Reports: parse available XML reports
    Measure->>Measure: aggregate selected, skipped, failures, errors
    Measure->>Measure: calculate passed
    Measure-->>CI: print collection triple
Loading

File-Level Changes

Change Details Files
Emit JUnit XML reports for all three pytest invocations in the required validation job.
  • Add distinct report paths to the main, S7 residue, and hermetic runtime pytest steps to prevent overwrites.
  • Preserve the existing test selections and hermetic execution boundaries.
.github/workflows/validate.yml
Add a CI-side measurement step that aggregates the collection triple across the three reports.
  • Parse and sum selected tests, skipped tests, failures, and errors from available JUnit suites.
  • Compute and print passed tests while allowing the measurement step to run after earlier failures.
  • Document that the measured values will be pinned in a follow-up commit from the same CI run.
.github/workflows/validate.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Missing reports can currently produce a misleading CI-derived pin.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds JUnit reporting and collection-triple measurement to the required validation job.

Changes:

  • Generates separate reports for three pytest runs.
  • Aggregates collection metrics for CI pinning.
File summaries
File Summary
.github/workflows/validate.yml Adds reporting and aggregation; must fail when an expected report is missing.
Review details

Suppressed comments (1)

.github/workflows/validate.yml:1825

  • This only prints the computed counts; it never asserts MIN_SELECTED/MIN_PASSED, the exact skipped count, or zero failures/errors. As currently shown, the required validate check therefore does not pin the collection triple and future collection drift can pass unnoticed. Add the CI-derived floor and exact-count assertions before treating clause (d) as implemented.
          print(f"TRIPLE selected={selected} passed={passed} "
                f"skipped={tot['skipped']} failures={tot['failures']} "
                f"errors={tot['errors']}")
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread .github/workflows/validate.yml Resolved
Second of two commits, and the pin itself. The values are CI's own, read
from the run the first commit produced — run 35397867526, job
105770720097, PR #29:

  pytest-report-main.xml     tests=714  skipped=2  failures=0  errors=0
  pytest-report-s7.xml       tests=13   skipped=0  failures=0  errors=0
  pytest-report-runtime.xml  tests=349  skipped=1  failures=0  errors=0
  TRIPLE  selected=1076  passed=1073  skipped=3  failures=0  errors=0

so MIN_SELECTED 1076 and MIN_PASSED 1073 as FLOORS, EXPECT_SKIPPED 3
EXACTLY, and failures and errors zero — the four the clause names, in the
clause's own order.

PER DESTINATION, NEVER A SUM. Clause (d) says so in as many words, and
gives the reason: "an equality pin on a sum goes RED on merge refs that
add tests for reasons the candidate cannot fix". This is openDox-code's
own triple in openDox-code's own file. openXdox's leg is its own pin,
owed after openXdox-code#23.

THE REFUSAL A SIMPLER VERSION WOULD HAVE MISSED. Three reports are
summed, so a step that fails to write one would present two thirds of the
suite as a smaller-but-passing sum. A missing report is therefore its own
refusal rather than a smaller number, and the script names which one.

PROVED, not assumed — the step's own script extracted from the YAML and
run against fixtures in three states:

  the measured state                     exit 0
  a report vanishes                      exit 1, 3 errors, names the file
  one collected test turns into a skip   exit 1, "skipped 4, pinned exactly 3"

THE collect_ignore CAVEAT IS IN THE STEP'S COMMENT, because it decides
what a future reader should do when this pin moves. The root conftest
ignores SEVEN files — six importing `openxdox.*` (awaiting the openXdox
leg) and `tests/test_session_harness.py` (awaiting the BUILD arc). An
ignored file is not collected, so it never reaches these reports: it is
invisible to all three numbers rather than counted as a skip. That makes
today's floors and exact SKIPPED honest, and says what happens when the
ignores lift — SELECTED and PASSED rise, which floors permit, and SKIPPED
moves, which is a pin edit WITH THE REASON and never a relaxation of the
comparison (the referent's own rule).

The DB-backed `runtime` job is untouched: this file states that
`validate` is the repository's one REQUIRED status check and that the
DB-backed half lives in its own job for that reason, and clause (d) pins
the required check.

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

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 18, 2026 21:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Add regression coverage and correct the collection caveat before approval.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

.github/workflows/validate.yml:1862

  • The aggregation and refusal logic is the core new behavior, but there is no checked-in test that executes it. The current CI run only exercises the all-reports-present path, so a future edit could break the missing-report handling or PASSED/SKIPPED arithmetic without this suite catching it; add a regression test covering the three fixture states described in the PR.
          python3 - <<'PY' > triple.env
          import xml.etree.ElementTree as ET, pathlib, sys
          REPORTS = ("pytest-report-main.xml", "pytest-report-s7.xml",
                     "pytest-report-runtime.xml")
          tot = {"tests": 0, "skipped": 0, "failures": 0, "errors": 0}
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread .github/workflows/validate.yml Resolved
… lists are not

Copilot was right and I was wrong. The caveat I wrote told a future
reader that `collect_ignore` lifting would move these numbers. It cannot,
on two independent grounds, either sufficient on its own:

  1. All THREE report-producing commands pass `--noconftest`, so the root
     `conftest.py` is never loaded and its `collect_ignore` is never
     evaluated. (The ledger says as much in its own description of both
     legs — "a NAMED FILE LIST under `--noconftest`" — and I read the
     folded YAML block's first lines and missed the trailing flag.)
  2. Every command names its files explicitly, 28 + 1 + 6 = 35, and NOT
     ONE of the seven `collect_ignore` entries is among them. Measured:
     the overlap is EMPTY.

So the openXdox leg landing cannot move SELECTED, PASSED or SKIPPED in
this job, and neither can the BUILD arc. A comment claiming otherwise
would send the next reader to the wrong file at the exact moment the pin
refuses — which is the moment the comment exists for.

What DOES move them, measured and now written down: editing one of the
three explicit lists. 35 files are named; 61 `test_*.py` exist under
`tests/` and `tests_runtime/`, so 26 are collected by no command here.
Adding one raises SELECTED and PASSED (floors permit a rise, and the
commit should raise them with its reason); removing one lowers them and
the floor refuses.

And the comment now says why SKIPPED is `==` where the others are `>=`:
an ignored file is never collected and never reaches the report, while a
skip is a test that WAS collected and then declined to run — so a named
file quietly turning into skips is what the exact pin catches and a floor
structurally cannot.

COMMENT-ONLY. The pin values, the assertions and the script are byte-for-
byte unchanged, measured:

  git diff -U0 | grep '^[+-]' | grep -v '^[+-][+-][+-]' | grep -cv '^[+-]      #'
  -> 0

so the green run at f98f874 (35398182026: selected=1076 passed=1073
skipped=3 failures=0 errors=0) still describes this head.

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

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 18, 2026 21:48
@brettheap

Copy link
Copy Markdown
Contributor Author

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

On the collect_ignore caveat — you are right and I was wrong. Corrected at fccc5faa, comment-only.

I measured it rather than argued, and it fails on two independent grounds, either sufficient alone:

$ python3 -c "<parse validate.yml, the three report-producing commands>"
[validate] 'pytest':                    --noconftest=True   explicit files=28
[validate] 'pytest (S7 residue)':       --noconftest=True   explicit files=1
[validate] 'pytest (runtime, hermetic)':--noconftest=True   explicit files=6

files named across the three commands: 35
collect_ignore entries:                 7
OVERLAP (ignored files also named):     NONE

So (1) the root conftest.py is never loaded and its collect_ignore never evaluated, and (2) not one of the seven ignored files is named anyway. The openXdox leg landing cannot move SELECTED, PASSED or SKIPPED in this job, and neither can the BUILD arc. My caveat would have sent the next reader to the wrong file at exactly the moment the pin refuses — which is the moment a caveat exists for.

How I got it wrong is worth recording: the main command is a folded >- block and I read its first lines, missing the trailing --noconftest. The ledger describes both legs correctly in its own words — "a NAMED FILE LIST under --noconftest" — so the correct fact was in front of me.

The real mechanism, now in the comment: editing one of the three explicit lists. 35 files are named; 61 test_*.py exist under tests/ and tests_runtime/, so 26 are collected by no command here. Adding one raises SELECTED and PASSED (floors permit a rise; the commit that adds it should raise them with its reason); removing one lowers them and the floor refuses. And the comment now says why SKIPPED is == where the others are >=: an ignored file is never collected and never reaches the report, while a skip is a test that was collected and then declined to run — so a named file quietly turning into skips is what the exact pin catches and a floor structurally cannot.

The change is comment-only, measured: git diff -U0 | grep '^[+-]' | grep -v '^[+-][+-][+-]' | grep -cv '^[+-] #' → 0. Pin values, assertions and script are byte-for-byte unchanged, so the green run at f98f8748 still describes this head.


On the suppressed finding — a checked-in regression test for the aggregation and refusal logic. The observation is fair: today only the all-reports-present path runs in CI, and I proved the other two states locally rather than in the suite. Registering the measurement instead of taking it, for a reason the correction above makes concrete: a test file only runs here if it is added to one of the three explicit lists, and adding it moves SELECTED and PASSED — so the test costs a list edit and a re-measured re-pin in the same PR that is establishing the pin. That is a second change wearing the first one's clothes.

Sized for whoever takes it: tests/test_triple_pin.py, ~60 lines, extracting the step's run: from the YAML and exercising the three states (all present; one report absent; one collected test turned skip) — the same three this PR proved by hand — plus its line in the pytest command's list and a MIN_SELECTED/MIN_PASSED bump with the reason. Recorded as the follow-up beside the openXdox leg.

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

🟢 Approval recommended

The reviewed workflow changes have no unresolved blocking issues.

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

@brettheap
brettheap merged commit 373b05a into main Sep 18, 2026
5 checks passed
@brettheap

Copy link
Copy Markdown
Contributor Author

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

LANDED — lane openxfactory-4, 2026-09-18T21:51:31Z, PR #29 → 373b05a (opensoft/openDox-code main; plain gate)

§ 5.4 FLOOR PART 2 clause (d), openDox leg: pin the collection triple on the required check (selected>=1076, passed>=1073, skipped==3, failures/errors 0; a missing report is a refusal); claim note 5736488087; regression test for the pin step registered as follow-up

brettheap added a commit to opensoft/openXdox-code that referenced this pull request Sep 18, 2026
…e on the required check (#25)

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

Second and last sub-act under `split-opendox-two-layer-product` § 5.4's standing claim [`5705086862`](opensoft/openXfactory#656 (comment)); this PR's CLAIMED note is [`5736634701`](opensoft/openXfactory#656 (comment)). The openDox leg landed as `openDox-code` [#29 → `373b05aa`](opensoft/openDox-code#29).

# § 5.4 FLOOR PART 2, clause (d) — the openXdox LEG

The clause, from the ledger at `openspec/changes/split-opendox-two-layer-product/tasks.md:2768-2775`:

> **(d) PINNED BY TEST** at each destination and in `openxFactory` … the way `pytest-suite.yml` already pins this repository's collection triple — **SKIPPED exactly, SELECTED and PASSED as FLOORS, failures and errors zero**. **Per destination, never as one cross-repository equality.**

Unblocked by **#23 → `3ee8cd31`**, which discharged § 4.5a (`tasks.md:1873`) — the blocker the ledger named for this leg at `tasks.md:2843-2846`.

## What the required job actually collects — measured, not assumed

This repository has **one** job, `validate`, and it runs pytest **once**:

| | |
| --- | --- |
| collection | a **NAMED LIST of 16 files**, never a directory |
| conftest | `--noconftest` — no conftest is loaded |
| on disk | **85** `test_*.py` under `tests/` |

A directory run is not merely unused here, it is **unavailable**, and the file says so itself:

> `--noconftest` STAYS, and it is why this list is a list: `tests/conftest.py` imports the carved session fixtures, which reach both absent packages. Every file named here stands on its own under it.

**So the pin covers the 16-file list — what the required check actually collects — and nothing else.** That is the honest object: pinning a number the required job does not produce would pin nothing. It also means what moves these numbers is **editing this list**, exactly as on the openDox leg, and neither `conftest.py` nor any collection-ignore mechanism can move them.

ONE report here, not the sibling's three, because this job runs pytest once: a single `--junitxml=pytest-report.xml` cannot be overwritten, and a missing report exits hard rather than producing a silently smaller sum.

## The pin is measured on CI

Two commits, as on the openDox leg: the first emits the report and PRINTS the triple; the second pins it using the numbers from the first commit's own run, whose URL is below. The reference implementation gives the reason — *"THE PIN IS TAKEN FROM CI'S OWN RUN, NOT FROM A DEVELOPER MACHINE"* — and this leg has the same self-skip shape.

Mirrors `openxFactory/.github/workflows/pytest-suite.yml` — `:599` (the report), `:671-672` (floors), `:782` (`EXPECT_SKIPPED`, exact), `:829` (the XML parse), `:877-881` (the assertions).

**Measuring run:** [35399041710](https://github.com/opensoft/openXdox-code/actions/runs/35399041710) — green, and its `Measure the triple` step printed:

```
TRIPLE selected=539 passed=533 skipped=6 failures=0 errors=0
```

So `MIN_SELECTED: "539"`, `MIN_PASSED: "533"` as floors, `EXPECT_SKIPPED: "6"` exactly, failures and errors zero.

**The measurement agrees with the file's own account of itself**, which is what makes the exact pin safe to take rather than merely possible — the pytest step already said *"The 6 skips that remain are the three seam suites' `doc_health` pairs, which no pin bump touches"*, and the report says six. `EXPECT_SKIPPED` is pinning a number somebody already understood.

**Proved, not assumed** — the step's own script extracted from the YAML and run against fixtures:

| state | result |
| --- | --- |
| the measured state | exit 0 |
| the report absent | exit 1, names the missing report |
| one collected test turns into a skip | exit 1, `skipped 7, pinned exactly 6` |

## Q-A2, folded in as one prose line

The docstring at `tests/test_domain_corpus_adapter.py:373` ends *"The question is registered in this PR rather than decided in it."* That was true on #23 and reads OPEN now that the question is ruled, so it gains a one-line **non-normative** citation of the ruling ([openxFactory#656 comment `5728368325`](opensoft/openXfactory#656 (comment)), 2026-09-18: LEAVE AS IS). Prose only — no assertion, no fixture and no test behaviour is touched. This is Q-A2's own REC (a), folded here because #23 has landed and this is the next act on that file.

## What this does NOT do

It does not tick § 5.4 — the tick rides the packet bookkeeper's amendment now that both legs exist, and no byte of `openspec/changes/split-opendox-two-layer-product/` is touched.

**A correction carried from the sibling leg, so it is not repeated here:** openDox's required job cannot have its numbers moved by this PR landing. All three of its report-producing commands pass `--noconftest` and name their files explicitly (35 named; overlap with its seven `collect_ignore` entries is **empty**). Copilot caught that against my first version of #29's comment and was right. The follow-up registered on openDox-code is `tests/test_triple_pin.py` (~60 lines, the three fixture states the step was proved against by hand), plus — as measurement with no action owed — the **26** `test_*.py` files there collected by no required command.

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


Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 18, 2026
…se (#30)

# The seven follow-ups openDox-code#26 registered rather than took

§ 3.6 landed with seven findings **registered**, because each of its batches had a scope the holder set. This is the act that takes them, one commit, one case each.

**Every measurement here was made against a full checkout of `4f8ae01e`** — never by pointing `PYTHONPATH` at an old tree. `pyproject.toml` sets `[tool.pytest.ini_options] pythonpath = ["src"]` and pytest **prepends** it, so a `PYTHONPATH` "old head" proof silently measures the new code and the case passes for nothing. That trap is now written down in `docs/runtime.md` § 8, "Proving a regression case against an older head", because it is the one that leaves a regression test in the suite that never saw the regression.

## The seven, with where each came from

| # | finding | origin |
|---|---|---|
| 1 | the served **DATABASE** has no non-secret declaration, only the served schema | A25-3's half-closed finding, registered on #26 as **ruled item 4** |
| 2 | **S8544** — installs resolve whatever the index offers on the day they run | SonarCloud on #26 (advisory gate) |
| 3 | `_found` wraps the pre-check and not the **act**: a deleted row is a 500 | Copilot on #26 at `db5197d0`, suppressed |
| 4 | the long-needle **substring** rule refuses `passwordless`, `secretary` | Copilot on #26 at `db5197d0`, suppressed |
| 5 | `write_back` reuses a **pathname** where the act holds a descriptor | Copilot on #26 at `4156f233` |
| 6 | the store's guard cannot see a **whitespace-bearing** scp authority | measured on #26 while closing the printing half; registered there |
| 7 | the repository **root** keeps `runtime init`'s umask-derived mode | registered on #26 as `local_git_adapter.py:465`; ruled "measure first" |

### 1. `OPENDOX_SERVED_DATABASE`, and four manifest edits

A25-3's finding was that `config._refuse_two_dsns_that_select_different_schemas` can never fire in a shipped deployment: the Deployment holds the served DSN, the migration Job holds the migration one, and no workload holds both — so the migration container has to be **told** where the API reads. It was told the **schema**. It was not told the **database**, and that is the wider question: a schema comparison made in the wrong database compares two names that happen to agree, and **`dbname` may be omitted from a DSN entirely, in which case libpq defaults it to the connection USER** (measured for #25's two-DSN guard) — so two DSNs that look alike can select two databases without either one saying so.

The consequence is A25-3's, one level up: DDL and a ledger applied to a database nothing serves, or **`runtime reset` dropping the six coordination tables of a database that was never this install's**. That verb cannot be undone.

`refuse_a_database_the_api_will_not_read` compares the declaration with `current_database()` **before the ledger is bootstrapped** and **before the schema guard** — the wider question first, so the refusal names the database when both declarations are wrong — in all three acts: `apply()`, `migrate --plan`, `reset`. A **name and never a credential**, which is the whole reason a workload that must not hold the served DSN can be given it. Four manifest edits carry it: the configmap literal (`pg_database=`), the Job's env, compose's migrate service (from the same `.env` value the Postgres service creates), and `.env.example`.

### 2. S8544 — one measured dependency lock, read by all three installs

`pyproject.toml` declares what this package **needs** and deliberately does not pin it; a library that pins its dependents' versions cannot be installed beside anything. The other half was missing: the required job, the DB-backed job and the runtime image each resolved whatever the index offered on the day they ran, so **the same commit tested twice is two different programs**.

`constraints-cpython312-linux.txt` is the **resolved** set — generated in a clean venv on cpython 3.12 / linux, not written by hand, with the command to regenerate it in its own header — and it is passed with `-c` in all three places. A **constraints** file and not a requirements one: it pins what is installed and installs nothing, so the required job still installs `.[test]` **alone** and the FastAPI and psycopg entries simply do not apply there.

It sits at the **repository root**, and that is load-bearing: `deploy/` holds the git-ignored `.env` that `.dockerignore` exists to keep out of the build context, so a lock living there would have meant a `!deploy…` re-inclusion — and the guard that no such rule exists is what keeps the filled-in `.env` at home.

### 3. `_found` around the act, not only the pre-check

Both repository routes read the map row with `_found(...)` and then call the act, which takes the row `FOR UPDATE` **inside itself**. A row deleted between those two statements raised `identity.NotFoundError` past a handler that catches only `RepositoryActRefused` — **measured at `4f8ae01e` as an uncaught exception**, which is a 500 where this API documents 404. The same class as #25's round 10 on the draft-discard path, and the same repair: the translation belongs on the call that can raise it, not on a read taken beforehand.

### 4. A parameter name is judged by its words, plus one declared compound

Whole-word matching answered `sslpassword` — libpq's own keyword — as innocent, so the first repair made every declared needle of six characters or more a **substring**. That bought one true name at the price of every other compound of those words: **measured**, `passwordless` and `secretary` were refused as credential-bearing. A false refusal at a **configuration** boundary is not the safe direction — this predicate decides whether an install starts.

So the compound is **declared**, and there is exactly one this runtime meets. `credentials_version` stays refused **on purpose**: `credentials` is one of its words, and that same reading is what catches `access_token`, `X-Api-Key` and `sessionToken` — narrowing past it would mean comparing the whole name, which those three walk straight through.

### 5. The temporary index is written through the held descriptor

Every other call in `write_back` goes through `-C /proc/self/fd/<n>`, which is what makes "the check and the use are one object" true. `GIT_INDEX_FILE` was built from `rev-parse --absolute-git-dir` — a **pathname**. **Measured on git 2.43.0**, with the directory renamed away and a symlink to a second repository put in its place after the probe:

| form | where `opendox-index-…` landed |
|---|---|
| the absolute pathname | **the decoy** |
| joined onto the held descriptor | the real repository |

`--git-dir` asked through `-C` answers **relative** — `.` for the bare repository this act creates, `.git` for a checkout, both measured — so joining it onto the runner's own root keeps the whole path, and the `unlink` that cleans it up, inside the descriptor. The case drives the swap from the probe itself and asserts **both** the mechanism (the index path is inside `/proc/self/fd/`) and the consequence (the decoy holds nothing, the real repository holds the commit); against `4f8ae01e` it reports the absolute path.

### 6. The store names an authority it cannot read

`_scp_like_userinfo` declines a head holding whitespace so this rule cannot start judging prose, and the redactor's `_CREDENTIAL_SHAPED` excludes it so an unrelated `user@host` three lines down git's stderr is not joined to the URL above it — and `user:pa ss@host:path` sat between them: refused in its URL form, accepted in its scp form. #26 closed the printing half at the one-URL entry point; this closes the store's own guard, **by shape and never by value**, on `_split_url`'s reasoning that a value this module cannot parse can still carry a credential. Nothing ordinary is caught: a head without `:` is a username, a value without `@` has no authority, and `/srv/a@b/my repos/x.git` is neither.

### 7. The repository root is created 0700 — measured first, as ruled

The holder ruled "measure first, fix only if a reachable path leaves it wider than 0700". `runtime init` is that path: every repository under the root is created `REPOSITORY_DIRECTORY_MODE`, and the root **above** them took `Path.mkdir`'s default, `0o777 & ~umask`. **Measured**: 0755 under the container's own umask (0o022) and **0777 under umask 0** — every project id listable, and traversable, by any local account. `0o700` is umask-safe, because a umask can only remove bits, and `Path.mkdir` applies `mode` to the **leaf** only, which is right: the parents are the operator's own path components.

An **existing** root is reported and not re-moded, on the walk's own rule that it narrows only what it made itself — an operator's mount point is not this act's to change — and the mode is in `init`'s evidence, so an operator upgrading from a build that created it 0755 sees the number and decides.

## Three existing cases moved with the code, and say why in place

* the required job's install guard reads the `.[…]` **extras** now, rather than searching the whole command line for the word `runtime` — the lock's filename contains it, and what the job must not do is install the runtime **extra**;
* the Dockerfile's install assertions read the parts rather than one exact line, because the install now carries `-c` and wraps;
* the redactor/refusal corpus records that one of its two "hidden but not refused" shapes is now refused, leaving one — the double-encoded parameter name, which stays a deliberate difference because a server decodes a name **once**, so `?%74oken=` is the one that arrives as `token` and **is** refused.

## Measured (python 3.12.3, pytest 8.4.2, postgres 16.15, git 2.43.0)

Every figure below was measured at **`4767ceb7`**, with the `runtime` extra made UNIMPORTABLE (the required job's own install) and with no ambient git configuration, and holds at the current head **`58852e1`**, which adds only the workflow's record of it. **This description is edited in the same act as that record**, which is what the round at `0a2af8b8` asked for on the sibling PR. The branch carries `origin/main` by **merge** (#29's "Pin the triple" step on the required job), never by rebase; both of this PR's hunks in that file — the two `-c` installs and the figure block — stayed where they were.

| run | result |
|---|---|
| the required `validate` job's own invocation (`--noconftest`, the six hermetic modules) | **357 passed, 1 skipped** |
| of which `tests_runtime/test_local_git_adapter.py` | 132 passed |
| `tests_runtime/test_repository_act.py` (DB-backed) | 82 passed |
| `python -m pytest -q tests_runtime/` with `OPENDOX_TEST_DATABASE_URL` set | **568 passed** |
| `python -m pyflakes src/opendox/runtime/*.py tests_runtime/*.py` | clean |
| the constrained install itself (`pip install -c … -e ".[test]"` in a clean venv) | 6 packages, and the hermetic six green under it |

**Ten new cases, each run against `4f8ae01e` first**, and each failed there for its own reason: the uncaught `NotFoundError`, `MigrationRunner.__init__() got an unexpected keyword argument 'served_database'`, `0o777`, the absolute index path, the three refusals and the missing lock.

## The review at `4df3701c`, and what it moved

Four findings, all measured true, all taken in one push — three of them defects in **this act's own output**, which is the line the holder drew: a finding about landed code is registered, work that does not do what it says is repaired.

* **The same defect in both deployments: a declaration that defaults to EMPTY beside a server that CREATES a named database.** Compose declared `${OPENDOX_PG_DB:-}` next to `POSTGRES_DB: ${OPENDOX_PG_DB:-opendox}`; the Kubernetes base left `pg_database=` empty and **neither overlay set it** (measured: `dev` merges only `opendox-oidc`, `managed-database` merges `migration_wait_host` and a commented `runtime_pg_role`). So the guard item 1 exists to add was a **no-op in every shape that ships**. One expression for compose's two services now; the base declares `opendox`, which its own StatefulSet hardcodes; the managed-database overlay — which deletes that StatefulSet — carries the commented edit beside the one it already carries. Leaving it wrong there is a **refusal**, not a silent wrong-database migration. `pg_schema` stays empty for the opposite reason: `public` is PostgreSQL's default, not a name this repository chose.
* **The image's repository root bypassed item 7.** `runtime init` narrows the root it *creates*, and in the shipped image it creates nothing — the Dockerfile makes `/var/lib/opendox/projects` in its own layer with `mkdir -p`, which takes `0o777 & ~umask` (0755 for a `RUN`), and this runtime does not re-mode a directory it did not make. `install -d -m 0700` states the mode itself, in the layer that owns the directory.
* **The runbook's old-head procedure now runs as written** — `tar -x -C` does not create its destination.
* **The comment at `local_git_adapter.py:2104` said something false, and now says the truth.** See follow-up #1 below. No behaviour changed there in this act.

## Registered as follow-up #1 — a separate PR, ruled

**`write_back`'s index is still pathname-bound for a LINKED WORKTREE**, and the comment that denied it was wrong. **Measured on git 2.43.0:** `git -C <worktree> rev-parse --git-dir` answers the **absolute** `<main>/.git/worktrees/<name>` — not `.` or `.git` — and `test_a_linked_worktree_can_reach_its_write_path`, landed with § 3.6, serves exactly that shape **writable** and drives `write_back` through it. So the fallback branch is live for a supported corpus, and for it `GIT_INDEX_FILE` stays outside the held descriptor: the race this PR closes for a bare repository and a checkout remains open there.

**Ruled by the holder**: bind the worktree's metadata by descriptor — its **own** gitdir *and* `--git-common-dir`, which is where `objects/` and `refs/` live, so two more held directories threaded through the method — and **keep linked worktrees writable**. Making them read-only instead is **rejected**, because it reverses a decision § 3.6 landed with its own case. A separate act, size M, not folded in here.

## Not in this act

* **`local_git_adapter.py:465` is the one item that came back "measure, then decide"** and the decision is recorded above: `runtime init` is the reachable path and it is fixed; the walk's own `fchmod` was already correct, and a pre-existing root is reported rather than re-moded — with the image's own layer now making that root 0700, since it is the one place that owns it.
* **Follow-up #1 above** — the linked worktree's index, ruled a separate act.
* The SonarCloud findings that are **not** S8544 (cognitive complexity, duplicated literals, the `secrets:S8136` false positives on this repository's own redaction fixtures) are untouched; the gate is advisory here and they are not this act's list.

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

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


Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 19, 2026
…ause

Floors: measured on head b48dd4b — selected 1096, passed 1093, skipped 3
— for the `init.templateDir` regression case. 1095 + 1 = 1096 is a check
on the reading, not its source.

AND THE SKIPPED REFUSAL'S MESSAGE WAS STILL WRONG, in the one place it
matters most. It told a reader whose pin had just fired that the expected
cause was "the root conftest's collect_ignore lifting as the openXdox leg
or the BUILD arc lands". That is false, and this repository's own #29
established why: all three report-producing commands pass `--noconftest`,
so the root conftest is never loaded, and no `collect_ignore` entry is
among the files they name — the overlap is EMPTY. I corrected the
explanatory comment there and left the failure message carrying the same
claim, which is the worse of the two places to leave it: the comment is
read by someone studying the file, the message by someone whose build
just went red and who will act on it.

It now names the only mechanism that can move these numbers here — an
edit to one of the three explicit lists — and says plainly that
collect_ignore cannot reach them.

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

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 19, 2026
…d Q-F1's transposition (#31)

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

CLAIM [`5736795055`](opensoft/openXfactory#656 (comment)) — `split-opendox-two-layer-product` § 3.7 FLOOR PART 3, the **openDox side**. The other two sides are landed: openxFactory's half of RULED Q-F1 (a) (`#1086` → `049d54a9`) and openXdox's reader (`openXdox-code` #23 → `3ee8cd31`).

# § 3.7 FLOOR PART 3 — openDox's conformance reader

The box asks for one thing and names two parts of it. Its own words:

> **§ 3.7 also owes a DECLARED factory and Q-F1's transposition** — `tasks.md:1392-1394`

> a reader that exists **is not a pass recorded**. The exit line — the three-argument command returning `OK — 17 of 17` … is owed — `tasks.md:1489-1493`

> **Q-F1 (a)** — how FLOOR PART 3 runs against a GIT-HISTORY reader: **the DESTINATION transposes the corpus into git and says so** (`conformance_corpus.transpose()`, run with `--corpus <transposition>`), documents, keys and bytes unchanged — `tasks.md:1357-1361`

So this PR is a factory, a transposition, and a recorded pass — **not a CI step**. openDox's implementation already existed (`LocalGitCorpus`, landed by #26 with Q-F2's three construction data on `__init__`); what was missing was the module that points it at somebody else's corpus. The ledger's reading of this side was blunt and correct: *"openDox — NOT EVIDENCED, and unlike openXdox this one has NOT moved: `openDox-code` carries no conformance reader at all"* (`:1516-1519`).

## The pass, measured

openxFactory's runner at `eb1880cb`, against this tree and a transposition built by this module:

```
$ python3 scripts/verify-carve-conformance.py \
    --destination opendox_code \
    --dest-root   <this checkout> \
    --adapter     opendox.conformance_corpus:reader \
    --corpus      <the transposition>

OK …: opendox_code passed the neutral conformance corpus — 17 of 17 check(s),
reader opendox.conformance_corpus:reader, corpus …,
TRANSPOSED and FAITHFUL to …/tests/corpus-adapter/fixtures — 3 document(s) at
revision 91c6319e…, key/sha256 table 744c9183…, unmoved across the run
EXIT=0
```

`TRANSPOSED and FAITHFUL` is the half that cannot be faked: the runner computes `{key: sha256(bytes)}` off openxFactory's **files** and compares it against what **this reader serves**, so a transposition that dropped, added, renamed or re-encoded a document refuses `conformance-corpus-unfaithful` instead of passing.

## What the module is

152 lines, two functions.

| | |
| --- | --- |
| `reader(name, location)` | the declared factory. **Neither argument is used**, and that is the property being measured rather than an oversight: one reader built from the corpus's terms alone is pointed at all four of the corpus's states in a single run, which the three resolution-time negative confirmations require. |
| `transpose(shipped, dst)` | Q-F1 (a)'s permission, taken with its proof — the same documents laid into git, bytes and keys unchanged. |

**`write_path=None` is load-bearing**, and is the one place this could have quietly failed. `LocalGitCorpus` declares *openDox's* governed write path; the corpus's `read-only-declared-at-resolution` check asserts that resolution reports **none**, and has a name for a reader that brings one anyway: *"a reader is inventing one"*. `kind_field` / `required_fields` are the corpus's own two-field header (`Type`, `Title`) — a corpus that "has never heard of a factory", in the words of its own first document — so they are values here, never defaults inherited from openDox.

**All four states are built**, because the seventeen checks resolve four locations and three of them are negative confirmations:

- `neutral` — a git repository holding **exactly** the shipped files
- `empty` — a repository committed with `--allow-empty` and **no tracked path**; a `.gitkeep` would be listed by `ls-tree -r` and the empty corpus would hold a document
- `not-a-directory` — a file
- the absent state — built by **not creating it**, which is the only honest way to build it

## The tests, and what they deliberately do not do

8 tests, added to the required job's named list. **They prove the property the runner checks, not the run**: the runner needs openxFactory's checkout and its fixtures, which this leg does not have and must not acquire to satisfy a test. So they reproduce the runner's own asymmetric comparison — a `{key: sha256}` table off the **files** against what the **reader** serves — over a corpus built in a tmpdir with the shipped one's shape, plus: the transposition adds no key of its own; the empty state answers rather than refuses; both refusal states refuse with the right kind.

Bytes are compared as `Document.content` **bytes**, never decoded — a transposition that re-encoded a document would round-trip through `str` and compare equal while the bytes on disk had changed.

## Honest size: M

The factory is small (openXdox's analogue is 94 lines) because the adapter already exists here. `transpose()` is the part openXdox never needed, and the faithfulness proof is unforgiving about keys, so it is a medium change rather than a small one.

## The pin

The required job's collection triple is pinned by this lane's #29 → `373b05aa`. Adding a test file moves it, so the floors are **re-measured from this PR's own CI run and raised with the reason in the same commit** — `pytest-suite.yml`'s own procedure, and the mechanism its comment names: what moves these numbers here is editing the explicit list, and nothing else.

## Coordination

**#30 @`58852e1f`** is open on this repository and overlaps two files (`validate.yml`, `local_git_adapter.py`). Different subject, different claim; named before authoring rather than discovered at a conflict. If it lands first this branch takes `git merge origin/main` — never a rebase — and **re-measures the pin afterwards**, because #30's own test additions move the same three numbers.

**This does not tick § 3.7**, which needs both destinations; openXdox's pass is evidenced ([`5736681367`](opensoft/openXfactory#656 (comment))) and this supplies openDox's. It is also **§ 8.2 part 3**, whose other three parts are already on record.

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


Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 19, 2026
…ection pin gets a test (#33)

# The openDox-code residue the rehome-lander registered: #31's follow-up and #29's test

Two registered items, neither of them this branch's own invention. Both were
found by a Copilot review, registered rather than taken because the PR that
found them was capped, and recorded as residue by the rehome-lander.

| # | what | origin |
|---|---|---|
| a | a global ignore file could take documents **out of** the transposed conformance corpus, and both shapes ended in a raw `CalledProcessError` | [#31 follow-up, comment 5738108117](#31 (comment)) |
| b | `Pin the triple` — the required check's collection pin — had **no test**, because a shell script in a workflow file is the one kind of code here that nothing executes until CI does | openDox-code#29's own registered residue |

Every measurement below was taken by running the thing, never by reading it.

## a. An ignore rule cannot shorten the corpus

`GIT_CONFIG_GLOBAL` is retained on purpose — an operator's own git is this
act's git — so a global ignore file reaches the `git add` that builds the
transposition. `core.excludesFile` is the fourth channel in `_HARDENING` and
the only one that is not about bytes: it decides which files are in the corpus
**at all**. Measured at **`776d2a80`**, the head with the list as #31 left it:

| ambient excludes file | at `776d2a80` |
|---|---|
| `*.md` | nothing staged, `git commit` exits 1 — `CalledProcessError` out of `transpose` |
| `beta.md` | the commit **succeeds** with a short tree, and the byte read-back fails on the key git never committed |

Neither was ever a *silent* short transposition: the read-back is what makes
that impossible and it held both times. What each was is a subprocess error
where a sentence belongs.

- **`-c core.excludesFile=` + `os.devnull`** disables the configured file.
- **`--force` on the add** answers the two entrances no config switch reaches:
  a `.gitignore` **copied in with the corpus** (the shipped corpus is arbitrary
  files, and one of them may be exactly that) and `$GIT_DIR/info/exclude`.
  Forcing is right here and would be wrong in the runtime — this repository is
  built by this function, one commit old, and holds nothing a rule could
  sensibly exclude.
- **Both failure paths name themselves.** `_committed_blob` and the commit step
  raise `ValueError`s naming the key and the usual cause. The failure is real
  and still refuses; this only decides what the refusal *says*.

**One case per exclusion shape, each run against the shape it forbids:**

| case | the shape | at `776d2a80` |
|---|---|---|
| `test_a_global_excludes_file_cannot_take_documents_out_of_the_corpus` | `*.md` through `GIT_CONFIG_GLOBAL` | the total-exclusion `CalledProcessError` |
| `test_an_exclusion_this_act_cannot_reach_is_named_and_not_a_git_error` | the same excludes file with **both halves of the repair removed** — the switch taken out of `_HARDENING` and `--force` stripped — which is the only way to reach the sentence once the repair is in place | a `CalledProcessError` on the read-back |

> **Correction, and it is this PR's own overstatement.** An earlier version of this row, and the message of commit `521abb7c`, described that second case as driving `$GIT_DIR/info/exclude` written after `init`. It does not: both cases drive a global excludes file. **No case here exercises a `.gitignore` copied in with the corpus or an `info/exclude`**, which means `--force`'s success behaviour is asserted nowhere — found by Copilot at this head and REGISTERED as F5 below. The commit message cannot be corrected without rewriting a pushed commit, so the correction lives here.

### The fixture is the shipped seed, not a description of it

`_DOCUMENTS` held three plausible documents. The shipped seed holds three
**awkward** ones, and the awkwardness is the point: `beta.md` has no `Title`
and `gamma.md` has no `Type`. A fixture that quietly gives every document both
front-matter keys cannot fail on a reader that requires them.

It is now the seed's own bytes — **verified, not asserted**, against
`tests/corpus-adapter/fixtures/neutral/`:

| key | bytes | sha256 |
|---|---|---|
| `notes/alpha.md` | 165 | `5a8c06574b3240ad…` |
| `notes/beta.md` | 171 | `971e78fb9fda1fe7…` |
| `papers/gamma.md` | 175 | `0473352024f38432…` |

all three byte-identical to the files on disk. `_SHIPPED_SIZES` pins the three
lengths and `_SHIPPED_DIGESTS` (added below, under R3) pins the three digests,
with two cases holding them there: one that the fixture **is** the seed, one
that the awkward pair is reported and never omitted. (The brief allowed this
half to be registered if the seed bytes could not be reproduced exactly. They
could, so it is taken.)

`tests/test_conformance_corpus.py`: **11 → 15 passed**.

### And the skip-pin message enumerates its causes

It stated an absolute — that a `collect_ignore` was the cause — and that was
false, which Copilot said on #31 and which the message now says **about
itself**. Four causes, and the list says it is not closed.

## b. The collection pin gets a test that can fail

`tests/test_triple_pin.py` **extracts the step and runs it**: it reads the
workflow, takes `Pin the triple`'s own `run` script and its own `env` pins,
writes JUnit reports into a temporary directory and runs `bash -c <the
script>` there. A copy of the script inside a test is a test of the copy — the
two drift the first time somebody edits one, and both keep passing. It also
means the numbers under test are whatever the pins currently say, so the
re-pin in this PR needed no matching edit in the test.

**Three cases, one per outcome, each isolated so exactly one refusal can fire
— and each proved against the mutation it forbids**, by patching the step in a
scratch copy of the workflow and re-running:

| case | mutation | result |
|---|---|---|
| the pinned state passes | the selected floor `-ge` → `-gt` | **fails** — a pin that refuses its own measured state is a red required check on every PR |
| a report that did not appear is a refusal **naming the file** | the `MISSING` guard made unreachable | **fails**, and the step prints `triple: selected=1109 passed=1106 skipped=3 … margin 0` and exits **0** over a run that never wrote a third of the suite |
| one skip more than pinned is a refusal | the exact `=` loosened to `-le` | **fails** |

The missing-report case is the sharp one: the two reports that *do* appear
satisfy **every number**. A step that failed to write its report has taken its
tests out of the sum, and the sum of the rest is not a smaller run but a blind
one.

It is hermetic on the same footing as its neighbours on the required list —
standard library plus `PyYAML`, this package's own base dependency, no
`opendox` import, `--noconftest` safe — and it **skips** where `bash` or
`python3` is absent, which is now cause (2) in the step's own enumeration.

## c. Copilot's three findings on this PR, taken in one push

All three were registered at `b5170372`
([comment](#33 (comment)))
and then **taken** on the holder's word. Every claim is measured against a full
checkout of `b5170372`.

### R1 — a non-zero `cat-file` does not mean an exclusion, so ask the tree

`cat-file blob HEAD:<key>` exits non-zero for a key that was never committed
**and** for a key whose object the database can no longer produce, and the
first cut answered both with "an ignore rule is the usual cause". `ls-tree`
separates them exactly — measured on git 2.43.0 in a one-commit repository:

| state | `cat-file blob HEAD:<key>` | `ls-tree --name-only HEAD -- <key>` |
|---|---|---|
| key absent from HEAD | `does not exist in 'HEAD'` | rc 0, **empty** |
| key present, object gone | `bad file` | rc 0, **names the path** |
| HEAD itself unreadable | non-zero | non-zero |

Three shapes, three sentences. At `b5170372`, with the loose object behind
`notes/beta.md` removed, the refusal read *"the transposition does not hold
'notes/beta.md' at all … An ignore rule is the usual cause"* — for a
repository that holds it perfectly well in its tree and has lost the blob.

### R2 — the commit catch-all stated an absolute, and the index knows better

*"every file copied into it was excluded before `git commit` saw it"*, stated
as fact, for a failure a full disk, an unwritable object database or a lock
left by a crashed process produces identically — **the same defect this PR
removes from the skip-pin message one file over**. `git diff --cached
--name-only` answers it, and the two shapes now get two sentences: nothing
staged keeps the exclusion sentence; anything staged gets a refusal that says
it is **not** an exclusion, gives the staged count as evidence, and enumerates
the causes (exclusion — ruled out, no space, a permission, another git failure
including a stale lock).

The case worth quoting: at `b5170372` a shipped root whose populated state is
an **empty directory** — nothing to do with any ignore rule anywhere — was
answered *"every file copied into it was excluded before `git commit` saw
it"*.

**And git is quoted from whichever stream carried it.** Measured: `commit -q`
with nothing staged writes `nothing to commit …` to **stdout** with stderr
empty, while a held `index.lock` writes `fatal: Unable to create …` to
**stderr** with stdout empty. A refusal quoting only stderr would quote an
empty string in exactly the exclusion case these messages exist to name.
Quoting git is safe here and the asymmetry with `local_git_adapter` — which
refuses to put git's stderr in a refusal — is deliberate: that module pushes to
a **remote**, and a remote URL can carry an authority and a credential.
Nothing in this module touches one.

### R3 — a length is not an identity

`_SHIPPED_DIGESTS` now carries the seed's sha256 **per key**, asserted in the
suite, with the sizes kept beside them (when a digest fails, the size says
whether the drift was an edit or a replacement). Proved both ways with one byte
changed and the length held — `factory` → `factorY` in `notes/alpha.md`:

| | |
|---|---|
| at `b5170372` | the case **passes** |
| here | it **fails**, naming `a7e2e453e7cc…` against `5a8c06574b32…` |

**Each of the three new cases fails at `b5170372`**, and so does the
strengthened exclusion case, which now requires git's own words in the
refusal. `tests/test_conformance_corpus.py`: **15 → 18 passed**.

**R4 stays REGISTERED** on the holder's word: the pin step has six refusals and
this PR covers three — `FAILURES != 0` and `ERRORS != 0` have no case.

## Figures, measured at `f9c8e4d5` and stated at that commit in `validate.yml`

| | |
|---|---|
| `tests/` (the required job's first list) | **733 passed, 2 skipped** (was 723 / 2 on main) |
| the S7 residue | **13 passed** |
| the hermetic six | **360 passed, 1 skipped** — unchanged |
| the triple, summed by the step's own script | `selected=1109 passed=1106 skipped=3 failures=0 errors=0` |
| `pytest -q tests_runtime/` (DB-backed) | **573 passed** — re-run, unmoved |

**The pin moves with the act**: `MIN_SELECTED` 1099 → **1109**, `MIN_PASSED`
1096 → **1106**, `EXPECT_SKIPPED` still **3**. Ten cases, all of them this
PR's: seven on the conformance corpus and three on the pin. `1106 + 3` is a
**check** on the reading and not its source — the reading came from a run.

And the pin now counts three cases that hold the pin. That is deliberate and
recorded beside the numbers, so a later move does not have to rediscover why
they are in the sum: they assert the step's **outcomes** over reports of their
own making, and they do not assert the figures.

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

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


Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants