Repository navigation
Realize fix-content-resolution-conflation: tell the one content condition the verifier can act on from the fourteen it cannot, and cut contract-v2.1 - #490
Conversation
… clean having been read on neither side Co-Authored-By: Claude Fable 5 <[email protected]>
…the bundle that describes them Co-Authored-By: Claude Fable 5 <[email protected]>
…corrected the filing's sweep 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-content-resolution-conflation packet by making content resolution distinguish the one actionable condition (“path absent from a successfully-read tree”) from all other dependency/safety refusals, and cuts the additive contract-v2.1 bundle so the declared digest inventory remains consistent with the edited inventory members.
Changes:
- Introduces a declared content-resolution condition code (
CONTENT_PATH_ABSENT) and updates release verification to treat only that code as “established absence,” failing closed for all other resolver refusals. - Adds regression tests covering the “quiet direction” (both sides unresolved) and other refusal modes, plus binds the new proofs into the Hermes runtime evidence register.
- Cuts
contract-v2.1(manifest + changelog + new digest inventory) to re-baseline the edited non-editorial members.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/hermes_runtime_contracts/test_release_inventory.py | Adds end-to-end tests ensuring release-surface comparisons fail closed except for established absence; extends fixture with a post-inventory hazard hook. |
| tests/hermes_runtime_contracts/test_content_resolution.py | Adds tests asserting only the absent-path refusal uses the new absence code and the default code remains unchanged. |
| scripts/hermes_runtime_validation/release.py | Implements the fail-closed distinction in _blob_object_id and _CommitSource.exists via _resolution_established_absence. |
| scripts/hermes_runtime_validation/content.py | Declares CONTENT_DEPENDENCY and CONTENT_PATH_ABSENT, and tags the absent-path refusal with the new code. |
| openspec/changes/fix-content-resolution-conflation/tasks.md | Updates realization tasks with recorded evidence and completion markers. |
| contracts/releases/contract-v2.1.digests.yaml | Adds the newly cut contract bundle digest inventory. |
| contracts/manifest.yaml | Advances contract_bundle_version to contract-v2.1. |
| contracts/hermes-runtime/evidence-register.yaml | Binds the new test node ids to existing SCO-002 scenarios. |
| contracts/CHANGELOG.md | Adds the contract-v2.1 additive release entry describing the verifier behavior change and why the cut is required. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Realizes the active packet
fix-content-resolution-conflation, filed and fullyruled via #463 (merged 2026-08-28 as
5314fac5), and cuts the additivecontract bundle
contract-v2.1in the same pull request, because the codesurface is a member of the declared bundle's own digest inventory. Not for
archive by this branch — § 6 of tasks.md is deliberately untouched.
The defect — fifteen refusals, one value, and the failure that emits nothing
_blob_object_idconverted everyContentResolutionErrorintoNoneand_CommitSource.existsconverted every one intoFalse. Both answers are thenconsumed as data: the first is one side of
_surface_drift's comparison,the second decides release membership and whether
contracts/manifest.yamlispresent at the commit.
Re-measured on this branch before a character was edited — 15 raise sites, 14
distinct messages (
repository path is not canonicalis raised twice), andcontent.py:125still the only one reached afterrev-parseresolved thecommit AND its tree AND
ls-treeran. The filing's six-condition table wasre-run and widened to seven, because a path inside a repository is not the
"not a repository" condition at all:
_blob_object_idexistsexact Git path is unavailableHRC-CONTENT-DEPENDENCYNoneFalseexact Git object is unavailableHRC-CONTENT-DEPENDENCYNoneFalseexact Git object is unavailableHRC-CONTENT-DEPENDENCYNoneFalseGit repository is unavailableHRC-CONTENT-DEPENDENCYNoneFalseGit path is not a supported regular fileHRC-CONTENT-DEPENDENCYNoneFalserepository path contains a forbidden segmentHRC-CONTENT-DEPENDENCYNoneFalserevision must be a full Git object IDHRC-CONTENT-DEPENDENCYNoneFalsee8c0afa5…TrueSix failing conditions, one value, one code. The first row is the only one
that means anything about the release.
The quiet direction, measured on the committed module
A failure on ONE side manufactures a drift finding out of an environment fact.
A failure on both sides makes two identical non-answers compare EQUAL, and
the surface is reported undrifted having been read on neither side — a pass
that emits nothing a reader could notice.
Driven from committed data, with no broken environment anywhere in the
fixture: a release-surface path (
contracts/hermes-runtime/README.md) committedas a directory, and the candidate compared against itself — the ordinary
shape of a promotion check for a candidate already on
main._surface_drift(repo, c, c)[]ReleaseDependencyErrorverify_promotion[]— surface reported cleanGit path is not a supported regular file, naming the pathThe proof asserts the refusal, asserts the reason names the condition
observed and not the release, and asserts the refusal is not an
HGR-RELEASE-SURFACE-DRIFTfinding either — the failure has two wrong answersand only one of them is loud.
The fix
content.pynow declares its condition vocabulary:CONTENT_DEPENDENCY(the unchanged
HRC-CONTENT-DEPENDENCYdefault, now named rather than inlined)and
CONTENT_PATH_ABSENT(HRC-CONTENT-PATH-ABSENT), which:125aloneraises. One new
_resolution_established_absenceinrelease.pyreads thatcode: the one data condition still yields
None/Falseunchanged, andevery other condition becomes a fail-closed
ReleaseDependencyErrorwhosereason quotes the resolver's own refusal, with the original chained by
from.The distinction is made in one place, deliberately — that is what makes the
mutation a single-token source edit rather than a rewrite.
Additive, and the sweep was re-run rather than relied on. The filing said
HRC-CONTENT-DEPENDENCY"occurs nowhere but its own default"; measured now itoccurs in five tracked files — its own default, this packet's three
documents, and a brief that documents the default, which stays true because
the default's value is unchanged. The load-bearing half holds: four
.codereaders exist in
scripts/and each was opened rather than counted —they read
MigrationContractError,DomainRegressionDependencyError,ReleaseDependencyErrorandConsumerHandoffDependencyError. Not one readsContentResolutionError.code. The refusals take the existingHGR-RELEASE-DEPENDENCYclass, so no finding code is added or re-scoped.HGR-RELEASE-PATH-UNRESOLVABLE(:713-719) is untouched, and the exclusionis now recorded in the helper's docstring citing OD-3, so the boundary is
legible from the code rather than only from the packet.
Mutation-pinned at SOURCE level, three directions
Each mutation replaces the single line
if exc.code == CONTENT_PATH_ABSENT:and runs the twelve new node ids; the file is restored from a byte-copy after
each.
if True:if False:existsproof asserting both directionsif "exact Git path is unavailable" in str(exc):M3 is the measurement OD-4 was argued from, and it was argued before it was
measured. Under M3 all nine behavioural proofs stay green, because the message
matches today. Only the structural assertion over
release.py's sourcereddens — so a future editor improving that message would break nothing a
behavioural suite could see. That is the silent reclassification OD-4 rejected
the mechanism for, and it is the same shape #478 reported for its prose patterns.
Separately, the RED baseline: with the two source files restored from
HEADand the new tests left in place, 10 of the 12 fail. The 2 that pass are the
absent-path pair, which must pass — they assert the answer is unchanged.
Every condition is constructed, never mocked: a directory and a nested
repository link committed at a release-surface path, a repository that is not
there, a revision that is not an object id, a path with a forbidden segment.
No proof waits on a real timeout (Q4).
Verification
pytest tests/hermes_runtime_contracts -q -m "not postgres"— theselection CI runs, which
tests/conftest.py:8names as this repository's owninvocation. Exit code read from
$?into the log, never off a tail.Before: 1 failed, 509 passed, 338 deselected, exit 1 (432.38s).
After: 522 passed, 0 failed, 338 deselected, exit 0 (319.12s). The +12
collected is exactly this packet's twelve new node ids.
before any edit.
test_validator_cli.py::test_release_mode_field_is_preserved_on_the_real_repository[--require-realization-realization]is a 30-second
subprocess.TimeoutExpired. Reproduced in isolation on theunedited tree (1 failed, 1 passed) and the cause measured rather than
guessed: the CLI itself takes ~40s wall here against a 30s allowance,
under contention from other sessions' concurrent pytest runs. Realize fix-pin-value-boundary-and-sentinel-split: refuse the fabricated pin, and split the sentinel that covered two failures #478 reported
the same failure and proved it pre-existing at the merge base. It passes
on the after-run, on the tree that carries this fix.
pytest tests/doc-health -q— before 1330 passed, after 1333 passed,0 failed, exit 0 both times. The +3 is
origin/main(this branch mergedit mid-realization, landing
settle-aging-staging-topics' fixtures), not thispacket: no doc-health test or module is touched.
release-inventory-driftrun directly on this head, not inferred from thesuite:
doc-health.py --single-repo . --family release-inventory-drift→No findings, exit 0, before the cut and after it. That family reports at
errorwhen a non-editorial member's bytes differ from the declaredinventory — which is exactly the state this change would leave behind without
the cut, and exactly why the cut rides here rather than following.
openspec validate --all --strict— 80 passed, 0 failed, exit 0; thechange validates
--strict.specs/shared-contract-ownership/spec.mdisbyte-unchanged from the filing.
The cut —
contract-v2.1Membership established by PARSE, not
grep:contract-v2.0.digests.yamlloaded with a YAML parser and its 192 entries walked.
scripts/hermes_runtime_validation/release.pypresent astype: validatoratsha256:660e55ca…,content.pyon the same terms, andcontracts/hermes-runtime/evidence-register.yamlastype: evidence-register—each exactly what the tree carried before this change. The editorial set is
three files and none of the three moved members is in it.
Number allocated at realization, collision-checked both ways, twice — at cut
time and again immediately before the final push.
git ls-tree origin/main contracts/releases/tops out atcontract-v2.0.digests.yaml;git ls-remote --tags origin 'refs/tags/contract-v2.*'returnscontract-v2.0and nothingelse; and every open pull request was enumerated with its changed-file list
read — none touches
contracts/releases/,contracts/manifest.yamlorcontracts/CHANGELOG.md. Thecontract-v1.28renumber sweep is why thesecond check exists.
Built, never hand-edited — three times. Two builds to distinct scratch paths
are byte-identical under
cmp; a third to the tree path is byte-identical tothe first, which also shows the candidate's own presence in
contracts/releases/does not perturb the build. Rerun after the evidenceregister edit, because the register is itself a member.
entries=192, unchanged — nothing joined or left, membership equalpath-for-path by parse rather than by count. Exactly five digests moved: the
two editorial members re-baselined, and the three non-editorial members edited
here. Each equals
sha256sumof the edited file.Re-affirmed against the COMMITTED tree (task 5.4), not the working one: at
7b1e9291the committed inventory was read withgit cat-file, and aninventory rebuilt from
_CommitSource(repo, HEAD)— the exact-commit source,which never reads the working tree — is byte-identical. Then every entry
independently: 192 of 192 declared digests equal
sha256of that path'sblob at the commit, 0 mismatches.
verify-commit --commit HEAD→pass,exit 0.
The fortunate property
contract-v1.44recorded holds again: the cut runs thenew code, so the fix is exercised by the release that carries it.
What § 6 will need after merge — the orchestrating session's acts
Four archive-gate boxes are left open on purpose, and each names its evidence:
git cat-file -pas a real two-parentmerge and re-verified an ancestor of
origin/main, with both required checksgreen; not read off the pull request page.
verify-promotion --commit <merge> --remote origin --tag contract-v2.1exit 0 before tagging (it cannot run earlier: it requiresthe candidate reachable from the remote's
main), then the annotated tag,then
verify-tag --remote origin --tag contract-v2.1exit 0, then theaggregation submodule pointer synced. The tag is not the authoring session's
act, exactly as
contract-v1.44discharged it.set -o pipefail,openspec validate --all --strictgreen, andrelease-inventory-driftreporting no
errorfor any of the three moved members.written.
Twenty-seven of thirty-five boxes are ticked with evidence. The eight left open
say why: four are the archive gate above, and four are § 7 follow-ups, each
carrying a disposition rather than a blank box.
🤖 Generated with Claude Code