You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OCI module-registry and reference-backend paths have eight coupled reliability and trust defects:
published tar+gzip bundles inherit wall-clock gzip timestamps and host file metadata;
a relative or symlinked module entrypoint is not canonicalized against one stable bundle root;
extraction cache entries are neither bound to the layer digest nor protected by an inter-process lock, and extraction writes directly into the final cache directory;
publishing silently falls back to unsigned output when only one signing option is configured;
publishing writes into an existing OCI layout in place and retains stale inventory;
metadata fetches ignore the configured OCI timeout in favor of a separate constant;
malformed or non-UTF-8 registry JSON can escape as unstable decoder exceptions; and
the reference-backend image trust predicate accepts any string containing @sha256:, while runtime OSError failures are not classified by errno.
These defects can produce non-reproducible content digests, cache poisoning or partial-cache reuse, stale published blobs, unexpectedly unsigned modules, unbounded configuration drift, unstable public errors, and execution of malformed image references.
Requirements
GOV-913 — Trust And Integrity Of Reusable Assets
RUN-314 — reference backend
Steps to reproduce
Publish the same module twice at different wall-clock times; compare bundle and manifest digests.
Publish a relative path and a symlink to the same entrypoint; compare root_file and artifact identity.
Interrupt or concurrently run extraction for one manifest digest, or reuse a cache directory with a different layer digest.
pass signer_id without private_key_path, or the inverse.
Republish into a layout containing a stale blob or file.
replace the configured OCI limits timeout and inspect urlopen calls.
serve invalid UTF-8, malformed JSON, or a JSON scalar from tag, manifest, or config endpoints.
evaluate foo@sha256:<64 hex>:junk, sha256:<64 hex>, and placeholder-like malformed names with ImageTrustPolicy; inject PermissionError and non-availability OSError values into the OCI runner.
Expected behavior
Bundle bytes and all content-addressed OCI descriptors are reproducible from identical canonical input bytes.
Relative and symlink entrypoints resolve to one canonical source root and cannot escape it.
A cache hit proves the expected layer digest, concurrent writers serialize, and readers see either a prior valid cache or a fully extracted replacement.
Signing is explicitly both configured and valid, or explicitly absent.
A successful publication exposes exactly the new layout inventory; failed publication preserves the prior layout.
All OCI fetches use the validated configured timeout.
All malformed registry JSON fails closed with stable, bounded SDLParseError messages.
Only syntactically complete digest-pinned references or exact allowlist/default placeholder references pass image trust; runtime absence is distinguished from other command failures without leaking native error text.
Actual behavior
Current implementation violates each expectation above in the corresponding code path.
Gap Claim
The existing digest, signature, OCI-layout, extraction, and image-policy surfaces establish the right architectural boundaries, but several implementation details are not transactional, canonical, or grammar-complete. The fix should harden incumbents rather than add a second registry, cache, trust policy, exception hierarchy, or runtime abstraction.
Existing Surface Audit
Module packaging and publication: raes.module_registry.publishing, models, signing, and digests.
OCI resolution and extraction: raes.module_registry.resolution and constants.
SDL error boundary: SDLParseError.
Registry policy: RegistryTrustPolicy and raes-trust.yaml.
OCI realization: raes_reference_backend.drivers.oci, ImageTrustPolicy, Diagnostic, and the injected subprocess runner.
Public behavior: raes sdl publish/resolve/verify-imports, supply-chain trust specification, reference-backend guide, ADR-063, and ADR-071.
Existing regression lanes: test_sdl_module_registry.py and test_reference_backend_oci_driver.py.
Resolve the module entrypoint strictly once, derive one canonical bundle root, and enforce every imported path against it.
Store a verified layer-digest marker inside the manifest-keyed cache; serialize rebuilds with a per-entry OS file lock; extract into a sibling staging directory; validate the root; then transactionally replace the cache.
Treat signing options as a pair and translate missing/unreadable/invalid key material into stable SDLParseError failures.
Construct the complete OCI layout in a sibling staging directory and transactionally publish it, with rollback preserving the old layout on failure and no stale inventory after success.
Use the validated OCI limits timeout for every network request.
Decode JSON through one bounded helper that catches UTF-8 and JSON shape failures without reflecting payloads or decoder internals.
Add a dated remediation/preflight note that maps each root cause to GOV-913 or RUN-314, the owning layer, negative tests, and stable public failure behavior. Update user-facing module publication and reference-backend documentation only where behavior is operator-visible. Do not create normative schema fields.
Verification Plan
Regression tests for byte-identical bundles, normalized tar/gzip headers, relative/symlink canonicalization, and import escape rejection.
Regression tests for partial signing configuration and invalid/unreadable keys.
Regression tests for exact layout inventory, stale-file removal, and rollback on publication failure.
Regression tests for configured fetch timeout and stable invalid UTF-8/malformed/non-object JSON errors.
Regression tests for cache digest binding, partial-extraction cleanup, concurrent extraction, and cache replacement rollback.
OS: cross-platform behavior; development reproduction on macOS
Architectural trust follow-up
Digest-pinned image admission establishes immutable content selection and integrity, but it does not by itself establish operator authorization or image authenticity. Preserve the focused ADR-063 grammar hardening from #1084, while explicitly deciding whether arbitrary plan-selected digests remain an accepted operator policy or must also satisfy registry allowlisting, signature verification, or another authenticity mechanism consistent with ADR-071. Any strengthened policy must remain operator-configured at the existing ImageTrustPolicy / backend registry seam and receive positive and negative tests without adding a parallel trust authority.
Description
The OCI module-registry and reference-backend paths have eight coupled reliability and trust defects:
These defects can produce non-reproducible content digests, cache poisoning or partial-cache reuse, stale published blobs, unexpectedly unsigned modules, unbounded configuration drift, unstable public errors, and execution of malformed image references.
Requirements
Steps to reproduce
Expected behavior
Actual behavior
Current implementation violates each expectation above in the corresponding code path.
Gap Claim
The existing digest, signature, OCI-layout, extraction, and image-policy surfaces establish the right architectural boundaries, but several implementation details are not transactional, canonical, or grammar-complete. The fix should harden incumbents rather than add a second registry, cache, trust policy, exception hierarchy, or runtime abstraction.
Existing Surface Audit
No second implementation stack is required.
Lineage / Precedent
Literature / Practice
Alternatives
Chosen Architecture
Documentation Defense
Add a dated remediation/preflight note that maps each root cause to GOV-913 or RUN-314, the owning layer, negative tests, and stable public failure behavior. Update user-facing module publication and reference-backend documentation only where behavior is operator-visible. Do not create normative schema fields.
Verification Plan
Environment
Architectural trust follow-up
Digest-pinned image admission establishes immutable content selection and integrity, but it does not by itself establish operator authorization or image authenticity. Preserve the focused ADR-063 grammar hardening from #1084, while explicitly deciding whether arbitrary plan-selected digests remain an accepted operator policy or must also satisfy registry allowlisting, signature verification, or another authenticity mechanism consistent with ADR-071. Any strengthened policy must remain operator-configured at the existing
ImageTrustPolicy/ backend registry seam and receive positive and negative tests without adding a parallel trust authority.