Skip to content

Realize govern-derived-pin-reachability: a declared pin class, verified against refs — plus two orphans the packet never saw - #424

Merged
brettheap merged 5 commits into
mainfrom
change/realize-pin-reachability
Aug 27, 2026
Merged

brettheap merged 5 commits into
mainfrom
change/realize-pin-reachability

Conversation

@brettheap

@brettheap brettheap commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Realizes the active change govern-derived-pin-reachability (ratified 2026-08-27
by Brett; all five orchestrator decisions cleared as authored, Q1/Q2/Q3 ruled).
Requirement 4's enforcement, requirement 1 and 2's semantics made checkable, and
requirement 3's reproduction obligation implemented for the one member whose
tooling defines derivation. Do not merge on my account — this is the
realization PR the packet's § 4.3 gate is waiting on, and the archive commit is a
separate act.

What it does

The promoted pin obligation covered exactly ONE artifact — an unreachable
generation.source_revision fails the readiness derivation proof. This extends
it to a DECLARED CLASS, judged against refs rather than against a clone's
object store.

  • scripts/doc_health/pin_class.py — Q1's ruled home, beside families.py,
    so the declaration is itself checked. 25 members (20 with committed sites, 5
    schema-declared future), each carrying its path globs, its key, whether that
    key is a FIELD or PROSE, its generator, whether reproduction is tool-defined,
    its locality, and a note. Six NON_MEMBERS rows, each with a reason.
  • The ref set is main plus refs/retention/pins/<full-sha> COMPUTED from
    the pin, and nothing else.
    Five stray ref shapes are refused by parametrized
    test — a branch, a tag, two near-miss namespace spellings, and the
    refs/remotes/origin-retention/* leftovers this checkout really carries from a
    since-deleted remote. A retention ref that does not point at the commit its
    name states retains nothing, and that is checked rather than assumed.
  • verify_pin_reachability on the readiness surface (OD-2: no new
    deterministic check family), returning pass / fail / skip, with the
    failure text naming the repair route the artifact's own class allows.
  • index_reproduces_at — requirement 3's reproduction obligation, made
    checkable for the index pair.

NO NEW DETERMINISTIC CHECK FAMILY, structurally

families.py is untouched (zero diff). pin_class defines no fam_* and
imports nothing from families, and a test fails if families.py ever so much
as mentions it — so a later edit cannot register it as a family without deciding
to. Asserted structurally rather than by counting, because a count breaks the day
an unrelated change registers a family, which is the coupling this decision
exists to avoid. add-modified-block-currency-check still owes the 21 -> 22
enumeration and nothing here touches it or reaches 23.

The packet's inventory does not survive measurement

proposal.md reports 9 pins / 8 artifacts / 4 generators. Re-measured over
committed structured state — every standalone 40-hex token in every committed
.yaml / .yml / .json, resolved against the object database rather than
matched by key name — the class is 63 sites across 20 members. Four generator
families the sweep never saw:

family sites why it was missed
proposal-support transition manifests 24 the largest member of the class, under the same source_revision key the packet did search
cross-factory ideation routing records 12 key revision, listed but not resolved
avatar-client kernel / lab register / F0 evidence 7 keys f0_source_commit, openxfactory_commit, spec_delta_last_touched_commit, source_commit
hermes-runtime handoff + verification, neutrality-drift baseline 9 keys commit, consumer_commit, expected_contract_ref, us3_baseline_commit

Two more orphans, and they are why the class exists

The packet knew of two. The class-wide verification found four.

74022ea5 — RETAINED (measured decision, flagged).
openspec/changes/archive/2026-08-22-add-doxbench-editing-phase-b/supporting-docs.manifest.yaml:31.
Measured before acting as requirement 2 obliges: cat-file -t = commit in the
shared object store, git branch -a --contains and git for-each-ref --contains
both EMPTY, and the pin absent from all 566 refs git ls-remote origin
advertises (403 of them refs/pull/*). Object still recoverable, window open, so
it was retained by the ruled route and the Q3 namespace:
refs/retention/pins/74022ea57354ab252abb0efa68c22474e4a2eb88, verified by
ls-remote. The manifest was NOT edited — it sits inside an archived packet.
This is a remote-state act taken by the implementing session. It was taken
because the act is fully ruled (Q3 named the namespace, Q2's execution set the
precedent, OD-4 cleared the route), because it is purely additive and reversible
by one command, and because the alternative was irreversible: an object nobody
retains is gone when garbage collection reaches it, and this one had survived
five days by accident.

66b14064 — UNRECOVERABLE. NEEDS BRETT.
openspec/changes/archive/2026-08-27-add-hermes-customer-subject-runtime-contract/evidence/provider-verification.yaml:15,
under the key us3_baseline_commit that no sweep vocabulary knew — which is
exactly how a renamed key becomes a silent loss of coverage. cat-file -t FAILS,
the pin is in none of the 566 advertised refs, the branch it was taken on
(005-customer-subject-runtime) is gone from the remote, and
git fetch origin 66b14064… is refused with upload-pack: not our ref.
Retention is IMPOSSIBLE, not merely not yet performed. This is requirement 2's
second branch, and its resolution is a superseding evidence record naming the
loss plus a disposition for the standing finding. Neither is performed
here, deliberately
— both are governance acts with a named authority, neither
is a code change, and a realization that wrote a superseding record for somebody
else's archived evidence would be inventing provenance. It is declared in
pin_class.KNOWN_LOSSES with the full measurement, RE-MEASURED by test (the day
the object turns out to be recoverable the row is stale, retention is the route,
and the test says so), and it holds fully_verified at FALSE so the loss cannot
quietly become background.

The pytest gate is green over it, deliberately: a standing governance obligation
with no available code repair would otherwise red every unrelated change until
the act lands, which is enforcement arriving through the back door — the same
reasoning four doc-health families launched advisory over a standing population
under. clean excludes a declared, re-measured loss; fully_verified does not.

Per-pin proof, real repository

63 declared pin sites across 20 class members: 49 reachable, 0 orphaned, 1 lost (declared unrecoverable), 0 inconclusive; 0 uncovered, 0 vanished, 0 future members now carrying pins.
Ref set consulted: refs/remotes/origin/main + refs/retention/pins/<full-sha>.

class member key sites via main via retention cross-repo lost
cross-reference-index source_revision 1 1
cross-reference-rendered Source revision: (PROSE) 1 1
ideation-readiness-run source_revision 2 2
derive-possibles-run source_revision 2 2
gate-transition-manifest source_revision 1 1
gate-action-record source_revision in a notes: string (PROSE) 1 1
spec-traceability source_revision 1 1
proposal-support-manifest source_revision 24 23 1
avatar-client-f0-pin f0_source_commit 3 3
avatar-client-f0-evidence source_commit 2 2
avatar-client-lab-transcription openxfactory_commit 1 1
avatar-client-lab-delta-touch spec_delta_last_touched_commit 1 1
ideation-routing-source revision 12 7 5
hermes-consumer-handoff-provider commit 1 1
hermes-provider-verification-contract-ref expected_contract_ref 1 1
hermes-provider-verification-us3-baseline us3_baseline_commit 1 1
omnigent-install-source-compatibility source_commit 1 1
hermes-consumer-handoff-consumer consumer_commit 1 1
hermes-provider-verification-domain commit 5 5
neutrality-drift-baseline commit 1 1
total 63 46 3 13 1

The three retention rows are the packet's worked example, and each is asserted
to be NOT reachable from main — a retained pin that main also reaches would
prove nothing about the namespace:

health/ideation-readiness/2026-08-24/brainstorm-packet-migration-20260824.yaml:5
  da9bf3b7… -> retained: origin refs/retention/pins/da9bf3b7…
health/ideation-readiness/2026-08-24/brainstorm-packet-migration-final-20260824.yaml:5
  f13a3b60… -> retained: origin refs/retention/pins/f13a3b60…
openspec/changes/archive/2026-08-22-add-doxbench-editing-phase-b/supporting-docs.manifest.yaml:31
  74022ea5… -> retained: origin refs/retention/pins/74022ea5…

Both readiness records are asserted BYTE-IDENTICAL to capture on their pin line,
against spelled-out literals rather than against the file being checked — which
is requirement 2's whole claim, demonstrated on the instances that forced it.

Reproduction

ideation/cross-reference.yaml reproduces from the corpus at its own pin
4e57009c — 290 entries, skeleton-identical — and cluster_skeleton is now
spelled once and shared with the readiness proof, because two spellings of "the
same skeleton" is how a reproduction claim quietly stops meaning anything.

A fixture proves the refusal that matters: a pin hand-moved to a perfectly
reachable new tip
with no regeneration is rejected. The fixture asserts the new
pin IS reachable first, so the test proves more than "unreachable pins fail" —
this is the exact act that produced f13a3b60, and a reachability-only rule
passes it.

Verification, pipefail on, exit codes read

check result
pytest tests/doc-health -q 1125 passed, 0 failed, 0 skipped in 121s, exit 0
baseline before this branch (same tree, --ignore the new module) 1077 collected — so +48, none displacing an existing test
pytest-suite CI on this head 6933 passed, 20 skipped, 338 deselected, 28 subtests passed, 0 failed in 12m38s — run 33091394406 on head b4cd8073 (the final head), success; wallet-validation success too. The identical figures came back on the preceding head fb134232 (run 33089969860) — same selection, same counts, twice
openspec validate govern-derived-pin-reachability --strict valid, exit 0
openspec validate --all --strict 76 passed, 0 failed (76 items), exit 0
contract bundle owed NONE
new tests 48 in tests/doc-health/test_pin_reachability.py

Bundle membership checked by parsing, not by grep. All 38
contracts/releases/*.digests.yaml inventories were parsed into their 192
distinct inventoried paths; none of the four touched files is among them. Worth
recording that a naive grep README.md hits all 38 and is a FALSE POSITIVE — the
members are contracts/README.md and contracts/hermes-runtime/README.md, not
the root file. Q1's ruling placed the declaration in scripts/doc_health/, not
under contracts/, so the contingency tasks.md § 4.4 named did not arise.

Two precondition guards that FAIL rather than skip

Six real-repository proofs degrade to a skip when the ref set cannot be
consulted — no main ref, or a retention namespace that is a remote read on a
machine with no network. This packet exists because seven proofs once reported
SKIPPED in every fresh clone, so neither skip is allowed to be silent. Both
halves of the ref set have their precondition asserted once, loudly:
test_this_repository_resolves_the_main_half_of_the_ref_set and
test_this_repository_can_consult_the_retention_namespace. The second also
asserts every advertised retention ref points at the commit its name states, so
a namespace that has lost or mis-aimed a ref is a failure rather than a quietly
orphaned record. tests/doc-health reports 0 skipped.

The preflight half of the enforcement home is deliberately unwired

The delta names two homes: "the readiness proof surface AND the per-repo
validator preflight". The first is realized. The second is not, and the reason
is measured — greping scripts/validate-*.py for merge-base / is-ancestor
returns NOTHING, so the existing pin obligation lives on the pytest surface
alone and the preflight clause describes where the index VALIDATOR runs. Three
reasons to stop short, the third decisive: run_preflight turns any non-zero
exit into an ERROR finding (enforcing severity on day one, over a class carrying
one standing unrecoverable loss); preflight._OPENX_NOARG is a hardcoded tuple;
and the verification consults the network, where whether a verification may
do so at all is fix-release-reachability-race's own named OPEN follow-up.
Wiring it into the nightly would answer that open question by implementation,
for every governed repository at once. What ships instead is a runnable entry
point — python3 -m doc_health.pin_class --repo . [--no-remote], exit 1 on a
repairable defect. Recorded as tasks.md § 5.6.

Deliberately not done

  • § 2.5's non-tool half. The task asks the check to verify a NAMED
    MEASUREMENT is recorded for members no generator re-derives. No committed
    artifact records one
    — there is no field, schema, or convention anywhere in
    the repository for a re-pin to write into, so the check has nothing to look
    for, and inventing a format would add a contract this packet explicitly
    declines to add. repair_route() states the obligation instead. Raised as
    follow-up § 5.3.
  • § 2.8's landing workflow. Stated, not automated, exactly as ruled. What is
    owed is that the obligation be DISCOVERABLE where it binds, and it is.
  • Markdown coverage. **/*.md is a declared non-member: governance prose
    quotes pins constantly and none of those is the quoting file's own claim. A
    declared markdown member is verified (ideation/cross-reference.md); an
    undeclared future one would go unswept where a .yaml one is caught. Stated
    as follow-up § 5.4.
  • No merge, no archive. § 4.3 stays open by design.

