Repository navigation
openDox-code#33 residue: clause (d)'s untested refusals, the fixture-identity marker, --force's success path, and a magic-looking key - #34
Conversation
openDox-code#33 landed with Copilot's finding F6 (comment 5738611955) REGISTERED rather than taken: the `ls-tree` probe inside `_committed_blob`'s exception handler parses a leading `:` in the key as git PATHSPEC MAGIC before it ever asks the tree, so a key shaped like `:!doomed.md` — never committed, ordinary in every other way — makes the probe exit 128 with `pathspec magic not supported by this command: 'exclude'` instead of the ordinary rc-0-empty "absent" reading, and the branch that follows misreports it as "HEAD or the repository itself is the problem". `--literal-pathspecs` on the probe answers it. MEASURED on git 2.43.0 (this container's version, matching every other measurement in this file): before the fix, a probe of `:!doomed.md` exits 128 with the magic-parsing error; after, rc 0 and an empty listing, indistinguishable from any other absent key. The other half of the same finding — a key CONTAINING `*` — was measured to need no such guard, and this act adds none for it: `ls-tree` does not expand a bare pathspec as a glob at all. Measured on a tree holding `alpha.md`, `beta.md` and a file literally named `a*.md`, all at the same directory depth: `-- '*.md'` matched NONE of the three, and `-- 'a*.md'` matched only the file actually named that, with or without `--literal-pathspecs`. The regression case proving both halves lands in the next commit, alongside R4 and F5, in `tests/test_conformance_corpus.py`. Lane: openxfactory-4 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
openDox-code#33's Copilot review (comment 5738550542) named R4 on the "Pin the triple" step: it has six refusals and three had cases before this act (a missing report, a report below floor, one skip more than pinned); the other two — `FAILURES != 0` and `ERRORS != 0` — had none. Two cases added, each isolated the same way `test_one_skip_more_than_pinned_ is_a_refusal` already was: `total - 19` on the main report keeps SELECTED and PASSED at or above their floors and SKIPPED exactly pinned, with one test moved from passed to failed (or to errored) instead of from collected to skipped, so only the clause under test can fire. MEASURED against the mutation each forbids: with `[ "$FAILURES" = "0" ]` neutered in the workflow, only `test_a_failure_is_a_refusal_with_both_floors_ and_the_skip_count_met` fails (4 passed, 1 failed); with `[ "$ERRORS" = "0" ]` neutered, only its sibling fails. Restored, all five pass. tests/test_triple_pin.py 3 passed -> 5 passed Lane: openxfactory-4 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Three of the four items openDox-code#33's Copilot review left REGISTERED land here together, because all three touch this one file. F4 (comment 5738550542) — `@requires_git` sat on `test_the_fixture_is_the_shipped_seed_and_not_a_description_of_it`, which shells out to no git at all: every assertion in it is `hashlib.sha256` over the module-level `_DOCUMENTS`/`_SHIPPED_SIZES`/`_SHIPPED_DIGESTS` dicts. The marker dropped the digest guard — the one check standing between this file and a fixture that has drifted from the seed it claims to mirror — on any runner without git, for a reason that was never this test's own. Removed; this runner has git, so the skipif condition was already false and the test already ran, and the pinned triple does not move because of it. F5 (comment 5738550542) — `--force`'s SUCCESS path was asserted nowhere. Every existing exclusion case reaches a CONFIGURED ignore file through `GIT_CONFIG_GLOBAL`, which `core.excludesFile=` disables; none of them lays a `.gitignore` down INSIDE the populated state or writes to `$GIT_DIR/info/exclude`, the two entrances `--force` exists for. Two cases added, each MEASURED against `--force` removed: the `.gitignore` case then fails on the ordinary per-key exclusion ValueError (the commit succeeds short, holding only the `.gitignore`, and the byte read-back names the first missing document); the `info/exclude` case then fails on the total-exclusion ValueError (nothing at all survives, since every document here is `.md` and there is no companion file to remain staged). Restored, both pass. Commit 521abb7's own message additionally MISDESCRIBED `test_an_exclusion_this_act_cannot_reach_is_named_and_not_a_git_error` as driving `$GIT_DIR/info/exclude` — it does not; both its cases are the same `GIT_CONFIG_GLOBAL` excludes file as the test before it, with the switch and `--force` monkeypatched out. That commit is already pushed and its message cannot be corrected; the true description is in this act's pull request body, and no doc or docstring in this tree repeats the wrong one (checked). F6 (comment 5738611955) — the regression case for the previous commit's `--literal-pathspecs` fix: `_committed_blob` on a key of `:!doomed.md`, never committed, now raises the ordinary "does not hold ... at all" ValueError rather than "cannot even ask its tree" — MEASURED to fail against the previous commit reverted (1 failed, 20 passed) and pass restored. tests/test_conformance_corpus.py 18 passed -> 21 passed Lane: openxfactory-4 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The pin floors may only rise, and only with the reading in the commit message: five new passing cases landed over the previous three commits (two on tests/test_triple_pin.py, three on tests/test_conformance_corpus.py), none of them a new skip, so the old floors now carry five tests of slack a regression could hide behind. MEASURED over the tree of `2b78d54f` (this act's last content commit), by running this job's three invocations and summing their JUnit reports with this step's own script: tests/ 738 passed 2 skipped, the S7 residue 13, the hermetic six 360 passed 1 skipped -- triple: selected=1114 passed=1111 skipped=3 failures=0 errors=0. tests_runtime/ is DB-backed and untouched by this act, so it is not re-measured here. NOT DERIVED: 1109 + 5 is a check on the reading, not its source. MIN_SELECTED 1109 -> 1114 MIN_PASSED 1106 -> 1111 EXPECT_SKIPPED 3 (unchanged) Both new floors are exact against the measured run (margin 0), matching this pin's own established discipline. Lane: openxfactory-4 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reviewer's GuideThe PR closes four registered review gaps by adding isolated refusal and --force success-path coverage, removing an unnecessary Git marker from fixture identity validation, and hardening absent-key probing against Git pathspec magic; the workflow pins are updated for the five new passing tests. Sequence diagram for literal absent-key probingsequenceDiagram
participant Caller
participant Corpus as conformance_corpus
participant Git
Caller->>Corpus: _committed_blob(repo, key)
Corpus->>Git: cat-file probe for key
Git-->>Corpus: key absent
Corpus->>Git: ls-tree --literal-pathspecs HEAD key
Git-->>Corpus: rc 0, empty listing
Corpus-->>Caller: absent-key ValueError
Flow diagram for the expanded validation pinflowchart LR
A[Add five passing tests] --> B[Run tests and collect JUnit reports]
B --> C[Triple sums selected=1114]
C --> D[Triple sums passed=1111]
D --> E[Workflow accepts the run]
F[EXPECT_SKIPPED=3] --> E
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
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Completes conformance-validation residue by adding refusal and force-add coverage, removing an unnecessary Git dependency, and handling literal Git pathspecs safely.
Changes:
- Adds failure/error refusal tests and updates validation thresholds.
- Covers forced additions with
.gitignoreandinfo/exclude. - Handles magic-looking keys as literal paths.
| File | Description |
|---|---|
tests/test_triple_pin.py |
Adds failure and error refusal coverage. |
tests/test_conformance_corpus.py |
Adds fixture, force-add, and pathspec edge-case tests. |
src/opendox/conformance_corpus.py |
Uses literal pathspec handling and forced adds. |
.github/workflows/validate.yml |
Updates triple-pin thresholds. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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 5 hours by commenting @sourcery-ai review. Upgrade to get a review now.
|
Lane: openxfactory-4 (openXfactory-4-openDox_extraction) LANDED — lane openxfactory-4, 2026-09-22T01:07:26Z, PR #34 → f8a1ece (opensoft/openDox-code main; plain gate) Hygiene residue of #33 (R4/F4/F5/F6): --literal-pathspecs on the ls-tree probe, the two untested pin-step refusals, the misplaced @requires_git, --force's success path asserted; triple 1114/1111/3; actor runtime; Brett's standing word 'keep going' (2026-09-22). |



