Skip to content

The mint script's Ed25519 dependency is declared where the suite installs it - #621

Merged
brettheap merged 1 commit into
mainfrom
fix/mint-script-cryptography-dep
Sep 3, 2026
Merged

brettheap merged 1 commit into
mainfrom
fix/mint-script-cryptography-dep

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Follow-up to #610, which was merged at f54bb61 before this commit reached the branch. Declares cryptography==50.0.0 (the pin hermes-install already vets) in requirements/hermes-runtime-contracts.{in,lock} so the six mint-script tests in tests/factory_identity run in CI; the script refuses legibly (cryptography-not-installed) when the library is absent. Without this, main's pytest-suite is red on those six tests.

🤖 Generated with Claude Code

…alls it

pytest-suite installs test dependencies from
requirements/hermes-runtime-contracts.lock (hash-pinned, `pip install
--require-hashes`), and scripts/mint-factory-origin-key.py imports
`cryptography` to derive the public half of a freshly generated Ed25519
seed. That import was never declared in the lock, so CI's fresh venv
never had it: 6 tests in tests/factory_identity/test_mint_script.py
failed with ModuleNotFoundError on every run.

This is not the same case scripts/signed_execution_chain/ed25519.py
avoids the dependency for — that module only VERIFIES a public
signature over public data, safely hand-rollable. The mint GENERATES a
key from secret material, where a from-scratch implementation (RNG
handling, scalar clamping, side channels) is the riskier choice, so the
audited library is the right call. Pinned to cryptography==50.0.0,
matching the version already hash-pinned and vetted in
installs/hermes-install/uv.lock, so no second independently-drifting
pin exists.

The import site is unchanged; a bare ImportError now raises a named
Refusal telling the operator to `pip install cryptography` rather than
surfacing a raw traceback.

Co-Authored-By: Claude Fable 5 <[email protected]>
(cherry picked from commit 4763027)
Copilot AI lite review requested due to automatic review settings September 3, 2026 20:16

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

🟡 Changes recommended

The new refusal message recommends an unpinned pip install cryptography command, which contradicts the repository’s hash-locked install approach and can lead to drifting dependencies.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR fixes CI breakage for the factory-origin key mint script/tests by ensuring the Ed25519 implementation dependency (cryptography) is present in the same hash-pinned Python environment that the pytest-suite workflow installs.

Changes:

  • Add cryptography==50.0.0 to requirements/hermes-runtime-contracts.in and regenerate the hash-locked requirements/hermes-runtime-contracts.lock (including transitive deps like cffi / pycparser).
  • Improve scripts/mint-factory-origin-key.py behavior when cryptography is missing by raising a named refusal (cryptography-not-installed) with an actionable error message.
File summaries
File Description
scripts/mint-factory-origin-key.py Adds a dedicated ImportError refusal path so missing cryptography fails with a clear, named diagnostic.
requirements/hermes-runtime-contracts.in Declares the cryptography==50.0.0 direct dependency for the Hermes runtime contracts test environment.
requirements/hermes-runtime-contracts.lock Updates the hash-pinned lock to include cryptography and required transitive dependencies.
Review details
  • Files reviewed: 2/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment on lines +1294 to +1298
f"({exc}); this program derives the Ed25519 key through it "
"and will not fall back to arithmetic of its own — run "
"`pip install cryptography` (pinned in "
"requirements/hermes-runtime-contracts.lock) and try "
"again") from exc
@brettheap
brettheap merged commit 995c0ad into main Sep 3, 2026
6 checks passed
brettheap added a commit that referenced this pull request Sep 3, 2026
… second baseline

