Skip to content

spec(normative): req-sc-004 zip with uniform limits (#4234); req-lk-015 content_hash anchor (#4092) - #4236

Merged
Daniel Meppiel (danielmeppiel) merged 4 commits into
mainfrom
danielmeppiel-spec-zip-archives
Nov 20, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 4 commits into
mainfrom
danielmeppiel-spec-zip-archives

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

APM publishes and installs zip registry archives (apm publish, apm pack and the release flow produce .zip), but OpenAPM req-sc-004(a) required consumers to reject application/zip. This adopts amendment 0.1.70, which revises req-sc-004 in place per the steward ruling on #4234:

  • (a) admits application/gzip over tar (tar.gz) or application/zip (zip), and rejects every other container.
  • One uniform limit set, (b) through (d), applies identically to both containers:
    • (b) an uncompressed-size cap (default 100 MB);
    • (c) an entry-count cap (default 10,000), counted as entries are read;
    • (d) new: refusal of path traversal, absolute paths, symbolic and hard links, and duplicate entry paths.
      A violation fails closed, and no entry of the archive remains extracted.
  • Appendix B: the reserved v0.2 archive-container item now names both containers under the same limits.
  • Appendix D: a new 0.1.70 row is adopted 2026-11-20 by editor decision recorded in spec: req-sc-004 accepts zip registry archives with the same limits as tar.gz #4234, without the Section 9.3 panel and comment period, following the 0.1.61 to 0.1.65 convention. It is noted in its own sentence so it does not collide with spec(normative): adopt req-lk-024 deployment-evidence deletion (#3701) #4186's edits to the summary paragraph.
  • The statement count is unchanged at 149 (144 MUST, 5 SHOULD).
  • No code change. registry: apply archive limits uniformly #4235 (S lead) applies the archive limits uniformly in code through one owner; this PR lands with or after it.

Spec slot: 0.1.70 is the next free slot after 0.1.69. #4006 (0.38) renumbers at merge per the existing plan.

Also in this PR: amendment 0.1.71, req-lk-015 re-anchor (Part of #4092, steward ruling)

  • req-lk-015 (Section 5.6.4, consumer MUST) is revised in place. 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).
  • This re-anchors the obligation without weakening it. Schema bytes and lockfile_version are unchanged, and the count stays 149.
  • The req-lk-015 conformance test pins the new text, and the manifest gains a note.

Issue and approved scope

Issue: Fixes #4234; Part of #4092 (req-lk-015)

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

Does this PR complete the issue, or what remains? Yes, for the spec. Verifying the zip caps in code is owned by the S lead.

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-sc-004 conformance assertions now pin the zip admission and the identical-limits clause.

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 updated (req-sc-004 prose in place, Appendix B and D; the anchor and Appendix C row are unchanged).
  • Manifest edit: docs/public/specs/manifests/openapm-v0.1.requirements.yml gains a req-sc-004 note.
  • Test edit: @pytest.mark.req("req-sc-004") in tests/spec_conformance/test_manifest_reqs.py is extended.
  • CONFORMANCE.{md,json} regenerated; no changes.

#4234)

Amendment 0.1.70: req-sc-004(a) admits application/zip alongside tar.gz
and rejects every other container; every archive limit (size and entry
caps, req-sc-002 traversal, absolute-path and link rejections, and any
further implementation limit) applies identically to both containers.
Appendix B's reserved archive-container item is aligned.

Fixes #4234

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Name the one limit set both containers share: the size cap, an entry
cap counted as entries are read, and refusal of path traversal,
absolute paths, links and duplicate entry paths.

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

Human review is needed to confirm the still-open #4235 companion implementation and per-format limit/cleanup regressions, since this amendment tests only specification wording rather than runtime guarantees.

No open issues 🎉

What changed in this PR

Adopts OpenAPM amendment 0.1.70 to align registry archive requirements with APM's ZIP-based publishing flow. This PR changes the specification and conformance assertions, not runtime extraction behavior.

Changes:

  • Accepts both tar.gz and zip, with identical size, entry-count, and path-safety limits and cleanup on violations.
  • Updates the requirements manifest and appendices to record adoption without changing the statement count.
  • Extends conformance assertions to pin ZIP acceptance and the shared limits.
File Description
tests/​spec_conformance/​test_manifest_reqs.py Updates assertions for accepted containers and shared archive limits.
docs/​src/​content/​docs/​specs/​openapm-v0.1.md Revises req-sc-004 and records amendment 0.1.70 in the appendices.
docs/​public/​specs/​manifests/​openapm-v0.1.requirements.yml Adds a note describing the adopted archive requirements.

Review effort: Balanced

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

# Conflicts:
#	docs/src/content/docs/specs/openapm-v0.1.md
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 16e0c95 into main Nov 20, 2026
42 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-spec-zip-archives branch November 20, 2026 10:54
@danielmeppiel Daniel Meppiel (danielmeppiel) changed the title spec(normative): req-sc-004 accepts zip archives with identical limits (#4234) spec(normative): req-sc-004 zip with uniform limits (#4234); req-lk-015 content_hash anchor (#4092) Nov 20, 2026
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.

spec: req-sc-004 accepts zip registry archives with the same limits as tar.gz

2 participants