The openDox-code residue #33's own Copilot review left REGISTERED: R4, F4, F5, F6
Four items, none of them this branch's own invention. All four were found by
Copilot's review of #33, registered rather than taken because that PR was
capped, and stand in
PROGRESS-runtime.mdas "Idle from here" waiting for anew brief. This is that brief, taken as one hygiene pass since all four are
small and three of the four land in the same file.
Pin the triplehas six refusals; three had cases;FAILURES != 0andERRORS != 0had none@requires_gitsits on the fixture-identity test, which runs no git--force's SUCCESS path is asserted nowhere--literal-pathspecson thels-treeprobe: the magic half is real, the glob half was never measuredEvery measurement below was taken by running the thing, on git 2.43.0 (this
container's version, the same one every prior measurement in this file cites).
R4 — clause (d)'s two untested refusals (
0fb990d)The step has six refusal branches. Three already had cases before this PR
(a missing report, a report below floor, one skip more than pinned); the
other two —
FAILURES != 0andERRORS != 0— had none.Two cases added, using the same isolation technique
test_one_skip_more_than_pinned_is_a_refusalalready established:total - 19on the main report keeps SELECTED and PASSED both at or above theirfloors and SKIPPED exactly pinned, with one test moved from passed to
failed (or to errored) rather than from collected to skipped, so only the
clause under test can fire.
Proved against the mutation each forbids, by neutering one clause in a
scratch copy of the workflow and re-running the suite:
[ "$FAILURES" = "0" ]replaced withtruetest_a_failure_is_a_refusal_with_both_floors_and_the_skip_count_metfails (4 passed, 1 failed)[ "$ERRORS" = "0" ]replaced withtruetests/test_triple_pin.py: 3 → 5 passed.F4 — the fixture-identity test runs no git, and was marked as if it did (
2b78d54)@requires_gitsat ontest_the_fixture_is_the_shipped_seed_and_not_a_description_of_it. Everyassertion in it is
hashlib.sha256over the module-level_DOCUMENTS,_SHIPPED_SIZESand_SHIPPED_DIGESTSdicts — nothing in the test shellsout to git. The marker dropped the digest guard — the one check standing
between this file and a fixture that has quietly drifted from the seed it
claims to mirror — on any runner without git, and moved
EXPECT_SKIPPEDthere for a reason that was never this test's own.
Removed. This runner has git, so the
skipifcondition was already false andthe test already ran and already passed — the fix makes the skip count
honest on a runner that does not have git; it moves nothing here. No new
case: a marker fix has no mutation of its own to prove against.
F5 —
--force's success path, asserted nowhere until now (2b78d54)Every existing exclusion case in this file reaches a configured ignore
file through
GIT_CONFIG_GLOBAL, which-c core.excludesFile=disables.None of them ever lays a
.gitignoredown inside the populated state, orwrites to
$GIT_DIR/info/exclude— the two entrances--forceon theaddactually exists for. Two cases added, each measured against
--forceremoved:
--forceremovedtest_a_gitignore_copied_in_with_the_corpus_does_not_shrink_it.gitignore(*.md) written intoshipped / POPULATEDbeforetranspose.gitignorestaged), and the byte read-back namesnotes/alpha.mdas excludedtest_an_info_exclude_written_after_init_does_not_shrink_the_corpus_gitmonkeypatched to write$GIT_DIR/info/exclude(*.md) right afterinit, beforeadd.md, and there is no companion file to survive), so the total-exclusionValueErrorfiresRestored, both pass and every document plus the
.gitignoreitself isbyte-verified into the transposition.
The correction commit
521abb7ccannot makeCommit
521abb7c's own message describestest_an_exclusion_this_act_cannot_reach_is_named_and_not_a_git_errorasdriving "
$GIT_DIR/info/exclude, written afterinit". That is wrong.Re-reading the test as it stands (and as it stood at
521abb7c): both of itscases drive the same
GIT_CONFIG_GLOBALexcludes file as the test beforeit (
*.mdandbeta.md), with the switch taken out of_HARDENINGand--forcemonkeypatched off — the only way left to reach the "cannot reach"sentence once the repair is in place. No case anywhere before this PR drove
$GIT_DIR/info/exclude, which is exactly the gap F5 names.That commit is already pushed and merged; its message cannot be edited. This
paragraph is the correction. I checked every docstring and doc file in this
tree for the same misdescription (
grep -rn "info/exclude" --include="*.py" --include="*.md") — nothing else repeats it, so nothing else needed fixing.tests/test_conformance_corpus.py(F4 + F5 + F6 together): 18 → 21passed.
F6 — a magic-looking key is not a repository problem (
40b1f80, tested in2b78d54)The
ls-treeprobe inside_committed_blob's exception handler parses aleading
:in the key as git pathspec magic before it ever asks thetree. A key shaped like
:!doomed.md— never committed, ordinary in everyother way — makes
cat-filefail exactly like any absent key (does not exist in 'HEAD'), and then makes the probe itself exit 128 withpathspec magic not supported by this command: 'exclude'. Before this PR,that 128 read as "HEAD or the repository itself is the problem" — true of
the exit status, false of the key, which was simply never committed.
--literal-pathspecson the probe closes it:ls-tree --name-only HEAD -- ':!doomed.md'fatal: :!doomed.md: pathspec magic not supported by this command: 'exclude'Why the glob half is not a bug
The same finding raised a second concern: a key containing
*might beglob-expanded by
ls-treeand match more than the caller intended.Measured, on a tree holding
alpha.md,beta.mdand a file literally nameda*.md, all at the same directory depth (no nesting to hide an answerbehind):
-- '*.md'-- 'a*.md'git ls-treedoes not expand a bare pathspec as a glob at all, with orwithout
--literal-pathspecs. So the flag is added here for the:-magiccase alone, proved by one new case:
test_a_magic_looking_key_is_named_absent_and_not_a_repository_problem—measured against the fix reverted: 1 failed (this case only), 20 passed;
restored, 21 passed.
Figures, measured at
2b78d54and stated at that commit invalidate.yml1d4ac83c)2b78d54)tests/(the required job's first list)selected=1109 passed=1106 skipped=3 failures=0 errors=0selected=1114 passed=1111 skipped=3 failures=0 errors=0pytest -q tests_runtime/(DB-backed)The pin moves with the act (
7719161):MIN_SELECTED1109 → 1114,MIN_PASSED1106 → 1111,EXPECT_SKIPPEDstill 3. Five cases, allof them this PR's: two on
test_triple_pin.py, three ontest_conformance_corpus.py.1109 + 5is a check on the reading andnot its source — the reading came from a run, quoted above.
What this PR does not touch
The OPENDOX pin lockstep and every pin file are untouched, per the brief.
tests_runtime/(the DB-backed job) is untouched, so its 573 figure is notre-measured or re-quoted here.
Summary by Sourcery
Harden conformance-corpus validation and complete the remaining refusal, fixture, force-add, and pathspec edge-case coverage.
Bug Fixes:
.gitignorefiles or$GIT_DIR/info/excludewhen force-adding.Enhancements:
CI:
Tests:
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
🤖 Generated with Claude Code