Skip to content

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

Merged
brettheap merged 3 commits into
mainfrom
change/realize-content-resolution-conflation
Aug 29, 2026
Merged

brettheap merged 3 commits into
mainfrom
change/realize-content-resolution-conflation

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Realizes the active packet fix-content-resolution-conflation, filed and fully
ruled via #463 (merged 2026-08-28 as 5314fac5), and cuts the additive
contract bundle contract-v2.1 in the same pull request
, because the code
surface 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_id converted every ContentResolutionError into None and
_CommitSource.exists converted every one into False. Both answers are then
consumed as data: the first is one side of _surface_drift's comparison,
the second decides release membership and whether contracts/manifest.yaml is
present at the commit.

Re-measured on this branch before a character was edited — 15 raise sites, 14
distinct messages
(repository path is not canonical is raised twice), and
content.py:125 still the only one reached after rev-parse resolved the
commit AND its tree AND ls-tree ran. The filing's six-condition table was
re-run and widened to seven, because a path inside a repository is not the
"not a repository" condition at all:

condition underlying refusal code _blob_object_id exists
blob genuinely absent at this commit exact Git path is unavailable HRC-CONTENT-DEPENDENCY None False
the COMMIT does not exist exact Git object is unavailable HRC-CONTENT-DEPENDENCY None False
a directory that is not a repository exact Git object is unavailable HRC-CONTENT-DEPENDENCY None False
a repository path that does not exist Git repository is unavailable HRC-CONTENT-DEPENDENCY None False
the path is a DIRECTORY Git path is not a supported regular file HRC-CONTENT-DEPENDENCY None False
the path is not canonical repository path contains a forbidden segment HRC-CONTENT-DEPENDENCY None False
the revision is not a full object id revision must be a full Git object ID HRC-CONTENT-DEPENDENCY None False
a real member — — e8c0afa5… True

Six 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) committed
as a directory, and the candidate compared against itself — the ordinary
shape of a promotion check for a candidate already on main.

committed module this branch
_surface_drift(repo, c, c) [] ReleaseDependencyError
verify_promotion [] — surface reported clean refuses
what was read neither side —
reason (silence) Git path is not a supported regular file, naming the path

The 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-DRIFT finding either — the failure has two wrong answers
and only one of them is loud.

The fix

content.py now declares its condition vocabulary: CONTENT_DEPENDENCY
(the unchanged HRC-CONTENT-DEPENDENCY default, now named rather than inlined)
and CONTENT_PATH_ABSENT (HRC-CONTENT-PATH-ABSENT), which :125 alone
raises. One new _resolution_established_absence in release.py reads that
code: the one data condition still yields None / False unchanged, and
every other condition becomes a fail-closed ReleaseDependencyError whose
reason 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 it
occurs 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 .code
readers exist in scripts/ and each was opened rather than counted —
they read MigrationContractError, DomainRegressionDependencyError,
ReleaseDependencyError and ConsumerHandoffDependencyError. Not one reads
ContentResolutionError.code.
The refusals take the existing
HGR-RELEASE-DEPENDENCY class, so no finding code is added or re-scoped.

HGR-RELEASE-PATH-UNRESOLVABLE (:713-719) is untouched, and the exclusion
is 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.

mutation what it does proofs that fail
M1 if True: flattens every refusal back to absence — the committed defect exactly all 7 refusal proofs; both absent-path proofs still pass
M2 if False: flattens the one data answer into a refusal both absent-path proofs, and the exists proof asserting both directions
M3 if "exact Git path is unavailable" in str(exc): substitutes the rejected mechanism (OD-4): a matched message for a declared code the structural proof, and nothing else

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 source
reddens — 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 HEAD
and 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" — the
    selection CI runs, which tests/conftest.py:8 names as this repository's own
    invocation. 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.
  • The one baseline failure is the known environment artifact, reproduced
    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 the
    unedited 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 merged
    it mid-realization, landing settle-aging-staging-topics' fixtures), not this
    packet: no doc-health test or module is touched.
  • release-inventory-drift run directly on this head, not inferred from the
    suite: doc-health.py --single-repo . --family release-inventory-drift →
    No findings, exit 0, before the cut and after it. That family reports at
    error when a non-editorial member's bytes differ from the declared
    inventory — 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; the
    change validates --strict. specs/shared-contract-ownership/spec.md is
    byte-unchanged from the filing.

The cut — contract-v2.1

Membership established by PARSE, not grep: contract-v2.0.digests.yaml
loaded with a YAML parser and its 192 entries walked.
scripts/hermes_runtime_validation/release.py present as type: validator at
sha256:660e55ca…, content.py on the same terms, and
contracts/hermes-runtime/evidence-register.yaml as type: 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 at contract-v2.0.digests.yaml; git ls-remote --tags origin 'refs/tags/contract-v2.*' returns contract-v2.0 and nothing
else; and every open pull request was enumerated with its changed-file list
read — none touches contracts/releases/, contracts/manifest.yaml or
contracts/CHANGELOG.md
. The contract-v1.28 renumber sweep is why the
second 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 to
the first, which also shows the candidate's own presence in
contracts/releases/ does not perturb the build. Rerun after the evidence
register edit, because the register is itself a member.

entries=192, unchanged — nothing joined or left, membership equal
path-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 sha256sum of the edited file.

Re-affirmed against the COMMITTED tree (task 5.4), not the working one: at
7b1e9291 the committed inventory was read with git cat-file, and an
inventory 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 sha256 of that path's
blob at the commit, 0 mismatches. verify-commit --commit HEAD → pass,
exit 0.

The fortunate property contract-v1.44 recorded holds again: the cut runs the
new 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:

  • 6.1 — the merge commit read out of git cat-file -p as a real two-parent
    merge and re-verified an ancestor of origin/main, with both required checks
    green; not read off the pull request page.
  • 6.2 — verify-promotion --commit <merge> --remote origin --tag contract-v2.1 exit 0 before tagging (it cannot run earlier: it requires
    the candidate reachable from the remote's main), then the annotated tag,
    then verify-tag --remote origin --tag contract-v2.1 exit 0, then the
    aggregation submodule pointer synced. The tag is not the authoring session's
    act, exactly as contract-v1.44 discharged it.
  • 6.3 — both suites green on the merged tree under set -o pipefail,
    openspec validate --all --strict green, and release-inventory-drift
    reporting no error for any of the three moved members.
  • 6.4 — the § 7 dispositions and the OD/Q rulings, which are already
    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

brettheap and others added 3 commits August 28, 2026 21:54
… 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]>
Copilot AI lite review requested due to automatic review settings August 29, 2026 02:07

@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 ✨

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 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.

@brettheap
brettheap merged commit 571e64d into main Aug 29, 2026
4 checks passed
@brettheap
brettheap deleted the change/realize-content-resolution-conflation branch August 29, 2026 02:37
brettheap added a commit that referenced this pull request Aug 29, 2026
Archive both measured-latents packets: the pin boundary on a green suite, the content distinction on contract-v2.1 (realized by #478 and #490)
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