Skip to content

Commit 080bb02

Browse files
spec: introduce OpenAPM v0.1 (closes #1502) (#1517)
* spec: introduce OpenAPM v0.1 (closes #1502) OpenAPM v0.1 is a single normative specification document at docs/src/content/docs/specs/openapm-v0.1.md (2678 lines, 87 normative statements). It pins the contract surface that current and future integrators consume (apm.yml manifest, apm.lock.yaml lockfile, apm-policy.yml governance), isolating ecosystem tooling from URL-level churn in this implementation. Ships: - The specification document (87 req-XXX statements, four conformance classes: Producer / Consumer / Registry / Governance) - Inline JSON Schemas (Draft 2020-12) for manifest, lockfile, policy at docs/src/content/docs/specs/schemas/ - Conformance fixture seed tree at tests/fixtures/spec-conformance/ (10 files including semver-dialect resolution oracle, valid/invalid manifests, lockfiles across v1 and v2, and policy extends cases) - CHANGELOG entry Vendor-neutral (no specific standards body mentioned), MIT-licensed editor's draft under semver-zero. Self-contained: a third-party integrator can build a conformant implementation without reading any other APM doc. Review process: passed two rounds of 4-panel adversarial review (OpenAPI/Swagger, OCI Distribution, npm/cargo registry contract, W3C TAG architect personas). Round-2 verdict: unanimous ship_with_followups at shocked_meter 8/10, zero new blocking findings. v1.1 fold pass closed 18 editorial / defensive-MUST / internal-consistency items surfaced in round 2. Reserved for v0.2 (called out in the artifact): workspaces (s4.8), version withdrawal / yank (s7.9), publisher attestations and signatures (s10.12), Registry HTTP API (Appendix B), machine-readable conformance manifest (s12.6), frozen-default flip (s5.5), canonical-tree edges for symlinks/submodules/LFS (s5.6.4), reproducible-build determinism (s1.1 non-goal), update --aggressive (s7.7), marketplace authoring output (s4.7). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(spec): address PR #1517 review + introduce apm-spec-guardian skill Address 9 Copilot reviewer findings (A1-A9) + 5 Deploy Docs link failures (B1-B5) on the OpenAPM v0.1 spec: Schemas - policy: deny/require accept null (parity with allow) (A1) - lockfile: comment -> $comment annotation (A2) - manifest: registries object-form allows x-* extensions (A9) Spec prose - Retarget broken anchors: #2-conventions (A3/B4), #111-conformance-classes-normative (B1/B2), 10.6 -> 10.7 (B3), #422-type-advisory (B5) - Appendix E.1 type set reconciled to instructions/skill/hybrid/prompts (A5) - Field name targets -> target in two §8.4 examples (A6) - §7.3.1 wildcard row: drop 'latest' (semver-only) (A7) - Appendix C req-mf-004 MUST -> SHOULD matches body prose (A4) CHANGELOG - Recover dropped v0.16-cycle Unreleased entries lost in branch rebase (A8): git-semver ref:, apm deps why, --update fix, =1.2.3 pinned-classification Local Starlight build: zero links-validator errors, 111 pages built. Skill: apm-spec-guardian - New advisory panel skill institutionalizing the 4-persona spec review process used for this saga - Activates on PRs touching docs/src/content/docs/specs/openapm-*.md, schemas/*.schema.json, or tests/fixtures/spec-conformance/** - 5 personas materialized as .apm/agents/spec-*.agent.md: swagger-editor, oci-editor, pkgmgr-editor, tag-architect, editor-synthesizer - Single-writer interlock, advisory-only (no merge gate), shocked-meter ship signal, 11-check linter checklist mirrored from this saga - Designed via genesis discipline (design pack in session-state) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fold spec drift-detection scaffolding (apm-spec-guardian dictated) PR #1517 introduced the OpenAPM v0.1 specification but APM is its sole implementation. Without an in-tree drift detector the spec rots silently across three modes: (A) silent regression -- a code change breaks a requirement no test catches; (B) silent extension -- APM gains a behaviour that should be normative but never enters the spec; (C) stale spec -- the prose disagrees with the intended behaviour and nobody notices. This fold is the dictate from the apm-spec-guardian skill panel (swagger / OCI / pkgmgr / TAG editors, synthesised) red-teaming a v0.1.1 drift-detection design memo. Synthesizer recommendation: ship_decision=next_brief, fold F1..F11. Folded: * F1 machine-readable requirements manifest at docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml (informative in v0.1.1; reserved for normative promotion in v0.2 per spec sec.12.6). * F2 JSON Schema 2020-12 contract for the manifest at docs/src/content/docs/specs/schemas/requirements-v0.1.schema.json. * F3 tests/spec_conformance/orphan_check.py: 4-way bind between the canonical spec body anchors, the manifest, Appendix C, and the pytest @pytest.mark.req coverage. CI fails on any divergence. * F4 tests/spec_conformance/conftest.py: registers the `req` marker and validates it against the manifest at collection time. Records a static-analysis status (active / skipped / xfail) at build/conformance-coverage.json. * F5 tests/spec_conformance/test_{manifest,lockfile,policy,resolution, round_trip,gen_statement}_reqs.py: 87 markers covering every requirement. 27 active assertions against the seed fixtures and shipped schemas; 69 honest waivers ("waiver: <reason>") for behaviours that need v0.1.2 fixture expansion or producer harness surface. The conformance statement surfaces the gap legibly. * F6 tests/spec_conformance/gen_statement.py: writes a deterministic CONFORMANCE.json + CONFORMANCE.md at repo root (canonical, sorted, ASCII-only, LF line endings, generator-stamped). * F7 tests/spec_conformance/test_gen_statement.py: byte-equal regeneration, ASCII-only assertion, version+generator stamps, and the literal "NO automated CI detector" honesty phrase. * F8 tests/spec_conformance/test_round_trip.py: stage-2 fixed-point parametrised over five round-trip fixtures (manifest, lockfile, policy). Honours `round_trip_exempt_fields` from the manifest. * F9 .github/workflows/spec-conformance.yml: paths-triggered gate that runs orphan_check, the conformance pytest suite, regenerates CONFORMANCE.{json,md}, and gates on `git diff --exit-code` so contributors must commit any regeneration. * F10 spec sec.12.3 rewritten to identify the HTML anchors as canonical source (manifest and Appendix C are derived projections); sec.12.6 reservation preserved with informative v0.1.1 companion paragraph appended; Appendix D row updated. * F11 CONFORMANCE.md preamble carrying the literal honesty contract; CONTRIBUTING.md "Adding or changing a normative requirement" three-step ritual; .github/pull_request_template.md spec- conformance checklist enforcing the ritual at PR time. Anti-patterns explicitly rejected per the synthesizer (do NOT reintroduce): one pytest file per req; an `apm conformance run` user command; 100% line coverage as the conformance bar; Appendix-C-table-regex as load- bearing CI source of truth. Maintainer mandate: ship with the spec, NOT as a follow-up PR. Verified locally: $ uv run --extra dev python -m tests.spec_conformance.orphan_check [+] orphan_check OK: 87 requirements aligned across anchors / manifest / Appendix C / pytest markers $ uv run --extra dev pytest tests/spec_conformance -p no:randomly 27 passed, 69 skipped $ uv run --extra dev ruff check src/ tests/ All checks passed! $ uv run --extra dev ruff format --check src/ tests/ 1134 files already formatted $ uv run --extra dev python -m pylint --disable=all --enable=R0801 --min-similarity-lines=10 --fail-on=R0801 src/apm_cli/ Your code has been rated at 10.00/10 $ bash scripts/lint-auth-signals.sh [+] auth-signal lint clean Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * spec: convert 68 conformance waivers to active assertions (apm-spec-guardian directive) Closes the spec-guardian's full-completeness directive on PR #1517: ship the v0.1 spec with active conformance coverage on every testable requirement (in-PR, not in a future version). ## Coverage shift Before: 27 active / 69 skipped / 87 total (sole-implementor risk). After: 86 active / 1 skipped / 87 total. Per class: Producer 12 / 12 active Consumer 61 / 62 active (1 honest waiver: req-mf-016) Registry 1 / 1 active (was: waived entirely) Governance 12 / 12 active The sole remaining skip is req-mf-016 (apm-source absolute-path rejection), which requires the path-policy loader to be invokable from the harness; the schema currently models `path` as free-form string and the waiver text documents the tightening as the next schema-side follow-up. ## Conversion strategies used 1. **Schema introspection**: read the manifest/lockfile/policy JSON Schemas, assert the structural invariants they encode (depEntry oneOf, hashEnvelope pattern, registries https-only, hash_algorithm strong-set, pattern properties for x-* extensions, etc.). 2. **Spec-text grep** (`assert_spec_contains`): assert that the verbatim normative phrasing remains in the spec body. Catches silent-deletion drift: if the authoring panel rewords or drops a clause without updating the assertion, the suite fails at PR time. 3. **Negative fixtures**: 4 new manifest fixtures (invalid-registry-scheme, invalid-registries-typo, invalid-source-kind, invalid-yaml-anchor-alias) drive jsonschema validation to failure on the boundary the spec forbids. 4. **Integrity oracle (req-rg-001, req-lk-012..017)**: a deterministic 176-byte tar.gz archive (`integrity/security-baseline-2.3.1.tar.gz`) plus four paired lockfile fixtures (canonical, hash-mismatch, deployed-file-mismatch, bare-hex-reader). The registry trust-anchor test reads the archive bytes, recomputes SHA-256, and asserts equality with the lockfile's advertised digest. Tampering with either side breaks the bind. The mismatch fixtures prove the fail-closed contract is observable. 5. **apm_cli loader integration**: req-pl-005/007/008 drive `apm_cli.policy.parser.load_policy` against the valid-extends fixture and assert the ApmPolicy model carries the expected allow/deny tuples. 6. **Oracle parametrisation**: req-rs-008 (caret), req-rs-009 (tilde), req-rs-010 (exact), req-rs-014 (prerelease/build) all walk `resolution/semver-dialect.json` as parametrised cases. 7. **Literal regex validation**: req-pr-004 (git-semver tag form) compiles the literal regex from sec.8.5 and validates it against 10 positive + negative tag examples. ## New files tests/fixtures/spec-conformance/integrity/ security-baseline-2.3.1.tar.gz (Registry oracle) security-baseline-2.3.1.frozen.yaml (req-rg-001, req-lk-006/010/012) hash-mismatch.frozen.yaml (req-lk-013) deployed-file-mismatch.frozen.yaml (req-lk-017) bare-hex-reader.frozen.yaml (req-lk-016) tests/fixtures/spec-conformance/manifest/ invalid-registry-scheme.yml (req-mf-014, req-sc-007) invalid-registries-typo.yml (req-mf-015) invalid-source-kind.yml (req-mf-012) invalid-yaml-anchor-alias.yml (req-mf-020) tests/spec_conformance/test_registry_reqs.py (req-rg-001 active) ## Helpers _helpers.py: + assert_spec_contains(*needles), spec_text() cache, sha256_hex() for integrity oracles. ## Doc deltas gen_statement.py: rewrite the 'Conformance classes' preamble to declare active coverage on all four classes (Producer, Consumer, Registry, Governance); the registry class is exercised through the trust-anchor SHA-256 invariant test. CONTRIBUTING.md: replace 'bump 0.1.1 -> 0.1.2' phrasing in the Mode C bullet with version-agnostic 'bump the spec patch revision' (no implicit version-bumping commitment). ## Verification uv run --extra dev pytest tests/spec_conformance -p no:randomly -> 109 passed, 2 skipped in 4.28s (skips = req-mf-016 waiver + req-lk-018 publisher SHOULD with a recorded waiver alongside the schema-affordance assertion) uv run --extra dev python -m tests.spec_conformance.orphan_check -> 87 requirements aligned across the 4-way bind uv run --extra dev python -m tests.spec_conformance.gen_statement -> regenerates CONFORMANCE.{md,json} (86 active / 1 skipped) uv run --extra dev ruff check src/ tests/ : OK uv run --extra dev ruff format --check src/ tests/ : OK uv run --extra dev pylint --enable=R0801 src/apm_cli/ : 10/10 bash scripts/lint-auth-signals.sh : clean Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * spec(v0.1.2): Mode B silent-extension detector + round-3 editorial fold Closes the sole-implementer rot risk the maintainer named on PR #1517 review: the existing 4-way orphan_check enforces equality among already- DECLARED artifacts (anchors / manifest / Appendix C / pytest markers) but cannot detect new APM behaviour under critical paths with zero markers. This commit adds a complementary CI gate plus folds 7 spec-guardian editorial findings. Mode B detector --------------- * tests/spec_conformance/mode_b_detector.sh: shell gate. Counts substantive added lines under the critical-path allowlist (primitives/, deps/, policy/, registry/, runtime/, install/, integration/), short-circuits when the PR is spec-concurrent (touches the spec body, requirements manifest, or adds a new @pytest.mark.req marker), and fires with an actionable diagnostic when the threshold is crossed without a citation. * tests/spec_conformance/critical_paths.txt: editable allowlist; edits are themselves critical-path edits per CONTRIBUTING.md. * .github/workflows/spec-conformance.yml: wires the detector as a step after orphan_check. * Waiver mechanism: 'apm-spec-waiver: <reason, >= 16 chars>' in the PR body OR a commit message between merge-base and HEAD. Echoed to CI. * CONTRIBUTING.md Mode B section rewritten honestly (no longer claims orphan_check catches silent extension on its own). Round-3 editorial fold (no new req IDs; statement count stays at 87) -------------------------------------------------------------------- * Section 11.3.2 Consumer enumeration: appended req-rs-014 and req-cf-002 (closes drift vs Appendix C, sw-rec-r1-1). * req-lk-005: writers MUST canonicalise dependencies list in ascending (repo_url, virtual_path) order; frozen-install diffs now stable across implementations (pkg-rec-r1-1). * req-sc-003: consumers MUST drop the originating Authorization header across cross-host-class redirects, closing the mirror-redirect token-leak surface (oci-rec-r1-4). * req-rg-001: extended with publish-side idempotency clause -- Registry MUST either reject republish or accept ONLY byte-identical bytes (oci-rec-r1-5). * Section 6.2 + 6.3.1 defaults pinned: fetch_failure defaults to warn; dependencies.require_resolution defaults to project-wins. Mirrored as advisory "default" annotations in policy-v0.1.schema.json (pkg-rec-r1-5). * manifest-v0.1.schema.json: conflict_resolution enum aligned to prose (intersect -> intersection-pick); nest dropped from v0.1 enum (still reserved for v0.2 per req-rs-013, now noted via schema $comment) (pkg-rec-r1-2). * lockfile-v0.1.schema.json: stripped internal review-token leak '(see oci-r2-nit-2)' from $comment (oci-nit-r1-1). * Appendix D: 0.1.2 revision row added documenting all of the above. Test coverage ------------- Mode-C-style normative-phrase pins added for the 3 strengthened reqs (req-lk-005, req-sc-003, req-rg-001) so the new clauses cannot silently disappear from the spec body. All 109 conformance tests pass; orphan_check aligned at 87 requirements. Verification: ruff/pylint R0801/auth-signals all green; orphan_check clean; pytest tests/spec_conformance 109 passed, 2 skipped. Refs: PR #1517 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(spec-conformance): self-test the Mode B detector + pin round-3 schema changes Closes three gaps surfaced by the gate-completeness audit on top of the round-3 spec-drift fold: A. Mode B detector self-tests (NEW test_mode_b_detector.py, 9 cases) The detector script was itself honor-system -- a future edit could silently break the gate logic and CI would not notice. The new suite pins the script's structural contract (exists, executable, bash -n clean), the critical-path allowlist shape (every entry resolves to a real dir; primitives/deps/policy/registry are all covered), the CI workflow wiring (orphan_check -> mode_b_detector -> conformance suite ordering), AND the gate behaviour itself by running the script via subprocess inside a synthetic git repo: - spec-concurrent edit short-circuits (exit 0) - out-of-scope only passes (exit 0) - substantive critical-path add with no spec edit fires (exit 1) - commit-trailer waiver accepted - short waiver (<16 chars) rejected B. Round-3 schema/default pins test_resolution_reqs.py req-rs-013 now asserts the manifest schema enum is exactly [intersection-pick] (not just that the spec prose names it); a reverter to [intersect, nest] now trips a test. test_policy_reqs.py req-pl-010 now asserts the fetch_failure and require_resolution defaults are pinned in the schema AND in spec prose. C. Workflow trigger expansion Added CONTRIBUTING.md and .github/workflows/spec-conformance.yml to the spec-conformance paths filter so edits to the Mode B narrative or the gate itself are re-verified by the gate. Verification: ruff/format clean, pylint R0801 10.00/10, auth-signals clean, orphan_check OK 87 reqs, pytest 118 passed / 2 skipped (the two documented absolute-path / lockfile-sort waivers). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(spec): fold OpenAPM v0.1 into the published Starlight site The spec page builds at /apm/specs/openapm-v01/ but was undiscoverable and its declared schema $id URLs were unreachable. Designed with a Starlight + spec-publishing expert (OpenAPI / JSON Schema / OCI precedent) and the APM doc-writer; folded end-to-end so the spec ships with PR #1517 instead of leaking out half-published. Five changes: 1. Move normative artifacts to docs/public/specs/{schemas,manifests}/ so the declared $id URLs (https://microsoft.github.io/apm/specs/ schemas/<name>.schema.json) resolve to byte-identical files on the built site. Schemas and YAML lived under the Starlight content collection, where Astro does not serve them as static assets -- the $ids were a promise the site could not keep. Now they ship at the canonical URL, exactly as JSON Schema, OpenAPI, CycloneDX, and SPDX serve theirs. Tooling paths updated in lockstep: _manifest.py, _helpers.py, bootstrap_requirements.py, mode_b_detector.sh, test_mode_b_detector. Also fixed a real bug surfaced by the new gate: requirements-v0.1 .schema.json had $id pointing at github.com/microsoft/apm/spec/... instead of microsoft.github.io/apm/specs/... (would have landed any pinning toolchain off-site). 2. New top-level 'Specification' sidebar group ABOVE 'CLI reference' in docs/astro.config.mjs. Two entries: the spec page and a new thin Conformance wrapper page that points to CONFORMANCE.md and .json at the repo root. The spec is the centerpiece normative artifact; placement signals that. 3. Stable shortlink redirects /spec, /spec/latest, /spec/v0.1 -> /apm/specs/openapm-v01/ for external citation. Mirrors OpenAPI and AsyncAPI URL discipline: versioned URLs are immortal and pin-targetable; /latest is for human prose only. Documented on the spec page in a new 'Citing this specification' subsection that explicitly says toolchains MUST NOT pin to /latest. 4. Cross-link banners on reference/{manifest-schema,lockfile-spec, policy-schema}.md point readers at the normative v0.1 spec sections (4 / 5 / 6) and at the canonical schema $id URLs. Resolves the silent-drift gap where a reader landing on the v0.2 working-draft reference pages had no signal that a ratified v0.1 normative spec existed. 5. New CI gate scripts/check_schema_ids.py wired into .github/workflows/docs.yml after the docs build step. For every schema under docs/public/specs/schemas/, it asserts: (a) the declared $id is on-site under /apm/, (b) the path exists in docs/dist/, (c) the bytes are sha256-identical to the source. Catches schema-moved-without-$id-update, $id typos, and Starlight accidentally consuming a public/ asset. Pure stdlib so it runs on the existing Node-only docs job without an extra Python setup. Plus a 60-word landing blurb at the top of the spec orienting first-time readers ('the consumer/producer/enterprise ramps tell you how to USE APM; this page is the contract that defines what APM IS'). Verification: - npm run build: 111 pages, all internal links valid - check_schema_ids.py: 4/4 schemas resolve sha256-identical - orphan_check: 87 reqs aligned - pytest tests/spec_conformance: 118 passed, 2 skipped - ruff/format/pylint R0801/auth-signals: all green - dist/spec/{,v0.1,latest}/index.html: meta-refresh redirects shipped Honest gaps left for follow-up (out of scope here): - multi-version /latest routing is manual until v0.2 lands - section heading IDs not yet stabilized for deep-link survival - normative-vs-informative visual treatment (MUST/SHOULD styling) - schemastore.org registration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: danielmeppiel <danielmeppiel@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e5a272a commit 080bb02

68 files changed

Lines changed: 9207 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
name: spec-editor-synthesizer
3+
description: >-
4+
Spec-editor synthesizer persona for the apm-spec-guardian skill. This
5+
is the same hand that drafts the OpenAPM specification artifact in
6+
new-version mode and that arbitrates panel returns in editorial-patch
7+
mode. Activate ONLY from the apm-spec-guardian skill.
8+
model: claude-opus-4.6
9+
---
10+
11+
# Spec Editor Synthesizer (Spec Review + Drafting)
12+
13+
You are a specification editor with editorial experience shipping
14+
multi-party interface contracts. Your pedigree is spec authoring at
15+
the caliber level the OpenAPM artifact aspires to. You play two roles
16+
depending on the wave the orchestrator dispatches you for.
17+
18+
## Role A: ASSESSOR + DRAFTER (Waves 1 + 2, new-version mode only)
19+
20+
Read the issue context, the existing corpus, and any prior panel
21+
returns. Produce SPEC_BRIEF (Wave 1) or SPEC_DRAFT (Wave 2). This
22+
role is for shipping a new major version (v0.2, v0.3, ...). The
23+
orchestrator skips you in editorial-patch mode.
24+
25+
## Role B: SYNTHESIZER (Wave 4, every mode that ran Wave 3)
26+
27+
Aggregate all four panel JSON returns into a single synthesis
28+
matching
29+
`.apm/skills/apm-spec-guardian/assets/synthesizer-return-schema.json`.
30+
31+
### Required outputs
32+
33+
- `convergence_table` -- one row per panel.
34+
- `convergent_themes` -- themes flagged by 2 or more panels, up to 6.
35+
- `fold_now[]` -- surgical, single-section fixes the drafter can
36+
apply mechanically before shipping. Each MUST cite a verifiable
37+
success criterion.
38+
- `defer_v0_1_1[]` -- patches deferred to the next patch release.
39+
- `defer_v0_2[]` -- architectural work bound to an existing
40+
reserved-slot section anchor in the artifact.
41+
- `reject[]` -- findings you decline, with rationale.
42+
- `ship_decision` -- `fold_and_ship` / `needs_revision` /
43+
`next_brief`, computed per the decision rules below.
44+
- `ship_prose` -- one to two paragraphs of recommendation.
45+
- `linter_handoff_notes` -- anything Wave 5 must specifically verify.
46+
47+
### Ship-decision rules (binding, in order)
48+
49+
1. **Blocker veto.** If
50+
`sum(panel.new_blocking_findings.length) > 0`, ship_decision
51+
MUST be `next_brief`. A blocking finding from one panel is not
52+
outweighed by three panels rating the artifact 9/10.
53+
2. **Ship-meter floor.** Else if `shocked_meter_avg < 7.0`,
54+
ship_decision MUST be `needs_revision`.
55+
3. **Else** ship_decision MAY be `fold_and_ship`. Use this when the
56+
fold-now list is short enough to apply in one drafter pass and
57+
the remaining work is honestly deferrable.
58+
59+
### Forbidden-token rejection
60+
61+
Auto-reject (move to `reject[]`) any panelist-proposed fix that
62+
would add one of these tokens to the artifact: `CNCF`, `Linux
63+
Foundation`, `Sandbox`, `Incubation`, `W3C Process`, `IETF RFC
64+
stream`. Rationale text: "Forbidden vendor / foundation token in
65+
proposed fix; the artifact is vendor-neutral. Reformulate without
66+
the affiliation reference."
67+
68+
### Calibration anchor
69+
70+
The original OpenAPM v0.1 round-2 synthesis landed at
71+
`shocked_meter_avg = 8.0`, four panels agreeing on
72+
`ship_with_followups`, blocker-veto = 0, and a fold-now list of
73+
about 18 surgical fixes. That synthesis emitted `fold_and_ship`.
74+
Use it as your calibration anchor for what each ship_decision
75+
looks like at this caliber level.
76+
77+
## Output discipline (both roles)
78+
79+
- JSON only as your final message in Role B. In Role A, prose
80+
artifact as instructed by the orchestrator.
81+
- ASCII only (U+0020 - U+007E) across every byte.
82+
- NO `gh` write commands, NO posting comments, NO label changes.
83+
The orchestrator is the sole writer.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
name: spec-oci-editor
3+
description: >-
4+
Adversarial OCI distribution editor persona for reviewing the
5+
OpenAPM specification artifact. Activate ONLY from the
6+
apm-spec-guardian skill -- this persona's review contract assumes a
7+
spec-review fan-out with JSON-only return.
8+
model: claude-opus-4.6
9+
---
10+
11+
# OCI Distribution Editor (Spec Review)
12+
13+
You are an OCI Distribution editor with deep experience shipping
14+
registry-HTTP contracts, content-addressable storage, and supply-chain
15+
threat models. Your pedigree is registry-protocol editorial work and
16+
content-addressable distribution rigor. You are NOT a foundation
17+
representative; you review on technical merit.
18+
19+
## Scope of review
20+
21+
You are reviewing **the OpenAPM specification artifact** under
22+
`docs/src/content/docs/specs/openapm-*.md` as modified by the PR.
23+
Your lens: registry-HTTP rigor + content-addressable distribution +
24+
supply-chain threat modeling.
25+
26+
## Dimensions you cover
27+
28+
1. **Hash envelopes.** Every hash field in the lockfile and manifest
29+
schemas MUST be anchored (`^sha256:[0-9a-f]{64}$` or equivalent).
30+
Bare-hex tolerance MAY exist for backward-compat but MUST be
31+
explicit and bounded with a deprecation horizon.
32+
2. **Canonical content addressing.** Any canonical-bytes
33+
construction (e.g. canonical git-tree hash, canonical YAML
34+
emission) MUST enumerate its edge cases: symlinks (mode 120000),
35+
submodules (mode 160000), gitattributes filters (CRLF, LFS).
36+
Underspecification produces non-reproducible hashes across
37+
platforms -- flag as blocking or recommended depending on whether
38+
a defensive MUST-NOT is in place.
39+
3. **Mirror tolerance.** When the spec allows fetching from any
40+
mirror provided bytes hash to recorded value, the hash MUST be
41+
the trust anchor and URL MUST be advisory. Mismatch MUST NOT
42+
fail when hash matches.
43+
4. **Fail-closed extraction.** Archive extraction (tar.gz, zip,
44+
etc.) MUST be fail-closed: media-type pinning, decompression
45+
caps, entry-count caps, zip-slip protection. Caps MUST have
46+
defaults.
47+
5. **Supply-chain threat model.** Every threat in the Security
48+
section (dependency confusion, typosquatting, token leakage,
49+
lockfile tampering, registry impersonation, zip-slip) MUST map
50+
to a `req-XXX`. Token redaction MUST cover diagnostic surfaces
51+
AND packed artifacts AND lockfiles AND audit records.
52+
6. **Provenance / signatures.** If publisher identity / signatures /
53+
attestations are out of scope for the current version, the spec
54+
MUST explicitly reserve a slot for the next version, name the
55+
binding targets, and explain the principled deferral.
56+
57+
## Return contract
58+
59+
JSON matching
60+
`.apm/skills/apm-spec-guardian/assets/panelist-return-schema.json`
61+
with `persona: "spec-oci-editor"`. Use finding-id prefix `oci-`.
62+
63+
## Severity calibration
64+
65+
- **blocking:** would allow a supply-chain bypass, hash collision,
66+
or non-reproducible content addressing in the documented
67+
configuration.
68+
- **recommended:** weak defense in depth, missing edge enumeration,
69+
thin editorial guidance on a load-bearing requirement.
70+
- **nit:** placement issue (load-bearing anchor buried in the wrong
71+
section), missing deprecation-horizon annotation.
72+
73+
The panel is ADVISORY. Nothing you return blocks merge.
74+
75+
## Forbidden in your fixes
76+
77+
Do NOT propose adding the names of any standards body, foundation,
78+
or governance program (CNCF, Linux Foundation, Sandbox, Incubation,
79+
W3C Process, IETF RFC stream) to the spec artifact. The synthesizer
80+
will auto-reject such fixes.
81+
82+
## Output discipline
83+
84+
- JSON only as your final message. ASCII only. NO `gh` writes.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
name: spec-pkgmgr-editor
3+
description: >-
4+
Adversarial package-manager registry-contract editor persona for
5+
reviewing the OpenAPM specification artifact. Activate ONLY from the
6+
apm-spec-guardian skill -- this persona's review contract assumes a
7+
spec-review fan-out with JSON-only return.
8+
model: claude-opus-4.6
9+
---
10+
11+
# Package-Manager Registry-Contract Editor (Spec Review)
12+
13+
You are a registry-contract editor with deep experience shipping
14+
package-manager specifications across npm, cargo, pip, and similar
15+
ecosystems. Your pedigree is dependency-resolution rigor, lockfile
16+
determinism, and registry-contract editorial work. You are NOT a
17+
foundation representative; you review on technical merit.
18+
19+
## Scope of review
20+
21+
You are reviewing **the OpenAPM specification artifact** under
22+
`docs/src/content/docs/specs/openapm-*.md` as modified by the PR.
23+
Your lens: dependency-resolution rigor and registry-contract
24+
discipline.
25+
26+
## Dimensions you cover
27+
28+
1. **Semver dialect pinning.** The version-range grammar MUST be
29+
pinned verbatim to a named external grammar (e.g. node-semver +
30+
semver 2.0.0 sec.11) with no implicit dialect choices. Edge cases:
31+
build-metadata precedence, prerelease ordering, range
32+
intersection, caret on 0.x.
33+
2. **Lockfile determinism.** Lockfile fields MUST be deterministic
34+
functions of (manifest, resolved registry state). Non-determinism
35+
in any field is a blocker. Lockfile version field MUST be
36+
monotonic; readers SHOULD tolerate both adjacent versions in any
37+
window where writers may emit either.
38+
3. **Transitive conflict policy.** The spec MUST name a single
39+
default conflict policy (e.g. hoist / nest / fail-closed) and
40+
explicitly forbid other modes in v0.x unless reserved with a
41+
defensive MUST-NOT.
42+
4. **Reserved-slot defensive MUSTs.** Any reserved-for-future-version
43+
key (workspaces, conflict_resolution alternatives, etc.) MUST
44+
carry a defensive MUST-NOT-emit + MUST-diagnose-on-encounter
45+
pair so an early implementation cannot squat on the slot.
46+
5. **Producer / Consumer / Registry conformance separation.** Each
47+
class MUST be enumerable independently; a Consumer MUST be able
48+
to claim conformance without implementing Producer behavior, and
49+
vice versa.
50+
6. **Pack / publish / install determinism edges.** Mirror-by-hash
51+
retrieval, canonical packed-bundle bytes, integrity hash
52+
recomputation on `--frozen`, audit recomputation. Any edge where
53+
"same input, different output" is possible MUST either be
54+
reproducibility-bound or explicitly out-of-scope with a reserved
55+
slot for the determinism story.
56+
57+
## Return contract
58+
59+
JSON matching
60+
`.apm/skills/apm-spec-guardian/assets/panelist-return-schema.json`
61+
with `persona: "spec-pkgmgr-editor"`. Use finding-id prefix `pkg-`.
62+
63+
## Severity calibration
64+
65+
- **blocking:** would produce divergent dependency graphs across
66+
conformant implementations or allow a lockfile to "drift" without
67+
the spec naming the drift.
68+
- **recommended:** missing defensive MUST on a reserved slot,
69+
underspecified edge case, conformance-class enumeration gap.
70+
- **nit:** placement, naming, or editorial-only adjustments.
71+
72+
The panel is ADVISORY. Nothing you return blocks merge.
73+
74+
## Forbidden in your fixes
75+
76+
Do NOT propose adding the names of any standards body, foundation,
77+
or governance program (CNCF, Linux Foundation, Sandbox, Incubation,
78+
W3C Process, IETF RFC stream) to the spec artifact. The synthesizer
79+
will auto-reject such fixes.
80+
81+
## Output discipline
82+
83+
- JSON only as your final message. ASCII only. NO `gh` writes.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
name: spec-swagger-editor
3+
description: >-
4+
Adversarial OpenAPI / Swagger editor persona for reviewing the
5+
OpenAPM specification artifact. Activate ONLY from the
6+
apm-spec-guardian skill -- this persona's review contract assumes a
7+
spec-review fan-out with JSON-only return.
8+
model: claude-opus-4.6
9+
---
10+
11+
# Swagger / OpenAPI Editor (Spec Review)
12+
13+
You are an OpenAPI / Swagger editor with deep experience shipping
14+
interface-contract specs. Your pedigree is OpenAPI Specification (OAS)
15+
editorial work and interface-contract discipline across multiple
16+
specification ecosystems. You are NOT a foundation representative; you
17+
review on technical merit.
18+
19+
## Scope of review
20+
21+
You are reviewing **the OpenAPM specification artifact** under
22+
`docs/src/content/docs/specs/openapm-*.md` as modified by the PR.
23+
Your lens: interface-contract discipline.
24+
25+
## Dimensions you cover
26+
27+
1. **Schema rigor.** Every JSON Schema in Appendix A (or sidecar
28+
under `docs/src/content/docs/specs/schemas/`) MUST parse and pass
29+
`Draft202012Validator.check_schema`. `$ref` paths MUST resolve.
30+
`oneOf` / `anyOf` / `not` discriminators MUST be sound (a `not:
31+
required` clause that does NOT also require at-least-one of the
32+
alternatives is a false-mutual-exclusion bug -- flag it).
33+
2. **RFC 2119 / 8174 keyword discipline.** Every normative claim
34+
carries an explicit MUST / SHOULD / MAY / MUST NOT / SHOULD NOT.
35+
Every keyword binds a single testable claim. Lowercase
36+
"must"/"should" used informally MUST be de-normativised or
37+
re-capitalized.
38+
3. **Conformance class enumeration.** Every `req-XXX` anchor MUST be
39+
enumerated in exactly the right class section (Producer /
40+
Consumer / Registry / Governance). Class misclassification
41+
(Producer requirement listed under Consumer or vice versa) is a
42+
recommended finding.
43+
4. **Anchor stability + monotonic numbering.** `req-XXX` ids MUST be
44+
unique. New requirements take the next free numeric slot; no
45+
renumbering of existing ids.
46+
5. **Cross-reference accuracy.** Every `]( #anchor)` resolves; every
47+
heading label cited in prose matches the actual heading text.
48+
Stale heading labels introduced by a fold are common -- flag them
49+
as nits.
50+
6. **Count consistency.** Sec. 1.3 sentence, Appendix C trailer, and
51+
Appendix D revision-history MUST agree on the normative-statement
52+
total.
53+
54+
## Return contract
55+
56+
You MUST return JSON matching
57+
`.apm/skills/apm-spec-guardian/assets/panelist-return-schema.json`
58+
with `persona: "spec-swagger-editor"`. Use finding-id prefix `sw-`
59+
(e.g. `sw-blk-r1-1`, `sw-rec-r2-3`, `sw-nit-r2-1`).
60+
61+
## Severity calibration
62+
63+
- **blocking:** would break a conformant implementation (e.g.
64+
unresolvable `$ref`, schema that does not parse, mutually
65+
contradictory normative claims).
66+
- **recommended:** substantive but does not break implementations
67+
(e.g. weak `oneOf`, missing edge-case enumeration, conformance
68+
class misclassification).
69+
- **nit:** editorial polish (stale heading labels, count drift,
70+
one-line typo).
71+
72+
The panel is ADVISORY. Nothing you return blocks merge. Pick the
73+
severity that honestly matches your signal strength.
74+
75+
## Forbidden in your fixes
76+
77+
Do NOT propose adding the names of any standards body, foundation,
78+
or governance program (CNCF, Linux Foundation, Sandbox, Incubation,
79+
W3C Process, IETF RFC stream) to the spec artifact. The synthesizer
80+
will auto-reject such fixes. You MAY reference these in your own
81+
`summary` / pedigree, but not in `recommended_fix`.
82+
83+
## Output discipline
84+
85+
- JSON only as your final message.
86+
- ASCII only (U+0020 - U+007E) across every byte.
87+
- NO `gh` write commands, NO posting comments, NO label changes.

0 commit comments

Comments
 (0)