Repository navigation
Realize harden-ideation-readiness-check: the proof reads its own repository, at a commit, and reds on an unreachable pin - #400
Conversation
…cannot
Three defects, one verification. The readiness derivation proof resolved its
subject by walking UP to the first ancestor holding
openxFactory/ideation/cross-reference.yaml, which inside the aggregation
workspace is always the ONE shared checkout — so every agent worktree proved a
verdict about another session's working tree, and find_index_validator() spawned
that checkout's validator besides. It read the index from a WORKING TREE, so an
uncommitted edit anywhere on the machine moved the verdict. And it turned an
unresolvable generation.source_revision into pytest.skip with the reason
"(shallow clone?)" — a conjecture that is false in the one place it fires, since
pytest-suite.yml checks out at fetch-depth: 0.
Resolution order now tries the repository under test first; only if that
checkout carries no index does it reach further — explicit argument,
OPENXFACTORY_ROOT, then the walk — and every rung past the first announces which
checkout it took and why. All three test spellings of the helper move together
(Q3, whether they collapse into one fixture, stays OPEN), and
find_index_validator() takes the same order, which also lets a standalone clone
find its own validator for the first time.
The index side of the comparison becomes revision-addressed like the corpus side
already was: git show <HEAD>:ideation/cross-reference.yaml, with the revision
named in both assertion messages. The accepted trade is stated rather than
hidden — an index edit is proved when it is committed, not while it sits in a
working tree.
An unresolvable pin is now discriminated by asking the repository rather than
guessing: rev-parse --is-shallow-repository and cat-file -e <rev>^{commit}.
Complete clone plus absent object FAILS, naming the pin and the index that
carries it; a genuinely truncated clone still skips (Q1 = KEEP), with a reason
naming the truncation observed.
The one live instance is repaired in the same commit, because requirement three
would otherwise land red on its own gate: main pinned f13a3b6, reachable from
no ref (the generating branch landed squashed as 4e57009), so the pin moves to
4e57009 and ideation/cross-reference.md is re-rendered through
scripts/render-ideation-cross-reference.py — one line each. Re-measured here
before writing: the derivation reproduces the committed 290-entry skeleton at
da9bf3b, at 4e57009, and at the old origin/main of 31c931f — but at CURRENT
main it derives 288, because the corpus has moved since the packet was authored.
Q2's recommendation is stronger than when it was written.
24 regressions, every one pinned to a defect rather than to the fix, over real
two-commit fixture repositories under tmp_path. The mutation check spells the
old walk out verbatim and proves the fixture reproduces defect A; two further
mutants — the working-tree read and the unconditional skip — were run by hand
and reddened the suite. The unreachable-pin regression catches both outcomes and
asserts WHICH was raised, because a test that merely skips when the skip returns
is the defect wearing the costume of the guard against it.
Realizes: harden-ideation-readiness-check (doc-health; three ADDED requirements,
nine scenarios).
Co-Authored-By: Claude Fable 5 <[email protected]>
…t got wrong The tasks now carry their evidence in the task rather than beside it: 920 tests where the packet predicted 895-plus-one-red, 77 openspec items strict-green, a single-repo doc-health report that diffs EMPTY against the pre-change run, and a release-bundle membership check that was performed rather than assumed — none of the edited files appears in any contracts/releases/*.digests.yaml, so no bundle is owed. Two of the packet's measurements have decayed since it was authored, and both are corrected where they live rather than quietly re-stated: The derivation reproduces the committed 290-entry body at da9bf3b and at 4e57009, but at CURRENT main it derives 288. The proposal measured 290 at origin/main when main stood at 31c931f. So Q2's "both produce a body identical to today's" is no longer true, and the alternative it offered would now owe a body regeneration. Q2's recommendation survives its own evidence changing, which is the strongest form it could have taken. The assertion was unreachable by two routes, not one. In an ISOLATED clone — how this repository's own CI validate job checks out — the pre-change resolver could not find the repository's OWN index, and the proof skipped before it ever reached the pin. Defect B named only the second route. Q1 (KEEP the narrowed skip) and Q2 (re-pin to 4e57009) are recorded as MEASURED DECISIONS taken by the realizing session, not as rulings: the implementation cannot be written without settling them, and either is one edit to reverse. Q3 is NOT taken. The three resolver spellings are fixed in place exactly as the tasks prescribe, and § 5.1 stays open — with the new regressions parametrized over all three modules, so the copies cannot drift apart while the question waits. § 4.6 stays unticked. The change ships ACTIVE and archives after the merge, in its own commit. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
Pull request overview
This PR realizes the harden-ideation-readiness-check packet by making the ideation readiness “derivation proof” deterministic and self-scoped: it resolves the repository-under-test first, reads the ideation index from committed Git state, and distinguishes “unreachable pin” failures from genuinely shallow-clone skips. It also repairs the live ideation/cross-reference.yaml pin and updates the corresponding generated Markdown projection.
Changes:
- Reworks test-side “openxFactory root” resolution to prioritize the repository under test, with explicit/ENV/ancestor fallbacks and auditable announcements.
- Updates the derivation proof to read
ideation/cross-reference.yamlviagit show <rev>:...and reconstruct the corpus viagit archive, failing vs skipping based on observed shallowness/object presence. - Adds a comprehensive regression suite covering the three defects and updates the live
source_revisionpin (+ re-rendered.md) and packet documentation.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/doc-health/test_readiness_proof_resolution.py | Adds regression coverage for resolver precedence, committed-index reads, and unreachable-pin behavior. |
| tests/doc-health/test_readiness_dispatch.py | Aligns dispatch-side resolver to “repository under test first” and improves skip messaging. |
| tests/doc-health/test_ideation_readiness.py | Implements committed index reads and observed fail-vs-skip behavior in the core derivation proof helpers. |
| tests/doc-health/test_derive_possibles.py | Aligns possibles lane tests with the updated resolver behavior and explicit skip reasons. |
| scripts/doc_health/ideation_readiness.py | Updates validator discovery to prefer the repository under test and to announce fallbacks. |
| ideation/cross-reference.yaml | Re-pins generation.source_revision to a reachable commit. |
| ideation/cross-reference.md | Re-renders the generated projection to reflect the updated pin. |
| README.md | Updates the “Active changes” index entry with realization status and measured outcomes. |
| openspec/changes/harden-ideation-readiness-check/tasks.md | Marks implementation tasks as realized while explicitly keeping the archive step open. |
| openspec/changes/harden-ideation-readiness-check/proposal.md | Records measured decisions (Q1/Q2) and documents realization findings/impact. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| f"state no reader can reconstruct, so its provenance claim is " | ||
| f"unverifiable: re-pin it to a reachable revision. " | ||
| f"git archive said: {detail}") | ||
| tarfile.open(fileobj=io.BytesIO(proc.stdout)).extractall(dest) |
| reachable = _git(repo, "merge-base", "--is-ancestor", pin, "HEAD", | ||
| check=False).returncode == 0 | ||
| assert reachable, ( | ||
| f"{INDEX_REL.as_posix()} pins {pin}, which is not an ancestor of HEAD " | ||
| "— the index names a corpus state no reader can reconstruct from this " | ||
| "history (re-pin it, as harden-ideation-readiness-check § 3 did)") |
…ched Task 4.3 predicted a first execution in a fresh clone and got two. The isolated doc-health shape moves 889 passed / 7 skipped to 920 passed / 0 skipped — seven real-corpus proofs no runner had ever run, the derivation proof among them — and pytest-suite on PR #400 is green at 6638 passed, 20 skipped, 0 failed in 13m07s, which is that assertion executing on continuous integration for the first time in the life of the test. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
Suppressed comments (1)
tests/doc-health/test_ideation_readiness.py:506
_corpus_at_pin()extracts a tar stream fromgit archiveusingtarfile.extractall()without any path validation. Even though the archive is produced locally, a repository can contain paths that escapedest(e.g.../...), which is a known tar path-traversal issue and is increasingly guarded against by Python tooling. Consider validating members before extraction, and (when supported) usingfilter='tar'to silence/avoid unsafe-extraction warnings in newer Python versions.
tarfile.open(fileobj=io.BytesIO(proc.stdout)).extractall(dest)
return dest
Realizes the ratified packet
harden-ideation-readiness-check(admitted by Brett, 2026-08-26). Three ADDEDdoc-healthrequirements, nine scenarios, no requirement MODIFIED. Do not archive on merge —tasks.md§ 4.6 is the archive act and stays open.What was broken
tests/doc-health/test_ideation_readiness.py::test_derivation_reproduces_the_real_bootstrap_clustersis the proof that the readiness lane's derivation still reproduces the landedideation-cross-referenceindex. It carried three defects:_openxfactory_root()walked UP to the first ancestor holdingopenxFactory/ideation/cross-reference.yaml, which inside the aggregation workspace is always the ONE shared checkout. Every agent worktree proved a verdict about another session's working tree.find_index_validator()carried the identical walk and spawned that checkout's validator besides."(shallow clone?)"— a conjecture that is false where it fires, sincepytest-suite.ymlchecks out atfetch-depth: 0.What changed
OPENXFACTORY_ROOT, then the walk — and every rung past the first announces which checkout it took and why. Applied to all three test spellings AND tofind_index_validator().git show <HEAD>:ideation/cross-reference.yaml, with the resolved revision named in both assertion messages. Both sides of the comparison are now revision-addressed.git archivefailure the code asksgit rev-parse --is-shallow-repositoryandgit cat-file -e <rev>^{commit}. Complete clone plus absent object FAILS, naming the pin and the index; a genuinely truncated clone skips, naming the truncation observed.f13a3b60→4e57009candideation/cross-reference.mdis re-rendered throughscripts/render-ideation-cross-reference.py— exactly one line each. Nothing else in either file moved.THE ACCEPTANCE SIGNAL — measured, not asserted
Nothing was written to the shared checkout. The hazard was reconstructed instead: an aggregation root holding a checkout at
openxFactory/, two fresh fetch-based clones beneath it atworktrees/, and the sibling dirtied into the exact 2026-08-26 shape — an uncommitted hand-bumpedsource_revisionwith the body left as generated and truncated to 67topic_entries.tests/doc-healthTHE GATE (
tasks.md§ 4.3) — the first execution in a fresh cloneFresh
git clone --no-local(never--local, which copies unreachable objects and would have hidden the defect). Every clone is complete —rev-parse --is-shallow-repository→false— and NONE carriesf13a3b60, which reproduces the packet's defect-B measurement.A FINDING THIS RUN SURFACED, reported rather than suppressed. The assertion was unreachable by TWO routes, not one. In an ISOLATED clone — which is exactly how this repository's own CI checks out — the pre-change resolver could not find the repository's OWN index, so the proof skipped before it ever reached the pin. In the CI shape the pre-change
tests/doc-healthrun is 889 passed, 7 skipped; with this change it is 920 passed, 0 skipped. Seven real-corpus proofs — the derivation proof, the validator wiring, the pipeline proof — have never run on a runner. They run now.Pin repair — verified the way the requirement will verify it
Re-measured before writing, by rebuilding the derivation from the corpus at each candidate and comparing skeletons against the COMMITTED 290-entry body:
f13a3b60(the orphan pin)da9bf3b7(generated at)4e57009c(landed the index)origin/main(275d065d)Scratch
git clone --bare --no-local:is-shallow-repository→false;cat-file -t f13a3b60→ 128,cat-file -t 4e57009c→commit;git archive f13a3b60 ideation→ 128,git archive 4e57009c ideation→ 0.scripts/validate-ideation-cross-reference.py … --strict→0 error(s), 0 warning(s).Q1 / Q2 / Q3 dispositions
proposal.md. The skip now only fires afterrev-parse --is-shallow-repositoryhas answeredtrue, so it is a stated observation about the clone rather than the silence defect C was. Both branches carry regressions that assert WHICH outcome was raised, so reversing this is one branch and one test.4e57009c. Also a measured decision — and its evidence moved. The proposal recorded 290 atorigin/mainwhen main stood at31c931fa; current main derives 288, so "both produce a body identical to today's" is no longer true and the regenerate-at-main alternative would now owe a body regeneration. The recommendation survived its own evidence changing.tasks.md§ 2 prescribes;tasks.md§ 5.1 stays open. What the realization added is a guard against the duplication rotting: every resolver test is parametrized over all three modules (RESOLVERS), so the copies cannot drift apart silently while the question waits for a ruling.Verification
python3 -m pytest tests/doc-health -q→ 920 passed (896 before; the 24 added are the regressions, no existing test moved).python3 -m pytest tests/ -q -m "not postgres"→ 6639 passed, 18 skipped, 338 deselected, 1 failed in 19m49s. The one failure istests/hermes_runtime_contracts/test_validator_cli.py::test_release_mode_field_is_preserved_on_the_real_repository[--require-realization-realization], a 30s_run_clitimeout — and it is PRE-EXISTING AND ENVIRONMENTAL, proven rather than presumed: it reproduces identically at unmodifiedorigin/main(bb7d7ae8) in a sibling agent worktree, and it PASSES with this change's code in a fresh clone (47.58s, both parameters). The CLI takes ~33s from a worktree under the aggregation root against ~24s from an isolated clone;git ls-remoteis 1.65s of that, so it is local walking, not the network.openspec validate harden-ideation-readiness-check --strict→ valid;openspec validate --all --strict→ 77 passed, 0 failed.diff before.md after.mdis EMPTY.release-inventory-drift0 → 0,proposal-origin0 → 0. The oneideation/cross-reference.mdrecord-immutability finding is pre-existing — it is present identically on a pristineorigin/mainclone.scripts/doc_health/ideation_readiness.py, the four test modules,ideation/cross-reference.yamlorideation/cross-reference.mdappears in ANYcontracts/releases/*.digests.yaml(those inventories carry onlycontracts/,schemas/and thehermes_runtime_validationsurface). No bundle is owed.Mutation discipline
Every regression is pinned to a defect rather than to the fix. The in-suite mutation check spells the pre-change walk out verbatim and asserts it resolves the ancestor decoy over the SAME fixture where the shipped resolver resolves the repository under test. Two further mutants were run by hand and reddened the suite:
The unreachable-pin regression catches
(Failed, Skipped)and then asserts WHICH was raised. Catching onlyFailedwould report a regression back to the skip as a SKIPPED test — a green scoreboard over an absent verification, which is defect C wearing the costume of the guard against it.For Brett
tasks.md§ 5.3 remains unaddressed and named:git_generation()pinsrev-parse HEADwhether or not the working tree is clean.source_revisionrecorded on a branch must be re-derived when that branch lands rewritten — is still an unwritten follow-up packet. This change makes its absence loud and repairs the one live instance; it does not state the rule.🤖 Generated with Claude Code