Summary
PR #595 improved OCI reference parsing by delegating to oras-go, but two follow-up improvements would bring PolicyRef into full alignment with OCI Distribution Spec semantics.
Motivation
- The
@version notation (e.g., registry.com/repo@v1.0) conflicts with OCI semantics where @ is exclusively a digest separator. Users familiar with OCI tooling (oras, crane, skopeo) may find this ambiguous.
PolicyRef.Version conflates tags (mutable pointers) and digests (immutable content addresses) into a single field. This prevents complyctl from distinguishing "pin to exact content" from "track latest of this tag" if that distinction is ever needed.
Proposed Changes
1. Deprecate @version notation
2. Split PolicyRef.Version into Tag and Digest fields
3. Consistent error reporting in doctor.go
Context
Summary
PR #595 improved OCI reference parsing by delegating to
oras-go, but two follow-up improvements would bringPolicyRefinto full alignment with OCI Distribution Spec semantics.Motivation
@versionnotation (e.g.,registry.com/repo@v1.0) conflicts with OCI semantics where@is exclusively a digest separator. Users familiar with OCI tooling (oras, crane, skopeo) may find this ambiguous.PolicyRef.Versionconflates tags (mutable pointers) and digests (immutable content addresses) into a single field. This prevents complyctl from distinguishing "pin to exact content" from "track latest of this tag" if that distinction is ever needed.Proposed Changes
1. Deprecate
@versionnotationParsePolicyRefencounters a non-digest@suffix (e.g.,@v1.0), advising the user to switch to:tagsyntax (e.g.,:v1.0).docs/andCHANGELOG.md.@versionsupport (suggest 2 releases from when the warning is introduced).2. Split
PolicyRef.VersionintoTagandDigestfieldsVersionfield with separateTag stringandDigest stringfields onPolicyRef.ParsePolicyRefto populate the correct field based on oras-go output (orasRef.Referenceis a tag whenorasRef.ReferenceType()returnsTag, digest otherwise).BuildLookupRefto use the struct fields instead of prefix checking.ref.Versionto useref.Tagorref.Digestas appropriate.3. Consistent error reporting in
doctor.goCheckPolicyActivePeriodandCheckComplypacksto reportParsePolicyReffailures asCheckResult{Status: StatusFail}matching the pattern inCheckPolicyVersions.CheckVariablesto include a specific error message (not just incrementresolveFailures).Context
openspec/changes/fix-complypack-oci-ref/design.md(Risks / Trade-offs section)