Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ which is precisely why the map is now generated rather than typed.

**When reporting**:

Use the [bug report template](.github/ISSUE_TEMPLATE/bug_report.md) and include:
Use the [bug report template](ISSUE_TEMPLATE/bug_report.yml) and include:

- Clear, descriptive title
- Environment details (OS, versions, toolchain)
Expand All @@ -61,7 +61,7 @@ Use the [bug report template](.github/ISSUE_TEMPLATE/bug_report.md) and include:

**When suggesting**:

Use the [feature request template](.github/ISSUE_TEMPLATE/feature_request.md) and include:
Use the [feature request template](ISSUE_TEMPLATE/feature_request.yml) and include:

- Problem statement (what pain point does this solve?)
- Proposed solution
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/dogfood-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -587,12 +587,14 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: hyperpolymath/hypatia
ref: be98f74ce93df200752f3798efa1305bfa3e0e10
# Pinned to a Hypatia commit that contains hypatia#1062 (the PinSites miscompile
# fix, merged as 37b8d01). The earlier pin be98f74 lacks it.
ref: 51539abf3d2472b955da9b051a68c5971f6cfa22
path: _hypatia
persist-credentials: false
# OTP 28.x (28.1 to 28.5.0.8) crashes this step with SIGSEGV in
# sweep_off_heap, called from the JIT's bs_init_bits, on trees whose
# workflow content trips it (Apodeixis.jl#333). OTP 27.3 scored all
# workflow content trips it (rsr-template-repo#333). OTP 27.3 scored all
# of them cleanly. Do not move to 28.x until a pinned 28.x build scores
# the #333 trees (af8665c, a55669e, 6ad5378) with no crash.
- name: Setup Elixir 1.19.4 / OTP 27.3.4.19 for Hypatia oracle
Expand All @@ -608,7 +610,7 @@ jobs:
_hypatia/_build
~/.hex
~/.mix
key: hypatia-oracle-${{ runner.os }}-otp27.3.4.19-elx1194-be98f74ce93df200752f3798efa1305bfa3e0e10
key: hypatia-oracle-${{ runner.os }}-otp27.3.4.19-elx1194-51539abf3d2472b955da9b051a68c5971f6cfa22
- name: Compile the oracle
working-directory: _hypatia
run: mix local.hex --force && mix local.rebar --force && mix deps.get && mix compile
Expand Down
4 changes: 3 additions & 1 deletion Apodeixis.jl_chora.deed
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand Down
2 changes: 2 additions & 0 deletions LICENSE.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-License-Identifier: MPL-2.0 AND CC-BY-SA-4.0
Code: MPL-2.0. Prose: CC-BY-SA-4.0.
152 changes: 0 additions & 152 deletions build/container/Containerfile

This file was deleted.

4 changes: 4 additions & 0 deletions docs/architecture/REPOSITORY-MAP.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ predecessors did.
| optional
| forge-facing copy of LICENSES/MPL-2.0.txt. Optional, not required:

| `LICENSE.adoc`
| yes
| the licence (MPL-2.0); renamed from LICENSE to the estate AsciiDoc format 2026-10-26

| `LICENSES/`
| yes
| REUSE licence texts, dual-licence model (code MPL-2.0 / docs CC-BY-SA-4.0)
Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ just log-tail # last N lines of logs
and the symptom in plain English.
. Linked from the issue: the relevant ADR(s) and any related issues.
. For *security*-relevant findings, see
link:./../SECURITY.md[SECURITY.md] — do **not** file public issues.
link:./../.github/SECURITY.md[SECURITY.md] — do **not** file public issues.

== Where to look for more help

Expand Down
30 changes: 24 additions & 6 deletions src/interface/ffi/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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)
//==============================================================================
Expand Down Expand Up @@ -110,7 +120,9 @@ export fn apodeixis_jl_process(handle: ?*Handle, input: u32) Result {
//==============================================================================

/// Get a string result (example)
/// Caller must free the returned string
/// Return a NUL-terminated "Example result" owned by the caller; free it with
/// `apodeixis_jl_free_string`. Return null and set the thread-local error for a
/// null or uninitialized handle, or allocation failure. Clear the error on success.
export fn apodeixis_jl_get_string(handle: ?*Handle) ?[*:0]const u8 {
const h = handle orelse {
setError("Null handle");
Expand All @@ -123,7 +135,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;
};
Expand Down Expand Up @@ -180,14 +192,15 @@ export fn apodeixis_jl_process_array(
// Error Handling
//==============================================================================

/// Get the last error message
/// Returns null if no error
/// Get the last error message.
/// Return an allocated NUL-terminated copy of the current thread's error, or
/// null if no error is set or allocation fails. Leave the stored error unchanged.
/// Caller must free a non-null returned string with `apodeixis_jl_free_string`.
export fn apodeixis_jl_last_error() ?[*:0]const u8 {
const err = last_error orelse return null;

// 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;
}

Expand Down Expand Up @@ -258,13 +271,18 @@ test "lifecycle" {
defer apodeixis_jl_free(handle);

try std.testing.expect(apodeixis_jl_is_initialized(handle) == 1);

const str = apodeixis_jl_get_string(handle) orelse return error.StringFailed;
defer apodeixis_jl_free_string(str);
try std.testing.expectEqualStrings("Example result", std.mem.span(str));
}

test "error handling" {
const result = apodeixis_jl_process(null, 0);
try std.testing.expectEqual(Result.null_pointer, result);

const err = apodeixis_jl_last_error();
defer apodeixis_jl_free_string(err);
try std.testing.expect(err != null);
}

Expand Down
Loading