Repository navigation
Realize fix-release-reachability-race: the remote's answer is fetched before it is compared, and contract-v1.44 carries the bytes - #390
Conversation
The release verifier asked the remote a live question and answered it out of a static object store: `_ls_remote` named what `refs/heads/main` points at on the remote right now, and `_is_ancestor` then ran `git merge-base --is-ancestor` inside a clone that may never have seen that object. When main advanced after the checkout the object was simply absent, merge-base exited 128 rather than 0 or 1, and the guard refused with "commit reachability could not be determined" — a fail-closed refusal produced by somebody else's merge. Measured on PR #372: one tree, three attempts, two failures each with a merge inside its window, one pass with a quiet one. The obligation moves to the operand. `_resolve_remote_object` probes with `git cat-file -e <oid>^{object}` — 0.006s and no network on an already-current clone — and only on absence fetches the single named object with `--no-tags --no-write-fetch-head`, so the mutation is confined to the object store and the clone's refs are left alone. It is called where each remote-derived id enters the local world, which covers all four readers by construction: the candidate ancestor check, the release-surface comparison and its per-member blob reads, the published-tag ancestor check, and the tag's tree walk. `_is_ancestor` is byte-unchanged; its 128 branch is the last line of defence. Three outcomes are now told apart. A candidate genuinely off published main keeps its existing refusal finding. Transient skew resolves in the fetch and produces no finding. An object that cannot be retrieved stays a fail-closed dependency refusal, never a finding and never a verdict invented from an absence, but its reason names the retrieval instead of announcing the verifier's own uncertainty. Q1 decided on measurement rather than on caution: no ref-fetch fallback. The canonical remote served a bare object id under no tracked ref in 4.80s from a depth-1 clone and in 6.55-8.49s from stale full clones, and the cost is the handshake rather than the object count, so a ref fetch would have bought nothing while bringing history nobody asked for. Q2's fixture mechanism was measured and the measurement corrected it. Chmod 000 on the whole bare `objects/` directory makes git refuse the path as a repository, so ls-remote itself exits 128 and the fixture would have proved the pre-existing remote-unavailable path. Revoking read on the single object file keeps advertisement working while upload-pack answers "not our ref", which is the condition wanted, so the real fixture is kept and the authorized monkeypatch fallback is unused. Six proofs drive the condition instead of describing it: a second clone advances the bare origin's main so the verifying repository genuinely lacks the advertised object. Two skew proofs, one release-surface proof asserting exact equality on the whole finding list so a false drift on every surface path cannot slip through, one unavailable-object proof, and a two-case mutation proof. Pinned twice — in-process and by commenting out the call sites, where all four failed at release.py:200. The verifier is a non-editorial member of its own inventory, so the bytes moving owes a cut. contract-v1.44, additive: no schema bytes, no schema version advance, no instance valid at contract-v1.43 narrowed, 192 entries as before, built twice to one digest and never hand-edited. The tag belongs to the post-merge cut. Realizes fix-release-reachability-race. Does not archive it. 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 fix-release-reachability-race change by ensuring any remote-derived Git object IDs (remote main tip and advertised tag targets) are fetched into the local object store before running local ancestry/tree/blob operations, eliminating nondeterministic “object missing” refusals caused by mid-run remote advancement.
Changes:
- Add
_resolve_remote_object()to probe (git cat-file -e) and, if needed, narrowly fetch (git fetch --no-tags --no-write-fetch-head <remote> <oid>) remote-derived objects before they are consumed locally. - Call the resolver at the operand-entry points in
verify_promotion()andverify_tag()so all downstream reads (ancestor check, surface drift, tag tree walk) are covered. - Add regression tests that drive mid-run skew and unservable-object scenarios; bind new proofs into the Hermes runtime evidence register; cut
contract-v1.44to carry the updated validator bytes.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
scripts/hermes_runtime_validation/release.py |
Introduces _resolve_remote_object() and resolves remote-derived operands before local ancestry/tree/blob reads. |
tests/hermes_runtime_contracts/test_release_inventory.py |
Adds fixtures + tests that deterministically reproduce skew/unservable-object cases and pin the fix via mutation checks. |
contracts/hermes-runtime/evidence-register.yaml |
Registers the new tests under existing SCO-002 scenarios so parity/collection gates include them. |
contracts/manifest.yaml |
Bumps contract_bundle_version to contract-v1.44. |
contracts/CHANGELOG.md |
Documents the additive contract-v1.44 release and why the cut is required. |
contracts/releases/contract-v1.44.digests.yaml |
Adds the new digest inventory for contract-v1.44 to carry updated validator bytes. |
openspec/changes/fix-release-reachability-race/tasks.md |
Marks realization tasks as completed and records measured decisions/outcomes. |
openspec/changes/fix-release-reachability-race/design.md |
Appends realization-time measurement results and the shallow-clone note. |
README.md |
Updates the active-change index entry to reflect realization as contract-v1.44 and summarize the mechanism/proofs. |
Suppressed comments (1)
scripts/hermes_runtime_validation/release.py:251
- If the post-fetch
cat-fileconfirmation fails, the current message doesn’t include any details from the failing git invocation. Adding rc/stderr will make it much easier to diagnose cases where the fetch succeeded but the object still can’t be resolved locally.
if confirm.returncode != 0:
raise ReleaseDependencyError(
f"remote object fetch did not provide {object_id} from {remote}"
)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if fetch.returncode != 0: | ||
| raise ReleaseDependencyError( | ||
| f"remote object fetch failed: {remote} would not serve {object_id}" | ||
| ) |
There was a problem hiding this comment.
Accepted and fixed. You are right that the message asserted a cause it had not observed, which is the exact fault the delta this change realizes names ("a reason that guesses is worse than a reason that names"). The reason now reads remote object fetch failed: <remote> <oid> (git exit <n>) — it names the fetch, the remote, the object and git's exit status, and claims nothing about why.
One deliberate departure from your suggestion: the captured stderr is NOT embedded. Two reasons. _run_git in this module already raises deliberately terse messages with no subprocess output (Git command failed, remote main is unavailable), so embedding it here would break the family's convention in one place only. And a git transport error can carry the remote URL, which is not something a governance dependency error should be free to reprint. The exit status plus the named retrieval gives the reader the discrimination canon actually requires — check the network or the credential, rather than check the candidate.
Recorded in contracts/CHANGELOG.md and at tasks.md § 3.3, both citing this review.
Records the realization verification in tasks.md rather than leaving it only in the pull request: the second continuous-integration selection (tests/ at 6494 passed, 15 skipped, zero failures, with both known local artifacts recorded as not-fired rather than not-chased), the two wallet gates, and the verify-commit / verify-promotion outputs. verify-promotion exits 1 with findings rather than 2 with a dependency refusal, which is itself the fix working: a definite answer where the published code could only say the question was unanswerable. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
tests/hermes_runtime_contracts/test_release_inventory.py:982
- The fixture restores unreadable object files to a hard-coded mode (
0o644). Even though this is undertmp_path, forcing permissions can still be brittle (umask differences, pack files often being0444, and potential future additions like.idxhandling). Safer is to capture and restore the original mode(s) for each path you chmod.
finally:
for path in revoked:
path.chmod(0o644)
message = str(excinfo.value)
| _resolve_remote_object(repo_root, remote, main_oid) | ||
|
|
||
| if not _is_ancestor(repo_root, commit_oid, main_oid): | ||
| findings.append( |
There was a problem hiding this comment.
Correct, measured independently before this review, and deliberately NOT fixed here — with the rule you propose written down for a ruling rather than left implicit.
MEASURED 2026-08-26 against the canonical remote, in a --depth 1 clone of main: the published validator refuses with commit reachability could not be determined (128, object absent), and this branch fetches the object, reaches merge-base, and gets rc 1 out of a grafted history — a false HGR-RELEASE-TAG-UNREACHABLE on a tag that is perfectly reachable. So the hazard is real and it is stated plainly in the pull request body under "Flagged", not buried.
Why it is not closed in this pull request:
- Both workflows that run this suite check out at
fetch-depth: 0(pytest-suite.yml:206,doc-health-reusable.yml:813), so no measured run is shallow. The faithful reproduction of the defect this change fixes needed a NON-shallow stale clone, and there the new code completes with zero findings. - The hazard pre-exists this change in kind: a shallow clone that held the object but not the connecting history already got a false rc 1. What this change does is widen how often the comparison is REACHED in a truncated store.
- This realization was commissioned against a task list with four decisions already ruled and a standing instruction not to add mechanism beyond what a measurement forces. Adding a refusal path for a population nobody has measured failing would be a fifth decision taken unbidden, and it would change the verdict for shallow users who legitimately get a correct negative today.
The rule, recorded at tasks.md § 6.4 so it can be accepted or declined on this evidence rather than re-derived: a POSITIVE ancestor verdict is trustworthy in any store, because a path git found is a path that exists; a NEGATIVE verdict in a shallow store is not. So refuse — as a dependency refusal naming the truncated history — only when _is_ancestor returns false AND git rev-parse --is-shallow-repository says true, at the two call sites rather than inside _is_ancestor, whose 128 branch § 2.4 protects and a mutation proof depends on. One local git call, no network, no widening.
There was a problem hiding this comment.
Resolved by ruling, and fixed in d548d04d. Brett ruled on 2026-08-26 (multi-choice, recommended option) that this be folded into #390 rather than deferred to its own packet, so the rule from tasks.md § 6.4 is now implemented exactly as it was specced there — your reading of the hazard was right, and it arrived twice independently: measured here against the canonical remote in a --depth 1 clone, and by your review.
_refuse_unreachable_in_a_shallow_clone(repo, ancestor, descendant) runs git rev-parse --is-shallow-repository and, when it answers true, raises ReleaseDependencyError("ancestry cannot be judged in a shallow clone: <ancestor> against <descendant>"). It is called ONLY on the FALSE branch of the two _is_ancestor call sites — before HGR-RELEASE-CANDIDATE-UNREACHABLE in verify_promotion and before HGR-RELEASE-TAG-UNREACHABLE in verify_tag — and NOT inside _is_ancestor, which stays byte-unchanged against origin/main because a mutation proof depends on its 128 branch.
The asymmetry is deliberate and is what keeps this cheap: a POSITIVE verdict is honoured in any store, because a path git found is a path that exists and truncation can only hide paths, never invent them. Only the negative is re-examined, so the cost is one local rev-parse on a branch the ordinary case never enters — no network, and nothing added to the 30-second budget on the common path.
One consequence is accepted on the record rather than engineered around: a shallow clone holding a GENUINELY unreachable candidate now takes the refusal as well, so a shallow verification can no longer emit either UNREACHABLE code. The verifier cannot distinguish an earned negative from an artefact of its own store, and a fail-closed refusal naming the truncation is honest about both.
Proofs, over a real --depth 1 clone (which needs a file:// URL, since git ignores --depth on a plain local path):
test_verify_tag_refuses_a_negative_verdict_a_shallow_clone_cannot_earn— the tag IS at published main's own parent, so it is genuinely reachable; asserts the shallow refusal, assertsUNREACHABLEis absent from the message, and asserts a FULL clone of the same origin returns== [].test_verify_promotion_refuses_a_negative_verdict_in_a_shallow_clone— the candidate path, with a full-history oracle asserting the negative is genuinely earned.test_a_shallow_clone_still_answers_when_merge_base_can_say_yes— pins the asymmetry.
Both refusal proofs are mutation-pinned at source level: neutralize the two call sites and both fail DID NOT RAISE, while the asymmetry proof still passes. Canon moved too — requirement 2 of the spec delta gains a fourth scenario, A truncated history returns a negative it cannot earn, and the three tests are bound in contracts/hermes-runtime/evidence-register.yaml under SCO-002-S04 and SCO-002-S02.
tests/hermes_runtime_contracts -m "not postgres": 508 passed, exit 0. openspec validate --all --strict: 78 passed, 0 failed. contract-v1.44 inventory rebuilt over the moved bytes, built twice to one digest, verify-commit pass.
| _resolve_remote_object(repo_root, remote, main_oid) | ||
| if not _is_ancestor(repo_root, peeled_commit, main_oid): | ||
| findings.append( |
There was a problem hiding this comment.
Correct, measured independently before this review, and deliberately NOT fixed here — with the rule you propose written down for a ruling rather than left implicit.
MEASURED 2026-08-26 against the canonical remote, in a --depth 1 clone of main: the published validator refuses with commit reachability could not be determined (128, object absent), and this branch fetches the object, reaches merge-base, and gets rc 1 out of a grafted history — a false HGR-RELEASE-TAG-UNREACHABLE on a tag that is perfectly reachable. So the hazard is real and it is stated plainly in the pull request body under "Flagged", not buried.
Why it is not closed in this pull request:
- Both workflows that run this suite check out at
fetch-depth: 0(pytest-suite.yml:206,doc-health-reusable.yml:813), so no measured run is shallow. The faithful reproduction of the defect this change fixes needed a NON-shallow stale clone, and there the new code completes with zero findings. - The hazard pre-exists this change in kind: a shallow clone that held the object but not the connecting history already got a false rc 1. What this change does is widen how often the comparison is REACHED in a truncated store.
- This realization was commissioned against a task list with four decisions already ruled and a standing instruction not to add mechanism beyond what a measurement forces. Adding a refusal path for a population nobody has measured failing would be a fifth decision taken unbidden, and it would change the verdict for shallow users who legitimately get a correct negative today.
The rule, recorded at tasks.md § 6.4 so it can be accepted or declined on this evidence rather than re-derived: a POSITIVE ancestor verdict is trustworthy in any store, because a path git found is a path that exists; a NEGATIVE verdict in a shallow store is not. So refuse — as a dependency refusal naming the truncated history — only when _is_ancestor returns false AND git rev-parse --is-shallow-repository says true, at the two call sites rather than inside _is_ancestor, whose 128 branch § 2.4 protects and a mutation proof depends on. One local git call, no network, no widening.
There was a problem hiding this comment.
Resolved by ruling, and fixed in d548d04d. Brett ruled on 2026-08-26 (multi-choice, recommended option) that this be folded into #390 rather than deferred to its own packet, so the rule from tasks.md § 6.4 is now implemented exactly as it was specced there — your reading of the hazard was right, and it arrived twice independently: measured here against the canonical remote in a --depth 1 clone, and by your review.
_refuse_unreachable_in_a_shallow_clone(repo, ancestor, descendant) runs git rev-parse --is-shallow-repository and, when it answers true, raises ReleaseDependencyError("ancestry cannot be judged in a shallow clone: <ancestor> against <descendant>"). It is called ONLY on the FALSE branch of the two _is_ancestor call sites — before HGR-RELEASE-CANDIDATE-UNREACHABLE in verify_promotion and before HGR-RELEASE-TAG-UNREACHABLE in verify_tag — and NOT inside _is_ancestor, which stays byte-unchanged against origin/main because a mutation proof depends on its 128 branch.
The asymmetry is deliberate and is what keeps this cheap: a POSITIVE verdict is honoured in any store, because a path git found is a path that exists and truncation can only hide paths, never invent them. Only the negative is re-examined, so the cost is one local rev-parse on a branch the ordinary case never enters — no network, and nothing added to the 30-second budget on the common path.
One consequence is accepted on the record rather than engineered around: a shallow clone holding a GENUINELY unreachable candidate now takes the refusal as well, so a shallow verification can no longer emit either UNREACHABLE code. The verifier cannot distinguish an earned negative from an artefact of its own store, and a fail-closed refusal naming the truncation is honest about both.
Proofs, over a real --depth 1 clone (which needs a file:// URL, since git ignores --depth on a plain local path):
test_verify_tag_refuses_a_negative_verdict_a_shallow_clone_cannot_earn— the tag IS at published main's own parent, so it is genuinely reachable; asserts the shallow refusal, assertsUNREACHABLEis absent from the message, and asserts a FULL clone of the same origin returns== [].test_verify_promotion_refuses_a_negative_verdict_in_a_shallow_clone— the candidate path, with a full-history oracle asserting the negative is genuinely earned.test_a_shallow_clone_still_answers_when_merge_base_can_say_yes— pins the asymmetry.
Both refusal proofs are mutation-pinned at source level: neutralize the two call sites and both fail DID NOT RAISE, while the asymmetry proof still passes. Canon moved too — requirement 2 of the spec delta gains a fourth scenario, A truncated history returns a negative it cannot earn, and the three tests are bound in contracts/hermes-runtime/evidence-register.yaml under SCO-002-S04 and SCO-002-S02.
tests/hermes_runtime_contracts -m "not postgres": 508 passed, exit 0. openspec validate --all --strict: 78 passed, 0 failed. contract-v1.44 inventory rebuilt over the moved bytes, built twice to one digest, verify-commit pass.
Copilot's review of #390 caught the new message asserting a cause nobody observed: "remote would not serve <oid>" is one of four things a failed fetch can mean, the others being a refused credential, an unreachable host and a timeout. Naming the wrong one sends the reader to the wrong place, which is the exact fault the delta this change realizes calls out — a reason that guesses is worse than a reason that names. The reason now reads `remote object fetch failed: <remote> <oid> (git exit <n>)`. It names the retrieval, the remote, the object and git's exit status, and claims nothing beyond them. Subprocess output stays out on purpose: `_run_git` already raises deliberately terse messages with no stderr, and a git transport error can carry the remote URL, which a governance dependency error has no business reprinting. The proofs are unaffected — they assert the message names the fetch and the oid and does NOT announce that reachability could not be determined, all of which still holds. The verifier's bytes moved again, so the contract-v1.44 inventory is rebuilt over them: entries=192 unchanged, built twice to one digest, never hand-edited. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Suppressed comments (3)
Previously missed (2) — in code that hasn't changed since the last review.
tests/hermes_runtime_contracts/test_release_inventory.py:954
- The fixture makes object files unreadable via chmod(0o000) but doesn’t preserve the original permissions, forcing callers to guess how to restore them. This can leave the bare origin in an unexpected state and make the test flaky across platforms/umasks. Capture the original mode before revoking read and return it so the caller can restore exactly.
This issue also appears on line 972 of the same file.
assert revoked, "the fixture found no object file to make unreadable"
for path in revoked:
path.chmod(0o000)
return revoked
contracts/CHANGELOG.md:20
- Typo: “re-severitied” isn’t a standard spelling and reads like a misspelling of “re-severitized”.
upgrades. No finding code is added, removed, renamed or re-severitied, and
tests/hermes_runtime_contracts/test_release_inventory.py:973
- The cleanup restores unreadable object files to a hard-coded 0o644, which may not match the repository’s original object/pack file permissions (often read-only). Restore the exact modes captured when revoking read so the fixture is reversible.
revoked = _revoke_read_on_the_remote_object(origin, advanced)
try:
Ruled by Brett on 2026-08-26: fold this in rather than defer it. Fetching the operand made the object present and left the ancestry absent. A shallow clone's graft boundary declares its oldest commits parentless, so merge-base returns a definite 1 for a commit that is reachable on the real history — and the resolution step, by getting past the 128, delivered the run to that false answer. Measured against the canonical remote in a depth-1 clone, and raised independently by Copilot's review of #390, which is two arrivals at the same finding. The rule is the asymmetry. A positive ancestry answer is trustworthy in any store, because a path git found is a path that exists and truncation can only hide paths, never invent them. A negative answer is precisely what truncation manufactures. So only the negative is re-examined: _refuse_unreachable_in_a_shallow_clone runs one local rev-parse on the false branch of each ancestor check and, in a truncated store, refuses with "ancestry cannot be judged in a shallow clone" instead of emitting the unreachable finding. Nothing on the ordinary path, no network, and _is_ancestor is still byte-unchanged against origin/main — the guard sits at the two call sites, where § 2.4 requires it. One cost is accepted rather than engineered around. A shallow clone holding a genuinely unreachable candidate takes the refusal too, so a shallow verification can no longer emit either UNREACHABLE code. The verifier cannot tell an earned negative from an artefact of its own store, and a verification that cannot establish which of the two it holds has earned neither verdict. Exit 2 where exit 1 stood; both block, and only one is honest about why. Canon moves with the code: requirement 2 gains a fourth scenario, because a truncated history is a fourth way the question goes unanswered and requirement 2 owns that taxonomy. Three proofs over a real depth-1 clone pin the two refusals and the asymmetry, the two refusals are mutation-pinned at source level, and all three are bound in the evidence register. The verifier's bytes moved again, so the contract-v1.44 inventory is rebuilt over them: 192 entries, built twice to one digest, never hand-edited. 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 1 comment.
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
tests/hermes_runtime_contracts/test_release_inventory.py:945
- The fixture changes object/pack permissions to
0o000but restores them to a hard-coded0o644. Git object/pack files are typically read-only, and hard-coding a new mode can leave the temporary bare repo in a non-default state (and makes debugging permission-related failures harder). Capture and restore each path’s original mode instead.
This issue also appears on line 988 of the same file.
def _revoke_read_on_the_remote_object(origin: Path, object_id: str) -> list[Path]:
"""Leave the bare origin's refs readable while its objects cannot be served.
MEASURED 2026-08-26 (the measurement `tasks.md` § 3.3 asked for): `chmod
000` on the whole `objects/` directory -- the mechanism that task proposed
scripts/hermes_runtime_validation/release.py:259
- This follow-up dependency error also includes the raw
remoteargument in its message. For the same reason as above (--remotecan be a URL/path), this risks leaking sensitive remote details into errors. Consider removing the remote from the message or sanitizing it consistently with the other fetch-failure message.
raise ReleaseDependencyError(
f"remote object fetch did not provide {object_id} from {remote}"
)
tests/hermes_runtime_contracts/test_release_inventory.py:990
- After changing
_revoke_read_on_the_remote_objectto return original modes, the restore loop should apply those stored modes rather than a hard-coded permission.
finally:
for path in revoked:
path.chmod(0o644)
| raise ReleaseDependencyError( | ||
| f"remote object fetch failed: {remote} {object_id} " | ||
| f"(git exit {fetch.returncode})" | ||
| ) |
Realizes the ratified change
fix-release-reachability-race. Does NOT archiveit: the archive gate is merged-plus-green PLUS the
contract-v1.44tag, and thetag is a post-merge act that is not this session's.
The defect
The release verifier asked the remote a live question and answered it out of a
static object store.
_ls_remotereturns whatrefs/heads/mainpoints at ONTHE REMOTE, right now;
_is_ancestorthen runsgit merge-base --is-ancestorINSIDE the local clone, against an object the clone may never have seen. A clone
is fixed at the moment it was taken; the remote's refs are not. When
mainadvances after the checkout, the advertised object is simply absent locally,
merge-baseexits 128 rather than 0 or 1, and the guard refuses withcommit reachability could not be determined— a fail-closed refusal produced bysomebody else's merge rather than by anything about the candidate.
Measured on this repository's PR #372, a doc-only change, run
32934803039,three attempts at ONE head commit
5c10ce6d: attempt 1 failed with #365 merginginside its window, attempt 2 failed with #374 merging inside its window, attempt
3 passed with a quiet window. One tree, three verdicts, decided by what else
landed during an eleven-minute suite.
The fix mechanism
_resolve_remote_object(repo, remote, object_id)— a probe, then a narrowfetch — called where each remote-derived object id ENTERS the local world rather
than at any one comparison:
git cat-file -e <oid>^{object}first, so an already-current clone spends0.006s and no network at all. (
^{object}, not^{type}— the latter isnot git syntax.)
git fetch --no-tags --no-write-fetch-head <remote> <oid>—the single named object, never a ref. Verified on a live stale clone that
after the verifier's fetch
for-each-refstill listed onlyrefs/heads/mainandFETCH_HEADstill named the setup fetch's commit: themutation is confined to the object store.
verify_promotionresolvesmain_oidbefore_is_ancestorAND before_surface_drift'sgit ls-treeand per-member blob reads;verify_tagresolves
peeled_commitandmain_oidbefore_is_ancestorand before_verify_release_atwalks the tag's tree._is_ancestoris byte-unchanged, 128-branch refusal included. It is thelast line of defence and the mutation proof depends on it.
Three outcomes, told apart and named. A candidate genuinely not on published
mainkeeps its existing refusal finding, unchanged — no finding code is added,removed, renamed or re-severitied. Transient skew resolves in the fetch and
produces no finding at all. An object that cannot be made available stays a
fail-closed dependency refusal (never a finding, never a pass, never a "not
reachable" verdict invented from an absence), but its reason now names the
retrieval:
remote object fetch failed: <remote> <oid> (git exit <n>). Itclaims NO cause beyond the failed fetch and its exit status — a fetch can fail
for a refused credential, an unreachable host, a timeout or a remote that
declines the object, and naming one of them unobserved would be the same failure
of diagnosis the message replaces. Subprocess output is deliberately not
embedded:
_run_gitalready raises terse messages with no stderr, and a gittransport error can carry the remote URL. (Narrowed in response to Copilot's
review; the message first read
<remote> would not serve <oid>and that reviewwas right to object.)
Q1 — decided on measurement: NO ref-fetch fallback
tasks.md§ 2.1 as authored asked for object-then-ref. The orchestratingsession's ruling made the fallback conditional on a measurement showing the
narrow fetch insufficient. It is sufficient. Against
[email protected]:opensoft/openxFactory.git:--depth 1ofmainThe remote serves a bare object id no tracked ref points at — the whole doubt in
Q1 — and the cost is the SSH handshake and ref negotiation rather than the
object count, so a ref fetch would have bought nothing on cost either while
bringing unrequested history and mutating remote-tracking refs. A remote that
declines to serve an object it advertises is therefore the fail-closed case,
reached with a reason naming the fetch.
Q2 / OD-4 — the offline fixture: measured, and the measurement corrected it
The mechanism as authored does not work.
chmod 000on the bare origin'swhole
objects/directory makes git refuse the path as a repository at all:git ls-remoteitself exits 128 withdoes not appear to be a git repository,so a fixture built that way proves the pre-existing "remote main is unavailable"
path — the exact wrong-reason pass § 3.3 warned about.
Revoking read on the single object FILE gives the wanted condition exactly:
ls-remoteexits 0 and still advertises the advanced oid, whilegit fetch <remote> <oid>exits 128 withupload-pack: not our ref. So the real fixtureis KEPT and the authorized monkeypatch fallback is not used. The proof asserts
the fixture's own soundness inline, so it cannot silently degrade into the
remote-unavailable path later.
The proofs
Six new tests over the module's established
_bare_originpattern, which DRIVEthe condition rather than describing it — a second clone advances the bare
origin's
main, so the verifying repository genuinely lacks the advertisedobject, asserted before each verdict is asserted.
Written FIRST and failing as predicted: all three skew proofs at
release.py:200withReleaseDependencyError: commit reachability could not be determined, the exact CI failure line.Mutation-pinned twice, because an in-process mutation can be platform-inert:
test_mutation_removing_the_resolution_step_alone_reproduces_the_refusal,parametrized
[skew]and[surface-drift].whereupon all four new proofs failed (the three skew proofs at
release.py:200, and the unavailable-object proof onassert 'fetch' in messagewith the message readingcommit reachability could not be determined). Source restored and digest-checked.The release-surface proof asserts exact equality on the whole finding list —
ONE
HGR-RELEASE-SURFACE-DRIFToncontracts/manifest.yaml— which is theassertion that catches the
None-comparison hazard: an unresolvedmain_oidmakes
_blob_object_idreturnNonefor EVERY surface path, so the falseverdict is drift on all of them and an
inassertion would have passed on it.The contract bundle:
contract-v1.44scripts/hermes_runtime_validation/release.pyis a NON-EDITORIAL member ofcontract-v1.43's own digest inventory, so editing it without a cut leaves thedeclared inventory describing bytes the repository no longer holds — the state
release-surface-integritynames a defect and whose prescribed remedy is arelease cut, never a hand-edit.
contract-v1.10was cut for this same file forthis same cause.
Number allocated here, not reserved in the proposal. Collision check both ways:
git ls-tree origin/main contracts/releases/ends atcontract-v1.43;git ls-remote --tags origin 'refs/tags/contract-v1.4*'ends atcontract-v1.43; the only open pull request, #176, touches one gate-intent fileand no release surface.
Byte reproduction.
build --tag contract-v1.44run twice, once to thecommitted path and once to a scratch path:
cmpreports them identical and bothhash to
sha256:4373259689f53699929ac462fde10466902887b7e8c20d0f68e538c9655d4100.entries=192, the same membership count ascontract-v1.43— nothing joined orleft the bundle. The verifier's recorded digest moves from
sha256:d149a34b9964ba…tosha256:2160dc3b745261…, which is exactlysha256sumof the tree'srelease.py. No inventory was hand-edited at anypoint.
Class: ADDITIVE (minor). No schema bytes move,
contract_schema_versionisunchanged, no instance valid at
contract-v1.43is narrowed, and a consumerpinned there stays conformant until it upgrades.
Verification evidence
Pipefail on, exit codes unmasked, real numbers.
pytest tests/hermes_runtime_contracts -q -m "not postgres"(CI's selection)pytest tests/hermes_runtime_contracts/test_release_inventory.py -q -m "not postgres"pytest tests/hermes_runtime_contracts/test_validator_cli.py -q -m "not postgres"_run_clitimeout at load average 26pytest tests/hermes_runtime_contracts/test_acceptance_parity.py -q -m "not postgres"openspec validate fix-release-reachability-race --strictopenspec validate --all --strictvalidate-contract-release.py build --tag contract-v1.44release build: pass,entries=192; run twice,cmpidentical, one digest — rebuilt after the review fix moved the verifier's bytes againvalidate-contract-release.py verify-commit --commit HEADrelease verify-commit: pass,inventory=contracts/releases/contract-v1.44.digests.yaml, exit 0pytest tests/ -q -m "not postgres"(CI's second selection)wallet-yaml-syntax-gate.py .andvalidate-openxwallet.py .0 error(s), 0 warning(s)over 17 positives, 36 negative confirmations, 13/13 requirements, 2 wallet artifactsdoc-health.py --single-repo . --family release-inventory-driftrelease-inventory-drift— the declared inventory describes the tree the repository actually holdspytest-suitepass,wallet-validationpass, all checks settled on6d3fe292and again on7723386apytest tests/hermes_runtime_contracts -q -m "not postgres"after the review fixpytest tests/doc-health -q -m "not postgres"after the review fixvalidate-contract-release.py verify-commit --commit HEADafter the review fixrelease verify-commit: pass, exit 0The arithmetic on the first row is itself the evidence. The authoring baseline
in this packet was
1 failed, 498 passed— 499 collected — and it is now 505passed with the six new proofs added and the one failure gone. The test the
defect fired through,
test_validate_candidate_passes_on_the_realized_repository,passes.
Two known local artifacts did NOT fire on the full run, and that is recorded as
not-fired rather than as not-chased:
test_derivation_reproduces_the_real_bootstrap_clustersRAN and passed from thisworktree — it is the source of the run's single warning, a
tarfileDeprecationWarning, which is how one can tell it executed rather than skipped —and no
_run_cli30-second timeout occurred at any point.verify-promotion --commit HEAD --remote origin --tag contract-v1.44exits1 with findings, not 2 with a dependency refusal, which is the point: a
definite answer instead of "could not be determined". The findings are exactly
the pre-merge state —
HGR-RELEASE-CANDIDATE-UNREACHABLEbecause the candidateis not yet on
main, andHGR-RELEASE-SURFACE-DRIFTon the three surfacemembers this cut changes.
Live end-to-end proof, against the canonical remote
The fixtures are deterministic; this one is not, and it is the one that closes
the loop. A non-shallow clone fetched to a commit 8 behind the tip — a
faithful stale full clone, which is what CI has (
fetch-depth: 0,pytest-suite.yml:206) — thenvalidate_realizationagainst the live remote,same tree, same remote, only
release.pyswapped:REFUSED after 12.08s -> commit reachability could not be determinedcompleted in 24.87s with 0 finding(s)Review feedback, dispositioned
Copilot raised three comments and all three are answered in the thread.
and fixed, see above. It was the same fault the delta names, one surface over.
the review. Initially deferred with the closing rule written down; Brett then
ruled on 2026-08-26 that it be folded in, so it is fixed here in
d548d04d. See "Resolved by ruling" below.Resolved by ruling — the shallow-clone verdict, folded in
This section was a flag. Brett ruled on 2026-08-26 (multi-choice, recommended
option) that the rule be folded into this pull request rather than deferred, so
it is implemented here, in
d548d04d.The hazard. Resolving the operand makes the OBJECT present; it does not make
the ANCESTRY present. A shallow clone's graft boundary declares its oldest
commits parentless, so
git merge-base --is-ancestorreturns a definite 1for a commit that is reachable on the real history — and the resolution step, by
getting past the 128, delivers the run to that false answer. MEASURED against the
canonical remote in a
--depth 1clone: the published validator refuses withcommit reachability could not be determined, and the fix alone reported a FALSEHGR-RELEASE-TAG-UNREACHABLE. Raised independently by Copilot's review, which istwo arrivals at the same finding.
The rule is the asymmetry. A POSITIVE ancestry answer is trustworthy in any
store, because a path git found is a path that exists and truncation can only
hide paths, never invent them. A NEGATIVE answer is precisely what truncation
manufactures. So only the negative is re-examined:
Same guard before
HGR-RELEASE-TAG-UNREACHABLEinverify_tag. NOT inside_is_ancestor, which stays byte-unchanged againstorigin/mainbecausetasks.md§ 2.4 requires it and a mutation proof depends on its 128 branch. Thebudget cost is one local
rev-parseon a branch the ordinary case never enters:no network, nothing added to either 30-second cap on the common path.
One cost, accepted rather than engineered around. A shallow clone holding a
genuinely unreachable candidate takes the refusal too, so a shallow verification
can no longer emit either UNREACHABLE code. The verifier cannot tell an earned
negative from an artefact of its own store, and a verification that cannot
establish which of the two it holds has earned neither verdict. Exit 2 where exit
1 stood — both block, and only one is honest about why. Deepen the clone, or
verify from a full one.
Canon moved with the code. Requirement 2 of the spec delta gains a fourth
scenario,
A truncated history returns a negative it cannot earn, plus itsgoverning prose — requirement 2 owns the taxonomy of unanswered outcomes, and a
truncated history is a fourth way the question goes unanswered.
Three proofs, over a REAL
--depth 1clone (which needs afile://URL,since git ignores
--depthon a plain local path):test_verify_tag_refuses_a_negative_verdict_a_shallow_clone_cannot_earn— thetag sits at published
main's own parent, so it is genuinely reachable;asserts the shallow refusal, asserts
UNREACHABLEis absent from the message,and asserts a FULL clone of the same origin returns
== [].test_verify_promotion_refuses_a_negative_verdict_in_a_shallow_clone— thecandidate call site, with a full-history oracle asserting the negative is
genuinely earned.
test_a_shallow_clone_still_answers_when_merge_base_can_say_yes— pins theasymmetry, and is why the guard is not a blanket refusal.
Both refusal proofs are mutation-pinned at source level: neutralize the two
call sites and both fail
DID NOT RAISE, while the asymmetry proof still passes.All three are bound in
contracts/hermes-runtime/evidence-register.yamlunderSCO-002-S04(the refusals) andSCO-002-S02(the asymmetry).tasks.md§ 6.4is ticked with the ruling recorded in place, and
design.md§ 5 keeps theoriginal deferral entry alongside the ruling, because the measurement is the
reason the rule exists.
Re-verified after the fold-in (
release.pybytes moved again, so theinventory was rebuilt over them):
pytest tests/hermes_runtime_contracts -q -m "not postgres"pytest tests/hermes_runtime_contracts/test_validator_cli.py -q -m "not postgres"openspec validate fix-release-reachability-race --strict/--all --strictdoc-health.py --single-repo . --family release-inventory-drift0 error(s), 0 warning(s)build --tag contract-v1.44twice +cmpentries=192, one digest;release.pydigest nowsha256:660e55ca…verify-commit --commit HEADrelease verify-commit: pass, exit 0pytest tests/ -q -m "not postgres"d548d04dpytest-suitepass (13m10s),wallet-validationpass, all checks settledTwo notes on this pull request's own continuous integration
It runs the NEW validator, so it should be immune to the race it fixes. If
its pytest suite reds with
commit reachability could not be determined, the fixis incomplete and wants investigation rather than a re-run.
But be precise about WHY it is immune, because the pre-tag window is a weaker
test than it looks. With the manifest now at
contract-v1.44and no such tagpublished yet,
verify_tagreturnsHGR-RELEASE-TAG-MISSINGand short-circuitsbefore it reaches the ancestor check at all. So this run does not exercise the
resolved operand on the live remote — the live-remote exercise resumes once the
contract-v1.44tag is pushed, and the evidence that it works there is thestale-full-clone measurement above rather than this run.
Not done here, on purpose
contract-v1.44tag on themerge commit (
tasks.md§ 4.6), the post-tagverify-promotion/verify-tag(§ 4.5), the aggregation submodule pointer sync (§ 4.7) and the archive act
(§ 5.6) all belong to the post-merge cut.
tasks.md§ 5.4 is left unticked with its reason, not quietly ticked:three full-suite runs each with a merge landing inside its window cannot be
arranged on demand. The deterministic fixtures and the live proof above are
offered as the substitute, and the many-runs-identical claim is recorded as
unproven.
tasks.md§ 6.4 is no longer among these — it was folded in by ruling, andis ticked. § 6.1, § 6.2 and § 6.3 stand open as authored.
tasks.md§ 6.1's sweep is still not performed. Whetherconsumer_handoff.pymixes a live remote read with a local resolve remainsunmeasured, and this change claims nothing about it.
Realizes
fix-release-reachability-race.