From db9b2b8a5a3f95907058abbdb702bbd6f8c05013 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 14:25:52 +0000 Subject: [PATCH 1/4] fix(deed): split the container-templates directory line under 998 octets The `DEED syntax` check, the `CHORA deed validation` lane of the Proven suite and the `Fork governance verdict` (which aggregates the DEED result) all fail on main with: "line 228: line is 1159 octets; a deed line is at most 998 octets". Put `:purpose` and `:overview` of the container-templates directory on their own lines, the layout rsr-template-repo main uses for the same entry. No characters change: removing all whitespace from the old and new files gives identical text. Longest line is now 748 octets. Checked with deed_lint.js from standards f0b3cd4 (the pin CI uses): the old deed fails with the line-228 message, the new one prints OK. The CLAUDE.md arrival-pack stamp inputs are unchanged (h_deed 2c53e201f68a, h_anchor 035b5062d09c). Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7ZpPGXDRaKVgNQUecwy --- Apodeixis.jl_chora.deed | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Apodeixis.jl_chora.deed b/Apodeixis.jl_chora.deed index b6d0338d..2a1e09bd 100644 --- a/Apodeixis.jl_chora.deed +++ b/Apodeixis.jl_chora.deed @@ -225,7 +225,9 @@ (directory :id "automation-unit-forge" :ply 3 :path ".machine_readable/scripts/forge" :description "Internal automation logic for project forge.") (directory :id "automation-unit-lifecycle" :ply 3 :path ".machine_readable/scripts/lifecycle" :description "Internal automation logic for project lifecycle.") (directory :id "automation-unit-verification" :ply 3 :path ".machine_readable/scripts/verification" :description "Internal automation logic for project verification."))) - (directory :id "container-templates" :ply 1 :path "build/container" :version "1.0.0" :description "Container templates for the stapeln container ecosystem. This directory\nprovides Podman-Chainguard-stapeln templates that are customised via\n`just container-init` or `just repo-init` during project bootstrap.\n\nAll files use {{PLACEHOLDER}} tokens that are substituted with project-\nspecific values during initialisation." :purpose "Provide a complete, security-first container deployment story for any\nRSR-compliant repository. The templates cover the full lifecycle:\nbuild, sign, verify, deploy, monitor, and govern." :overview "The stapeln container ecosystem comprises six tools:\n\nselur — Container orchestration with zero-copy IPC. Reads compose.toml.\ncerro-torre — Verified container packaging (.ctp bundles), Ed25519 signing.\nsvalinn — Policy-driven edge gateway (auth, rate limits, CORS, trust).\nvordr — Runtime monitoring (health, crashes, resources, logs).\nrokur — Secrets management (runtime injection, no baked secrets).\nk9-svc — Nickel deployment components (Kennel/Yard/Hunt trust levels)." + (directory :id "container-templates" :ply 1 :path "build/container" :version "1.0.0" :description "Container templates for the stapeln container ecosystem. This directory\nprovides Podman-Chainguard-stapeln templates that are customised via\n`just container-init` or `just repo-init` during project bootstrap.\n\nAll files use {{PLACEHOLDER}} tokens that are substituted with project-\nspecific values during initialisation." + :purpose "Provide a complete, security-first container deployment story for any\nRSR-compliant repository. The templates cover the full lifecycle:\nbuild, sign, verify, deploy, monitor, and govern." + :overview "The stapeln container ecosystem comprises six tools:\n\nselur — Container orchestration with zero-copy IPC. Reads compose.toml.\ncerro-torre — Verified container packaging (.ctp bundles), Ed25519 signing.\nsvalinn — Policy-driven edge gateway (auth, rate limits, CORS, trust).\nvordr — Runtime monitoring (health, crashes, resources, logs).\nrokur — Secrets management (runtime injection, no baked secrets).\nk9-svc — Nickel deployment components (Kennel/Yard/Hunt trust levels)." :context ("https://stapeln.dev/ns/v1") (canonical-locations :build_pipeline "build/container/stapeln/ct-build.sh" :compose "build/container/stapeln/compose.toml" :compose_example "build/container/stapeln/compose.example.toml" :compose_portable "build/container/compose.yaml" :compose_portable_example "build/container/compose.example.yaml" :containerfile "build/container/Containerfile" :containerignore "build/container/.containerignore" :deployment "build/container/stapeln/deploy.k9.ncl" :entrypoint "build/container/entrypoint.sh" :gatekeeper "build/container/stapeln/.gatekeeper.yaml" :just_module "build/just/container.just" :manifest "build/container/stapeln/manifest.toml" :monitoring "build/container/stapeln/vordr.toml" :secrets_gate "build/container/stapeln/rokur.toml") :invariants ("Base images MUST be cgr.dev/chainguard/wolfi-base or cgr.dev/chainguard/static" "Container runtime is Podman — never Docker" "Containerfile — never Dockerfile" "All images run as non-root (appuser or project-specific user)" ".ctp bundles are signed with Ed25519 via cerro-torre" "Health endpoints (/health, /ready) must always be public (no auth)") From 32385e5d005224d933aa24f80cf7f7c84fcf1651 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 14:26:21 +0000 Subject: [PATCH 2/4] fix(container): pin the wolfi-base image by digest `Code Quality / mint-gates` fails on main in check-container-pins.sh: "build/container/Containerfile: floating base image 'cgr.dev/chainguard/wolfi-base:latest'" (TRUST-DEFAULTS-POLICY, Trustfile check container-images-pinned). Pin both FROM lines to sha256:1f6b7499...db31, the multi-arch (amd64 + arm64) OCI index that cgr.dev/chainguard/wolfi-base:latest resolved to on 2026-11-14. Verified, not assumed: the digest came from the registry's Docker-Content-Digest header on two requests, sha256 of the returned manifest body equals it, and `podman pull` of the digest succeeds. The comment above the FROM line said `:latest` was right for a template scaffold; it now says the image is pinned and how to refresh it. The .devcontainer/Containerfile is out of scope for the gate and unchanged. .machine_readable/configs/stapeln.toml also names `:latest` in two `from` fields; the gate does not scan it and it is left alone. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7ZpPGXDRaKVgNQUecwy --- build/container/Containerfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/build/container/Containerfile b/build/container/Containerfile index 691ec193..b9890060 100644 --- a/build/container/Containerfile +++ b/build/container/Containerfile @@ -56,12 +56,13 @@ # RUN zig build -Doptimize=ReleaseFast # # Output: /build/zig-out/bin/apodeixis.jl # -# Base image: `:latest` is right for a template scaffold (Chainguard rebuilds -# Wolfi daily). For PRODUCTION builds, pin by digest for reproducibility/supply- -# chain integrity, e.g.: -# FROM cgr.dev/chainguard/wolfi-base:latest@sha256: AS builder -# (cerro-torre's .ctp signing in build/container/stapeln/ records the resolved digest.) -FROM cgr.dev/chainguard/wolfi-base:latest AS builder +# Base image: pinned by digest (TRUST-DEFAULTS-POLICY, check-container-pins.sh). +# The digest below is the multi-arch (amd64 + arm64) index that +# cgr.dev/chainguard/wolfi-base:latest resolved to on 2026-11-14. Chainguard +# rebuilds Wolfi daily, so refresh it deliberately: resolve the new digest with +# `podman image inspect cgr.dev/chainguard/wolfi-base:latest` after a pull, then +# update BOTH FROM lines. +FROM cgr.dev/chainguard/wolfi-base:latest@sha256:1f6b749929164c3d9e7cad0289254f39b2ba51e1dddaeb0fa57532ea03f2db31 AS builder # TODO: Install your language toolchain RUN apk add --no-cache build-base @@ -79,7 +80,7 @@ COPY . . # Minimal production image. Only the compiled binary/release and runtime # dependencies are included. No compilers, no source code, no build tools. # -FROM cgr.dev/chainguard/wolfi-base:latest +FROM cgr.dev/chainguard/wolfi-base:latest@sha256:1f6b749929164c3d9e7cad0289254f39b2ba51e1dddaeb0fa57532ea03f2db31 # OCI image labels (compatible with cerro-torre .ctp bundle metadata) LABEL org.opencontainers.image.title="Apodeixis.jl" \ From 264fa2562dd8683b739a8b31b1d2659b9959dbc8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 15:14:01 +0000 Subject: [PATCH 3/4] fix(ffi): add the dupeZ helper that the regression tests and callers expect `Proven Tests and Benches / Proven 3-outcome test & bench suite` fails on main in the "Proven tools Silence + Firing self-tests" lane: src/main.zig:279:26: error: use of undeclared identifier 'dupeZ' (also 293:52 and 337:52) tests/ffi_strings_test.sh (synced by the template upgrade in #12) appends tests that call a free `dupeZ(allocator, bytes)`, but this repo's src/interface/ffi/src/main.zig never got the helper: `Allocator.dupeZ` was removed in Zig 0.17. Add the helper exactly as rsr-template-repo main has it, and switch the two callers (`..._get_string`, `..._last_error`) from `allocator.dupeZ(u8, x)` to `dupeZ(allocator, x)`. The file otherwise differs from the template only by this repo's substituted project name, which is kept. Checked with Zig 0.16.0 (the version CI downloads; tarball sha256 verified against the pin in proven-tests.yml): `bash tests/ffi_strings_test.sh` fails on main with the three errors above and passes with this change. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7ZpPGXDRaKVgNQUecwy --- src/interface/ffi/src/main.zig | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/interface/ffi/src/main.zig b/src/interface/ffi/src/main.zig index 6f4db637..e39716a5 100644 --- a/src/interface/ffi/src/main.zig +++ b/src/interface/ffi/src/main.zig @@ -25,6 +25,16 @@ fn clearError() void { last_error = null; } +/// Duplicate a byte slice as a NUL-terminated buffer across Zig 0.15/0.16/0.17 +/// (`Allocator.dupeZ` was removed in Zig 0.17). +/// The caller owns the returned slice and must free it with `allocator`. +/// Propagates allocation failure. +fn dupeZ(allocator: std.mem.Allocator, bytes: []const u8) ![:0]u8 { + const buf = try allocator.allocSentinel(u8, bytes.len, 0); + @memcpy(buf[0..bytes.len], bytes); + return buf; +} + //============================================================================== // Core Types (must match src/abi/Types.idr) //============================================================================== @@ -123,7 +133,7 @@ export fn apodeixis_jl_get_string(handle: ?*Handle) ?[*:0]const u8 { } // Example: allocate and return a string - const result = h.allocator.dupeZ(u8, "Example result") catch { + const result = dupeZ(h.allocator, "Example result") catch { setError("Failed to allocate string"); return null; }; @@ -187,7 +197,7 @@ export fn apodeixis_jl_last_error() ?[*:0]const u8 { // Return C string (static storage, no need to free) const allocator = std.heap.c_allocator; - const c_str = allocator.dupeZ(u8, err) catch return null; + const c_str = dupeZ(allocator, err) catch return null; return c_str.ptr; } From 5b77306ae75000de03406225053b4b8094425d4e Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 15:28:39 +0000 Subject: [PATCH 4/4] fix(container): pin by digest only and fix the refresh wording SonarQube raised two MAJOR docker:S8431 findings on this PR, at the two FROM lines: "Use either the version tag or the digest for the image instead of both." The `:latest@sha256:...` form carries a tag that the runtime ignores once a digest is present. Drop the tag: `cgr.dev/chainguard/wolfi-base@sha256:...`. check-container-pins.sh still passes (it requires `@sha256:`, not a tag). CodeRabbit (minor) pointed out that the refresh comment could lead a maintainer to pin a single-architecture digest. In this podman `.Digest` returned the index digest, but `RepoDigests` lists two digests (the index 1f6b... and the amd64-only manifest 6b818b...), so the wording was ambiguous. Say to use the top-level index digest, which is the Docker-Content-Digest the registry returns for the :latest manifest request, and not a per-platform one. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7ZpPGXDRaKVgNQUecwy --- build/container/Containerfile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/build/container/Containerfile b/build/container/Containerfile index b9890060..bf29d552 100644 --- a/build/container/Containerfile +++ b/build/container/Containerfile @@ -56,13 +56,16 @@ # RUN zig build -Doptimize=ReleaseFast # # Output: /build/zig-out/bin/apodeixis.jl # -# Base image: pinned by digest (TRUST-DEFAULTS-POLICY, check-container-pins.sh). -# The digest below is the multi-arch (amd64 + arm64) index that -# cgr.dev/chainguard/wolfi-base:latest resolved to on 2026-11-14. Chainguard -# rebuilds Wolfi daily, so refresh it deliberately: resolve the new digest with -# `podman image inspect cgr.dev/chainguard/wolfi-base:latest` after a pull, then -# update BOTH FROM lines. -FROM cgr.dev/chainguard/wolfi-base:latest@sha256:1f6b749929164c3d9e7cad0289254f39b2ba51e1dddaeb0fa57532ea03f2db31 AS builder +# Base image: pinned by digest only (TRUST-DEFAULTS-POLICY, check-container-pins.sh). +# The digest is the multi-arch (amd64 + arm64) OCI index that +# cgr.dev/chainguard/wolfi-base:latest resolved to on 2026-11-14. A tag next to a +# digest is ignored by the runtime, so none is written. Chainguard rebuilds Wolfi +# daily; refresh the pin deliberately and update BOTH FROM lines. Use the digest +# of the top-level index (media type application/vnd.oci.image.index.v1+json), +# which is the Docker-Content-Digest the registry returns for the :latest +# manifest request, NOT one of the per-platform digests that +# `podman image inspect` may also list under RepoDigests. +FROM cgr.dev/chainguard/wolfi-base@sha256:1f6b749929164c3d9e7cad0289254f39b2ba51e1dddaeb0fa57532ea03f2db31 AS builder # TODO: Install your language toolchain RUN apk add --no-cache build-base @@ -80,7 +83,7 @@ COPY . . # Minimal production image. Only the compiled binary/release and runtime # dependencies are included. No compilers, no source code, no build tools. # -FROM cgr.dev/chainguard/wolfi-base:latest@sha256:1f6b749929164c3d9e7cad0289254f39b2ba51e1dddaeb0fa57532ea03f2db31 +FROM cgr.dev/chainguard/wolfi-base@sha256:1f6b749929164c3d9e7cad0289254f39b2ba51e1dddaeb0fa57532ea03f2db31 # OCI image labels (compatible with cerro-torre .ctp bundle metadata) LABEL org.opencontainers.image.title="Apodeixis.jl" \