Skip to content

spec(normative): req-lk-015 anchors git-source integrity on content_hash (#4092) - #4285

Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-spec-lk015-content-hash
Nov 20, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-spec-lk015-content-hash

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

This amendment was added to #4236 after Lane L had merged that PR, so it never reached main; this PR re-lands it. It adopts amendment 0.1.71, which revises req-lk-015 in place per the steward ruling:

  • In v0.1, every git-sourced lock entry MUST record content_hash, a sha256 envelope over the package tree (byte stream per req-lk-016).
  • A frozen install and apm audit MUST recompute it at resolved_commit and fail closed, with a diagnostic naming the entry, the expected envelope and the observed envelope.
  • The canonical git tree hash tree_sha256 and its Section 5.6.4 byte representation are reserved for v0.2.
  • Aligned: the Section 5.2 field table (content_hash is required for git entries; tree_sha256 is reserved), the Section 5.6.4 editorial note, the Section 7.5 replay prose, and the informative lockfile examples (now content_hash).
  • Appendix D gains a 0.1.71 row, adopted 2026-11-20 by editor decision (steward ruling, Spec conformance: classify linked tests by kind so CONFORMANCE counts behavioral coverage #4092).
  • This re-anchors the obligation without weakening it. Schema bytes and lockfile_version are unchanged; the count stays 149 (144 MUST, 5 SHOULD).
  • The req-lk-015 conformance test pins the new text, and the manifest gains a note. CONFORMANCE has no diff.

Issue and approved scope

Issue: Refs #4092 (Part of #4092)

Human scope-approval comment: the steward ruling on #4092, relayed by the 0.37 Stream H lead.

Does this PR complete the issue, or what remains? It completes the req-lk-015 part of #4092's spec-conformance linking.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally. Static only: pytest tests/spec_conformance --collect-only (683 collected), gen_statement (no diff), orphan_check (OK) and ruff. CI validates the rest.
  • All existing tests pass (CI)
  • Added tests for new functionality (if applicable): the req-lk-015 assertions are extended.

Changelog

  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md (req-lk-015 prose in place, Sections 5.2, 5.6.4 and 7.5, examples, Appendix D).
  • Manifest edit: docs/public/specs/manifests/openapm-v0.1.requirements.yml (req-lk-015 note).
  • Test edit: @pytest.mark.req("req-lk-015") in tests/spec_conformance/test_lockfile_reqs.py is extended.
  • CONFORMANCE.{md,json} regenerated; no changes.

…ash (#4092)

Amendment 0.1.71 re-anchors req-lk-015: every git-sourced lock entry
records content_hash, a sha256 envelope over the package tree; frozen
install and apm audit recompute it and fail closed naming the entry,
the expected and the observed envelope. The canonical tree_sha256 is
reserved for v0.2. The field table, editorial note, Section 7.5 replay
prose and informative examples are aligned; schema bytes are unchanged.

Part of #4092

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The normative integrity-anchor amendment relies on a steward ruling and adoption authority that the retrieved #4092 comments do not substantiate, requiring human confirmation.

No open issues 🎉

What changed in this PR

Re-lands OpenAPM amendment 0.1.71, making content_hash the v0.1 integrity anchor for git-sourced lock entries and reserving tree_sha256 for v0.2.

Changes:

  • Revises req-lk-015 to require recording content_hash and verifying it during frozen installs and apm audit, with fail-closed mismatch diagnostics.
  • Aligns the field table, replay guidance, examples, and amendment history without changing schemas, lockfile_version, or the requirement count.
  • Updates the requirements manifest and extends spec-text assertions to pin the revised wording.
File Description
tests/​spec_conformance/​test_lockfile_reqs.py Adds assertions for the revised integrity requirement and v0.2 reservation.
docs/​src/​content/​docs/​specs/​openapm-v0.1.md Revises the normative requirement and aligns supporting prose, examples, and history.
docs/​public/​specs/​manifests/​openapm-v0.1.requirements.yml Records amendment 0.1.71 in the req-lk-015 notes.

Review effort: Balanced

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 1de3ea5 into main Nov 20, 2026
30 of 37 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-spec-lk015-content-hash branch November 20, 2026 11:33

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The content_hash re-anchoring is consistent across the specification, field table, replay requirements, and lockfile examples. However, there are two areas worth tightening:

  1. tests/spec_conformance/test_lockfile_reqs.py:470-478: The test is still named test_lockfile_tree_sha256_canonicalisation_invariant, although it now validates content_hash as the v0.1 integrity anchor. Rename it to reflect the actual requirement and avoid misleading future maintainers.
  2. Steward ruling and adoption traceability: The amendment is marked adopted through an editor decision without the Section 9.3 reviewer-panel approval or public comment period. Since this changes a normative requirement, ensure the referenced steward ruling and human scope approval are independently verifiable in #4092 rather than relying solely on the PR description.

The specification changes are otherwise well aligned, and keeping the schema bytes and lockfile_version unchanged is appropriate for this amendment. Recommendation: Approve, with a follow-up to improve test naming and verify the amendment's governance record.

Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Co-authored-by: copilot-swe-agent[bot] <[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.

3 participants