The evidence table was measured against merge-base 2b0615d. After merging
origin/main twice (for #614's clock pin, then for #621), it is re-measured
against 995c0ad: base 6/8/29/14, head 6/8/29/16 — the same +2 info and
nothing else, against a newer baseline whose own error band had moved 6 -> 8
by main's landings.

CI on the merged head b74c846 passes all five required checks, pytest-suite
included. The local full-suite run's 95 failures are environmental — no
initialized openXwallet submodule in the scratch worktree, identical on the
untouched origin/main worktree beside it.

Lane: openxfactory-smalls
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RhXyJoZvtSmGcTdPVDKPoD
brettheap added a commit that referenced this pull request Sep 3, 2026
#624)

contract-v3.1 was cut by #616 (squash 19d0087) and its annotated tag pushed
there. It does not verify at its own commit. verify-tag --tag contract-v3.1 and
verify-commit --commit 19d0087 both report:

  HGR-RELEASE-DIGEST-MISMATCH error path=requirements/hermes-runtime-contracts.in: digest does not match the raw Git blob at the pinned commit
  HGR-RELEASE-DIGEST-MISMATCH error path=requirements/hermes-runtime-contracts.lock: digest does not match the raw Git blob at the pinned commit

MEASURED CAUSE. The v3.1 inventory was built last at #616's head a981c98 and
verified there. The branch forked at 0bf37d1 and three first-parent landings
reached main before the squash: ea117d4 (#610), 4fc7b94 (#566) and 995c0ad,
the merge of 11db75e (#621, "The mint script's Ed25519 dependency is declared
where the suite installs it"). Intersecting the eighteen paths of `git diff --name-only
a981c98 19d0087` with the 283 registered members of contract-v3.1.digests.yaml
leaves exactly two, both #621's: requirements/hermes-runtime-contracts.in and
.lock. The lane published the tag without re-running verify-commit at the merge
commit — Bundle Realization Order step 4, skipped. That was lane repo-shape's
error, in the cutting session itself.

REMEDY, per docs/contract-versioning-policy.md § Immutable Tag Correction: the
published tag is never moved, deleted or re-tagged. The defect is corrected by a
superseding release allocated through the same realization order. contract-v3.1's
tag and inventory remain in place as immutable provenance, its number is never
reused, and nothing is declared spent — v3.1 was PUBLISHED, so it is DEFECTIVE
rather than a number that could never be published. Ruled by Brett Heap,
convener, 2026-09-03: "cut 3.2".

CLASS: ADDITIVE (minor). `git diff --name-status contract-v3.1 HEAD` at the
branch point is empty — the tag peels to origin/main's tip — so this bundle is
v3.1's realized surface with the two requirements files as they now stand. The
only registered movement is #621's cryptography==50.0.0 declaration and its lock
closure: a build dependency added, no required field, no shape removed, no
semantics changed. No consumer pinned at contract-v3.1 is made non-conformant.

One candidate commit, per Bundle Realization Order step 2: manifest, changelog,
the release-boundary hand statement and the rebuilt inventory move together.
Membership is 283 rows in both inventories, unchanged; five digests move —
this cut's own three release-surface files plus the two requirements files.
No new capability is realized beyond what contract-v3.1 named.
contracts/releases/contract-v3.1.digests.yaml is byte-identical.

Lane: repo-shape

Claude-Session: https://claude.ai/code/session_015WekBEXf55Xv64psGe5t3T

Co-authored-by: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Sep 4, 2026
… origin may declare proposed_by/proposed_on, and approval becomes an addition (#318) (#619)

* Give a drafted-but-unapproved packet a lawful origin shape (#318)

An `ad_hoc` origin may now declare `proposed_by` + `proposed_on` in place of
`approved_by` + `approved_on`. Before this, a drafted-but-unapproved packet had
NO lawful shape: `ad_hoc` without `approved_on` was an error and no origin block
was an error, so the only mechanical remedies were to approve the change, delete
the draft, or write a date nobody gave — the last being the defect the field
exists to catch. Two medx boundary packets carried the finding long enough to
join the standing error baseline.

RULED 2026-09-03 by Brett Heap in session, verbatim "implement your
recommendations on all these"; the resolution for this issue is the RULING
comment on #318, which chose shape 1 and named the vehicle.

THE ENCODING, and it is the decision the ruling deliberately left open: `kind`
and `id` are fields the SUPPORT MANIFEST REPEATS, and this family reports a
manifest/packet disagreement as post-ratification mutation at `error` +
`contested`. A `kind: drafted` must become `ad_hoc` at approval, so that
spelling writes a contested-class mutation into the happy path of every packet
that gets approved. Under this one the identity never moves and approval is two
ADDED lines.

Two new finding classes, both with an empty population by construction:
`drafting-provenance-incomplete` (ERROR, mechanical) and
`unapproved-origin-at-ratification` (ERROR, `contested`) — a proposal whose own
`Status:` claims `ratified` or beyond over an unapproved origin, read through
`corpus.parse_status` + `promotion_fidelity.declared_standing` against the
existing `RATIFIED_OR_BEYOND`, fired only where the state is POSITIVELY
declared and never on the fact of archival.

`approved_on` is still required in full wherever approval is claimed, so
nothing already lawful changes shape. Measured: 109 ad-hoc origins in this
corpus, all with a complete approval pair, 0 with neither, 0 with half of one.

Proposal and realization land together, by the ruling. doc-health moves by +2
`info` and nothing else — this packet's own two MODIFIED blocks in the carriage
ledger. `_LEDGER_SUBJECTS` gains those two rows; the self-gate failed first, by
name, naming both, which is that assertion working.

Lane: openxfactory-smalls
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RhXyJoZvtSmGcTdPVDKPoD

* Record the landed gate numbers, and the one flake, in the packet's own evidence

`tasks.md` § 6 and the ratification record carried "(recorded at the
ratification commit)" placeholders for the two suite gates. They now carry the
measurements: `openspec validate --all --strict` 87 passed / 0 failed, and
`pytest tests/doc-health` 1528 passed / 0 failed on the landed tree against
1500 at the merge-base — this change adds 28 test items.

AND THE ONE FLAKE IS WRITTEN DOWN RATHER THAN SWALLOWED. An intermediate run of
the identical tree failed `test_the_report_moves_only_in_this_family_s_lines`
with an `info` movement of 11 against the family's 10 — one NON-FAMILY `info`
finding absent from one of that test's two report renderings. It did not
reproduce in that run's predecessor or its successor over the same tree, and it
cannot be this change's: the missing finding belongs to another family, and
every finding this change can emit has an empty population here. The class is
the one #613/#614 narrowed by pinning `--as-of` across both renderings.

Lane: openxfactory-smalls
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RhXyJoZvtSmGcTdPVDKPoD

* Refuse a half-given provenance pair in write_origin_block instead of dropping it

FOUND BY COPILOT ON PR #619, and it was a silent drop. The writer wrote only
pairs it found COMPLETE, so a caller handing it a full approval pair and a lone
`proposed_by` got a block with the stray field discarded and no word said — a
record that looks complete, produced by the writer whose own gate and nightly
family both report a half-declared pair as a defect.

It now raises `SupportError` naming what was given and what is missing. Four
parametrized tests pin it at either field of either pair, including the exact
shape Copilot named, and assert no packet file is written.

No spec text moves: the delta already says a provenance pair is declared in
full or not at all. The writer was not saying it.

Lane: openxfactory-smalls
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RhXyJoZvtSmGcTdPVDKPoD

* Re-measure the suite after the bot-round fix: 1532 / 0, 32 items added

Task 2.10's four parametrized tests landed after the Executed table was
written, so its number and the ratification record's said 1528 / 28. Measured
again on the landed tree rather than adjusted on paper.

Lane: openxfactory-smalls
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RhXyJoZvtSmGcTdPVDKPoD

* Move the live corpus-sweep pins this packet's two MODIFIED blocks move

CI caught what the local `pytest tests/doc-health` gate could not see:
`tests/sequenced_after/test_sweep.py`'s live sweep reads the WHOLE corpus for
changes sharing a (capability, requirement) key, so a packet carrying MODIFIED
blocks moves it. Measured on the merged tree: change_ids 158 -> 159,
co_modified 109 -> 110, active_co_modified 21 -> 22, sole_modifiers and
active_sole UNMOVED at 49 and 12.

THE RISE IS ONE, NOT TWO, and the file's own rule says a rise of one never
comes with the sole set falling. Co-modified membership is boolean, so this
packet enters once; and both its keys have the SAME single earlier owner, the
archived add-proposal-origin-contract that ADDED both requirements, already
co-modified through two other keys — doc-health's 'Deterministic check
families' (fifteen changes) and document-lifecycle's 'Proposal-owned
supporting documents' (two). Measured, not reasoned from the totals.

All three pins carry their dated narrative and the movement log gains a
bullet, in that file's own convention.

Lane: openxfactory-smalls
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RhXyJoZvtSmGcTdPVDKPoD

* Record the merged-tree gates: CI green on all five, +2 info against a second baseline

The evidence table was measured against merge-base 2b0615d. After merging
origin/main twice (for #614's clock pin, then for #621), it is re-measured
against 995c0ad: base 6/8/29/14, head 6/8/29/16 — the same +2 info and
nothing else, against a newer baseline whose own error band had moved 6 -> 8
by main's landings.

CI on the merged head b74c846 passes all five required checks, pytest-suite
included. The local full-suite run's 95 failures are environmental — no
initialized openXwallet submodule in the scratch worktree, identical on the
untouched origin/main worktree beside it.

Lane: openxfactory-smalls
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RhXyJoZvtSmGcTdPVDKPoD

---------

Co-authored-by: Claude Fable 5.1 <[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