Measured decisions taken by the realization, all recorded in tasks.md

  1. main resolves as refs/remotes/origin/main BEFORE refs/heads/main —
    on evidence: the shared checkout's local main sat at 26e1e021 while
    origin/main was at 0417e9b5, and consulting the local branch reported a
    pin that HAD landed as orphaned. main in the requirement means the
    PUBLISHED branch.
  2. The retention namespace is consulted locally, then in ONE ls-remote — no
    default refspec fetches refs/retention/*, so it is a remote read. A remote
    that cannot be consulted yields INCONCLUSIVE, never a pass: an unaskable
    question is not an affirmative answer.
  3. Per-site locality is read out of the artifact where the artifact declares
    it (locality_from). Forced by hermes-install-g0-handoff.yaml carrying one
    repo-local and one cross-repository pin, and by routing records whose entries
    name their own repository. A key-boundary bug found by the first real run —
    commit matching the tail of consumer_commit — is pinned by test.
  4. The vanished direction is answered only for the repository the
    declaration describes.
    Run anywhere else every row would "vanish" and the
    report would be noise a reader learns to ignore.
  5. 74022ea5's retention ref was published (above).
  6. A precondition guard that FAILS rather than skips if no main ref
    resolves, so a checkout that stops providing one says so once, loudly,
    instead of six real-repository proofs quietly reporting SKIPPED on a green
    scoreboard — the silent-skip class harden-ideation-readiness-check was
    filed over.

Flagged for Brett

  1. 66b14064 needs a superseding record + disposition for
    add-hermes-customer-subject-runtime-contract's archived evidence. Not
    performable by code. tasks.md § 5.5.
  2. 74022ea5's retention ref is now on the remote — additive, reversible by
    git push origin --delete refs/retention/pins/74022ea5… if you disagree with
    the act.
  3. The proposal's inventory table is wrong (9 vs 63). It is kept verbatim and
    corrected in tasks.md § 2's preamble rather than rewritten, because a table
    rewritten to look prescient erases the evidence that a hand-swept inventory
    drifts.
  4. Ten proposal-support manifests carry sentinel pins —
    "uncommitted-worktree" (6), "not-applicable-ad-hoc" (1), absent (3). That
    generator already refuses to write a pin it cannot mean, which is what
    follow-up § 5.1 asks of git_generation(). Worth deciding whether the
    sentinel vocabulary should be shared and declared rather than invented per
    lane.

🤖 Generated with Claude Code

On the full selection: CI's pytest-suite runs the identical command the
gate names (python3 -m pytest tests/ -q -m "not postgres") and is the
authoritative result, so the local run of the same selection was stopped as
redundant rather than left half-finished and reported as though complete. The 20
skips are pre-existing and none is in tests/doc-health, which reports zero.

brettheap and others added 2 commits August 27, 2026 11:37
…s now

govern-derived-pin-reachability's requirement 4, realized. The promoted pin
obligation covered one artifact — the cross-reference index — and this extends
it to a DECLARED class of twenty members, judged against refs rather than
against a clone's object store.

Q1's ruled home: scripts/doc_health/pin_class.py, beside families.py, so the
declaration is itself checked. Every member carries its path globs, its key,
whether that key is a FIELD or PROSE, its generator, whether reproduction is
tool-defined, its locality, and whether it has committed instances yet. Both
prose members are declared — the .md twin's rendered line and a gate-action
`notes:` sentence — because a key-name scanner misses them, and all five
schema-declared future members are declared so the first committed instance is
covered on arrival rather than on discovery.

The ref set is `main` plus refs/retention/pins/<full-sha> COMPUTED from the pin,
and nothing else. Five stray ref shapes are refused by test, including the
refs/remotes/origin-retention/* leftovers this checkout carries from a deleted
remote. A retention ref that does not point at the commit its name states
retains nothing, and that is checked. The namespace is consulted locally first
and then in one `ls-remote`; a remote that cannot be consulted yields
INCONCLUSIVE, never a pass.

THE SEED INVENTORY IS MEASURED, NOT INHERITED. The packet's table reports 9
pins across 8 artifacts and 4 generators. Resolving every standalone 40-hex
token in every committed .yaml/.yml/.json against the object database finds 63
sites across 20 members and four generator families the sweep never saw — the
31 proposal-support transition manifests above all. It also found two more
orphans:

  74022ea (2026-08-22-add-doxbench-editing-phase-b's supporting-docs manifest)
  was orphaned and still recoverable, so it is RETAINED — published to
  refs/retention/pins/74022ea5… while the window was open, by the route
  requirement 2 rules and the namespace Q3 named, with the manifest unedited.

  66b14064 (add-hermes-customer-subject-runtime-contract's archived
  provider-verification evidence, under the key `us3_baseline_commit` that no
  sweep vocabulary knew) is orphaned AND UNRECOVERABLE: absent from the object
  store, absent from all 566 advertised refs, and `git fetch` of it is refused
  by the server with "not our ref". It is declared in KNOWN_LOSSES with the
  measurement and the superseding record it owes, re-measured by test so a
  stale exemption cannot stand, and it holds fully_verified at FALSE.

Reproduction is implemented where a tool defines derivation: the landed index
reproduces from the corpus at its own pin, 290 entries, skeleton-identical, and
a fixture proves the refusal that matters — a pin hand-moved to a perfectly
reachable new tip with no regeneration is rejected, which is the exact act that
produced f13a3b6. cluster_skeleton is now spelled once and shared with the
readiness proof.

NO DETERMINISTIC CHECK FAMILY IS ADDED (OD-2), and it is structural rather than
promised: families.py is untouched, pin_class defines no fam_* and imports
nothing from families, and a test fails if families.py ever mentions it.

tests/doc-health: 1077 -> 1123 passed, 0 failed, 0 skipped.
openspec validate --strict: valid; --all --strict: 76 passed, 0 failed.
No contract bundle owed: all 38 release inventories parsed to 192 paths, none
of them a file this change touches.

Co-Authored-By: Claude Fable 5 <[email protected]>
… meets

tasks.md carries the measured suite figures — tests/doc-health 1077 -> 1124
passed, 0 failed, 0 SKIPPED, on the tree rebased onto origin/main — and says why
the zero matters here rather than merely reporting it: the sibling packet's whole
forcing instance was seven proofs that reported SKIPPED in every fresh clone, so
a realization of the rule about it does not get to add more. The guard that
keeps it honest is a precondition test that FAILS rather than skips when no
`main` ref resolves, because six real-repository proofs degrade to a skip
without one and a green scoreboard full of skips is how the original defect hid.

pin_class states the consequence a future regenerator will actually meet: `main`
means the PUBLISHED branch, so an artifact re-pinned to one of its own unlanded
branch commits reports orphaned until that branch lands. That is the requirement
read literally, it is what house practice already does — the sibling re-pinned
to 4e57009, already on main, not to its branch tip — and the ref set is
deliberately not widened to admit the revision under test, because "main plus
whatever branch I happen to be on" is not a ref set a reader can reason about.

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

…wired

The delta names two homes for requirement 4's verification — the readiness proof
surface and the per-repo validator preflight. The first is realized; the second
is not, and a realization that left that silent would be indistinguishable from
one that forgot.

Measured rather than assumed: no preflight validator resolves a commit today
(grepping scripts/validate-*.py for merge-base and is-ancestor returns nothing),
so the existing pin obligation lives on the pytest surface alone and the
preflight clause describes where the index VALIDATOR runs. Three reasons to stop
short, and the third decides it. run_preflight turns any non-zero exit into an
ERROR finding, which is enforcing severity on day one over a class that carries
one standing unrecoverable loss. _OPENX_NOARG is a hardcoded tuple, so joining
it edits a shared entrypoint list rather than following a convention. And the
verification CONSULTS THE NETWORK — no default refspec fetches refs/retention/* —
where whether a verification may consult the network at all is
fix-release-reachability-race's own named OPEN follow-up. Wiring it into the
nightly would answer that open question by implementation, for every governed
repository at once.

What ships instead is a runnable entry point, `python3 -m doc_health.pin_class
--repo . [--no-remote]`, exit 1 on a repairable defect: available outside pytest
today, gated nowhere.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR realizes the govern-derived-pin-reachability OpenSpec change by introducing a declared “derivation-pin” artifact class and verifying that declared pins are reachable via a constrained ref set (main plus computed refs/retention/pins/<full-sha>), with the verification exposed on the existing readiness surface (rather than via a new doc-health family). It also adds an index reproduction check (tool-defined derivation) and a comprehensive regression suite capturing the measured defect scenarios.

Changes:

  • Add scripts/doc_health/pin_class.py defining the declared pin class, coverage sweep, and refs-based reachability verification (including retention-namespace semantics and declared known losses).
  • Add verify_pin_reachability() and index_reproduces_at() to scripts/doc_health/ideation_readiness.py to expose class-wide verification and enforce reproduction for the index pair.
  • Add tests/doc-health/test_pin_reachability.py to lock in behavior across reachability, retention refs, truncation handling, locality, declaration drift, and reproduction.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/doc-health/test_pin_reachability.py Adds regression coverage for refs-based pin reachability, retention semantics, declaration drift, locality, truncation, and reproduction refusal cases.
scripts/doc_health/pin_class.py Introduces the declared pin class registry, scan/exclusion rules, per-site locality extraction, and ref-set verification logic (including retention-namespace checks and known-loss handling).
scripts/doc_health/ideation_readiness.py Exposes class-wide reachability verification on the readiness surface and adds an index reproduction check via git archive re-derivation.
openspec/changes/govern-derived-pin-reachability/tasks.md Updates the change packet task record to reflect realization status, measured inventory expansion, and follow-ups.

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

Comment on lines +797 to +805
return (PIN_PROBE_FAIL,
f"DERIVATION-PIN REACHABILITY FAILED in a COMPLETE clone "
f"({report.truncation}). The ref set consulted was "
f"{report.main_ref} plus "
f"{pin_class.RETENTION_NAMESPACE}/<full-sha> computed from "
f"each pin, and no other ref: a commit surviving in this "
f"clone's object store is not reachability.\n{rendered}"
+ (f"\n\nREPAIR ROUTES:\n{detail}" if detail else ""),
report)
Comment on lines +887 to +890
with tempfile.TemporaryDirectory(prefix="pin-reproduction-") as tmp:
tarfile.open(fileobj=io.BytesIO(archived.stdout)).extractall(tmp)
derived = derive_clusters(corpus_mod.load_docs("openxFactory",
Path(tmp)))
Copilot AI review requested due to automatic review settings August 27, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

scripts/doc_health/pin_class.py:1203

  • PinResult.verdict is documented as only PASS/ORPHAN/INCONCLUSIVE/NOT_APPLICABLE, but the module also defines and emits LOST. This comment is now inaccurate and can confuse readers/maintainers.
@dataclass(frozen=True)
class PinResult:
    site: PinSite
    verdict: str               # PASS | ORPHAN | INCONCLUSIVE | NOT_APPLICABLE
    how: str                   # which half of the ref set answered, or why not

scripts/doc_health/ideation_readiness.py:804

  • verify_pin_reachability() always says it failed in a "COMPLETE" clone, but this branch can also trigger for non-reachability defects (e.g., uncovered/vanished/arrived) even when the clone is truncated. That makes the failure text potentially incorrect/misleading because report.truncation can explicitly indicate a shallow/partial clone.
    if report.orphans or report.uncovered or report.vanished or report.arrived:
        routes = []
        for result in report.orphans:
            member = next(m for m in pin_class.PIN_CLASS
                          if m.id == result.site.member_id)
            status = _committed_status(root, report.rev, result.site.path)
            routes.append(f"  {result.site.named()}\n    route -> "
                          f"{pin_class.repair_route(member, status=status)}")
        detail = "\n".join(routes)
        return (PIN_PROBE_FAIL,
                f"DERIVATION-PIN REACHABILITY FAILED in a COMPLETE clone "
                f"({report.truncation}). The ref set consulted was "
                f"{report.main_ref} plus "
                f"{pin_class.RETENTION_NAMESPACE}/<full-sha> computed from "
                f"each pin, and no other ref: a commit surviving in this "
                f"clone's object store is not reachability.\n{rendered}"
                + (f"\n\nREPAIR ROUTES:\n{detail}" if detail else ""),

Comment on lines +887 to +890
with tempfile.TemporaryDirectory(prefix="pin-reproduction-") as tmp:
tarfile.open(fileobj=io.BytesIO(archived.stdout)).extractall(tmp)
derived = derive_clusters(corpus_mod.load_docs("openxFactory",
Path(tmp)))
…id once

The retention namespace is a REMOTE read — no default refspec fetches
refs/retention/*, and three committed pins resolve only through it — so a
machine without network answers "I could not ask" rather than "there is no such
ref". As shipped a moment ago that turned into a hard assertion failure on a
transient outage, which is the wrong direction to be wrong in: the honest
outcome is a skip, because it is a fact about the environment and not about any
artifact.

So _real_report now skips when the namespace is unconsultable, and — because
this packet exists because seven proofs once reported SKIPPED in every fresh
clone — that skip is never silent. Both halves of the ref set now have a
precondition test that FAILS, once and loudly:
test_this_repository_resolves_the_main_half_of_the_ref_set and
test_this_repository_can_consult_the_retention_namespace. The second also
asserts every advertised retention ref points at the commit its name states, so
a namespace that has lost or mis-aimed a ref is a failure rather than a quietly
orphaned record.

48 tests, 1125 in tests/doc-health, 0 failed, 0 skipped.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Suppressed comments (2)

scripts/doc_health/ideation_readiness.py:802

  • The failure message always says "FAILED in a COMPLETE clone" and interpolates report.main_ref directly. This can be misleading when the clone is truncated (or when no main ref resolved) but the failure is due to uncovered/vanished/arrived declaration drift, not an answered reachability verdict. Make the wording clone-agnostic and render a safe placeholder when main_ref is None so the reason text remains accurate in all failure modes.
        return (PIN_PROBE_FAIL,
                f"DERIVATION-PIN REACHABILITY FAILED in a COMPLETE clone "
                f"({report.truncation}). The ref set consulted was "
                f"{report.main_ref} plus "
                f"{pin_class.RETENTION_NAMESPACE}/<full-sha> computed from "
                f"each pin, and no other ref: a commit surviving in this "

scripts/doc_health/ideation_readiness.py:890

  • index_reproduces_at() extracts a tar archive using tarfile.open(...).extractall(tmp) without a context manager or any path traversal guard. Even though the archive is produced by git archive, using extractall on unvalidated members is a known footgun and can write outside tmp if a crafted archive ever slips through. Use a context manager and validate member paths before extraction.
    with tempfile.TemporaryDirectory(prefix="pin-reproduction-") as tmp:
        tarfile.open(fileobj=io.BytesIO(archived.stdout)).extractall(tmp)
        derived = derive_clusters(corpus_mod.load_docs("openxFactory",
                                                       Path(tmp)))

tasks.md § 4.3 stays UNTICKED because the box is merged-plus-green and the merge
is deliberately not this session's act — but the green half is now evidence
rather than an expectation, so it is written down where the gate will be read.

openxFactory PR #424, head fb13423: pytest-suite success, running the identical
selection the gate names — 6933 passed, 20 skipped, 338 deselected, 28 subtests
passed, 0 failed in 12m38s (run 33089969860) — and wallet-validation success. The
20 skips are pre-existing and none of them is in tests/doc-health, which reports
zero: this packet descends from seven proofs that reported SKIPPED in every fresh
clone, so a realization of the rule about it does not get to add one.

openspec validate govern-derived-pin-reachability --strict: valid.
openspec validate --all --strict: 76 passed, 0 failed.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Suppressed comments (4)

Previously missed (2) — in code that hasn't changed since the last review.

scripts/doc_health/pin_class.py:1432

  • The --no-remote help text says unresolved pins report INCONCLUSIVE, but verify(..., allow_remote=False) reports pins not reachable from main as ORPHAN (see tests asserting this behavior). The CLI help should match the actual semantics to avoid operator confusion.
    parser.add_argument("--no-remote", action="store_true",
                        help="do not consult the retention namespace on the "
                             "remote; unresolved pins report INCONCLUSIVE")

scripts/doc_health/pin_class.py:1203

  • PinResult.verdict’s inline type comment omits the LOST verdict even though it’s a supported value and is rendered/used elsewhere in the module. This is small, but it makes the declared verdict set inaccurate for readers and tooling.
@dataclass(frozen=True)
class PinResult:
    site: PinSite
    verdict: str               # PASS | ORPHAN | INCONCLUSIVE | NOT_APPLICABLE
    how: str                   # which half of the ref set answered, or why not

scripts/doc_health/ideation_readiness.py:890

  • tarfile.extractall() is used on an archive payload without any safety filter. Since this runs in CI on potentially untrusted repository contents (e.g., a PR can introduce malicious paths), it’s safer to use tarfile’s extraction filter to prevent path traversal / special files from escaping the temp directory.
    with tempfile.TemporaryDirectory(prefix="pin-reproduction-") as tmp:
        tarfile.open(fileobj=io.BytesIO(archived.stdout)).extractall(tmp)
        derived = derive_clusters(corpus_mod.load_docs("openxFactory",
                                                       Path(tmp)))

scripts/doc_health/ideation_readiness.py:801

  • The failure message says "FAILED in a COMPLETE clone" but this branch can also be hit for declaration drift (uncovered/vanished/arrived) even when the clone is truncated. That wording is misleading because it implies the repo was verified with full history.

Consider rephrasing to avoid claiming the clone is complete and rely on the already-rendered truncation detail.

        return (PIN_PROBE_FAIL,
                f"DERIVATION-PIN REACHABILITY FAILED in a COMPLETE clone "
                f"({report.truncation}). The ref set consulted was "
                f"{report.main_ref} plus "
                f"{pin_class.RETENTION_NAMESPACE}/<full-sha> computed from "

@brettheap
brettheap merged commit 175682e into main Aug 27, 2026
3 checks passed
@brettheap
brettheap deleted the change/realize-pin-reachability branch August 27, 2026 17:51
brettheap pushed a commit that referenced this pull request Aug 27, 2026
…t names

pytest-suite on PR #427 read 1 failed, 6985 passed. The failure was
test_every_carriage_ledger_finding_over_the_real_tree_is_named, reporting by
name that ('qualify-avatar-live-voice', 'repo-boundary-governance', 'Neutral
avatar-client repository boundary') was no longer reported.

PR #424 (realize-pin-reachability) merged to main while this was open. Its
commit 7e4e2f9 -- "The client was extracted three weeks early under another
name, so canon learns to say openAvatar" -- renamed xfactory-avatar-client to
openAvatar in CANON and in the active delta that quotes it, in one commit.
That is the correct authoring move and it is exactly what the carriage arm is
advisory about: the block now carries all twelve of canon's units, so the
family correctly reports nothing for that requirement.

Fixed the way _moved()'s own message says to: merge origin/main (no rebase),
re-measure, update one row, record the cause and the commit beside it in the
source. NOTHING WAS LOOSENED -- the set is still an exact == comparison and
the tests are still in pytest-suite.

Verified before deleting, and the verification caught my own error. A first
ad-hoc probe reported "UNCARRIED: 12", the opposite conclusion, because
mbc.carried() returns the UNCARRIED units; F1's
test_case_and_trailing_punctuation_are_significant settles the direction. Read
correctly it returns none, and canon's sentence and the block's are
byte-identical. No triple was removed on the strength of a misread probe.

Re-measured at the merged head: 22 blocks, +1 warning / +8 info, 0 unresolved,
0 ordering, 0 marker defects, 0 error, 0 critical. Report 22 lines in 5 hunks
in the same three sections. Suite 1163 -> 1178 (+15, baseline re-derived by
moving this file aside rather than by subtracting -- the absolute numbers moved
by 48 because the merge brought in PR #424's own test_pin_reachability.py).
openspec validate 76. Scope diff over scripts/, openspec/ and .github/ empty.

Every figure in plan.md § THE FIGURES and evidence/self-gate.md now carries
BOTH measurements with the tree each was taken at.

This also answers the blast-radius open question with real data and settles
nothing, which is how it is recorded: evidence for keeping the tests in
pytest-suite (the gate worked; the remedy cost one merge and one line because
the message named the subject and the remedy) and evidence for moving them to
the nightly lane (the failing PR was authored by someone who already knew what
the gate was for, and the next one will not be). Brett's call, now on evidence
rather than on a hypothetical.

Co-Authored-By: Claude Opus 5 <[email protected]>
brettheap added a commit that referenced this pull request Aug 27, 2026
…this repository, names its findings, proves it examines its own packet, and moves the report in its own lines only (#427)

* The self-gate is specified and planned; the packet's figures were stale

Speckit F3 of add-modified-block-currency-check, phases specify and plan.
No test code yet.

Re-measured at 76a2ad2, through the family itself: 22 active MODIFIED
blocks, +1 warning / +9 info, 0 unresolved, 0 ordering, 0 marker defects.
The packet's § 4.1 figure (11 info) was taken at 9be81a4 over 23 blocks
and no longer describes any tree; § 4.2's basis
(add-family-enumeration-check's outcome) archived at f027d3b before the
family registered, so § 2.1's block is measured against CANON. Both are
recorded as orchestrator decisions D1 and D2, flagged for veto.

Also recorded: F1's task T057 (test_the_family_reads_its_own_packet_s_delta)
is ticked [x] in F1's tasks.md and its hand-off calls the assertion "live",
but no such function or assertion exists anywhere under tests/. F3 writes
it rather than duplicating nothing (D5), and this is F1 residue finding 6
after F2's five.

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

* Tasks, then an analyze pass that caught the spec claiming something false

Speckit F3 phases tasks and analyze. 31 tasks, no test code yet.

The analyze pass returned eleven findings, no CRITICAL. Five fixed before
implementation, six dispositioned; all eleven are recorded in tasks.md
§ Analyze pass rather than in a separate file.

The one worth naming here: the spec's motivating paragraph claimed that a
broken active_blocks would leave every fixture test green. It would not —
the fixture trees carry openspec/changes/, an archive/ directory and a
proposal.md each, so they route through the same discovery. The accurate
case is stronger and is now written: fixtures prove the RULES, nothing
proved the VERDICT. An overstatement in a document about lossy restatement
is worth recording rather than quietly correcting.

Two smaller ones changed the task list: FR-001 had no assertion (T024a
now asserts the gate reaches the corpus only through the family), and
FR-018 was stated at a level its mechanism did not cover (the family's own
module reads ONE context attribute; agg_root is read transitively by the
disposition reader, and T024 now pins both levels).

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

* The self-gate: fifteen tests that name what the family says about this tree

Speckit F3 of add-modified-block-currency-check, § 4.1-4.5. One new test
module, tests/doc-health/test_modified_block_currency_self_gate.py. No
module change; scripts/, openspec/ and .github/ show no diff.

Gates: pytest tests/doc-health 1115 -> 1130 (+15); openspec validate
--all --strict 76 passed; the single-repo report moves 0 critical,
0 error, +1 warning, +9 info against the same run with the family
skipped, in 24 lines across three sections and nowhere else. F1's, F2's
and the enumeration suites read 176, unchanged.

The verdict is asserted by NAMED SUBJECT, never by count: the one warning
by all four of its fields (add-composed-view-authoring / 'Composed views
are read-only with a repository jump' omitting canon's 'Gate verbs hide
on a composed view'), the nine info as an exact set of (change,
capability, requirement) triples, and three empty classes by the module's
own rule text with a positive control on each probe. A discovery floor is
asserted separately, naming no severity and no subject, so no assertion
here can pass on an empty read.

Four things in the packet's § 4 were wrong as written, each recorded as an
orchestrator decision flagged for veto:

- § 4.1's count (11 info) was taken at 9be81a4 over 23 MODIFIED blocks;
  this tree carries 22 and reads 9. (D1)
- § 4.2 asks the block be measured against add-family-enumeration-check's
  outcome; that sibling archived at f027d3b before the family registered,
  so the basis is CANON and the gate asserts both the basis that exists
  and the sibling's absence. (D2)
- § 4.5 asks for "+1 warning, +11 info ... headline unchanged", and the
  headline is the line those counts print on. Implemented as: the error
  and critical bands do not move. (D3)
- F1's T057 own-packet hook is ticked [x] and does not exist. F3 wrote
  the assertion. F1 residue finding 6. (D5)

The mutation round's finding is worth the commit message: this machine
carries FIFTEEN other measurable openxFactory checkouts, so pointing the
resolver at another tree is not a hypothetical. Pointed at the shared
submodule checkout -- exactly the tree harden-ideation-readiness-check's
ancestor walk always landed on -- four tests kill it independently, and
that tree is a genuinely different corpus: two warnings, five ledger
subjects this branch does not have, and add-family-enumeration-check
still ACTIVE in it.

Six mutants, all killed. Two tests went RED on their own first run, both
on the same mistake in opposite directions: matching a probe on a MENTION
rather than a USE. One was the positive control on the zero-class probes
doing exactly its job. Both are recorded rather than quietly fixed.

This gate is EXPECTED to fall due when add-composed-view-authoring
declares its rename, which packet § 6.3 already calls the correct
disposition. Every corpus assertion's failure message says so and names
the re-measure command and the zero end state. Do not loosen it.

This change does NOT close #330 (packet § 7.1), and the domain factories
remain unmeasured (§ 7.4).

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

* The self-gate asserted the developer's filesystem; CI has no such ancestor

Combined review of add-modified-block-currency-check F3: one blocker and six
findings. Tests and specs only; scripts/, openspec/ and .github/ still show
no diff.

B1, THE BLOCKER. test_the_resolver_fails_on_a_checkout_it_cannot_confirm_
and_never_walks_up searched ROOT.parents for a real checkout carrying
.gitmodules and xFactories/ and asserted one was FOUND. That is an
assertion about the developer's filesystem, not about the resolver: it
passes in a worktree under the aggregation checkout and fails in the
required pytest-suite check, which runs against a bare
$GITHUB_WORKSPACE/openxFactory with no such ancestor. A green branch would
have reddened a required check.

The repository's standing answer to an environment-dependent proof is to
skip it (test_session_harness.py:251,
test_aggregation_register_instance.py:25-27), and both are right for a
proof that NEEDS a real aggregation tree. This one does not. Its content
is "aggregation markers without the family markers are refused", which a
tmp_path decoy states in every environment with no skip and no filesystem
assumption. Removing the dependence beats guarding it.

N1: the context-surface pin had two holes and both survived a mutant. The
attribute probe matched only ctx.<attr>, so getattr(ctx, "git", None) --
the spelling the disposition reader itself uses -- went unseen; and
source.count("load_dispositions(ctx") == 1 proved one known collaborator
is called once rather than that there is one collaborator, so a second
_second_reader(ctx) survived beside it. Now a union of both read shapes
and a SET of callees. Tightening the callee regex to \(ctx\s*[,)] was
needed too: \(ctx\b collected `sorted`, from sorted(ctx.repo_paths.items()).

N2: the allowlist pin matched MENTIONS while its own docstring said
"matched on use" -- naming a family attribute in any docstring reddened
it. Then the FIX for it reddened it the same way, because the first
_without_docstrings did not strip comments either. _code_only now strips
docstrings and whole-line comments, and both directions are proven: a
mention passes, the same name in real code still fails.

N6: the report's H1 is `# Doc-Health Report — <date>`, which _SECTION does
not match (its em dash is outside the heading class), so it landed in
(preamble) and was compared verbatim. Two report runs ~7s apart straddling
midnight would have failed the movement pin for a reason unrelated to this
family. The title is dropped by name rather than matched -- widening
_SECTION would let it parse `### Requirement:`, which another test forbids
on purpose -- and the caller asserts both reports carried one, so the drop
cannot hide a change it was not written for.

N3: the documented zero end-state was unreachable by the documented
mechanism. At zero findings the movement pin's two vacuity guards are TRUE
of the desired state, so quickstart § The end state and _moved()'s
guidance now name those two lines as the ones to re-aim.

N4: this change's OWN archival after F4 reds four assertions, nearer than
the composed-view rename and previously unmentioned. Recorded in
quickstart § WHEN THE GATE FAILS and in the F4 hand-off with the expected
disposition -- re-aim at the archived path (a change of subject, since the
family excludes archive/) or retire with a dated record. Deleting silently
is the one wrong answer.

N7: five len(...)==1 asserts sit beside the brief's one permitted count.
The scenario-arm docstring now says why joint count-and-subject assertions
are the sanctioned reading of § 4.1's anti-vacuity rule rather than a
drift from it.

N5 lands in F1's file, where F1's owner reads: residue finding 6 appended
to the numbered list after F2's five, and the false `- [x] T057` box
downgraded to `[~]` with a pointer to the two F3 tests that do the work.
Verified phantom: `git grep -n reads_its_own_packet origin/main --
tests/` is empty. The progress line claiming T001-T057 done is corrected.
The lesson is the packet's own: a ticked box is a restatement, and a
restatement can be lossy.

N8: evidence § 2 now names the openspec item behind 75 -> 76 --
govern-derived-pin-reachability, PR #416, merge d2ed6d3, proven absent at
F1's branch point 19e3f6b.

Also recorded as an OPEN QUESTION FOR BRETT in the F4 hand-off, not
decided here: _LEDGER_SUBJECTS is an exact set of nine live corpus triples
in a REQUIRED check, so any PR adding or archiving a lossy MODIFIED block
reds this gate. The option is a marker routing the six corpus-facing tests
to the nightly lane; it trades away § 4's PR-gate intent. Pending his
call the tests stay in pytest-suite.

Gates: pytest tests/doc-health 1130; openspec validate --all --strict 76.

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

* The CI shape proved: 15 of 15 where the pre-fix file read 1 failed / 14

Evidence and PR body for the combined review's fixes.

§ 7a CI shape records the blocker's reproduction and closure, both halves
measured in the same tree: git archive HEAD into a scratch dir, git init,
no aggregation ancestor (confirmed by walking every parent), then the
pre-fix file from 0a15bee reading "1 failed, 14 passed" and the fixed
file reading "15 passed".

It also records what the harness does NOT reproduce, because that run is
not green: the whole doc-health suite reads 4 failed there, and all four
are git-history readers (F2's two historical reconstructions and the two
readiness proofs) failing on a tree with exactly one commit. git archive
| git init discards history on purpose; real CI checks out at
fetch-depth: 0. So "15 of 15 in the harness" is the claim and "the suite
is green in CI shape" is not, and is not made.

§ 6a records the second mutation round with the mutants that proved each
fix, including the one worth remembering: the fix for the prose-matching
allowlist REPRODUCED the defect it was fixing, because the comment
explaining it named a family attribute. That is three separate times a
probe in this family's suite has been caught matching a mention rather
than a use, so the pattern is recorded rather than trusted to intention.

The PR body carries the CI-shape proof, the blast-radius open question
for Brett, and the issue decision: Refs #357, Refs #329, Refs #330 --
NOT Closes. Checked rather than assumed. #330 is explicitly held open by
proposal.md:311-313 and tasks.md § 7.1. #357 and #329 carry no closure
claim anywhere in the packet (the only clos* matches are #318's origin
ruling and the two #330 disclaimers), and substantively neither is
discharged: § 8.1 makes the archive a separate later act after F4 and the
merge, and #329's blocks are reported-and-standing under § 7.2's advisory
launch. An issue about text that is still lost is not closed by a check
that now mentions it.

Gates: pytest tests/doc-health 1130; openspec validate 76; CI shape 15;
scope diff over scripts/, openspec/ and .github/ empty.

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

* The gate fell due on its own pull request, so the remedy is the one it names

pytest-suite on PR #427 read 1 failed, 6985 passed. The failure was
test_every_carriage_ledger_finding_over_the_real_tree_is_named, reporting by
name that ('qualify-avatar-live-voice', 'repo-boundary-governance', 'Neutral
avatar-client repository boundary') was no longer reported.

PR #424 (realize-pin-reachability) merged to main while this was open. Its
commit 7e4e2f9 -- "The client was extracted three weeks early under another
name, so canon learns to say openAvatar" -- renamed xfactory-avatar-client to
openAvatar in CANON and in the active delta that quotes it, in one commit.
That is the correct authoring move and it is exactly what the carriage arm is
advisory about: the block now carries all twelve of canon's units, so the
family correctly reports nothing for that requirement.

Fixed the way _moved()'s own message says to: merge origin/main (no rebase),
re-measure, update one row, record the cause and the commit beside it in the
source. NOTHING WAS LOOSENED -- the set is still an exact == comparison and
the tests are still in pytest-suite.

Verified before deleting, and the verification caught my own error. A first
ad-hoc probe reported "UNCARRIED: 12", the opposite conclusion, because
mbc.carried() returns the UNCARRIED units; F1's
test_case_and_trailing_punctuation_are_significant settles the direction. Read
correctly it returns none, and canon's sentence and the block's are
byte-identical. No triple was removed on the strength of a misread probe.

Re-measured at the merged head: 22 blocks, +1 warning / +8 info, 0 unresolved,
0 ordering, 0 marker defects, 0 error, 0 critical. Report 22 lines in 5 hunks
in the same three sections. Suite 1163 -> 1178 (+15, baseline re-derived by
moving this file aside rather than by subtracting -- the absolute numbers moved
by 48 because the merge brought in PR #424's own test_pin_reachability.py).
openspec validate 76. Scope diff over scripts/, openspec/ and .github/ empty.

Every figure in plan.md § THE FIGURES and evidence/self-gate.md now carries
BOTH measurements with the tree each was taken at.

This also answers the blast-radius open question with real data and settles
nothing, which is how it is recorded: evidence for keeping the tests in
pytest-suite (the gate worked; the remedy cost one merge and one line because
the message named the subject and the remedy) and evidence for moving them to
the nightly lane (the failing PR was authored by someone who already knew what
the gate was for, and the next one will not be). Brett's call, now on evidence
rather than on a hypothetical.

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

---------

Co-authored-by: brettheap <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants