diff --git a/.cursorrules b/.cursorrules deleted file mode 100644 index 28fe7ec2..00000000 --- a/.cursorrules +++ /dev/null @@ -1,55 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -# Authoritative source: docs/practice/AI-CONVENTIONS.adoc - -# Read the repo deed (*_chora.deed in the repo root) FIRST: canonical file locations -# live in its (ply ...) canonical-locations clauses. - -# LICENSE -# All original code: MPL-2.0 (SPDX header required on every file). -# Copyright: Jonathan D.A. Jewell (hyperpolymath) - -# STATE FILES -# No .a2ml file may exist anywhere: the format is retired. State, metadata, -# (neurosym) and (playbook) are clauses of the repo deed (*_chora.deed); -# the journal is docs/status/ROADMAP.adoc. Never recreate them as files. - -# BANNED PATTERNS -# Idris2: believe_me, assert_total, assert_smaller, unsafePerformIO -# Haskell: unsafeCoerce, unsafePerformIO, undefined, error -# OCaml: Obj.magic, Obj.repr, Obj.obj -# Coq: Admitted -# Lean: sorry -# Rust: transmute (unless FFI with // SAFETY: comment) - -# JS RUNTIME — Bun first (standards/3-practice/LANGUAGE-POLICY.adoc sections 1.3-1.4) -# 1. Bun tier 1: package.json + bun.lock, run with bun / bunx -# 2. Deno tier 2: permitted; runs the same package.json scripts (deno task) -# 3. pnpm tier 3 -# 4. npm last resort; permitted, never preferred; keeps no lock -# One package.json carries every runtime's lock (bun.lock, deno.lock, -# pnpm-lock.yaml); `js-runtimes regen` writes all three (owner ruling -# 2026-10-14). TypeScript and ReScript are banned; they migrate to -# AffineScript. Use plain JavaScript where JS is needed. - -# BANNED LANGUAGES -# Go -> use Rust -# Python -> use Julia or Rust - -# CONTAINERS -# Runtime: Podman (never Docker) -# File: Containerfile (never Dockerfile) -# Base: cgr.dev/chainguard/wolfi-base:latest - -# ABI/FFI STANDARD -# ABI definitions: Idris2 with dependent types (src/interface/abi/) -# FFI implementation: Zig with C ABI (src/interface/ffi/) -# Generated C headers: src/interface/generated/ - -# BUILD SYSTEM -# Use just (Justfile) for all build, test, lint, and format tasks. - -# CODE STYLE -# Use descriptive variable names. -# Annotate and document all files. -# Add SPDX-License-Identifier headers to every source file. diff --git a/.hypatia-ignore b/.hypatia-ignore index 41563b7a..b4c79dc0 100644 --- a/.hypatia-ignore +++ b/.hypatia-ignore @@ -13,18 +13,6 @@ # below carries a stated reason. Prefer fix-the-code or an inline directive # over an entry here; this file is for whole-file/directory exemptions. -# ─── build/docs-seed/ describes DOWNSTREAM repos, not this one ───────────── -# -# `build/docs-seed/` is the canonical template of documentation that gets -# copied into scaffolded repos. Its example paths (e.g. `src/middleware/…`, -# `src/main.rs`) describe a hypothetical generated project, so they -# legitimately do not resolve against this template's own tree. SD022 -# (stale `src//` reference) is therefore a structural false positive -# for everything under this directory — mirrors the built-in CHANGELOG.md -# and third_party/ carve-outs. Scaffolded repos inherit this file, so the -# exemption travels with the template. -structural_drift/SD022:build/docs-seed/ - # ─── Research-extension workflow findings ─────────────────────────────────────── # # RE001 is an advisory recommendation to add harden-runner whenever a workflow diff --git a/.machine_readable/mint-verbatim.txt b/.machine_readable/mint-verbatim.txt index 53ac43a0..71b0cb20 100644 --- a/.machine_readable/mint-verbatim.txt +++ b/.machine_readable/mint-verbatim.txt @@ -27,7 +27,19 @@ scripts/strip-instruction-blocks.rs # names the marker it strips scripts/resolve-template-pin.sh # documents the template it resolves tests/e2e/template_instantiation_test.sh # token answer list; marker exemptions tests/e2e/use_template_mint_test.sh # mints a template copy: template literals +tests/e2e/chain_mint_test.sh # chain fixtures: parent names and paths tests/workflows/mint_cleanup_test.sh # instruction-block fixture tests/workflows/self_name_pass_test.sh # template-name fixtures tests/workflows/template_conformance_test.sh # template-slug fixtures +tests/workflows/julia_library_test.sh # PACKAGE_UUID brace-token fixture +tests/workflows/mint_gates_test.sh # names an unanswered token, on purpose +tests/e2e/language_profiles_mint_test.sh # minted-tree fixtures; keeps archetype paths tests/workflows/resolve_template_pin_test.sh # template-slug fixtures +tests/ffi_strings_test.sh # FFI token fixture, filled in a scratch copy +tests/workflows/container_kyaml_test.sh # container token fixtures (template only) +CHANGELOG.adoc # prose quotes the project-name brace token when it describes a mint failure +docs/reports/compliance/RSR-TEMPLATE-DAMAGE-2026-10-30.adoc # the report is about the unfilled project-name brace token +docs/status/TEST-NEEDS.adoc # prose records the lowercase brace placeholders it converted +scripts/survey-template-damage.sh # searches children for an unfilled project-name brace token +scripts/check-mint-tokens.sh # the gate's own comments name the tokens it checks +tests/aspect_tests.sh # a comment names the lowercase brace token that symbol names may carry diff --git a/.machine_readable/policies/hypatia-rule-order.json b/.machine_readable/policies/hypatia-rule-order.json index d073f9ec..d6f53751 100644 --- a/.machine_readable/policies/hypatia-rule-order.json +++ b/.machine_readable/policies/hypatia-rule-order.json @@ -1 +1 @@ -{"SPDX-License-Identifier":"MPL-2.0","clashes":[{"id":"C1","resolution":"single producer; scripts/check-workflow-edges.sh fails on a dead edge","summary":"one scanner, two workflows"},{"id":"C2","resolution":"one pin per tool per repository; the verdict job names the producer's commit","summary":"one tool, two pins"},{"id":"C3","resolution":"panicbot stays unenrolled; the grid's own row is the authority","summary":"panicbot versus the direct panic-attack row"},{"id":"C4","resolution":"every fragment must end on a path boundary","summary":"substring fragments suppress more than they name"},{"id":"C5","resolution":"subsumed entries are refused","summary":"a broad entry makes narrower ones dead"},{"id":"C6","resolution":"the named path must exist in the tree","summary":"an exemption outlives the file it names"},{"id":"C7","resolution":"stated, not worked around; un-suppression is an upstream change","summary":"a repository cannot narrow a built-in default"},{"id":"C8","resolution":"producers own their gates; a failed fleet is orange rows, not a block","summary":"the reporter must not re-gate"}],"concerns":[{"id":"hypatia-execution","owner":".github/workflows/hypatia-scan.yml","rationale":"Two workflows built and ran the same scanner at the same pin (clash C1)."},{"id":"hypatia-gate","owner":".github/workflows/hypatia-scan.yml","rationale":"The producer owns its gate; the verdict grid is not a gate (clash C8)."},{"id":"panic-attack-gate","owner":".github/workflows/static-analysis-gate.yml","rationale":"Blocks on critical exactly once, in the workflow that runs it."},{"id":"pons-asinorum","owner":".github/workflows/static-analysis-gate.yml","rationale":"Advisory by design: pons classifies evidence, it does not prove."},{"id":"verdict-grid-render","owner":".github/workflows/fork-governance.yml","rationale":"The reporter collects evidence and never scans (clash C8)."},{"id":"verdict-grid-comment","owner":".github/workflows/verdict-grid-publish.yml","rationale":"Only the trusted default-branch workflow_run publisher may write the single bot-owned verdict comment; PR rendering remains read-only."},{"id":"fleet-report-backs","owner":".github/workflows/fork-governance.yml","rationale":"The fleet job is the only producer of .gitbot-fleet evidence."},{"id":"exemption-policy","owner":".hypatia-ignore","rationale":"One file, checked by scripts/check-hypatia-ignore.sh."}],"grid":{"commit":"f0b3cd4c464d33e1584f8528c17bce104555e256","library":"scripts/lib/verdict-grid.jq","library_sha256":"36e7aa69afbe8c488b1a313fd9bd0cf2bf6af45d3f34b80afd793f6b20582896","renderer":"scripts/verdict-grid.sh","renderer_sha256":"7c2cac9248fd249f607de827dc8dc9a3f6276bf9ca662be86aa435e9aeca48d7","repository":"metadatastician/standards","specification":"docs/VERDICT-GRID-SPEC.adoc"},"layer_owners":["hypatia","this-repository","the-gate","the-grid"],"layers":[{"description":"Python, Go, Makefile and Gemfile are refused by a dedicated clause; no exemption reaches it.","id":"rule-total-ban","overrides":"nothing: every other layer is unreachable for this rule","owner":"hypatia","rank":1,"repository_can_change":false,"scope":"cicd_rules/banned_language_file"},{"description":"Applied to every rule before any module-specific table.","id":"universal-excludes","overrides":"every layer below it, for the paths it names","owner":"hypatia","rank":2,"repository_can_change":false,"scope":"vendored and generated paths: .git/, node_modules/, _build/, deps/, target/, dist/, .hypatia-baseline.json"},{"description":"Training corpora and fixtures are provenance, not signal.","id":"builtin-defaults","overrides":"every layer below it; a repository cannot narrow it (clash C7)","owner":"hypatia","rank":3,"repository_can_change":false,"scope":"@training_corpus_paths keyed per module, plus benches/ for code_safety only"},{"description":"Scoped, reasoned exemptions. Fragments are substring matches, so each must end on a path boundary.","id":"repository-ignore","overrides":"nothing above it; it may only widen layer 3","owner":"this-repository","rank":4,"repository_can_change":true,"scope":".hypatia-ignore"},{"description":"Line- or file-scoped. The narrowest layer, and the one to use when only one line is affected.","id":"inline-directive","overrides":"layers 3 and 4, for the line that carries it","owner":"this-repository","rank":5,"repository_can_change":true,"scope":"# hypatia: allow / -- "},{"description":"Applied at gate time only. The verdict grid ignores it, so standing debt stays visible.","id":"baseline","overrides":"the gate's decision, never a scanner's output","owner":"the-gate","rank":6,"repository_can_change":true,"scope":".hypatia-baseline.json"},{"description":"Presentation and grading. It never suppresses a finding.","id":"grid-normalisation","overrides":"nothing; it may not change what a scanner reported","owner":"the-grid","rank":7,"repository_can_change":false,"scope":"severity words, suppressed:true, the row's colour"}],"observed_modules":[{"layer":4,"module":"structural_drift","rationale":"SD022 (stale src/ reference) fires on build/docs-seed/, which documents DOWNSTREAM repositories: the paths in it are not this tree's."},{"layer":4,"module":"research_extensions","rationale":"RE001/RE005/RE008 are advisory recommendations for workflows that deliberately hold a credential or render an annotation non-fatally; each exemption is file-scoped."},{"layer":4,"module":"workflow_audit","rationale":"wrong_sha_pin compares against a static May-2026 table; authoritative pin verification is actions.lock plus check-lock-sync.sh, which runs on every pull request."}],"scanner":{"commit":"be98f74ce93df200752f3798efa1305bfa3e0e10","repository":"hyperpolymath/hypatia","sources":["lib/hypatia/scanner_suppression.ex","lib/rules/"]},"schema":"hypatia-rule-order/1"} +{"SPDX-License-Identifier":"MPL-2.0","clashes":[{"id":"C1","resolution":"single producer; scripts/check-workflow-edges.sh fails on a dead edge","summary":"one scanner, two workflows"},{"id":"C2","resolution":"one pin per tool per repository; the verdict job names the producer's commit","summary":"one tool, two pins"},{"id":"C3","resolution":"panicbot stays unenrolled; the grid's own row is the authority","summary":"panicbot versus the direct panic-attack row"},{"id":"C4","resolution":"every fragment must end on a path boundary","summary":"substring fragments suppress more than they name"},{"id":"C5","resolution":"subsumed entries are refused","summary":"a broad entry makes narrower ones dead"},{"id":"C6","resolution":"the named path must exist in the tree","summary":"an exemption outlives the file it names"},{"id":"C7","resolution":"stated, not worked around; un-suppression is an upstream change","summary":"a repository cannot narrow a built-in default"},{"id":"C8","resolution":"producers own their gates; a failed fleet is orange rows, not a block","summary":"the reporter must not re-gate"}],"concerns":[{"id":"hypatia-execution","owner":".github/workflows/hypatia-scan.yml","rationale":"Two workflows built and ran the same scanner at the same pin (clash C1)."},{"id":"hypatia-gate","owner":".github/workflows/hypatia-scan.yml","rationale":"The producer owns its gate; the verdict grid is not a gate (clash C8)."},{"id":"panic-attack-gate","owner":".github/workflows/static-analysis-gate.yml","rationale":"Blocks on critical exactly once, in the workflow that runs it."},{"id":"pons-asinorum","owner":".github/workflows/static-analysis-gate.yml","rationale":"Advisory by design: pons classifies evidence, it does not prove."},{"id":"verdict-grid-render","owner":".github/workflows/fork-governance.yml","rationale":"The reporter collects evidence and never scans (clash C8)."},{"id":"verdict-grid-comment","owner":".github/workflows/verdict-grid-publish.yml","rationale":"Only the trusted default-branch workflow_run publisher may write the single bot-owned verdict comment; PR rendering remains read-only."},{"id":"fleet-report-backs","owner":".github/workflows/fork-governance.yml","rationale":"The fleet job is the only producer of .gitbot-fleet evidence."},{"id":"exemption-policy","owner":".hypatia-ignore","rationale":"One file, checked by scripts/check-hypatia-ignore.sh."}],"grid":{"commit":"f0b3cd4c464d33e1584f8528c17bce104555e256","library":"scripts/lib/verdict-grid.jq","library_sha256":"36e7aa69afbe8c488b1a313fd9bd0cf2bf6af45d3f34b80afd793f6b20582896","renderer":"scripts/verdict-grid.sh","renderer_sha256":"7c2cac9248fd249f607de827dc8dc9a3f6276bf9ca662be86aa435e9aeca48d7","repository":"metadatastician/standards","specification":"docs/VERDICT-GRID-SPEC.adoc"},"layer_owners":["hypatia","this-repository","the-gate","the-grid"],"layers":[{"description":"Python, Go, Makefile and Gemfile are refused by a dedicated clause; no exemption reaches it.","id":"rule-total-ban","overrides":"nothing: every other layer is unreachable for this rule","owner":"hypatia","rank":1,"repository_can_change":false,"scope":"cicd_rules/banned_language_file"},{"description":"Applied to every rule before any module-specific table.","id":"universal-excludes","overrides":"every layer below it, for the paths it names","owner":"hypatia","rank":2,"repository_can_change":false,"scope":"vendored and generated paths: .git/, node_modules/, _build/, deps/, target/, dist/, .hypatia-baseline.json"},{"description":"Training corpora and fixtures are provenance, not signal.","id":"builtin-defaults","overrides":"every layer below it; a repository cannot narrow it (clash C7)","owner":"hypatia","rank":3,"repository_can_change":false,"scope":"@training_corpus_paths keyed per module, plus benches/ for code_safety only"},{"description":"Scoped, reasoned exemptions. Fragments are substring matches, so each must end on a path boundary.","id":"repository-ignore","overrides":"nothing above it; it may only widen layer 3","owner":"this-repository","rank":4,"repository_can_change":true,"scope":".hypatia-ignore"},{"description":"Line- or file-scoped. The narrowest layer, and the one to use when only one line is affected.","id":"inline-directive","overrides":"layers 3 and 4, for the line that carries it","owner":"this-repository","rank":5,"repository_can_change":true,"scope":"# hypatia: allow / -- "},{"description":"Applied at gate time only. The verdict grid ignores it, so standing debt stays visible.","id":"baseline","overrides":"the gate's decision, never a scanner's output","owner":"the-gate","rank":6,"repository_can_change":true,"scope":".hypatia-baseline.json"},{"description":"Presentation and grading. It never suppresses a finding.","id":"grid-normalisation","overrides":"nothing; it may not change what a scanner reported","owner":"the-grid","rank":7,"repository_can_change":false,"scope":"severity words, suppressed:true, the row's colour"}],"observed_modules":[{"layer":4,"module":"research_extensions","rationale":"RE001/RE005/RE008 are advisory recommendations for workflows that deliberately hold a credential or render an annotation non-fatally; each exemption is file-scoped."},{"layer":4,"module":"workflow_audit","rationale":"wrong_sha_pin compares against a static May-2026 table; authoritative pin verification is actions.lock plus check-lock-sync.sh, which runs on every pull request."}],"scanner":{"commit":"be98f74ce93df200752f3798efa1305bfa3e0e10","repository":"hyperpolymath/hypatia","sources":["lib/hypatia/scanner_suppression.ex","lib/rules/"]},"schema":"hypatia-rule-order/1"} diff --git a/.windsurfrules b/.windsurfrules deleted file mode 100644 index 46b3580e..00000000 --- a/.windsurfrules +++ /dev/null @@ -1,52 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -# Authoritative source: docs/practice/AI-CONVENTIONS.adoc - -# STARTUP: Read the repo deed (*_chora.deed at the repo root) first, then docs/status/ROADMAP.adoc. - -# LICENSE -# All original code: MPL-2.0. -# Never AGPL-3.0. MPL-2.0 only as platform-required fallback. -# SPDX header required on every source file. -# Copyright: Jonathan D.A. Jewell (hyperpolymath) - -# STATE FILES -# No .a2ml file may exist anywhere: the format is retired. State, metadata, -# (neurosym) and (playbook) are clauses of the repo deed (*_chora.deed); -# the journal is docs/status/ROADMAP.adoc. Never recreate them as files. -# The repo deed and .machine_readable/ are the single source of truth. - -# BANNED PATTERNS -# Idris2: believe_me, assert_total, assert_smaller, unsafePerformIO -# Haskell: unsafeCoerce, unsafePerformIO, undefined, error -# OCaml: Obj.magic, Obj.repr, Obj.obj -# Coq: Admitted -# Lean: sorry -# Rust: transmute (unless FFI with // SAFETY: comment) - -# JS RUNTIME — Bun first (standards/3-practice/LANGUAGE-POLICY.adoc sections 1.3-1.4) -# 1. Bun tier 1: package.json + bun.lock, run with bun / bunx -# 2. Deno tier 2: permitted; runs the same package.json scripts (deno task) -# 3. pnpm tier 3 -# 4. npm last resort; permitted, never preferred; keeps no lock -# One package.json carries every runtime's lock (bun.lock, deno.lock, -# pnpm-lock.yaml); `js-runtimes regen` writes all three (owner ruling -# 2026-10-14). TypeScript and ReScript are banned; they migrate to -# AffineScript. Use plain JavaScript where JS is needed. - -# BANNED LANGUAGES -# Go -> Rust -# Python -> Julia or Rust - -# CONTAINERS -# Runtime: Podman (never Docker). -# File: Containerfile (never Dockerfile). -# Base: cgr.dev/chainguard/wolfi-base:latest or cgr.dev/chainguard/static:latest. - -# ABI/FFI -# ABI: Idris2 with dependent types (src/interface/abi/). -# FFI: Zig with C ABI (src/interface/ffi/). -# Headers: src/interface/generated/. - -# BUILD: Use just (justfile) for all tasks. -# STYLE: Descriptive names. Document all files. SPDX headers everywhere. diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index c4643bca..6afa75ef 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -606,7 +606,7 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. `relock-standards-pin.sh` at `75bd599` gave the nine records the same tags. No commit changes: each tag was checked to point at its recorded commit. * The mint's self-name pass keeps issue references. It rewrote - `bactrian#N`, a reference to this template's own issue, into + `rsr-template-repo#N`, a reference to this template's own issue, into `#N`, which names an issue of the child that does not exist or is unrelated. resource-algebra carried such references after its mint. `tests/workflows/self_name_pass_test.sh` (wired into Estate Rules) runs diff --git a/README.adoc b/README.adoc index 591af20b..b33cb5fb 100644 --- a/README.adoc +++ b/README.adoc @@ -141,7 +141,7 @@ maintainers can brief an AI with `just ai-warmup dev` / `just ai-warmup maintain == Governance badges The *K9 conformance* badge in the row at the top becomes live after -`just repo-init` replaces the `{{OWNER}}` and `{{REPO}}` placeholders in its URL +`just repo-init` replaces the `hyperpolymath` and `bactrian` placeholders in its URL and an eligible push to `main` publishes it. It is published by `.github/workflows/dogfood-gate.yml` to a generated *orphan* branch called `governance-badges`, and read back through the shields endpoint. diff --git a/docs/architecture/REPOSITORY-MAP.adoc b/docs/architecture/REPOSITORY-MAP.adoc index 63dc2022..03201bc6 100644 --- a/docs/architecture/REPOSITORY-MAP.adoc +++ b/docs/architecture/REPOSITORY-MAP.adoc @@ -21,6 +21,10 @@ predecessors did. | yes | code-hygiene gate allowlist; template scaffolds are seams, not debt +| `.claude/` +| optional +| Claude Code project state (checkpoints, history) — created by the tool itself + | `.clinerules` | yes | AI editor rules. Cline reads them from the project ROOT, so the copies formerly under .machine_readable/ai/ were inert (.cursorrules and .windsurfrules were retired 2026-10-26) @@ -29,10 +33,6 @@ predecessors did. | optional | CodeRabbit reads its config from the root only; pins Docstring Coverage to mode: warning (estate decision, not a vendor default). Optional: only the template and the repos whose rulesets require the CodeRabbit context carry it -| `.cursorrules` -| yes -| - - | `.devcontainer/` | optional | VS Code dev container spec; present only where the container capability is declared @@ -49,6 +49,10 @@ predecessors did. | yes | - +| `.gitbot-fleet/` +| yes +| fleet enrolment manifest + report-backs/ (empty in git; filled per run by the fork-governance fleet job). Read by the Hypatia verdict grid at this path and no other + | `.github/` | yes | community health + workflows (GitHub reads this path and no other) + versioned git hooks (.github/hooks/, wired via core.hooksPath) @@ -77,10 +81,6 @@ predecessors did. | yes | git reads .mailmap from the worktree root only -| `.windsurfrules` -| yes -| - - | `CHANGELOG.adoc` | yes | AsciiDoc is the estate-standard documentation format @@ -93,13 +93,13 @@ predecessors did. | yes | generated arrival pack; the generator, pre-commit and Claude Code all read it from the ROOT (do not hand-edit; edit the repo deed) -| `CONTRIBUTING.adoc` +| `CODE_OF_CONDUCT.adoc` | optional -| estate docs gate (standards scripts/check-docs-presence.sh) requires CONTRIBUTING at the ROOT; this is the copy it verifies +| community health file; GitHub accepts it at root, docs/ or .github/ -| `GEMINI.md` +| `CONTRIBUTING.adoc` | optional -| pointer to CLAUDE.md for repos without AGENTS.md yet +| estate docs gate (standards scripts/check-docs-presence.sh) requires CONTRIBUTING at the ROOT; this is the copy it verifies | `Justfile` | yes @@ -216,7 +216,6 @@ your own repo - but do not read their emptiness as neglect here. | `docs/governance/planning/could/` | `docs/governance/planning/must/` | `docs/governance/planning/should/` -| `docs/reports/compliance/` | `docs/reports/maintenance/` | `docs/reports/performance/` | `docs/reports/quality/` diff --git a/docs/status/TEST-NEEDS.adoc b/docs/status/TEST-NEEDS.adoc index 98877182..c6d2e512 100644 --- a/docs/status/TEST-NEEDS.adoc +++ b/docs/status/TEST-NEEDS.adoc @@ -1,6 +1,6 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -= TEST-NEEDS: bactrian += TEST-NEEDS: rsr-template-repo == CRG Grade: C — ACHIEVED 2026-04-04 @@ -65,7 +65,7 @@ output only. === Zig FFI Tests ✅ * [x] `src/interface/ffi/test/integration_test.zig` — template with examples -** Converted from `bactrian` placeholders to "template" namespace +** Converted from `{{project}}` placeholders to "template" namespace ** Added comprehensive comments for how to instantiate ** Tests grouped by category (lifecycle, operations, strings, errors, version, memory safety, threading) ** Compiles and passes placeholder test diff --git a/src/interface/Abi/Foreign.idr b/src/interface/Abi/Foreign.idr index cd537d49..fbf5f9de 100644 --- a/src/interface/Abi/Foreign.idr +++ b/src/interface/Abi/Foreign.idr @@ -2,8 +2,8 @@ -- Copyright (c) Jonathan D.A. Jewell ||| Foreign Function Interface Bridge ||| -||| Raw FFI calls into lib{{project}} (src/interface/ffi/src/main.zig) and their -||| safe wrappers. Every `%foreign "C:,lib{{project}}"` below names a +||| Raw FFI calls into libbactrian (src/interface/ffi/src/main.zig) and their +||| safe wrappers. Every `%foreign "C:,libbactrian"` below names a ||| symbol that main.zig `export fn`s; tests/aspect_tests.sh (Aspect 3) fails ||| if one does not. The symbols and the Result codes follow main.zig; the ||| template once bound rsr_* in librsr, which nothing exported. @@ -20,15 +20,15 @@ import Abi.Layout -------------------------------------------------------------------------------- ||| Raw FFI call to initialize the library (Zig: returns ?*Handle, null on failure) -%foreign "C:{{project}}_init,lib{{project}}" +%foreign "C:bactrian_init,libbactrian" prim__init : PrimIO Bits64 ||| Raw FFI call to free library resources (Zig: accepts null) -%foreign "C:{{project}}_free,lib{{project}}" +%foreign "C:bactrian_free,libbactrian" prim__free : Bits64 -> PrimIO () ||| Raw FFI call: 1 if the handle is initialised, else 0 -%foreign "C:{{project}}_is_initialized,lib{{project}}" +%foreign "C:bactrian_is_initialized,libbactrian" prim__isInitialized : Bits64 -> PrimIO Bits32 ||| Safe wrapper for initialization @@ -60,7 +60,7 @@ isInitialized h = do ||| of the return register is unspecified for an `int` return). It is ||| `Bits32`, not `Int32`, because RefC in Idris2 0.7.0 cannot generate code ||| for an `Int32` foreign return; see Abi.Types.resultCode. -%foreign "C:{{project}}_process,lib{{project}}" +%foreign "C:bactrian_process,libbactrian" prim__process : Bits64 -> Bits32 -> PrimIO Bits32 ||| Safe wrapper. Right () on code 0; Left on any other known code; an @@ -79,11 +79,11 @@ process h input = do -------------------------------------------------------------------------------- ||| Get the last error message, if any (Zig: thread-local, no handle argument) -%foreign "C:{{project}}_last_error,lib{{project}}" +%foreign "C:bactrian_last_error,libbactrian" prim__lastError : PrimIO (Ptr String) ||| Library version string (static storage on the Zig side) -%foreign "C:{{project}}_version,lib{{project}}" +%foreign "C:bactrian_version,libbactrian" prim__version : PrimIO (Ptr String) ||| Detailed error string helper, one line per Result constructor @@ -109,4 +109,4 @@ errorDescription NullPointer = "Null pointer" ||| and is injective (Abi.Types.resultCodeInjective). public export abiSafetyGuarantees : String -abiSafetyGuarantees = "{{project}} ABI: 4 stated safety properties for FFI integration" +abiSafetyGuarantees = "bactrian ABI: 4 stated safety properties for FFI integration" diff --git a/src/interface/Abi/Types.idr b/src/interface/Abi/Types.idr index 4c8c349f..9ec1a391 100644 --- a/src/interface/Abi/Types.idr +++ b/src/interface/Abi/Types.idr @@ -3,7 +3,7 @@ ||| ABI Type Definitions ||| ||| This module defines the Application Binary Interface (ABI) for -||| lib{{project}}. It is the Idris2 side of the seam whose Zig side is +||| libbactrian. It is the Idris2 side of the seam whose Zig side is ||| src/interface/ffi/src/main.zig; tests/aspect_tests.sh (Aspect 3) checks ||| that the two name the same symbols, and `Result` below carries the same ||| integer codes as the Zig `Result` enum, in the same order. diff --git a/tests/aspect_tests.sh b/tests/aspect_tests.sh index 813aad99..26c7e17d 100755 --- a/tests/aspect_tests.sh +++ b/tests/aspect_tests.sh @@ -39,7 +39,7 @@ fail() { red " FAIL: $1"; FAIL=$((FAIL + 1)); } warn() { yellow " WARN: $1"; WARN=$((WARN + 1)); } echo "═══════════════════════════════════════════════════════════════" -echo " BACTRIAN — Aspect Tests (Cross-Cutting Concerns)" +echo " {{PROJECT}} — Aspect Tests (Cross-Cutting Concerns)" echo "═══════════════════════════════════════════════════════════════" echo ""