From e1d7779048442e769f17b05e6366e3b1a6ef6153 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 21:47:32 +0000 Subject: [PATCH 01/19] feat: mint idris2x from the RSR template and land Phase 0 Mint with `just repo-init rust-cli`; fill the deed's identity (IS, IS-NOT, pipeline position, chain, unique strength) and fix the template-residue manifest purpose. Land the Phase 0 results: ADRs 0004-0011, threat model, maintainers' abandonment contract, Phase 0 report, prior art, estate integration, upstream notes, beyond-repo list and a best-practice comparison. Add the error taxonomy, support matrix and channel schema as data, with generators (runbooks, error-report issue form, wiki tables) that run with --check in CI; the twelve canaries; the bash prototype launcher, factory and chaos suite; and a std-only Rust fixture server (this repo's anchor forbids Node.js). Add issue forms, project labels, PR checklist, agent rules for Copilot, CodeRabbit and Claude, and wiki sources for users, platform maintainers, developers and theorists, published by wiki-sync.yml. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfNoDw3DrRWQKo5pd7 --- .clinerules | 4 +- .coderabbit.yaml | 16 + .devcontainer/Containerfile | 8 +- .devcontainer/README.adoc | 8 +- .devcontainer/devcontainer.json | 6 +- .devcontainer/docker/devcontainer.json | 6 +- .editorconfig | 2 +- .envrc | 2 +- .gitattributes | 2 +- .github/CODEOWNERS | 14 +- .github/GOVERNANCE.adoc | 6 +- .github/ISSUE_TEMPLATE/canary_failure.yml | 38 + .github/ISSUE_TEMPLATE/capsule_request.yml | 40 + .github/ISSUE_TEMPLATE/config.yml | 4 +- .github/ISSUE_TEMPLATE/dx_feedback.yml | 42 ++ .github/ISSUE_TEMPLATE/error_report.yml | 79 ++ .github/SECURITY.md | 20 +- .github/copilot-instructions.md | 19 +- .github/dependabot.yml | 32 - .github/labels-idris2x.toml | 82 ++ .github/pull_request_template.md | 12 + .github/repo-settings-idris2x.toml | 50 ++ .github/settings.yml | 6 +- .github/workflows/actions.lock | 2 + .github/workflows/labels-idris2x.yml | 35 + .github/workflows/sonarqube.yml | 2 +- .github/workflows/wiki-sync.yml | 56 ++ .hypatia-ignore | 12 - .machine_readable/ai/PLACEHOLDERS.adoc | 189 ----- .machine_readable/coaptation/coapt.ncl | 4 +- .machine_readable/coaptation/coapt.sh | 2 +- .../coaptation/receipts/latest.toml | 2 +- .machine_readable/coaptation/witness-map.ncl | 4 +- .machine_readable/compliance/reuse/dep5 | 28 +- .machine_readable/configs/eclexiaiser.toml | 2 +- .../configs/git-cliff/cliff.toml | 10 +- .machine_readable/configs/stapeln.toml | 12 +- .machine_readable/contractiles/Justfile | 10 +- .machine_readable/contractiles/README.adoc | 2 +- .../contractiles/adjust/adjust.k9.ncl | 6 +- .../contractiles/bust/bust.k9.ncl | 14 +- .../contractiles/dust/dust.k9.ncl | 12 +- .../contractiles/intend/intend.k9.ncl | 8 +- .../contractiles/must/must.k9.ncl | 6 +- .../contractiles/trust/trust.k9.ncl | 8 +- .../descriptiles/anchors/README.adoc | 2 +- .../descriptiles/provisioning_praxis.deed | 4 +- .../policies/hypatia-rule-order.json | 2 +- .machine_readable/root-allow.txt | 2 +- .../scripts/maintenance/maint-assault.sh | 2 +- .machine_readable/self-validating/README.adoc | 12 +- .../self-validating/examples/ci-config.k9.ncl | 2 +- .../examples/project-metadata.k9.ncl | 12 +- .../examples/setup-repo.k9.ncl.in | 8 +- .../self-validating/methodology-guard.k9.ncl | 8 +- .../self-validating/template-hunt.k9.ncl.in | 2 +- .../self-validating/template-kennel.k9.ncl.in | 2 +- .../self-validating/template-yard.k9.ncl.in | 2 +- .mailmap | 5 +- CHANGELOG.adoc | 706 +----------------- CITATION.cff | 13 +- CLAUDE.md | 36 +- CONTRIBUTING.adoc | 18 +- Cargo.lock | 7 + .../overlay/Cargo.toml.in => Cargo.toml | 12 +- Justfile | 12 +- README.adoc | 197 ++--- SUPPORT.adoc | 4 +- archetypes/README.adoc | 116 --- archetypes/julia-library/actions.lock | 41 - .../julia-library/julia-library_praxis.deed | 37 - .../overlay/.github/workflows/julia-ci.yml.in | 105 --- .../.github/workflows/julia-docs.yml.in | 91 --- .../descriptiles/provisioning_praxis.deed | 38 - .../julia-library/overlay/Project.toml.in | 38 - .../overlay/scripts/julia-quality.jl | 129 ---- .../julia-library/overlay/src/PACKAGE.jl.in | 18 - .../julia-library/overlay/test/cases/smoke.jl | 14 - .../julia-library/overlay/test/runtests.jl | 34 - archetypes/julia-library/prune.txt | 14 - archetypes/rust-cli/overlay/src/main.rs.in | 6 - archetypes/rust-cli/prune.txt | 15 - archetypes/rust-cli/rust-cli_praxis.deed | 37 - .../benches/about.rs.in => benches/about.rs | 4 +- build/container/.containerignore | 59 -- build/container/README.adoc | 281 ------- build/container/compose.example.yaml | 153 ---- build/container/compose.yaml | 134 ---- build/container/entrypoint.sh | 63 -- build/container/stapeln/.gatekeeper.yaml | 157 ---- build/container/stapeln/compose.example.toml | 135 ---- build/container/stapeln/compose.toml | 94 --- build/container/stapeln/ct-build.sh | 168 ----- build/container/stapeln/deploy.k9.ncl.in | 189 ----- build/container/stapeln/manifest.toml | 62 -- build/container/stapeln/rokur.toml | 81 -- build/container/stapeln/vordr.toml | 117 --- build/docs-seed/README.adoc | 87 --- build/guix.scm | 12 +- build/just/groove.just | 4 +- build/just/provision-lib.sh | 4 +- build/manifest.scm | 2 +- build/templates/ROADMAP.adoc.in | 23 - build/templates/identity.deed.in | 91 --- docs/AFFIRMATION.adoc | 28 +- docs/AI_INSTALLATION_GUIDE.adoc | 2 +- docs/MAINTAINERS.adoc | 92 ++- docs/QUICKSTART.adoc | 2 +- docs/RSR-PHILOSOPHY.adoc | 2 +- docs/SETUP.adoc | 16 +- {build/docs-seed => docs}/architecture.adoc | 6 +- docs/architecture/REPOSITORY-MAP.adoc | 4 +- docs/architecture/THREAT-MODEL.adoc | 196 ++--- docs/attribution/CITATIONS.adoc | 20 +- {build/docs-seed => docs}/contributing.adoc | 14 +- docs/decisions/0000-template.adoc | 2 +- docs/decisions/0001-adopt-rsr-standard.adoc | 4 +- .../decisions/0001-template.adoc | 4 +- ...in-chez-10-build-from-release-tarball.adoc | 38 + .../0005-relocation-by-direct-exec.adoc | 54 ++ ...-glibc-floor-via-manylinux-containers.adoc | 35 + ...ints-compression-digest-lock-language.adoc | 86 +++ ...rust-signify-ed25519-monotonic-expiry.adoc | 39 + .../0009-error-taxonomy-as-data.adoc | 31 + .../0010-hosting-and-survivability.adoc | 39 + .../0011-estate-compliance-mint-rust-cli.adoc | 58 ++ docs/decisions/README.adoc | 22 +- docs/developer/ABI-FFI-README.adoc | 56 +- docs/governance/CRG-AUDIT-TEMPLATE.adoc | 22 +- docs/governance/TEMPLATE-LINEAGE-AUDIT.adoc | 4 +- docs/onboarding/QUICKSTART-DEV.adoc | 20 +- docs/onboarding/QUICKSTART-MAINTAINER.adoc | 32 +- docs/onboarding/QUICKSTART-USER.adoc | 14 +- docs/onboarding/llm-warmup-dev.adoc | 6 +- docs/onboarding/llm-warmup-maintainer.adoc | 4 +- docs/onboarding/llm-warmup-user.adoc | 10 +- docs/practice/AI-CONVENTIONS.adoc | 8 +- docs/practice/STATE-VISUALIZER-GUIDE.adoc | 8 +- docs/practice/ci-cost-reduction.adoc | 6 +- .../audit/pillar-audit-2026-04-15.adoc | 2 +- docs/runbooks/E-CAPSULE-INVALID.adoc | 20 + docs/runbooks/E-CHANNEL-EXPIRED.adoc | 20 + docs/runbooks/E-CHANNEL-ROLLBACK.adoc | 20 + docs/runbooks/E-CHANNEL-SCHEMA.adoc | 20 + docs/runbooks/E-GLIBC-FLOOR.adoc | 20 + docs/runbooks/E-HASH-MISMATCH.adoc | 20 + docs/runbooks/E-INTERNAL.adoc | 20 + docs/runbooks/E-LOCK-TIMEOUT.adoc | 20 + docs/runbooks/E-NETWORK.adoc | 20 + docs/runbooks/E-OFFLINE.adoc | 20 + docs/runbooks/E-PIN-DRIFT.adoc | 20 + docs/runbooks/E-PIN-NOT-FOUND.adoc | 20 + docs/runbooks/E-PLATFORM-UNSUPPORTED.adoc | 20 + docs/runbooks/E-PROBE-CODEGEN.adoc | 20 + docs/runbooks/E-SIG-INVALID.adoc | 20 + docs/runbooks/E-STORE-IO.adoc | 20 + docs/runbooks/E-USAGE.adoc | 20 + docs/status/BEST-PRACTICES.adoc | 79 ++ docs/status/BEYOND-REPO.adoc | 66 ++ docs/status/ESTATE-INTEGRATION.adoc | 44 ++ docs/status/PHASE0-REPORT.adoc | 133 ++++ docs/status/PRIOR-ART.adoc | 47 ++ docs/status/PROOF-NEEDS.adoc | 2 +- docs/status/PROOF-STATUS.adoc | 2 +- docs/status/READINESS.adoc | 22 +- docs/status/ROADMAP.adoc | 103 +-- docs/status/TEST-NEEDS.adoc | 2 +- docs/status/UPSTREAM-NOTES.adoc | 30 + .../docs-seed => docs}/troubleshooting.adoc | 8 +- {build/docs-seed => docs}/usage.adoc | 10 +- docs/wikis/Architecture.adoc | 27 + docs/wikis/CI-Fleet-Operations.adoc | 21 + docs/wikis/CI-Usage.adoc | 39 + docs/wikis/Capsule-Factory.adoc | 20 + docs/wikis/Capsule-Lifecycle.adoc | 11 + docs/wikis/Contributing-Guide.adoc | 29 + docs/wikis/Daily-Use.adoc | 44 ++ docs/wikis/Error-Reference.adoc | 29 + docs/wikis/Error-Taxonomy-Workflow.adoc | 14 + docs/wikis/FAQ.adoc | 24 + docs/wikis/Formal-Model.adoc | 35 + docs/wikis/Getting-Started.adoc | 37 + docs/wikis/Glossary.adoc | 19 + docs/wikis/Home.adoc | 42 ++ docs/wikis/Install.adoc | 57 ++ docs/wikis/Maintenance-Loop.adoc | 13 + docs/wikis/Mirrors-and-Caching.adoc | 19 + docs/wikis/Offline-and-Air-Gapped.adoc | 32 + docs/wikis/Platform-Overview.adoc | 30 + docs/wikis/Proof-Plan.adoc | 19 + docs/wikis/Prototype-and-Chaos-Suite.adoc | 30 + docs/wikis/Release-and-Signing.adoc | 16 + docs/wikis/Reproducibility-for-Research.adoc | 15 + docs/wikis/Security-Model.adoc | 16 + docs/wikis/Self-Hosted-Channel.adoc | 28 + docs/wikis/Supported-Platforms.adoc | 21 + docs/wikis/Theory-Overview.adoc | 20 + docs/wikis/Troubleshooting.adoc | 47 ++ docs/wikis/Trust-and-Freshness.adoc | 21 + docs/wikis/Uninstall.adoc | 45 ++ docs/wikis/_Footer.adoc | 5 + docs/wikis/_Sidebar.adoc | 46 ++ examples/fixture_server.rs | 112 +++ examples/idris2x.lock | 22 + examples/idris2x.lock.license | 2 + examples/idris2x.toml | 10 + ...late-repo_chora.deed => idris2x_chora.deed | 309 ++++---- launcher.sh | 6 +- mise.lock | 31 - mise.toml | 22 +- scripts/campaigns/repo-map-trim.campaign | 2 +- scripts/campaigns/www-bundle.campaign | 2 +- scripts/canon-pin-check.sh | 2 +- scripts/check-no-placeholders.sh | 8 +- scripts/configure-repo.sh | 18 + scripts/deed-template-sync.sh | 2 +- scripts/gen-issue-forms.sh | 76 ++ scripts/gen-matrix.sh | 14 + scripts/gen-runbooks.sh | 33 + scripts/is-template-tree.sh | 14 +- scripts/lib/toml2json.sh | 33 + scripts/proto/README.adoc | 29 + scripts/proto/bench-decompress.sh | 12 + scripts/proto/chaos.sh | 110 +++ scripts/proto/idris2x.sh | 226 ++++++ scripts/proto/make-capsule.sh | 59 ++ scripts/sync-local-labels.sh | 15 + scripts/sync-wiki.sh | 42 ++ scripts/validate-template.sh | 2 +- sonar-project.properties | 6 +- src/contracts/channel-v1.schema.json | 1 + src/contracts/channel-v1.schema.json.license | 2 + src/definitions/targets.toml | 55 ++ src/errors/errors.toml | 93 +++ src/interface/Abi/Foreign.idr | 112 --- src/interface/Abi/Layout.idr | 128 ---- src/interface/Abi/README.adoc | 3 - src/interface/Abi/Types.idr | 161 ---- src/interface/README.adoc | 3 - src/interface/abi.ipkg | 36 - src/interface/ffi/README.adoc | 3 - src/interface/ffi/build.zig | 29 - src/interface/ffi/src/README.adoc | 3 - src/interface/ffi/src/main.zig | 293 -------- src/interface/ffi/test/README.adoc | 3 - src/interface/ffi/test/integration_test.zig | 66 -- src/interface/generated/README.adoc | 3 - src/interface/generated/abi/README.adoc | 3 - .../overlay/src/lib.rs.in => src/lib.rs | 8 +- src/main.rs | 6 + tests/canaries/ipkg_multi_module/canary.ipkg | 7 + .../ipkg_multi_module/canary.ipkg.license | 2 + tests/canaries/ipkg_multi_module/src/Lib.idr | 6 + tests/canaries/ipkg_multi_module/src/Main.idr | 6 + tests/canaries/run.sh | 45 ++ tests/canaries/src/CFfiSupport.idr | 8 + tests/canaries/src/ChezCodegen.idr | 6 + tests/canaries/src/PreludeBase.idr | 12 + tests/canaries/src/chez_threads.ss | 6 + tests/canaries/src/pure_eval.ss | 4 + .../overlay/tests/cli.rs.in => tests/cli.rs | 4 +- tests/e2e.sh | 4 +- tests/workflows/canon_pin_check_test.sh | 2 +- tests/workflows/check_identity_test.sh | 2 +- tests/workflows/devcontainer_test.sh | 2 +- tests/workflows/edict_trial_test.sh | 2 +- tests/workflows/governance_policy_test.sh | 2 +- www/.well-known/aibdp.json | 2 +- www/.well-known/humans.txt | 6 +- www/.well-known/security.txt | 8 +- www/README.adoc | 2 +- www/dns/records/example.invalid.zone | 4 +- www/policies/acceptable-use.adoc | 2 +- www/policies/ai-use.adoc | 2 +- www/policies/privacy.adoc | 2 +- www/public/index.html | 10 +- 276 files changed, 4385 insertions(+), 5395 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/canary_failure.yml create mode 100644 .github/ISSUE_TEMPLATE/capsule_request.yml create mode 100644 .github/ISSUE_TEMPLATE/dx_feedback.yml create mode 100644 .github/ISSUE_TEMPLATE/error_report.yml create mode 100644 .github/labels-idris2x.toml create mode 100644 .github/repo-settings-idris2x.toml create mode 100644 .github/workflows/labels-idris2x.yml create mode 100644 .github/workflows/wiki-sync.yml delete mode 100644 .machine_readable/ai/PLACEHOLDERS.adoc create mode 100644 Cargo.lock rename archetypes/rust-cli/overlay/Cargo.toml.in => Cargo.toml (65%) delete mode 100644 archetypes/README.adoc delete mode 100644 archetypes/julia-library/actions.lock delete mode 100644 archetypes/julia-library/julia-library_praxis.deed delete mode 100644 archetypes/julia-library/overlay/.github/workflows/julia-ci.yml.in delete mode 100644 archetypes/julia-library/overlay/.github/workflows/julia-docs.yml.in delete mode 100644 archetypes/julia-library/overlay/.machine_readable/descriptiles/provisioning_praxis.deed delete mode 100644 archetypes/julia-library/overlay/Project.toml.in delete mode 100644 archetypes/julia-library/overlay/scripts/julia-quality.jl delete mode 100644 archetypes/julia-library/overlay/src/PACKAGE.jl.in delete mode 100644 archetypes/julia-library/overlay/test/cases/smoke.jl delete mode 100644 archetypes/julia-library/overlay/test/runtests.jl delete mode 100644 archetypes/julia-library/prune.txt delete mode 100644 archetypes/rust-cli/overlay/src/main.rs.in delete mode 100644 archetypes/rust-cli/prune.txt delete mode 100644 archetypes/rust-cli/rust-cli_praxis.deed rename archetypes/rust-cli/overlay/benches/about.rs.in => benches/about.rs (88%) delete mode 100644 build/container/.containerignore delete mode 100644 build/container/README.adoc delete mode 100644 build/container/compose.example.yaml delete mode 100644 build/container/compose.yaml delete mode 100755 build/container/entrypoint.sh delete mode 100644 build/container/stapeln/.gatekeeper.yaml delete mode 100644 build/container/stapeln/compose.example.toml delete mode 100644 build/container/stapeln/compose.toml delete mode 100755 build/container/stapeln/ct-build.sh delete mode 100644 build/container/stapeln/deploy.k9.ncl.in delete mode 100644 build/container/stapeln/manifest.toml delete mode 100644 build/container/stapeln/rokur.toml delete mode 100644 build/container/stapeln/vordr.toml delete mode 100644 build/docs-seed/README.adoc delete mode 100644 build/templates/ROADMAP.adoc.in delete mode 100644 build/templates/identity.deed.in rename {build/docs-seed => docs}/architecture.adoc (93%) rename {build/docs-seed => docs}/contributing.adoc (88%) rename {build/docs-seed => docs}/decisions/0001-template.adoc (94%) create mode 100644 docs/decisions/0004-pin-chez-10-build-from-release-tarball.adoc create mode 100644 docs/decisions/0005-relocation-by-direct-exec.adoc create mode 100644 docs/decisions/0006-glibc-floor-via-manylinux-containers.adoc create mode 100644 docs/decisions/0007-launcher-constraints-compression-digest-lock-language.adoc create mode 100644 docs/decisions/0008-channel-trust-signify-ed25519-monotonic-expiry.adoc create mode 100644 docs/decisions/0009-error-taxonomy-as-data.adoc create mode 100644 docs/decisions/0010-hosting-and-survivability.adoc create mode 100644 docs/decisions/0011-estate-compliance-mint-rust-cli.adoc create mode 100644 docs/runbooks/E-CAPSULE-INVALID.adoc create mode 100644 docs/runbooks/E-CHANNEL-EXPIRED.adoc create mode 100644 docs/runbooks/E-CHANNEL-ROLLBACK.adoc create mode 100644 docs/runbooks/E-CHANNEL-SCHEMA.adoc create mode 100644 docs/runbooks/E-GLIBC-FLOOR.adoc create mode 100644 docs/runbooks/E-HASH-MISMATCH.adoc create mode 100644 docs/runbooks/E-INTERNAL.adoc create mode 100644 docs/runbooks/E-LOCK-TIMEOUT.adoc create mode 100644 docs/runbooks/E-NETWORK.adoc create mode 100644 docs/runbooks/E-OFFLINE.adoc create mode 100644 docs/runbooks/E-PIN-DRIFT.adoc create mode 100644 docs/runbooks/E-PIN-NOT-FOUND.adoc create mode 100644 docs/runbooks/E-PLATFORM-UNSUPPORTED.adoc create mode 100644 docs/runbooks/E-PROBE-CODEGEN.adoc create mode 100644 docs/runbooks/E-SIG-INVALID.adoc create mode 100644 docs/runbooks/E-STORE-IO.adoc create mode 100644 docs/runbooks/E-USAGE.adoc create mode 100644 docs/status/BEST-PRACTICES.adoc create mode 100644 docs/status/BEYOND-REPO.adoc create mode 100644 docs/status/ESTATE-INTEGRATION.adoc create mode 100644 docs/status/PHASE0-REPORT.adoc create mode 100644 docs/status/PRIOR-ART.adoc create mode 100644 docs/status/UPSTREAM-NOTES.adoc rename {build/docs-seed => docs}/troubleshooting.adoc (84%) rename {build/docs-seed => docs}/usage.adoc (87%) create mode 100644 docs/wikis/Architecture.adoc create mode 100644 docs/wikis/CI-Fleet-Operations.adoc create mode 100644 docs/wikis/CI-Usage.adoc create mode 100644 docs/wikis/Capsule-Factory.adoc create mode 100644 docs/wikis/Capsule-Lifecycle.adoc create mode 100644 docs/wikis/Contributing-Guide.adoc create mode 100644 docs/wikis/Daily-Use.adoc create mode 100644 docs/wikis/Error-Reference.adoc create mode 100644 docs/wikis/Error-Taxonomy-Workflow.adoc create mode 100644 docs/wikis/FAQ.adoc create mode 100644 docs/wikis/Formal-Model.adoc create mode 100644 docs/wikis/Getting-Started.adoc create mode 100644 docs/wikis/Glossary.adoc create mode 100644 docs/wikis/Home.adoc create mode 100644 docs/wikis/Install.adoc create mode 100644 docs/wikis/Maintenance-Loop.adoc create mode 100644 docs/wikis/Mirrors-and-Caching.adoc create mode 100644 docs/wikis/Offline-and-Air-Gapped.adoc create mode 100644 docs/wikis/Platform-Overview.adoc create mode 100644 docs/wikis/Proof-Plan.adoc create mode 100644 docs/wikis/Prototype-and-Chaos-Suite.adoc create mode 100644 docs/wikis/Release-and-Signing.adoc create mode 100644 docs/wikis/Reproducibility-for-Research.adoc create mode 100644 docs/wikis/Security-Model.adoc create mode 100644 docs/wikis/Self-Hosted-Channel.adoc create mode 100644 docs/wikis/Supported-Platforms.adoc create mode 100644 docs/wikis/Theory-Overview.adoc create mode 100644 docs/wikis/Troubleshooting.adoc create mode 100644 docs/wikis/Trust-and-Freshness.adoc create mode 100644 docs/wikis/Uninstall.adoc create mode 100644 docs/wikis/_Footer.adoc create mode 100644 docs/wikis/_Sidebar.adoc create mode 100644 examples/fixture_server.rs create mode 100644 examples/idris2x.lock create mode 100644 examples/idris2x.lock.license create mode 100644 examples/idris2x.toml rename rsr-template-repo_chora.deed => idris2x_chora.deed (85%) create mode 100755 scripts/configure-repo.sh create mode 100755 scripts/gen-issue-forms.sh create mode 100755 scripts/gen-matrix.sh create mode 100755 scripts/gen-runbooks.sh create mode 100755 scripts/lib/toml2json.sh create mode 100644 scripts/proto/README.adoc create mode 100755 scripts/proto/bench-decompress.sh create mode 100755 scripts/proto/chaos.sh create mode 100755 scripts/proto/idris2x.sh create mode 100755 scripts/proto/make-capsule.sh create mode 100755 scripts/sync-local-labels.sh create mode 100755 scripts/sync-wiki.sh create mode 100644 src/contracts/channel-v1.schema.json create mode 100644 src/contracts/channel-v1.schema.json.license create mode 100644 src/definitions/targets.toml create mode 100644 src/errors/errors.toml delete mode 100644 src/interface/Abi/Foreign.idr delete mode 100644 src/interface/Abi/Layout.idr delete mode 100644 src/interface/Abi/README.adoc delete mode 100644 src/interface/Abi/Types.idr delete mode 100644 src/interface/README.adoc delete mode 100644 src/interface/abi.ipkg delete mode 100644 src/interface/ffi/README.adoc delete mode 100644 src/interface/ffi/build.zig delete mode 100644 src/interface/ffi/src/README.adoc delete mode 100644 src/interface/ffi/src/main.zig delete mode 100644 src/interface/ffi/test/README.adoc delete mode 100644 src/interface/ffi/test/integration_test.zig delete mode 100644 src/interface/generated/README.adoc delete mode 100644 src/interface/generated/abi/README.adoc rename archetypes/rust-cli/overlay/src/lib.rs.in => src/lib.rs (52%) create mode 100644 src/main.rs create mode 100644 tests/canaries/ipkg_multi_module/canary.ipkg create mode 100644 tests/canaries/ipkg_multi_module/canary.ipkg.license create mode 100644 tests/canaries/ipkg_multi_module/src/Lib.idr create mode 100644 tests/canaries/ipkg_multi_module/src/Main.idr create mode 100755 tests/canaries/run.sh create mode 100644 tests/canaries/src/CFfiSupport.idr create mode 100644 tests/canaries/src/ChezCodegen.idr create mode 100644 tests/canaries/src/PreludeBase.idr create mode 100644 tests/canaries/src/chez_threads.ss create mode 100644 tests/canaries/src/pure_eval.ss rename archetypes/rust-cli/overlay/tests/cli.rs.in => tests/cli.rs (75%) diff --git a/.clinerules b/.clinerules index d245981b..18c0c224 100644 --- a/.clinerules +++ b/.clinerules @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MPL-2.0 -# Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +# Copyright (c) 2026 Jonathan D.A. Jewell (metadatastician) # Authoritative source: docs/practice/AI-CONVENTIONS.adoc # STARTUP: Read the repo deed (*_chora.deed at the repo root) first, then docs/status/ROADMAP.adoc. @@ -8,7 +8,7 @@ # 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: {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +# Copyright: Jonathan D.A. Jewell (metadatastician) # STATE FILES # No .a2ml file may exist anywhere: the format is retired. State, metadata, diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 6342c2ca..9937cd4c 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -14,6 +14,22 @@ reviews: project's approved language and runtime. Pre-existing third-party code is not permission to author new Python. Do not demand language migrations of unrelated upstream dependencies as cosmetic PR work. + - path: "src/**" + instructions: >- + idris2x launcher. Flag any silent fallback, untyped error, network + access on the exec path, inherited IDRIS2_/LD_LIBRARY_PATH/DYLD_ values, + resumed download of a mutable document, or archive extraction without + a containment check. Every failure must map to an ID in + src/errors/errors.toml. Exit codes are append-only. + - path: "src/errors/errors.toml" + instructions: >- + Exit codes must never be renumbered or reused. Each entry needs a + one-line meaning and an exact, copy-pasteable fix. Remind the author to + run scripts/gen-runbooks.sh and scripts/gen-issue-forms.sh. + - path: "docs/wikis/**" + instructions: >- + Wiki source. Check that planned behaviour is labelled as planned, that + commands are copy-pasteable, and that pages stay within their persona. pre_merge_checks: docstrings: mode: warning diff --git a/.devcontainer/Containerfile b/.devcontainer/Containerfile index a6cd810d..26f8e379 100644 --- a/.devcontainer/Containerfile +++ b/.devcontainer/Containerfile @@ -1,9 +1,9 @@ # SPDX-License-Identifier: MPL-2.0 -# Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +# Copyright (c) 2026 Jonathan D.A. Jewell (metadatastician) # -# Dev Container image for {{PROJECT_NAME}} +# Dev Container image for idris2x # Base: Chainguard Wolfi (minimal, supply-chain-secure) -# Build: podman build -t {{PROJECT_NAME}}-dev -f .devcontainer/Containerfile . +# Build: podman build -t idris2x-dev -f .devcontainer/Containerfile . # `:latest` suits a dev container (rebuilt daily); pin by digest # (...@sha256:) if you need a reproducible dev environment. # @@ -44,7 +44,7 @@ RUN set -eu; \ # devcontainer.json maps your host user onto it with --userns=keep-id. # Set workspace directory -WORKDIR /workspaces/{{PROJECT_NAME}} +WORKDIR /workspaces/idris2x # Default shell ENV SHELL=/bin/bash diff --git a/.devcontainer/README.adoc b/.devcontainer/README.adoc index 6a0114ec..eb9aeff3 100644 --- a/.devcontainer/README.adoc +++ b/.devcontainer/README.adoc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell = Dev Container Usage -:author: {{AUTHOR}} <{{AUTHOR_EMAIL}}> +:author: Jonathan D.A. Jewell == Overview @@ -35,7 +35,7 @@ There are two configurations for the same image: . Install the *Dev Containers* extension (`ms-vscode-remote.remote-containers`). . Set `dev.containers.dockerPath` to `podman` in VS Code settings. . Open the repo folder, then choose **Reopen in Container** and pick - **{{PROJECT_NAME}} (Podman)**. + **idris2x (Podman)**. == devcontainer CLI (Podman) @@ -47,7 +47,7 @@ bunx @devcontainers/cli up --workspace-folder . --docker-path podman == GitHub Codespaces . From the repository on GitHub, click **Code > Codespaces > ... > New with options**. -. Choose the **{{PROJECT_NAME}} (Docker / Codespaces)** configuration. +. Choose the **idris2x (Docker / Codespaces)** configuration. == Gitpod @@ -56,6 +56,6 @@ bunx @devcontainers/cli up --workspace-folder . --docker-path podman == Customization -Replace the `{{PROJECT_NAME}}` placeholders in both `devcontainer.json` files and +Replace the `idris2x` placeholders in both `devcontainer.json` files and the `Containerfile` with your actual project name. `just deps` runs automatically after the container is created. Run it again to check the environment. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3193734e..eae14bc8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MPL-2.0 -// Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +// Copyright (c) 2026 Jonathan D.A. Jewell (metadatastician) // -// Dev Container configuration for {{PROJECT_NAME}} — rootless Podman (default). +// Dev Container configuration for idris2x — rootless Podman (default). // Works with: VS Code Dev Containers with `dev.containers.dockerPath` = podman, // and the devcontainer CLI (`devcontainer up --docker-path podman`). // Docker, GitHub Codespaces and Gitpod: use .devcontainer/docker/devcontainer.json @@ -44,7 +44,7 @@ } } }, - "name": "{{PROJECT_NAME}} (Podman)", + "name": "idris2x (Podman)", "postCreateCommand": "just deps", "remoteUser": "nonroot", // Rootless Podman maps your host user to root inside the container, so the diff --git a/.devcontainer/docker/devcontainer.json b/.devcontainer/docker/devcontainer.json index fadee842..0074ff5e 100644 --- a/.devcontainer/docker/devcontainer.json +++ b/.devcontainer/docker/devcontainer.json @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MPL-2.0 -// Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +// Copyright (c) 2026 Jonathan D.A. Jewell (metadatastician) // -// Dev Container configuration for {{PROJECT_NAME}} — Docker engines. +// Dev Container configuration for idris2x — Docker engines. // Works with: GitHub Codespaces, Gitpod, and VS Code Dev Containers on Docker. // The estate default is rootless Podman: .devcontainer/devcontainer.json. // Same image (../Containerfile); only the user-namespace settings differ. { - "name": "{{PROJECT_NAME}} (Docker / Codespaces)", + "name": "idris2x (Docker / Codespaces)", "build": { "dockerfile": "../Containerfile", diff --git a/.editorconfig b/.editorconfig index 808e2414..068cca1f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MPL-2.0 # Hyperpolymath estate canonical .editorconfig (standards#343 phase 1) -# Canon lives in rsr-template-repo; do not add a per-repo name to this header. +# Canon lives in idris2x; do not add a per-repo name to this header. # https://editorconfig.org root = true diff --git a/.envrc b/.envrc index ec7a7ad0..961e672a 100644 --- a/.envrc +++ b/.envrc @@ -13,7 +13,7 @@ if has guix && [ -f build/manifest.scm ]; then fi # Project environment variables -export PROJECT_NAME="{{PROJECT_NAME}}" +export PROJECT_NAME="idris2x" export RSR_TIER="infrastructure" # Add non-secret project env vars above (e.g. DATABASE_URL, service endpoints). # Real secrets belong in .env (gitignored) — never commit them to .envrc. diff --git a/.gitattributes b/.gitattributes index 60462f86..0d85687a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MPL-2.0 (code) # SPDX-License-Identifier: CC-SA-BY-4.0 (prose) # Hyperpolymath estate canonical .gitattributes (standards#343 phase 1) -# Canon lives in rsr-template-repo; do not add a per-repo name to this header. +# Canon lives in idris2x; do not add a per-repo name to this header. # # Only diff drivers that git actually ships are used here. MEASURED on git # 2.47.3: diff=go and diff=zig are NOT drivers (git silently falls back to the diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6bdfc8a2..a36bbc0b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,14 +2,14 @@ # CODEOWNERS - Define code review assignments # See: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners # -# Replace {{OWNER}} with your GitHub username or team +# Replace metadatastician with your GitHub username or team # Default owners for everything -* @{{OWNER}} +* @metadatastician # Security-sensitive files require explicit review -SECURITY.md @{{OWNER}} -.github/workflows/ @{{OWNER}} -.machine_readable/contractiles/trust/ @{{OWNER}} -*_chora.deed @{{OWNER}} -.machine_readable/ @{{OWNER}} +SECURITY.md @metadatastician +.github/workflows/ @metadatastician +.machine_readable/contractiles/trust/ @metadatastician +*_chora.deed @metadatastician +.machine_readable/ @metadatastician diff --git a/.github/GOVERNANCE.adoc b/.github/GOVERNANCE.adoc index feee84e7..835e2ffa 100644 --- a/.github/GOVERNANCE.adoc +++ b/.github/GOVERNANCE.adoc @@ -4,13 +4,13 @@ Copyright (c) Jonathan D.A. Jewell --> # Project Governance -This document describes the governance model for **{{PROJECT_NAME}}**. +This document describes the governance model for **idris2x**. --- ## Project Governance Model -{{PROJECT_NAME}} follows a **Benevolent Dictator For Life (BDFL)** governance model. +idris2x follows a **Benevolent Dictator For Life (BDFL)** governance model. This model is well-suited for solo maintainers and small project teams where rapid, consistent decision-making is more valuable than formal consensus processes. @@ -157,4 +157,4 @@ with the community before adoption, even though the BDFL retains final authority --- -Copyright (c) {{CURRENT_YEAR}} {{OWNER}}. Licensed under MPL-2.0. +Copyright (c) 2026 metadatastician. Licensed under MPL-2.0. diff --git a/.github/ISSUE_TEMPLATE/canary_failure.yml b/.github/ISSUE_TEMPLATE/canary_failure.yml new file mode 100644 index 00000000..41aff4a9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/canary_failure.yml @@ -0,0 +1,38 @@ +# SPDX-License-Identifier: CC-BY-SA-4.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +name: Canary or churn-drill failure +description: A canary failed on a capsule, or an upstream asset changed. Used by humans and by the maintenance agent. +title: "[canary] on (idris2@, chez@)" +labels: ["area:canary", "needs-triage"] +body: + - type: markdown + attributes: + value: | + Keep the title format exactly: the maintenance loop de-duplicates on it. One issue per canary and target. + - type: dropdown + id: canary + attributes: + label: Canary + options: [pure_eval, chez_codegen, refc_codegen, c_ffi_support, ipkg_multi_module, relocatable_artifact, prelude_base, concurrent_build, unicode_paths, large_module, chez_threads, version_match, "churn drill (upstream asset changed)"] + validations: + required: true + - type: input + id: digest + attributes: + label: Capsule digest + placeholder: "sha256:0dc9ae68..." + validations: + required: true + - type: textarea + id: record + attributes: + label: Failure record + description: Stage, triple, versions, log excerpt, host fingerprint (the JSON the canary runner emits). + render: json + validations: + required: true + - type: dropdown + id: class + attributes: + label: First classification + options: ["data fix (channel patch)", "engine fix (launcher)", "upstream outage or regression", "flaky / infrastructure", "unknown"] diff --git a/.github/ISSUE_TEMPLATE/capsule_request.yml b/.github/ISSUE_TEMPLATE/capsule_request.yml new file mode 100644 index 00000000..9124bbfa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/capsule_request.yml @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: CC-BY-SA-4.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +name: Request a capsule (new Idris 2 version or target) +description: Ask for an Idris 2 release, a Chez Scheme pairing or a platform that has no capsule yet. +title: "[capsule] idris2@ on " +labels: ["enhancement", "area:capsule", "needs-triage"] +body: + - type: markdown + attributes: + value: | + Capsules are built from pinned upstream sources and are immutable once published. Adding one is a + Class B change (one human approval) after the full canary matrix passes. New *targets* change the + support matrix (`src/definitions/targets.toml`) and are Class C: they need an ADR. + - type: input + id: version + attributes: + label: Idris 2 version or tag + placeholder: "0.8.0" + validations: + required: true + - type: dropdown + id: target + attributes: + label: Target + options: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-pc-windows-msvc (Tier 2)", "Other (describe below)"] + multiple: true + validations: + required: true + - type: textarea + id: why + attributes: + label: What do you need it for? + description: CI, teaching, a paper, a production service... It decides priority and tier. + validations: + required: true + - type: textarea + id: host + attributes: + label: Host details for unusual targets + description: OS release, libc and version (`ldd --version`), CPU, container base image. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 5e508a70..55edeebb 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -6,8 +6,8 @@ blank_issues_enabled: true contact_links: - name: Security vulnerability - url: https://{{FORGE}}/{{OWNER}}/{{REPO}}/security/advisories/new + url: https://github.com/metadatastician/idris2x/security/advisories/new about: Report privately via a security advisory. Do NOT open a public issue. - name: Question or support request - url: https://{{FORGE}}/{{OWNER}}/{{REPO}}/discussions + url: https://github.com/metadatastician/idris2x/discussions about: Ask a question. See .github/SUPPORT.md for what to expect. diff --git a/.github/ISSUE_TEMPLATE/dx_feedback.yml b/.github/ISSUE_TEMPLATE/dx_feedback.yml new file mode 100644 index 00000000..d54c80d8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/dx_feedback.yml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: CC-BY-SA-4.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +name: Developer experience feedback +description: An error message, prompt, output or flow that confused you, slowed you down, or could be clearer. +title: "[dx] " +labels: ["area:dx", "needs-triage"] +body: + - type: markdown + attributes: + value: | + We treat confusing output as a bug. Tell us what you saw, what you thought it meant, and what you did next. + Installation, uninstallation, CI setup, offline use and debugging are all in scope. + - type: dropdown + id: moment + attributes: + label: Which moment? + options: ["First install", "Uninstall / cleanup", "Pinning or upgrading a version", "Running the compiler", "CI setup", "Offline or air-gapped use", "An error message", "doctor / selftest output", "Documentation or wiki", "Other"] + validations: + required: true + - type: textarea + id: saw + attributes: + label: What you saw (verbatim) + render: shell + validations: + required: true + - type: textarea + id: understood + attributes: + label: What you understood it to mean, and what you did next + validations: + required: true + - type: textarea + id: wished + attributes: + label: What would have helped (optional) + - type: dropdown + id: env + attributes: + label: Terminal / environment + options: ["Interactive terminal", "CI log", "Screen reader", "NO_COLOR or monochrome", "Narrow terminal (< 80 columns)", "Non-English locale", "Other"] + multiple: true diff --git a/.github/ISSUE_TEMPLATE/error_report.yml b/.github/ISSUE_TEMPLATE/error_report.yml new file mode 100644 index 00000000..6360a6b4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/error_report.yml @@ -0,0 +1,79 @@ +# SPDX-License-Identifier: CC-BY-SA-4.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +# GENERATED by scripts/gen-issue-forms.sh from src/errors/errors.toml — edit the TOML, not this file. +name: idris2x printed an error +description: idris2x stopped with an error ID (E-...). Start here; it is the fastest way to a fix. +title: "[E-???] " +labels: ["bug", "needs-triage", "error-report"] +body: + - type: markdown + attributes: + value: | + Every idris2x failure has a stable ID, an exit code and a runbook. Please check the runbook linked in the + error first: most reports are solved by its fix line. If it did not help, this form gives us everything + we need in one round trip. + - type: dropdown + id: error-id + attributes: + label: Error ID + description: The E-... code idris2x printed (also its exit code). + options: + - "E-USAGE (exit 2): bad command line" + - "E-PIN-NOT-FOUND (exit 10): no lock, or lock/channel has no capsule for this version+target" + - "E-HASH-MISMATCH (exit 11): downloaded bytes or unpacked tree do not match the pinned digest" + - "E-SIG-INVALID (exit 12): channel manifest signature or key id does not verify" + - "E-PLATFORM-UNSUPPORTED (exit 13): no capsule exists for this OS/arch" + - "E-NETWORK (exit 14): all mirrors failed" + - "E-LOCK-TIMEOUT (exit 15): another install of the same capsule held the lock too long" + - "E-GLIBC-FLOOR (exit 16): host glibc older than the capsule's min_glibc" + - "E-PROBE-CODEGEN (exit 17): capsule unpacked and verified but a canary failed on this host" + - "E-CHANNEL-SCHEMA (exit 18): channel or lock schema newer than this launcher" + - "E-PIN-DRIFT (exit 19): idris2x.toml and idris2x.lock disagree" + - "E-OFFLINE (exit 20): cache miss while IDRIS2X_OFFLINE=1" + - "E-CAPSULE-INVALID (exit 21): capsule archive is malformed or contains unsafe paths/links" + - "E-CHANNEL-ROLLBACK (exit 22): channel_version went backwards relative to the lock (rollback/freeze attack or stale mirror)" + - "E-CHANNEL-EXPIRED (exit 23): channel manifest past its expires timestamp (freeze protection)" + - "E-STORE-IO (exit 24): store not writable, disk full, or atomic rename failed" + - "E-INTERNAL (exit 70): launcher bug" + - "No error ID was printed (that itself is a bug: every failure must be typed)" + validations: + required: true + - type: textarea + id: command + attributes: + label: The exact command and its full output + render: shell + placeholder: | + $ idris2x exec --locked -- idris2 --check src/Main.idr + idris2x: E-HASH-MISMATCH: ... + validations: + required: true + - type: textarea + id: doctor + attributes: + label: Output of idris2x doctor --json + description: Contains no secrets and no telemetry; review it before pasting if you are unsure. + render: json + validations: + required: true + - type: textarea + id: lock + attributes: + label: idris2x.lock (if the project has one) + render: json + - type: dropdown + id: context + attributes: + label: Where did this happen? + options: ["Developer laptop", "CI runner (GitHub-hosted)", "CI runner (self-hosted)", "Server or container", "Air-gapped host", "Other"] + validations: + required: true + - type: checkboxes + id: checked + attributes: + label: Before submitting + options: + - label: I read the runbook linked in the error message. + required: true + - label: I did not paste any credentials, tokens or private paths I mind sharing. + required: true diff --git a/.github/SECURITY.md b/.github/SECURITY.md index d68f060b..20c8c69f 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -36,7 +36,7 @@ We take security seriously. We appreciate your efforts to responsibly disclose v The preferred method for reporting security vulnerabilities is through GitHub's Security Advisory feature: -1. Navigate to [Report a Vulnerability](https://github.com/hyperpolymath/rsr-template-repo/security/advisories/new) +1. Navigate to [Report a Vulnerability](https://github.com/metadatastician/idris2x/security/advisories/new) 2. Click **"Report a vulnerability"** 3. Complete the form with as much detail as possible 4. Submit — we'll receive a private notification @@ -54,7 +54,7 @@ If you cannot use GitHub Security Advisories, you may email us directly: | | | |---|---| -| **Email** | {{SECURITY_EMAIL}} | +| **Email** | j.d.a.jewell@open.ac.uk | This mailbox is not encrypted. For anything sensitive enough to need encryption, prefer GitHub Security Advisories above — the report stays private @@ -190,7 +190,7 @@ If we cannot reach agreement on disclosure timing, we default to 90 days from yo The following are within scope for security research: -- This repository (`hyperpolymath/rsr-template-repo`) and all its code +- This repository (`metadatastician/idris2x`) and all its code - Official releases and packages published from this repository - Documentation that could lead to security issues - Build and deployment configurations in this repository @@ -309,7 +309,7 @@ Recognition includes: To stay informed about security updates: - **Watch this repository**: Click "Watch" → "Custom" → Select "Security alerts" -- **GitHub Security Advisories**: Published at [Security Advisories](https://github.com/hyperpolymath/rsr-template-repo/security/advisories) +- **GitHub Security Advisories**: Published at [Security Advisories](https://github.com/metadatastician/idris2x/security/advisories) - **Release notes**: Security fixes noted in [CHANGELOG](../CHANGELOG.adoc) ### Update Policy @@ -335,7 +335,7 @@ To stay informed about security updates: ## Security Best Practices -When using rsr-template-repo, we recommend: +When using idris2x, we recommend: ### General @@ -357,7 +357,7 @@ When using rsr-template-repo, we recommend: ## Additional Resources -- [Security Advisories](https://github.com/hyperpolymath/rsr-template-repo/security/advisories) +- [Security Advisories](https://github.com/metadatastician/idris2x/security/advisories) - [Changelog](../CHANGELOG.adoc) - [Contributing Guidelines](../CONTRIBUTING.adoc) - [CVE Database](https://cve.mitre.org/) @@ -369,8 +369,8 @@ When using rsr-template-repo, we recommend: | Purpose | Contact | |---------|---------| -| **Security issues** | [Report via GitHub](https://github.com/hyperpolymath/rsr-template-repo/security/advisories/new) or {{SECURITY_EMAIL}} | -| **General questions** | [GitHub Discussions](https://github.com/hyperpolymath/rsr-template-repo/discussions) | +| **Security issues** | [Report via GitHub](https://github.com/metadatastician/idris2x/security/advisories/new) or j.d.a.jewell@open.ac.uk | +| **General questions** | [GitHub Discussions](https://github.com/metadatastician/idris2x/discussions) | | **Other enquiries** | See [README](../README.adoc) for contact information | --- @@ -385,8 +385,8 @@ This security policy may be updated from time to time. Significant changes will --- -*Thank you for helping keep rsr-template-repo and its users safe.* 🛡️ +*Thank you for helping keep idris2x and its users safe.* 🛡️ --- -Last updated: {{CURRENT_YEAR}} · Policy version: 1.0.0 +Last updated: 2026 · Policy version: 1.0.0 diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 2f441bd2..e7229460 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: CC-BY-SA-4.0 Copyright (c) Jonathan D.A. Jewell --> - + # Copilot Instructions @@ -17,7 +17,7 @@ Copyright (c) Jonathan D.A. Jewell - SPDX: `MPL-2.0` on all new files. - Never use AGPL-3.0. -- Copyright: `{{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}>` +- Copyright: `Jonathan D.A. Jewell (metadatastician) ` ## Code Style @@ -91,3 +91,18 @@ Only if this repo has a `src/interface/` seam; otherwise skip. 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 separate files. + +## idris2x: rules for agents working in this repository + +These are project facts, measured in Phase 0 (docs/status/PHASE0-REPORT.adoc). They bind every agent. + +* **Five invariants.** I1 no silent drift, I2 atomic or absent, I3 loud by default, I4 the past never breaks, I5 verify before trust. A change that adds a silent fallback, an untyped failure or a network call on the execution path is wrong even if tests pass. +* **Execution never reads the channel.** `install --locked` and `exec --locked` need only `idris2x.lock` and capsule bytes. Expiry, rollback protection and deprecation gate `pin`/`update` only (ADR 0008). +* **Every failure is typed.** Add or change errors only in `src/errors/errors.toml` (exit codes are append-only), then run `scripts/gen-runbooks.sh` and `scripts/gen-issue-forms.sh`. Never hand-edit `docs/runbooks/*.adoc` above the marker or `.github/ISSUE_TEMPLATE/error_report.yml`. +* **The environment contract is a reset** (ADR 0005): inherited `IDRIS2_*`, `LD_LIBRARY_PATH`, `DYLD_*`, `CHEZ`, `SCHEMEHEAPDIRS` are code search paths; the launcher sets them and inherits none unless `--inherit-env`. +* **Resume only immutable, digest-addressed downloads.** Never resume the channel manifest or any mutable document. +* **Archive extraction** rejects absolute names, `..`, links escaping the staging tree, devices and setuid bits, and uses a containment check, never `join(dst, clean(name))`. +* **Languages:** Rust for the launcher, bash + jq + awk for scripts. No Python, Go or Node.js (estate policy and this repo's anchor). The capsule factory *invokes* upstream Makefiles; it never patches Idris 2 or Chez Scheme (zero-fork policy). +* **The launcher stays under 1,000 lines of our own code.** A feature that does not fit belongs in the channel (data) or the capsule. +* **The maintenance agent** may only propose one of four shapes (`compat_patch`, `pin_bump`, `mirror_add`, `escalate`), never signs, never approves or merges its own PR, never widens `src/definitions/targets.toml`. Any open issue labelled `agent:kill-switch` stops it. +* **Report faithfully.** The launcher, factory and published capsules do not exist yet; do not describe planned behaviour as shipped. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 83278065..97fe75f2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -48,35 +48,3 @@ updates: open-pull-requests-limit: 0 # Elixir/Mix - - package-ecosystem: "mix" - directory: "/" - schedule: - interval: "weekly" - open-pull-requests-limit: 3 - groups: - dependency-updates: - patterns: ["*"] - - # Node.js/npm - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "weekly" - open-pull-requests-limit: 3 - groups: - dependency-updates: - patterns: ["*"] - - # Python/pip - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "weekly" - open-pull-requests-limit: 3 - groups: - dependency-updates: - patterns: ["*"] - - # NOTE: Nix is banned estate-wide — Guix is the sole package manager. - # Do not add a `nix` ecosystem here. Guix has no Dependabot ecosystem; - # pin Guix channels/manifests via build/ tooling instead. diff --git a/.github/labels-idris2x.toml b/.github/labels-idris2x.toml new file mode 100644 index 00000000..6958d8e8 --- /dev/null +++ b/.github/labels-idris2x.toml @@ -0,0 +1,82 @@ +# SPDX-License-Identifier: MPL-2.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +# Project labels for idris2x, in addition to the estate set in .github/labels.json (generated elsewhere; do not edit). +# Applied by scripts/sync-local-labels.sh (create or update; never deletes). +schema = 1 + +[[label]] +name = "area:launcher" +color = "1d76db" +description = "The Rust launcher: resolve, fetch, verify, store, exec" +[[label]] +name = "area:factory" +color = "1d76db" +description = "Capsule factory CI: building Chez and Idris 2 from pinned sources" +[[label]] +name = "area:channel" +color = "1d76db" +description = "The signed compat channel (data only)" +[[label]] +name = "area:capsule" +color = "1d76db" +description = "A capsule: contents, layout, licences, new versions or targets" +[[label]] +name = "area:canary" +color = "1d76db" +description = "The twelve canaries and churn drills" +[[label]] +name = "area:dx" +color = "5319e7" +description = "Developer experience: error messages, install and uninstall, debugging flows" +[[label]] +name = "area:wiki" +color = "0075ca" +description = "docs/wikis and the published GitHub wiki" +[[label]] +name = "error-report" +color = "d93f0b" +description = "A user hit a typed E-... error" +[[label]] +name = "risk:class-a" +color = "0e8a16" +description = "Mirror, URL or docs change: auto-merge after two green rehearsals" +[[label]] +name = "risk:class-b" +color = "fbca04" +description = "New version pin or checksum: one human approval after green canaries" +[[label]] +name = "risk:class-c" +color = "b60205" +description = "Launcher, schema, exit codes or support matrix: human only, needs an ADR" +[[label]] +name = "agent:proposed" +color = "c5def5" +description = "Opened by the bounded maintenance agent; never merged by it" +[[label]] +name = "agent:kill-switch" +color = "000000" +description = "While any open issue carries this label the maintenance agent does nothing" +[[label]] +name = "upstream:idris2" +color = "bfdadc" +description = "Caused by or reported to idris-lang/Idris2" +[[label]] +name = "upstream:chez" +color = "bfdadc" +description = "Caused by or reported to cisco/ChezScheme" +[[label]] +name = "target:linux" +color = "ededed" +description = "Linux x86_64 or aarch64 capsules" +[[label]] +name = "target:macos" +color = "ededed" +description = "macOS arm64 or x86_64 capsules" +[[label]] +name = "target:windows" +color = "ededed" +description = "Windows x86_64 (Tier 2, experimental)" +[[label]] +name = "needs-triage" +color = "fef2c0" +description = "Not yet classified" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index af129bf4..0c8fe0d8 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -46,3 +46,15 @@ Copyright (c) Jonathan D.A. Jewell ## Screenshots + +## idris2x specifics + + + +- Risk class: [ ] A (mirror, URL, docs) · [ ] B (version pin, checksum) · [ ] C (launcher, schema, exit codes, support matrix: link the ADR) +- [ ] Channel patch: `channel_version` is exactly +1, the manifest validates against `src/contracts/channel-v1.schema.json`, and `expires` is set +- [ ] Canaries green on three targets (link the run) +- [ ] Error taxonomy changed: `src/errors/errors.toml` edited (exit codes append-only), then `scripts/gen-runbooks.sh` and `scripts/gen-issue-forms.sh` re-run +- [ ] Launcher still under 1,000 lines of our own code; new crates vendored and allowed in `deny.toml` +- [ ] User-facing output changed: before/after transcript pasted below (plain, `NO_COLOR=1` and `--json`) +- [ ] Wiki source changed in `docs/wikis/` (published on merge) diff --git a/.github/repo-settings-idris2x.toml b/.github/repo-settings-idris2x.toml new file mode 100644 index 00000000..b18595e0 --- /dev/null +++ b/.github/repo-settings-idris2x.toml @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: MPL-2.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +# Forge identity for the Configure stage (ADR 0011). Applied by the OWNER with scripts/configure-repo.sh, +# never by CI (estate rule: .github/settings.yml must not declare repository identity). +schema = 1 + +[[repo]] +description = "Hermetic, lockfile-pinned toolchain for Idris 2 + Chez Scheme: signed, self-testing capsules, loud typed errors, offline and air-gap installs; designed to survive abandonment. Unofficial. Phase 0 (design) complete." +homepage = "https://github.com/metadatastician/idris2x/wiki" + +[[topic]] +name = "idris2" +[[topic]] +name = "idris" +[[topic]] +name = "chez-scheme" +[[topic]] +name = "dependent-types" +[[topic]] +name = "toolchain" +[[topic]] +name = "toolchain-manager" +[[topic]] +name = "version-manager" +[[topic]] +name = "hermetic-builds" +[[topic]] +name = "reproducible-builds" +[[topic]] +name = "lockfile" +[[topic]] +name = "content-addressable-storage" +[[topic]] +name = "supply-chain-security" +[[topic]] +name = "signed-releases" +[[topic]] +name = "air-gapped" +[[topic]] +name = "ci-cd" +[[topic]] +name = "formal-verification" +[[topic]] +name = "rust" +[[topic]] +name = "cli" +[[topic]] +name = "rsr" +[[topic]] +name = "hyperpolymath" diff --git a/.github/settings.yml b/.github/settings.yml index 46df3417..3019cecc 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -12,10 +12,10 @@ # It carries NO `name`, `description`, `homepage` or `private` key, and it must # never gain one. The reason is a real incident, not a hypothetical: # -# This file previously read `name: "rsr-template-repo"`. probot/settings applies it on +# This file previously read `name: "idris2x"`. probot/settings applies it on # every push to the default branch, so it submitted the literal string -# `rsr-template-repo` as the repository name. GitHub sanitises an invalid name by -# collapsing each run of illegal characters to a dash — `rsr-template-repo` became +# `idris2x` as the repository name. GitHub sanitises an invalid name by +# collapsing each run of illegal characters to a dash — `idris2x` became # `-REPO-`. The template renamed itself on every push, its old URL 404'd, and # it was mistaken for a deleted repository. `description` was likewise left # reading the literal `Canonical RSR (Rhodium Standard Repository) template — governance, CI/CD, machine-readable metadata, ABI/FFI seam and formal-verification scaffolding that hyperpolymath projects are instantiated from.` on the live repo. diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index 92d449a8..509a912f 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -49,6 +49,7 @@ workflows: - 'erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124' - 'github/codeql-action@33d7b85da1a04171e211befe2c739303b9a4c066' '.github/workflows/label-triage.yml': [] + '.github/workflows/labels-idris2x.yml': [] '.github/workflows/labels.yml': [] '.github/workflows/lock-sync-gate.yml': [] '.github/workflows/main-estate-audit.yml': @@ -102,6 +103,7 @@ workflows: - 'actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9' '.github/workflows/verdict-grid-publish.yml': - 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1' + '.github/workflows/wiki-sync.yml': [] '.github/workflows/workflow-linter.yml': - 'actions/checkout@v7.0.1' dependencies: diff --git a/.github/workflows/labels-idris2x.yml b/.github/workflows/labels-idris2x.yml new file mode 100644 index 00000000..36247ee4 --- /dev/null +++ b/.github/workflows/labels-idris2x.yml @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: MPL-2.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +name: Project labels + +# Applies the idris2x project labels from .github/labels-idris2x.toml (create or update, never delete). +# The estate label set stays with labels.yml. NO `uses:` (see labels.yml for why). + +on: + workflow_dispatch: + push: + branches: [main] + paths: ['.github/labels-idris2x.toml'] + +permissions: + contents: read + issues: write + +jobs: + labels: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - name: Fetch the commit (plain git, no actions) + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + git init -q src && cd src + git remote add origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" + git fetch -q --depth 1 origin "$GITHUB_SHA" && git checkout -q FETCH_HEAD + - name: Apply project labels + working-directory: src + env: + GH_TOKEN: ${{ github.token }} + run: scripts/sync-local-labels.sh "$GITHUB_REPOSITORY" diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 765b1f82..5f0ea3e3 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -3,7 +3,7 @@ # SonarQube Cloud (SonarCloud) static analysis. Analysis scope + exclusions live # in sonar-project.properties. Requires the SONAR_TOKEN repository secret # (Settings -> Secrets and variables -> Actions) and a SonarCloud project: -# https://sonarcloud.io/project/overview?id=hyperpolymath_rsr-template-repo +# https://sonarcloud.io/project/overview?id=hyperpolymath_idris2x # Mirrors the boj-server arrangement. # # WHY THE TOKEN GUARD (added 2026-07-28) diff --git a/.github/workflows/wiki-sync.yml b/.github/workflows/wiki-sync.yml new file mode 100644 index 00000000..b3c9a694 --- /dev/null +++ b/.github/workflows/wiki-sync.yml @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: MPL-2.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +name: Wiki sync + +# Publishes docs/wikis/*.adoc to the GitHub wiki after merge to main, and checks on pull +# requests that generated wiki pages, runbooks and the error-report form are not stale. +# +# NO `uses:` ANYWHERE, deliberately (same reason as labels.yml): .github/workflows/actions.lock +# is keyed by workflow path, and a workflow that pulls an unlisted action fails before any step. +# The repository is fetched with plain git instead of actions/checkout. + +on: + push: + branches: [main] + paths: ['docs/wikis/**', 'src/errors/errors.toml', 'scripts/sync-wiki.sh'] + pull_request: + paths: ['docs/wikis/**', 'src/errors/errors.toml', 'scripts/**', '.github/ISSUE_TEMPLATE/**'] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: wiki-sync-${{ github.ref }} + cancel-in-progress: false + +jobs: + wiki: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + permissions: + contents: write # the wiki repository is written with the workflow token + steps: + - name: Fetch the commit (plain git, no actions) + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + git init -q src && cd src + git remote add origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" + git fetch -q --depth 1 origin "$GITHUB_SHA" && git checkout -q FETCH_HEAD + - name: Check generated sources are current + working-directory: src + run: | + set -euo pipefail + scripts/gen-runbooks.sh --check + scripts/gen-issue-forms.sh --check + scripts/sync-wiki.sh --check + - name: Publish to the wiki + if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' + working-directory: src + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + scripts/sync-wiki.sh --publish "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.wiki.git" diff --git a/.hypatia-ignore b/.hypatia-ignore index 7b2aec00..c7a493dc 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/ai/PLACEHOLDERS.adoc b/.machine_readable/ai/PLACEHOLDERS.adoc deleted file mode 100644 index a2ba9875..00000000 --- a/.machine_readable/ai/PLACEHOLDERS.adoc +++ /dev/null @@ -1,189 +0,0 @@ -// SPDX-License-Identifier: CC-BY-SA-4.0 -// Copyright (c) Jonathan D.A. Jewell -= Template Placeholders -# Template Placeholders - -All placeholders in this template follow the `{{PLACEHOLDER}}` pattern. -After cloning, replace them with your project-specific values. - -## Recommended: Interactive Bootstrap - -```bash -just repo-init -``` - -This interactively prompts for all values, replaces every placeholder, -validates the result, and runs k9-svc checks if available. - -## Manual Replace - -```bash -# If you prefer manual replacement (run from repo root) - -sed -i 's/{{AUTHOR}}/Jane Doe/g' $(grep -rl '{{AUTHOR}}' .) -sed -i 's/{{AUTHOR_EMAIL}}/jane@example.org/g' $(grep -rl '{{AUTHOR_EMAIL}}' .) -sed -i 's/{{OWNER}}/my-org/g' $(grep -rl '{{OWNER}}' .) -sed -i 's/{{PROJECT_NAME}}/My Project/g' $(grep -rl '{{PROJECT_NAME}}' .) -sed -i 's/{{PROJECT}}/MY_PROJECT/g' $(grep -rl '{{PROJECT}}' .) -sed -i 's/{{project}}/my_project/g' $(grep -rl '{{project}}' .) -sed -i 's/{{REPO}}/my-project/g' $(grep -rl '{{REPO}}' .) -sed -i 's/{{FORGE}}/github.com/g' $(grep -rl '{{FORGE}}' .) -sed -i "s/{{CURRENT_YEAR}}/$(date +%Y)/g" $(grep -rl '{{CURRENT_YEAR}}' .) -sed -i "s/{{CURRENT_DATE}}/$(date +%Y-%m-%d)/g" $(grep -rl '{{CURRENT_DATE}}' .) -``` - -## Placeholder Reference - -### Author & Copyright - -| Placeholder | Description | Example | Files | -|---|---|---|---| -| `{{AUTHOR}}` | Full legal name | `Jane Doe` | SPDX headers (all files), MAINTAINERS.md, .mailmap, .reuse/dep5, docs/AI-CONVENTIONS.md | -| `{{AUTHOR_EMAIL}}` | Primary contact email | `jane@example.org` | SPDX headers (all files), .mailmap, .reuse/dep5, www/.well-known/humans.txt | -| `{{AUTHOR_EMAIL_ALT}}` | Previous/secondary email (for .mailmap) | `old@example.com` | .mailmap | -| `{{AUTHOR_ORG}}` | Author's organization/affiliation | `Acme University` | project-metadata.k9.ncl | -| `{{AUTHOR_LAST}}` | Author surname (for citations) | `Doe` | docs/CITATIONS.adoc | -| `{{AUTHOR_FIRST}}` | Author first name (for citations) | `Jane` | docs/CITATIONS.adoc | -| `{{AUTHOR_INITIALS}}` | Author initials (for citations) | `J.` | docs/CITATIONS.adoc | -| `{{AUTHOR_ORCID}}` | Author ORCID iD, bare form; blank drops the line (default: `git config user.orcid`) | `0000-0002-1825-0097` | CITATION.cff | - -### Project Identity - -Three DIFFERENT things are named "the project" and they are three different -tokens. Conflating them is how a repository ends up with a display name where an -identifier belongs: - -* `{{PROJECT_NAME}}` — what a human reads: spaces, capitals, punctuation. -* `{{PROJECT}}` / `{{project}}` — what a compiler reads: an identifier, so no - spaces and no hyphens. `{{PROJECT}}` is the uppercase form (Idris2 modules, C - macros); `{{project}}` is the lowercase form (C symbols, file names, crate - and module names). -* `{{REPO}}` — what a forge reads: the repository slug. - -They may look alike today (`My Project` / `MY_PROJECT` / `my_project` / -`my-project`) and they are still four tokens, because each is filled from a -different answer in `just repo-init`. A file that needs all four needs all four. - -| Placeholder | Description | Example | Files | -|---|---|---|---| -| `{{PROJECT_NAME}}` | Human-readable project name | `My Project` | SECURITY.md, CODE_OF_CONDUCT.md, TOPOLOGY.md, docs/status/ROADMAP.adoc (via build/templates/ROADMAP.adoc.in), Justfile, GOVERNANCE.md, MAINTAINERS.md, devcontainer.json | -| `{{PROJECT_DESCRIPTION}}` | One-line description | `A tool for X` | README.adoc, CITATION.cff, the repo deed | -| `{{PROJECT}}` | Uppercase identifier (for Idris2 modules, C macros) | `MY_PROJECT` | ABI-FFI-README.md, src/interface/abi/*.idr, src/interface/ffi/*.zig | -| `{{project}}` | Lowercase identifier (for C symbols, filenames) | `my_project` | ABI-FFI-README.md, src/interface/ffi/*.zig | -| `{{REPO}}` | Repository name (slug) | `my-project` | CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md, cliff.toml | -| `{{OWNER}}` | GitHub/GitLab org or username | `my-org` | SPDX headers, CONTRIBUTING.md, SECURITY.md, GOVERNANCE.md, MAINTAINERS.md, CODEOWNERS, mirror.yml, cliff.toml | -| `{{FORGE}}` | Git forge domain | `github.com` | CONTRIBUTING.md | - -### Dates - -| Placeholder | Description | Example | Files | -|---|---|---|---| -| `{{CURRENT_YEAR}}` | Current year | `2026` | SPDX headers (all files), GOVERNANCE.md, MAINTAINERS.md | -| `{{CURRENT_DATE}}` | Current date (ISO) | `2026-02-14` | `*_chora.deed` (via build/templates/identity.deed.in), MAINTAINERS.md | -| `{{DATE}}` | Last updated date | `2026-02-14` | TOPOLOGY.md, THREAT-MODEL.md | - -### Contact & Security - -| Placeholder | Description | Example | Files | -|---|---|---|---| -| `{{SECURITY_EMAIL}}` | Security contact email | `security@example.org` | SECURITY.md | -| `{{PGP_FINGERPRINT}}` | 40-char PGP fingerprint | `ABCD 1234 ...` | SECURITY.md | -| `{{PGP_KEY_URL}}` | URL to public PGP key | `https://keys.openpgp.org/...` | SECURITY.md | -| `{{WEBSITE}}` | Project website | `https://example.org` | SECURITY.md | -| `{{CONDUCT_EMAIL}}` | Conduct reports email | `conduct@example.org` | CODE_OF_CONDUCT.md | -| `{{CONDUCT_TEAM}}` | Conduct committee name | `Code of Conduct Committee` | CODE_OF_CONDUCT.md | -| `{{RESPONSE_TIME}}` | SLA for initial response | `48 hours` | CODE_OF_CONDUCT.md | - -### Git - -| Placeholder | Description | Example | Files | -|---|---|---|---| -| `{{MAIN_BRANCH}}` | Main branch name | `main` | CONTRIBUTING.md | - -### Build - -| Placeholder | Description | Example | Files | -|---|---|---|---| -| `{{LICENSE}}` | License name | `MPL-2.0` | ABI-FFI-README.md | -| `{{PROJECT_PURPOSE}}` | One-line project description | `FFI bridges between languages` | `*_chora.deed` `(anchor (identity))` :one-sentence (set from `{{PROJECT_DESCRIPTION}}` by `just repo-init`) | -| `{{OPENSSF_BP_ID}}` | OpenSSF Best Practices numeric project ID (from registering at bestpractices.dev). Optional — leave blank until registered; `just repo-init` then surfaces it in the post-init "remaining placeholders" notice as a reminder. | `1234` | README.adoc (OpenSSF Best Practices badge) | - -### Project Content & Onboarding (manual-fill, post-init) - -These tokens carry free-form, per-project content that the interactive -`just repo-init` bootstrap does **not** prompt for (you cannot sensibly answer -"required invariants" in a 30-second bootstrap). Like the `{{PGP_*}}` tokens, -fill them by hand after `init`; the post-init "remaining placeholders" notice -surfaces any left unfilled. - -| Placeholder | Description | Example | Files | -|---|---|---|---| -| `{{PACKAGE_NAME}}` | Package / module name (slug) | `my-project` | docs/onboarding/QUICKSTART-MAINTAINER.adoc | -| `{{DESCRIPTION}}` | Short repo description (forge metadata) | `A tool for X` | .github/settings.yml | -| `{{LANG_STACK}}` | Language / toolchain stack | `Idris2 + Zig` | docs/onboarding/QUICKSTART-DEV.adoc | -| `{{BUILD_CMD}}` | Build command | `just build` | docs/onboarding/QUICKSTART-DEV.adoc | -| `{{TEST_CMD}}` | Test command | `just test` | docs/onboarding/QUICKSTART-DEV.adoc | -| `{{BUILD_OUTPUT_PATH}}` | Build artefact output path | `build/` | docs/onboarding/QUICKSTART-MAINTAINER.adoc | -| `{{DEPS}}` | Project dependencies summary | `Idris2 0.7, Zig 0.13` | docs/onboarding/QUICKSTART-MAINTAINER.adoc | -| `{{MUST_INVARIANTS}}` | Required project invariants | `no believe_me; totality on` | docs/onboarding/QUICKSTART-DEV.adoc | -| `{{MAIN_FUNCTION}}` | Primary function / purpose | `FFI bridge generation` | no file in this template (the retired Intentfile is now `.machine_readable/contractiles/intend/intend.k9.ncl`, which does not carry the token) | -| `{{TARGET_AUDIENCE}}` | Intended audience | `library authors` | no file in this template (the retired Intentfile is now `.machine_readable/contractiles/intend/intend.k9.ncl`, which does not carry the token) | -| `{{EXPECTED_AUTHOR}}` | Expected author identity (trust anchor) | `hyperpolymath` | no file in this template (the retired Trustfile is now `.machine_readable/contractiles/trust/trust.k9.ncl`, which does not carry the token) | -| `{{PROJECT_UNIQUE_STRENGTH}}` | What this project does better than alternatives | `proof-carrying FFI` | `*_chora.deed` `(bot-directives (methodology (methodology (unique-strength))))` :description | -| `{{PROJECT_KIND}}` | Project kind / category | `library` | `*_chora.deed` `(anchor (identity))` :kind | -| `{{PROJECT_DOMAIN}}` | Project domain | `formal-methods` | `*_chora.deed` `(anchor (identity))` :domain | -| `{{OPENSSF_PROJECT_ID}}` | OpenSSF Best Practices project ID (same value as `{{OPENSSF_BP_ID}}`) | `1234` | docs/governance/TEMPLATE-STANDARDS-AUDIT.adoc | - -### Repo deed (folded family-7 allocation manifest) - -| Placeholder | Description | Example | Files | -|---|---|---|---| -| `[YOUR-REPO-NAME]` | Repository name | `my-project` | `*_chora.deed` (repo deed) | -| `[YOUR-NAME/ORG]` | Maintainer name | `hyperpolymath` | `*_chora.deed` (repo deed) | - -(`[DATE]` was listed here for the root AI manifest but no file ever carried the -literal token — row removed with the fold; standards#837 pilot.) - -### AI Installation Guide - -| Marker | Description | Files | -|---|---|---| -| `[TODO-AI-INSTALL]` | Unfilled section in AI installation guide | `docs/AI_INSTALLATION_GUIDE.adoc`, `docs/AI-INSTALL-README-SECTION.adoc`, `README.adoc` | - -These are **not** standard `{{PLACEHOLDER}}` markers -- they are TODO markers -that must be replaced with project-specific content before release. They mark -sections where the developer (or AI) must fill in: - -- What questions the AI should ask the user -- Exact prerequisite check and install commands -- Privacy notice specific to this project -- Complete installation command block -- Credential setup instructions (URLs, scopes, env vars) -- Verification commands and expected output -- Error handling table -- Example conversation - -**finishbot checks:** `just validate-ai-install` verifies no `[TODO-AI-INSTALL]` markers remain. - -## Deletion Markers - -Some files contain deletion instructions: - -| Marker | Meaning | File | -|---|---|---| -| `{{~ ... ~}}` | Delete this entire line after reading | ABI-FFI-README.md (line 1) | - -## Verification - -After replacing all placeholders, verify none remain: - -```bash -grep -rn '{{' . --include='*.md' --include='*.adoc' --include='*.deed' \ - --include='*.scm' --include='*.idr' --include='*.zig' --include='*.res' \ - --include='Justfile' --include='*.nix' --include='*.toml' --include='*.yml' \ - --include='*.yaml' --include='*.hs' --include='*.ncl' --include='*.txt' \ - --include='*.json' --include='Containerfile' --include='dep5' \ - | grep -v 'PLACEHOLDERS.md' | grep -v 'node_modules' -``` - -If the above command produces no output, all placeholders have been replaced. diff --git a/.machine_readable/coaptation/coapt.ncl b/.machine_readable/coaptation/coapt.ncl index 3b05b597..4e94b696 100644 --- a/.machine_readable/coaptation/coapt.ncl +++ b/.machine_readable/coaptation/coapt.ncl @@ -139,8 +139,8 @@ let contractile_prov = "intend@%{cp.intend} must@%{cp.must} trust@%{cp.trust} ad let descriptile_prov = "deed@%{fp.deed} anchor@%{fp.anchor}" in # repo name comes from the repo deed, not a hardcoded literal — this -# script is shared verbatim by every repo instantiated from rsr-template-repo, -# so a literal "rsr-template-repo" here would misreport every one of them. +# script is shared verbatim by every repo instantiated from idris2x, +# so a literal "idris2x" here would misreport every one of them. let repo_name = (lookup "clade.canonical-name").value in let s = std.to_string in diff --git a/.machine_readable/coaptation/coapt.sh b/.machine_readable/coaptation/coapt.sh index 0e503666..e829bd94 100755 --- a/.machine_readable/coaptation/coapt.sh +++ b/.machine_readable/coaptation/coapt.sh @@ -46,7 +46,7 @@ case "$MODE" in basis="$CO/receipts/reanchor-basis.toml" # repo name from the repo deed, not a hardcoded literal — this # script is shared verbatim by every repo instantiated from - # rsr-template-repo, so a literal "rsr-template-repo" here would + # idris2x, so a literal "idris2x" here would # misreport every one of them. repo_name="$(bash "$ROOT/scripts/deed-field.sh" "$(bash "$ROOT/scripts/deed-field.sh" --find "$ROOT")" "" canonical-name)" { diff --git a/.machine_readable/coaptation/receipts/latest.toml b/.machine_readable/coaptation/receipts/latest.toml index 21eb4bf8..c2992d5e 100644 --- a/.machine_readable/coaptation/receipts/latest.toml +++ b/.machine_readable/coaptation/receipts/latest.toml @@ -5,7 +5,7 @@ [receipt] schema = "hyperpolymath.coaptation/1" -repo = "rsr-template-repo" +repo = "idris2x" band = "amber" proposed-action = "advisory — soft drift within bands (posture/intend). Open an advisory issue; no re-anchor." diff --git a/.machine_readable/coaptation/witness-map.ncl b/.machine_readable/coaptation/witness-map.ncl index a272b1df..854eeac9 100644 --- a/.machine_readable/coaptation/witness-map.ncl +++ b/.machine_readable/coaptation/witness-map.ncl @@ -60,12 +60,12 @@ }, # --- ADJUST: accessibility/hygiene posture (advisory; never gates) --- - # The ANCHOR identity block still carries {{PROJECT_NAME}}; for the template + # The ANCHOR identity block still carries idris2x; for the template # itself that is expected, but it is honestly a posture dip worth surfacing. "adjust.placeholder-drift" = { kind = "descriptile", witnesses = [{ fact = "anchor.project", op = 'not_contains, arg = "{{" }], - note = "deed (anchor (identity :project)) is un-substituted ({{PROJECT_NAME}}) ⇒ posture dip", + note = "deed (anchor (identity :project)) is un-substituted (idris2x) ⇒ posture dip", }, # --- BUST: deliberately NO descriptile witness since rsr-template-repo#209. --- diff --git a/.machine_readable/compliance/reuse/dep5 b/.machine_readable/compliance/reuse/dep5 index 637157cd..d2397819 100644 --- a/.machine_readable/compliance/reuse/dep5 +++ b/.machine_readable/compliance/reuse/dep5 @@ -1,56 +1,56 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: {{PROJECT_NAME}} -Upstream-Contact: {{AUTHOR}} <{{AUTHOR_EMAIL}}> -Source: https://github.com/{{OWNER}}/{{REPO}} +Upstream-Name: idris2x +Upstream-Contact: Jonathan D.A. Jewell +Source: https://github.com/metadatastician/idris2x # Default: all files are MPL-2.0 Files: * -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (metadatastician) License: MPL-2.0 # Configuration files that cannot carry headers Files: .editorconfig .gitignore .gitattributes .tool-versions .mailmap -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (metadatastician) License: MPL-2.0 # Machine-readable state files Files: .machine_readable/*.a2ml -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (metadatastician) License: MPL-2.0 # Bot directives Files: .machine_readable/bot_directives/* -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (metadatastician) License: MPL-2.0 # Contractiles Files: .machine_readable/contractiles/* -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (metadatastician) License: MPL-2.0 # GitHub/CI configuration Files: .github/* .github/**/* -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (metadatastician) License: MPL-2.0 # Generated files Files: generated/* -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (metadatastician) License: MPL-2.0 # Lockfiles and auto-generated Files: *.lock Cargo.lock flake.lock -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (metadatastician) License: MPL-2.0 # Devcontainer config (JSON, no comments) Files: .devcontainer/*.json -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (metadatastician) License: MPL-2.0 # Git-cliff config Files: cliff.toml -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (metadatastician) License: MPL-2.0 # Narrative documentation is CC-BY-SA-4.0 (estate Rule 1). @@ -58,5 +58,5 @@ License: MPL-2.0 # including the GitHub community-health .md files. Machine-readable .a2ml is a # different extension and stays MPL-2.0 per its stanza above. Files: *.adoc *.md -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (metadatastician) License: CC-BY-SA-4.0 diff --git a/.machine_readable/configs/eclexiaiser.toml b/.machine_readable/configs/eclexiaiser.toml index abc542ed..45fc6c0d 100644 --- a/.machine_readable/configs/eclexiaiser.toml +++ b/.machine_readable/configs/eclexiaiser.toml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: MPL-2.0 [project] -name = "{{REPO}}" +name = "idris2x" [[functions]] name = "build" diff --git a/.machine_readable/configs/git-cliff/cliff.toml b/.machine_readable/configs/git-cliff/cliff.toml index 5c39b484..28fb7eb3 100644 --- a/.machine_readable/configs/git-cliff/cliff.toml +++ b/.machine_readable/configs/git-cliff/cliff.toml @@ -1,12 +1,12 @@ # SPDX-License-Identifier: MPL-2.0 -# Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +# Copyright (c) 2026 Jonathan D.A. Jewell (metadatastician) # # git-cliff configuration for conventional commit changelog generation. # https://git-cliff.org/docs/configuration # # Placeholders — replace before first use: -# {{OWNER}} — GitHub organization or username -# {{REPO}} — GitHub repository name +# metadatastician — GitHub organization or username +# idris2x — GitHub repository name [changelog] # Changelog header @@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # https://keats.github.io/tera/docs/#introduction body = """ {%- macro remote_url() -%} - https://github.com/{{OWNER}}/{{REPO}} + https://github.com/metadatastician/idris2x {%- endmacro -%} {% if version -%} @@ -57,7 +57,7 @@ body = """ # Template for the changelog footer footer = """ {%- macro remote_url() -%} - https://github.com/{{OWNER}}/{{REPO}} + https://github.com/metadatastician/idris2x {%- endmacro -%} {% for release in releases -%} diff --git a/.machine_readable/configs/stapeln.toml b/.machine_readable/configs/stapeln.toml index 7bf5d48d..20b1f3ed 100644 --- a/.machine_readable/configs/stapeln.toml +++ b/.machine_readable/configs/stapeln.toml @@ -1,16 +1,16 @@ # SPDX-License-Identifier: MPL-2.0 -# stapeln.toml — Layer-based container build for {{SERVICE_NAME}} +# stapeln.toml — Layer-based container build for idris2x # # stapeln builds containers as composable layers (German: "to stack"). # Each layer is independently cacheable, verifiable, and signable. [metadata] -name = "{{SERVICE_NAME}}" +name = "idris2x" version = "0.1.0" -description = "{{SERVICE_NAME}} container service" +description = "idris2x container service" author = "Jonathan D.A. Jewell " license = "MPL-2.0" -registry = "{{REGISTRY}}" +registry = "ghcr.io/metadatastician" [build] containerfile = "Containerfile" @@ -32,7 +32,7 @@ packages = [] cache = true [layers.build] -description = "{{SERVICE_NAME}} build" +description = "idris2x build" extends = "toolchain" commands = [] @@ -43,7 +43,7 @@ packages = ["ca-certificates", "curl"] copy-from = [ { layer = "build", src = "/app/", dst = "/app/" }, ] -entrypoint = ["/app/{{SERVICE_NAME}}"] +entrypoint = ["/app/idris2x"] user = "nonroot" # ── Security ─────────────────────────────────────────────────── diff --git a/.machine_readable/contractiles/Justfile b/.machine_readable/contractiles/Justfile index d54df313..e2f032a1 100644 --- a/.machine_readable/contractiles/Justfile +++ b/.machine_readable/contractiles/Justfile @@ -22,9 +22,9 @@ import? "build/contractile.just" mod provision 'build/just/provision.just' # Project metadata — customize these -project := "rsr-template-repo" +project := "idris2x" OWNER := "hyperpolymath" -REPO := "rsr-template-repo" +REPO := "idris2x" version := "0.1.0" tier := "infrastructure" # 1 | 2 | infrastructure @@ -574,7 +574,7 @@ opsm: provision::opsm # Guided tour of key features tour: - @echo "=== rsr-template-repo Tour ===" + @echo "=== idris2x Tour ===" @echo "" @echo "1. Project structure:" @ls -la @@ -589,12 +589,12 @@ tour: # Open feedback channel with diagnostic context help-me: - @echo "=== rsr-template-repo Help ===" + @echo "=== idris2x Help ===" @echo "Platform: $(uname -s) $(uname -m)" @echo "Shell: $SHELL" @echo "" @echo "To report an issue:" - @echo " https://github.com/hyperpolymath/rsr-template-repo/issues/new" + @echo " https://github.com/metadatastician/idris2x/issues/new" @echo "" @echo "Include the output of 'just doctor' in your report." diff --git a/.machine_readable/contractiles/README.adoc b/.machine_readable/contractiles/README.adoc index 0006f5bd..3b8f034b 100644 --- a/.machine_readable/contractiles/README.adoc +++ b/.machine_readable/contractiles/README.adoc @@ -5,7 +5,7 @@ :sectnums: This directory contains the canonical contractile templates for the -hyperpolymath estate. `rsr-template-repo` mirrors the standards master +hyperpolymath estate. `idris2x` mirrors the standards master structure; copy `.machine_readable/contractiles/` into a new repo to establish a consistent operational, validation, trust, recovery, aspiration, and service-automation framework. diff --git a/.machine_readable/contractiles/adjust/adjust.k9.ncl b/.machine_readable/contractiles/adjust/adjust.k9.ncl index 267c7d83..9e3488ff 100644 --- a/.machine_readable/contractiles/adjust/adjust.k9.ncl +++ b/.machine_readable/contractiles/adjust/adjust.k9.ncl @@ -79,7 +79,7 @@ let base = import "../_base.ncl" in signed_by = { user = "Jonathan D.A. Jewell", date = "2026-04-18", - context = "adjust trident — canonical template in rsr-template-repo. (Yard, advisory) authority pattern. Specialises in cumulative-drift catchment — tolerance bands + trend tracking + auto-fix-where-declared. Advisory (continue-with-warnings). Copy this trident into a new repo and define its drift tolerances and corrective actions.", + context = "adjust trident — canonical template in idris2x. (Yard, advisory) authority pattern. Specialises in cumulative-drift catchment — tolerance bands + trend tracking + auto-fix-where-declared. Advisory (continue-with-warnings). Copy this trident into a new repo and define its drift tolerances and corrective actions.", }, history = [ { date = "2026-04-18", event = "trident-born", note = "Adjustfile.a2ml and adjust.ncl pre-existed. This manifest + adjust.k9.ncl complete the trident. Exercises the Yard tier + advisory authority for the first time; on_exceeded = 'warn_and_attempt_fix rather than 'fail. adjust-specific track_drift_trend_over_sessions + flag_accelerating_drift." }, @@ -97,8 +97,8 @@ let base = import "../_base.ncl" in # Read by .machine_readable/coaptation/extract-clauses.sh. # ------------------------------------------------------------------- declaration = { - preamble = "# SPDX-License-Identifier: MPL-2.0\n# Adjustfile — Drift-tolerance contract for rsr-template-repo\n# Author: Jonathan D.A. Jewell \n#\n# Cumulative-drift catchment: tolerance bands + corrective actions.\n# Authority: advisory (Yard) — continue-with-warnings; auto_fix where deterministic.\n# Run with: adjust check\n# Fix with: adjust fix (applies deterministic patches; advisory otherwise)\n", - abstract = "Drift tolerances and corrective actions for rsr-template-repo. Unlike\nMUST (hard gate), ADJUST tracks cumulative drift against tolerance bands\nand proposes corrective actions. Advisory — it warns and trends, it does\nnot block.", + preamble = "# SPDX-License-Identifier: MPL-2.0\n# Adjustfile — Drift-tolerance contract for idris2x\n# Author: Jonathan D.A. Jewell \n#\n# Cumulative-drift catchment: tolerance bands + corrective actions.\n# Authority: advisory (Yard) — continue-with-warnings; auto_fix where deterministic.\n# Run with: adjust check\n# Fix with: adjust fix (applies deterministic patches; advisory otherwise)\n", + abstract = "Drift tolerances and corrective actions for idris2x. Unlike\nMUST (hard gate), ADJUST tracks cumulative drift against tolerance bands\nand proposes corrective actions. Advisory — it warns and trends, it does\nnot block.", prose = [ ], requirements = [ diff --git a/.machine_readable/contractiles/bust/bust.k9.ncl b/.machine_readable/contractiles/bust/bust.k9.ncl index 2e94cc21..39ffc552 100644 --- a/.machine_readable/contractiles/bust/bust.k9.ncl +++ b/.machine_readable/contractiles/bust/bust.k9.ncl @@ -81,7 +81,7 @@ let base = import "../_base.ncl" in signed_by = { user = "Jonathan D.A. Jewell", date = "2026-04-18", - context = "bust trident — canonical template in rsr-template-repo. Completes the blocking-authority triple (must + trust + bust). Specialises in deprecated-path-reintroduction catchment. Declares hard-stop / expiry / must-not-run conditions. Copy this trident into a new repo and declare its real breakage / expiry conditions.", + context = "bust trident — canonical template in idris2x. Completes the blocking-authority triple (must + trust + bust). Specialises in deprecated-path-reintroduction catchment. Declares hard-stop / expiry / must-not-run conditions. Copy this trident into a new repo and declare its real breakage / expiry conditions.", }, history = [ { date = "2026-04-18", event = "trident-born", note = "Bustfile.a2ml and bust.ncl pre-existed. This manifest + bust.k9.ncl complete the trident. Inherits the full negotiation+accountability schema from intend.k9.ncl v2.0.0 + trust/must extensions; adds flag_deprecated_reintroduction for C2-defense specificity." }, @@ -99,8 +99,8 @@ let base = import "../_base.ncl" in # Read by .machine_readable/coaptation/extract-clauses.sh. # ------------------------------------------------------------------- declaration = { - preamble = "# SPDX-License-Identifier: MPL-2.0\n# Bustfile — failure mode contractile for rsr-template-repo\n# Author: Jonathan D.A. Jewell \n#\n# Paired runner: bust.ncl\n# Verb: bust\n# Semantics: Every declared failure mode must have a working recovery path\n# that has been exercised. Status moves:\n# declared → drilled (probe run) → verified (recovery confirmed)\n# or → failing (recovery broken)\n#\n# CLI:\n# contractile bust check → list failure modes + recovery status\n# contractile bust drill → inject failures, verify recovery paths\n#\n# This repository: rsr-template-repo is the canonical template for RSR compliance.\n# Failure modes here relate to template distribution and substitution.\n", - abstract = "Bustfile for rsr-template-repo. Lists failure modes specific to the template\nrepository itself, particularly around template distribution, substitution,\nand synchronization across the hyperpolymath estate.", + preamble = "# SPDX-License-Identifier: MPL-2.0\n# Bustfile — failure mode contractile for idris2x\n# Author: Jonathan D.A. Jewell \n#\n# Paired runner: bust.ncl\n# Verb: bust\n# Semantics: Every declared failure mode must have a working recovery path\n# that has been exercised. Status moves:\n# declared → drilled (probe run) → verified (recovery confirmed)\n# or → failing (recovery broken)\n#\n# CLI:\n# contractile bust check → list failure modes + recovery status\n# contractile bust drill → inject failures, verify recovery paths\n#\n# This repository: idris2x is the canonical template for RSR compliance.\n# Failure modes here relate to template distribution and substitution.\n", + abstract = "Bustfile for idris2x. Lists failure modes specific to the template\nrepository itself, particularly around template distribution, substitution,\nand synchronization across the hyperpolymath estate.", prose = [ ], failure_modes = [ @@ -109,7 +109,7 @@ let base = import "../_base.ncl" in section = "Failure Modes", class = 'template_processing, description = "Template substitution fails when initializing a new repo from this template", - injection_probe = "cp -r rsr-template-repo test-repo && cd test-repo && sed -i 's/rsr-template-repo/TEST/g' .machine_readable/contractiles/intend/intend.k9.ncl && grep -q 'TEST' .machine_readable/contractiles/intend/intend.k9.ncl", + injection_probe = "cp -r idris2x test-repo && cd test-repo && sed -i 's/idris2x/TEST/g' .machine_readable/contractiles/intend/intend.k9.ncl && grep -q 'TEST' .machine_readable/contractiles/intend/intend.k9.ncl", recovery_probe = "git -C test-repo diff --quiet .machine_readable/contractiles/intend/intend.k9.ncl", expected_recovery_time_seconds = 10, status = 'declared, @@ -119,7 +119,7 @@ let base = import "../_base.ncl" in id = "sync-drift-between-repos", section = "Failure Modes", class = 'synchronization, - description = "Drift occurs between rsr-template-repo and other repos after template updates", + description = "Drift occurs between idris2x and other repos after template updates", injection_probe = "echo 'template_updated' > /tmp/test_drift_marker", recovery_probe = "test -f /tmp/test_drift_marker && rm /tmp/test_drift_marker", expected_recovery_time_seconds = 60, @@ -131,8 +131,8 @@ let base = import "../_base.ncl" in section = "Failure Modes", class = 'contractile_format, description = "A contractile file fails to parse due to syntax errors", - injection_probe = "echo 'invalid syntax' >> rsr-template-repo/.machine_readable/contractiles/intend/intend.k9.ncl", - recovery_probe = "git checkout rsr-template-repo/.machine_readable/contractiles/intend/intend.k9.ncl", + injection_probe = "echo 'invalid syntax' >> idris2x/.machine_readable/contractiles/intend/intend.k9.ncl", + recovery_probe = "git checkout idris2x/.machine_readable/contractiles/intend/intend.k9.ncl", expected_recovery_time_seconds = 5, status = 'declared, notes = "Every .k9.ncl must typecheck; validate with .github/hooks/validate-k9.sh and nickel typecheck", diff --git a/.machine_readable/contractiles/dust/dust.k9.ncl b/.machine_readable/contractiles/dust/dust.k9.ncl index 7a8284c9..ba3ff5b0 100644 --- a/.machine_readable/contractiles/dust/dust.k9.ncl +++ b/.machine_readable/contractiles/dust/dust.k9.ncl @@ -90,7 +90,7 @@ let base = import "../_base.ncl" in signed_by = { user = "Jonathan D.A. Jewell", date = "2026-04-18", - context = "dust trident — canonical template in rsr-template-repo. Specialises in audit-trail preservation + rollback-path verification. Yard tier with destructive-action gating (dry-run default; --apply + per-item approval required for mutations). Copy this trident into a new repo and describe how it actually rolls back or retires behaviour.", + context = "dust trident — canonical template in idris2x. Specialises in audit-trail preservation + rollback-path verification. Yard tier with destructive-action gating (dry-run default; --apply + per-item approval required for mutations). Copy this trident into a new repo and describe how it actually rolls back or retires behaviour.", }, history = [ { date = "2026-04-18", event = "trident-born", note = "Dustfile.a2ml and dust.ncl pre-existed. This manifest + dust.k9.ncl complete the trident and the full verb set. All 6 verbs now on trident shape: intend (Hunt, reporting), trust (Hunt, blocking), must (Hunt-read-only, blocking), bust (Hunt-read-only, blocking), adjust (Yard, advisory), dust (Yard, advisory)." }, @@ -109,8 +109,8 @@ let base = import "../_base.ncl" in # Read by .machine_readable/coaptation/extract-clauses.sh. # ------------------------------------------------------------------- declaration = { - preamble = "# SPDX-License-Identifier: MPL-2.0\n# Dustfile — Cleanup and hygiene contract for rsr-template-repo\n# Author: Jonathan D.A. Jewell \n#\n# Paired runner: dust.ncl\n# Verb: dust\n# Semantics: What should be cleaned up. Housekeeping, not blockers.\n#\n# This repository: rsr-template-repo is the canonical template.\n# Cleanup items here ensure the template itself remains pristine.\n", - abstract = "Cleanup and hygiene items for rsr-template-repo. These are maintenance tasks\nthat ensure the template repository remains clean and ready for distribution\nto new repositories.", + preamble = "# SPDX-License-Identifier: MPL-2.0\n# Dustfile — Cleanup and hygiene contract for idris2x\n# Author: Jonathan D.A. Jewell \n#\n# Paired runner: dust.ncl\n# Verb: dust\n# Semantics: What should be cleaned up. Housekeeping, not blockers.\n#\n# This repository: idris2x is the canonical template.\n# Cleanup items here ensure the template itself remains pristine.\n", + abstract = "Cleanup and hygiene items for idris2x. These are maintenance tasks\nthat ensure the template repository remains clean and ready for distribution\nto new repositories.", prose = [ ], removal_candidates = [ @@ -156,10 +156,10 @@ let base = import "../_base.ncl" in { id = "no-stale-template-references", section = "Template Hygiene", - description = "No references to rsr-template-repo in generic template files", - probe = "test -z \"$(grep -r 'rsr-template-repo' machine-readable-design/ 2>/dev/null)\"", + description = "No references to idris2x in generic template files", + probe = "test -z \"$(grep -r 'idris2x' machine-readable-design/ 2>/dev/null)\"", severity = 'warning, - notes = "Generic templates should use {{PROJECT_NAME}} or similar placeholders", + notes = "Generic templates should use idris2x or similar placeholders", }, { id = "version-sync-checked", diff --git a/.machine_readable/contractiles/intend/intend.k9.ncl b/.machine_readable/contractiles/intend/intend.k9.ncl index 0765dc51..45598181 100644 --- a/.machine_readable/contractiles/intend/intend.k9.ncl +++ b/.machine_readable/contractiles/intend/intend.k9.ncl @@ -94,7 +94,7 @@ let base = import "../_base.ncl" in signed_by = { user = "Jonathan D.A. Jewell", date = "2026-04-18", - context = "intend trident — canonical template in rsr-template-repo. North-star verb: reports progress toward committed next-actions ([[intents]]) and lists horizon aspirations ([[wishes]]). Non-gating (reporting authority). Copy this trident into a new repo and replace the declaration with project-specific content.", + context = "intend trident — canonical template in idris2x. North-star verb: reports progress toward committed next-actions ([[intents]]) and lists horizon aspirations ([[wishes]]). Non-gating (reporting authority). Copy this trident into a new repo and replace the declaration with project-specific content.", }, history = [ { date = "2026-04-18", event = "trident-born", note = "intend/Intentfile.a2ml pre-existed (f380b62, lust absorption). This manifest + intend.k9.ncl complete the trident for the first time." }, @@ -113,7 +113,7 @@ let base = import "../_base.ncl" in # Read by .machine_readable/coaptation/extract-clauses.sh. # ------------------------------------------------------------------- declaration = { - preamble = "# SPDX-License-Identifier: MPL-2.0\n# Intentfile — north-star contractile for rsr-template-repo\n# Author: Jonathan D.A. Jewell \n#\n" + preamble = "# SPDX-License-Identifier: MPL-2.0\n# Intentfile — north-star contractile for idris2x\n# Author: Jonathan D.A. Jewell \n#\n" ++ "# Paired runner: intend.ncl\n# Verb: intend\n#\n# Semantics: North-star contractile. Declares BOTH concrete committed\n" ++ "# next-actions AND horizon aspirations the project wishes to\n# become. Two sections share one file because they answer\n" ++ "# the same question at different ranges:\n# [[intents]] — \"we WILL do this; track progress\"\n" @@ -121,11 +121,11 @@ let base = import "../_base.ncl" in ++ "# [[wishes]] — \"we WISH this were true; revisit later\"\n# status: declared → in_progress → achieved |\n" ++ "# abandoned\n# grouped by horizon: near / mid / far.\n" ++ "# Non-gating — this is a report, not a gate. See the `must`\n# contractile for hard gates.\n", - abstract = "North-star contractile for rsr-template-repo. This repository is the\ncanonical template for Rhodium Standard Repository compliance. It provides\nthe scaffold that all hyperpolymath repos should copy and customize.", + abstract = "North-star contractile for idris2x. This repository is the\ncanonical template for Rhodium Standard Repository compliance. It provides\nthe scaffold that all hyperpolymath repos should copy and customize.", prose = [ { section = "Purpose", - text = "The rsr-template-repo serves as the master template for all hyperpolymath\nrepositories. It contains the complete set of contractile files, machine-readable\nspecifications, and governance documentation that define the Rhodium Standard.\n\nEvery new repository in the hyperpolymath estate should be initialized by\ncopying this template and substituting the placeholder values with\nrepo-specific content.", + text = "The idris2x serves as the master template for all hyperpolymath\nrepositories. It contains the complete set of contractile files, machine-readable\nspecifications, and governance documentation that define the Rhodium Standard.\n\nEvery new repository in the hyperpolymath estate should be initialized by\ncopying this template and substituting the placeholder values with\nrepo-specific content.", }, { section = "Anti-Purpose", diff --git a/.machine_readable/contractiles/must/must.k9.ncl b/.machine_readable/contractiles/must/must.k9.ncl index 7ce7f67e..d8cf5dff 100644 --- a/.machine_readable/contractiles/must/must.k9.ncl +++ b/.machine_readable/contractiles/must/must.k9.ncl @@ -106,7 +106,7 @@ let base = import "../_base.ncl" in signed_by = { user = "Jonathan D.A. Jewell", date = "2026-04-18", - context = "must trident — canonical template in rsr-template-repo. Blocking-authority verb (paired with trust). Specialises in subtle invariant-erosion catchment vs trust's outrageous-attack catchment. Hard gate: any failing invariant blocks merge. Copy this trident into a new repo and replace the declaration with project-specific invariants.", + context = "must trident — canonical template in idris2x. Blocking-authority verb (paired with trust). Specialises in subtle invariant-erosion catchment vs trust's outrageous-attack catchment. Hard gate: any failing invariant blocks merge. Copy this trident into a new repo and replace the declaration with project-specific invariants.", }, history = [ { date = "2026-04-18", event = "trident-born", note = "Mustfile.a2ml and must.ncl pre-existed. This manifest + must.k9.ncl complete the trident. Inherits on_open schema from intend.k9.ncl v2.0.0; inherits block_session_close_on_critical_drift + variance-severity-acknowledgement from trust.k9.ncl v1.0.0; adds must-specific track_per_session_trend + flag_silent_regression + probe_scope = 'read_only (must doesn't do active exploit attempts — that's trust's safe_hacking territory)." }, @@ -124,8 +124,8 @@ let base = import "../_base.ncl" in # Read by .machine_readable/coaptation/extract-clauses.sh. # ------------------------------------------------------------------- declaration = { - preamble = "# SPDX-License-Identifier: MPL-2.0\n# Mustfile — Physical state contract for rsr-template-repo\n# Author: Jonathan D.A. Jewell \n#\n# What MUST be true about this repository. Hard requirements.\n# Run with: must check\n# Fix with: must fix (where a deterministic fix exists)\n", - abstract = "Physical-state invariants for rsr-template-repo. This is the canonical\nRSR template repository. These are hard requirements — CI and pre-commit\nhooks fail if any check fails.", + preamble = "# SPDX-License-Identifier: MPL-2.0\n# Mustfile — Physical state contract for idris2x\n# Author: Jonathan D.A. Jewell \n#\n# What MUST be true about this repository. Hard requirements.\n# Run with: must check\n# Fix with: must fix (where a deterministic fix exists)\n", + abstract = "Physical-state invariants for idris2x. This is the canonical\nRSR template repository. These are hard requirements — CI and pre-commit\nhooks fail if any check fails.", prose = [ { section = "Template Integrity", diff --git a/.machine_readable/contractiles/trust/trust.k9.ncl b/.machine_readable/contractiles/trust/trust.k9.ncl index 3a99075f..04a3b86a 100644 --- a/.machine_readable/contractiles/trust/trust.k9.ncl +++ b/.machine_readable/contractiles/trust/trust.k9.ncl @@ -112,7 +112,7 @@ let base = import "../_base.ncl" in signed_by = { user = "Jonathan D.A. Jewell", date = "2026-04-18", - context = "trust trident — canonical template in rsr-template-repo. (Hunt, blocking) authority pattern. Primary catchment for adversarial drift test scenarios (firewall-off, cleartext-auth, PQ-downgrade, CSP-weaken). Hard gate: failed verification blocks merge. Copy this trident into a new repo and point it at the real keys, policies, and authority boundaries.", + context = "trust trident — canonical template in idris2x. (Hunt, blocking) authority pattern. Primary catchment for adversarial drift test scenarios (firewall-off, cleartext-auth, PQ-downgrade, CSP-weaken). Hard gate: failed verification blocks merge. Copy this trident into a new repo and point it at the real keys, policies, and authority boundaries.", }, history = [ { date = "2026-04-18", event = "trident-born", note = "Trustfile.a2ml and trust.ncl pre-existed. This manifest + trust.k9.ncl complete the trident. Inherits on_open negotiation + accountability + plain-language-translation schema from intend.k9.ncl v2.0.0; adds trust-specific threat_model_foregrounding + block_session_close_on_critical_drift + stricter accountability pledge (user cannot disable verification to unblock merges)." }, @@ -130,12 +130,12 @@ let base = import "../_base.ncl" in # Read by .machine_readable/coaptation/extract-clauses.sh. # ------------------------------------------------------------------- declaration = { - preamble = "# SPDX-License-Identifier: MPL-2.0\n# Trustfile — Trust boundaries and integrity invariants for rsr-template-repo\n# Author: Jonathan D.A. Jewell \n#\n# Defines what LLM/SLM agents are trusted to do without asking, and\n# integrity invariants that verify the repo has not been tampered with.\n", - abstract = "Trust boundaries and integrity checks for rsr-template-repo. This file\ncombines the trust-level definitions from the original TRUST.contractile\nwith the integrity invariants from the old Trustfile.a2ml. It defines\nwhat AI agents may do autonomously and what requires human approval,\nplus checks that verify repository integrity.", + preamble = "# SPDX-License-Identifier: MPL-2.0\n# Trustfile — Trust boundaries and integrity invariants for idris2x\n# Author: Jonathan D.A. Jewell \n#\n# Defines what LLM/SLM agents are trusted to do without asking, and\n# integrity invariants that verify the repo has not been tampered with.\n", + abstract = "Trust boundaries and integrity checks for idris2x. This file\ncombines the trust-level definitions from the original TRUST.contractile\nwith the integrity invariants from the old Trustfile.a2ml. It defines\nwhat AI agents may do autonomously and what requires human approval,\nplus checks that verify repository integrity.", prose = [ { section = "Trust Levels", - text = "The rsr-template-repo operates at trust level: maximal\n\nTrust levels:\n- maximal: Agent may read, build, test, lint, format, heal freely.\n Only destructive/external actions require approval.\n- standard: Agent may read and build. Test/lint need approval.\n- restricted: Agent may read only. All modifications need approval.\n- minimal: Agent may read specific files only. Everything else blocked.\n\nCurrent trust level: maximal", + text = "The idris2x operates at trust level: maximal\n\nTrust levels:\n- maximal: Agent may read, build, test, lint, format, heal freely.\n Only destructive/external actions require approval.\n- standard: Agent may read and build. Test/lint need approval.\n- restricted: Agent may read only. All modifications need approval.\n- minimal: Agent may read specific files only. Everything else blocked.\n\nCurrent trust level: maximal", }, ], verifications = [ diff --git a/.machine_readable/descriptiles/anchors/README.adoc b/.machine_readable/descriptiles/anchors/README.adoc index 9d2f62f5..9083fee6 100644 --- a/.machine_readable/descriptiles/anchors/README.adoc +++ b/.machine_readable/descriptiles/anchors/README.adoc @@ -10,7 +10,7 @@ anchor file lives in this directory, and no `.a2ml` file may be created here. - `(anchor)` - Project recalibration, scope intervention, canonical authority -Read a field with `scripts/deed-field.sh rsr-template-repo_chora.deed anchor `. +Read a field with `scripts/deed-field.sh idris2x_chora.deed anchor `. ## Multiple Versions diff --git a/.machine_readable/descriptiles/provisioning_praxis.deed b/.machine_readable/descriptiles/provisioning_praxis.deed index 54459823..b6b93901 100644 --- a/.machine_readable/descriptiles/provisioning_praxis.deed +++ b/.machine_readable/descriptiles/provisioning_praxis.deed @@ -10,8 +10,8 @@ ;; Canon: hyperpolymath/standards 3-practice/provisioning/PROVISIONING-STANDARD.adoc (praxis-deed :schema-version "1.0.0" - :canonical-name "rsr-template-repo-provisioning" - :repo "hyperpolymath/rsr-template-repo" + :canonical-name "idris2x-provisioning" + :repo "metadatastician/idris2x" :archetype "library" ; app | library | tool | theory | docs :languages "idris2 zig" ; detected; informational ;; Contract-verb overrides ("" = per-language default, which `just langs` shows) diff --git a/.machine_readable/policies/hypatia-rule-order.json b/.machine_readable/policies/hypatia-rule-order.json index aa458f1d..d0a592e2 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, including Hypatia checkouts; 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-exemptions.md, .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 (security_errors, code_safety, migration_rules, structural_drift, content_patterns, dogfooding), plus benches/ for code_safety only, and for security_errors also .github/workflows/integration.yml and, for secret_detected only, harvested-registry/"},{"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 and RE005 exemptions are file-scoped for deliberate credential-bearing or non-fatal reporting workflows. The former RE008 entry is removed: the Dependabot job pins the PR author by login and numeric id and performs no actor comparison."},{"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":"6693f9aed8e4383f78a3d01b600b32663bf7a45c","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, including Hypatia checkouts; 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-exemptions.md, .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 (security_errors, code_safety, migration_rules, structural_drift, content_patterns, dogfooding), plus benches/ for code_safety only, and for security_errors also .github/workflows/integration.yml and, for secret_detected only, harvested-registry/"},{"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 and RE005 exemptions are file-scoped for deliberate credential-bearing or non-fatal reporting workflows. The former RE008 entry is removed: the Dependabot job pins the PR author by login and numeric id and performs no actor comparison."},{"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":"6693f9aed8e4383f78a3d01b600b32663bf7a45c","repository":"hyperpolymath/hypatia","sources":["lib/hypatia/scanner_suppression.ex","lib/rules/"]},"schema":"hypatia-rule-order/1"} diff --git a/.machine_readable/root-allow.txt b/.machine_readable/root-allow.txt index 67c1d28f..3aa32725 100644 --- a/.machine_readable/root-allow.txt +++ b/.machine_readable/root-allow.txt @@ -39,7 +39,7 @@ LICENSE.adoc # the licence (MPL-2.0); renamed from LICENSE to the LICENSES/ # REUSE licence texts, dual-licence model (code MPL-2.0 / docs CC-BY-SA-4.0) CHANGELOG.adoc # AsciiDoc is the estate-standard documentation format CITATION.cff # citation metadata; GitHub reads it from the root of the default branch only -rsr-template-repo_chora.deed # the repo deed: universal AI entry point; family-7 allocation manifest + ply tree folded in (standards#837 pilot). Filename carries the repo slug (deed dispatch _chora.deed), so repo-init renames it at mint +idris2x_chora.deed # the repo deed: universal AI entry point; family-7 allocation manifest + ply tree folded in (standards#837 pilot). Filename carries the repo slug (deed dispatch _chora.deed), so repo-init renames it at mint CLAUDE.md # generated arrival pack; the generator, pre-commit and Claude Code all read it from the ROOT (do not hand-edit; edit the repo deed) ?GEMINI.md # pointer to CLAUDE.md for repos without AGENTS.md yet Justfile # thin; delegates phases to build/just/*.just diff --git a/.machine_readable/scripts/maintenance/maint-assault.sh b/.machine_readable/scripts/maintenance/maint-assault.sh index a72e17bb..6d9b2aa1 100644 --- a/.machine_readable/scripts/maintenance/maint-assault.sh +++ b/.machine_readable/scripts/maintenance/maint-assault.sh @@ -8,7 +8,7 @@ set -euo pipefail -BINARY_NAME="{{project}}" +BINARY_NAME="idris2x" REPORT_PATH="docs/reports/security/assault-latest.json" PA_BIN="${PANIC_ATTACK_BIN:-panic-attack}" diff --git a/.machine_readable/self-validating/README.adoc b/.machine_readable/self-validating/README.adoc index 0530eede..b19e2c56 100644 --- a/.machine_readable/self-validating/README.adoc +++ b/.machine_readable/self-validating/README.adoc @@ -131,7 +131,7 @@ K9 contractiles integrate with other RSR standards: ⚠️ **Never run as root unless required** + ⚠️ **Sandbox external components** -**See:** https://github.com/{{OWNER}}/k9-svc/blob/main/docs/SECURITY-BEST-PRACTICES.adoc +**See:** https://github.com/metadatastician/k9-svc/blob/main/docs/SECURITY-BEST-PRACTICES.adoc == Template Files @@ -155,14 +155,14 @@ chmod +x nickel && sudo mv nickel /usr/local/bin/ cargo install just # Clone K9-SVC (for must shim and tooling) -git clone https://github.com/{{OWNER}}/k9-svc.git +git clone https://github.com/metadatastician/k9-svc.git ---- == Learn More -- **K9-SVC Specification:** https://github.com/{{OWNER}}/k9-svc/blob/main/SPEC.adoc -- **K9 User Guide:** https://github.com/{{OWNER}}/k9-svc/blob/main/GUIDE.adoc -- **Security Documentation:** https://github.com/{{OWNER}}/k9-svc/blob/main/docs/SECURITY-FAQ.adoc +- **K9-SVC Specification:** https://github.com/metadatastician/k9-svc/blob/main/SPEC.adoc +- **K9 User Guide:** https://github.com/metadatastician/k9-svc/blob/main/GUIDE.adoc +- **Security Documentation:** https://github.com/metadatastician/k9-svc/blob/main/docs/SECURITY-FAQ.adoc - **IANA Media Type:** `application/vnd.k9+nickel` == Contributing @@ -175,4 +175,4 @@ When adding K9 contractiles to your repository: 4. Sign Hunt-level components before committing 5. Add K9 validation to CI/CD pipeline -**Questions?** Open an issue on https://github.com/{{OWNER}}/k9-svc +**Questions?** Open an issue on https://github.com/metadatastician/k9-svc diff --git a/.machine_readable/self-validating/examples/ci-config.k9.ncl b/.machine_readable/self-validating/examples/ci-config.k9.ncl index 1f38e2dc..9fe314e2 100644 --- a/.machine_readable/self-validating/examples/ci-config.k9.ncl +++ b/.machine_readable/self-validating/examples/ci-config.k9.ncl @@ -19,7 +19,7 @@ K9! name = "ci-config", version = "1.0.0", description = "CI/CD configuration with runtime validation", - author = "{{AUTHOR}} <{{AUTHOR_EMAIL}}>", + author = "Jonathan D.A. Jewell ", }, }, diff --git a/.machine_readable/self-validating/examples/project-metadata.k9.ncl b/.machine_readable/self-validating/examples/project-metadata.k9.ncl index c8e6ebf0..e6e56d75 100644 --- a/.machine_readable/self-validating/examples/project-metadata.k9.ncl +++ b/.machine_readable/self-validating/examples/project-metadata.k9.ncl @@ -19,7 +19,7 @@ K9! name = "project-metadata", version = "1.0.0", description = "Pure data configuration for project metadata", - author = "{{AUTHOR}} <{{AUTHOR_EMAIL}}>", + author = "Jonathan D.A. Jewell ", }, }, @@ -30,14 +30,14 @@ K9! description = "A project following Rhodium Standard Repositories", repository = { - url = "https://github.com/{{OWNER}}/my-project", + url = "https://github.com/metadatastician/my-project", type = "git", }, author = { - name = "{{AUTHOR}}", - email = "{{AUTHOR_EMAIL}}", - organization = "{{AUTHOR_ORG}}", + name = "Jonathan D.A. Jewell", + email = "j.d.a.jewell@open.ac.uk", + organization = "hyperpolymath", }, license = "MPL-2.0", @@ -45,7 +45,7 @@ K9! keywords = [ "rhodium-standard", "rsr", - "{{OWNER}}", + "metadatastician", ], }, diff --git a/.machine_readable/self-validating/examples/setup-repo.k9.ncl.in b/.machine_readable/self-validating/examples/setup-repo.k9.ncl.in index f86df82f..70cdbb9c 100644 --- a/.machine_readable/self-validating/examples/setup-repo.k9.ncl.in +++ b/.machine_readable/self-validating/examples/setup-repo.k9.ncl.in @@ -20,7 +20,7 @@ K9! name = "setup-repo", version = "1.0.0", description = "Automated repository setup with RSR standards", - author = "{{AUTHOR}} <{{AUTHOR_EMAIL}}>", + author = "Jonathan D.A. Jewell ", }, warnings = [ "This component has full system access", @@ -104,8 +104,8 @@ K9! description = "Initialize Git repository", commands = [ "git init -b %{config.git.default_branch}", - "git config user.name '{{AUTHOR}}'", - "git config user.email '{{AUTHOR_EMAIL}}'", + "git config user.name 'Jonathan D.A. Jewell'", + "git config user.email 'j.d.a.jewell@open.ac.uk'", "echo '✓ Git initialized'", ], }, @@ -114,7 +114,7 @@ K9! description = "Add RSR-compliant workflows", commands = [ # This would copy workflow templates - # In a real implementation, would fetch from rsr-template-repo + # In a real implementation, would fetch from idris2x "echo '✓ Workflows configured'", ], }, diff --git a/.machine_readable/self-validating/methodology-guard.k9.ncl b/.machine_readable/self-validating/methodology-guard.k9.ncl index 65e6eea1..be7d9941 100644 --- a/.machine_readable/self-validating/methodology-guard.k9.ncl +++ b/.machine_readable/self-validating/methodology-guard.k9.ncl @@ -1,6 +1,6 @@ K9! # SPDX-License-Identifier: MPL-2.0 -# Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +# Copyright (c) 2026 Jonathan D.A. Jewell (metadatastician) # # K9 Validator: Methodology Guard # Checks that agent work respects methodology constraints declared in the @@ -57,7 +57,7 @@ let methodology_guard = { state_not_template = { description = "The ROADMAP journal must not contain template placeholders", severity = "warning", - # The journal, not the repo deed: a deed names rsr-template-repo in + # The journal, not the repo deed: a deed names idris2x in # (lineage :instantiated-from) by design, so this pattern would always # fire there. file = "docs/status/ROADMAP.adoc", @@ -69,8 +69,8 @@ let methodology_guard = { # out of the file (in this comment too) so init cannot match it, while # Nickel still evaluates the element back to the full token. Do not # "simplify" it to a plain string. (The PLACEHOLDER token and - # "rsr-template-repo" are not init tokens, so they survive as-is.) - reject_patterns = ["{{PLACEHOLDER}}", "{{" ++ "PROJECT}}", "rsr-template-repo"], + # "idris2x" are not init tokens, so they survive as-is.) + reject_patterns = ["{{PLACEHOLDER}}", "{{" ++ "PROJECT}}", "idris2x"], }, coverage_updated = { diff --git a/.machine_readable/self-validating/template-hunt.k9.ncl.in b/.machine_readable/self-validating/template-hunt.k9.ncl.in index a9cc350e..b3fcb475 100644 --- a/.machine_readable/self-validating/template-hunt.k9.ncl.in +++ b/.machine_readable/self-validating/template-hunt.k9.ncl.in @@ -20,7 +20,7 @@ K9! name = "TODO: component-name", version = "1.0.0", description = "TODO: Detailed description of what this component does", - author = "{{AUTHOR}} <{{AUTHOR_EMAIL}}>", + author = "Jonathan D.A. Jewell ", }, warnings = [ "This component has full system access", diff --git a/.machine_readable/self-validating/template-kennel.k9.ncl.in b/.machine_readable/self-validating/template-kennel.k9.ncl.in index fa7e3f35..4228b26c 100644 --- a/.machine_readable/self-validating/template-kennel.k9.ncl.in +++ b/.machine_readable/self-validating/template-kennel.k9.ncl.in @@ -19,7 +19,7 @@ K9! name = "TODO: component-name", version = "1.0.0", description = "TODO: Brief description of what this component contains", - author = "{{AUTHOR}} <{{AUTHOR_EMAIL}}>", + author = "Jonathan D.A. Jewell ", }, }, diff --git a/.machine_readable/self-validating/template-yard.k9.ncl.in b/.machine_readable/self-validating/template-yard.k9.ncl.in index 358671cf..a723f5af 100644 --- a/.machine_readable/self-validating/template-yard.k9.ncl.in +++ b/.machine_readable/self-validating/template-yard.k9.ncl.in @@ -19,7 +19,7 @@ K9! name = "TODO: component-name", version = "1.0.0", description = "TODO: Brief description with validation details", - author = "{{AUTHOR}} <{{AUTHOR_EMAIL}}>", + author = "Jonathan D.A. Jewell ", }, }, diff --git a/.mailmap b/.mailmap index e416ced0..9a973b3a 100644 --- a/.mailmap +++ b/.mailmap @@ -1,4 +1 @@ -# Format: Canonical Name Alias Name -Jonathan D.A. Jewell hyperpolymath -# Bot identities -gitbot-fleet[bot] +# No alternate author address to map. diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index a481e6a9..fce0aed3 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -8,696 +8,20 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. === [Unreleased] -==== Fixed - -* The K9 badge publisher failed on every push to `main` in minted repos: it - wrote straight to the `governance-badges` branch, and the estate's - `Branch-Floor` ruleset (all branches, `code_coverage` requires a pull - request) refused it with HTTP 409. The badge is now staged by the `badges` - job (`governance-badge.js stage`, `contents: read` only) and deployed with - the GitHub Pages site by `pages.yml` (now triggered by Dogfood Gate - completing on `main`), at `https://.github.io//badges/k9.json`. - The ruleset is satisfied, not bypassed. Minted repos need Pages enabled with - source "GitHub Actions"; `pages.yml` lost its `push` and `workflow_dispatch` - triggers. The helper's old `publish` route is no longer used by any workflow - and is left in place for a follow-up removal. - -==== Added - -* **Chain minting: a minted repo can be minted again.** "Use this template" - on a minted repo now mints correctly (owner ruling 2026-11-04, after the - Codex review of #251 showed the grandchild inherited its parent's identity). - `scripts/chain-mint.sh` replays the parent's mint, mints the same template - commit with the new answers, and carries the parent's own work across with - `git merge-tree`: everything rendered is rendered afresh, the parent's - edits, additions and removals are kept (renamed by the self-name rule and - the narrow self-owner rule, each defined once in repo-init) and declared in - the new `(variant (paths))` by comparing the result with the fresh mint, as - the drift gate does, so an edit carried across an answer-dependent rename - (a Julia entry point) is declared where it lives. Paths stay NUL-delimited, - so a backslash or a leading dash survives, and a file the parent tracks - although an ignore rule matches it is carried. Identity files are held in - git's index, never through the work tree, and a symlink at any path the - chain writes is refused, so a parent-controlled link cannot redirect a - write. Every tree is read from, and the result written back into, the - checkout by git (a scratch index and a two-tree `read-tree -m -u`), never by - tar, so no symlink is followed. The checkout is read and written by its own - git, under its own configuration (a linked worktree's common excludes, - `core.autocrlf`, a global excludesFile, clean and smudge filters); the - replays under none. Every path the result adds is checked on the disk first - and refused by name if anything the parent snapshot does not track is there, - ignored or not: git's own check lets an ignored entry be overwritten - wherever it sees the ignore rule. A sparse checkout, an unresolved merge, or - a tracked path beneath a symlink is refused. A parent's deletion is honoured - across an answer-dependent rename; a type change there is refused by name. - The baselines, and the drift gate, replay with the wrapper at the pin, not - the carried copy, and - the template clone takes no init templates. The result is fixed before the - gates run (what they write is not carried), every file the write changes is - first checked out into scratch with this checkout's filters, and a write - that still fails part-way keeps the objects needed to put it back. The - generator's temporary paths join the symlink guard. A path holding byte 0x01 is refused - like one holding a newline. The deed's (mint-answers) decides that a tree is - a minted repo, so one that added build/templates/identity.deed.in back is - still chain-minted. The carried generators run before the - final measure (their intermediate data is removed before it, and the - declaration settles path by path and category by category), and the result must pass - the child's own gates (placeholders, SPDX, toolchain, container pins, www, - `just verify`) before it is written. A conflict with the new rendering stops - before anything is written. Provenance records the root - template commit plus `:derived-from` the parent. A parent minted before - `(mint-answers)` is still refused. `scripts/replay-mint.sh` is now the one - replay path, shared with the drift gate; only a recorded `(mint-answers)` - supplies its package uuid, so the new side of a chain mint derives its own. -* **An exact drift gate for minted repos: the mint is replayed.** repo-init - records its answers in a `(mint-answers)` deed clause (owner ruling - 2026-11-04: only values it already writes into the child's files; the - recipe checks each value against those files, not the template-only trees - it deletes, and names any it leaves out) - and takes its date from `RSR_MINT_DATE`; a replay also takes the recorded - Julia package uuid, which an ordinary mint always derives. - `scripts/check-mint-drift.sh` re-mints the template at `(provenance :template-commit)` with those answers - and diffs the child against the result, so a fresh mint is green by - construction and each later edit is named. `check-variant-drift.sh` - delegates to it for a minted repo, and stage 8 recommends it again. The - derived files (`CLAUDE.md`, the repository map) are declared diverged at - mint: their own gates keep them fresh. Each side's file set is its tracked - or unignored files (the child's under its own git configuration, as - `git add -A` commits it; the replay's under none), so a force-added build - artefact is still named. The - most specific declaration covering a path decides its category, so a file - declared added under a directory the mint removes is an addition; a path - holding a newline is refused by name. A path declared diverged must be one - the mint produces; `operational-state` stays out of the comparison. The - replay's git runs without user or system configuration or hooks. What a - work tree already held beyond the pinned tree before the mint (an edit, an - untracked file, a deletion) is named by the mint, which then replays itself - from the pinned tree before writing anything and declares in - `(variant (paths))` exactly what the result differs by: the comparison the - drift gate makes, whatever the mint did to a change on the way (moved, - rendered, overwritten, or reached through an edited input). The replay - passes the recorded `RSR_TEMPLATE_SLUG`. A pre-mint change under a root `.well-known/` (which the mint moves), - or a work tree that differs from an asserted template tree this repository - does not hold, is refused before anything is written. The gate clears - inherited git location variables, and writes the pinned tree as a checkout - does (`checkout-index`, never `git archive`, whose `export-ignore` and - `export-subst` would change it), without global git attributes. A pre-mint - file at a path the mint itself writes (the archetype overlay, the docs seed, - the deed), or an edited template file the overlay replaces, is refused, - since the mint would overwrite it; and the mint also dry-runs itself on the - work tree, refusing by name any pre-mint change it would discard (an edit to - the roadmap or `mise.toml`, which it writes whole). repo-init clears any - inherited git location (`GIT_DIR`, `GIT_INDEX_FILE`, …) before it runs, so - neither its replays nor the tests it runs in scratch repositories can commit - into the child; one naming another repository is refused. The replays - receive `STANDARDS_UUID_V8_JS`, and a template tree carrying a submodule - (a gitlink, which a replay cannot reproduce) is refused by name, at the mint - as well, clean or not. A pre-mint change gone from both results (an input - the mint never copies, a file in a directory it deletes) is checked by - minting without it, and refused by name when it has no effect; a path - holding byte 0x01 (the deed reader's record separator) is refused like one - holding a newline. - -==== Changed - -* **Agda proofs use PROOF-POLICY §2.1's invocation.** `scripts/check-proofs.sh - agda` runs `agda --safe --without-K --cubical-compatible`, the canonical - theory invocation (metadatastician/standards `3-practice/PROOF-POLICY.adoc` - §2.1), instead of `agda --safe`. Every repository minted from the template - inherits the gate, so this is the source of the fix that - hyperpolymath/resource-algebra#19 and hyperpolymath/occupancy-types#18 make - to their copies. `Properties.agda` checks under the new flags (Agda 2.6.3, - standard library 1.7.3); the manifest records it. - - -==== Fixed - -* **Mint, drift gate and chain mint: the review findings left open on #275 - and #277.** -** An answer holding byte 0x01, the deed reader's record separator, is - refused before the first write. -** The drift gate and the pre-mint check compare a symlink's target byte for - byte (a trailing newline was stripped) and the execute bit git records - (the owner's), not `-x`, which as root is true for a file only its group - or others may execute. -** The repo uuid is derived the same on every machine - (`scripts/uuid5-url.sh`: sha1sum, shasum or openssl, equal to - `uuidgen --sha1`); without uuidgen it used to be `UNASSIGNED`, which a - replay then reported as drift. `deed-field.sh --uuid` falls back to it. -** A divergent legacy `.well-known/` file is quarantined under the mint - date (`migrate-wellknown-to-www.sh --date`), so a later replay names it - the same. -** Replays keep a file the template tracks although its `.gitignore` - matches it, and refuse a template commit whose checkout does not read - back as its own tree, instead of replaying it inexactly. -** A chain mint holds the parent's original deed name as identity (a parent - that renamed its deed chain-mints), refuses a carried generator that - edits the deed, and fetches a partial clone's pinned files while the - user's git configuration (credentials, `insteadOf`) still applies. -** A minted repo without `scripts/chain-mint.sh` is refused, never minted as - a template. - -* **repo-init follow-ups to #251 (the Codex review it merged before).** -** Re-minting a minted repo silently inherited its parent's author, contacts - and identity (its tokens are filled and `build/templates` is gone). A - minted repo that records `(mint-answers)` is now chain-minted (see Added); - one that does not is refused before writing, naming its template. -** The template identity no longer falls back to the git remote, which in a - template-created child is the child itself. A Justfile without readable - `OWNER :=`/`REPO :=` (now also `export`) needs `RSR_TEMPLATE_SLUG`. -** The self-name pass matches the template name only where no letter or - digit touches it, so a short parent name such as `app` no longer rewrites - "application" into "newlication". -** `resolve-template-pin.sh` pins a root commit by creation time (the - default branch's tip when the child was made) and refuses, listing them, - when several commits share a tree; 29 trees repeat on main. -** `rust-tool.sh` caches each mint tool by the hash of its source, so two - checkouts can no longer run each other's binary. -** Answers go through `sed_rhs`, so `&`, `|` and `\` in a description or name - render literally; an answer with a newline is refused. - -* **`.kyaml` files were invisible to four file scans.** Estate configuration - is `.kyaml` (D307), but these selectors matched only `*.yaml`/`*.yml`: the - invisible-character scan (`scripts/check-invisible-characters.sh`), the - `http://` URL check in `security-policy.yml`, and the VeriSimDB probe in - `dogfood-gate.yml` and `dogfood-summary.yml`. A zero-width character or a - plain-HTTP URL in a `.kyaml` file passed unseen. Each now includes - `*.kyaml`. Ported from `hyperpolymath/panic-attack#246`. -* **The template's gates could not fail, and the toolchain was not minted.** - Reported from JuliaPackageSpitter.jl and traced here; see - `docs/reports/compliance/RSR-TEMPLATE-DAMAGE-2026-10-30.adoc` for the full - investigation and the estate inventory. -** `spdx-headers` globbed `*.rs`/`*.res`/`*.gleam` and capped the scan at 20 - files, so it examined nothing and passed in every Julia, Idris2, Zig, Elixir, - OCaml and shell repository. `scripts/check-spdx-headers.sh` derives the - extension set from the languages the repository declares, scans every match, - and fails when a declared language has no files or when it matched nothing; -** `container-images-pinned` asked whether `cgr.dev` appeared in the - Containerfile, which `FROM cgr.dev/chainguard/wolfi-base:latest` satisfies. - `scripts/check-container-pins.sh` requires a 64-hex digest on every `FROM`; - `scripts/pin-container-digests.sh` writes the pins and refuses a placeholder; -** `mise.toml` was copied from the spine, not rendered, so every mint declared - the template's own toolchain — nine runtimes including Python, which is - banned estate-wide, and not the language of the repository. It is now - rendered from the detected languages by `scripts/render-mise.sh`, and - `scripts/check-mise-language.sh` fails a repository whose declared toolchain - is not the one its languages need; -** `just quality` printed "All quality checks passed!" over verbs that reported - `N/A` and exited 0. It now fails when a verb runs nothing, and the - `julia-library` archetype wires `fmt`, `fmt-check` and `lint` to - `scripts/julia-quality.jl`; -** `build/container/Containerfile` is deleted rather than pinned: two - `FROM …:latest` lines and a body of TODO comments built nothing and failed - `container-images-pinned` in every minted repository, including those that - publish no image. A repository that publishes one adds the file and pins it - (`scripts/pin-container-digests.sh`); `just container-build` says so; -** `archetypes/*/prune.txt` and `scripts/prune-archetype-modules.sh`: an - archetype can remove spine modules its preset does not declare, so a Julia - library no longer inherits a `Containerfile`; -** the mint's `.in` rename covered a hardcoded three-file list; it now covers - the files the applied overlay actually added, so the spine's own `.in` - templates survive; -** `check-no-placeholders.sh` died with exit 1 and no output in a repository - with no `origin` remote (a fresh mint, before the first push): `git config` - exited 1 and `set -e` took the script with it; -** `validate-template.sh` referenced an unset `SCRIPT_DIR` (aborting at Phase 6 - under `set -u`) and demanded `CONTRIBUTING.md` in an estate that writes - `.adoc`. There is now a root `LICENSE` (MPL-2.0), so the Mustfile's - `license-present` and every minted `link:LICENSE[LICENSE]` resolve; -** a pre-write token gate in `repo-init` refuses a mint the recipe cannot answer - for, and four gates now run against the minted tree before handoff; -** `tests/workflows/mint_gates_test.sh` (30 controls) asserts that every gate - fails on a fixture built to fail it; `tests/e2e/language_profiles_mint_test.sh` - (27 controls) mints a Julia package and a Rust CLI and runs the gates on both. - `.github/workflows/quality.yml` gained a `mint-gates` job that runs them. - -* Defects a child inherited, found porting this CI into resource-algebra - (resource-algebra#15, fixed there in resource-algebra#16): -** Secret Scanner: a repository `.gitleaks.toml` replaced the estate - gitleaks baseline in all three passes, so a pull request could pass with - a weaker local config. The baseline now always runs; a local config adds - a second pass; -** `scripts/check-required-contexts.sh` checked a mapped context's workflow - trigger but not that a job with that check-run name exists, so a renamed - job could strand pull requests behind an unproducible required check; a - job with neither `runs-on` nor `uses` produces nothing. A - job that calls a local reusable workflow (one declaring - `on: workflow_call`, directly in `.github/workflows/`, called as `./` or - `$/`, nested at most ten deep, no - cycles) counts as producing - ` / `; one that calls a remote reusable produces - nothing the gate can certify. A literal matrix is expanded as GitHub - names its runs (property names case-insensitive, and only names GitHub - can dereference); a matrix with - include/exclude or computed values is - refused by name, never assumed to match; a matrix caller of a reusable - produces one ` / ` per run; -** `repo-init` and `container-init` filled the container tokens without - reformatting the KYAML, so a fresh child that keeps its containers failed - Estate Rules' "Converted YAML stays KYAML". Both now run - `scripts/format-container-kyaml.sh` after their substitution pass, and check - for a yq that writes KYAML before they write anything (a mint that prunes - `build/container/` needs none), refusing a service name, port or registry - that would break the KYAML they fill or the substitution (a service name - that is a DNS label, since it is also a TOML table key and the backend's - hostname; a registry of a host or a bracketed IPv6 address in RFC 4291 text, an optional port - from 1 to 65535 and lower-case path components, the owner lower-cased in - its default; - `container_kyaml_test.sh` holds the accepted and refused values). yq joins - the base toolchain (`MISE_BASE`, so every rendered `mise.toml`, and the - template's own); `mise.lock` gains its record with `just toolchain-refresh`. - The quick-start docs install the toolchain before `just repo-init` and run - every `just` through `mise exec --` unless mise is activated. Estate Rules - installs its pinned yq before the mint steps, and `use_template_mint_test.sh` - checks the minted configs and that a mint without a KYAML-capable yq stops - untouched; -** `mint-verbatim.txt` did not list `tests/ffi_strings_test.sh` or - `tests/workflows/container_kyaml_test.sh`, token fixtures the placeholder - gate then rejected in a child; -** `tests/ffi_strings_test.sh` named the template's export prefix, so in a - child it called functions that do not exist. It now maps the child's exported - symbols onto the fixture's, and nothing else that shares their prefix. - -* `repo-init` minting a repository created with GitHub's "Use this - template" (measured on metadatastician/lintel, 2026-10-14): -** provenance recorded the CHILD's own HEAD as the template commit. The - commit is now resolved by tree equality against the template's history - (`scripts/resolve-template-pin.sh`), before anything is written, and an - unresolvable tree aborts the mint (`RSR_TEMPLATE_URL`, - `RSR_TEMPLATE_COMMIT`, `RSR_ALLOW_UNPINNED=1` for the exceptions); -** the template's name, owner and deed file are derived from the checkout - (the root Justfile, else `RSR_TEMPLATE_SLUG`; never the git remote, which in - a "Use this template" child names the child), not hardcoded (ported from - lintel#9, which did not merge; its removal of the `[YOUR-REPO-NAME]` deed - seds was not ported, since only they fill it); -** every rewrite pass and completeness check reads one file list: the - repository's own files (`git ls-files`, plus untracked not-ignored), minus - `.machine_readable/mint-verbatim.txt`. The strip pass no longer edits - git-ignored sibling checkouts under `_build/`, nor the fixture tests its - own leftover check exempts; `strip-instruction-blocks.rs` takes files, not - a directory. `check-no-placeholders.sh` reads the same manifest; -** a fresh mint of main aborted on `julia_library_test.sh`'s package-UUID - fixture token; it is now carried verbatim; -** the repository map is generated from the work tree (`gen-repo-map.sh - --worktree`), after the last tree-changing step, so it no longer lists - `archetypes/` and the template's deed name; a path holding a newline, - which the line-based map would split into bogus entries, is refused by - name in both modes; -** stage 8 no longer tells a minted repo to arm `check-variant-drift.sh`, - which a fresh mint cannot pass (101 rendered files differ); it points at - `check-template-conformance.sh`. The (variant) clause now declares the - mint's removals, and the drift gate says why it fails on a minted repo; -** deed-validate.yml's "Copy it from …" line names the template as the - upstream source, so the self-name pass leaves it alone. -* `tests/e2e/use_template_mint_test.sh` (wired into estate-rules): the first - CI job to run a full mint, with a negative control beside each check. -* The published governance badge could lie. `dogfood-gate.yml` mapped every - non-`success` K9 outcome to RED, so `skipped`, `cancelled` and `timed_out` - all rendered a red "failure" that never happened; worse, the `badges` job - skipped publication entirely when its lane was skipped, so an earlier green - badge stayed on display. Badge publication is now owned by - `scripts/governance-badge.js`, which renders `success`/brightgreen, - `failure`/red, and skipped/cancelled/unavailable/unrecognised as explicit - lightgrey states, and which publishes on a skipped lane instead of leaving - the old badge alone. -* Badge publication treated every GitHub API error as "the branch is missing": - `gh api … >/dev/null 2>&1` fell through to branch creation on a 401, a 429 or - a network failure, and a failed file read produced a PUT with no `sha` that - could never converge. Only a 404 on both the file and the ref may now create - a branch; auth, rate-limit, 5xx and network failures fail the run without - writing anything. -* Every push to `main` wrote a badge commit even when the badge was unchanged. - The publisher now fetches the published file, compares it byte for byte with - the newly rendered badge, and exits with an "unchanged" notice and no commit - when they are identical - and it never re-serialises the JSON to make the - comparison succeed. Publications are serialised per repository (job-level - `concurrency`), and the sha-checked contents call turns a race into a - re-read instead of a silent overwrite. - -* **The Hypatia verdict grid was described in three places and produced in - none.** `.github/workflows/README.adoc` said a `verdict` job posted the grid, - `.gitbot-fleet/report-backs/README.md` said the Hypatia lane downloaded the - report-backs, and `fork-governance.yml` produced a `fleet-report-backs` - artifact "for the grid" — while no workflow rendered a grid, and - `hypatia-scan.yml` uploaded no findings file at all. `fork-governance.yml`'s - verdict job now collects the producers' artifacts for one commit, renders the - findings-family grid with the standards renderer (pinned commit, verified - sha256, never a copy in this tree), uploads `verdict-grid` and maintains one - `` comment per pull request. It is triggered by - `pull_request` *and* by `workflow_run` on the two producer workflows, so it - re-renders when a scanner finishes instead of showing "not yet" forever. -* **Hypatia ran twice per pull request.** `hypatia-scan.yml` and a - `hypatia-scan` job of `static-analysis-gate.yml` each built the same scanner - at the same pin, with separate caches and two independent "fail on critical" - gates over two differently-shaped JSON files. Hypatia now runs once, in - `hypatia-scan.yml`, which also uploads `hypatia-findings.relativized.json` - (repo-relative paths, so the grid's delta column can match - `git diff --name-only`) as `hypatia-scan-findings`. `static-analysis-gate.yml` - keeps what is specific to it and uploads `static-analysis-findings`. -* **A failed fleet job was reported and then ignored.** The verdict job printed - the fleet result in a table and never failed on it, so a fleet failure was - invisible where a reader looked; its `jq '… | .findings | length'` loop could - also abort the whole summary on one malformed envelope and skip the final - check. The verdict now fails on DEED/K9 only (each producer owns its own - gate), states that the fleet's failure is orange rows plus its own red check, - and never parses fields it does not own. -* **`.hypatia-ignore` carried a dangling cross-reference**: `panicbot` was left - unenrolled because "the Hypatia lane's direct panic-attack row" would cover - it, and no such row existed. The grid now renders that row from - `static-analysis-gate.yml` evidence, and the enrolment reason states the rule - it is an instance of (one scanner, one row). - -* **Seven defects the review of this work found, each now covered by a control.** - None of these were reached by the tests as written, which is the point: -** `check-container-pins.sh` took the "nothing to pin" success path even after - failing on a `Dockerfile`, so the one repository shape the Dockerfile rule - exists to catch reported PASS; and it registered a stage name only after the - line that `continue`s, so the ordinary `FROM image@sha256:… AS build` + - `FROM build` pair was judged an unpinned remote image. Stage names are now - registered when parsed, before any branch can skip the rest of the line; -** `pin-container-digests.sh` rewrote every `FROM` line, turning `FROM scratch` - and `FROM build` into `scratch@sha256:…` and `build@sha256:…` — corrupting the - multi-stage files it should leave alone, while the companion gate accepted the - result. It now splits FROM into flags/reference/tail and rewrites only the - reference of a remote image; -** `check-spdx-headers.sh` judged emptiness per EXTENSION, so a valid Elixir tree - with `.ex` and no `.exs` (or OCaml `.ml` without `.mli`) failed for a language - it is written in. Emptiness is now judged per language, across all of its - extensions; -** `render-mise.sh --langs` only changed the label: the tool list still came from - the tree's own detection, so a fixture asking for Julia was handed the docs - toolchain. `mise-tools` now accepts the language list, and `--check` compares - the declared toolchain rather than the rendered prose — which made it - impossible to pass on any repository that wrote its own header, the template - included; -** `check-mise-language.sh` parsed only bare `[tools]` keys, and backend-qualified - tools MUST be quoted (`"npm:prettier"`), so the banned-tool check could never - see them; its `--detect` mirror also looked only at the root, calling a tree - with `src/interface/abi.ipkg` and `src/interface/ffi/build.zig` a docs - repository. Both now follow the engine, depths included, and the mirror lists - mise tools rather than each language's binaries; -** `check-mint-tokens.sh` treated "no build/just/repo-init.just" as proof of a - minted tree — but that recipe is carried verbatim into every child, so no child - was ever recognised and an unfilled `{{PROJECT_NAME}}` passed (and - `survey-template-damage.sh` reported such repositories token-clean). The marker - is `archetypes/`, which the mint deletes; -** `archetypes/*/prune.txt` dropped only `build/container/`, so a minted Julia - package and a minted Rust CLI both carried the Idris2/Zig seam: three languages - detected, `idris2` and `zig` installed, `idris2 --build` in `just build`. Both - presets declare neither the abi nor the ffi capability, so both now prune - `src/interface/`; `validate-rsr` requires the seam only of a tree that carries - it. The archetype tests assert the toolchain is single-language. - ==== Added -* `scripts/governance-badge.js` — the single implementation of the badge - scheme: the state -> (message, colour) table, canonical rendering, the - publication decision (create orphan branch / add file / update / no-op), - API-error classification, and guards that refuse `main`, `master`, a - repository default branch, or a path outside `badges/`. Runtime-agnostic - (Bun or Node, `node:` builtins only), so it is unit testable. -* `tests/workflows/governance_badge_test.sh` and - `tests/workflows/governance_badge_test.js` — hermetic tests wired into - Estate Rules: the state table, byte-equal no-op, changed-bytes publication, - orphan-branch creation with `parents: []`, grey states for missing/malformed - lane evidence, malformed existing content, 404-vs-outage classification, - conflict reconciliation and the source-branch guards, plus wiring checks run - against a mutated workflow so they are proven able to fail. They supersede - `tests/workflows/dogfood_badge_test.sh`, which asserted the old mapping and - was never wired into CI. A present but *unreadable* artifact (EACCES, or a - TOCTOU deletion between the stat and the read) is now evidence that cannot be - checked rather than an uncaught exception: it renders grey, names the errno, - and exits 3. The assertion is skipped, with the reason printed, when the - suite runs as root, where `chmod 000` cannot deny a read. -* `README.adoc` and `.github/workflows/README.adoc` now state the operational - contract of the generated `governance-badges` branch: it is an orphan with no - common ancestor with `main`, it is never merged and has no pull request, - recent pushes are normal refreshes, identical content makes no commit, and a - grey badge means the lane produced no trustworthy result. - -* `www/` site-operations bundle (issue #53): canonical `.well-known/` - metadata, publishable content, policy sources, error bodies, - security-header templates, Caddy/nginx/Apache integration examples, an - authoritative-only BIND 9 starting hand with record templates, - encrypted-DNS/privacy and TLS guidance, explicit opt-in profiles, - schemas, planted-control tests and operational runbooks. -* `scripts/migrate-wellknown-to-www.sh` — conflict-safe migration of a - repository-root `.well-known/` into `www/.well-known/` (identical copies - de-duplicated, root-only content moved, divergent content quarantined — - see Changed). -* `scripts/sweep-wellknown.sh` — stage 5 (#119) batch driver: classify, - migrate, test and commit across the estate in batches of 25, holding - Pages-served and non-RSR repositories for a human decision instead of - sweeping them blind. -* `www/runbooks/stage5-wellknown-sweep.adoc` — how to run the sweep, and - how to recover from a quarantine. -* Mint wiring for the `www/` bundle: `repo-init` now invokes - `scripts/migrate-wellknown-to-www.sh` when the tree being minted still - carries a legacy root `.well-known/`, and runs `www/tests/run-all.sh` - afterwards. Both are no-ops for a repository minted from the current - template; they exist for running `repo-init` over a tree that predates - #53. #106 described both as already present — neither was, which is a - fair part of why the estate still carries root `.well-known/` directories. -* `scripts/merge-actions-lock.rs` — merges an archetype's lock fragment - (`archetypes//actions.lock`) into the spine's - `.github/workflows/actions.lock` at mint. A record that differs between - the two stops the mint. `tests/workflows/archetype_lock_merge_test.sh` - (wired into estate-rules) checks the merged lock with - `check-lock-sync.sh`, and checks that the old clobber, a missing record - and a conflicting record all fail. - -* `scripts/verdict-grid-lane.sh` — collect / validate / render / previous / - comment for the verdict grid lane. It refuses to execute a renderer whose - sha256 does not match the recorded digest, renders an explicit **orange - "indeterminate"** grid (never green) when the renderer or the evidence is - unavailable, refuses a bare panic/pons findings array (a bare array cannot - distinguish "ran clean" from "never ran"), and updates the comment it posted - last time instead of adding one per run. -* `scripts/check-workflow-edges.sh` — the intra-repository half of the CICD - Squabbler gate, run in both `squabble.yml` and `estate-rules.yml`. It fails - when a `workflow_run.workflows` entry names no workflow's `name:`, when two - workflows share a `name:`, when the verdict job reads an artifact its named - producer never uploads, when a producer stops running on `pull_request`, when - the verdict job's `--hypatia-ref`/`--panic-ref`/`--pons-ref` disagree with the - producer's pin, or when one tool is pinned at two different commits. -* `scripts/check-hypatia-ignore.sh` — the meta-rules for `.hypatia-ignore`: - every fragment must end on a path boundary (a substring fragment silences - more than it names), no entry may be subsumed by a broader one for the same - module, the path it names must exist, and it must belong to a commented - reason block. -* `docs/HYPATIA-RULE-ORDER.adoc` — the ordered statement of Hypatia's exemption - layers (total ban, universal excludes, built-in defaults, `.hypatia-ignore`, - inline directives, baseline, grid normalisation), the eight clashes found - between them, the rule that resolves each, the e/r (evidence/reason) - contract per reporter, the GitBot design rules, what is deliberately *not* - enforced, and the refusals that make the order a checked contract. -* `tests/workflows/verdict_grid_test.sh` (70 checks), `workflow_edges_test.sh` - (21) and `hypatia_ignore_test.sh` (22) — behaviour, wiring and firing controls - for the three scripts above, with stub `gh`/renderer and mutated workflow - copies, so every check is proven able to fail. -* `.machine_readable/policies/hypatia-rule-order.json` — the rule order as a - contract rather than prose: the seven layers with their rank, scope, owner and - what each may override; the eight concerns with exactly one owning workflow or - file each; the eight clashes with the rule that resolves each; the modules - `.hypatia-ignore` currently exempts and the layer each exemption lives in; and - the scanner, grid, renderer and jq-library pins the order was written against. -* `scripts/check-hypatia-rule-order.sh` — refuses a duplicate or gapped rank, a - layer that states no scope or no override, an owner outside the four declared - parties, a concern owned by a path that does not exist, a clash with no - resolution, a module exempted but unclassified (or classified but no longer - exempted), an exemption filed under a layer this repository may not change, - and any pin or digest that disagrees with `hypatia-scan.yml` or the lane - script. Exit 0 clean, 1 violation, 2 setup error. -* `tests/workflows/hypatia_rule_order_test.sh` (44 checks) — one mutation per - refusal above, run against a copy of the real policy. Two of its own first-draft - defects are documented in `docs/HYPATIA-RULE-ORDER.adoc`: `@tsv` collapses an - empty field (a missing `overrides` was reported as a missing `scope`), and - `grep` under `set -e` exits before a missing pin can be diagnosed. -* `.machine_readable/policies/README.adoc` — the registry now says what each - policy states, what checks it, and that adding a policy means adding the - checker and its lane. -* `scripts/run-proven-suite.sh` gains the lane *Hypatia rule order & clash - resolution*, so the policy cannot drift from the four files it describes - without a red run; `tests/run_proven_suite_test.sh` asserts the lane is - dispatched (16). - -==== Changed - -* KYAML, step 5 of standards YAML-POLICY §5 (standards#1024): the three - estate-owned YAML files that no third-party bot rewrites are now KYAML - content: `build/container/compose.yaml`, `compose.example.yaml` and - `stapeln/.gatekeeper.yaml`. Each keeps its name, because Compose, the - Containerfile label and svalinn find it by name (§3.4). They were rewritten - by standards' `kyaml-format.sh` alone, which refuses any change to the - parsed data. Every comment line survives, and `.gatekeeper.yaml` is now - byte-identical to standards' `_shared/container/.gatekeeper.yaml`. - Estate Rules gains the ratchet "Converted YAML stays KYAML", which runs - that script at standards `75bd599` with yq 4.53.3, both sha256-verified. - Container narrowing at mint can delete any of the three files, so the - template must keep all of them, while a minted repository checks the ones - it kept and names the ones narrowing removed. - `tests/workflows/kyaml_ratchet_test.sh` covers the template and each - narrowing, and `tests/workflows/container_kyaml_test.sh` checks that the - conversion kept every value in the template's configs. Estate Rules runs - both. - Workflows wait for step 6 (standards#1025). Files that Dependabot, - FUNDING, issue forms, Probot settings, CodeRabbit, Copilot, GitLab CI or - pre-commit read or rewrite are not converted, as in standards. -* The workflow linter installs Bun 1.4.2, the estate pin, from its release - archive and checks its sha256, as Estate Rules installs its tools. It ran - `oven-sh/setup-bun@v2.2.0` with `bun-version: latest`, so the runtime was - unpinned, and SonarCloud rated a third-party action pinned by tag "C" - ("Use full commit SHA hash"), even though `actions.lock` pins its commit. - The linter's lock edge to setup-bun goes. The `setup-bun@v2.2.0` record - stays, because the commented Bun steps in `e2e.yml.template` resolve - through it. -* `.github/workflows/runtime-policy.yml` is removed, folded into governance - as the standards cicd-regularisation spec §14 rules. Governance's - "Language / package anti-pattern policy" fails any tracked - `package-lock.json`, a stricter test than this file's mixed-toolchain error, - and its "JS runtimes" jobs check `bun.lock`, `deno.lock` and - `pnpm-lock.yaml` against `package.json`. Its `actions.lock` record goes with - it, and `validate-template.sh` and `validate_workflows_test.sh` require - `governance.yml` in its place. Repositories minted from the template stop - receiving their own copy of the check. Governance now runs on pull requests - to any branch, as the removed workflow did, so a stacked pull request keeps - the check. `tests/workflows/runtime_policy_fold_test.sh`, which Estate Rules - runs, checks that both validators reject a tree without `governance.yml` and - accept none of the retired gates' names in its place. - `tests/workflows/governance_policy_test.sh`, also in Estate Rules under a - sha256-verified Bun 1.4.2, checks that the workflow and its lock record stay - gone, that governance's pull request trigger has no filter, and that its - standards call matches the lock. -* JavaScript runtimes follow the 2026-10-14 ruling (standards - LANGUAGE-POLICY §1.3–§1.4): Bun > Deno > pnpm > npm, from one - `package.json` whose `bun.lock`, `deno.lock` and `pnpm-lock.yaml` are all - written by `js-runtimes regen`. -** `.github/workflows/runtime-policy.yml` used to fail any repository - carrying more than one lock, so it failed every repository that follows the - ruling ("Mixed toolchains: 3 package managers"). Those three locks now count - as one dependency graph. `package-lock.json` next to them still fails. A - `deno.json` is a notice, not a warning. -** The provisioning engine (`build/just/provision-lib.sh`, - `provision-modes.sh`, `provision-check.sh`) is re-synced to standards - `ed04132e` (engine 0.6.0, standards#1255). A `package.json` provisions bun, - deno and pnpm, and deno and pnpm are no longer banned tools. -** The same policy appears in the arrival pack (`arrival-pack.ncl`, and - CLAUDE.md regenerated from it), `mise.toml`, `docs/SETUP.adoc` PV-W23, - PV-W30 and PV-W34, the dev warm-up, `.cursorrules`, `.clinerules`, - `.windsurfrules`, `.github/copilot-instructions.md` and the PR template. -** The six standards reusables move from `ae36881` to `934b879`. At - `ae36881` governance's Actions lockfile verify installs gh-actions-lock - v0.1.6, which cannot read this lock's format v0.0.3 (exit 2, red on main). - `actions.lock` is re-keyed and closed at the new pin (setup-bun and - setup-deno records added), as resource-algebra#8 did. - -* Canonical `.well-known/` location moved from the repository root to - `www/.well-known/`. Well-known enforcement, Groove checks, the root-shape - allowlist, the SSG bootstrap and the documentation now prefer the `www/` - location and accept the legacy root location with a warning during the - migration window. - -==== Changed - -* Divergent root/`www/` `.well-known/` content is now quarantined to - `www/.legacy-well-known-/` instead of being left in place: the - estate-wide sweep (#119) is unattended, so a conflict must not halt it, and - must not be silent either. The `www/` copy is untouched, both hashes are - printed, and the run exits non-zero. `--in-place` keeps the previous - contract (preserve both, exit 1) for hand resolution. The quarantine lives - under `www/` rather than at the root because the root allowlist is matched - literally and bidirectionally, so a dated root directory would report as - drift in every repository swept. - -==== Fixed - -* Governance, Hypatia Security Scan, Mirror to Git Forges, Rust CI and - Secret Scanner start again. GitHub's runner now rejects a lock record whose - `ref:` is the record's own SHA ("invalid lockfile pin"), and nine of this - lock's action records had one. The standards reusables move from `6a92510` - to `75bd599`, whose own lock carries tag refs - (hyperpolymath/standards#1271, hyperpolymath/standards#1285), and - `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 - `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 - the recipe's own rewrite program on fixtures. -* CLAUDE.md prints the deed's typed identity (`#u5""`) instead of - the derived uuid5 in hex, and the deed's identity comment no longer - spells it out. ADR-008's strict v8 gate (governance "UUID v7 - conformance") rejected both, in the template and in every minted repo. -* The standards reusables are pinned to `6a92510`, whose governance job - installs gh-actions-lock v0.2.0. At `ae36881` it installed v0.1.6, which - refuses lock format v0.0.3 ("newer than this binary supports"), so - Actions lockfile verify failed. `actions.lock` was relocked with - standards' `propagate-workflow-pins.sh` (hyperpolymath/standards#1254). - `6a92510` also scans the julia-library overlay's `Project.toml.in` as a - `Project.toml` (hyperpolymath/standards#1258), so its `[extras]` registry - UUIDs no longer fail the strict v8 gate. -* The non-interactive mint completes. `RSR_NON_INTERACTIVE=1` used to - stub `read` for the whole recipe, so an unanswered prompt killed the - mint under `set -u` and the substitution loops never ended. Prompts now - read answers from the environment; `tests/workflows/non_interactive_mint_test.sh` - drives that path in Estate Rules, and the docs that warned agents off it - now describe it. -* A mint leaves just's own interpolation of `project` alone, regenerates - CLAUDE.md and the repository map from the child's deed and tree, keeps - the deed's `reject-if-contains` detector, and no longer breaks the - OpenSSF audit table when no OpenSSF id is given. -* The standards reusables are pinned to standards main (`ae36881`), where - the Actions lockfile verify job pins its tool and treats `sha-as-ref` - as advisory. -* The julia-library lock fragment is at the spine's lockfile format - v0.0.3, so Julia mints merge it again. - -* Julia mints start with Lock Sync green. The julia-library overlay - shipped its own `actions.lock`, which replaced the spine's at mint, so - every spine workflow lost its records. The records now ship beside the - overlay and are merged in. The overlay workflows gain SPDX headers and - top-level permissions, and julia-docs builds with plain steps instead of - the allowlist-refused julia-buildpkg/julia-docdeploy. julia-actions/cache - moves to v3.5.0. The root allowlist admits `?Project.toml` and `?test/`. - The docs checkout sets `persist-credentials: false`, so package code run - while the docs environment is set up finds no stored token. deploydocs - still receives GITHUB_TOKEN. -* `just repo-init julia-library` accepts a `.jl` slug. The PROJECT - tokens map its dot to an underscore, and the default service name is the - slug in lower case. - -* Dev container starts for everyone: dropped the ghcr.io dev container - features (anonymous pulls returned 403), installing just from Wolfi and a - SHA-256-checked Nickel 1.17.0 binary instead. The default - `.devcontainer/devcontainer.json` now targets rootless Podman - (`--userns=keep-id:uid=65532,gid=65532`, `label=disable`) so the workspace - is writable as wolfi-base's built-in `nonroot`; Docker, Codespaces and - Gitpod use `.devcontainer/docker/devcontainer.json`. -* `dot-wellknown-enforcement.yml` now drives the migrator that #106 described - but never wired up: previously the workflow only printed advice to run it, - so nothing verified that a repository would survive the migration. It now - runs the migrator in `--dry-run` and turns every conflict into a - `::warning` annotation — a warning, not an error, for the migration window. -* The migrator's acceptance test had encoded the in-place contract as the - required behaviour, contradicting #106's stated design; it now proves the - quarantine contract across nine scenarios, including the collision case - where a quarantine name is already taken. -* `tests/e2e/template_instantiation_test.sh` fed the three container answers - only when `container/` existed, but `build/just/repo-init.just` asks those - questions when `build/container/` does. On any complete checkout — which is - what CI clones — the recipe asked three questions the test had no answers - for, `read` hit EOF, and the recipe exited 1, so the instantiation e2e was - red at the container prompt. The guard now matches the recipe's own path. - (The test also needed `ruby` for the two mint tools. Those are Rust as - of 2026-09-18, so it no longer stops there.) - -* Restore the modular `just` recipes removed by the root-layout refactor, so - `just repo-init`, validation, assessment, container, Groove, and proof tasks - are available again. -* Require lowercase hyphenated repository slugs at initialization and verify - that both Guix package definitions receive the rendered slug and project URL. -* Keep template validation aligned with authority documents moved under - `docs/`, and repair the cross-platform `cloak`/`uncloak` recipe syntax. -* Restore the tracked-file language-ban gate with regression fixtures proving - that supported Zig passes while prohibited V-language remnants fail. +* Minted from `hyperpolymath/rsr-template-repo` with the `rust-cli` archetype; deed identity filled (IS, IS-NOT, chain). +* Phase 0 results: ADRs 0004–0011, threat model, maintainers' abandonment contract, Phase 0 report with measured numbers, + prior-art survey, estate-integration notes, upstream notes and the beyond-repo list. +* Error taxonomy (`src/errors/errors.toml`, 17 IDs), support matrix (`src/definitions/targets.toml`) and channel schema + (`src/contracts/channel-v1.schema.json`), with generators for runbooks, the error-report issue form and wiki tables. +* Twelve canaries (`tests/canaries/`), the bash prototype launcher, capsule factory and 43-check chaos suite (`scripts/proto/`), + and a std-only Rust fixture server (`examples/fixture_server.rs`). +* Issue forms (error report, capsule request, canary failure, DX feedback), project labels, PR checklist, agent rules + for Copilot, CodeRabbit and Claude. +* Wiki source for users, platform maintainers, developers and theorists (`docs/wikis/`), published by `wiki-sync.yml`. +* Best-practice comparison (`docs/status/BEST-PRACTICES.adoc`). + +==== Not yet + +* The Rust launcher, the capsule factory CI and published capsules (Phase 1). diff --git a/CITATION.cff b/CITATION.cff index ba88b6a6..c9f4b2d2 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,14 +1,13 @@ cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - - family-names: "{{AUTHOR_LAST}}" - given-names: "{{AUTHOR_FIRST}}" - orcid: "https://orcid.org/{{AUTHOR_ORCID}}" -title: "{{PROJECT_NAME}}" + - family-names: "Jewell" + given-names: "Jonathan D.A." +title: "idris2x" version: 0.1.0 -date-released: "{{CURRENT_DATE}}" -url: "https://{{FORGE}}/{{OWNER}}/{{REPO}}" -repository-code: "https://{{FORGE}}/{{OWNER}}/{{REPO}}" +date-released: "2026-11-16" +url: "https://github.com/metadatastician/idris2x" +repository-code: "https://github.com/metadatastician/idris2x" license: MPL-2.0 keywords: - "rsr" diff --git a/CLAUDE.md b/CLAUDE.md index 13f09ed2..b2ee0890 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,7 +6,7 @@ SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell - + # You are in the hyperpolymath estate — orient before acting @@ -39,7 +39,7 @@ The descriptive family (working name *descriptiles*) describes what-is; the **co | File | Answers | |---|---| -| `rsr-template-repo_chora.deed` | **CHORA**, the repo deed. Its header `:repo-uuid` is the repo's one id, and `(identity)` and `(lineage)` say what this repo IS; a `(clade)` clause, when present, records the repo's clade placements: identity facts about where it sits, never its id and never an edict. chora-registry (formerly `gv-clade-index`) is authoritative for them; this repo's validation checks only that a declared clade is one of the 12 shelves; `(meta)` the architecture axes; `(agentic)` *may I act now?*; `(ecosystem)` where it sits and what it is not; `(status)` and `(maturity)` where it is now. Read fields with `scripts/deed-field.sh`. | +| `idris2x_chora.deed` | **CHORA**, the repo deed. Its header `:repo-uuid` is the repo's one id, and `(identity)` and `(lineage)` say what this repo IS; a `(clade)` clause, when present, records the repo's clade placements: identity facts about where it sits, never its id and never an edict. chora-registry (formerly `gv-clade-index`) is authoritative for them; this repo's validation checks only that a declared clade is one of the 12 shelves; `(meta)` the architecture axes; `(agentic)` *may I act now?*; `(ecosystem)` where it sits and what it is not; `(status)` and `(maturity)` where it is now. Read fields with `scripts/deed-field.sh`. | | `(anchor)` | *Semantic authority + golden path* — what downstream may extend-not-redefine; if a recognised-drift / re-anchor marker is present, it **supersedes** accumulated context — read it first. | | `(neurosym)` | *Meaning* of operations — proof obligations. | | `(playbook)` | *How* permitted actions run. | @@ -114,18 +114,18 @@ and FRG letters, and ECHIDNA's `TrustLevel`, are different schemes. --- -# This repo: `rsr-template-repo` +# This repo: `idris2x` -- **Identity** — chora id `#uuid"8e515699-3fb9-8785-8883-ef2a100c2e02"`; clade: rm (placement); born 2026-03-16; forge `hyperpolymath/rsr-template-repo`. -- **IS** — Canonical RSR-compliant repository template: scaffolding (CI/CD, AI manifests, ABI/FFI standards, container ecosystem, governance) that new hyperpolymath projects are instantiated from. -- **IS-NOT** — a project in its own right · Scaffoldia (the full-featured repo designer) · standards (the canon source this template operationalises) -- **Where it sits** — pipeline position **foundation**; chain `standards → rsr-template-repo → (every estate repo)`; coordination = `standards`. +- **Identity** — chora id `#uuid"77688e35-8b7e-875f-870f-858748238496"`; clade: none declared (optional placement); born 2026-11-16; forge `metadatastician/idris2x`. +- **IS** — Materialize an exact, verified Idris 2 + Chez Scheme toolchain capsule from a lockfile and run it: signed data channel, content-addressed store, typed loud failures, offline and air-gap paths; built to keep working after its maintainer stops +- **IS-NOT** — an Idris 2 package manager (that is pack) · a fork or rebuild-with-patches of Idris 2 or Chez Scheme · a global default-version manager · official Idris 2 or Chez Scheme distribution · telemetry of any kind +- **Where it sits** — pipeline position **toolchain-provider**; chain `idris-lang/Idris2 + cisco/ChezScheme (upstream source) -> idris2x factory (capsules) -> idris2x launcher -> estate repos (proof and ABI work, mathesis receipts)`; coordination = `standards`. - **Constraints here** (AGENTIC) — fail-closed; evidence-per-step; no-silent-skip; rerun-after-fix; release-claim-requires-hard-pass. Never: banned langs (above), secrets, state files in repo root, AGPL. Details: the deed's `(bot-directives (methodology) (coverage) (debt))` clauses. - **Golden path** (ANCHOR) — `just test && just quality` → Core tests pass; Quality gates pass; No unresolved critical security findings. - **Anchor override** (ANCHOR) — This repo's anchor forbids: Node.js, npm. The anchor overrides the estate policy above. -- **State** — phase active; maturity production. Milestones and next actions: `docs/status/ROADMAP.adoc`. +- **State** — phase incubating; maturity experimental. Milestones and next actions: `docs/status/ROADMAP.adoc`. - + ## Estate-Wide Format Migration Directives @@ -180,7 +180,7 @@ never written, and a `#u7` literal is illegal. - Grammars: `standards/1-formats/deed/spec/abnf/deed.abnf` (authoritative over the deed README, D308) and `standards/1-formats/k9/` for k9. - Descriptiles (anchor, meta, state, ecosystem, agentic, neurosym, playbook) - are clauses of `rsr-template-repo_chora.deed` (D312). + are clauses of `idris2x_chora.deed` (D312). - Contractiles (intend, must, trust, adjust, bust, dust) are k9 contracts in `.machine_readable/contractiles//`. The deed attests to them (`:contractiles_required`, and a `(contractiles …)` clause per D312). @@ -189,3 +189,19 @@ never written, and a `#u7` literal is illegal. **ENFORCEMENT:** these rulings are recorded on `standards#787`. Some are ruled but not yet gated: check the gate on `standards` main before relying on it. + + +## idris2x: rules for agents working in this repository + +These are project facts, measured in Phase 0 (docs/status/PHASE0-REPORT.adoc). They bind every agent. + +* **Five invariants.** I1 no silent drift, I2 atomic or absent, I3 loud by default, I4 the past never breaks, I5 verify before trust. A change that adds a silent fallback, an untyped failure or a network call on the execution path is wrong even if tests pass. +* **Execution never reads the channel.** `install --locked` and `exec --locked` need only `idris2x.lock` and capsule bytes. Expiry, rollback protection and deprecation gate `pin`/`update` only (ADR 0008). +* **Every failure is typed.** Add or change errors only in `src/errors/errors.toml` (exit codes are append-only), then run `scripts/gen-runbooks.sh` and `scripts/gen-issue-forms.sh`. Never hand-edit `docs/runbooks/*.adoc` above the marker or `.github/ISSUE_TEMPLATE/error_report.yml`. +* **The environment contract is a reset** (ADR 0005): inherited `IDRIS2_*`, `LD_LIBRARY_PATH`, `DYLD_*`, `CHEZ`, `SCHEMEHEAPDIRS` are code search paths; the launcher sets them and inherits none unless `--inherit-env`. +* **Resume only immutable, digest-addressed downloads.** Never resume the channel manifest or any mutable document. +* **Archive extraction** rejects absolute names, `..`, links escaping the staging tree, devices and setuid bits, and uses a containment check, never `join(dst, clean(name))`. +* **Languages:** Rust for the launcher, bash + jq + awk for scripts. No Python, Go or Node.js (estate policy and this repo's anchor). The capsule factory *invokes* upstream Makefiles; it never patches Idris 2 or Chez Scheme (zero-fork policy). +* **The launcher stays under 1,000 lines of our own code.** A feature that does not fit belongs in the channel (data) or the capsule. +* **The maintenance agent** may only propose one of four shapes (`compat_patch`, `pin_bump`, `mirror_add`, `escalate`), never signs, never approves or merges its own PR, never widens `src/definitions/targets.toml`. Any open issue labelled `agent:kill-switch` stops it. +* **Report faithfully.** The launcher, factory and published capsules do not exist yet; do not describe planned behaviour as shipped. diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index 128a328d..03499a6e 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -1,6 +1,6 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // SPDX-FileCopyrightText: Jonathan D.A. Jewell (hyperpolymath) -= Contributing — rsr-template-repo += Contributing — idris2x :toc: left Contributors work on the *spine*: the template every RSR repo is minted @@ -12,15 +12,15 @@ is the estate's bar. [source,bash] ---- # Clone the repository -git clone https://github.com/hyperpolymath/rsr-template-repo.git -cd rsr-template-repo +git clone https://github.com/metadatastician/idris2x.git +cd idris2x # Using Guix (recommended for reproducibility) guix shell -D -f build/guix.scm # Or using toolbox/distrobox -toolbox create rsr-template-repo-dev -toolbox enter rsr-template-repo-dev +toolbox create idris2x-dev +toolbox enter idris2x-dev # Install dependencies manually # Verify setup @@ -80,10 +80,10 @@ and include: Look for issues labelled: -* https://github.com/hyperpolymath/rsr-template-repo/labels/good%20first%20issue[`good first issue`] — Simple Perimeter 3 tasks -* https://github.com/hyperpolymath/rsr-template-repo/labels/help%20wanted[`help wanted`] — Community help needed -* https://github.com/hyperpolymath/rsr-template-repo/labels/documentation[`documentation`] — Docs improvements -* https://github.com/hyperpolymath/rsr-template-repo/labels/perimeter-3[`perimeter-3`] — Community sandbox scope +* https://github.com/metadatastician/idris2x/labels/good%20first%20issue[`good first issue`] — Simple Perimeter 3 tasks +* https://github.com/metadatastician/idris2x/labels/help%20wanted[`help wanted`] — Community help needed +* https://github.com/metadatastician/idris2x/labels/documentation[`documentation`] — Docs improvements +* https://github.com/metadatastician/idris2x/labels/perimeter-3[`perimeter-3`] — Community sandbox scope == Development workflow diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..d49d44ed --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "idris2x" +version = "0.1.0" diff --git a/archetypes/rust-cli/overlay/Cargo.toml.in b/Cargo.toml similarity index 65% rename from archetypes/rust-cli/overlay/Cargo.toml.in rename to Cargo.toml index 2bd51eb0..a631808c 100644 --- a/archetypes/rust-cli/overlay/Cargo.toml.in +++ b/Cargo.toml @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MPL-2.0 -# SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (metadatastician) # -# minted by: just repo-init rust-cli ({{CURRENT_YEAR}}) +# minted by: just repo-init rust-cli (2026) # # The package name is the repository slug; the CRATE name (what `use` sees) is # its underscored form, which is the token used in src/*.rs and tests/*.rs. @@ -9,14 +9,14 @@ # `just build` and `just test` run (provision-lib.sh lang_cmd rust:*). [package] -name = "{{REPO}}" +name = "idris2x" version = "0.1.0" edition = "2021" rust-version = "1.80" license = "MPL-2.0" -description = "{{PROJECT_DESCRIPTION}}" -authors = ["{{AUTHOR}} <{{AUTHOR_EMAIL}}>"] -repository = "https://{{FORGE}}/{{OWNER}}/{{REPO}}" +description = "Hermetic, lockfile-pinned toolchain materializer for Idris 2 + Chez Scheme: signed, self-testing capsules and a tiny launcher designed to survive abandonment" +authors = ["Jonathan D.A. Jewell "] +repository = "https://github.com/metadatastician/idris2x" readme = "README.adoc" [dependencies] diff --git a/Justfile b/Justfile index b251ad9a..5e86514d 100644 --- a/Justfile +++ b/Justfile @@ -22,9 +22,9 @@ import? "build/contractile.just" mod provision 'build/just/provision.just' # Project metadata — customize these -project := "rsr-template-repo" -OWNER := "hyperpolymath" -REPO := "rsr-template-repo" +project := "idris2x" +OWNER := "metadatastician" +REPO := "idris2x" version := "0.1.0" tier := "infrastructure" # 1 | 2 | infrastructure @@ -636,7 +636,7 @@ opsm: provision::opsm # Guided tour of key features tour: - @echo "=== rsr-template-repo Tour ===" + @echo "=== idris2x Tour ===" @echo "" @echo "1. Project structure:" @ls -la @@ -651,12 +651,12 @@ tour: # Open feedback channel with diagnostic context help-me: - @echo "=== rsr-template-repo Help ===" + @echo "=== idris2x Help ===" @echo "Platform: $(uname -s) $(uname -m)" @echo "Shell: $SHELL" @echo "" @echo "To report an issue:" - @echo " https://github.com/hyperpolymath/rsr-template-repo/issues/new" + @echo " https://github.com/metadatastician/idris2x/issues/new" @echo "" @echo "Include the output of 'just doctor' in your report." diff --git a/README.adoc b/README.adoc index 00c04e60..9083dc26 100644 --- a/README.adoc +++ b/README.adoc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell // SPDX-FileCopyrightText: 2024-2026 Jonathan D.A. Jewell (hyperpolymath) -= {{PROJECT_NAME}} += idris2x :toc: :toc-placement: preamble @@ -12,132 +12,85 @@ image:https://img.shields.io/badge/Provenance-Quantum--Safe-blueviolet[Quantum-S // ── Standard & quality gates ──────────────────────────────────────────────── image:https://img.shields.io/badge/RSR-Rhodium_Standard-9C27B0[Rhodium Standard Repository,link="https://github.com/hyperpolymath/rhodium-standard-repositories"] -image:https://img.shields.io/endpoint?url=https://{{OWNER}}.github.io/{{REPO}}/badges/k9.json[K9 conformance,link="https://github.com/{{OWNER}}/{{REPO}}/actions/workflows/dogfood-gate.yml"] -image:https://www.bestpractices.dev/projects/{{OPENSSF_BP_ID}}/badge[OpenSSF Best Practices,link="https://www.bestpractices.dev/projects/{{OPENSSF_BP_ID}}"] -image:https://api.scorecard.dev/projects/github.com/{{OWNER}}/{{REPO}}/badge[OpenSSF Scorecard,link="https://scorecard.dev/viewer/?uri=github.com/{{OWNER}}/{{REPO}}"] -image:https://sonarcloud.io/api/project_badges/measure?project={{OWNER}}_{{REPO}}&metric=alert_status[SonarQube Quality Gate,link="https://sonarcloud.io/summary/new_code?id={{OWNER}}_{{REPO}}"] -image:https://archive.softwareheritage.org/badge/origin/https://{{FORGE}}/{{OWNER}}/{{REPO}}/[Archived in Software Heritage,link="https://archive.softwareheritage.org/browse/origin/?origin_url=https://{{FORGE}}/{{OWNER}}/{{REPO}}"] +image:https://img.shields.io/endpoint?url=https://metadatastician.github.io/idris2x/badges/k9.json[K9 conformance,link="https://github.com/metadatastician/idris2x/actions/workflows/dogfood-gate.yml"] +image:https://api.scorecard.dev/projects/github.com/metadatastician/idris2x/badge[OpenSSF Scorecard,link="https://scorecard.dev/viewer/?uri=github.com/metadatastician/idris2x"] +image:https://sonarcloud.io/api/project_badges/measure?project=metadatastician_idris2x&metric=alert_status[SonarQube Quality Gate,link="https://sonarcloud.io/summary/new_code?id=metadatastician_idris2x"] +image:https://archive.softwareheritage.org/badge/origin/https://github.com/metadatastician/idris2x/[Archived in Software Heritage,link="https://archive.softwareheritage.org/browse/origin/?origin_url=https://github.com/metadatastician/idris2x"] // ── Provenance & ecosystem ────────────────────────────────────────────────── -image:https://img.shields.io/badge/Idris-Inside-5E5086?logo=idris&logoColor=white[Idris Inside,link="https://github.com/hyperpolymath/proven"] -image:https://img.shields.io/badge/Zig-Zero--overhead-F7A41D?logo=zig&logoColor=black[Zig Zero-overhead FFI,link="https://github.com/hyperpolymath/typed-wasm"] -image:https://api.thegreenwebfoundation.org/greencheckimage/{{FORGE}}[Green Web,link="https://www.thegreenwebfoundation.org/green-web-check/?url={{FORGE}}"] +image:https://api.thegreenwebfoundation.org/greencheckimage/github.com[Green Web,link="https://www.thegreenwebfoundation.org/green-web-check/?url=github.com"] -{{PROJECT_DESCRIPTION}} +*One command, exactly the compiler you pinned, or a loud error that tells you how to fix it.* + +idris2x materializes an exact Idris 2 + Chez Scheme toolchain from a lockfile and runs it. It downloads an immutable, +signed, self-testing *capsule*, verifies it, unpacks it atomically into a content-addressed cache, runs canaries, and execs +the real compiler. It needs no system Chez, no `sudo`, no Nix and no mise. It works offline and air-gapped, and it is +designed so that existing pins keep working even if this project is abandoned. [IMPORTANT] ==== -*This file is a template.* You are reading `README.adoc` from the *RSR template repo* -(or a freshly-cloned copy of it). Run `just repo-init` to replace every `{{PLACEHOLDER}}` -token with your project's details, then delete this admonition. Until you do, the -`{{...}}` markers below are intentional placeholders, not content. +*Status: Phase 0 complete, Phase 1 not started.* The design is pinned in eight ADRs and was tested on real builds: +43 chaos drills and 11 of 12 canaries pass against a prototype launcher (bash) and a real Linux x86_64 capsule. +The Rust launcher, the capsule factory CI and published capsules do *not* exist yet. Nothing below the "Planned" line +is usable today. Unofficial; not affiliated with the Idris 2 or Chez Scheme projects. ==== -== What this is - -A new repository scaffolded from the *Rhodium Standard Repository (RSR)* template: -a batteries-included starting point that ships with CI/CD, machine-readable project -metadata, an AI-agent gatekeeper protocol, a formally-typed ABI/FFI seam -(Idris2 + Zig), container and reproducible-build scaffolding, and governance -infrastructure — all wired and passing the RSR validators on day one. - -Replace this section with a description of *your* project once initialised. - -== Quick start - -[source,bash] ----- -# 1. Create a repo from this template (or clone it), then from the repo root: -mise trust # allow this repository's mise.toml (needed without a TTY) -mise install # the toolchain, including the yq repo-init needs -mise exec -- just repo-init # interactive bootstrap: fills every {{PLACEHOLDER}} - -# 2. See the available tasks: -mise exec -- just # lists all phases (build, test, validate, audit, ...) - -# 3. Check the repo still satisfies the RSR shape: -mise exec -- just validate # structure + metadata checks ----- - -`mise exec --` puts the toolchain on `PATH` for that one command. Once mise is -activated in your shell (`eval "$(mise activate bash)"`, or your shell's -equivalent), plain `just` works and the prefix can be dropped. +== Why -`just repo-init` prompts for the project name, owner, author, licence contact, and the -other values listed in `.machine_readable/ai/PLACEHOLDERS.adoc`, substitutes them -across the tree, validates the result, and (if available) runs the `k9-svc` checks. +Installing Idris 2 today means building it from source against whichever Chez Scheme your system happens to have +(pack, distro packages, Homebrew), and the compiler bakes absolute paths into everything it produces. idris2x treats a +compiler toolchain as an *artifact with a digest*, not a package: the same lockfile gives the same compiler on a laptop, +in CI, on a server and in an air-gapped lab, years apart. -[[ai-install]] -== AI-Assisted Installation (Recommended) +== Five invariants -=== Just say it +[cols="1,2,4",options="header"] +|=== +| ID | Invariant | Meaning +| I1 | No silent drift | What executes is exactly the pinned digest, or nothing. +| I2 | Atomic or absent | The store never contains half-state. Interrupted installs are garbage by definition. +| I3 | Loud by default | Every failure is a typed error with a stable ID, an exit code, a runbook and the exact fix command. +| I4 | The past never breaks | Old digests run under new launchers. A lockfile plus capsule bytes is sufficient forever. +| I5 | Verify before trust | Signature, digest and probes before first execution. +|=== -Say this to any AI assistant that can read a URL and run commands (or give you -commands to paste): +== Planned usage (Phase 1) -[source,text] +[source,bash] ---- -Create a new repository from https://github.com/hyperpolymath/rsr-template-repo +idris2x init # scaffold idris2x.toml +idris2x pin 0.8.0 # verify the signed channel, write idris2x.lock +idris2x exec --locked -- idris2 --check src/Proof.idr +idris2x doctor --json # fingerprint, probes, exact fix commands +idris2x fetch -o bundle.tar.gz # air-gap prefetch; then: idris2x install --from bundle.tar.gz +idris2x gc --keep-last 3 # reclaim the store ---- -The URL is the key: it leads the assistant to -link:docs/AI_INSTALLATION_GUIDE.adoc[`docs/AI_INSTALLATION_GUIDE.adoc`], the -complete step-by-step recipe. The assistant checks your system, installs the -prerequisites, instantiates the template with `just repo-init`, and verifies the -result with `just doctor`. +Today the same surface exists as a tested prototype for Linux: link:scripts/proto/[`scripts/proto/idris2x.sh`]. -* "Set up rsr-template-repo so I can work on the template itself — https://github.com/hyperpolymath/rsr-template-repo" -* `./launcher.sh --ai-setup` (or `just ai-setup`) prints the line and the guide path. +== What Phase 0 established -=== What you will be asked +* Upstream ships no Linux or macOS binaries of either project, so capsules are built from pinned sources: Chez 10.4.1 in 164 s, Idris 2 v0.8.0 in 604 s on four cores. +* Relocation works without patching: Chez 10 finds its boot files relative to the executable, and Idris 2 honours `IDRIS2_PREFIX` at runtime. The launcher execs `scheme --program idris2.so` directly with an environment it *resets* (link:docs/decisions/0005-relocation-by-direct-exec.adoc[ADR 0005]). +* A Linux x86_64 capsule is 137 MB unpacked and 35 MB gzip; a cold install from a mirror takes 3.3 s. +* Nine assumptions of the original plan were refuted or corrected with primary sources; the launcher is Rust, per the estate language policy (link:docs/decisions/0011-estate-compliance-mint-rust-cli.adoc[ADR 0011]). -. Your operating system (Linux, macOS, or Windows via WSL2). -. The new project's name, owner, author and licence contact (the values listed in - `.machine_readable/ai/PLACEHOLDERS.adoc`). -. To confirm the privacy notice below. +Full evidence: link:docs/status/PHASE0-REPORT.adoc[Phase 0 report]. -=== Privacy and security +== Documentation -[IMPORTANT] -==== -Setting up rsr-template-repo clones this repository and installs its developer -tools per-user with mise (no administrator rights, nothing sent anywhere). -`just repo-init` rewrites files only inside the new checkout; it creates no -remote repository and pushes nothing until you do. -==== +[cols="1,3",options="header"] +|=== +| You are | Start at +| A user (developer, student, researcher) | link:https://github.com/metadatastician/idris2x/wiki[Wiki] → Getting started, Install, Uninstall, Troubleshooting +| A platform maintainer (CI fleets, mirrors, air-gapped labs) | Wiki → Platform maintainers; link:docs/architecture/THREAT-MODEL.adoc[threat model] +| A contributor | link:CONTRIBUTING.adoc[CONTRIBUTING]; link:docs/decisions/README.adoc[ADRs]; link:scripts/proto/README.adoc[prototype] +| A theorist | Wiki → Theory: the formal model; link:docs/status/PROOF-STATUS.adoc[proof status] +| Maintaining this project | link:docs/MAINTAINERS.adoc[MAINTAINERS] (the abandonment contract) +| An AI agent | link:CLAUDE.md[CLAUDE.md], then the deed `idris2x_chora.deed` +|=== -=== Minting without a terminal - -Agents and CI can mint non-interactively: set `RSR_NON_INTERACTIVE=1` and pass -the answers as environment variables named like the prompts' variables in -`build/just/repo-init.just` (`PROJECT_NAME`, `REPO`, `OWNER`, `AUTHOR` and -`AUTHOR_EMAIL` are required; any other answer left unset is blank or takes its -default). Piping the answers to stdin in prompt order also works. - -=== Troubleshooting - -Run `just doctor`; each FAIL carries a code explained in -link:docs/SETUP.adoc#troubleshooting[`docs/SETUP.adoc` §Troubleshooting], and -`just heal` applies the automatic fixes. Prefer to do it yourself? The full -manual route is link:docs/SETUP.adoc[`docs/SETUP.adoc`]; developers and -maintainers can brief an AI with `just ai-warmup dev` / `just ai-warmup maintainer`. - -== What you get - -* *Machine-readable metadata* (`.machine_readable/descriptiles/`) — `STATE`, `META`, - `ECOSYSTEM`, `PLAYBOOK`, `AGENTIC`, `NEUROSYM`, `CLADE`, and `anchors/ANCHOR`, - in deed, so tools and agents can read the project's state and boundaries. -* *AI gatekeeper protocol* — `rsr-template-repo_chora.deed` (the repo deed) is the - universal entry point that tells an AI agent how to work in this repo before it - touches anything; it carries the AI allocation policy and the ply directory tree. -* *Typed ABI/FFI seam* — `src/interface/Abi/` (Idris2 type + layout proofs) over - `src/interface/ffi/` (Zig implementation), with generated C headers. -* *CI/CD* — GitHub Actions for quality, security (CodeQL, Scorecard, secret - scanning), multi-forge mirroring, and RSR anti-pattern enforcement. -* *Supply-chain & reproducibility* — container layering (stapeln), Guix shells, - SBOM, and signing hooks. -* *Governance* — `GOVERNANCE.adoc`, `MAINTAINERS.adoc`, `.github/` community health - files, and a release `AUDIT.adoc` gate. +The wiki is generated from link:docs/wikis/[`docs/wikis/`] so it is reviewed like code. == Governance badges @@ -180,34 +133,22 @@ The authoritative map is generated, so it cannot drift from the tree: link:docs/architecture/REPOSITORY-MAP.adoc[docs/architecture/REPOSITORY-MAP.adoc] (regenerate with `just repo-map`; CI fails if it is stale). -The short version: - [cols="1,3"] |=== | Path | What lives there -| `README.adoc`, `CLAUDE.md` | Start here - humans and AI agents respectively. -| `src/`, `tests/` | The code and its tests. -| `docs/` | Human documentation, including the full map above. -| `.machine_readable/` | Manifests, contractiles and policies that tools read. -| `build/`, `Justfile` | Every task runs through `just`; phases live in `build/just/`. -| `ci/`, `.github/` | CI configuration; GitHub reads `.github/` and no other path. +| `src/` | The Rust launcher (Phase 1); `src/errors/errors.toml` (error taxonomy), `src/definitions/targets.toml` (support matrix), `src/contracts/channel-v1.schema.json` (signed channel schema). +| `tests/canaries/` | The twelve atomic canaries every capsule must pass. +| `scripts/proto/` | The Phase 0 prototype launcher, capsule factory and chaos suite. +| `docs/decisions/`, `docs/status/`, `docs/runbooks/` | ADRs; evidence and tracking; one runbook per error ID (generated). +| `docs/wikis/` | Source of the GitHub wiki. +| `.machine_readable/`, `idris2x_chora.deed` | Machine-readable identity, contractiles and policies. +| `build/`, `Justfile`, `.github/` | Every task runs through `just`; CI. |=== -== Where to go next - -* link:docs/architecture/REPOSITORY-MAP.adoc[The repository map] — generated; what every directory is for. -* link:docs/EXPLAINME.adoc[EXPLAINME] — the engineering deep-dive: how the pieces actually work. -* link:docs/AFFIRMATION.adoc[AFFIRMATION] — the dated, signed honesty snapshot of the repo's true state. -* link:docs/AUDIT.adoc[AUDIT] — the release audit gate. -* link:docs/AI_INSTALLATION_GUIDE.adoc[AI installation guide] — for agents instantiating this template. -* link:.machine_readable/ai/PLACEHOLDERS.adoc[PLACEHOLDERS] — the full placeholder reference. - == Licence -Code, configuration and scripts are link:LICENSE[Mozilla Public License 2.0] -(`MPL-2.0`); prose documentation is `CC-BY-SA-4.0`. Both texts live in -`LICENSES/`, and per-file `SPDX-License-Identifier` headers are authoritative. -The GitHub-detected licence is MPL-2.0 (the root `LICENSE`). Long-term -attribution uses Quantum-Safe Provenance — see -link:docs/legal/EXHIBIT-B-QUANTUM-SAFE.txt[the Quantum-Safe Provenance exhibit]. +Code, configuration and scripts are link:LICENSE[Mozilla Public License 2.0] (`MPL-2.0`); prose documentation is +`CC-BY-SA-4.0`. Capsules redistribute Chez Scheme (Apache-2.0 with NOTICE, plus LZ4 BSD-2, Nanopass MIT, zlib) and +Idris 2 (BSD-3-Clause) under their own licences, shipped verbatim inside each capsule. Long-term attribution uses +Quantum-Safe Provenance — see link:docs/legal/EXHIBIT-B-QUANTUM-SAFE.txt[the Quantum-Safe Provenance exhibit]. diff --git a/SUPPORT.adoc b/SUPPORT.adoc index b06c59a3..9c9c5f34 100644 --- a/SUPPORT.adoc +++ b/SUPPORT.adoc @@ -2,6 +2,6 @@ For questions, help, and community discussion: -- GitHub Discussions: https://github.com/{{OWNER}}/{{REPO}}/discussions -- GitHub Issues: https://github.com/{{OWNER}}/{{REPO}}/issues +- GitHub Discussions: https://github.com/metadatastician/idris2x/discussions +- GitHub Issues: https://github.com/metadatastician/idris2x/issues - Documentation: See README.adoc in the root directory. diff --git a/archetypes/README.adoc b/archetypes/README.adoc deleted file mode 100644 index 2a58e122..00000000 --- a/archetypes/README.adoc +++ /dev/null @@ -1,116 +0,0 @@ -// SPDX-License-Identifier: CC-BY-SA-4.0 -// Copyright (c) Jonathan D.A. Jewell -= Archetypes — template-only overlay data for `just repo-init` - -An *archetype* specialises the spine for one kind of repository (a Julia -library, a WordPress plugin, …) **as data, not as a fork**. Each archetype is -a directory here: - - archetypes//_praxis.deed required — the contract (see below) - archetypes//overlay/ optional — files copied over the spine - archetypes//actions.lock required when the overlay ships workflows - -Decision record: `docs/decisions/0003-forge-and-sustain-lifecycle.adoc`. -Normative lifecycle: standards `spec/SCAFFOLD-LIFECYCLE.adoc`. - -== The contract (`_praxis.deed`) - -A `praxis-deed` (standards `1-formats/deed/spec/abnf/deed.abnf`), read by -`just repo-init` through `scripts/deed-field.sh`. Values are single-line -strings: - -- `(metadata :archetype … :schema_version …)`. -- `(capability :preset "")` — MUST name a preset in standards - `.machine_readable/template-capability-gates.toml [presets]`. The archetype - directory name and the preset name are the same string by convention. -- `(tokens :TOKEN "value" …)` — one pair per token. Only tokens the archetype can - honestly determine (`PROJECT_KIND`, `PROJECT_DOMAIN`, `LANG_STACK`, - `BUILD_CMD`, `TEST_CMD`, `DEPS`, `BUILD_OUTPUT_PATH`, `MAIN_FUNCTION`). - Values MUST NOT contain `|` (the init sed delimiter — init skips such - values with a warning). Judgement-only tokens - (`PROJECT_UNIQUE_STRENGTH`, `TARGET_AUDIENCE`, `MUST_INVARIANTS`, - per-repo names like `PACKAGE_NAME`) MUST be omitted so they stay - `UNASSIGNED` — an archetype never writes fiction. - -`just repo-init ` applies the overlay directory (if present), adds the -token substitutions, and writes the preset into the minted repo's -deed's `(rsr-profile)` clause. This whole `archetypes/` directory is -template-only and is removed from the minted tree, exactly like -`build/templates/`. - -== Workflows and their lock records - -An overlay that ships workflows ships their lock records **beside** the -overlay, as `archetypes//actions.lock`, and never inside it. An -`overlay/.github/workflows/actions.lock` would replace the spine's lock when -the overlay is copied, and every spine workflow would then be refused at -startup for want of a record. That is how the first Julia mints -(ZeroInflatedCounts.jl, ResidualEvidenceTypes.jl) began with Lock Sync red. - -`just repo-init` merges the fragment into `.github/workflows/actions.lock` -with `scripts/merge-actions-lock.rs`: entries are unioned, and a key present -in both files with a different record stops the mint. Write the fragment with -the authoritative tool, never by hand: - -. Copy the overlay workflows into an empty git repository, under - `.github/workflows/` and under their minted names (drop the `.in`). -. Run `gh actions-lock --no-narrow` there, then `gh actions-lock --no-fix` - to check it. -. Run `scripts/check-lock-sync.sh` from the spine there too. `--no-fix` is - not enough: over a SHA-pinned `uses:`, `--no-narrow` can record the pin's - own SHA as `ref:`, which the tool reports only as the advisory `sha-as-ref` - while the runner refuses it at `Set up job` ("invalid lockfile pin"). - Clause 5 of `check-lock-sync.sh` refuses that record. The overlays here pin - by tag, so they do not hit this today; a SHA-pinned overlay would. -. Copy the resulting `.github/workflows/actions.lock` to - `archetypes//actions.lock`. - -Regenerate it in the same PR as any `uses:` change in the overlay. -`tests/workflows/archetype_lock_merge_test.sh` mints each archetype's -workflow set and runs `scripts/check-lock-sync.sh` on the merged lock. - -== Removing modules the preset does not declare (`prune.txt`) - -The spine is polyglot on purpose: it carries modules that some archetypes need -and others must not have. An overlay adds files; it cannot subtract them — and -a Julia package that ships `build/container/` inherits a `Containerfile` built -for a service, which then fails `trust-container-images-pinned` in a repository -that will never build an image. - -So an archetype may ship a `prune.txt` beside its contract: one path per line, -relative to the minted root, `#` for comments, trailing `/` for a directory. -`just repo-init` reads it *after* it has recorded what the overlay wrote and -*before* it renames any `.in` file. It removes each listed path that exists -and warns on stderr when an entry is stale. The removed paths are recorded in -`MINT_REMOVES` and written to the minted variant provenance. - -Removal is a declaration: a line in `prune.txt` says "this preset does not -carry this capability", and the preset in -`.machine_readable/template-capability-gates.toml [presets]` should agree. It -is not a place to hide files that fail a gate. - -== Current archetypes - -- `julia-library` — reference instance, harvested from - rsr-julia-library-template-repo's variant record (ADR-0002) and the - dormant scaffoldia registry's `julia/package.ncl`. The variant repo - remains the full hand-maintained reference until the scaffoldia - inversion; this archetype covers the `just repo-init` path. - Ships `overlay/scripts/julia-quality.jl` (the `fmt`, `fmt-check` and `lint` - verbs, run in a private Julia tools environment so Aqua and JuliaFormatter - never enter the package's own dependency set) and its - `provisioning_praxis.deed` override; prunes `build/container/`. -- `rust-cli` — the preset `rust-cli` from the canon. Ships `Cargo.toml.in`, - `src/{lib,main}.rs.in`, `tests/cli.rs.in` and a std-only - `benches/about.rs.in` (`harness = false`, no criterion, so the lockfile stays - dependency-free), so a minted CLI has a real library-plus-binary split, one - integration test and a compiling Rust bench rather than a - `println!` stub that no test can fail. Prunes `build/container/` for the same - reason as `julia-library`: a CLI that publishes no image should not ship a - `Containerfile`. - -Declared, content to follow (presets already reserved in the canon): -`wordpress-plugin`, `zotero-plugin`, `userscript`, `rust-ffi-lib`, -`rust-service`, `formal-proof-lib`, `docs-site`, `affinescript-app`, `canon`. -Do not stub them empty — an archetype exists when its contract and overlay are -real. diff --git a/archetypes/julia-library/actions.lock b/archetypes/julia-library/actions.lock deleted file mode 100644 index d7fca002..00000000 --- a/archetypes/julia-library/actions.lock +++ /dev/null @@ -1,41 +0,0 @@ -# This file is machine-generated by `gh actions-lock`. -# Do not edit by hand; run `gh actions-lock` to update. -# Docs: https://gh.io/actions-lockfile -version: 'v0.0.3' -workflows: - '.github/workflows/julia-ci.yml': - - 'actions/checkout@v7.0.1' - - 'julia-actions/cache@v3.5.0' - - 'julia-actions/setup-julia@v3.0.2' - '.github/workflows/julia-docs.yml': - - 'actions/checkout@v7.0.1' - - 'actions/download-artifact@v8.0.2' - - 'actions/upload-artifact@v7.0.2' - - 'julia-actions/cache@v3.5.0' - - 'julia-actions/setup-julia@v3.0.2' -dependencies: - 'actions/checkout@v7.0.1': - ref: 'v7.0.1' - commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1' - owner_id: 44036562 - repo_id: 197814629 - 'actions/download-artifact@v8.0.2': - ref: 'v8.0.2' - commit: 'sha1-9000827ccba6bdab643e8b6fd33ac0654aef8333' - owner_id: 44036562 - repo_id: 192626254 - 'actions/upload-artifact@v7.0.2': - ref: 'v7.0.2' - commit: 'sha1-cf430e030ddbb5b0abf93d22962f4752f3646cd9' - owner_id: 44036562 - repo_id: 192625955 - 'julia-actions/cache@v3.5.0': - ref: 'v3.5.0' - commit: 'sha1-9353db09a0f2bbbdec6f41791918c75d37391b36' - owner_id: 53965732 - repo_id: 441908600 - 'julia-actions/setup-julia@v3.0.2': - ref: 'v3.0.2' - commit: 'sha1-fa02766e078afaaf09b14210362cee14137e6a32' - owner_id: 53965732 - repo_id: 202020219 diff --git a/archetypes/julia-library/julia-library_praxis.deed b/archetypes/julia-library/julia-library_praxis.deed deleted file mode 100644 index 497ea931..00000000 --- a/archetypes/julia-library/julia-library_praxis.deed +++ /dev/null @@ -1,37 +0,0 @@ -;; SPDX-License-Identifier: MPL-2.0 -;; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) -;; -;; julia-library_praxis.deed — the julia-library archetype for `just repo-init` -;; (ADR-0003). repo-init reads it with scripts/deed-field.sh: -;; (capability :preset) the capability preset; and -;; (tokens :) each value fills {{}} at mint. -;; -;; Harvested 2026-07-21 from rsr-julia-library-template-repo (its variant -;; record, the ADR-0002 reference instance) and the dormant scaffoldia registry -;; entry registry/julia/package.ncl. The variant repo remains the full -;; hand-maintained reference (Project.toml [compat] closure, Aqua+JET, -;; Documenter, flagship rubric); this archetype covers the `just repo-init` path. -;; -;; Contract rules: archetypes/README.adoc. Single-line values; no `|` in token -;; values (init's sed delimiter). Tokens omitted here stay UNASSIGNED on -;; purpose: PACKAGE_NAME and MUST_INVARIANTS are per-repo judgement, and an -;; archetype must not write fiction. -(praxis-deed - :schema-version "1.0.0" - :canonical-name "rsr-template-repo-archetype-julia-library" - (metadata - :archetype "julia-library" - :name "julia-library" - :schema_version "0.1.0" - :harvested-from "rsr-julia-library-template-repo variant record + scaffoldia registry julia/package.ncl") - (capability - ; Preset defined in standards .machine_readable/template-capability-gates.toml - :preset "julia-library") - (tokens - :PROJECT_KIND "library" - :PROJECT_DOMAIN "julia" - :LANG_STACK "Julia (1.9+)" - :BUILD_CMD "julia --project=. -e 'using Pkg; Pkg.instantiate()'" - :TEST_CMD "julia --project=. -e 'using Pkg; Pkg.test()'" - :DEPS "Julia General registry via Project.toml [deps] with [compat] closure" - :BUILD_OUTPUT_PATH "src/")) diff --git a/archetypes/julia-library/overlay/.github/workflows/julia-ci.yml.in b/archetypes/julia-library/overlay/.github/workflows/julia-ci.yml.in deleted file mode 100644 index 956a90f1..00000000 --- a/archetypes/julia-library/overlay/.github/workflows/julia-ci.yml.in +++ /dev/null @@ -1,105 +0,0 @@ -# This workflow is managed by gh actions-lock. -# SPDX-License-Identifier: MPL-2.0 -# {{PROJECT_NAME}} — Julia CI (julia-library archetype) -# -# Pin posture (estate ruling R2, 2026-09-02; D38/D39 resolution 2026-09-19): -# symbolic refs here, pinned by .github/workflows/actions.lock (same dir). -# The lock records come from archetypes/julia-library/actions.lock, merged -# into the spine's lock at mint. Refs resolved 2026-10-09: -# actions/checkout@v7.0.1 = 3d3c42e5aac5ba805825da76410c181273ba90b1 -# julia-actions/setup-julia@v3.0.2 = fa02766e078afaaf09b14210362cee14137e6a32 -# julia-actions/cache@v3.5.0 = 9353db09a0f2bbbdec6f41791918c75d37391b36 -# Regenerate the lock in the SAME PR as any uses: change (estate MUST). - -name: Julia CI - -on: - push: - branches: [main, master] - pull_request: - -permissions: - contents: read - -concurrency: - group: julia-ci-${{ github.ref }} - cancel-in-progress: true - -jobs: - fmt: - name: Format (JuliaFormatter) - runs-on: ubuntu-24.04 - timeout-minutes: 10 - steps: - - uses: actions/checkout@v7.0.1 - with: - persist-credentials: false - - uses: julia-actions/setup-julia@v3.0.2 - with: - version: "1" - - name: Check formatting (check mode — never writes in CI) - run: | - julia --project=. -e ' - using Pkg - Pkg.add("JuliaFormatter") - using JuliaFormatter - for f in filter(isfile, collect(Iterators.flatten(( - [joinpath("src", x) for x in readdir("src")], - [joinpath("test", x) for x in readdir("test") if x != "cases"], - [joinpath("test", "cases", x) for x in readdir(joinpath("test", "cases"))], - )))) - text = read(f, String) - formatted = JuliaFormatter.format_text(text) - if text != formatted - @error "not formatted" file=f - exit(1) - end - end' - - jet: - name: Static analysis (JET) - runs-on: ubuntu-24.04 - timeout-minutes: 10 - steps: - - uses: actions/checkout@v7.0.1 - with: - persist-credentials: false - - uses: julia-actions/setup-julia@v3.0.2 - with: - version: "1" - - uses: julia-actions/cache@v3.5.0 - - name: JET analysis (supported API) - run: | - julia -e ' - using Pkg - Pkg.activate(mktempdir()) - Pkg.develop(path=".") - Pkg.add(Pkg.PackageSpec(name="JET", version="0.12")) - using {{PROJECT_NAME}}, JET - - if !hasmethod(JET.test_package, (Module,)) - error("JET ", pkgversion(JET), " has no test_package(::Module) — " * - "the julia-library overlay pins an API that no longer exists.") - end - - JET.test_package({{PROJECT_NAME}})' - - test: - name: Test (Test + Aqua) - runs-on: ubuntu-24.04 - timeout-minutes: 15 - strategy: - fail-fast: false - matrix: - julia: ["1.9", "1"] - os: [ubuntu-24.04] - steps: - - uses: actions/checkout@v7.0.1 - with: - persist-credentials: false - - uses: julia-actions/setup-julia@v3.0.2 - with: - version: ${{ matrix.julia }} - - uses: julia-actions/cache@v3.5.0 - - name: Pkg.test() - run: julia --project=. -e 'using Pkg; Pkg.test()' diff --git a/archetypes/julia-library/overlay/.github/workflows/julia-docs.yml.in b/archetypes/julia-library/overlay/.github/workflows/julia-docs.yml.in deleted file mode 100644 index fe55bb8f..00000000 --- a/archetypes/julia-library/overlay/.github/workflows/julia-docs.yml.in +++ /dev/null @@ -1,91 +0,0 @@ -# This workflow is managed by gh actions-lock. -# SPDX-License-Identifier: MPL-2.0 -# {{PROJECT_NAME}} — docs build & deploy (julia-library archetype) -# -# Split into an unprivileged `build` job (`contents: read`, no write token -# exposed to untrusted package/doc evaluation — issue #232) and a minimal -# `deploy` job (`contents: write`) that publishes only the pre-built artifact -# to `gh-pages` on default-branch pushes. - -name: Docs - -on: - push: - branches: [main, master] - pull_request: - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: julia-docs-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - name: Build docs (read-only) - runs-on: ubuntu-24.04 - timeout-minutes: 15 - permissions: - contents: read - steps: - - uses: actions/checkout@v7.0.1 - with: - persist-credentials: false - - name: Layout gate — fail loud while docs/ is absent - run: | - if [ ! -f docs/Project.toml ] || [ ! -f docs/make.jl ] || [ ! -d docs/src ]; then - echo "::error::docs-site declared but no Documenter build: docs/Project.toml, docs/make.jl and docs/src/ are required. Either add the build or drop the docs-site capability from the repo deed's (rsr-profile) clause." - exit 1 - fi - - uses: julia-actions/setup-julia@v3.0.2 - with: - version: "1" - - uses: julia-actions/cache@v3.5.0 - - name: Instantiate the docs environment - run: julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - - name: Build static site without write credentials - env: - # Suppress Documenter deploydocs push inside the build job; deploy - # happens in the isolated job below without executing Julia code. - GITHUB_EVENT_NAME: pull_request - run: | - julia --project=docs docs/make.jl - test -d docs/build - - name: Upload built site artifact - uses: actions/upload-artifact@v7.0.2 - with: - name: julia-docs-site - path: docs/build - retention-days: 5 - - deploy: - name: Deploy docs to gh-pages - needs: build - if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') - runs-on: ubuntu-24.04 - timeout-minutes: 10 - permissions: - contents: write - steps: - - name: Download built site artifact - uses: actions/download-artifact@v8.0.2 - with: - name: julia-docs-site - path: site - - name: Publish static site to gh-pages branch - env: - REPO: ${{ github.repository }} - SHA: ${{ github.sha }} - TOKEN: ${{ github.token }} - run: | - set -euo pipefail - AUTH="AUTHORIZATION: basic $(printf 'x-access-token:%s' "${TOKEN}" | base64 -w0)" - touch site/.nojekyll - git -C site init -q -b gh-pages - git -C site config user.name "github-actions[bot]" - git -C site config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git -C site add -A - git -C site commit -q -m "docs: deploy ${SHA:0:12}" - git -C site -c http.extraheader="${AUTH}" push -q --force "https://github.com/${REPO}.git" gh-pages:gh-pages diff --git a/archetypes/julia-library/overlay/.machine_readable/descriptiles/provisioning_praxis.deed b/archetypes/julia-library/overlay/.machine_readable/descriptiles/provisioning_praxis.deed deleted file mode 100644 index b719b8b3..00000000 --- a/archetypes/julia-library/overlay/.machine_readable/descriptiles/provisioning_praxis.deed +++ /dev/null @@ -1,38 +0,0 @@ -;; SPDX-License-Identifier: MPL-2.0 -;; SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> -;; -;; provisioning_praxis.deed: the repo-specific facts behind `just setup/doctor/run/…`. -;; build/just/provision-lib.sh reads each `:key "value"` field below. Rules: -;; * one key per line, value in double quotes, and no double quote inside a value; -;; * an empty value "" means "use the per-language default"; -;; * a verb key (build test bench lint fmt fmt-check run deps) replaces the default. -;; -;; Written by the julia-library archetype at mint. The three overrides below are -;; the point: the engine has no Julia formatter or linter, so fmt, fmt-check and -;; lint were N/A, exited 0, and `just quality` printed a pass having run nothing -;; but `Pkg.test()` (measured in every Julia repo minted from this template -;; before 2026-10-30). scripts/julia-quality.jl supplies them. -;; -;; Canon: hyperpolymath/standards 3-practice/provisioning/PROVISIONING-STANDARD.adoc -(praxis-deed - :schema-version "1.0.0" - :canonical-name "{{PROJECT_NAME}}-provisioning" - :repo "{{OWNER}}/{{REPO}}" - :archetype "library" ; app | library | tool | theory | docs - :languages "julia" ; detected; informational - ;; Contract-verb overrides ("" = per-language default, which `just langs` shows) - :build "" - :test "" - :bench "" - :lint "julia --project=. scripts/julia-quality.jl lint" - :fmt "julia --project=. scripts/julia-quality.jl fmt" - :fmt-check "julia --project=. scripts/julia-quality.jl fmt-check" - :run "" - :deps "" - ;; Facts shown by `just config-show` and checked by `just doctor` - :config "" - :ports "" - :system-deps "julia" - ;; What `just ai-setup` and `just opsm` print ("" = the generic line) - :ai-say-it "" - :opsm-note "") diff --git a/archetypes/julia-library/overlay/Project.toml.in b/archetypes/julia-library/overlay/Project.toml.in deleted file mode 100644 index 0fa4b006..00000000 --- a/archetypes/julia-library/overlay/Project.toml.in +++ /dev/null @@ -1,38 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> -# -# minted by: just repo-init julia-library ({{CURRENT_YEAR}}) -# owner: {{OWNER}} -# -# uuid = "{{PACKAGE_UUID}}" is MINTED at mint as UUIDv8 profile C over the -# registered domain julia-package-identity, preimage -# github.com// (see repo-init's julia-library rule; the strict -# UUIDv8 gate rejects the v5 mint per ADR-008 D320). Profile C is -# deterministic, so the uuid is stable across re-mints of the same repo and -# never hand-edited. If the mint could not derive it (no python3 and no bun -# with standards' uuid-v8.js on the operator machine) it is UNASSIGNED and -# Pkg refuses to load the package until the owner assigns one. - -name = "{{PROJECT_NAME}}" -uuid = "{{PACKAGE_UUID}}" -description = "{{PROJECT_DESCRIPTION}}" -authors = ["{{AUTHOR}} <{{AUTHOR_EMAIL}}"] -license = "MPL-2.0" -version = "0.1.0" - -[deps] - -# Test uuid = stdlib, resolved via Base.identify_package("Test") 2026-09-19 -[extras] -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" - -# Aqua's deps_compat check requires a compat bound for EVERY extra — -# a template that omits these fails its own gate (measured 2026-09-19). -[targets] -test = ["Test", "Aqua"] - -[compat] -julia = "1.9" -Test = "1.9" -Aqua = "0.8" diff --git a/archetypes/julia-library/overlay/scripts/julia-quality.jl b/archetypes/julia-library/overlay/scripts/julia-quality.jl deleted file mode 100644 index d9275608..00000000 --- a/archetypes/julia-library/overlay/scripts/julia-quality.jl +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env julia -# SPDX-License-Identifier: MPL-2.0 -# SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> -# -# julia-quality.jl — the `fmt`, `fmt-check` and `lint` verbs for a Julia package. -# -# ── Why this file exists ──────────────────────────────────────────────────── -# -# `just quality` is fmt-check + lint + test. For a Julia package the engine had -# no command for fmt-check or lint, so both reported N/A, exited 0, and -# `just quality` printed a pass having run only `Pkg.test()`. A gate that cannot -# fail is not a gate. -# -# ── Why the tools live in their own environment ───────────────────────────── -# -# JuliaFormatter and Aqua are DEVELOPMENT tools. Putting them in the package's -# [deps] would ship them to every user of the library — and Aqua's own -# deps_compat/stale-deps checks fail a package that does that. `[extras]` is not -# enough either: extras resolve only inside `Pkg.test`'s temporary environment, -# so `julia --project=. -e 'using JuliaFormatter'` cannot see them. -# -# So they get a private environment (default ~/.cache/rsr/julia-quality, -# override with RSR_JULIA_QUALITY_ENV), the package is `develop`ed into it for -# lint, and the package's own Project.toml stays honest. The first run resolves -# the tools from the registry; the depot caches them afterwards. -# -# ── Usage ─────────────────────────────────────────────────────────────────── -# julia --project=. scripts/julia-quality.jl fmt # rewrite -# julia --project=. scripts/julia-quality.jl fmt-check # fail if it would -# julia --project=. scripts/julia-quality.jl lint # Aqua shape gate -# -# Exit: 0 pass, 1 finding, 2 usage, 3 the tool environment could not be built. - -using Pkg - -const ROOT = normpath(joinpath(@__DIR__, "..")) -const TOOLS = get(ENV, "RSR_JULIA_QUALITY_ENV", - joinpath(homedir(), ".cache", "rsr", "julia-quality")) -const CMD = isempty(ARGS) ? "" : ARGS[1] - -if !(CMD in ("fmt", "fmt-check", "lint")) - println(stderr, "usage: julia --project=. scripts/julia-quality.jl fmt|fmt-check|lint") - exit(2) -end - -mkpath(TOOLS) -Pkg.activate(TOOLS; io = devnull) - -"""Install `pkg` into the tools environment unless it is already loadable.""" -function ensure(pkg::AbstractString) - Base.find_package(pkg) === nothing || return - try - Pkg.add(pkg; io = devnull) - catch err - println(stderr, "FAIL: could not install ", pkg, " into ", TOOLS, ": ", err) - println(stderr, " a quality gate that cannot run its tool is not a pass.") - exit(3) - end - if Base.find_package(pkg) === nothing - println(stderr, "FAIL: ", pkg, " is still not loadable after Pkg.add") - exit(3) - end - return -end - -if CMD == "fmt" || CMD == "fmt-check" - ensure("JuliaFormatter") - @eval using JuliaFormatter - - # Judge by content, not by JuliaFormatter's return value. Its `format` - # documents the return as "was the tree already formatted" in some releases - # and "did it write" in others, so `changed` inverted this check on at least - # one: a clean scaffold failed and an unformatted one passed. Formatting a - # COPY and diffing the bytes cannot be ambiguous. - jl_files(root) = [joinpath(d, f) for (d, _, fs) in walkdir(root) - for f in fs if endswith(f, ".jl")] - - if CMD == "fmt" - n = length(jl_files(ROOT)) - format(ROOT; overwrite = true, verbose = false) - println("PASS: formatted ", n, " Julia file(s) in place") - else - tmp = mktempdir() - copy_root = joinpath(tmp, "tree") - cp(ROOT, copy_root; force = true) - before = Dict(f => read(f) for f in jl_files(copy_root)) - format(copy_root; overwrite = true, verbose = false) - dirty = sort!([relpath(f, copy_root) for (f, bytes) in before if read(f) != bytes]) - rm(tmp; recursive = true, force = true) - if !isempty(dirty) - println(stderr, "FAIL: JuliaFormatter would rewrite ", length(dirty), - " file(s) — run: just fmt") - foreach(f -> println(stderr, " ", f), dirty) - exit(1) - end - println("PASS: Julia formatting is clean") - end -else - ensure("Aqua") - # Aqua checks a LOADED package: develop this one into the tools environment - # so its own dependencies resolve, then bring it into scope by the name its - # Project.toml declares (a package's module name is not its directory name). - try - Pkg.develop(Pkg.PackageSpec(path = ROOT); io = devnull) - catch err - println(stderr, "FAIL: could not develop ", ROOT, " into the tools environment: ", err) - exit(3) - end - @eval using Aqua - - text = read(joinpath(ROOT, "Project.toml"), String) - m = match(r"(?m)^name\s*=\s*\"([^\"]+)\"", text) - if m === nothing - println(stderr, "FAIL: no name = \"…\" line in Project.toml") - exit(1) - end - modname = Symbol(m.captures[1]) - try - # `using Pkg` parses to Expr(:using, Expr(:., :Pkg)); a colon node is the - # `using A: b` form. Building the colon expression loads nothing, so the - # check failed for every package it was meant to validate. - Base.eval(Main, Meta.parse("using " * String(modname))) - catch err - println(stderr, "FAIL: the package does not load: ", err) - exit(1) - end - Aqua.test_all(getfield(Main, modname)) - println("PASS: Aqua package-shape checks are clean") -end diff --git a/archetypes/julia-library/overlay/src/PACKAGE.jl.in b/archetypes/julia-library/overlay/src/PACKAGE.jl.in deleted file mode 100644 index 3ac2c8a6..00000000 --- a/archetypes/julia-library/overlay/src/PACKAGE.jl.in +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> -# -module {{PROJECT_NAME}} - -# {{PROJECT_NAME}} — {{PROJECT_DESCRIPTION}} -# -# Forged from the hyperpolymath julia-library archetype ({{CURRENT_YEAR}}). -# Provenance: the repo deed's (provenance) clause, written at mint. -# -# The public API is whatever is `export`ed below; Aqua's exports/ambiguity -# checks gate it from the first mint, so keep exports deliberate. - -# --- public API ---------------------------------------------------------- - -# --- implementation ------------------------------------------------------ - -end # module {{PROJECT_NAME}} diff --git a/archetypes/julia-library/overlay/test/cases/smoke.jl b/archetypes/julia-library/overlay/test/cases/smoke.jl deleted file mode 100644 index 6d3c2ed9..00000000 --- a/archetypes/julia-library/overlay/test/cases/smoke.jl +++ /dev/null @@ -1,14 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> -# -# smoke.jl — the archetype's load-check case. -# -# This case proves the package LOADS (module resolution, no parse/load -# errors, top-level evaluation clean). It is deliberately not a behaviour -# test: a repo whose only case is this file has a NECESSARY-but-not- -# sufficient green. Replace it with real behaviour tests as they land — -# do not delete it (the Aqua suite already covers shape; this covers load). - -@testset "smoke — package loads" begin - @test @isdefined {{PROJECT_NAME}} -end diff --git a/archetypes/julia-library/overlay/test/runtests.jl b/archetypes/julia-library/overlay/test/runtests.jl deleted file mode 100644 index 021c5df9..00000000 --- a/archetypes/julia-library/overlay/test/runtests.jl +++ /dev/null @@ -1,34 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> -# -# {{PROJECT_NAME}} — test entry point (julia-library archetype) -# -# Two suites, in this order: -# 1. Aqua package-shape gate — runs FIRST: a package that does not load -# cleanly, whose deps are not compat-closed, or whose exports are -# ambiguous is rejected before any behaviour test can pass. -# 2. Behaviour — every test/cases/*.jl is included. The shipped case -# (smoke.jl) is a LOAD check only; replace/extend it as real -# behaviour tests land. Until then, `Pkg.test()` passing is necessary -# but NOT sufficient — record that in docs/status/ROADMAP.adoc (smoke-only suite). - -using Test -using {{PROJECT_NAME}} - -@testset "{{PROJECT_NAME}} — Aqua package shape" begin - using Aqua - Aqua.test_all({{PROJECT_NAME}}) -end - -@testset "{{PROJECT_NAME}} — behaviour" begin - # NOTE: no `continue`/`break` inside a `for` inside @testset — Test's - # loop-form detection re-parses the loop body at top level, where - # `continue` is a ParseError. Filter with a guarded call instead. - # (Measured trap, 2026-09-19 — see the Julia testing guide.) - cases = joinpath(@__DIR__, "cases") - if isdir(cases) - for path in sort(readdir(cases, join = true)) - endswith(path, ".jl") && include(path) - end - end -end diff --git a/archetypes/julia-library/prune.txt b/archetypes/julia-library/prune.txt deleted file mode 100644 index e2c7385f..00000000 --- a/archetypes/julia-library/prune.txt +++ /dev/null @@ -1,14 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# -# Spine modules this archetype does NOT carry, one repository-relative path per -# line. `container-images-pinned` means an unpinned Containerfile cannot ship; -# a Julia package has nothing to deploy, so the deployed-container module is -# dropped rather than shipped floating. The dev container stays (it is a -# development environment, not an artifact, and the pin gate scopes it out). -build/container/ -# Same rule for the polyglot seam: a Julia package declares neither the abi nor -# the ffi capability, so src/interface/ (abi.ipkg, ffi/build.zig) is carrier data -# from the template's spine, not part of this package. Shipping it made the mint -# detect Idris2 and Zig, install both, and run `idris2 --build` from `just build` -# in a package written in one language. -src/interface/ diff --git a/archetypes/rust-cli/overlay/src/main.rs.in b/archetypes/rust-cli/overlay/src/main.rs.in deleted file mode 100644 index ebad037e..00000000 --- a/archetypes/rust-cli/overlay/src/main.rs.in +++ /dev/null @@ -1,6 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> - -fn main() { - println!("{}", {{project}}::about()); -} diff --git a/archetypes/rust-cli/prune.txt b/archetypes/rust-cli/prune.txt deleted file mode 100644 index 34b1f778..00000000 --- a/archetypes/rust-cli/prune.txt +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# -# Spine modules this archetype does NOT carry, one repository-relative path per -# line. `container-images-pinned` means an unpinned Containerfile cannot ship; -# a CLI library has nothing to deploy, so the deployed-container module is -# dropped rather than shipped floating. The dev container stays (it is a -# development environment, not an artifact, and the pin gate scopes it out). -build/container/ -# The contract above says it plainly: "nothing here declares the ffi or abi -# capability, so the archetype must not ship the ...". The seam is the template's -# polyglot spine — src/interface/abi.ipkg (Idris2) and src/interface/ffi/build.zig -# (Zig) — and carrying it made a Rust CLI detect THREE languages: render-mise.sh -# installed idris2 and zig, and the inherited build/test recipes ran them. A -# Rust CLI that needs an Idris2 toolchain is not a Rust CLI. -src/interface/ diff --git a/archetypes/rust-cli/rust-cli_praxis.deed b/archetypes/rust-cli/rust-cli_praxis.deed deleted file mode 100644 index e8614b12..00000000 --- a/archetypes/rust-cli/rust-cli_praxis.deed +++ /dev/null @@ -1,37 +0,0 @@ -;; SPDX-License-Identifier: MPL-2.0 -;; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) -;; -;; rust-cli_praxis.deed — the rust-cli archetype for `just repo-init` -;; (ADR-0003). repo-init reads it with scripts/deed-field.sh: -;; (capability :preset) the capability preset; and -;; (tokens :) each value fills {{}} at mint. -;; -;; The preset name matches a [presets] entry in standards -;; .machine_readable/template-capability-gates.toml: -;; rust-cli = ["rust", "cli", "library"] -;; It is deliberately the CLI/library preset and not rust-ffi-lib: nothing here -;; declares the ffi or abi capability, so the archetype must not ship the -;; Zig/Idris2 seam as if it did. -;; -;; Contract rules: archetypes/README.adoc. Single-line values; no `|` in token -;; values (init's sed delimiter). Tokens omitted here stay UNASSIGNED on -;; purpose: PACKAGE_NAME and MUST_INVARIANTS are per-repo judgement, and an -;; archetype must not write fiction. -(praxis-deed - :schema-version "1.0.0" - :canonical-name "rsr-template-repo-archetype-rust-cli" - (metadata - :archetype "rust-cli" - :name "rust-cli" - :schema_version "0.1.0") - (capability - ; Preset defined in standards .machine_readable/template-capability-gates.toml - :preset "rust-cli") - (tokens - :PROJECT_KIND "cli" - :PROJECT_DOMAIN "rust" - :LANG_STACK "Rust (edition 2021)" - :BUILD_CMD "cargo build --release" - :TEST_CMD "cargo test --all-targets" - :DEPS "crates.io via Cargo.toml with a [compat] floor per dependency" - :BUILD_OUTPUT_PATH "target/release/")) diff --git a/archetypes/rust-cli/overlay/benches/about.rs.in b/benches/about.rs similarity index 88% rename from archetypes/rust-cli/overlay/benches/about.rs.in rename to benches/about.rs index cef97585..18d24311 100644 --- a/archetypes/rust-cli/overlay/benches/about.rs.in +++ b/benches/about.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MPL-2.0 -// SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (metadatastician) //! //! A dependency-free benchmark (std only, `harness = false` in Cargo.toml), so //! `cargo bench` works on a fresh mint without adding criterion to the lockfile. @@ -11,7 +11,7 @@ use std::hint::black_box; use std::time::Instant; -use {{project}}::about; +use idris2x::about; fn main() { let timing = std::env::args().any(|a| a == "--bench"); diff --git a/build/container/.containerignore b/build/container/.containerignore deleted file mode 100644 index a4d65199..00000000 --- a/build/container/.containerignore +++ /dev/null @@ -1,59 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# -# Build-context exclusions for the OCI image build (Tier A). -# Honoured by podman, nerdctl and docker (all read .containerignore; -# docker also reads .dockerignore — this file is the portable name). -# -# Keeping the context lean speeds builds and prevents secrets, VCS -# history and local cruft from leaking into image layers. - -# Version control -.git/ -.gitignore -.gitattributes - -# CI / forge metadata -.github/ -ci/ - -# Editor / agent / local state -.claude/ -.devcontainer/ -.editorconfig -.envrc -.direnv/ -*.swp -*~ - -# Build outputs and caches -build/ttc/ -target/ -_build/ -deps/ -zig-out/ -zig-cache/ -node_modules/ -dist/ -result/ - -# Docs, tests, examples (not needed in the runtime image) -docs/ -build/docs-seed/ -benches/ -examples/ -tests/ - -# The container tooling itself (don't recurse the build files into the image) -build/container/stapeln/ -build/container/compose*.yaml -build/container/compose*.toml -build/container/.containerignore -build/container/README.adoc - -# Secrets and environment files — never ship these -*.env -.env -.env.* -*.pem -*.key -secrets/ diff --git a/build/container/README.adoc b/build/container/README.adoc deleted file mode 100644 index 94b629d9..00000000 --- a/build/container/README.adoc +++ /dev/null @@ -1,281 +0,0 @@ -// SPDX-License-Identifier: CC-BY-SA-4.0 -// Copyright (c) Jonathan D.A. Jewell -= {{PROJECT_NAME}} Containerisation -:toc: left -:toclevels: 3 -:sectnums: - -== Overview - -[TIP] -==== -*This module ships no `Containerfile`.* It used to ship one, and that file had -two `FROM …:latest` lines and a body of TODO comments: it could not build, and -it failed `container-images-pinned` in every repository minted from this -template — including the ones that publish no image at all. - -A repository that publishes an image adds the file here, pinned: - -[source,bash] ----- -scripts/pin-container-digests.sh --root . --base --runtime \ - build/container/Containerfile ----- - -`scripts/check-container-pins.sh` fails the build until every `FROM` in it -carries an `@sha256:` digest, and `just container-build` says the same thing -rather than building an image from two moving tags. -==== - -Containerisation in this template is organised in *three tiers*, from the most -portable to the most sovereign. You can use only the tier you need and ignore — -or delete — the rest. - -[cols="1,2,4"] -|=== -| Tier | What | Why - -| *A — OCI standard* -| `Containerfile` (you add it — see above), `.containerignore` -| A plain, multi-stage OCI image on https://www.chainguard.dev/[Chainguard] - Wolfi. Builds with any OCI engine. No dependency on tiers B or C. - -| *B — Portable engine* -| `compose.yaml`, `compose.example.yaml` -| A https://compose-spec.io[compose-spec] stack that runs unchanged on - `podman`, `nerdctl` or `docker`. For everyday local and simple production use. - -| *C — stapeln (sovereign)* -| `stapeln/` directory -| Verified `.ctp` bundles, zero-copy IPC, edge-gateway trust policy, secrets - gating, runtime monitoring and signed deployment — the full - https://github.com/hyperpolymath/stapeln[stapeln] stack. -|=== - -All files use `{{PLACEHOLDER}}` tokens, replaced by `just container-init` -(or the top-level `just repo-init` during project bootstrap). - -The container engine is *auto-detected* (`podman`, then `nerdctl`, then -`docker`). Override with `CONTAINER_ENGINE=docker just container-build`. - -== File Reference - -=== Tier A + B (this directory) - -[cols="1,3"] -|=== -| File | Purpose - -| `Containerfile` -| Multi-stage OCI build. Stage 1 builds the app; Stage 2 is a minimal Wolfi - runtime image. Engine-agnostic. Carries the stapeln files only as labels, - so it has no hard dependency on tier C. - -| `.containerignore` -| Build-context exclusions (honoured by podman/nerdctl/docker). Keeps `.git`, - secrets, docs, tests and build caches out of image layers. - -| `compose.yaml` -| Portable compose-spec stack: app + `rokur` + `svalinn`. Use with - `just container-up` or `podman compose -f build/container/compose.yaml up -d`. - -| `compose.example.yaml` -| Concrete multi-service example (Rust API + Elixir worker + gate + gateway). - Copy to `compose.yaml` and customise. - -| `entrypoint.sh` -| Container entrypoint: signal handling (SIGTERM/SIGINT), startup logging, - `exec` into the main process. -|=== - -=== Tier C — `stapeln/` - -[cols="1,3"] -|=== -| File | Purpose - -| `compose.toml` -| *selur-compose* stack definition (TOML, selur-native — not parseable by - `podman compose`; use `compose.yaml` for that). Declares services, volumes, - the selur zero-copy network, and health checks. - -| `compose.example.toml` -| Concrete multi-service selur example. - -| `manifest.toml` -| *cerro-torre* `.ctp` bundle metadata: provenance, dependencies, - attestations, and the runtime security profile. Used by `ct pack` / `ct verify`. - -| `.gatekeeper.yaml` -| *svalinn* edge-gateway policy: authentication, rate limiting, container - trust, request validation, CORS, audit logging. - -| `rokur.toml` -| *rokur* secrets-gate configuration: required secrets, listener/backend, - rate limiting, policy engine, and audit log. - -| `vordr.toml` -| *vordr* runtime monitoring: health/readiness probes (app, rokur, svalinn), - crash detection, resource thresholds, structured logs. - -| `ct-build.sh` -| *cerro-torre* build → pack → sign (Ed25519) → verify → push pipeline. - Engine-agnostic; degrades gracefully when cerro-torre tools are absent. - -| `deploy.k9.ncl.in` -| *k9-svc* deployment component at the Hunt leash (K9 contract v1.0.0): - pedigree with capability grant, side effects and signature block; - dev/staging/prod configs, rolling deployment strategy. Rendered to - `deploy.k9.ncl` by `just container-init`. -|=== - -== The stapeln ecosystem - -The sovereign tier wires together the stapeln container stack: - -*cerro-torre* (build + sign):: - Produces signed, minimal `.ctp` bundles from OCI images. Tools: `ct pack`, - `ct sign`, `ct verify`, `ct push`, `ct explain`. - -*selur* (compose + IPC):: - Orchestration with zero-copy IPC for co-located services. Reads - `stapeln/compose.toml`. - -*rokur* (secrets gate):: - A service that fronts the application and refuses to pass traffic unless - the declared secrets are present; rate-limits per client and writes a - structured audit log. Configured by `stapeln/rokur.toml`. In the stack it - sits between `svalinn` and the app. - -*svalinn* (edge gateway):: - Policy-driven reverse proxy: TLS termination, authentication, rate limiting, - CORS and container trust, from `stapeln/.gatekeeper.yaml`. - -*vordr* (monitoring):: - Runtime monitoring: health probes, crash detection, resource tracking, - structured logs, from `stapeln/vordr.toml`. - -*k9-svc* (deployment):: - Nickel-based deployment components with pedigree and trust levels - (Kennel / Yard / Hunt). - -The request path in the full stack is: -`svalinn` (edge) → `rokur` (secrets gate) → `{{SERVICE_NAME}}` (app). - -== Initialise - -[source,bash] ----- -just repo-init # full project bootstrap (all placeholders) -# or -just container-init # container-only: prompts for service/port/registry ----- - -== Everyday workflow (tiers A + B) - -[source,bash] ----- -just container-build # build image (auto-detected engine) -just container-verify # validate the compose config -just container-up -d # start the stack -just container-down # stop the stack - -# Explicit engine: -CONTAINER_ENGINE=docker just container-build ----- - -`just container-up` uses `selur-compose` automatically when it is installed, -otherwise it falls back to ` compose -f build/container/compose.yaml`. - -== Sovereign workflow (tier C) - -[source,bash] ----- -just container-sign # build → pack → sign → verify (.ctp) -just container-push # push the signed bundle -cd build/container/stapeln && selur-compose up --detach ----- - -k9-svc managed deployment. The deployment component ships as the template -`build/container/stapeln/deploy.k9.ncl.in`, in the K9 contract v1.0.0 shape. -`just repo-init` fills its `PROJECT_NAME` and `VERSION` placeholders and -`just container-init` fills `SERVICE_NAME`, `PORT` and `REGISTRY`. Once no -placeholder token is left, `just container-init` renders it to -`build/container/stapeln/deploy.k9.ncl`; until then it keeps the `.in` file -and names the tokens still missing. The rendered file is a K9 component, so -the K9 lane validates it like any other: - -[source,bash] ----- -k9-validate.sh --strict --layer L2 build/container/stapeln/deploy.k9.ncl -k9-svc deploy build/container/stapeln/deploy.k9.ncl --env production ----- - -It is a `'Hunt` component, so it carries a signature block. That block is a -claim until you sign the rendered file: the validator reports it -`'Present_Unverified` (K9-C001), and Hunt stays unauthorised until a verifier -accepts the signature. - -== Continuous integration - -A `container build` workflow ships in `.github/workflows/docker-build.yml`. -It is **off by default** — it costs nothing in a repository created from this -template until you opt in. - -To enable it, set a repository (or organisation) variable: - -[cols="1,3"] -|=== -| Variable | Effect - -| `CONTAINER_CI=true` -| Enables the workflow. It builds the image (`just container-build`), verifies - the compose config, runs a best-effort `trivy` scan, and on `v*` tags signs - the `.ctp` bundle (`just container-sign`). - -| `CONTAINER_RUNNER` -| Optional JSON array of runner labels. Defaults to - `["self-hosted","owned","container"]` — owned compute, so **no metered - GitHub Actions minutes**. Set e.g. `["ubuntu-24.04"]` to use GitHub-hosted - runners instead. -|=== - -[source,bash] ----- -gh variable set CONTAINER_CI --body true -# optional: gh variable set CONTAINER_RUNNER --body '["ubuntu-24.04"]' ----- - -The owned runner is expected to have `just` and a container engine installed; -`trivy` and cerro-torre (`ct`/`cerro-sign`) are used when present and skipped -otherwise. - -== Removing containerisation - -If your project does not need containers (e.g. a pure library), strip the whole -apparatus in one command: - -[source,bash] ----- -just no-container ----- - -This removes `build/container/`, `.devcontainer/`, the `build/just/container.just` -module and its Justfile import. Review `.github/workflows/` afterwards for any -image build/publish jobs you no longer need. - -== Base images - -* Builder: `cgr.dev/chainguard/wolfi-base@sha256:` -* Runtime: `cgr.dev/chainguard/wolfi-base@sha256:` (or - `cgr.dev/chainguard/static@sha256:` for static binaries) - -Pin every `FROM` by digest with `scripts/pin-container-digests.sh`. A tag is not a pin: `scripts/check-container-pins.sh` rejects a `FROM` with a tag and no digest (`:latest` or a version tag). It accepts a tag followed by a digest, but then the tag does nothing, so write the digest alone. - -Chainguard images are minimal, low-CVE, and rebuilt daily (`apk` package -manager, Alpine-compatible). - -== Container runtime - -Podman is recommended, but the OCI Containerfile and compose-spec files work -unchanged with `nerdctl` and `docker`. Set `CONTAINER_ENGINE` to choose. diff --git a/build/container/compose.example.yaml b/build/container/compose.example.yaml deleted file mode 100644 index 6e84892c..00000000 --- a/build/container/compose.example.yaml +++ /dev/null @@ -1,153 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# -# Example portable compose stack (Tier B) — multi-service -# -# A concrete, fully-commented example: a Rust API + Elixir worker behind the -# rokur secrets gate and the svalinn edge gateway. Copy to compose.yaml and -# customise. Works with podman / nerdctl / docker compose unchanged. -# -# cp build/container/compose.example.yaml build/container/compose.yaml -# # edit service names, ports, images -# just container-up # or: podman compose -f build/container/compose.yaml up -d -# -# For the sovereign selur path see build/container/stapeln/compose.example.toml. - -{ - services: { - # Rust API — primary HTTP/gRPC backend. - rust-api: { - build: { - context: "..", - dockerfile: "build/container/Containerfile", - }, - image: "ghcr.io/hyperpolymath/myproject-api:latest", - ports: [ - "8080:8080", - ], - environment: { - RUST_LOG: "info", - APP_HOST: "[::]", - APP_PORT: "8080", - APP_LOG_FORMAT: "json", - APP_DATA_DIR: "/data", - }, - volumes: [ - "api-data:/data", - ], - restart: "unless-stopped", - healthcheck: { - test: [ - "CMD", - "curl", - "-sf", - "http://localhost:8080/health", - ], - interval: "30s", - timeout: "5s", - retries: 3, - }, - }, - # Elixir worker — background processing, talks to the API over the network. - elixir-worker: { - image: "ghcr.io/hyperpolymath/myproject-worker:latest", - ports: [ - "4000:4000", - ], - environment: { - API_URL: "http://rust-api:8080/api/v1", - MIX_ENV: "prod", - APP_LOG_FORMAT: "json", - POOL_SIZE: "10", - }, - depends_on: { - rust-api: { - condition: "service_healthy", - }, - }, - restart: "unless-stopped", - healthcheck: { - test: [ - "CMD", - "curl", - "-sf", - "http://localhost:4000/health", - ], - interval: "30s", - timeout: "5s", - retries: 3, - }, - }, - # rokur — secrets gate. Refuses to come up unless required secrets are present. - rokur: { - image: "ghcr.io/hyperpolymath/rokur:latest", - ports: [ - "8081:8081", - ], - environment: { - ROKUR_BACKEND: "http://rust-api:8080", - ROKUR_LISTEN: "[::]:8081", - ROKUR_REQUIRED_SECRETS: "DATABASE_URL,JWT_SIGNING_KEY", - ROKUR_AUDIT_LOG: "/var/log/rokur/audit.jsonl", - ROKUR_LOG_FORMAT: "json", - }, - volumes: [ - "rokur-audit:/var/log/rokur", - ], - depends_on: { - rust-api: { - condition: "service_healthy", - }, - }, - restart: "unless-stopped", - healthcheck: { - test: [ - "CMD", - "curl", - "-sf", - "http://localhost:8081/health", - ], - interval: "30s", - timeout: "5s", - retries: 3, - }, - }, - # svalinn — edge gateway. TLS, auth, rate limiting, audit. The only - # externally exposed service. - svalinn: { - image: "ghcr.io/hyperpolymath/svalinn:latest", - ports: [ - "443:443", - "80:80", - ], - environment: { - SVALINN_BACKEND: "http://rokur:8081", - SVALINN_WORKER_BACKEND: "http://elixir-worker:4000", - SVALINN_POLICY_FILE: "/etc/svalinn/gatekeeper.yaml", - SVALINN_TLS_AUTO: "true", - }, - volumes: [ - "./stapeln/.gatekeeper.yaml:/etc/svalinn/gatekeeper.yaml:ro", - ], - depends_on: [ - "rokur", - "elixir-worker", - ], - restart: "unless-stopped", - healthcheck: { - test: [ - "CMD", - "curl", - "-sf", - "http://localhost:80/health", - ], - interval: "30s", - timeout: "5s", - retries: 3, - }, - }, - }, - volumes: { - api-data: null, - rokur-audit: null, - }, -} diff --git a/build/container/compose.yaml b/build/container/compose.yaml deleted file mode 100644 index cd30b335..00000000 --- a/build/container/compose.yaml +++ /dev/null @@ -1,134 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# -# {{PROJECT_NAME}} — portable compose stack (Tier B) -# -# This is the runtime-agnostic, OCI compose-spec file. It works unchanged with: -# podman compose -f build/container/compose.yaml up -d -# nerdctl compose -f build/container/compose.yaml up -d -# docker compose -f build/container/compose.yaml up -d -# -# It has NO dependency on the stapeln tier. For the sovereign path -# (selur zero-copy IPC, signed .ctp bundles, svalinn trust policy) use -# build/container/stapeln/compose.toml with `selur-compose` instead. -# -# The Justfile picks the right one automatically: -# just container-up # selur-compose if installed, else this file -# -# See https://compose-spec.io for the full specification. - -{ - services: { - # ────────────────────────────────────────────────────────────────────── - # Primary application service - # ────────────────────────────────────────────────────────────────────── - "{{SERVICE_NAME}}": { - build: { - context: "..", - dockerfile: "build/container/Containerfile", - }, - image: "{{REGISTRY}}/{{SERVICE_NAME}}:latest", - ports: [ - "{{PORT}}:{{PORT}}", - ], - environment: { - APP_HOST: "[::]", - APP_PORT: "{{PORT}}", - APP_LOG_FORMAT: "json", - APP_DATA_DIR: "/data", - }, - volumes: [ - "{{SERVICE_NAME}}-data:/data", - ], - restart: "unless-stopped", - healthcheck: { - test: [ - "CMD", - "curl", - "-sf", - "http://localhost:{{PORT}}/health", - ], - interval: "30s", - timeout: "5s", - retries: 3, - start_period: "10s", - }, - }, - # ────────────────────────────────────────────────────────────────────── - # rokur — secrets-management gate (stapeln). Fronts the app and refuses - # to start the stack unless required secrets are present. on Wolfi. - # Remove this service if you do not use secret gating. - # ────────────────────────────────────────────────────────────────────── - rokur: { - image: "ghcr.io/hyperpolymath/rokur:latest", - environment: { - ROKUR_BACKEND: "http://{{SERVICE_NAME}}:{{PORT}}", - ROKUR_LISTEN: "[::]:8081", - ROKUR_REQUIRED_SECRETS: "", # comma-separated env names that MUST be set - ROKUR_AUDIT_LOG: "/var/log/rokur/audit.jsonl", - ROKUR_LOG_FORMAT: "json", - }, - ports: [ - "8081:8081", - ], - volumes: [ - "rokur-audit:/var/log/rokur", - ], - depends_on: { - "{{SERVICE_NAME}}": { - condition: "service_healthy", - }, - }, - restart: "unless-stopped", - healthcheck: { - test: [ - "CMD", - "curl", - "-sf", - "http://localhost:8081/health", - ], - interval: "30s", - timeout: "5s", - retries: 3, - }, - }, - # ────────────────────────────────────────────────────────────────────── - # svalinn — edge gateway (stapeln). TLS termination, auth, rate limiting. - # Reads the gatekeeper policy from build/container/stapeln/.gatekeeper.yaml. - # Remove this service for a bare app with no gateway. - # ────────────────────────────────────────────────────────────────────── - svalinn: { - image: "ghcr.io/hyperpolymath/svalinn:latest", - ports: [ - "443:443", - "80:80", - ], - environment: { - SVALINN_BACKEND: "http://rokur:8081", - SVALINN_POLICY_FILE: "/etc/svalinn/gatekeeper.yaml", - SVALINN_TLS_AUTO: "true", - }, - volumes: [ - "./stapeln/.gatekeeper.yaml:/etc/svalinn/gatekeeper.yaml:ro", - ], - depends_on: [ - "rokur", - ], - restart: "unless-stopped", - healthcheck: { - test: [ - "CMD", - "curl", - "-sf", - "http://localhost:80/health", - ], - interval: "30s", - timeout: "5s", - retries: 3, - }, - }, - }, - volumes: { - "{{SERVICE_NAME}}-data": null, - rokur-audit: null, - }, -} diff --git a/build/container/entrypoint.sh b/build/container/entrypoint.sh deleted file mode 100755 index a7a03699..00000000 --- a/build/container/entrypoint.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: MPL-2.0 -# {{PROJECT_NAME}} container entrypoint -# -# Handles signal propagation, startup logging, and health check -# preparation before exec-ing into the main application process. - -set -e - -# --------------------------------------------------------------------------- -# Signal handling -# --------------------------------------------------------------------------- -# -# Trap SIGTERM and SIGINT so that the application can shut down gracefully -# when Podman sends stop signals (e.g. `podman stop`, `selur-compose down`). - -cleanup() { - echo "Received shutdown signal — stopping {{SERVICE_NAME}}..." - # If the main process is backgrounded, kill it here: - # kill "$MAIN_PID" 2>/dev/null || true - # wait "$MAIN_PID" 2>/dev/null || true - exit 0 -} -trap cleanup TERM INT - -# --------------------------------------------------------------------------- -# Startup logging -# --------------------------------------------------------------------------- - -echo "Starting {{SERVICE_NAME}}..." -echo " Host: ${APP_HOST:-[::]}" -echo " Port: ${APP_PORT:-{{PORT}}}" -echo " Data: ${APP_DATA_DIR:-/data}" -echo " Log: ${APP_LOG_FORMAT:-json}" - -# --------------------------------------------------------------------------- -# Health check preparation -# --------------------------------------------------------------------------- -# -# Ensure the data directory exists and is writable. -# The VOLUME directive in the Containerfile creates /data, but a bind-mount -# might replace it with an empty directory owned by root. - -if [ -d "${APP_DATA_DIR:-/data}" ]; then - if [ ! -w "${APP_DATA_DIR:-/data}" ]; then - echo "WARNING: ${APP_DATA_DIR:-/data} is not writable by $(whoami)" - fi -fi - -# --------------------------------------------------------------------------- -# Exec into main process -# --------------------------------------------------------------------------- -# -# Replace the entrypoint shell with the application process so that -# signals are delivered directly and PID 1 is the application. -# -# TODO: Replace the command below with your application binary. -# Examples: -# exec /app/{{SERVICE_NAME}} -# exec /app/release/bin/{{SERVICE_NAME}} start -# exec /app/{{SERVICE_NAME}} serve --host "${APP_HOST}" --port "${APP_PORT}" - -exec "$@" diff --git a/build/container/stapeln/.gatekeeper.yaml b/build/container/stapeln/.gatekeeper.yaml deleted file mode 100644 index 46afaa1a..00000000 --- a/build/container/stapeln/.gatekeeper.yaml +++ /dev/null @@ -1,157 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# -# Svalinn gatekeeper policy for {{PROJECT_NAME}} -# -# Controls which operations are permitted through the edge gateway. -# This template provides moderate security defaults — not wide-open test -# mode, but not production-hardened either. Tighten the values below -# before deploying to production. -# -# See: stapeln/container-stack/svalinn/ - -{ - version: "1.0", - # ============================================================================ - # Authentication - # ============================================================================ - # - # Define which endpoints require authentication and at what level. - auth: { - # Public endpoints — no authentication required. - # Health and readiness probes must always be public so that - # orchestrators (selur, Podman, k8s) can check service status. - public: [ - { - path: "/health", - methods: [ - "GET", - ], - }, - { - path: "/ready", - methods: [ - "GET", - ], - }, - { - path: "/metrics", - methods: [ - "GET", - ], - }, - ], - # Endpoints requiring JWT or OAuth2 authentication. - # Svalinn validates the token before forwarding the request. - authenticated: [ - { - path: "/api/v1/*", - methods: [ - "GET", - "POST", - "PUT", - "DELETE", - ], - }, - ], - }, - # ============================================================================ - # Rate Limiting - # ============================================================================ - # - # Protects backend services from overload. Values here are moderate - # defaults — adjust based on your service capacity. - rate_limits: { - # Global limit: applied to all authenticated clients. - global: { - requests_per_second: 500, - burst: 1000, - }, - # Write operations: stricter limit to protect data stores. - writes: { - paths: [ - "/api/v1/*", - ], - methods: [ - "POST", - "PUT", - "DELETE", - ], - requests_per_second: 100, - burst: 200, - }, - }, - # ============================================================================ - # Container Trust - # ============================================================================ - # - # Svalinn verifies that all .ctp bundles in the stack are signed by - # trusted keys and carry the required attestations. - trust: { - # Only accept .ctp bundles signed by these keys. - trusted_signers: [ - { - key_id: "{{SERVICE_NAME}}-release", - algorithm: "Ed25519", - public_key_file: "/etc/svalinn/keys/{{SERVICE_NAME}}-release.pub", - }, - ], - # Require these attestations on all .ctp bundles. - required_attestations: [ - "source-signature", - "sbom-complete", - ], - # Reject unsigned or untrusted images. - reject_unsigned: true, - }, - # ============================================================================ - # Request Validation - # ============================================================================ - # - # Input validation at the gateway layer — catches malformed requests - # before they reach the application. - validation: { - # Maximum request body size. - max_body_size: "8MB", - # Reject requests with NaN or Infinity in numeric fields. - reject_nan_inf: true, - # Maximum result limit per list/search query. - max_result_limit: 500, - }, - # ============================================================================ - # CORS - # ============================================================================ - # - # Cross-Origin Resource Sharing policy. The defaults below allow all - # origins — restrict to your frontend domain(s) in production. - cors: { - allow_origins: [ - "*", - ], - allow_methods: [ - "GET", - "POST", - "PUT", - "DELETE", - "OPTIONS", - ], - allow_headers: [ - "Content-Type", - "Authorization", - ], - max_age: 3600, - }, - # ============================================================================ - # Logging - # ============================================================================ - # - # Structured logging for svalinn itself. Audit paths log all requests - # (including body hashes) for post-incident investigation. - logging: { - format: "json", - level: "info", - # Log all write operations for audit trail. - audit_paths: [ - "/api/v1/*", - ], - }, -} diff --git a/build/container/stapeln/compose.example.toml b/build/container/stapeln/compose.example.toml deleted file mode 100644 index 1dd5794e..00000000 --- a/build/container/stapeln/compose.example.toml +++ /dev/null @@ -1,135 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# -# Example selur-compose configuration — multi-service stack -# -# This is a concrete, fully-commented example showing a Rust API + Elixir -# worker + svalinn gateway deployment. Copy this file to compose.toml and -# customise for your project. -# -# Usage: -# cp compose.example.toml compose.toml -# # Edit service names, ports, images -# selur-compose up --detach - -version = "1.0" - -# ============================================================================ -# Services -# ============================================================================ - -# Rust API service — the primary HTTP/gRPC backend. -# Handles incoming requests, data storage, and core business logic. -[services.rust-api] -image = "ghcr.io/hyperpolymath/myproject-api:latest.ctp" - -# Map host port 8080 to container port 8080. -# Use ["[::]:8080:8080"] for explicit IPv6 binding. -ports = ["8080:8080"] - -# Environment variables passed into the container at startup. -# These override defaults in the Containerfile ENV directives. -environment = { - RUST_LOG = "info", # Rust log level (trace, debug, info, warn, error) - APP_HOST = "[::]", # Listen on all interfaces (IPv4 + IPv6) - APP_PORT = "8080", # Internal container port - APP_LOG_FORMAT = "json", # Structured logging for selur/vordr - APP_DATA_DIR = "/data", # Persistent data directory (matches VOLUME) -} - -# Bind-mount a named volume for persistent data. -# Format: "volume-name:/build/container/path" -volumes = ["api-data:/data"] - -# Restart policy: "always" ensures the service comes back after crashes. -# Other options: "no", "on-failure", "unless-stopped" -restart = "always" - -# Health check: selur/Podman uses this to determine if the service is ready. -# The service must respond 2xx to this endpoint within the timeout. -healthcheck = { test = "curl -sf http://localhost:8080/health", interval = "30s", timeout = "5s", retries = 3 } - -# --- - -# Elixir worker service — background processing, event handling, coordination. -# Runs as an OTP release with supervision trees for fault tolerance. -[services.elixir-worker] -image = "ghcr.io/hyperpolymath/myproject-worker:latest.ctp" - -# Separate port for the worker's admin/metrics endpoint. -ports = ["4000:4000"] - -# The worker connects to the Rust API over the internal selur network. -# Service names resolve as hostnames within the compose network. -environment = { - API_URL = "http://rust-api:8080/api/v1", # Internal service discovery - MIX_ENV = "prod", # Elixir release mode - APP_LOG_FORMAT = "json", # Match structured logging format - POOL_SIZE = "10", # DB connection pool size -} - -# depends_on ensures the Rust API starts before the worker. -# Note: This only waits for the container to start, not for the health check. -# Use healthcheck + startup probes for true readiness gating. -depends_on = ["rust-api"] - -restart = "always" -healthcheck = { test = "curl -sf http://localhost:4000/health", interval = "30s", timeout = "5s", retries = 3 } - -# --- - -# Svalinn edge gateway — reverse proxy with policy enforcement. -# All external traffic enters through svalinn, which: -# 1. Terminates TLS (auto-provisioned certificates) -# 2. Validates JWT/OAuth2 authentication -# 3. Enforces rate limits from .gatekeeper.yaml -# 4. Routes requests to the appropriate backend service -# 5. Logs all write operations for audit -[services.svalinn] -image = "ghcr.io/hyperpolymath/svalinn:latest.ctp" - -# External-facing ports: HTTPS (443) and HTTP->HTTPS redirect (80). -ports = ["443:443", "80:80"] - -environment = { - # Backend routing: svalinn proxies to internal services. - SVALINN_BACKEND = "http://rust-api:8080", - SVALINN_WORKER_BACKEND = "http://elixir-worker:4000", - - # Policy file: mounted from the svalinn-config volume. - SVALINN_POLICY_FILE = "/etc/svalinn/gatekeeper.yaml", - - # Auto-provision TLS certificates (Let's Encrypt). - SVALINN_TLS_AUTO = "true", -} - -# Mount .gatekeeper.yaml as read-only policy configuration. -volumes = ["svalinn-config:/etc/svalinn:ro"] - -# Svalinn starts last — it needs both backends to be running. -depends_on = ["rust-api", "elixir-worker"] -restart = "always" -healthcheck = { test = "curl -sf http://localhost:80/health", interval = "30s", timeout = "5s", retries = 3 } - -# ============================================================================ -# Volumes -# ============================================================================ - -# Persistent storage for the Rust API (database files, indexes, WAL). -[volumes.api-data] -driver = "local" - -# Read-only policy configuration for svalinn gateway. -# Populate with: cp .gatekeeper.yaml /path/to/svalinn-config/gatekeeper.yaml -[volumes.svalinn-config] -driver = "local" - -# ============================================================================ -# Networks -# ============================================================================ - -# selur network: zero-copy IPC between services on the same host. -# When the selur driver is not installed, falls back to standard bridge -# networking (TCP over localhost). Performance is slightly lower but -# functionality is identical. -[networks.default] -driver = "selur" diff --git a/build/container/stapeln/compose.toml b/build/container/stapeln/compose.toml deleted file mode 100644 index db42fb99..00000000 --- a/build/container/stapeln/compose.toml +++ /dev/null @@ -1,94 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# -# {{PROJECT_NAME}} selur-compose configuration -# -# Orchestrates the container stack as verified container bundles (.ctp). -# Uses selur zero-copy IPC between services on the same host. -# -# Usage: -# selur-compose up # Start all services -# selur-compose up --detach # Start in background -# selur-compose verify # Verify all .ctp signatures -# selur-compose ps # Check status -# selur-compose logs -f {{SERVICE_NAME}} # Stream logs -# selur-compose down # Stop all services -# -# Fallback (when selur is not installed): this TOML is selur-native and is -# NOT parseable by `podman compose` / `docker compose`. For the portable -# (podman/nerdctl/docker) path use the compose-spec file instead: -# podman compose -f ../compose.yaml up -d # (or: just container-up) - -version = "1.0" - -# ============================================================================ -# Services -# ============================================================================ - -# Primary application service -[services.{{SERVICE_NAME}}] -image = "{{REGISTRY}}/{{SERVICE_NAME}}:latest.ctp" -ports = ["{{PORT}}:{{PORT}}"] -environment = { - APP_HOST = "[::]", - APP_PORT = "{{PORT}}", - APP_LOG_FORMAT = "json", - APP_DATA_DIR = "/data", -} -volumes = ["{{SERVICE_NAME}}-data:/data"] -restart = "always" -healthcheck = { test = "curl -sf http://localhost:{{PORT}}/health", interval = "30s", timeout = "5s", retries = 3 } - -# Rokur secrets gate: refuses to start (and refuses to proxy) unless the -# declared secrets are present; emits a structured audit log of every access. -# Sits between svalinn and the application. Remove if you do not gate secrets. -[services.rokur] -image = "ghcr.io/hyperpolymath/rokur:latest.ctp" -ports = ["8081:8081"] -environment = { - ROKUR_BACKEND = "http://{{SERVICE_NAME}}:{{PORT}}", - ROKUR_LISTEN = "[::]:8081", - ROKUR_REQUIRED_SECRETS = "", - ROKUR_AUDIT_LOG = "/var/log/rokur/audit.jsonl", - ROKUR_LOG_FORMAT = "json", -} -volumes = ["rokur-audit:/var/log/rokur"] -depends_on = ["{{SERVICE_NAME}}"] -restart = "always" -healthcheck = { test = "curl -sf http://localhost:8081/health", interval = "30s", timeout = "5s", retries = 3 } - -# Svalinn edge gateway: validates requests, enforces policies, TLS termination. -# Proxies to rokur, which in turn fronts the application. -[services.svalinn] -image = "ghcr.io/hyperpolymath/svalinn:latest.ctp" -ports = ["443:443", "80:80"] -environment = { - SVALINN_BACKEND = "http://rokur:8081", - SVALINN_POLICY_FILE = "/etc/svalinn/gatekeeper.yaml", - SVALINN_TLS_AUTO = "true", -} -volumes = ["svalinn-config:/etc/svalinn:ro"] -depends_on = ["rokur"] -restart = "always" -healthcheck = { test = "curl -sf http://localhost:80/health", interval = "30s", timeout = "5s", retries = 3 } - -# ============================================================================ -# Volumes -# ============================================================================ - -[volumes.{{SERVICE_NAME}}-data] -driver = "local" - -[volumes.rokur-audit] -driver = "local" - -[volumes.svalinn-config] -driver = "local" - -# ============================================================================ -# Networks -# ============================================================================ - -# Use selur zero-copy IPC for inter-service communication on the same host. -# Falls back to standard bridge networking when selur driver is unavailable. -[networks.default] -driver = "selur" diff --git a/build/container/stapeln/ct-build.sh b/build/container/stapeln/ct-build.sh deleted file mode 100755 index c825b844..00000000 --- a/build/container/stapeln/ct-build.sh +++ /dev/null @@ -1,168 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: MPL-2.0 -# -# {{PROJECT_NAME}} — Cerro Torre build, sign, and verify pipeline -# -# Builds the container image, packages it as a verified .ctp bundle, -# signs it with Ed25519, and verifies the result. Gracefully degrades -# when cerro-torre tools are not installed. -# -# Prerequisites: -# - podman / nerdctl / docker (container build — required; set CONTAINER_ENGINE) -# - ct (cerro-torre CLI: pack, sign, verify — optional) -# - cerro-sign (Ed25519 signing — optional, ct sign used as fallback) -# -# Usage: -# ./ct-build.sh # Build + sign (local only) -# ./ct-build.sh --push # Build + sign + push to registry -# CT_KEY_ID=my-key ./ct-build.sh # Use specific signing key -# -# Environment variables: -# CT_KEY_ID — Signing key identifier (default: {{SERVICE_NAME}}-release) -# CT_REGISTRY — OCI registry to push to (default: {{REGISTRY}}) -# CT_TAG — Image tag (default: latest) - -set -euo pipefail - -# --------------------------------------------------------------------------- -# Configuration -# --------------------------------------------------------------------------- - -# This script lives in build/container/stapeln/. The repo root is two levels up, -# and the Tier-A Containerfile is one level up in build/container/. -SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -CONTAINER_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" -REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)" # build/container/stapeln -> repo root - -# Container engine — podman (recommended), nerdctl or docker. -ENGINE="${CONTAINER_ENGINE:-podman}" - -PUSH="" -for arg in "$@"; do - if [ "$arg" = "--push" ]; then - PUSH="--push" - fi -done - -CT_KEY_ID="${CT_KEY_ID:-{{SERVICE_NAME}}-release}" -CT_REGISTRY="${CT_REGISTRY:-{{REGISTRY}}}" -CT_TAG="${CT_TAG:-latest}" - -IMAGE_NAME="{{SERVICE_NAME}}" -FULL_IMAGE="${CT_REGISTRY}/${IMAGE_NAME}:${CT_TAG}" -CTP_FILE="${SCRIPT_DIR}/${IMAGE_NAME}-${CT_TAG}.ctp" - -echo "=== {{PROJECT_NAME}} Cerro Torre Build Pipeline ===" -echo " Image: ${FULL_IMAGE}" -echo " Key: ${CT_KEY_ID}" -echo " Bundle: ${CTP_FILE}" -echo "" - -# --------------------------------------------------------------------------- -# Step 1: Build container image (CONTAINER_ENGINE, default podman) -# --------------------------------------------------------------------------- - -echo "--- Step 1: Building container image (${ENGINE}) ---" - -"${ENGINE}" build \ - -t "${FULL_IMAGE}" \ - -f "${CONTAINER_DIR}/Containerfile" \ - "${REPO_ROOT}" - -echo " Built: ${FULL_IMAGE}" -echo "" - -# --------------------------------------------------------------------------- -# Step 2: Pack into .ctp bundle -# --------------------------------------------------------------------------- - -echo "--- Step 2: Packing into .ctp bundle ---" - -if command -v ct &>/dev/null; then - ct pack "${FULL_IMAGE}" -o "${CTP_FILE}" - echo " Packed: ${CTP_FILE}" -else - echo " SKIP: ct not found (install cerro-torre CLI from stapeln/container-stack/cerro-torre)" - echo " The container image is built and tagged but not packed as a .ctp bundle." - echo " To pack manually: ct pack ${FULL_IMAGE} -o ${CTP_FILE}" - echo "" - if [ "$PUSH" = "--push" ]; then - echo "--- Pushing unsigned OCI image (no .ctp) ---" - "${ENGINE}" push "${FULL_IMAGE}" - echo " Pushed: ${FULL_IMAGE} (unsigned OCI — not a .ctp bundle)" - fi - echo "" - echo "=== Build complete (without .ctp signing) ===" - exit 0 -fi - -echo "" - -# --------------------------------------------------------------------------- -# Step 3: Sign the .ctp bundle -# --------------------------------------------------------------------------- - -echo "--- Step 3: Signing .ctp bundle ---" - -if command -v cerro-sign &>/dev/null; then - cerro-sign sign "${CTP_FILE}" --key-id "${CT_KEY_ID}" - echo " Signed: ${CTP_FILE} (key: ${CT_KEY_ID})" -elif command -v ct &>/dev/null; then - ct sign "${CTP_FILE}" --key "${CT_KEY_ID}" - echo " Signed: ${CTP_FILE} (key: ${CT_KEY_ID})" -else - echo " SKIP: cerro-sign not found (install from stapeln/container-stack/cerro-torre)" -fi - -echo "" - -# --------------------------------------------------------------------------- -# Step 4: Verify the .ctp bundle -# --------------------------------------------------------------------------- - -echo "--- Step 4: Verifying .ctp bundle ---" - -if command -v ct &>/dev/null; then - ct verify "${CTP_FILE}" - echo " Verified: ${CTP_FILE}" -else - echo " SKIP: ct not found" -fi - -echo "" - -# --------------------------------------------------------------------------- -# Step 5: Push to registry (optional) -# --------------------------------------------------------------------------- - -if [ "$PUSH" = "--push" ]; then - echo "--- Step 5: Pushing to registry ---" - - if command -v ct &>/dev/null; then - ct push "${CTP_FILE}" "${FULL_IMAGE}" - echo " Pushed: ${FULL_IMAGE}" - else - # Fall back to podman push (unsigned OCI image) - echo " ct not available, falling back to '${ENGINE}' push (unsigned)" - "${ENGINE}" push "${FULL_IMAGE}" - echo " Pushed: ${FULL_IMAGE} (unsigned OCI — not a .ctp bundle)" - fi - echo "" -fi - -# --------------------------------------------------------------------------- -# Summary -# --------------------------------------------------------------------------- - -echo "=== Build pipeline complete ===" -echo " Image: ${FULL_IMAGE}" -echo " Bundle: ${CTP_FILE}" -echo "" -echo " To deploy with selur-compose:" -echo " cd build/container/stapeln && selur-compose up" -echo "" -echo " To verify at any time:" -echo " ct verify ${CTP_FILE}" -echo "" -echo " To explain the verification chain:" -echo " ct explain ${CTP_FILE}" diff --git a/build/container/stapeln/deploy.k9.ncl.in b/build/container/stapeln/deploy.k9.ncl.in deleted file mode 100644 index 4a25720f..00000000 --- a/build/container/stapeln/deploy.k9.ncl.in +++ /dev/null @@ -1,189 +0,0 @@ -K9! -# SPDX-License-Identifier: MPL-2.0 -# deploy.k9.ncl — {{PROJECT_NAME}} deployment component (Hunt level) -# -# k9-svc deployment component, K9 contract v1.0.0 (D173). Shipped as -# deploy.k9.ncl.in because a template is not a component: `just repo-init` -# fills PROJECT_NAME and VERSION, `just container-init` fills SERVICE_NAME, -# PORT and REGISTRY, and once no brace token is left `just container-init` -# renders it to build/container/stapeln/deploy.k9.ncl. -# -# WARNING: this component executes shell commands. It is 'Hunt, so a host -# runs it only with all five Hunt preconditions met, a verified signature -# among them. The signature block below is a claim until the owner signs the -# rendered file; until then the validator reports it 'Present_Unverified -# (K9-C001) and Hunt stays unauthorised. -# -# Usage (on the rendered file): -# k9-validate.sh --strict --layer L2 build/container/stapeln/deploy.k9.ncl -# k9-svc validate build/container/stapeln/deploy.k9.ncl -# k9-svc deploy build/container/stapeln/deploy.k9.ncl --env production - -{ - pedigree = { - schema_version = "1.0.0", - component_type = "deployment", - - metadata = { - name = "{{SERVICE_NAME}}-deploy", - version = "{{VERSION}}", - description = "{{PROJECT_NAME}} deployment component (Hunt level)", - }, - - # Target environment (extension field; contract §5.5). - target = { - os = 'Linux, - is_edge = false, - requires_podman = true, - min_memory_mb = 256, - }, - - security = { - leash = 'Hunt, - trust_level = "controlled-execution", - allow_network = true, - allow_filesystem_write = true, - allow_subprocess = true, - signature_required = true, - # Default-deny: every flag above is paid for here (contract §8.4), plus - # the deploy and rollback actions the scripts below perform. - capabilities = [ - "net.fetch", - "fs.write", - "process.spawn", - "container.run", - "deploy.apply", - "rollback.apply", - ], - }, - - warnings = [ - "This is a Hunt-level component: it executes shell commands and changes the system.", - "Review the deployment scripts before running it.", - "A signature block being present is not a signature being verified.", - "Authorise Hunt explicitly: k9-svc authorize build/container/stapeln/deploy.k9.ncl", - ], - - side_effects = [ - "spawns build/container/stapeln/ct-build.sh, which builds the image and packs and signs a .ctp bundle beside it", - "pulls and pushes {{REGISTRY}}/{{SERVICE_NAME}} images", - "starts, updates and stops the {{SERVICE_NAME}} stack with selur-compose, else podman compose over build/container/compose.yaml", - "publishes the service on port {{PORT}}", - ], - - # Ed25519, presence only (K9-S009). The signing step adds payload_hash - # and signature to the rendered file; verification is K9-C001 (L3). - signature = { - algorithm = "Ed25519", - key_id = "primary", - }, - }, - - # Deployment configuration - deployment = { - # Target environments (dev / staging / production) - environments = { - dev = { - replicas = 1, - memory = "256Mi", - cpu = "100m", - image_tag = "dev", - }, - staging = { - replicas = 2, - memory = "512Mi", - cpu = "250m", - image_tag = "staging", - }, - production = { - replicas = 3, - memory = "1Gi", - cpu = "500m", - image_tag = "latest", - }, - }, - - # Container configuration - container = { - image = "{{REGISTRY}}/{{SERVICE_NAME}}", - port = {{PORT}}, - health_check = "/health", - readiness_check = "/ready", - }, - - # Deployment strategy - strategy = { - type = "rolling", - max_surge = 1, - max_unavailable = 0, - }, - }, - - # Deployment scripts (executed at Hunt level) - scripts = { - # Pre-deployment validation - pre_deploy = m%" -#!/bin/sh -set -eu -echo "K9: Pre-deployment validation for {{SERVICE_NAME}}..." -cd build/container/stapeln -if command -v selur-compose >/dev/null 2>&1; then - selur-compose verify -else - podman compose --file ../compose.yaml config -fi -echo "K9: Validation passed." -"%, - - # Deployment script - deploy = m%" -#!/bin/sh -set -eu -ENV="${1:-dev}" -echo "K9: Deploying {{SERVICE_NAME}} to $ENV environment..." -cd build/container/stapeln -./ct-build.sh -if command -v selur-compose >/dev/null 2>&1; then - selur-compose up --detach -else - podman compose --file ../compose.yaml up --detach -fi -echo "K9: Deployment to $ENV complete." -"%, - - # Rollback script - rollback = m%" -#!/bin/sh -set -eu -echo "K9: Rolling back {{SERVICE_NAME}} deployment..." -cd build/container/stapeln -if command -v selur-compose >/dev/null 2>&1; then - selur-compose down -else - podman compose --file ../compose.yaml down -fi -echo "K9: Rollback complete." -"%, - }, - - # Just recipes: an execution surface, which is why the leash is 'Hunt - # (K9-S011). - recipes = { - install = { - description = "Build the container image", - commands = ["just container-build"], - }, - validate = { - description = "Verify the compose configuration", - commands = ["just container-verify"], - }, - deploy = { - description = "Start the container stack", - commands = ["just container-up"], - }, - migrate = { - description = "Rebuild the image and restart the stack", - commands = ["just container-build", "just container-up"], - }, - }, -} diff --git a/build/container/stapeln/manifest.toml b/build/container/stapeln/manifest.toml deleted file mode 100644 index f55fcb3a..00000000 --- a/build/container/stapeln/manifest.toml +++ /dev/null @@ -1,62 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# -# Cerro Torre manifest for {{PROJECT_NAME}} .ctp bundle -# -# This manifest describes the container image for verified -# container packaging. Used by `ct pack` to create .ctp bundles. - -[metadata] -name = "{{SERVICE_NAME}}" -version = "{{VERSION}}" -revision = 1 -summary = "{{PROJECT_DESCRIPTION}}" -description = """ -{{PROJECT_NAME}} — containerised service packaged as a verified -cerro-torre .ctp bundle with Ed25519 signing and full provenance -tracking. -""" -license = "{{LICENSE}}" -homepage = "https://{{FORGE}}/{{OWNER}}/{{REPO}}" -maintainer = "{{AUTHOR}} <{{EMAIL}}>" - -[provenance] -upstream = "https://{{FORGE}}/{{OWNER}}/{{REPO}}" -import_date = {{CURRENT_DATE}}T00:00:00Z - -[dependencies] -runtime = ["ca-certificates", "curl"] -build = [] - -[build] -system = "podman" - -[build.environment] -APP_HOST = "[::]" -APP_PORT = "{{PORT}}" - -[outputs] -primary = "{{SERVICE_NAME}}" -split = [] - -[attestations] -require = ["source-signature", "sbom-complete"] -recommend = ["security-audit", "reproducible-build"] - -# Runtime security profile -[security] -user = "appuser" -group = "appuser" -read_only_root = false -no_new_privileges = true - -[security.capabilities] -drop = ["ALL"] -add = ["NET_BIND_SERVICE"] - -[security.network] -listen_tcp = [{{PORT}}] - -[security.filesystem] -read = ["/app/", "/data/"] -write = ["/data/", "/tmp/"] -execute = ["/app/entrypoint.sh"] diff --git a/build/container/stapeln/rokur.toml b/build/container/stapeln/rokur.toml deleted file mode 100644 index 361c1ea2..00000000 --- a/build/container/stapeln/rokur.toml +++ /dev/null @@ -1,81 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# -# Rokur secrets-gate configuration for {{PROJECT_NAME}} -# -# Rokur (stapeln container stack) is a secrets-management gate: a small -# Deno service that sits in front of the application and refuses to pass -# traffic unless the declared secrets are present and valid. It rate-limits -# per client and writes a structured audit log of every secret access. -# -# Most settings can also be supplied as environment variables (the ROKUR_* -# names below); this file is the declarative equivalent consumed at startup -# and re-read on SIGHUP. Environment variables win over file values. -# -# Usage: -# rokur serve --config build/container/stapeln/rokur.toml -# # or, in the stack, via compose (see compose.toml / compose.yaml) - -[metadata] -name = "{{SERVICE_NAME}}-gate" -version = "{{VERSION}}" - -# ============================================================================ -# Listener / routing (env: ROKUR_LISTEN, ROKUR_BACKEND) -# ============================================================================ - -[server] -# Address rokur listens on (inside the container). -listen = "[::]:8081" -# The upstream application rokur fronts once the gate is satisfied. -backend = "http://{{SERVICE_NAME}}:{{PORT}}" -# Health/readiness endpoints rokur exposes for vordr / orchestrators. -health_path = "/health" -ready_path = "/ready" - -# ============================================================================ -# Required secrets (env: ROKUR_REQUIRED_SECRETS, comma-separated) -# ============================================================================ -# -# Names of secrets that MUST be present (as environment variables or in the -# mounted secret store) before rokur will start the gate. An empty list means -# the gate starts open — tighten this before production. - -[secrets] -required = [] -# Example: -# required = ["DATABASE_URL", "JWT_SIGNING_KEY", "TLS_PRIVATE_KEY"] - -# Where rokur looks for secret material, in order. "env" reads process -# environment; "file" reads a mounted directory (one file per secret). -sources = ["env"] -# file_dir = "/run/secrets" - -# ============================================================================ -# Rate limiting (rokur/rate_limit.js — per-client token bucket) -# ============================================================================ - -[rate_limit] -enabled = true -requests_per_second = 100 -burst = 200 - -# ============================================================================ -# Policy engine (rokur/policy/engine.js — pluggable evaluator) -# ============================================================================ - -[policy] -# "builtin" uses rokur's built-in evaluator; "external" delegates to a -# command/endpoint you supply. -engine = "builtin" -# external_command = "/usr/local/bin/my-policy" - -# ============================================================================ -# Audit log (env: ROKUR_AUDIT_LOG, ROKUR_LOG_FORMAT) -# ============================================================================ - -[audit] -log = "/var/log/rokur/audit.jsonl" -format = "json" -# Record a hash of secret values (never the values themselves) for tamper -# evidence in the audit trail. -hash_values = true diff --git a/build/container/stapeln/vordr.toml b/build/container/stapeln/vordr.toml deleted file mode 100644 index 90084b49..00000000 --- a/build/container/stapeln/vordr.toml +++ /dev/null @@ -1,117 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# -# Vordr runtime monitoring configuration for {{PROJECT_NAME}} -# -# Vordr watches container health, detects crashes, tracks resource usage, -# and emits structured logs. It runs alongside the application stack and -# provides runtime observability without requiring in-process agents. -# -# Usage: -# vordr watch --config build/container/vordr.toml -# vordr status -# vordr report - -[metadata] -name = "{{SERVICE_NAME}}" -version = "{{VERSION}}" - -# ============================================================================ -# Health Monitoring -# ============================================================================ -# -# Vordr periodically probes these endpoints. If a probe fails beyond the -# failure_threshold, vordr emits an alert and (optionally) restarts the -# container via Podman. - -[health] -# Primary health endpoint — must return 2xx. -endpoint = "http://localhost:{{PORT}}/health" -interval = "30s" -timeout = "5s" -failure_threshold = 3 - -# Readiness endpoint — checked during startup and after restarts. -readiness_endpoint = "http://localhost:{{PORT}}/ready" -readiness_timeout = "10s" - -# Action on failure: "alert" (log + notify) or "restart" (alert + restart). -on_failure = "alert" - -# Additional deep probes for the sidecar stapeln services. Crash detection -# below already tracks every container's lifecycle via the engine; these add -# endpoint-level health checks for the secrets gate and the edge gateway. -[[health.extra]] -name = "rokur" -endpoint = "http://localhost:8081/health" -interval = "30s" -timeout = "5s" -failure_threshold = 3 - -[[health.extra]] -name = "svalinn" -endpoint = "http://localhost:80/health" -interval = "30s" -timeout = "5s" -failure_threshold = 3 - -# ============================================================================ -# Crash Detection -# ============================================================================ -# -# Monitors container state via the engine (podman/nerdctl/docker). Detects -# OOM kills, segfaults, and unexpected exits across the whole stack. - -[crash_detection] -enabled = true -# Maximum restarts within the window before vordr stops restarting. -max_restarts = 5 -restart_window = "10m" - -# ============================================================================ -# Resource Thresholds -# ============================================================================ -# -# Alert when resource usage exceeds these thresholds. Values are percentages -# of the container's cgroup limits (or host limits if uncapped). - -[resources] -cpu_warn = 80 # Percentage — warn at 80% sustained CPU. -cpu_critical = 95 # Percentage — critical alert at 95%. -memory_warn = 75 # Percentage of memory limit. -memory_critical = 90 -disk_warn = 80 # Percentage of volume usage. -disk_critical = 95 - -# Sample interval for resource metrics. -sample_interval = "15s" - -# ============================================================================ -# Log Output -# ============================================================================ -# -# Vordr emits its own logs (not the application's) in structured format. - -[logging] -format = "json" -level = "info" -# Write vordr logs to stdout (captured by Podman) and optionally to file. -output = "stdout" -# file = "/var/log/vordr/{{SERVICE_NAME}}.log" - -# ============================================================================ -# Notifications (optional) -# ============================================================================ -# -# Uncomment and configure to receive alerts via webhook or email. - -# [notifications.webhook] -# url = "https://example.com/hooks/vordr" -# method = "POST" -# headers = { "Content-Type" = "application/json" } -# on = ["failure", "recovery", "resource_critical"] - -# [notifications.email] -# to = "{{EMAIL}}" -# from = "vordr@{{SERVICE_NAME}}.local" -# smtp = "smtp://localhost:25" -# on = ["failure", "resource_critical"] diff --git a/build/docs-seed/README.adoc b/build/docs-seed/README.adoc deleted file mode 100644 index c4e0266d..00000000 --- a/build/docs-seed/README.adoc +++ /dev/null @@ -1,87 +0,0 @@ -// SPDX-License-Identifier: CC-BY-SA-4.0 -// Copyright (c) Jonathan D.A. Jewell -// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) -= Documentation Template -:revdate: 2026-05-26 -:status: SEED - -This directory is the *minimum heavy-wiki seed* for a hyperpolymath repo. - -[NOTE] -==== -*This is NOT a duplicate of `docs/`.* `docs/` holds *this* template's own, -fully-written documentation; `build/docs-seed/` is the un-filled *seed* (with -`{{PLACEHOLDER}}` tokens and illustrative example paths) that is copied into a -*newly scaffolded* repo's `docs/`. Example paths inside `build/docs-seed/` -describe a hypothetical downstream project, so they intentionally do not resolve -against this template's tree (see `.hypatia-ignore` for the matching SD022 -carve-out). -==== - -== How adoption works - -`just repo-init` does the first two steps for you. It was previously a manual -four-step procedure that nothing automated, with the result that minted repos -carried the un-filled seed *and* the spine's own rendered docs side by side. - -. **Automatic** — repo-init copies this seed over `docs/` before substitution. - It is an *overlay*: these files win on collision, and everything else the - spine ships under `docs/` survives (notably `docs/governance/` and - `docs/legal/`, which `build/just/validate.just` requires). This README is not - copied. The seed directory is then removed from your repo alongside - `archetypes/` and `build/templates/`. -. **Automatic** — `{{PROJECT_NAME}}`, `{{OWNER}}`, `{{AUTHOR}}`, - `{{AUTHOR_EMAIL}}` and `{{CURRENT_YEAR}}` are rendered by the same - substitution pass as the rest of the tree. -. **Yours to do** — delete any section that genuinely does not apply. Do not - leave empty scaffolding: the 2026-05-26 doc-debt audit counted 61 estate - repos with empty `docs/` dirs as its own category of debt. -. **Yours to do** — add repo-specific sections. - -== What's in here - -[cols="1,2", options="header"] -|=== -| File | Purpose - -| `README.adoc` | This file. NOT copied into your repo — it documents the seed itself. -| `architecture.adoc` | System overview, component diagram, data flow. -| `usage.adoc` | End-user / consumer perspective. How to invoke / consume / depend on this repo. -| `contributing.adoc` | Developer perspective. Local-dev setup, test running, PR conventions. -| `troubleshooting.adoc` | FAQ-style. Known failure modes + recovery paths. -| `decisions/0001-template.adoc` | ADR (Architecture Decision Record) template. Copy → `0002-...`, `0003-...` etc. -|=== - -== Why these five sections - -The 2026-05-26 estate documentation-debt audit -(link:https://github.com/hyperpolymath/standards/blob/main/docs/audits/2026-05-26-estate-documentation-debt.md[standards#197]) -identified four canonical perspectives every repo should answer: - -. **What is it** — README answers (lives at repo root, not here). -. **How is it built** — `architecture.adoc`. -. **How do I use it** — `usage.adoc`. -. **How do I help build it** — `contributing.adoc`. -. **What goes wrong** — `troubleshooting.adoc`. - -ADRs are the long-running historical record — they don't fit any of -the above but are essential for explaining *why* a particular shape -was chosen. - -== What's intentionally NOT in here - -This seed deliberately omits: - -* `proof-debt.md` — only relevant to proof-bearing repos; see - link:https://github.com/hyperpolymath/standards/blob/main/docs/TRUSTED-BASE-REDUCTION-POLICY.adoc[standards#203]. -* `CHANGELOG.md` — generated automatically by - link:https://github.com/hyperpolymath/standards/blob/main/.github/workflows/changelog-reusable.yml[`changelog-reusable.yml`] - (standards#206), don't write by hand. -* `tech-debt-YYYY-MM-DD.md` — generated by the periodic estate audit. - -== "Heavily-developed wiki" bar (audit definition) - -A repo meets the audit's bar when `docs/` contains ≥ 10 substantive -markdown / asciidoc / rst files with topical organisation. Adopting -this seed gets you to ~5 — add repo-specific deep-dives (typically -one per major component or invariant) to clear the bar. diff --git a/build/guix.scm b/build/guix.scm index adbe8c31..ab896ef7 100755 --- a/build/guix.scm +++ b/build/guix.scm @@ -1,9 +1,9 @@ ;; SPDX-License-Identifier: MPL-2.0 ;; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) ;; -;; guix.scm — rsr-template-repo as a Guix package. +;; guix.scm — idris2x as a Guix package. ;; -;; guix build -f build/guix.scm # installs the source tree to share/rsr-template-repo +;; guix build -f build/guix.scm # installs the source tree to share/idris2x ;; guix shell -D -f build/guix.scm # the full development toolchain ;; ;; This is a SOURCE package, and says so: a hermetic compiled build needs this @@ -28,17 +28,17 @@ '(".git" "target" ".eval" "node_modules" "_build" "deps" "zig-out" ".zig-cache" "dist-newstyle")) (package - (name "rsr-template-repo") + (name "idris2x") (version "0.1.0") - (source (local-file %source-dir "rsr-template-repo-checkout" + (source (local-file %source-dir "idris2x-checkout" #:recursive? #t #:select? (lambda (file stat) (not (member (basename file) %ignored))))) (build-system copy-build-system) - (arguments (list #:install-plan #~'(("." "share/rsr-template-repo/")))) + (arguments (list #:install-plan #~'(("." "share/idris2x/")))) (native-inputs (map spec->input (list "git" "bash" "coreutils" "nss-certs" "just" "mise" "shellcheck" "chez-scheme" "gmp" "gcc-toolchain" "zig"))) - (home-page "https://github.com/hyperpolymath/rsr-template-repo") + (home-page "https://github.com/metadatastician/idris2x") (synopsis "Rhodium Standard Repository template") (description "The estate's repository template: the RSR layout, an Idris2 ABI seam with a Zig FFI, CI gates, and the provisioning set (launcher, Justfile, diff --git a/build/just/groove.just b/build/just/groove.just index 2b2d7ae5..14a3949a 100644 --- a/build/just/groove.just +++ b/build/just/groove.just @@ -78,8 +78,8 @@ verify-template: fi # Check for template defaults still present - if grep -q 'rsr-template-repo' Justfile 2>/dev/null; then - echo "⚠ Justfile still references 'rsr-template-repo' — update project name" + if grep -q 'idris2x' Justfile 2>/dev/null; then + echo "⚠ Justfile still references 'idris2x' — update project name" FOUND=1 fi diff --git a/build/just/provision-lib.sh b/build/just/provision-lib.sh index d619bee2..1eca2527 100755 --- a/build/just/provision-lib.sh +++ b/build/just/provision-lib.sh @@ -51,7 +51,7 @@ have() { command -v "$1" >/dev/null 2>&1; } # Where this repository keeps each part of the set. A file sits at the root only # when something needs it there (launcher.sh, Justfile, mise.toml, mise.lock); # the Guix trio and the warm-ups follow the layout the repository already has -# (rsr-template-repo keeps build/guix.scm and docs/onboarding/llm-warmup-*.adoc). +# (idris2x keeps build/guix.scm and docs/onboarding/llm-warmup-*.adoc). # This is the ONE answer: provision-check.sh asks it through `guix-dir` and # `set-files` rather than keeping its own copy. guix_dir() { if [ -f build/guix.scm ]; then echo build; else echo .; fi; } @@ -97,7 +97,7 @@ ARCHETYPE="$(deed archetype "")" # --------------------------------------------------------------------------- # Language detection. Markers at the root or one level down (workspaces). The # estate ABI/FFI pattern nests deeper: Idris2 to two levels down (src/abi/*.ipkg), -# Zig to three (ffi/zig/build.zig, and rsr-template-repo's src/interface/ffi/build.zig: +# Zig to three (ffi/zig/build.zig, and idris2x's src/interface/ffi/build.zig: # 74 repos have their only build.zig at that depth, measured 2026-09-30). # Julia to three (src/julia/Project.toml: occupancy-types keeps its package there). # Order matters only for display. `docs` is reported when nothing else is. diff --git a/build/manifest.scm b/build/manifest.scm index a05df9c9..24246d2e 100644 --- a/build/manifest.scm +++ b/build/manifest.scm @@ -1,7 +1,7 @@ ;; SPDX-License-Identifier: MPL-2.0 ;; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) ;; -;; manifest.scm — the Guix development shell for rsr-template-repo. +;; manifest.scm — the Guix development shell for idris2x. ;; ;; guix shell -m manifest.scm # or: just dev-shell ;; guix time-machine -C channels.scm -- shell -m manifest.scm # the pinned Guix diff --git a/build/templates/ROADMAP.adoc.in b/build/templates/ROADMAP.adoc.in deleted file mode 100644 index 3a465b16..00000000 --- a/build/templates/ROADMAP.adoc.in +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: CC-BY-SA-4.0 -// Copyright (c) Jonathan D.A. Jewell -= {{PROJECT_NAME}} Roadmap - -== Current Status - -Initial development phase. - -== Milestones - -=== v0.1.0 - Foundation -* [ ] Core functionality -* [ ] Basic documentation -* [ ] CI/CD pipeline - -=== v1.0.0 - Stable Release -* [ ] Full feature set -* [ ] Comprehensive tests -* [ ] Production ready - -== Future Directions - -_To be determined based on community feedback._ diff --git a/build/templates/identity.deed.in b/build/templates/identity.deed.in deleted file mode 100644 index 650fa85c..00000000 --- a/build/templates/identity.deed.in +++ /dev/null @@ -1,91 +0,0 @@ - ; >>> repo-identity - ; Written by `just repo-init` from build/templates/identity.deed.in, in - ; place of the block the template repo ships (template issue #209). It replaces - ; descriptiles/CLADE.a2ml and ECOSYSTEM.a2ml; the mapping is standards - ; 1-formats/deed/mappings/clade-to-repo-deed.adoc and - ; meta-ecosystem-to-repo-deed.adoc. - ; - ; THE ID IS MINTED ONCE, NOT INVENTED. The header :repo-uuid is this repo's - ; chora id: the ADR-008 profile C UUIDv8 of its birth path in the domain - ; chora-registry (standards A1 rules U1 to U4, V8 and V9, A7 J11): - ; bash scripts/uuid-v8.sh chora-registry "{{FORGE}}/{{OWNER}}/{{REPO}}" - ; repo-init wrote it at mint. It is carried opaquely and never re-derived: - ; a transfer or rename does not change it. Do not edit it. - ; - ; THE ID IS THE CHORA, NOT THE CLADE (standards A1, ruling W10). The deed - ; header's :repo-uuid is the repo's id. A clade placement is an OPTIONAL - ; identity fact (where the repo sits), never the id and never an edict; - ; chora-registry is authoritative for it. No check requires one, and no name - ; prefix is required. When you do - ; choose one, add a clause beside (identity), for example - ; (clade :primary gm :primary-name "Games & Interactive" :secondary () - ; :assigned "YYYY-MM-DD" :rationale "why") - ; and `just validate-rsr` then checks that the code is one of the 12 and - ; agrees with its name. The 12, read off the RIGHT-HAND column, never off - ; the repository name (two real mis-choices read `pt` and `gv` as letters of - ; the slug): - ; fv Formal Verification & Proofs provable correctness, dependent types, theorem proving - ; nl Nextgen Languages compilers, runtimes, language tooling - ; rm Repo Management & Tooling scaffolding, graph analysis, bots, templates - ; gv Governance & Standards licensing, compliance, policy enforcement - ; db Databases database engines, query languages, storage - ; ap Applications end-user apps, web, desktop, services - ; ix Infrastructure & Cloud containers, deployment, sysadmin - ; dx Developer Ecosystem dev tools, package managers, editors, bindings - ; pt Protocols & Interop internet standards, protocol implementations - ; ax AI & Neurosymbolic ML, neural proof synthesis, AI governance - ; gm Games & Interactive game engines, interactive experiences - ; sc Security scanning, vulnerability management, access control - ; The primary clade reflects the project's core value proposition, not its - ; implementation: a game written in Idris2 is `gm`. - ; - ; REGISTRATION IS NOT DERIVATION. Registering means an entry in the - ; chora-registry (formerly gv-clade-index) seed. It is outward-facing - ; and it is the OWNER's act; an agent must not do it. - (identity - :primary-forge github - :owner "{{OWNER}}") - (forges - :github "{{OWNER}}/{{REPO}}") - ; :type is one of standalone monorepo monorepo-child inflated deflated hub - ; satellite. A hub COORDINATES an ecosystem family; a satellite is - ; coordinated by one and keeps :parent "" (parent names a monorepo parent, - ; never the coordinating hub). - (lineage - :type standalone - :parent "" - :born "{{CURRENT_DATE}}" - :previous-names () - :instantiated-from "rsr-template-repo") - ; :phase is one of reserved incubating active dormant merged superseded - ; archived extinct. A repo created today has not proven anything yet. - (status - :phase incubating - :since "{{CURRENT_DATE}}" - :present #t - :aliases () - :merged-into "" - :superseded-by "" - :successors () - :ended "" - (history - (entry :phase incubating :since "{{CURRENT_DATE}}" :note "created from rsr-template-repo; not yet registered"))) - ; :level is one of experimental alpha beta production lts (standards - ; 1-formats/deed/vocabulary/maturity.adoc). - (maturity - :level experimental - :since "{{CURRENT_DATE}}") - ; Fill in what this repo IS and IS NOT, and the repos it relates to. - ; :relationship is one of standard-source build-tooling validation-tooling - ; signing-tooling verification-tooling minted-from registry. - (ecosystem - :project "{{REPO}}" - :ecosystem "{{OWNER}}" - :position-type "UNASSIGNED" - :purpose "UNASSIGNED" - :not () - :pipeline-position "UNASSIGNED" - :chain "UNASSIGNED" - :coordination standards - (related :name "rsr-template-repo" :relationship minted-from :notes "the template this repo was minted from by just repo-init")) - ; <<< repo-identity diff --git a/docs/AFFIRMATION.adoc b/docs/AFFIRMATION.adoc index 90d321ca..62c3b5cc 100644 --- a/docs/AFFIRMATION.adoc +++ b/docs/AFFIRMATION.adoc @@ -1,6 +1,6 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell -= AFFIRMATION — {{PROJECT_NAME}}, as of += AFFIRMATION — idris2x, as of :toc: macro :toclevels: 2 :std-docs: https://github.com/hyperpolymath/standards/blob/main/docs @@ -37,12 +37,12 @@ toc::[] == What this is, and how it works -*What it is.* A short, dated, signed snapshot of what {{OWNER}} can honestly and -verifiably claim about *{{PROJECT_NAME}}* at one exact commit. Nothing here is +*What it is.* A short, dated, signed snapshot of what metadatastician can honestly and +verifiably claim about *idris2x* at one exact commit. Nothing here is marketing and nothing is a promise about the future — those live in the README. This file is the receipt. -*What the project is.* {{PROJECT_DESCRIPTION}} +*What the project is.* Hermetic, lockfile-pinned toolchain materializer for Idris 2 + Chez Scheme: signed, self-testing capsules and a tiny launcher designed to survive abandonment *How it stays trustworthy.* Three moving parts: @@ -63,7 +63,7 @@ correctness. Treat it as a falsifiable claim, not gospel. == The epistemic contract (read this before you trust _or_ attack) -This document records {{OWNER}}'s *best belief* at the timestamp below. It is +This document records metadatastician's *best belief* at the timestamp below. It is *not a guarantee of correctness.* The only guarantee is *no intentional overclaim*: where something is proven we say "proven"; where it is a documented trust boundary, an experiment, or an unwired module, we say so; where a claim is @@ -95,19 +95,19 @@ file. Bring a counter-example, a failing run, or a contradicting source. | Field | Value | Project -| {{PROJECT_NAME}} +| idris2x | Repo -| `{{OWNER}}/{{REPO}}` +| `metadatastician/idris2x` | Branch -| `{{MAIN_BRANCH}}` +| `main` | Commit (HEAD) | `` | Permalink -| https://{{FORGE}}/{{OWNER}}/{{REPO}}/tree/ +| https://github.com/metadatastician/idris2x/tree/ | Verified (UTC) | `` @@ -120,7 +120,7 @@ file. Bring a counter-example, a failing run, or a contradicting source. | `` | Affirmed by -| {{AUTHOR}} <{{AUTHOR_EMAIL}}> +| Jonathan D.A. Jewell |=== [IMPORTANT] @@ -193,15 +193,15 @@ to prevent — mark it refuted and say what refuted it. [source,bash] ---- -git clone https://{{FORGE}}/{{OWNER}}/{{REPO}} -cd {{REPO}} +git clone https://github.com/metadatastician/idris2x +cd idris2x git checkout # ---- == One-line characterisation (quote this) -> `` +> `` == Joint attestation @@ -213,7 +213,7 @@ hidden. * *Engineering party (AI):* `` — ran the checks recorded here at `` and stands behind the wording above as a faithful report of those runs. -* *Owner / maintainer:* {{AUTHOR}} <{{AUTHOR_EMAIL}}> — _signs by committing +* *Owner / maintainer:* Jonathan D.A. Jewell — _signs by committing this file with `-S`; the git commit signature over this content, at the commit SHA recorded above, is the cryptographic form of this affirmation._ diff --git a/docs/AI_INSTALLATION_GUIDE.adoc b/docs/AI_INSTALLATION_GUIDE.adoc index 10c0b64b..6a2e19a8 100644 --- a/docs/AI_INSTALLATION_GUIDE.adoc +++ b/docs/AI_INSTALLATION_GUIDE.adoc @@ -30,7 +30,7 @@ local checkouts across this estate are routinely stale or carry sweep debris. [source,bash] ---- -git clone https://github.com/hyperpolymath/rsr-template-repo.git my-project +git clone https://github.com/metadatastician/idris2x.git my-project cd my-project rm -rf .git && git init ---- diff --git a/docs/MAINTAINERS.adoc b/docs/MAINTAINERS.adoc index ead75c4d..ab279577 100644 --- a/docs/MAINTAINERS.adoc +++ b/docs/MAINTAINERS.adoc @@ -1,63 +1,85 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell = Maintainers -:toc: preamble +:toc: macro -This is the single maintainer roster for this repository. It supersedes the -earlier duplicates at `.github/MAINTAINERS` and `docs/attribution/MAINTAINERS.adoc`. +Written first, before any launcher code, because it forces the question this project exists to answer: +*what keeps working after the maintainer stops?* + +toc::[] == Current maintainers -[cols="2,3,2",options="header"] -|=== -| Name | Role | Contact +* Jonathan D.A. Jewell (`@hyperpolymath`, metadatastician estate) — sole maintainer, holder of the offline root key. +* A mid-range AI agent runs the bounded weekly loop (link:#the-weekly-loop[below]). It proposes; it never signs, never merges Class B/C, never widens the support matrix. + +== What survives abandonment (the archive-mode contract) + +The design splits into three pieces, and only one of them is code: -| {{AUTHOR}} -| Lead Maintainer -| https://github.com/{{OWNER}}[@{{OWNER}}] +[cols="1,2,3",options="header"] |=== +| Piece | What it is | Why it outlives the maintainer +| Capsules | Immutable `idris2---chez.tar.gz` on GitHub Releases, mirrored to object storage | Content-addressed by sha256 in every lockfile; never rewritten; a dead maintainer cannot change them +| Channel | One signed JSON document (`channel/v1.json` + detached Ed25519 signature) | Pure data: no scripts. The *last* signed version stays valid for resolution until its `expires` date and is never required to *execute* an existing pin +| Launcher | One static binary (Rust, vendored audited crates), under 1,000 lines of our own code | Old digests run under new launchers (I4). The binary itself is pinned by sha256 in each estate repo's CI +|=== + +Invariant to protect above all others: `idris2x install --locked` and `idris2x exec --locked` need *only* the lockfile and the capsule bytes. +They never contact the channel. Expiry, rollback protection and deprecation gate *resolution* (`pin`, `update`), never *execution*. +Proven by the Phase 0 prototype drill "offline cache miss" and "install --from bundle" (see link:status/PHASE0-REPORT.adoc[]). + +If this repository is archived: + +. Existing locks keep working as long as the release assets are reachable (GitHub serves release assets of archived repositories). +. A final "sunset" channel is signed with `expires` ten years out and every bundle marked in `deprecated` with a plain-English note. +. The root public key, the capsule digests and the factory recipes are in this repository; anyone can fork, re-key and republish without our cooperation. Forks must change the channel URL and key; the launcher refuses a key change silently (E-SIG-INVALID), which is the intended behaviour. == Responsibilities -Maintainers are responsible for: +* *Approve data, not write code.* Routine maintenance is a channel patch: a JSON diff, `channel_version + 1`, a new signature. The launcher changes rarely (monthly "engine train" at most). +* *Keep the canaries green.* The nightly matrix runs the 12 canaries in `tests/canaries/` against every Tier 1 capsule. Red is triaged within the week. +* *Hold the human gates:* signing keys, the support matrix (`src/definitions/targets.toml`), Class B/C merges, releases of the launcher. +* *Announce deprecations two quarters ahead* in the channel's `deprecated` list and in CHANGELOG.adoc. -* Reviewing and merging pull requests -* Triaging issues and feature requests -* Ensuring code quality and security standards -* Managing releases and versioning -* Upholding the project's Code of Conduct -* Maintaining documentation and examples -* Responding to security vulnerabilities +== The weekly loop (target 15–30 minutes) -== Contribution process +. Look at the canary badge. Green: done. +. Red: read the auto-filed failure record (stable issue title). Classify: data fix (review the agent's channel patch PR), engine fix (schedule for the monthly train), upstream outage (document, wait). +. Merge by risk class. Class A (mirror URL, docs): auto-merge after two green rehearsals. Class B (new version pins, checksums): one human click. Class C (launcher, schema): human only, needs an ADR. +. The channel version ticks. Done. + +Monthly: engine train if needed. Quarterly: chaos drill (`scripts/proto/chaos.sh` lineage) and key dry-run. Yearly: glibc floor review, upstream roadmap scan, key rotation rehearsal. -Contributions are welcome via: +== Key ceremony (solo) + +* Root key: Ed25519, generated offline, stored on two USB sticks plus a paper seed in separate places. Public key is embedded in the launcher and committed as `channel/root.pub`. +* CI signing key: a separate Ed25519 key whose public half is *listed in the root-signed channel header* (planned for Phase 2; Phase 0/1 sign with the root key only). +* Rotation: publish a channel that lists both old and new keys for two quarters; launchers released in that window accept either; then drop the old one. +* The AI agent never has access to any private key. Signing happens in a protected GitHub environment with a required reviewer, or offline. + +== Contribution process -. **Issues** — report bugs, request features, ask questions -. **Pull requests** — submit improvements for review -. **Discussions** — engage with the wider project +* Channel patches: PR against `channel/v1.json`; CI validates against `src/contracts/channel-v1.schema.json`, checks `channel_version` is exactly +1, re-resolves every example lock, and runs the full canary matrix on three targets before any merge. +* Capsule changes: a new revision (`idris2@0.8.0-2`), never a rewrite of an existing asset. +* Launcher changes: keep under 1,000 lines of our own code, dependencies vendored and allow-listed in `deny.toml`, every failure typed (`src/errors/errors.toml`), every error with a runbook. Property tests for the pure core (resolution, verification, lock parsing). +* Zero-fork policy: we never patch Idris 2 or Chez Scheme. Problems go upstream as well-formed reports (see link:status/UPSTREAM-NOTES.adoc[]). == Decision making -* Routine decisions (bug fixes, minor improvements) may be made by any maintainer. -* Significant changes require discussion and consensus among maintainers. -* Breaking changes should be discussed in an issue, with a migration path, before - implementation. +Architecture Decision Records live in `docs/decisions/`. A decision that changes the channel schema, the lock schema, the error taxonomy's exit codes, or the support matrix requires an ADR and is Class C. == Becoming a maintainer -Contributors who demonstrate consistent, high-quality contributions, an -understanding of the project's goals and standards, constructive participation, -and commitment to its long-term health may be invited to become maintainers at -the discretion of the existing maintainers. +Open an issue describing which of the human gates you would hold. Co-maintainers receive their own CI signing key; the root key is never shared. +A second human holding a root-signed key is the single most valuable survivability upgrade this project can get. == Contact -For questions about project governance, open an issue in this repository. +Issues on this repository. Security reports: see `.github/SECURITY.md`. This project is not affiliated with the Idris 2 or Chez Scheme projects. == See also -* link:GOVERNANCE.adoc[Governance model] -* link:../CODE_OF_CONDUCT.adoc[Code of Conduct] -* link:../CONTRIBUTING.adoc[Contributing guide] -* link:attribution/CODEOWNERS.adoc[Code owners] +* link:decisions/README.adoc[Architecture decisions] +* link:architecture/THREAT-MODEL.adoc[Threat model] +* link:status/PHASE0-REPORT.adoc[Phase 0 empirical report] diff --git a/docs/QUICKSTART.adoc b/docs/QUICKSTART.adoc index fc9fdf97..c1eb5d75 100644 --- a/docs/QUICKSTART.adoc +++ b/docs/QUICKSTART.adoc @@ -15,7 +15,7 @@ Get up and running in 60 seconds. [source,bash] ---- -git clone https://github.com/{{OWNER}}/rsr-template-repo my-project +git clone https://github.com/metadatastician/idris2x my-project cd my-project rm -rf .git && git init -b main just repo-init # interactive placeholder replacement diff --git a/docs/RSR-PHILOSOPHY.adoc b/docs/RSR-PHILOSOPHY.adoc index 05a15903..957b5442 100644 --- a/docs/RSR-PHILOSOPHY.adoc +++ b/docs/RSR-PHILOSOPHY.adoc @@ -51,7 +51,7 @@ Two obligations follow from this, and they are not optional: * *Find the source.* Before acting, trace the thing back to where it is actually defined — the template, the generator, the canon, the single point that everything else inherits from. The estate's structure is - `standards → rsr-template-repo → (every repo)`; a fix that belongs at the + `standards → idris2x → (every repo)`; a fix that belongs at the template does not belong in 380 leaves. * *Be mindful of every up- and down-stream.* A change at a source propagates. Before you make it, know what feeds into the thing you are changing (upstream) diff --git a/docs/SETUP.adoc b/docs/SETUP.adoc index 4bb25e3b..c34df694 100644 --- a/docs/SETUP.adoc +++ b/docs/SETUP.adoc @@ -1,6 +1,6 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) -= Setting up rsr-template-repo by hand += Setting up idris2x by hand :toc: :toclevels: 2 @@ -10,7 +10,7 @@ link:AI_INSTALLATION_GUIDE.adoc[AI_INSTALLATION_GUIDE.adoc]), but those do exactly what is written here, so this page is also what to read when they stop. [horizontal] -Repository:: https://github.com/hyperpolymath/rsr-template-repo +Repository:: https://github.com/metadatastician/idris2x Kind:: library (idris2, zig) Toolchain declared in:: `mise.toml` (versions `latest`, made concrete in `mise.lock`), and `build/manifest.scm` / `build/guix.scm` / `build/channels.scm` for Guix @@ -56,12 +56,12 @@ The Guix development shell (`build/manifest.scm`) already includes both. [source,bash] ---- -git clone https://github.com/hyperpolymath/rsr-template-repo.git -cd rsr-template-repo +git clone https://github.com/metadatastician/idris2x.git +cd idris2x ---- Or with OPSM, the odds-and-sods package manager (see <>): -`opsm install https://github.com/hyperpolymath/rsr-template-repo.git --registry git` +`opsm install https://github.com/metadatastician/idris2x.git --registry git` TIP: To start a *new* project from this template, use GitHub's *Use this template* button (or clone as above), install the toolchain (step 3), then run @@ -160,10 +160,10 @@ when it is not. [source,bash] ---- -opsm install https://github.com/hyperpolymath/rsr-template-repo.git --registry git +opsm install https://github.com/metadatastician/idris2x.git --registry git ---- -rsr-template-repo has no registry package, so OPSM fetches it through its git +idris2x has no registry package, so OPSM fetches it through its git adapter; then provision it with `./launcher.sh --setup`. To get OPSM itself (Erlang/OTP 26+ and Elixir 1.16+ required): @@ -219,4 +219,4 @@ every fix marked *auto* for you. |=== Still stuck? `just doctor > doctor.txt 2>&1` and open an issue at -https://github.com/hyperpolymath/rsr-template-repo/issues with that file attached. +https://github.com/metadatastician/idris2x/issues with that file attached. diff --git a/build/docs-seed/architecture.adoc b/docs/architecture.adoc similarity index 93% rename from build/docs-seed/architecture.adoc rename to docs/architecture.adoc index 685b0244..717b4d97 100644 --- a/build/docs-seed/architecture.adoc +++ b/docs/architecture.adoc @@ -1,8 +1,8 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -// SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> -= Architecture — {{PROJECT_NAME}} -:revdate: {{CURRENT_YEAR}}-MM-DD +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (metadatastician) += Architecture — idris2x +:revdate: 2026-MM-DD == System overview diff --git a/docs/architecture/REPOSITORY-MAP.adoc b/docs/architecture/REPOSITORY-MAP.adoc index d1985eb4..7c32d7a2 100644 --- a/docs/architecture/REPOSITORY-MAP.adoc +++ b/docs/architecture/REPOSITORY-MAP.adoc @@ -129,7 +129,7 @@ predecessors did. | optional | community health file; GitHub accepts it at root, docs/ or .github/ -| `archetypes/` +| `archetypes` | optional | template-only variation seam (ADR-0003); `just repo-init` removes it from minted repos @@ -175,7 +175,7 @@ predecessors did. | `rsr-template-repo_chora.deed` | yes -| the repo deed: universal AI entry point; family-7 allocation manifest + ply tree folded in (standards#837 pilot). Filename carries the repo slug (deed dispatch _chora.deed), so repo-init renames it at mint +| - | `scripts/` | yes diff --git a/docs/architecture/THREAT-MODEL.adoc b/docs/architecture/THREAT-MODEL.adoc index 43d945d1..6f9630b0 100644 --- a/docs/architecture/THREAT-MODEL.adoc +++ b/docs/architecture/THREAT-MODEL.adoc @@ -1,197 +1,85 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 -// Copyright (c) Jonathan D.A. Jewell +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell = Threat Model -// SPDX-License-Identifier: CC-BY-SA-4.0 -// Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +:toc: macro -== Threat Model: {{PROJECT_NAME}} +== Threat Model: idris2x === Document Info -|=== -| Field | Value - -| Project | {{PROJECT_NAME}} -| Version | 1.0 -| Last Reviewed | {{DATE}} -| Author | {{AUTHOR}} -| Methodology | STRIDE -|=== +Version 0.1 (Phase 0, 2026-11-09). Sources: the plan's Section 4, the Phase 0 red-team audit (primary sources cited inline), and the prototype drills in `scripts/proto/chaos.sh`. +toc::[] === Scope ==== In Scope - -- Application source code and build pipeline -- CI/CD workflows (GitHub Actions) -- Container images and runtime environment -- Secrets and credential management -- Dependencies (direct and transitive) -- Deployment artifacts (binaries, containers, SBOM) +* The launcher binary, its cache/store, the lockfile, the signed channel manifest, capsule archives, mirrors, the factory CI, the maintainer's keys, the first-install (bootstrap) path, the air-gap path. ==== Out of Scope - -- Physical security of hosting infrastructure -- GitHub/GitLab platform-level vulnerabilities -- End-user device security -- Social engineering attacks against maintainers (handled by org policy) +* Bugs inside Idris 2 or Chez Scheme themselves (zero-fork policy: reported upstream, see `docs/status/UPSTREAM-NOTES.adoc`). +* Compromise of the user's own machine or account. === System Overview -Brief description of {{PROJECT_NAME}} and its architecture. - -NOTE: See link:../STATE-VISUALIZER.adoc[STATE-VISUALIZER.adoc] for the full architecture diagram and completion dashboard. +`idris2x.toml` → `idris2x.lock` (digests + URLs) → launcher: resolve (local) → fetch (any mirror) → verify (sha256, tar rules) → unpack to staging → probes → atomic rename → `.complete` → direct `execve` of the capsule's Chez with an explicit environment. Resolution (`pin`/`update`) additionally fetches the channel manifest and verifies its Ed25519 signature, monotonic `channel_version` and `expires`. Execution never needs the manifest. === Assets -|=== -| Asset | Classification | Owner | Notes - -| Source code | Internal | Maintainers | Public repos are still internal-integrity -| Signing keys | Restricted | Release lead | Signing keys (e.g., Ed25519), GPG keys -| CI/CD secrets | Restricted | Maintainers | GITHUB_TOKEN, deploy tokens, PATs -| User/contributor data | Confidential | Org | Emails, contributor identity -| Build artifacts | Internal | CI pipeline | Binaries, WASM bundles -| Container images | Internal | CI pipeline | Chainguard-based, signed via image signing tool -| SBOM / provenance | Public | CI pipeline | SLSA attestations -| Dependencies | Public | Lockfile | Cargo.lock, .lock, gleam.toml -| Infrastructure config | Confidential | Maintainers | Containerfiles, compose files, orchestration config -|=== - +. Integrity of what executes (the pinned digest, nothing else) — I1/I5. +. The channel signing key(s); the embedded root public key. +. Availability of capsules for existing locks after abandonment — I4. +. The maintainer's and users' privacy (no telemetry). +. Redistribution compliance (Apache-2.0 + NOTICE, BSD-3, LZ4 BSD-2, Nanopass MIT, zlib). === Trust Boundaries +[cols="1,2,2",options="header"] |=== -| Boundary | From (Lower Trust) | To (Higher Trust) - -| Pull request submission | External contributor | Repository codebase -| CI/CD workflow execution | Workflow definition | Runner with secrets access -| Container build boundary | Build stage | Runtime stage -| External API calls | Third-party service | Application internals -| User input (CLI/Web) | End user | Application logic -| Dependency resolution | Package registry | Build environment -| Forge mirroring | GitHub | GitLab / Bitbucket +| Boundary | Trusted side | Untrusted side +| Channel signature | Embedded root public key, manifest bytes that verify | Every mirror, every URL, GitHub, Cloudflare, the network +| Lockfile | The project's reviewed `idris2x.lock` | Anything not matching its sha256 +| Store | Directories with `.complete` whose `sha256sums.txt` verifies | Staging dirs, partial downloads, dirs without the marker +| Process environment | Variables the launcher sets | Inherited `IDRIS2_*`, `LD_LIBRARY_PATH`, `DYLD_*`, `CHEZ`, `PATH` +| Capsule archive | Members that pass the extractor rules | Absolute paths, `..`, escaping links, hardlinks, devices, setuid bits |=== - === Threat Actors -|=== -| Actor | Motivation | Capability - -| Script kiddie | Vandalism, clout | Low -| Disgruntled contributor | Sabotage, backdoor insertion | Medium -| Supply chain attacker | Wide-impact compromise | High -| Nation state | Espionage, disruption | Very High -| Automated bot | Credential stuffing, spam PRs | Low-Medium -|=== - +Malicious or compromised mirror; compromised CI runner or GitHub token; network attacker (TLS stripping is out of scope for HTTPS-only URLs, but a captive portal can serve 200s); a squatter who registers the repository name after a rename or deletion; a local unprivileged process sharing the cache (CI runners); the maintainer's own mistakes. === STRIDE Analysis ==== Spoofing - -|=== -| Threat | Affected Asset | Likelihood | Impact | Risk | Mitigation - -| Unsigned commits impersonate maintainer | Source code | Medium | High | High | Require GPG-signed commits; vigilant code review -| Forged bot actions (automated agents) | CI/CD pipeline | Low | High | Medium | Bot tokens scoped minimally; audit bot activity -| Spoofed package registry identity | Dependencies | Low | High | Medium | Pin dependencies by hash; verify provenance -|=== - +* *Fake manifest / fake mirror.* Mitigated: Ed25519 signature with the key pinned in the launcher; key-id must match; pre-hashed formats rejected (`E-SIG-INVALID`). Drilled: tampered manifest, wrong key. +* *Repository squatting after rename/transfer.* GitHub keeps a 301 from the old name until it is re-registered. Mitigation: lock URLs list two providers (GitHub Releases plus an object-store mirror on a domain we control); signatures make squatting a denial, not a forgery. +* *First-launcher trust is TOFU over TLS.* Mitigation: publish the root key fingerprint in at least two independent places (README, release notes, DNS TXT) and ship the launcher through independently reviewed manifests (Homebrew, winget, Nix) whose own hashes pin it; `self-update` verifies new launchers with the embedded key. Residual: `curl | sh` users. ==== Tampering - -|=== -| Threat | Affected Asset | Likelihood | Impact | Risk | Mitigation - -| Malicious pull request | Source code | Medium | High | High | Branch protection; required reviews; CodeQL -| Dependency poisoning (typosquat) | Dependencies | Medium | High | High | Lockfiles; secret-scanner; security scans -| Tampered container base image | Container images | Low | High | Medium | Chainguard images; image signing verification -| Workflow file modification | CI/CD pipeline | Low | High | Medium | CODEOWNERS on .github/; workflow-linter -|=== - +* *Flipped or truncated bytes, substituted capsule.* Mitigated: sha256 of the archive and `sha256sums.txt` of the tree before anything runs; partial downloads are deleted on mismatch (`E-HASH-MISMATCH`). Drilled. +* *Rollback / freeze / mix-and-match of the channel.* Mitigated: monotonic `channel_version` recorded in the lock (`E-CHANNEL-ROLLBACK`), `expires` (`E-CHANNEL-EXPIRED`, explicit override only), one manifest covering all targets. Residual: a fresh install with no prior lock accepts any manifest inside its expiry window; a rotatable key list signed by an offline root (two-tier TUF-lite) is the planned Phase 2 addition. +* *Code injection through the environment.* Idris 2 treats `IDRIS2_DATA`, `IDRIS2_LIBS`, `IDRIS2_PACKAGE_PATH`, `IDRIS2_INC_SRC` and `IDRIS2_PATH` as search paths and splices `support.ss` into every compiled program; `LD_LIBRARY_PATH`/`DYLD_LIBRARY_PATH` select `libidris2_support`. Mitigation (ADR 0005): the launcher *sets* every one of these, inheriting none unless `--inherit-env` is passed, and never places user-writable directories ahead of the capsule. +* *Overlays as an injection vector.* Overlays are capsules: content-addressed, listed by hash in the signed manifest, verified like a base capsule. No post-install scripts, ever. +* *Archive extraction.* Rules (PEP 706 "data" filter equivalent): reject absolute names, `..` components, links resolving outside the staging tree, hardlinks (materialise as copies), devices/fifos; strip setuid/setgid/sticky and group/other write; `lstat` parents so nothing writes through a link; the factory rejects case-fold duplicate names (macOS). Drilled: `..` member and escaping symlink. The Phase 1 Go extractor must use a containment check, not `filepath.Join(dst, Clean(name))` (the audit's skeleton showed that escapes). +* *Store races.* Per-digest `flock`; staging → rename; `.complete` written last; directories without the marker are garbage. Drilled: four concurrent installs, lock contention, write-limit failure. ==== Repudiation - -|=== -| Threat | Affected Asset | Likelihood | Impact | Risk | Mitigation - -| Unlogged deployment | Build artifacts | Medium | Medium | Medium | SLSA provenance; deployment audit trail -| Denied merge of vulnerable code | Source code | Low | Medium | Low | Git history is immutable; signed commits -| Secret rotation without record | CI/CD secrets | Low | Low | Low | Secret rotation logged in `docs/status/ROADMAP.adoc` (Maintenance runs) -|=== - +* Every published capsule carries SLSA provenance and a Sigstore attestation; *the factory verifies the build attestation before the channel is signed* (attestation-gated signing), so the channel signature implies a verified build. Immutable GitHub releases prevent silent re-upload. The launcher does not verify attestations (offline, stdlib); humans and CI do with `gh attestation verify`. ==== Information Disclosure - -|=== -| Threat | Affected Asset | Likelihood | Impact | Risk | Mitigation - -| Secrets leaked in git history | CI/CD secrets | Medium | High | High | TruffleHog in CI; secret-scanner workflow -| Verbose error messages in prod | Application logic | Medium | Medium | Medium | Sanitize outputs; structured logging -| SBOM reveals internal structure | Infrastructure | Low | Low | Low | Accepted risk; SBOM is intentionally public -|=== - +* GitHub and Cloudflare access logs see IP, user agent and the capsule name (OS/arch/version). Mitigation: fetches only on explicit `pin`/`update`/`install`, generic User-Agent, no install IDs, no background checks, `IDRIS2X_OFFLINE`, self-hosted channels. Documented in the privacy policy. ==== Denial of Service - -|=== -| Threat | Affected Asset | Likelihood | Impact | Risk | Mitigation - -| CI resource exhaustion (fork bomb in PR) | CI/CD pipeline | Medium | Medium | Medium | Concurrency limits; timeout on workflows -| Spam issues/PRs flooding triage | Maintainer time | Medium | Low | Low | GitHub rate limits; bot auto-close stale -| Large binary commits bloating repo | Source code | Low | Medium | Low | .gitattributes LFS policy; pre-commit hooks -|=== - +* *Mirror outage / bandwidth throttling (GitHub AUP §9).* Mitigated: `urls[]` per capsule across two providers, resume via `Range` (always re-requesting the stable github.com URL, since the redirect target is a five-minute signed URL), hedged fetch in Phase 2. +* *Abandonment.* Mitigated: execution never needs the manifest; immutable releases survive archiving; sunset manifest with long `expires`; archival copies (Internet Archive item; IPFS pin) in Phase 2. +* *Disk full / interrupted install.* Typed failure, store unchanged. Drilled. ==== Elevation of Privilege +* The launcher writes only under its cache, its temp dir and the project directory; never needs `sudo`; strips special permission bits on extraction; refuses to run anything before verification. Chez and Idris 2 run with the user's privileges only. -|=== -| Threat | Affected Asset | Likelihood | Impact | Risk | Mitigation - -| Workflow injection via PR title/body | CI/CD pipeline | Medium | High | High | Never interpolate PR fields in `run:`; use env vars -| GITHUB_TOKEN over-scoped | CI/CD secrets | Medium | High | High | `permissions: read-all` default; per-job scoping -| Container escape | Runtime environment | Low | High | Medium | Hardened container runtime; read-only rootfs; no-new-privileges -| Compromised action dependency | CI/CD pipeline | Medium | High | High | SHA-pin all actions; never use `@latest` tags -|=== - - -=== Mitigations in Place - -- **SLSA Provenance**: Build attestations via slsa-github-generator -- **Secret Scanning**: TruffleHog + secret-scanner workflow on every push -- **Static Analysis**: CodeQL on supported languages -- **Supply Chain**: OpenSSF Scorecard (scorecard.yml + scorecard-enforcer.yml) -- **Container Signing**: Ed25519 signatures on all published images (optional: use your signing tool) -- **Container Runtime**: Hardened container runtime with formal verification (optional) -- **Dependency Pinning**: All GitHub Actions SHA-pinned; lockfiles committed -- **Workflow Validation**: workflow-linter.yml checks all workflow changes -- **Security Scanning**: Neurosymbolic scanning (hypatia-scan.yml, optional) -- **Bot Governance**: Bot orchestration with confidence thresholds (optional) -- **Edge Security**: Gateway with policy enforcement (optional, where applicable) -- **SBOM**: Generated and published with releases - -=== Residual Risks - -|=== -| Risk | Accepted Because | Review Trigger - -| Zero-day in GitHub Actions runner | Platform responsibility; no feasible mitigation | GitHub advisory -| Maintainer account compromise | Mitigated by 2FA requirement; residual remains | Any suspicious activity -| Transitive dependency vulnerability (0-day) | Lockfiles limit blast radius; scanning catches known CVEs | CVE database update -| SBOM exposes internal component names | Transparency is a design goal | Policy change -|=== - - -=== Review Schedule - -This threat model should be reviewed: - -- **Quarterly** as a standing item -- **When architecture changes** (new services, new trust boundaries, new deployment targets) -- **Before major releases** (v1.0, v2.0, etc.) -- **After any security incident** affecting this project or its dependencies +=== Residual Risks and Decisions Deferred -Reviewer should update the "Last Reviewed" date and version in Document Info above. +* Single signing key until Phase 2 (rotation list signed by offline root). +* Intel macOS runners are sunsetting (~2027); `x86_64-apple-darwin` may need cross-build (`make bootquick XM=ta6osx`) or demotion. +* Compiled user programs embed the store path (`#!/bin/scheme --program`) and break if the store path contains spaces or the capsule is garbage-collected; `doctor` warns, docs recommend `--cg refc` for long-lived artifacts. +* Export-control notification for distributing TLS-containing binaries is a policy question for the estate (not legal advice). diff --git a/docs/attribution/CITATIONS.adoc b/docs/attribution/CITATIONS.adoc index 0a8b4192..4880b90d 100644 --- a/docs/attribution/CITATIONS.adoc +++ b/docs/attribution/CITATIONS.adoc @@ -1,36 +1,36 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -= {{PROJECT_NAME}} - Citation Guide += idris2x - Citation Guide :toc: == BibTeX [source,bibtex] ---- -@software{{{PROJECT_NAME}}_{{CURRENT_YEAR}}, - author = {{{AUTHOR_LAST}}, {{AUTHOR_FIRST}}}, - title = {{{PROJECT_NAME}}}, - year = {{{CURRENT_YEAR}}}, - url = {https://github.com/{{OWNER}}/{{PROJECT_NAME}}}, +@software{idris2x_2026, + author = {Jewell, Jonathan D.A.}, + title = {idris2x}, + year = {2026}, + url = {https://github.com/metadatastician/idris2x}, license = {MPL-2.0} } ---- == Harvard Style -{{AUTHOR_LAST}}, {{AUTHOR_INITIALS}} ({{CURRENT_YEAR}}) _{{PROJECT_NAME}}_ [Computer software]. Available at: https://github.com/{{OWNER}}/{{PROJECT_NAME}} +Jewell, J. (2026) _idris2x_ [Computer software]. Available at: https://github.com/metadatastician/idris2x == OSCOLA -{{AUTHOR}}, '{{PROJECT_NAME}}' ({{CURRENT_YEAR}}) +Jonathan D.A. Jewell, 'idris2x' (2026) == MLA -{{AUTHOR_LAST}}, {{AUTHOR_FIRST}} "{{PROJECT_NAME}}." {{CURRENT_YEAR}}, github.com/{{OWNER}}/{{PROJECT_NAME}}. +Jewell, Jonathan D.A. "idris2x." 2026, github.com/metadatastician/idris2x. == APA 7 -{{AUTHOR_LAST}}, {{AUTHOR_INITIALS}} ({{CURRENT_YEAR}}). _{{PROJECT_NAME}}_ [Computer software]. GitHub. https://github.com/{{OWNER}}/{{PROJECT_NAME}} +Jewell, J. (2026). _idris2x_ [Computer software]. GitHub. https://github.com/metadatastician/idris2x == See Also diff --git a/build/docs-seed/contributing.adoc b/docs/contributing.adoc similarity index 88% rename from build/docs-seed/contributing.adoc rename to docs/contributing.adoc index eb22aac2..ce55977a 100644 --- a/build/docs-seed/contributing.adoc +++ b/docs/contributing.adoc @@ -1,12 +1,12 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -// SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> -= Contributing — {{PROJECT_NAME}} -:revdate: {{CURRENT_YEAR}}-MM-DD +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (metadatastician) += Contributing — idris2x +:revdate: 2026-MM-DD == Audience -Developers working *on* `{{PROJECT_NAME}}`. For consumers (people calling +Developers working *on* `idris2x`. For consumers (people calling or depending on it) see link:./usage.adoc[usage.adoc]. == Local-dev setup @@ -23,8 +23,8 @@ One-shot setup: [source,bash] ---- -git clone git@github.com:{{OWNER}}/{{PROJECT_NAME}}.git -cd {{PROJECT_NAME}} +git clone git@github.com:metadatastician/idris2x.git +cd idris2x just setup # installs deps, sets up hooks just test # runs the full test suite ---- @@ -86,6 +86,6 @@ When you make a non-obvious design decision, write it down: == Reporting issues -* Bugs in `{{PROJECT_NAME}}`: file at `{{OWNER}}/{{PROJECT_NAME}}/issues`. +* Bugs in `idris2x`: file at `metadatastician/idris2x/issues`. * Estate-wide concerns (policy, conventions, CI): file at `hyperpolymath/standards/issues`. diff --git a/docs/decisions/0000-template.adoc b/docs/decisions/0000-template.adoc index 32c2c2a5..7a8774a2 100644 --- a/docs/decisions/0000-template.adoc +++ b/docs/decisions/0000-template.adoc @@ -2,7 +2,7 @@ // Copyright (c) Jonathan D.A. Jewell = Architecture Decision Record: 0000-template // SPDX-License-Identifier: CC-BY-SA-4.0 -// Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +// Copyright (c) 2026 Jonathan D.A. Jewell (metadatastician) == [NUMBER]. [TITLE] diff --git a/docs/decisions/0001-adopt-rsr-standard.adoc b/docs/decisions/0001-adopt-rsr-standard.adoc index cfcc68e9..0b580648 100644 --- a/docs/decisions/0001-adopt-rsr-standard.adoc +++ b/docs/decisions/0001-adopt-rsr-standard.adoc @@ -2,7 +2,7 @@ // Copyright (c) Jonathan D.A. Jewell = Architecture Decision Record: 0001-adopt-rsr-standard // SPDX-License-Identifier: CC-BY-SA-4.0 -// Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +// Copyright (c) 2026 Jonathan D.A. Jewell (metadatastician) NOTE: Superseded in part (2026-10-06, rsr-template-repo#209): the `.a2ml` files named below no longer exist; their facts are clauses of the repo deed (`*_chora.deed`). @@ -58,7 +58,7 @@ New repositories are created by cloning the template: [source,bash] ---- -git clone https://github.com/{{OWNER}}/rsr-template-repo new-repo-name +git clone https://github.com/metadatastician/rsr-template-repo new-repo-name cd new-repo-name rm -rf .git && git init ---- diff --git a/build/docs-seed/decisions/0001-template.adoc b/docs/decisions/0001-template.adoc similarity index 94% rename from build/docs-seed/decisions/0001-template.adoc rename to docs/decisions/0001-template.adoc index eff8bb85..6b339a45 100644 --- a/build/docs-seed/decisions/0001-template.adoc +++ b/docs/decisions/0001-template.adoc @@ -1,8 +1,8 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -// SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (metadatastician) = ADR-0001 — Use Architecture Decision Records -:revdate: {{CURRENT_YEAR}}-MM-DD +:revdate: 2026-MM-DD :status: ACCEPTED == Context diff --git a/docs/decisions/0004-pin-chez-10-build-from-release-tarball.adoc b/docs/decisions/0004-pin-chez-10-build-from-release-tarball.adoc new file mode 100644 index 00000000..6a6dca72 --- /dev/null +++ b/docs/decisions/0004-pin-chez-10-build-from-release-tarball.adoc @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += ADR 0004. Pin the Chez Scheme 10.x line for every target and build it from the upstream release tarball + +Date: 2026-11-09 + +== Status + +Accepted (Phase 0 spike, measured). + +== Context + +The plan assumed "reuse cisco/ChezScheme release binaries where available" and paired Idris 2 with Chez 9.6.4. +Checked against upstream: releases ship only a Windows installer and the source tarball; 9.6.4 exists (2023-10-16) but +refuses Apple Silicon and has no arm64 boot files; Idris 2 v0.8.0 needs a *threaded* Chez and >= 10.0.0 on any AArch64 target. +Measured here: `csv10.4.1.tar.gz` (sha256 `2e74952db7bc177f0c3602e2217a341ba677d733eec4cd7726418c3a4e1ef308`) configures, builds and +installs in 2 min 44 s on 4 cores, producing a 6 MB tree whose `bin/scheme` is a relative symlink into `lib/csv10.4.1//`. + +== Decision + +* One Chez line for all capsules: 10.4.1 (latest, 2026-05-12). A capsule name always carries it: `idris2-0.8.0--chez10.4.1`. +* The factory builds Chez from the sha256-pinned release tarball on native runners, with `./configure --disable-x11 --disable-curses` + (X11 is only dlopen'ed for the REPL clipboard; curses only serves the REPL line editor; dropping both removes the `libtinfo` runtime dependency). +* Keep upstream's install layout and the executable basename `scheme` (the boot file name is derived from it), so the tree is relocatable with no environment variables. +* Ship `LICENSE`, `NOTICE`, and the LZ4/zlib notices under `licenses/`; never ship the csug Cisco logo files. + +== Consequences + +=== Positive +* Apple Silicon and Linux arm64 are first-class with the same Chez everywhere; one compat row per Idris 2 version. +* No dependency on third-party binary distributions (Homebrew bottles, distro packages) whose versions drift (Ubuntu noble ships 9.5.8). + +=== Negative +* Every capsule build pays ~3 minutes of Chez compilation per target (cacheable by tarball digest). +* Windows x64 needs MSVC (vcruntime140.dll) or MSYS2; stays Tier 2. + +=== Neutral +* Chez 9.5.x would still work for x86_64 Linux users who bring their own (Tier 2 BYO), but we do not build 9.x capsules. diff --git a/docs/decisions/0005-relocation-by-direct-exec.adoc b/docs/decisions/0005-relocation-by-direct-exec.adoc new file mode 100644 index 00000000..34b270b3 --- /dev/null +++ b/docs/decisions/0005-relocation-by-direct-exec.adoc @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += ADR 0005. The launcher execs the capsule's Chez directly; no wrapper scripts, one explicit environment contract + +Date: 2026-11-09 + +== Status + +Accepted (Phase 0 spike, measured: 11 of 12 canaries pass on a tree copied into a path with spaces). + +== Context + +Idris 2's installed `bin/idris2` is a POSIX sh script that execs `bin/idris2_app/idris2.so`, whose first line is +`#! --program`. Three facts make that fragile for a relocatable capsule: +the baked path (`src/Compiler/Scheme/Chez.idr:87-91`), the Linux shebang limit (256 bytes since kernel 5.1, 128 before; a +`~/.cache/idris2x/store/sha256-<64 hex>/bin/scheme --program` line is ~125 bytes), and macOS SIP stripping `DYLD_LIBRARY_PATH` +when passing through `/bin/sh`. The compiler's own prefix is baked into `src/IdrisPaths.idr` but overridden at runtime by `IDRIS2_PREFIX`. + +== Decision + +The launcher performs `execve(/bin/scheme, ["scheme", "--program", "/bin/idris2_app/idris2.so", args...])` +(argv-identical to what the wrappers end up doing) with exactly this environment, recorded in each capsule's `capsule.json`: + +[cols="1,2",options="header"] +|=== +| Variable | Value +| `IDRIS2_PREFIX` | `` — libraries, support files, `libidris2_support` +| `CHEZ` | `/bin/scheme` — so the compiler finds Chez when compiling user programs +| `SCHEMEHEAPDIRS` | `/lib/csv/%m` — belt and braces; the default executable-relative path already works +| `IDRIS2_INC_SRC` | `/bin/idris2_app` +| `LD_LIBRARY_PATH` / `DYLD_LIBRARY_PATH` | `/bin/idris2_app` prepended (the compiler dlopens `libidris2_support`) +| `PATH` | `/bin` prepended +|=== + +The contract is a *reset*, not a prepend: the launcher also clears inherited `IDRIS2_PATH`, `IDRIS2_PACKAGE_PATH`, +`IDRIS2_DATA`, `IDRIS2_LIBS`, `IDRIS2_CG`, `IDRIS2_INC_CGS` and any `CHEZ`/`SCHEMEHEAPDIRS` from the environment unless +`--inherit-env` is given, because Idris 2 treats every one of them as a code search path (THREAT-MODEL.adoc, Tampering). +`idris2x run -- ` execs `/bin/scheme` the same way. The capsule factory builds Idris 2 with `CHEZ` set to an +absolute path and the *same* `PREFIX` for `make bootstrap` and `make install` (the libraries are installed by the freshly +built compiler into its baked prefix). + +== Consequences + +=== Positive +* No `sh`, no `readlink -f`, no `zsh` on macOS, no shebang length limit, no SIP interaction; warm path is a stat plus an execve. +* The store path may contain spaces and non-ASCII characters (verified for spaces; see ADR note on Idris 2's own non-ASCII bug). + +=== Negative +* Programs compiled *through* the capsule embed `#!/bin/scheme --program`; garbage-collecting or moving that capsule breaks them. + `idris2x gc` must say so loudly, and the docs must recommend `--cg refc` or re-compilation for long-lived artifacts. +* The exec form is capsule-layout-specific; the layout is therefore part of `capsule.json` (`exec` and `env` fields), not of the launcher. + +=== Neutral +* Rewriting the `.so` shebang at capsule-build time remains possible (Chez tolerates it) but is not needed. diff --git a/docs/decisions/0006-glibc-floor-via-manylinux-containers.adoc b/docs/decisions/0006-glibc-floor-via-manylinux-containers.adoc new file mode 100644 index 00000000..c00585e8 --- /dev/null +++ b/docs/decisions/0006-glibc-floor-via-manylinux-containers.adoc @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += ADR 0006. Build Linux capsules inside manylinux_2_28 containers to honour the glibc 2.28 floor + +Date: 2026-11-09 + +== Status + +Accepted (measured; container build itself is Phase 1 work). + +== Context + +The plan promises "glibc 2.28+". A Chez 10.4.1 built on the `ubuntu-24.04` runner image requires symbols up to `GLIBC_2.38` +(measured with `objdump -T`), which would exclude RHEL/Alma 8, Debian 11 and Ubuntu 22.04 hosts. GitHub retired the +`ubuntu-20.04` runner (glibc 2.31) in April 2025, so "pick an old runner" is not available. + +== Decision + +Linux x86_64 and aarch64 capsules are built inside `quay.io/pypa/manylinux_2_28_` (AlmaLinux 8, glibc 2.28, modern GCC), +the same mechanism Python wheels use. The runner is still native (`ubuntu-24.04`, `ubuntu-24.04-arm`); only the build runs in +the container. The factory records the measured maximum `GLIBC_x.y` symbol version into `capsule.json` as `min_glibc`, and the +launcher reports `E-GLIBC-FLOOR` when the probe run of `scheme --version` fails with `version 'GLIBC_...' not found`. + +== Consequences + +=== Positive +* A single Linux capsule per architecture covers every mainstream distribution released since 2018. +* No cross-compilation machinery; `zig cc -target x86_64-linux-gnu.2.28` stays a documented Phase 3 experiment. + +=== Negative +* Docker is required in the factory workflow; the Idris 2 bootstrap (measured 10 min natively) runs inside the container. +* musl/Alpine hosts are unsupported until a musl capsule exists (tracked in `src/definitions/targets.toml` as a future target). + +=== Neutral +* Chez's vendored zlib and LZ4 are static; the only remaining runtime dependencies are `libc` and `libm`. diff --git a/docs/decisions/0007-launcher-constraints-compression-digest-lock-language.adoc b/docs/decisions/0007-launcher-constraints-compression-digest-lock-language.adoc new file mode 100644 index 00000000..49146fa7 --- /dev/null +++ b/docs/decisions/0007-launcher-constraints-compression-digest-lock-language.adoc @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += ADR 0007. Launcher constraints: gzip capsules, sha256 digests, JSON lock + minimal TOML config, language choice + +Date: 2026-11-09 + +== Status + +Proposed — recommendation A′ below (Rust). Superseded in part by the estate audit (ADR 0011): the canon bans Go for new work and the +template's gates enforce it, so the plan's Go launcher is not available without an owner ruling. The owner decision still to take is Rust vs Zig. + +== Context + +The plan requires simultaneously: Go, `CGO_ENABLED=0`, *standard library only*, under 1,000 lines, zstd tarballs, BLAKE3 digests, +TOML config and lockfile, minisign signatures, per-digest flock, direct execve, Windows Tier 2. Checked on Go 1.24.7: + +[cols="2,1,3",options="header"] +|=== +| Need | In Go stdlib? | Note +| zstd decompression | no | `compress/gzip`, `compress/bzip2` (decode only) are; xz is not +| BLAKE3 / BLAKE2b | no | `crypto/sha256`, `crypto/sha3` are +| TOML | no | `encoding/json` is +| Ed25519 verify | yes | minisign's *default* pre-hashed mode needs BLAKE2b; signify / minisign legacy mode do not +| flock | Linux/macOS yes; Windows no | Windows: `LockFileEx` through `syscall.NewLazyDLL`, or an `O_EXCL` lock directory +| execve | Linux/macOS yes; Windows no real execve | Windows: spawn child, relay exit code and signals +|=== + +Measured on the real Linux x86_64 capsule (137 MB tree): gzip -9 35.4 MB / unpack 0.67 s; zstd -19 28.3 MB / 0.20 s; xz -9 19.5 MB / 1.4 s. +Removing the bootstrap artifacts Idris 2 installs (`idris2-boot.so`, `*.ss`, ~30 MB raw) will shrink every variant further. + +== Options + +[cols="1,3,1,1",options="header"] +|=== +| | Approach | Elegance | Dependability +| A | Go, stdlib only: `.tar.gz`, sha256, signify-format Ed25519, JSON lock, ~100-line TOML-subset reader for the 3-key `idris2x.toml` | 4 | 5 +| B | Go plus two vendored pure-Go packages (zstd, TOML); keep sha256 | 3 | 4 +| A+ | As A, plus a *copy* of Go's own BSD-licensed decoder-only `internal/zstd` (2,279 lines, no module dependency) so capsules stay zstd | 3 | 4 +| C | Zig 0.17.x, stdlib only (`std.compress.zstd`, `Blake3`, `Ed25519`, `std.tar`, `std.http` + TLS, `std.Io.File.lock`) — probe built 300–630 KB static binaries for four targets from one host | 5 | 2 +| D | Rust with `zstd`, `blake3`, `toml`, `minisign-verify`, `rustls`; `cargo vendor` for reproducibility; estate has a `rust-cli` archetype | 3 | 4 +|=== + +== Recommendation after the estate audit (A′: Rust, same discipline) + +Keep every decision below (gzip, sha256, JSON lock + minimal TOML, direct exec, reset environment) and implement it in Rust from the +`rust-cli` archetype, replacing "stdlib only" with "minimal, vendored, audited crates" enforced by `cargo vendor`, `cargo deny` +(the template ships `compliance/rust/deny.toml`) and a pinned toolchain. Candidate crate set, each with a pure-Rust option: +`ureq` + `rustls` (HTTP/TLS; std has neither), `flate2` with the `miniz_oxide` backend (gzip), `sha2`, `ed25519-dalek` or +`minisign-verify` (pure, no deps), `serde_json`, and a hand-written TOML-subset reader (no `toml` crate needed for three keys). +LOC ceiling stays 1,000 for *our* code; Creusot/Verus contracts on the pure core (resolution, lock parsing, digest checks) are the +proof route the canon already names for Rust. Zig (option C) is the permitted fallback if the maintainer prefers it, with the +toolchain tarball vendored because of the measured std API churn. + +== The Go-shaped recommendation as originally evaluated (A) + +* Capsules are `.tar.gz` for the launcher; the factory may *also* publish `.tar.zst`/`.tar.xz` for humans and mirrors, each with its own + digest entry. The download penalty versus zstd is ~25% for ~0.5 s more unpacking, paid once per capsule per machine. +* One digest algorithm: sha256 (channel, lock, `sha256sums.txt`). BLAKE3 adds nothing the threat model needs. +* Humans write TOML, machines write JSON: `idris2x.toml` holds `[toolchain] idris2 = "0.8.0"` and optional overlay/channel keys (a + tiny strict subset: tables, strings, arrays of strings, booleans — anything else is `E-PIN-DRIFT`-class loud failure); + `idris2x.lock` and the channel are JSON with sorted keys, validated against `src/contracts/channel-v1.schema.json`. +* Go keeps the 1.x compatibility promise, which is the property "survive abandonment" needs most from a language; a 1,000-line + stdlib-only program compiled by any future Go 1.x is the strongest source-rot guarantee available among the options. + *Estate verdict:* unavailable — Go is on the banned list (LANGUAGE-POLICY §3) and `.go` files fail the template's quality gate; Rust's + editions plus a vendored, pinned dependency set are the nearest substitute for that guarantee. +* Windows (Tier 2) is implemented as spawn-and-relay with a lock directory; the Unix path keeps real execve and flock. +* Measured skeleton (audit, Go 1.24.7, `-trimpath -ldflags='-s -w'`, `CGO_ENABLED=0`): 5.98 MB linux/amd64 (5.6–6.2 MB across the five targets; `crypto/tls` + `net/http` dominate) — so the plan's "3–5 MB" becomes "about 6 MB"; warm overhead 1.7 ms for a no-op and 2.8 ms for lock parse + flock + execve, against a 20 ms budget. The fetch/verify/extract/exec skeleton is 209 lines; the TOML subset reader 248 lines. + +== Why not the others + +* B: vendoring 10k+ lines next to a 1,000-line launcher inverts the review surface; zstd's benefit is a quarter of the download. +* A+: a reasonable compromise if download size matters more than audit surface: the copied decoder is Go-team code, fuzzed, 2.3k lines, ~160 MB/s; it must be re-synced by hand. Decide once the pruned capsule has been measured with `zstd --long=27`. +* C: Zig's standard library covers every need and would be the most elegant implementation (probe verified on 0.17.1), but pre-1.0 churn is measured, not hypothetical: `std.posix.execveZ`/`flock` existed in 0.14/0.15 and are gone in 0.17, and zstd/ZON/Io APIs were renamed between releases. The *source* would stop compiling within a year or two of abandonment even though the binary keeps working. Revisit after Zig 1.0; if chosen anyway, vendor the exact toolchain tarball next to the source. +* D: the dependency tree (TLS, zstd, toml, …) is the supply-chain surface the plan is trying to avoid; the `zstd` crate links C (`ruzstd` is pure but 1.4–3.5x slower), macOS/Windows cross-builds need extra toolchains; acceptable only with full vendoring and `cargo deny`; the estate's Rust archetype makes it viable if the maintainer prefers Rust day to day. +* Vendored-dependency trap measured for B: current `klauspost/compress`, `x/crypto` and `x/sys` already require Go 1.25/1.26; a frozen build needs pinned versions and `GOTOOLCHAIN=local`. + +== Consequences + +=== Positive +* Zero external code in the trusted computing base of the launcher; verification uses only `crypto/ed25519` and `crypto/sha256`. + +=== Negative +* ~7 MB more per capsule download than zstd would give; a TOML-subset reader to maintain (property-tested). + +=== Neutral +* The channel schema already allows per-variant entries, so switching the launcher to zstd later is a data change plus a launcher release. diff --git a/docs/decisions/0008-channel-trust-signify-ed25519-monotonic-expiry.adoc b/docs/decisions/0008-channel-trust-signify-ed25519-monotonic-expiry.adoc new file mode 100644 index 00000000..68f60a47 --- /dev/null +++ b/docs/decisions/0008-channel-trust-signify-ed25519-monotonic-expiry.adoc @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += ADR 0008. Channel trust: pure Ed25519 (signify/minisign-legacy format), monotonic versions, expiry that gates resolution only + +Date: 2026-11-09 + +== Status + +Accepted (Phase 0 prototype drills: tampered manifest, wrong key, rollback and expiry all fail loudly with stable exit codes). + +== Context + +The plan said "minisign". minisign's default mode pre-hashes with BLAKE2b-512, which is not in Go's standard library; its legacy +mode and OpenBSD signify both sign the raw bytes with Ed25519, which *is* (`crypto/ed25519`). The plan's "TUF-lite" (monotonic +`channel_version`) stops rollback but not a freeze attack (serving an old-but-valid manifest forever). + +== Decision + +* Signature format: signify-compatible (`Ed` algorithm, 8-byte key id, 64-byte Ed25519 signature over the manifest bytes). + Verifiable by `crypto/ed25519`, `openssl pkeyutl -verify -rawin`, `signify`, and `minisign -l`. Pre-hashed `ED` signatures are rejected. +* `channel_version` is strictly monotonic; the lockfile records the version it was resolved from and `pin`/`update` refuse to go + backwards (`E-CHANNEL-ROLLBACK`). A rollback is published as version N+1 with the old content. +* Every manifest carries `expires` (re-signed on each publish, default +90 days). After expiry `pin`/`update` fail with + `E-CHANNEL-EXPIRED`; `IDRIS2X_ALLOW_EXPIRED=1` is the explicit human override. *Execution never consults the manifest*: a lock plus + capsule bytes is sufficient forever (I4). +* The channel is data only: schema-validated (`src/contracts/channel-v1.schema.json`), no scripts, no commands, HTTPS URLs only. Mirrors are untrusted. + +== Consequences + +=== Positive +* Stdlib-only verification in the launcher; keys and signatures can be produced and audited with ubiquitous tools. +* Freeze, rollback and mix-and-match are detected; abandonment does not strand existing pins. + +=== Negative +* A maintainer must re-sign at least every 90 days or new pins start failing (loudly, with an override). The sunset procedure in MAINTAINERS.adoc covers the end state. +* No delegation/threshold roles yet (full TUF is an explicit non-goal for v1). + +=== Neutral +* Capsule provenance attestations (SLSA, sigstore) are published for humans and CI and are *not* verified by the launcher. diff --git a/docs/decisions/0009-error-taxonomy-as-data.adoc b/docs/decisions/0009-error-taxonomy-as-data.adoc new file mode 100644 index 00000000..3f4b3363 --- /dev/null +++ b/docs/decisions/0009-error-taxonomy-as-data.adoc @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += ADR 0009. The error taxonomy is data: stable IDs and exit codes in `src/errors/errors.toml`, runbooks and tables generated + +Date: 2026-11-09 + +== Status + +Accepted (generators in `scripts/gen-runbooks.py`, `scripts/gen-matrix.py`; `--check` mode for CI drift). + +== Context + +"Every failure has a stable ID, a runbook page and an exact fix" only stays true if the three cannot drift apart. + +== Decision + +* `src/errors/errors.toml` is the single source: ID, exit code, meaning, fix. Exit codes are append-only; never renumbered. +* `docs/runbooks/.adoc` are generated stubs with a protected hand-written triage section; CI runs the generator in `--check` mode. +* The launcher's error table and `--json` output are generated from the same file (Phase 1). +* Phase 0 added five IDs the plan lacked: `E-CAPSULE-INVALID`, `E-CHANNEL-ROLLBACK`, `E-CHANNEL-EXPIRED`, `E-STORE-IO`, `E-INTERNAL`. + +== Consequences + +=== Positive +* `idris2x explain` and the AI triage loop can key on IDs with confidence; docs cannot lie about exit codes. + +=== Negative +* Adding an error is a data change plus a regenerate, not a one-line edit. + +=== Neutral +* The same pattern drives `src/definitions/targets.toml` → CI matrix and support table. diff --git a/docs/decisions/0010-hosting-and-survivability.adoc b/docs/decisions/0010-hosting-and-survivability.adoc new file mode 100644 index 00000000..dacb9265 --- /dev/null +++ b/docs/decisions/0010-hosting-and-survivability.adoc @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += ADR 0010. Hosting and survivability: immutable GitHub Releases plus an object-store mirror on our own domain; manifest URLs are a list + +Date: 2026-11-09 + +== Status + +Accepted (from the Phase 0 infra audit; implementation is Phase 1/2). + +== Context + +GitHub Releases: 2 GiB per asset, 1000 assets per release, no published bandwidth cap but an acceptable-use clause allowing +throttling; asset URLs survive rename/transfer (301) and archiving, not deletion; the download redirect is a signed URL valid for +about five minutes; immutable releases are generally available (2025-10-28). Cloudflare R2: 10 GB storage and egress free, public +buckets only via a custom domain, `Range` may be answered with a full `200` at the edge. + +== Decision + +* Capsules are published to *immutable* GitHub Releases (draft → attach all assets → publish) and mirrored to an R2 bucket behind a + domain we control. Every `urls[]` entry in the channel lists both; the launcher treats all mirrors as untrusted. +* The launcher embeds a *list* of channel manifest URLs (Releases asset + mirror); identical bytes, identical signature, any one succeeds. +* Resume (`Range`) applies only to immutable, digest-addressed capsule downloads, never to the channel manifest or any other mutable document (the Phase 0 drills caught a stale-partial splice). Resume logic always re-requests the stable `github.com/.../releases/download/...` URL, never a cached redirect target, and restarts + when a `Range` request is answered with `200`. +* The factory verifies each capsule's build attestation (`gh attestation verify --deny-self-hosted-runners`) *before* the channel is signed. +* Phase 2 adds archival deposits (Internet Archive item per release; IPFS pin with the sha256 recorded) and a sunset procedure (MAINTAINERS.adoc). + +== Consequences + +=== Positive +* No single provider can deny existing pins; squatting a renamed repository cannot forge anything. +* Immutability becomes platform-enforced rather than merely hash-detectable. + +=== Negative +* A domain is a new expiry risk (multi-year auto-renew, registrar lock); CI must keep two copies in sync. +* Intel macOS capsules depend on runners GitHub plans to retire (~2027); tracked in `src/definitions/targets.toml`. + +=== Neutral +* GitHub Pages was rejected as a manifest host: same provider, and project URLs are not redirected on rename. diff --git a/docs/decisions/0011-estate-compliance-mint-rust-cli.adoc b/docs/decisions/0011-estate-compliance-mint-rust-cli.adoc new file mode 100644 index 00000000..77e9eb0b --- /dev/null +++ b/docs/decisions/0011-estate-compliance-mint-rust-cli.adoc @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += ADR 0011. Estate compliance: mint from rsr-template-repo with the `rust-cli` archetype; obey LANGUAGE-, LICENCE- and PROOF-POLICY + +Date: 2026-11-16 + +== Status + +Accepted for the repository shape; the implementation language is confirmed in ADR 0007 (owner decision). + +== Context + +idris2x lives in the metadatastician/hyperpolymath estate, whose canon (`metadatastician/standards`) is enforced by the RSR +template's CI gates. The Phase 0 estate audit (read-only inspection of `hyperpolymath/rsr-template-repo` @2be7b88, +`metadatastician/standards`, `hyperpolymath/scaffoldia`) established: + +* `3-practice/LANGUAGE-POLICY.adoc` §3 bans Go, Python ("no exceptions"), Java/Kotlin, Swift, V, ATS2, ReScript and Makefiles for new + work; the gates are executable (`scripts/check-spdx-headers.sh` fails on any `.go`/`.py`, `check-mise-language.sh`, + `build/just/provision-lib.sh`, `governance-reusable.yml`, hypatia). The "overridable via AGENTIC" note in generated CLAUDE.md has no schema or gate behind it. +* The only CLI archetype is `rust-cli` (preset `[rust, cli, library]`); there is no Go or Zig archetype. `scaffoldia` is a design surface (5% complete) and cannot mint. +* Licence policy: MPL-2.0 for code and configuration, CC-BY-SA-4.0 for prose; third-party licences preserved verbatim (no conflict with redistributing Apache-2.0 Chez and BSD-3 Idris 2 provided `LICENSE`/`NOTICE` ship and `dep5` carries Files stanzas). +* Docs are AsciiDoc; `.md` only for GitHub community files at root or `.github/`. A minimal RSR repo still needs 33 required root entries, so minting is cheaper than hand-building. +* Today the estate gets Idris 2 from `pack` (unpinned source build) or the idris2-pack container, never from mise. `PROOF-POLICY.adoc` §6 requires proof toolchains in CI to come from the repo's Guix manifest or container, otherwise a recorded *deviation* asserting version and digest. +* The Interface & Architecture Law treats a lockfile/manifest verifier as a (de)serialisation trust boundary that wants an Idris 2 contract; gates only enforce it when the `abi` capability is declared. + +== Decision + +. Create `metadatastician/idris2x` from the template ("Use this template" or clone), then mint non-interactively: ++ +---- +mise trust && mise install +RSR_NON_INTERACTIVE=1 PROJECT_NAME=idris2x REPO=idris2x OWNER=metadatastician \ + AUTHOR="Jonathan D.A. Jewell" AUTHOR_EMAIL= mise exec -- just repo-init rust-cli +---- ++ +Prerequisites on the minting host: `just`, `yq`, `rustc`, `uuidgen`, `nickel`, `file`, network to github.com. Remove the template's +temporary `oracle-segfault-diag.yml` before minting if it is still on main. +. Implementation language: Rust (canon CLI language; `rust-cli` archetype; Creusot/Verus route available for the symbolic core). Go would + need an owner ruling amending LANGUAGE-POLICY §3 plus gate changes in `standards` and the template; it is not pursued. Zig remains the + fallback (permitted, but ADR 0007 records its API churn). +. No Python anywhere in the repository: generators are bash with a strict TOML-subset converter (`scripts/lib/toml2json.sh`, awk) and `jq`; the prototype stays bash. +. Licences: MPL-2.0 (code, scripts, data), CC-BY-SA-4.0 (docs); `LICENSES/` gains `Apache-2.0.txt` and `BSD-3-Clause.txt` for vendored upstream notices; `dep5` lists capsule-side third-party content. +. Proof-policy alignment: the `idris2x.lock` *is* a version-plus-digest assertion. Until PROOF-POLICY lists capsule installs as a sanctioned route, estate repos using idris2x in CI record a §6 deviation that names the launcher version, the capsule digest and the `idris2x verify` step; a canon change request is filed (beyond-repo). +. Interface Law: declare `abi`, and make the Idris 2 ABI module a *real* contract — the lockfile and `capsule.json` schemas as total Idris 2 types with decoding proofs — rather than the template placeholder. This is also the natural home for the install state machine's invariants (atomic-or-absent) as a model checked by the mathesis census. +. Configure stage (out of band, once): `gh repo edit` identity, visibility (SCAFFOLD-LIFECYCLE defaults to private; public is needed for free arm64/macOS runners and free CodeQL/Scorecard SARIF), rulesets (signed commits, linear history, immutable tags), gv-clade-index registration, commit-signing key. + +== Consequences + +=== Positive +* Born wired into the estate's provenance, drift gates, oracle scoring and CI; no exceptions to argue about. +* Rust's `cargo vendor` + the template's `compliance/rust/deny.toml` give the supply-chain discipline the plan wanted from "stdlib only". + +=== Negative +* The plan's Go launcher is dropped; the "stdlib only" rule becomes "minimal, vendored, audited crates" (ADR 0007 lists them). +* Inherited workflows (`proven-tests.yml` expects the Zig seam; `estate-rules.yml` checks root shape and repo-map freshness) need the same change to prune or wire them. + +=== Neutral +* `just` replaces any Makefile *we* would write; the factory still drives upstream's Makefiles, which is invoking, not authoring. diff --git a/docs/decisions/README.adoc b/docs/decisions/README.adoc index cb9c6d84..75ce7f67 100644 --- a/docs/decisions/README.adoc +++ b/docs/decisions/README.adoc @@ -1,3 +1,23 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -= decisions Unit += Architecture Decision Records + +Template-inherited (estate): + +* link:0001-adopt-rsr-standard.adoc[0001] Adopt the Rhodium Standard Repository template +* link:0002-variant-contract.adoc[0002] Variant contract +* link:0003-forge-and-sustain-lifecycle.adoc[0003] Forge and sustain lifecycle +* link:0000-template.adoc[0000] / link:0001-template.adoc[template] ADR templates + +idris2x (Phase 0, measured on real builds; see link:../status/PHASE0-REPORT.adoc[the Phase 0 report]): + +* link:0004-pin-chez-10-build-from-release-tarball.adoc[0004] Pin Chez Scheme 10.x for every target; build it from the release tarball +* link:0005-relocation-by-direct-exec.adoc[0005] Relocation by direct exec; the environment contract is a reset +* link:0006-glibc-floor-via-manylinux-containers.adoc[0006] glibc 2.28 floor via manylinux_2_28 containers +* link:0007-launcher-constraints-compression-digest-lock-language.adoc[0007] Launcher constraints: gzip, sha256, JSON lock + minimal TOML; Rust +* link:0008-channel-trust-signify-ed25519-monotonic-expiry.adoc[0008] Channel trust: Ed25519, monotonic versions, expiry gates resolution only +* link:0009-error-taxonomy-as-data.adoc[0009] The error taxonomy is data +* link:0010-hosting-and-survivability.adoc[0010] Hosting and survivability: immutable releases, own-domain mirror, manifest URL list +* link:0011-estate-compliance-mint-rust-cli.adoc[0011] Estate compliance: mint with `rust-cli`, MPL-2.0, AsciiDoc, PROOF-POLICY deviation, Idris 2 contract + +A change to the channel schema, lock schema, exit codes or support matrix is Class C and needs a new ADR. diff --git a/docs/developer/ABI-FFI-README.adoc b/docs/developer/ABI-FFI-README.adoc index 2a9ff086..d9d9061d 100644 --- a/docs/developer/ABI-FFI-README.adoc +++ b/docs/developer/ABI-FFI-README.adoc @@ -3,7 +3,7 @@ = ABI/FFI Standards {{~ Aditionally delete this line and fill out the template below ~}} -== {{PROJECT}} ABI/FFI Documentation +== IDRIS2X ABI/FFI Documentation === Overview @@ -29,7 +29,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design: ▼ ┌─────────────────────────────────────────────┐ │ C Headers (auto-generated) │ -│ generated/abi/{{project}}.h │ +│ generated/abi/idris2x.h │ └─────────────────┬───────────────────────────┘ │ │ imported by @@ -42,7 +42,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design: │ - Memory-safe by default │ └─────────────────┬───────────────────────────┘ │ - │ compiled to lib{{project}}.so/.a + │ compiled to libidris2x.so/.a ▼ ┌─────────────────────────────────────────────┐ │ Any Language via C ABI │ @@ -53,7 +53,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design: === Directory Structure ---- -{{project}}/ +idris2x/ ├── src/ │ ├── abi/ # ABI definitions (Idris2) │ │ ├── Types.idr # Core type definitions with proofs @@ -70,11 +70,11 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design: │ ├── test/ │ │ └── integration_test.zig │ └── include/ -│ └── {{project}}.h # C header (optional, can be generated) +│ └── idris2x.h # C header (optional, can be generated) │ ├── generated/ # Auto-generated files │ └── abi/ -│ └── {{project}}.h # Generated from Idris2 ABI +│ └── idris2x.h # Generated from Idris2 ABI │ └── bindings/ # Language-specific wrappers (optional) ├── rust/ @@ -212,7 +212,7 @@ zig build test # Run tests [source,bash] ---- cd src/abi -idris2 --cg c-header Types.idr -o ../../generated/abi/{{project}}.h +idris2 --cg c-header Types.idr -o ../../generated/abi/idris2x.h ---- ==== Cross-Compile @@ -237,19 +237,19 @@ zig build -Dtarget=x86_64-windows [source,c] ---- -#include "{{project}}.h" +#include "idris2x.h" int main() { - void* handle = {{project}}_init(); + void* handle = idris2x_init(); if (!handle) return 1; - int result = {{project}}_process(handle, 42); + int result = idris2x_process(handle, 42); if (result != 0) { - const char* err = {{project}}_last_error(); + const char* err = idris2x_last_error(); fprintf(stderr, "Error: %s\n", err); } - {{project}}_free(handle); + idris2x_free(handle); return 0; } ---- @@ -257,14 +257,14 @@ int main() { Compile with: [source,bash] ---- -gcc -o example example.c -l{{project}} -L./zig-out/lib +gcc -o example example.c -lidris2x -L./zig-out/lib ---- ==== From Idris2 [source,idris] ---- -import {{PROJECT}}.ABI.Foreign +import IDRIS2X.ABI.Foreign main : IO () main = do @@ -282,22 +282,22 @@ main = do [source,rust] ---- -#[link(name = "{{project}}")] +#[link(name = "idris2x")] extern "C" { - fn {{project}}_init() -> *mut std::ffi::c_void; - fn {{project}}_free(handle: *mut std::ffi::c_void); - fn {{project}}_process(handle: *mut std::ffi::c_void, input: u32) -> i32; + fn idris2x_init() -> *mut std::ffi::c_void; + fn idris2x_free(handle: *mut std::ffi::c_void); + fn idris2x_process(handle: *mut std::ffi::c_void, input: u32) -> i32; } fn main() { unsafe { - let handle = {{project}}_init(); + let handle = idris2x_init(); assert!(!handle.is_null()); - let result = {{project}}_process(handle, 42); + let result = idris2x_process(handle, 42); assert_eq!(result, 0); - {{project}}_free(handle); + idris2x_free(handle); } } ---- @@ -306,21 +306,21 @@ fn main() { [source,julia] ---- -const lib{{project}} = "lib{{project}}" +const libidris2x = "libidris2x" function init() - handle = ccall((:{{project}}_init, lib{{project}}), Ptr{Cvoid}, ()) + handle = ccall((:idris2x_init, libidris2x), Ptr{Cvoid}, ()) handle == C_NULL && error("Failed to initialize") handle end function process(handle, input) - result = ccall((:{{project}}_process, lib{{project}}), Cint, (Ptr{Cvoid}, UInt32), handle, input) + result = ccall((:idris2x_process, libidris2x), Cint, (Ptr{Cvoid}, UInt32), handle, input) result end function cleanup(handle) - ccall((:{{project}}_free, lib{{project}}), Cvoid, (Ptr{Cvoid},), handle) + ccall((:idris2x_free, libidris2x), Cvoid, (Ptr{Cvoid},), handle) end # Usage @@ -377,7 +377,7 @@ When modifying the ABI/FFI: 2. **Generate C header** ```bash - idris2 --cg c-header src/interface/Abi/Types.idr -o generated/abi/{{project}}.h + idris2 --cg c-header src/interface/Abi/Types.idr -o generated/abi/idris2x.h ``` 3. **Update FFI implementation** (`ffi/zig/src/main.zig`) @@ -396,10 +396,10 @@ When modifying the ABI/FFI: === License -{{LICENSE}} +MPL-2.0 === See Also - https://idris2.readthedocs.io[Idris2 Documentation] - https://ziglang.org/documentation/master/[Zig Documentation] -- https://github.com/{{OWNER}}/rhodium-standard-repositories[Rhodium Standard Repositories] +- https://github.com/metadatastician/rhodium-standard-repositories[Rhodium Standard Repositories] diff --git a/docs/governance/CRG-AUDIT-TEMPLATE.adoc b/docs/governance/CRG-AUDIT-TEMPLATE.adoc index 192c5f93..c332cfcd 100644 --- a/docs/governance/CRG-AUDIT-TEMPLATE.adoc +++ b/docs/governance/CRG-AUDIT-TEMPLATE.adoc @@ -1,8 +1,8 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -= {{PROJECT_NAME}} — CRG Audit ({{CURRENT_DATE}}) -{{AUTHOR}} -{{CURRENT_DATE}} += idris2x — CRG Audit (2026-11-16) +Jonathan D.A. Jewell +2026-11-16 :toc: :sectnums: @@ -18,17 +18,17 @@ == Scope and Standard -Evaluates the `{{REPO}}` repository against +Evaluates the `idris2x` repository against *Component Readiness Grades v2.0 (STRICT)*, 2026-03-30 revision. - Standard: `standards/component-readiness-grades/COMPONENT-READINESS-GRADES.md` -- Template (criteria boilerplate): `rsr-template-repo/docs/governance/CRG-CRITERIA.adoc` +- Template (criteria boilerplate): `idris2x/docs/governance/CRG-CRITERIA.adoc` - Self-declared grade (prior art): * `docs/status/ROADMAP.adoc` → `Declared CRG grade: ` line * `docs/READINESS.md` (if present) → per-component grades * Third-party badges (Glama, OpenSSF, etc.) if any — note date and scope -- Audit date: {{CURRENT_DATE}} -- Auditor: {{AUTHOR}} +- Audit date: 2026-11-16 +- Auditor: Jonathan D.A. Jewell The audit grades the repo *as-is today*, not aspirationally. @@ -49,7 +49,7 @@ The audit grades the repo *as-is today*, not aspirationally. Publication requires B+. Long alpha is discipline, not shame. -== Evidence Inventory (verified {{CURRENT_DATE}}) +== Evidence Inventory (verified 2026-11-16) === Structural compliance (Grade D floor) @@ -101,7 +101,7 @@ Do *not* mark PRESENT without citing the path. | Build-system policy (RSR R-020) | Remote -| `git@{{FORGE}}:{{OWNER}}/{{REPO}}.git` (origin only) / drift +| `git@github.com:metadatastician/idris2x.git` (origin only) / drift | `git remote -v` |=== @@ -135,7 +135,7 @@ RSR compliance verdict: *met* / *partial* / *not met* — Grade D floor satisfie | Dangerous-pattern scan (`assert_total`, `Admitted`, `sorry`, `unsafeCoerce`, `Obj.magic`) | N -| Grepped {{CURRENT_DATE}}. +| Grepped 2026-11-16. |=== === Test matrix @@ -283,7 +283,7 @@ them. Examples: - `docs/READINESS.md` — per-component table. Note v1.0-vs-v2.0 schema alignment. - `*_chora.deed` (repo deed) — authoritative phase and maturity (`(status)`, `(maturity)`). - `docs/status/ROADMAP.adoc` — milestones, evidence and the declared CRG grade. -- `docs/governance/CRG-LIFT-PLAN-{{CURRENT_DATE}}.adoc` — companion plan for +- `docs/governance/CRG-LIFT-PLAN-2026-11-16.adoc` — companion plan for D→C (and medium-term C→B) lifts. - `docs/governance/CRG-CRITERIA.adoc` — boilerplate criteria doc. diff --git a/docs/governance/TEMPLATE-LINEAGE-AUDIT.adoc b/docs/governance/TEMPLATE-LINEAGE-AUDIT.adoc index 9c64d8ae..71e65abc 100644 --- a/docs/governance/TEMPLATE-LINEAGE-AUDIT.adoc +++ b/docs/governance/TEMPLATE-LINEAGE-AUDIT.adoc @@ -51,7 +51,7 @@ ____ NOTE: 2026-10-02 — rsr-template-repo#209 retired STATE/META/ECOSYSTEM/AGENTIC/CLADE.a2ml; their content is now in the repo deed (`*_chora.deed`) and `docs/status/ROADMAP.adoc`. -The ordinary mint path rewrites `{{OWNER}}`, `{{REPO}}` and friends. Those +The ordinary mint path rewrites `metadatastician`, `idris2x` and friends. Those tokens *are* consumed widely — 56 files in this repository, including the README badge block, `CITATION.cff`, `.github/CODEOWNERS`, `.github/settings.yml` and the three AI-assistant rule files. The problem is @@ -195,7 +195,7 @@ both files. NOTE: 2026-10-02 — in this template, rsr-template-repo#209 retired CLADE.a2ml; the canonical name now lives in the repo deed header (`:canonical-name`). *Severity is lower than it appears.* Across every `Justfile` and `*.just` in -that repository there are *zero* `{{OWNER}}` or `{{REPO}}` interpolations, so +that repository there are *zero* `metadatastician` or `idris2x` interpolations, so neither variable is consumed by any recipe. This is a wrong self-description with no runtime effect — worth fixing because a template propagates its own mistakes, not because anything currently misbehaves. diff --git a/docs/onboarding/QUICKSTART-DEV.adoc b/docs/onboarding/QUICKSTART-DEV.adoc index 2affbac7..5ffc0206 100644 --- a/docs/onboarding/QUICKSTART-DEV.adoc +++ b/docs/onboarding/QUICKSTART-DEV.adoc @@ -1,14 +1,14 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell // Template: QUICKSTART-DEV.adoc — clone → build → test → PR -// Replace rsr-template-repo, {{BUILD_CMD}}, {{TEST_CMD}}, {{LANG_STACK}} with actuals -= rsr-template-repo — Quick Start for Developers +// Replace idris2x, cargo build --release, cargo test --all-targets, Rust (edition 2021) with actuals += idris2x — Quick Start for Developers :toc: :toclevels: 2 == Tech Stack -{{LANG_STACK}} +Rust (edition 2021) == Set Up Development Environment @@ -23,8 +23,8 @@ guix shell [source,bash] ---- -git clone https://github.com/hyperpolymath/rsr-template-repo.git -cd rsr-template-repo +git clone https://github.com/metadatastician/idris2x.git +cd idris2x just setup-dev ---- @@ -32,21 +32,21 @@ just setup-dev [source,bash] ---- -{{BUILD_CMD}} +cargo build --release ---- == Test [source,bash] ---- -{{TEST_CMD}} +cargo test --all-targets ---- == Project Structure [source] ---- -rsr-template-repo/ +idris2x/ ├── src/ # Source code ├── src/interface/Abi/ # Idris2 ABI definitions (if applicable) ├── ffi/zig/ # Zig FFI bridge (if applicable) @@ -84,7 +84,7 @@ just panic-scan # No new security issues Read `.machine_readable/MUST.contractile` before making changes. Key invariants that must never be violated: -{{MUST_INVARIANTS}} +UNASSIGNED == LLM/AI Agent Development @@ -100,5 +100,5 @@ Or read the repo deed (`*_chora.deed` at root) and `.claude/CLAUDE.md` directly. == Get Help * **Architecture**: link:../EXPLAINME.adoc[EXPLAINME.adoc] -* **Wiki**: https://github.com/hyperpolymath/rsr-template-repo/wiki +* **Wiki**: https://github.com/metadatastician/idris2x/wiki * **Report issue**: `just help-me` diff --git a/docs/onboarding/QUICKSTART-MAINTAINER.adoc b/docs/onboarding/QUICKSTART-MAINTAINER.adoc index aaaa3484..da621e92 100644 --- a/docs/onboarding/QUICKSTART-MAINTAINER.adoc +++ b/docs/onboarding/QUICKSTART-MAINTAINER.adoc @@ -1,30 +1,30 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell // Template: QUICKSTART-MAINTAINER.adoc — packaging, deploying, and maintaining -// Replace rsr-template-repo, {{PACKAGE_NAME}}, {{DEPS}} with actuals -= rsr-template-repo — Quick Start for Platform Maintainers +// Replace idris2x, UNASSIGNED, crates.io via Cargo.toml with a [compat] floor per dependency with actuals += idris2x — Quick Start for Platform Maintainers :toc: :toclevels: 2 == Overview -This guide covers packaging, deploying, and maintaining rsr-template-repo for +This guide covers packaging, deploying, and maintaining idris2x for distribution on your platform. == Runtime Dependencies -{{DEPS}} +crates.io via Cargo.toml with a [compat] floor per dependency == Build from Source [source,bash] ---- -git clone https://github.com/hyperpolymath/rsr-template-repo.git -cd rsr-template-repo +git clone https://github.com/metadatastician/idris2x.git +cd idris2x just build-release ---- -Output: `{{BUILD_OUTPUT_PATH}}` +Output: `target/release/` == Packaging @@ -40,7 +40,7 @@ guix build -f build/guix.scm [source,bash] ---- just stapeln-export # Generates Containerfile -podman build -t rsr-template-repo . +podman build -t idris2x . ---- === Manual Package @@ -59,10 +59,10 @@ Files installed: | `$PREFIX/bin/` | Executables -| `$PREFIX/share/{{PACKAGE_NAME}}/` +| `$PREFIX/share/UNASSIGNED/` | Data files, assets -| `$PREFIX/share/doc/{{PACKAGE_NAME}}/` +| `$PREFIX/share/doc/UNASSIGNED/` | Documentation | `$PREFIX/share/applications/` @@ -74,9 +74,9 @@ Files installed: == Configuration -Default config location: `$XDG_CONFIG_HOME/{{PACKAGE_NAME}}/config.toml` +Default config location: `$XDG_CONFIG_HOME/UNASSIGNED/config.toml` -Fallback: `$HOME/.config/{{PACKAGE_NAME}}/config.toml` +Fallback: `$HOME/.config/UNASSIGNED/config.toml` == Health Checks @@ -96,7 +96,7 @@ just build-release just install --prefix=/usr/local ---- -Or via OPSM: `opsm update {{PACKAGE_NAME}}` +Or via OPSM: `opsm update UNASSIGNED` == Security Notes @@ -111,13 +111,13 @@ For deploying multiple instances (e.g., different users or tenants): [source,bash] ---- -just install --prefix=/opt/{{PACKAGE_NAME}}-instance1 --config=/etc/{{PACKAGE_NAME}}/instance1.toml -just install --prefix=/opt/{{PACKAGE_NAME}}-instance2 --config=/etc/{{PACKAGE_NAME}}/instance2.toml +just install --prefix=/opt/UNASSIGNED-instance1 --config=/etc/UNASSIGNED/instance1.toml +just install --prefix=/opt/UNASSIGNED-instance2 --config=/etc/UNASSIGNED/instance2.toml ---- Each instance has isolated config, data, and logs. == Reporting Issues -* Upstream: https://github.com/hyperpolymath/rsr-template-repo/issues +* Upstream: https://github.com/metadatastician/idris2x/issues * With diagnostic: `just help-me` (pre-fills context) diff --git a/docs/onboarding/QUICKSTART-USER.adoc b/docs/onboarding/QUICKSTART-USER.adoc index d0134136..1ded29dc 100644 --- a/docs/onboarding/QUICKSTART-USER.adoc +++ b/docs/onboarding/QUICKSTART-USER.adoc @@ -1,12 +1,12 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell // Template: QUICKSTART-USER.adoc — 5-minute path to working software -// Replace rsr-template-repo, Rsr Template Repo — See README.adoc for details., just run, Rsr Template Repo started successfully. with actuals -= rsr-template-repo — Quick Start for Users +// Replace idris2x, Rsr Template Repo — See README.adoc for details., just run, Rsr Template Repo started successfully. with actuals += idris2x — Quick Start for Users :toc: :toclevels: 2 -== What is rsr-template-repo? +== What is idris2x? Rsr Template Repo — See README.adoc for details. @@ -38,8 +38,8 @@ Before you begin, ensure you have: [source,bash] ---- # Clone and set up -git clone https://github.com/hyperpolymath/rsr-template-repo.git -cd rsr-template-repo +git clone https://github.com/metadatastician/idris2x.git +cd idris2x just setup ---- @@ -62,7 +62,7 @@ just stapeln-run [source,bash] ---- -just install --portable --prefix=./rsr-template-repo-portable +just install --portable --prefix=./idris2x-portable ---- == First Run @@ -103,7 +103,7 @@ just heal * **In-app**: `just run --help` * **Guided tour**: `just tour` * **Report a problem**: `just help-me` (pre-fills diagnostic context) -* **Wiki**: https://github.com/hyperpolymath/rsr-template-repo/wiki +* **Wiki**: https://github.com/metadatastician/idris2x/wiki == Uninstall diff --git a/docs/onboarding/llm-warmup-dev.adoc b/docs/onboarding/llm-warmup-dev.adoc index 8b65d04a..2ef094ba 100644 --- a/docs/onboarding/llm-warmup-dev.adoc +++ b/docs/onboarding/llm-warmup-dev.adoc @@ -1,12 +1,12 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) -= LLM warm-up — rsr-template-repo (developer) += LLM warm-up — idris2x (developer) -Paste this into an AI assistant before changing code in rsr-template-repo. +Paste this into an AI assistant before changing code in idris2x. == Orientation -rsr-template-repo (https://github.com/hyperpolymath/rsr-template-repo): a library in idris2, zig. +idris2x (https://github.com/metadatastician/idris2x): a library in idris2, zig. The template's own code is the ABI/FFI seam that every minted repo inherits: diff --git a/docs/onboarding/llm-warmup-maintainer.adoc b/docs/onboarding/llm-warmup-maintainer.adoc index 01e2d181..d0fa2109 100644 --- a/docs/onboarding/llm-warmup-maintainer.adoc +++ b/docs/onboarding/llm-warmup-maintainer.adoc @@ -1,9 +1,9 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) -= LLM warm-up — rsr-template-repo (maintainer) += LLM warm-up — idris2x (maintainer) Paste this into an AI assistant before release, CI or governance work on -rsr-template-repo. Read `llm-warmup-dev.adoc` first; this adds what a maintainer owns. +idris2x. Read `llm-warmup-dev.adoc` first; this adds what a maintainer owns. == The provisioning set diff --git a/docs/onboarding/llm-warmup-user.adoc b/docs/onboarding/llm-warmup-user.adoc index 3a8eb3d8..19032aee 100644 --- a/docs/onboarding/llm-warmup-user.adoc +++ b/docs/onboarding/llm-warmup-user.adoc @@ -1,19 +1,19 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) -= LLM warm-up — rsr-template-repo (user) += LLM warm-up — idris2x (user) Paste this whole file into any AI assistant before asking it about -rsr-template-repo. It tells the assistant what the project is, how a person gets it +idris2x. It tells the assistant what the project is, how a person gets it running, and where to look when something goes wrong. == What it is -rsr-template-repo (https://github.com/hyperpolymath/rsr-template-repo) is a library written in idris2, zig. +idris2x (https://github.com/metadatastician/idris2x) is a library written in idris2, zig. It is not a project in its own right: it is the template every new hyperpolymath repository is created from. It ships CI/CD, machine-readable metadata (`.machine_readable/descriptiles/`), an AI gatekeeper deed -(`rsr-template-repo_chora.deed`), a typed ABI/FFI seam (Idris2 over Zig), Guix and +(`idris2x_chora.deed`), a typed ABI/FFI seam (Idris2 over Zig), Guix and mise toolchains, and governance files, all passing the RSR validators before you add a line of your own. @@ -22,7 +22,7 @@ add a line of your own. The supported routes, in order of ease: . *Ask an AI*: follow `docs/AI_INSTALLATION_GUIDE.adoc` in the repository. -. *The launcher*: `git clone https://github.com/hyperpolymath/rsr-template-repo.git && cd rsr-template-repo && ./launcher.sh --setup` +. *The launcher*: `git clone https://github.com/metadatastician/idris2x.git && cd idris2x && ./launcher.sh --setup` . *By hand*: `docs/SETUP.adoc`, every step explained. Prerequisites are git, a C toolchain and mise; everything else is installed by diff --git a/docs/practice/AI-CONVENTIONS.adoc b/docs/practice/AI-CONVENTIONS.adoc index 7c9a4869..decb37a3 100644 --- a/docs/practice/AI-CONVENTIONS.adoc +++ b/docs/practice/AI-CONVENTIONS.adoc @@ -2,7 +2,7 @@ // Copyright (c) Jonathan D.A. Jewell = AI Conventions // SPDX-License-Identifier: CC-BY-SA-4.0 -// Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +// Copyright (c) 2026 Jonathan D.A. Jewell (metadatastician) == AI Conventions (Authoritative Source) @@ -38,9 +38,9 @@ Per estate policy (hyperpolymath/standards `LICENCE-POLICY.adoc` Rule 1 + Addend === Author Attribution -- Name: **{{AUTHOR}}** -- Email: **{{AUTHOR_EMAIL}}** -- Copyright: `Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}>` +- Name: **Jonathan D.A. Jewell** +- Email: **j.d.a.jewell@open.ac.uk** +- Copyright: `Copyright (c) 2026 Jonathan D.A. Jewell (metadatastician) ` === State Files diff --git a/docs/practice/STATE-VISUALIZER-GUIDE.adoc b/docs/practice/STATE-VISUALIZER-GUIDE.adoc index dc9a561d..761400d7 100644 --- a/docs/practice/STATE-VISUALIZER-GUIDE.adoc +++ b/docs/practice/STATE-VISUALIZER-GUIDE.adoc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell = TOPOLOGY.md — Generation Guide -{{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Jonathan D.A. Jewell (metadatastician) :toc: :sectnums: @@ -62,7 +62,7 @@ The file must contain exactly three sections: Add a header comment with SPDX-License-Identifier and Last updated date. End with an "Update Protocol" section explaining how to maintain the file. -Use the template at TOPOLOGY.md in rsr-template-repo as a structural reference, +Use the template at TOPOLOGY.md in idris2x as a structural reference, but make the content completely specific to THIS project. ---- @@ -70,7 +70,7 @@ but make the content completely specific to THIS project. [source,bash] ---- -cp /path/to/rsr-template-repo/TOPOLOGY.md ./TOPOLOGY.md +cp /path/to/idris2x/TOPOLOGY.md ./TOPOLOGY.md # Then edit: replace placeholders, draw the real architecture, fill the dashboard ---- @@ -154,4 +154,4 @@ _structured data_ for tooling. Both should agree. == Copyright -Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright (c) 2026 Jonathan D.A. Jewell (metadatastician) diff --git a/docs/practice/ci-cost-reduction.adoc b/docs/practice/ci-cost-reduction.adoc index 705c637a..022e5b16 100644 --- a/docs/practice/ci-cost-reduction.adoc +++ b/docs/practice/ci-cost-reduction.adoc @@ -214,8 +214,8 @@ Recommendations: === 7. Reusable workflow (longer-term) Ship the above patterns in a single reusable workflow under -`rsr-template-repo/.github/workflows/rsr-ci-defaults.yml`, and adopt -it estate-wide via `uses: hyperpolymath/rsr-template-repo/.github/workflows/rsr-ci-defaults.yml@main` +`idris2x/.github/workflows/rsr-ci-defaults.yml`, and adopt +it estate-wide via `uses: metadatastician/idris2x/.github/workflows/rsr-ci-defaults.yml@main` in downstream repos. Single PR propagates improvements. === 8. Self-hosted runner for heavy work (long-term) @@ -274,5 +274,5 @@ frequency × job count). incident that motivated this spec. * `007-lang/audits/audit-dependabot-automation-gap-2026-04-17.md` — separate defect stack also addressed in the same session. -* `rsr-template-repo/.github/workflows/dependabot-automerge.yml` — +* `idris2x/.github/workflows/dependabot-automerge.yml` — canonical pattern for auto-merge pattern referenced above. diff --git a/docs/reports/audit/pillar-audit-2026-04-15.adoc b/docs/reports/audit/pillar-audit-2026-04-15.adoc index d94b391e..26bdcc71 100644 --- a/docs/reports/audit/pillar-audit-2026-04-15.adoc +++ b/docs/reports/audit/pillar-audit-2026-04-15.adoc @@ -6,7 +6,7 @@ NOTE: Superseded in part (2026-10-06, rsr-template-repo#209): the `.a2ml` files named below no longer exist; their facts are clauses of the repo deed (`*_chora.deed`). Date: 2026-04-15 + -Repository: `/var/mnt/eclipse/repos/rsr-template-repo` +Repository: `/var/mnt/eclipse/repos/idris2x` == Audit Criteria diff --git a/docs/runbooks/E-CAPSULE-INVALID.adoc b/docs/runbooks/E-CAPSULE-INVALID.adoc new file mode 100644 index 00000000..209e161b --- /dev/null +++ b/docs/runbooks/E-CAPSULE-INVALID.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-CAPSULE-INVALID +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `21` +| Meaning | capsule archive is malformed or contains unsafe paths/links +| Fix | `report the digest; never unpack by hand` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-CHANNEL-EXPIRED.adoc b/docs/runbooks/E-CHANNEL-EXPIRED.adoc new file mode 100644 index 00000000..1c165e6f --- /dev/null +++ b/docs/runbooks/E-CHANNEL-EXPIRED.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-CHANNEL-EXPIRED +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `23` +| Meaning | channel manifest past its expires timestamp (freeze protection) +| Fix | `fetch a fresh manifest; IDRIS2X_ALLOW_EXPIRED=1 only when you know why` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-CHANNEL-ROLLBACK.adoc b/docs/runbooks/E-CHANNEL-ROLLBACK.adoc new file mode 100644 index 00000000..68b25830 --- /dev/null +++ b/docs/runbooks/E-CHANNEL-ROLLBACK.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-CHANNEL-ROLLBACK +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `22` +| Meaning | channel_version went backwards relative to the lock (rollback/freeze attack or stale mirror) +| Fix | `investigate; do not override` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-CHANNEL-SCHEMA.adoc b/docs/runbooks/E-CHANNEL-SCHEMA.adoc new file mode 100644 index 00000000..638bdbbb --- /dev/null +++ b/docs/runbooks/E-CHANNEL-SCHEMA.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-CHANNEL-SCHEMA +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `18` +| Meaning | channel or lock schema newer than this launcher +| Fix | `update idris2x` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-GLIBC-FLOOR.adoc b/docs/runbooks/E-GLIBC-FLOOR.adoc new file mode 100644 index 00000000..73129292 --- /dev/null +++ b/docs/runbooks/E-GLIBC-FLOOR.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-GLIBC-FLOOR +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `16` +| Meaning | host glibc older than the capsule's min_glibc +| Fix | `upgrade the host or use a musl/static capsule when available` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-HASH-MISMATCH.adoc b/docs/runbooks/E-HASH-MISMATCH.adoc new file mode 100644 index 00000000..93348a16 --- /dev/null +++ b/docs/runbooks/E-HASH-MISMATCH.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-HASH-MISMATCH +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `11` +| Meaning | downloaded bytes or unpacked tree do not match the pinned digest +| Fix | `idris2x gc && idris2x install --locked` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-INTERNAL.adoc b/docs/runbooks/E-INTERNAL.adoc new file mode 100644 index 00000000..7734d42c --- /dev/null +++ b/docs/runbooks/E-INTERNAL.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-INTERNAL +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `70` +| Meaning | launcher bug +| Fix | `file an issue with idris2x doctor --json` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-LOCK-TIMEOUT.adoc b/docs/runbooks/E-LOCK-TIMEOUT.adoc new file mode 100644 index 00000000..f3ed1a00 --- /dev/null +++ b/docs/runbooks/E-LOCK-TIMEOUT.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-LOCK-TIMEOUT +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `15` +| Meaning | another install of the same capsule held the lock too long +| Fix | `wait, or remove the stale lock file named in the message` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-NETWORK.adoc b/docs/runbooks/E-NETWORK.adoc new file mode 100644 index 00000000..77d1c359 --- /dev/null +++ b/docs/runbooks/E-NETWORK.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-NETWORK +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `14` +| Meaning | all mirrors failed +| Fix | `retry; check proxy; IDRIS2X_OFFLINE=1 with a prefetched bundle` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-OFFLINE.adoc b/docs/runbooks/E-OFFLINE.adoc new file mode 100644 index 00000000..a4bafc71 --- /dev/null +++ b/docs/runbooks/E-OFFLINE.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-OFFLINE +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `20` +| Meaning | cache miss while IDRIS2X_OFFLINE=1 +| Fix | `idris2x fetch -o bundle on a connected host, then idris2x install --from bundle` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-PIN-DRIFT.adoc b/docs/runbooks/E-PIN-DRIFT.adoc new file mode 100644 index 00000000..5411ef1b --- /dev/null +++ b/docs/runbooks/E-PIN-DRIFT.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-PIN-DRIFT +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `19` +| Meaning | idris2x.toml and idris2x.lock disagree +| Fix | `idris2x pin ` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-PIN-NOT-FOUND.adoc b/docs/runbooks/E-PIN-NOT-FOUND.adoc new file mode 100644 index 00000000..e0af31d1 --- /dev/null +++ b/docs/runbooks/E-PIN-NOT-FOUND.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-PIN-NOT-FOUND +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `10` +| Meaning | no lock, or lock/channel has no capsule for this version+target +| Fix | `idris2x pin ` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-PLATFORM-UNSUPPORTED.adoc b/docs/runbooks/E-PLATFORM-UNSUPPORTED.adoc new file mode 100644 index 00000000..8d91ec1a --- /dev/null +++ b/docs/runbooks/E-PLATFORM-UNSUPPORTED.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-PLATFORM-UNSUPPORTED +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `13` +| Meaning | no capsule exists for this OS/arch +| Fix | `see supported targets; consider --from-source (Tier 3)` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-PROBE-CODEGEN.adoc b/docs/runbooks/E-PROBE-CODEGEN.adoc new file mode 100644 index 00000000..75206cd1 --- /dev/null +++ b/docs/runbooks/E-PROBE-CODEGEN.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-PROBE-CODEGEN +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `17` +| Meaning | capsule unpacked and verified but a canary failed on this host +| Fix | `runbook triage; idris2x doctor --json` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-SIG-INVALID.adoc b/docs/runbooks/E-SIG-INVALID.adoc new file mode 100644 index 00000000..21fc7b28 --- /dev/null +++ b/docs/runbooks/E-SIG-INVALID.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-SIG-INVALID +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `12` +| Meaning | channel manifest signature or key id does not verify +| Fix | `do not override; investigate the mirror (runbook)` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-STORE-IO.adoc b/docs/runbooks/E-STORE-IO.adoc new file mode 100644 index 00000000..04786717 --- /dev/null +++ b/docs/runbooks/E-STORE-IO.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-STORE-IO +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `24` +| Meaning | store not writable, disk full, or atomic rename failed +| Fix | `free space / fix permissions; idris2x gc` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/runbooks/E-USAGE.adoc b/docs/runbooks/E-USAGE.adoc new file mode 100644 index 00000000..77621e37 --- /dev/null +++ b/docs/runbooks/E-USAGE.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED from src/errors/errors.toml by scripts/gen-runbooks.sh — edit the TOML, not this block += E-USAGE +:toc: macro + +[cols="1,4"] +|=== +| Exit code | `2` +| Meaning | bad command line +| Fix | `idris2x --help` +| Invariant | I3 loud by default +|=== + +// END GENERATED — hand-written triage notes below survive regeneration + +== Triage + +. Reproduce with `idris2x doctor --json` and attach the output. +. Classify: data fix (channel patch), engine fix (launcher), or upstream outage. +. If a channel patch resolves it, open a Class A/B PR; the rehearsal pipeline must be green on 3 targets. diff --git a/docs/status/BEST-PRACTICES.adoc b/docs/status/BEST-PRACTICES.adoc new file mode 100644 index 00000000..ba736de8 --- /dev/null +++ b/docs/status/BEST-PRACTICES.adoc @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += Best-practice comparison +:toc: macro + +How idris2x measures against named industry frameworks, as of 2026-11-16. *Present* means the file or mechanism exists in +this repository today. *Planned* means designed in an ADR but not built. *Gap* means neither. Nothing here is a +certification: badges and scores are earned by external tools, not by this table. + +toc::[] + +== Repository and community health (GitHub community standards, CHAOSS basics) + +[cols="3,1,4",options="header"] +|=== +| Practice | Status | Where +| README with purpose, status and audience routing | Present | `README.adoc` +| Licence detectable by the forge; REUSE-style per-file SPDX | Present | `LICENSE`, `LICENSES/`, SPDX headers +| Contributing guide, code of conduct, support policy | Present | `CONTRIBUTING.adoc`, `CODE_OF_CONDUCT.adoc`, `SUPPORT.adoc` +| Security policy with private reporting | Present | `.github/SECURITY.md`, issue chooser links to security advisories +| Issue forms that collect exactly what triage needs | Present | `.github/ISSUE_TEMPLATE/` (error report generated from the taxonomy; capsule, canary, DX feedback) +| PR template with project-specific checks | Present | `.github/pull_request_template.md` (risk class, channel rules, transcripts) +| CODEOWNERS, labels, triage automation | Present | `.github/CODEOWNERS`, `.github/labels-idris2x.toml`, estate label set +| Governance and maintainer handoff | Present | `docs/MAINTAINERS.adoc` (abandonment contract), `.github/GOVERNANCE.adoc` +| Discussions enabled | Gap | owner setting; the issue chooser already links to it +| Second maintainer | Gap | the single largest survivability risk (MAINTAINERS.adoc) +|=== + +== Documentation (Diátaxis) + +[cols="3,1,4",options="header"] +|=== +| Quadrant | Status | Where +| Tutorials | Present (planned surface) | Wiki: Getting started +| How-to guides | Present (planned surface) | Wiki: Install, Uninstall, CI usage, Offline, Self-hosted channel, Mirrors +| Reference | Present | Wiki: Error reference (generated), Supported platforms (generated); runbooks per error ID +| Explanation | Present | Wiki: Architecture, Theory overview, Formal model, Trust and freshness; ADRs +| Docs as code, reviewed and drift-checked | Present | `docs/wikis/` → wiki via `scripts/sync-wiki.sh`; generators run with `--check` in CI +|=== + +== Supply chain (OpenSSF Scorecard, SLSA, Best Practices badge) + +[cols="3,1,4",options="header"] +|=== +| Practice | Status | Where +| Pinned workflow dependencies, least-privilege tokens | Present | estate `actions.lock`, per-job `permissions` +| Branch protection, signed commits, linear history, immutable tags | Present (rulesets as files) | `.github/rulesets/*.json`; must be applied by the owner (Configure stage) +| Dependency update automation | Present | `.github/dependabot.yml` (cargo included) +| SAST and secret scanning | Present | `codeql.yml`, `secret-scanner.yml`, gitleaks config +| Scorecard workflow | Present | `scorecard.yml`; the score itself appears after the first runs +| OpenSSF Best Practices badge | Gap | needs a project entry at bestpractices.dev (owner) +| SLSA build provenance for capsules and launcher | Planned | ADR 0010; attestation-gated channel signing +| Immutable releases | Planned | ADR 0010; organisation setting +| SBOM per capsule | Planned | capsule factory (syft) +| Reproducible, bit-for-bit builds | Gap (stated non-goal for v1) | later phase +|=== + +== Toolchain-distribution practice (compared with rustup, uv, Zig, ghcup, mise) + +[cols="3,1,4",options="header"] +|=== +| Practice | idris2x | Best-in-class reference +| Per-artifact digest pinned in a project lockfile | Planned (prototyped) | uv, Bazel `http_archive`, Nix fixed-output derivations +| Signed metadata, *enforced* by the client | Planned (prototyped, drilled) | ghcup (GPG, strict mode); rustup signs but does not enforce +| Rollback and freeze protection | Planned (prototyped, drilled) | TUF; most toolchain managers have neither +| Mirrors untrusted by construction, ordered fallback | Planned (prototyped, drilled) | Zig community mirrors, Bazel +| Offline / air-gap path as a first-class command | Planned (prototyped, drilled) | rare; usually ad hoc +| Typed, stable error IDs with runbooks and exact fixes | Planned (taxonomy and runbooks present) | Rust compiler error index, Elm compiler messages +| Complete, checkable uninstall | Planned (documented) | uv, bun (single directory) +| Chaos drills of failure modes in CI | Prototyped (43 checks) | uncommon in this category +| Zero telemetry, documented network surface | Designed | uv (opt-in), Zig +|=== + +== What would move the most gaps + +. Apply the rulesets and enable Discussions and immutable releases (owner settings, minutes). +. Register at bestpractices.dev. +. Ship the Rust launcher with the chaos suite as its CI gate (Phase 1). +. Recruit a second maintainer with their own signing key. diff --git a/docs/status/BEYOND-REPO.adoc b/docs/status/BEYOND-REPO.adoc new file mode 100644 index 00000000..63310911 --- /dev/null +++ b/docs/status/BEYOND-REPO.adoc @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += Beyond this repository: items to track or act on elsewhere +:toc: macro + +Collected from the Phase 0 audit (five fact-checking passes, primary sources cited in the audit record) and the spike. Each line names where it lives. + +== Estate canon (`metadatastician/standards`) + +* LANGUAGE-POLICY §3 bans Go and Python; this project complied by choosing Rust and bash. Decide whether a toolchain-launcher archetype (`rust-launcher`?) belongs in the template if the shape recurs. +* No toolchain-pinning policy exists for Idris 2 / pack; PROVISIONING-STANDARD §4 notes Guix lacks idris2 and mise cannot provide it; `echidna-verify.yml` installs pack unpinned from main. Propose: PROOF-POLICY §6 recognises sha256-pinned, signed capsules (idris2x) as a sanctioned route. +* KNOWN-TENSIONS: Interface & Architecture Law ("ABI → Idris 2, always") versus capability-gated template applicability; record it. +* Licence canon: add guidance for redistributing third-party binaries (Apache-2.0 NOTICE propagation, BSD-3 notice retention, `dep5` Files stanzas, `LICENSES/` texts). +* Standardise one Ed25519 wire format estate-wide (signify / minisign-legacy `Ed`, raw bytes); document key custody, rotation and a trusted-keys list embedded in launchers. +* Export-control note: a one-time 15 CFR 742.15(b) notification for open-source binaries containing TLS is a cross-estate policy question (not legal advice). + +== RSR template (`hyperpolymath/rsr-template-repo`) + +* `proven-tests.yml` never installs Idris 2; `run-proven-suite.sh` degrades to Static-Checked; `check-proofs.sh` is unwired; 5 of 6 Idris 2 proofs quarantined. idris2x is the obvious fix once it exists. +* `oracle-segfault-diag.yml` ("TEMPORARY DIAGNOSTIC … must never reach main") is on main @2be7b88; remove before minting children. +* `mise.toml` references `launch-scaffolder provision-set realign` (hyperpolymath/launch-scaffolder) as the re-minter of `mise.toml`/`launcher.sh`; track it for the launcher standard. +* Local `standards` clone used by the audit (d036da33) is behind main (e518e0c9); re-verify canon citations against main before relying on them. +* GitHub Pages / CodeQL / Scorecard SARIF need Pages enabled and a Code Security licence on private repos; SCAFFOLD-LIFECYCLE defaults new repos to private — decide visibility before the first push (public is also what unlocks free arm64 Linux and macOS runners). + +== Upstream: Idris 2 + +* Bug: Chez backend mis-quotes non-ASCII project paths (`Chez.idr:536-537` uses Idris `show`); repro in UPSTREAM-NOTES.adoc. Check the tracker, then file. +* Docs: INSTALL.md still demands `--threads` and points Apple Silicon at the Racket fork; `envvars.rst` lists `IDRIS2_PREFIX` as build-time only although runtime honours it. +* `/usr/bin/env scheme --program` fallback cannot work on Linux (single-argument shebang); long-path shebang truncation (128/256 bytes). +* Search-path precedence (`IDRIS2_DATA`, `IDRIS2_LIBS`, `IDRIS2_PACKAGE_PATH`, `IDRIS2_INC_SRC`) means any env-injected directory is code execution; worth an upstream security note. +* Upstream `ci-bootstrap.yml` still pins the retired `ubuntu-20.04` runner; AArch64 Linux needs Chez ≥ 10 (undocumented); Windows wrappers embed the Chez path in `idris2.cmd`. +* Source provenance: idris-lang.org publishes `idris2-0.8.0.tgz` + `.sha256` (`940a283c…`); pin by tag commit `15a3e4e7…` as well. + +== Upstream: Chez Scheme + +* Release cadence roughly yearly (10.0.0 2024-02, 10.2.0 2025-05, 10.4.0/10.4.1 2026-05); only Windows gets binaries; tarball sha256 for 10.4.1 is `2e74952d…ef308`. +* Executable basename determines the boot file name; renaming the kernel requires shipping `.boot`. +* Linux kernel links `libtinfo` unless `--disable-curses` (measured: `--disable-curses --disable-x11` leaves only libm/libc). +* Windows capsule obligations: `vcruntime140.dll` (MSVC builds) and optional win-iconv; macOS binaries need ad-hoc or Developer ID signing for Gatekeeper. +* Distro drift: Ubuntu noble 9.5.8, jammy 9.5.4; Homebrew 10.4.1 with the executable named `chez`. + +== GitHub / infrastructure + +* Runner lifecycle: macos-13 retired 2025-12-04, macos-14 retired 2026-11-02; Intel macOS (`macos-15-intel`, `macos-26-intel`) sunsetting ~2027 — plan the `x86_64-apple-darwin` fallback (cross boot files via `make bootquick XM=ta6osx`, or demote the target). +* Enable *immutable releases* at the organisation level for every estate repo publishing binaries; adopt draft → attach → publish. +* Release asset redirects are five-minute signed URLs; AUP §9 allows throttling: share one download/resume helper estate-wide that always re-requests the stable URL. +* Cloudflare R2: custom domain required for public buckets (never `r2.dev`), `Range` may be answered with a full 200 at the edge, 512 MB Free-plan cache ceiling, domain renewal/registrar lock as an abandonment risk. +* Sigstore trusted-root rotation ("a few times a year") and Rekor SLO are upstream dependencies if any launcher embeds a Sigstore root; prefer attestation-gated signing in the factory. +* Apple: Sequoia removed the Control-click Gatekeeper override; decide estate-wide whether CLI launchers get Developer ID + notarization. +* Windows: short store roots and `longPathAware` manifests across estate launchers (MAX_PATH 260 without opt-in); avoid symlinks in Windows capsules. +* Archival: Software Heritage scope for binary assets is unverified (site bot-protected during the audit); set up Internet Archive items + IPFS pinning as a shared estate service. + +== Distribution ecosystem (from the prior-art audit) + +* Watch idris-lang/Idris2 PR #3857 (installers), issue #3295 (CHEZ shebang validation, open) and #3778 (macOS `DYLD_*` stripping in the `/bin/sh` launcher); upstream fixes shrink our surface. +* Publish idris2x (the launcher) through the mise/aqua registry as well, so estate repos get an independently governed hash and mise's verification for free; no Idris 2 entry exists in the registry today. +* Homebrew `chezscheme` bottles (7 platforms, relocatable) are a workable Tier-2 Chez source; needs the ghcr anonymous-token flow and the Linux ncurses caveat. +* Adopt the Zig community-mirrors protocol and the python-build-standalone pattern (SHA256SUMS + release attestations) as estate conventions for any binary distribution. +* Third-party images worth monitoring as CI fallbacks: `mattpolzin2/idris-docker`, `ghcr.io/joshuanianji/idris-2-docker`, `ghcr.io/stefan-hoeck/idris2-pack`. +* Distro Chez is too old or too varied to rely on (Ubuntu 24.04 9.5.8, Debian trixie 10.0.0, Alpine 10.3.0); no distro except Fedora ships idris2 at all. + +== Toolchains and languages + +* Go: `internal/zstd` (decoder-only, BSD) exists since Go 1.21; a public `compress/zstd` would change ADR 0007's arithmetic. Moot while Go is banned, but relevant to the canon's own Go-rewrite roadmap. +* Zig: std API churn measured between 0.14 → 0.17 (`posix.execveZ`/`flock` removed, zstd/ZON/Io renamed); any Zig launcher must vendor its toolchain tarball. +* Rust: `zstd` crate links C (`ruzstd` pure, 1.4–3.5x slower); macOS/Windows cross-builds from Linux need extra toolchains; RUSTSEC tracking across the vendored tree. diff --git a/docs/status/ESTATE-INTEGRATION.adoc b/docs/status/ESTATE-INTEGRATION.adoc new file mode 100644 index 00000000..65282e6d --- /dev/null +++ b/docs/status/ESTATE-INTEGRATION.adoc @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += Estate integration (plan §15, corrected by the Phase 0 estate audit) +:toc: macro + +== Where Idris 2 comes from today + +* The RSR template's `mise.toml` says Idris 2 "is not a mise tool: it comes from pack"; `build/just/provision-lib.sh` remedies a missing + compiler with `pack install-app idris2` (unpinned source build) and lists OS packages `chezscheme libgmp-dev` (Ubuntu noble ships Chez 9.5.8, + which cannot target arm64). `doctor` only warns when pack is missing. +* The template's proof lane (`proven-tests.yml` → `run-proven-suite.sh`) never installs or executes Idris 2; it degrades to "Static-Checked". + Five of the six shipped Idris 2 proof modules are quarantined as never having compiled. +* `PROOF-POLICY.adoc` §6: proof toolchains used in CI come from the repo's Guix manifest or container, otherwise a recorded *deviation* naming + the tool, its asserted version and a digest of what was installed; the run must assert the version and fail on mismatch. +* The proof census lives in `hyperpolymath/mathesis`; it catalogues receipts and derives grades, it never assigns them. + +== What idris2x plugs into + +[cols="1,3",options="header"] +|=== +| Seam | Change +| `provision-lib.sh` (`lang_remedy`/`lang_run idris2`) | remedy becomes `idris2x install --locked`; run becomes `idris2x exec --locked -- idris2 …`; doctor delegates to `idris2x doctor --json` +| `mise.toml` comment | "Idris 2 comes from idris2x (pinned, sha256-verified capsule); see idris2x.toml" +| Proof lane | `idris2x verify` + `idris2x exec --locked -- idris2 --check …`; the lock's digest and `idris2x --version` are the §6 version-and-digest assertion +| PROOF-POLICY §6 | file a canon change request to list "idris2x lock (sha256-pinned capsule, signed channel)" as a sanctioned installation route; until then each repo records the deviation (template below) +| mathesis census | idris2x's own properties become receipts: the Idris 2 ABI contract for `idris2x.lock`/`capsule.json` (total decoders), the error-taxonomy completeness check (every ID in `src/errors/errors.toml` has a runbook and an exit code), the store state machine model +| Multi-version testing | `idris2x -p idris2@0.7.0 -- …` and `idris2x -p idris2@0.8.0 -- …` side by side, since the store is content-addressed (Phase 1 flag) +|=== + +== §6 deviation template (until the canon lists idris2x) + +---- +deviation: + tool: idris2 (+ chez-scheme), installed by idris2x from capsule sha256: + asserted: idris2 0.8.0, chez 10.4.1 # from idris2x.lock [toolchain] + check: idris2x verify && idris2x exec --locked -- idris2 --version # fails the run on mismatch + why: Guix has no idris2 package; mise cannot provide it; pack builds unpinned from source +---- + +== Relationship to pack + +pack is the Idris 2 *package* manager and also builds compilers from source per collection. idris2x does not replace it: it supplies the +pinned, verified compiler+runtime that pack (or plain `idris2 --build`) runs on. The prior-art audit (pending) records whether pack can be +pointed at an existing compiler without rebuilding one. diff --git a/docs/status/PHASE0-REPORT.adoc b/docs/status/PHASE0-REPORT.adoc new file mode 100644 index 00000000..48a6752d --- /dev/null +++ b/docs/status/PHASE0-REPORT.adoc @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += Phase 0 report: assumptions tested on a fresh Linux x86_64 host (2026-11-09) +:toc: macro + +Host: Ubuntu 24.04.5, glibc 2.39, 4 vCPU, 15 GB RAM, no Chez/Idris 2/Go deps preinstalled beyond gcc, make, Go 1.24.7. +Everything below was executed, not estimated. Scripts: `scripts/proto/` (prototype launcher, factory, chaos drills), `tests/canaries/`. + +toc::[] + +== Verdicts on the plan's load-bearing assumptions + +[cols="3,1,4",options="header"] +|=== +| Plan assumption | Verdict | What is true (source) +| Idris 2 "0.8.1" is the current release | Refuted | Newest tag is v0.8.0 (2025-10-31). No binary assets upstream; capsules must be built from source. +| Pair Idris 2 with Chez 9.6.4 | Refuted | 9.6.4 exists but has no arm64 boot files and refuses Apple Silicon; Idris 2 needs threaded Chez and >= 10.0 on AArch64. Pin 10.4.1 (ADR 0004). +| Reuse upstream Chez release binaries | Refuted (Linux/macOS) | Upstream publishes only a Windows installer plus the source tarball. Build from tarball: 2 min 44 s on 4 cores, 6 MB installed. +| Relocation needs `CHEZSCHEMELIBDIRS` | Refuted | That variable only affects R6RS library import paths. Boot files use `SCHEMEHEAPDIRS`; Chez 10's compiled-in default is executable-relative, so a copied tree works with *no* variables. +| Idris 2 is relocatable via `IDRIS2_PREFIX` | Confirmed | Prefix baked in `src/IdrisPaths.idr`, overridden at runtime (`src/Idris/Driver.idr`). 11/12 canaries pass on a tree copied into a path with spaces. +| The `idris2` wrapper is relocatable | Partially | `bin/idris2` is sh; `bin/idris2_app/idris2.so` carries `#! --program`. Solved by direct exec (ADR 0005). +| glibc 2.28 floor | Partially | A build on ubuntu-24.04 needs `GLIBC_2.38`; the floor requires building inside manylinux_2_28 containers (ADR 0006). +| Go stdlib only + zstd + blake3 + TOML + minisign | Contradictory | Go 1.24 stdlib has no zstd, no blake2b/blake3, no TOML; minisign's default pre-hash is BLAKE2b. Resolved in ADR 0007/0008 (gzip or vendored decoder; sha256; signify-format Ed25519; JSON or TOML-subset lock). +| Bundle size 40–120 MB compressed | Confirmed (low end) | Linux x86_64 capsule: 137 MB unpacked; 35.4 MB gzip -9, 28.3 MB zstd -19, 19.5 MB xz -9 (before pruning ~30 MB of bootstrap `.ss`/`-boot.so` files). +| Warm path < 20 ms | Confirmed | Go skeleton: 1.7 ms no-op, 2.8 ms with lock parse + flock + execve (200-run loops). Bash prototype: ~40 ms. +| Launcher written in Go, repo scaffolded from rsr-template-repo | Refuted (Go) / Confirmed (template) | Estate LANGUAGE-POLICY §3 bans Go and Python for new work and the template's CI gates enforce it; `rust-cli` is the only CLI archetype; mint = `just repo-init rust-cli` (ADR 0011). +| Nothing already provides hermetic Idris 2 + Chez pairs | Confirmed | pack builds from source with BYO Chez; Homebrew bakes paths; no asdf/mise plugin, no setup action, no upstream binaries (PRIOR-ART.adoc). +| 12 canaries are implementable in ~10 lines each | Confirmed | All 12 written and run; `unicode_paths` fails because of an upstream Idris 2 bug (see UPSTREAM-NOTES.adoc), kept as expected-fail for 0.8.0. +|=== + +== Measured numbers + +[cols="3,2",options="header"] +|=== +| Measurement | Value +| Chez 10.4.1 configure + make -j4 + install | 164 s +| Idris 2 v0.8.0 `make bootstrap` (Chez) | 604 s; `make install` 6 s +| Installed Idris 2 tree | 127 MB (bin 40 MB incl. 30 MB of removable bootstrap artifacts; libs 87 MB) +| Installed Chez tree | 6.0 MB (bin symlinks → lib/csv10.4.1/ta6le) +| Merged capsule tar | 136,980,480 bytes +| gzip -9 / zstd -19 / xz -9 | 35,374,302 / 28,341,143 / 19,480,036 bytes +| Unpack wall time, best of 3 (gzip / zstd / xz) | 674 ms / 196 ms / 1,425 ms +| Cold `install --locked` from a local HTTP mirror (download, sha256, unpack, sha256sums -c, probes) | 3.3 s +| Warm `install --locked` no-op (bash prototype) | 40 ms +| Go launcher skeleton (audit): static binary / warm overhead | 5.98 MB linux-amd64 (5.6–6.2 MB over 5 targets) / 1.7–2.8 ms +| GLIBC symbol floor of a native ubuntu-24.04 Chez build | 2.38 (libm, libc, libtinfo only) +| Chez built with `--disable-curses --disable-x11` | 181 s; runtime deps reduced to libm + libc (no libtinfo); `(threaded?)` = #t by default +|=== + +== Chaos drills (prototype launcher, full capsule) + +Prototype launcher against the full Linux x86_64 capsule served by a local Range-capable fixture server (Node); 43 checks, 0 failures (final run, 2026-11-16). + +[cols="2,4,1,1,2",options="header"] +|=== +| Drill | Check | Exit | ms | Error ID +| T1 | pin 0.8.0 | 0 | 84 | +| | install --locked (cold) | 0 | 4358 | +| | store/.complete present | | | +| | no staging leftovers in tmp | | | +| | install --locked (warm, no-op) | 0 | 32 | +| | run -- chez evaluates 42 | | | +| | verify (sha256sums + probes) | 0 | 691 | +| | doctor | 0 | 709 | +| | env --json | 0 | 39 | +| T2 | 404 primary -> mirror succeeds | 0 | 4423 | +| T3 | flipped byte -> E-HASH-MISMATCH | 11 | 169 | `E-HASH-MISMATCH` +| | store absent after mismatch | | | +| | no .part left behind | | | +| T4 | truncated -> E-HASH-MISMATCH | 11 | 108 | `E-HASH-MISMATCH` +| | resume from partial .part | 0 | 3907 | +| | server answered the resume with 206 (Range) | | | +| T5 | all 4 concurrent installs exit 0 (4/4) | | | +| | exactly one store dir | | | +| | no stage leftovers | | | +| T6 | write limit -> typed E- error | 14 | 51 | `E-NETWORK` +| | store has no half-capsule | | | +| T7 | tampered manifest -> E-SIG-INVALID | 12 | 43 | `E-SIG-INVALID` +| | wrong pinned key -> E-SIG-INVALID | 12 | 35 | `E-SIG-INVALID` +| | channel rollback -> E-CHANNEL-ROLLBACK exit=22 64ms E-CHANNEL-ROLLBACK | | | +| | expired manifest -> E-CHANNEL-EXPIRED exit=23 67ms E-CHANNEL-EXPIRED | | | +| | expired + explicit override -> ok | 0 | 74 | +| T8 | offline cache miss -> E-OFFLINE | 20 | 34 | `E-OFFLINE` +| T9 | fetch -o bundle | 0 | 229 | +| | install --from bundle (offline) | 0 | 4450 | +| | bundle kept after --from | | | +| T10 | lock held -> E-LOCK-TIMEOUT | 15 | 1038 | `E-LOCK-TIMEOUT` +| T11 | '../' member -> E-CAPSULE-INVALID | 21 | 52 | `E-CAPSULE-INVALID` +| | nothing escaped the staging dir | | | +| T12 | install into path with spaces | 0 | 4436 | +| | chez runs from spaced path | | | +| | lock lacks host target -> E-PIN-NOT-FOUND exit=10 23ms E-PIN-NOT-FOUND | | | +| T13 | gc removes incomplete dirs | 0 | 16 | +| | incomplete dir gone, complete kept | | | +| T14 | exec -- idris2 --version | 0 | 549 | +| | selftest (chez_codegen, relocatable_artifact, refc) exit=0 2081ms | | | +| T15 | exec works from spaced store | 0 | 537 | +| | selftest: compiled program breaks (shebang) -> E-PROBE-CODEGEN with fix hint exit=17 951ms E-PROBE-CODEGEN | | | +| | diagnosis names the shebang/space cause | | | +|=== + +== Canary results on the relocated store copy + +Capsule root: `~/.cache/idris2x/store/sha256-0dc9ae68…/` (installed by the prototype from a local mirror, run via direct exec). + +[cols="2,1,4",options="header"] +|=== +| Canary | Result | Note +| pure_eval | pass | Chez boots from relocated boot files, prints 42 +| chez_codegen | pass | compile + run 0.8 s +| refc_codegen | pass | `--cg refc` with host cc + gmp +| c_ffi_support | pass | `System.getPID` through libidris2_support +| ipkg_multi_module | pass | `--build canary.ipkg`, two modules +| relocatable_artifact | pass | compiled program moved to a dir with spaces, run under `env -i` +| prelude_base | pass | Data.List / Data.String / Data.Vect +| concurrent_build | pass | two parallel compilations +| unicode_paths | *expected fail* | upstream Idris 2 bug: Chez backend mis-quotes non-ASCII paths (UPSTREAM-NOTES.adoc) +| large_module | pass | 400 generated definitions, compile + run 1.5 s +| chez_threads | pass | `(threaded?)` #t, fork-thread / thread-join +| version_match | pass | `Idris 2, version 0.8.0` +|=== + +Runner: `tests/canaries/run.sh [--quick]`. A runner bug found on the way: Idris 2 refuses source files outside the working directory, so canaries are copied into a scratch directory first. + +== What Phase 0 changed in the plan + +. Pin `idris2@0.8.0` + `chez 10.4.1`; build both from pinned sources in CI (no upstream binaries exist). +. The launcher execs the capsule's Chez directly with an explicit environment contract; wrappers and shebangs are not trusted. +. Linux capsules come out of manylinux_2_28 containers; `min_glibc` is measured and recorded, and the launcher maps the dynamic-loader failure to `E-GLIBC-FLOOR`. +. Channel signatures are signify-format pure Ed25519; the manifest carries `expires`; both rollback and freeze are typed failures; execution never needs the manifest. +. Five error IDs added. Taxonomy and target matrix are TOML data with generators. +. One upstream bug report prepared (non-ASCII project paths, Chez backend). +. Language changed from Go to Rust to comply with the estate canon; generators rewritten without Python. diff --git a/docs/status/PRIOR-ART.adoc b/docs/status/PRIOR-ART.adoc new file mode 100644 index 00000000..38ad79c4 --- /dev/null +++ b/docs/status/PRIOR-ART.adoc @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += Prior art: does anything already do this, and what to borrow +:toc: macro + +From the Phase 0 prior-art audit (primary sources: upstream repos, package indexes, download manifests; 27 findings). + +== Idris 2 distribution today + +[cols="2,4",options="header"] +|=== +| Route | What it actually does +| `pack` (stefan-hoeck/idris2-pack) | Builds the compiler *from source* per collection with a bring-your-own system Chez (or Racket); collections are TOML files pinning git commits (unsigned, no Chez version); nightlies rebuilt ~1 am UTC; no Windows story +| Homebrew `idris2` | Prebuilt bottle depending on Homebrew `chezscheme` 10.4.1; bakes the Homebrew Chez path in — fine for brew users, not relocatable +| Distros | Debian/Ubuntu package Chez (9.5.4 … 10.4.1 depending on release) but not Idris 2; Fedora packages both; Arch only via AUR; nixpkgs has both (Chez 10.4.1) and wraps idris2 with `CHEZ` +| asdf / mise | No Idris 2 plugin exists; the mise `chezscheme` entry is a vfox plugin that compiles from source +| GitHub Actions | No `setup-idris2`; upstream publishes no nightly or release binaries (CI artifacts only) +| Docker | Active images: `mattpolzin2/idris-docker` (nightly), `ghcr.io/joshuanianji/idris-2-docker` (multi-arch, v0.6–v0.8), `ghcr.io/stefan-hoeck/idris2-pack` +| Upstream | PR #3857 (installers, open, unreviewed) confirms the direction: installed Idris 2 always uses `IDRIS2_PREFIX`, still needs system Chez, and recompiles if the Chez version differs — i.e. the Chez+Idris2 pair must be pinned together, which is the capsule +|=== + +Verdict: nothing provides hermetic, immutable, offline-cacheable Idris 2 + Chez pairs. The gap is real. + +== Prebuilt Chez anywhere? + +Only Homebrew bottles (7 platforms, `cellar :any_skip_relocation`, fetched via ghcr with an anonymous token) are a viable Tier-2/mirror source for *Chez only*. conda-forge has no package; Racket's bundled Chez is not standalone; cisco ships Windows installers only. + +== Conventions to borrow + +[cols="1,3",options="header"] +|=== +| Project | Borrow +| Zig | `download/index.json` with sha256 + size per tarball; per-tarball minisign; community-mirror protocol (mirror list, origin last); note the index itself is unsigned +| uv / python-build-standalone | sha256 table baked into the launcher release; `SHA256SUMS` + GitHub release attestations on the artifact side +| rustup | TOML channel manifests with per-target url/hash; dated archives as rollback; lesson: signatures exist but are not enforced — we enforce +| ghcup | GPG-signed metadata with sha256 per download and distro requirement lists — closest existing model to our signed channel +| mise (aqua backend) | checksum + cosign + SLSA + minisign + GitHub-attestation verification, verified lockfiles, baked registry snapshot, dated deprecation warnings +| Bazel `http_archive` / Nix fixed-output derivations | `urls[]` tried in order, sha256 mandatory, mirrors first +| elan / juliaup | *anti-patterns*: elan verifies nothing (TLS only), juliaup's version DB has no hashes; both rely on exe-relative layouts for relocation (as Chez 10 does) +|=== + +== Options scored (elegance / dependability, 1–5) + +* Build on pack as the pin layer — 3 / 2: community standard, but compiles from source on every machine with BYO Chez. +* Wrap the mise/aqua registry (publish capsules as an aqua/github recipe) — 4 / 3: inherits mise's verification and lockfiles and solves first-launcher trust for mise users (independently governed hash), but the capsules must still be built and hosted by us. Worth doing *in addition* for the estate, which already standardises on mise. +* Contribute a `setup-idris2` action on upstream nightlies — 3 / 2: there are no upstream nightlies. +* Own capsule + tiny launcher (the plan) — 4 / 4: the only route to hermetic, immutable, offline pairs. Chez 10's executable-relative boot path makes half of it free. diff --git a/docs/status/PROOF-NEEDS.adoc b/docs/status/PROOF-NEEDS.adoc index 4c92835f..85b90c5e 100644 --- a/docs/status/PROOF-NEEDS.adoc +++ b/docs/status/PROOF-NEEDS.adoc @@ -2,7 +2,7 @@ // Copyright (c) Jonathan D.A. Jewell // Template: rsr-template-repo/docs/status/PROOF-NEEDS.adoc // Authoritative master list: ~/Desktop/PROOF-REQUIREMENTS-MASTER.adoc -= Proof Requirements — {{PROJECT}} += Proof Requirements — IDRIS2X == Proof Tier diff --git a/docs/status/PROOF-STATUS.adoc b/docs/status/PROOF-STATUS.adoc index 610a130c..7eb48f9f 100644 --- a/docs/status/PROOF-STATUS.adoc +++ b/docs/status/PROOF-STATUS.adoc @@ -2,7 +2,7 @@ // Copyright (c) Jonathan D.A. Jewell // Template: rsr-template-repo/docs/status/PROOF-STATUS.adoc // The per-claim proof record. Obligations are in PROOF-NEEDS.adoc. -= Proof Status — {{PROJECT}} += Proof Status — IDRIS2X This is the repository's proof-status file in the sense of `standards/3-practice/PROOF-POLICY.adoc` §8.5: one row per claim, with its status diff --git a/docs/status/READINESS.adoc b/docs/status/READINESS.adoc index b34e6a11..af252dbc 100644 --- a/docs/status/READINESS.adoc +++ b/docs/status/READINESS.adoc @@ -1,10 +1,10 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -= {{PROJECT_NAME}} Component Readiness Assessment += idris2x Component Readiness Assessment -*Standard:* link:https://{{FORGE}}/{{OWNER}}/standards/tree/main/component-readiness-grades[Component Readiness Grades (CRG) v2.0 STRICT] + -*Assessed:* {{CURRENT_DATE}} + -*Assessor:* {{AUTHOR}} + +*Standard:* link:https://github.com/metadatastician/standards/tree/main/component-readiness-grades[Component Readiness Grades (CRG) v2.0 STRICT] + +*Assessed:* 2026-11-16 + +*Assessor:* Jonathan D.A. Jewell + *Previous assessment:* __ *Current Grade:* X @@ -59,7 +59,7 @@ Below B, any publication must be explicitly abstract or provisional. ''' -== 2. Headline Evidence (as of {{CURRENT_DATE}}) +== 2. Headline Evidence (as of 2026-11-16) [cols="2,3,3", options="header"] |=== @@ -67,7 +67,7 @@ Below B, any publication must be explicitly abstract or provisional. | Test count | __ | `docs/status/ROADMAP.adoc` or CI | Formal-verification posture | __ | grep of proof dirs -| Dangerous patterns (`assert_total`, `unsafeCoerce`, `Obj.magic`) | __ | grep {{CURRENT_DATE}} +| Dangerous patterns (`assert_total`, `unsafeCoerce`, `Obj.magic`) | __ | grep 2026-11-16 | Per-unit README coverage | __ | filesystem scan of unit dirs | CI status | __ | `.github/workflows/` | RSR mandatory workflows | __ | `.github/workflows/` @@ -87,9 +87,9 @@ unless noted. |=== | Component | Grade | Posture | Evidence Summary | Promotion blocker | Last Assessed -| __ | X/F/E/D/C/B/A | __ | __ | __ | {{CURRENT_DATE}} -| __ | … | … | … | … | {{CURRENT_DATE}} -| __ | … | … | … | … | {{CURRENT_DATE}} +| __ | X/F/E/D/C/B/A | __ | __ | __ | 2026-11-16 +| __ | … | … | … | … | 2026-11-16 +| __ | … | … | … | … | 2026-11-16 |=== *Rules of thumb for populating this table:* @@ -164,7 +164,7 @@ Real-world external feedback confirming value. Populate ''' -== 7. Summary ({{CURRENT_DATE}}) +== 7. Summary (2026-11-16) * Project grade: __. Why: _<1-2 line justification>_. * Delta since last assessment: __. @@ -177,7 +177,7 @@ Real-world external feedback confirming value. Populate * `docs/governance/CRG-CRITERIA.adoc` — grade definitions (boilerplate). * `docs/governance/CRG-AUDIT-.adoc` — formal audit (populate from - `rsr-template-repo/docs/governance/CRG-AUDIT-TEMPLATE.adoc`). + `idris2x/docs/governance/CRG-AUDIT-TEMPLATE.adoc`). * `docs/practice/DOGFOOD-LOG.adoc` — dated dogfood evidence (required for C). * `docs/status/ROADMAP.adoc` — evidence journal (sections `== Dogfooding status`, `== External targets`, `== Issues fed back`, diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index 97326374..15b5c2bf 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -1,93 +1,36 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -= rsr-template-repo Roadmap += idris2x Roadmap -The journal of the template itself: milestones, blockers and next actions. -A repo minted from the template does not inherit it: `just repo-init` -replaces this file with `build/templates/ROADMAP.adoc.in`. +== Current Status -Phase and maturity are not recorded here. They live in the repo deed, -`rsr-template-repo_chora.deed`, in the `(status …)` and `(maturity …)` -clauses (`just state-phase` prints both). - -This file took over the journal half of the retired STATE record -(rsr-template-repo#209), last -updated there on 2026-09-19. STATE also recorded version 0.3.0; the release -version is 0.1.0 (`Justfile`, `CITATION.cff`, tag `v0.1.0`, deed -`(meta :version …)`). +Phase 0 complete (2026-11-16): design pinned in ADRs 0004–0011 and tested on real builds (see PHASE0-REPORT.adoc). +Phase 1 not started. Nothing is released. == Milestones -=== 2026-11-16 — contribution-guide and Hypatia consistency repairs - -The contribution canary counts all four supported root/.github guide paths -once and rejects duplicates, including mixed-location and same-format pairs. -Regression controls cover the four single guides, no guide and all six pairs. - -The RSR oracle now uses the same Hypatia revision as the SARIF scanner and -verdict reporters: `6693f9aed8e4383f78a3d01b600b32663bf7a45c`. The existing -OTP 27 oracle runtime and PinSites compiler guard remain in place. The -workflow-edge gate also inspects Hypatia checkout refs, with controls for -wrong, missing, duplicate and unresolved refs, environment bindings, quoted -keys, repository casing and indentless steps. Shell examples are ignored. - -The suppression-policy description is reconciled with the pinned source. -The stale RE008 Dependabot exemption is removed after checking the workflow's -author-id gate, metadata handling and absence of checkout/artifact consumers. -No exemption is added or broadened. These are execution/consistency repairs; -a successful oracle invocation does not establish an RSR compliance tier. - -This upstream repair accompanies Secret Types PR #50. Existing template -coverage/debt placeholders remain placeholders for newly minted repositories. - -=== Existing milestones +=== Phase 0 — Spike (done) +* [x] Build Chez 10.4.1 and Idris 2 v0.8.0 from pinned sources; measure +* [x] Prove relocation (11 of 12 canaries on a relocated copy; one upstream bug) +* [x] Prototype launcher, factory and chaos suite (43 checks green) +* [x] Fact-check the plan against primary sources; record ADRs -[cols="5,1",options="header"] -|=== -| Milestone | Done +=== Phase 1 — MVP (Rust launcher + factory) +* [ ] Rust launcher: resolve, fetch, verify, store, exec, doctor, selftest, gc, lockfile (< 1,000 lines) +* [ ] Chaos suite as the launcher's CI gate +* [ ] Factory CI for idris2@0.8.0 × four Tier 1 targets (manylinux_2_28, native macOS), signed channel +* [ ] Error-message and DX design system applied to every output (parallel DX thread) +* [ ] Dogfood in estate proof lanes -| Phase 0: Core scaffolding (justfile, CI/CD, machine-readable) | 100% -| Phase 1: ABI/FFI standard (Idris2/Zig templates) | 100% -| Phase 1b: AI Gatekeeper Protocol (AI manifest, now the repo deed) | 100% -| Phase 1c: TOPOLOGY.md standard and guide | 100% -| Phase 1d: Maintenance gate (axes, checklist, approach) | 100% -| Phase 1e: Trustfile / contractiles | 100% -| Phase 2: Container ecosystem templates (stapeln) | 100% -| Phase 2b: www/ site-operations bundle + .well-known migration (#53) | 100% -| Phase 2c: Forge & Sustain mechanics — provenance at mint, self-name passes, drift gate, update mechanism (ADR-0003, ratified 2026-09-19) | 100% -| Phase 2d: julia-library archetype overlay + e2e mint test (recon P1.2) | 100% -| Phase 3: Multi-forge sync hardening | 0% -| Phase 4: Guix reproducible shells | 50% -| Phase 4b: RSR oracle dogfood gate in CI (recon P0.2; hypatia M-3 SSOT-path fix is the precondition) | 0% -|=== +=== Phase 2 — Trust layer +* [ ] Mirrors, hedged fetch, nightly canaries, churn drill, status page +* [ ] SLSA provenance, SBOM, immutable releases, two-tier keys +* [ ] Overlays, air-gap bundles, runbooks with triage notes -== Blockers - -. Hypatia M-3: `mix hypatia.rsr_score --standards` resolves the SSOT at the - pre-reorg path (`rhodium-standard-repositories/spec/`). A one-line fix is - prepared (recon P0.2/01), pending its PR. The dogfood job works around it - with an explicit `--ssot` until then. -. Estate-wide `actions.lock` sweep (D38/D39 ruling 2026-09-19): the grace - window closed on 2026-10-01. The sweep's estate-wide status is not recorded - here. This repo's own lockfile verifies (`gh actions-lock --no-fix`, rc=0, - 2026-10-02). +=== Phase 3 — Autonomy +* [ ] Bounded maintenance agent (human-only first month), Windows Tier 2, proofs per the proof plan == Next actions -* Wire the RSR oracle dogfood job in dogfood-gate.yml (recon P0.2) once the hypatia M-3 fix lands -* Record where the estate-wide actions.lock sweep stands now that the 2026-10-01 window has closed (gatekeeper repos first) -* Rebase rsr-julia-library-template-repo onto this spine (recon P1.3 procedure; ADR-0003 now accepted) -* Validate container templates across wolfi-base and static Chainguard images -* Harden multi-forge sync for GitLab/Bitbucket mirroring edge cases -* Expand Guix development shell templates - -== Maintenance runs - -No maintenance run has been recorded. Reports go to -`docs/reports/maintenance/latest.json`. - -== Ecosystem - -Part of the RSR Framework and the stapeln ecosystem. The repos it depends on -(stapeln, selur-compose, cerro-torre, svalinn, vordr, k9-svc) are the -`(related …)` entries of the deed's `(ecosystem …)` clause. +. Owner: apply rulesets, enable Discussions and immutable releases, create the wiki's first page, register at bestpractices.dev. +. Decide and start the Rust launcher at xhigh effort; port `scripts/proto/idris2x.sh` behaviour drill by drill. diff --git a/docs/status/TEST-NEEDS.adoc b/docs/status/TEST-NEEDS.adoc index 74af2434..586deeba 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: rsr-template-repo += TEST-NEEDS: idris2x == CRG Grade: C — ACHIEVED 2026-04-04 diff --git a/docs/status/UPSTREAM-NOTES.adoc b/docs/status/UPSTREAM-NOTES.adoc new file mode 100644 index 00000000..532185a3 --- /dev/null +++ b/docs/status/UPSTREAM-NOTES.adoc @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += Upstream notes (zero-fork policy: report, never patch) +:toc: macro + +Findings from the Phase 0 spike that belong upstream, with repro and citation. Check the upstream tracker before filing. + +== Idris 2 v0.8.0 — Chez backend fails when the project path contains non-ASCII characters + +* Repro (Linux, Chez 10.4.1): put a `Main.idr` under a directory named `ünïcödé/` and run `idris2 -o m Main.idr`. +* Observed: `Exception in read: invalid string character \23 at line 1, char 105 of build/exec/m_app/compileChez`. +* Cause: `src/Compiler/Scheme/Chez.idr:536-537` builds the Chez compile script with `"(compile-program " ++ show outSsAbs ++ "))"`. Idris's `show` on `String` emits Idris-style decimal escapes (`\252n\239c\246d\233`), which the Chez reader does not accept. Paths with spaces or `'` work; locale (`LANG=C.UTF-8`) makes no difference. +* Suggested fix: emit the path with a Scheme string escaper (hex `\xHH;` escapes or raw UTF-8), as `support/chez` already does elsewhere. +* idris2x stance: documented limitation; the `unicode_paths` canary stays *expected-fail* for `idris2@0.8.0` and is recorded in the channel's `compat` notes. + +== Idris 2 — generated `#! --program` shebang + +* `Chez.idr:87-91` bakes the absolute Chez path into the compiled `.so`'s first line; the `/usr/bin/env scheme --program` fallback cannot work on Linux because the kernel passes `scheme --program` as one argument. +* Linux limits the shebang line to 256 bytes (128 before kernel 5.1); long installation paths silently break. +* idris2x stance: the launcher never relies on the shebang; it execs `scheme --program idris2.so` directly (ADR 0005). Worth a doc note upstream. + +== Idris 2 — INSTALL.md and envvars.rst + +* INSTALL.md still tells source builders to pass `./configure --threads` (Chez 10 defaults to threaded on supported platforms) and points Apple Silicon users at the Racket fork; Chez >= 10.0.0 upstream supports `tarm64osx` natively. +* `docs/source/reference/envvars.rst` lists `IDRIS2_PREFIX` as build-time only, but `src/Idris/Driver.idr` honours it at runtime (this is what makes relocation possible). + +== Chez Scheme 10.4.1 + +* No prebuilt Linux/macOS binaries are published (Windows installer only). Build from `csv10.4.1.tar.gz` takes under three minutes on four cores. +* Boot-file search is executable-relative by default (`%x:%x/../lib/csv%v/%m:...`), so a tree copied whole is relocatable with no environment variables; the executable basename must stay `scheme` (boot file name is derived from it). diff --git a/build/docs-seed/troubleshooting.adoc b/docs/troubleshooting.adoc similarity index 84% rename from build/docs-seed/troubleshooting.adoc rename to docs/troubleshooting.adoc index b115d1a5..52e51de3 100644 --- a/build/docs-seed/troubleshooting.adoc +++ b/docs/troubleshooting.adoc @@ -1,8 +1,8 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -// SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> -= Troubleshooting — {{PROJECT_NAME}} -:revdate: {{CURRENT_YEAR}}-MM-DD +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (metadatastician) += Troubleshooting — idris2x +:revdate: 2026-MM-DD This file is a *living FAQ* — known failure modes and recovery paths. Add a new entry every time you debug something that took more than 15 @@ -54,5 +54,5 @@ just log-tail # last N lines of logs * `docs/architecture.adoc` — internals. * `docs/decisions/` — historical record of why things are this shape. -* `https://github.com/{{OWNER}}/{{PROJECT_NAME}}/issues?q=is%3Aissue+` — has anyone hit this before? +* `https://github.com/metadatastician/idris2x/issues?q=is%3Aissue+` — has anyone hit this before? * `https://github.com/hyperpolymath/standards/issues` — for estate-wide problems. diff --git a/build/docs-seed/usage.adoc b/docs/usage.adoc similarity index 87% rename from build/docs-seed/usage.adoc rename to docs/usage.adoc index 8ebc5330..371c0fed 100644 --- a/build/docs-seed/usage.adoc +++ b/docs/usage.adoc @@ -1,12 +1,12 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -// SPDX-FileCopyrightText: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> -= Usage — {{PROJECT_NAME}} -:revdate: {{CURRENT_YEAR}}-MM-DD +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (metadatastician) += Usage — idris2x +:revdate: 2026-MM-DD == Audience -This document is for *consumers* of `{{PROJECT_NAME}}` — people who depend +This document is for *consumers* of `idris2x` — people who depend on it, call it, or include it. For developers working *on* it, see link:./contributing.adoc[contributing.adoc]. @@ -31,7 +31,7 @@ Expected output: [source] ---- -{{PROJECT_NAME}} v0.0.0 +idris2x v0.0.0 Listening on 127.0.0.1:8080 ---- diff --git a/docs/wikis/Architecture.adoc b/docs/wikis/Architecture.adoc new file mode 100644 index 00000000..e5e9e1fc --- /dev/null +++ b/docs/wikis/Architecture.adoc @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Architecture + +Three pieces, only one of which is code: + +[cols="1,2,3",options="header"] +|=== +| Piece | What | Changes how often +| Launcher | Rust, one static binary, < 1,000 lines | Rarely (monthly engine train at most) +| Capsule factory | CI recipes driving upstream Makefiles in manylinux_2_28 containers and native macOS runners | Per upstream release +| Channel | One signed JSON document | Whenever data changes; a fix is a JSON diff plus `channel_version + 1` +|=== + +== Execution path + +`resolve` (local, no network) → stat `store/sha256-/.complete` (warm path) → otherwise fetch from mirrors with resume → +verify sha256 → safety-check the archive → unpack to staging → verify `sha256sums.txt` → run probes → atomic rename → +write `.complete` → compose the environment (a reset, ADR 0005) → `execve(/bin/scheme, --program, idris2.so, args)`. + +== Measured (Phase 0) + +Cold install from a local mirror 3.3 s; warm no-op 1.7–2.8 ms (Go skeleton measurement, ADR 0007); capsule 35 MB gzip. + +Decisions: link:https://github.com/metadatastician/idris2x/blob/main/docs/decisions/README.adoc[ADRs]. diff --git a/docs/wikis/CI-Fleet-Operations.adoc b/docs/wikis/CI-Fleet-Operations.adoc new file mode 100644 index 00000000..e65c0a94 --- /dev/null +++ b/docs/wikis/CI-Fleet-Operations.adoc @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += CI fleet operations + +[NOTE] +==== +*Planned (Phase 1).* Describes the agreed design (ADRs in `docs/decisions/`); not yet shipped. +==== + +[cols="1,3",options="header"] +|=== +| Task | How +| Health check | `idris2x doctor --json`; alert on non-zero exit and on any `[FAIL]` probe. +| Pre-warm images | Run `idris2x install --locked` for your common locks while building the image. +| Disk budget | `idris2x gc --keep-last N` on a schedule; capsules are about 137 MB unpacked. +| Stale locks | Locks die with their process; `E-LOCK-TIMEOUT` names the lock file if one must be removed by hand. +| Proxies | Standard `HTTPS_PROXY`/`NO_PROXY`; the only hosts contacted are the channel and capsule URLs in your lock. +| Monitoring | Exit codes are stable (link:Error-Reference[error reference]); `--json` errors carry `error`, `message`, `fix`, `runbook`. +|=== diff --git a/docs/wikis/CI-Usage.adoc b/docs/wikis/CI-Usage.adoc new file mode 100644 index 00000000..e93a4844 --- /dev/null +++ b/docs/wikis/CI-Usage.adoc @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Using idris2x in CI + +[NOTE] +==== +*Planned (Phase 1).* The Rust launcher and published capsules do not exist yet. Commands on this page describe the +agreed interface (ADRs in `docs/decisions/`). The Linux prototype in `scripts/proto/idris2x.sh` implements the same +surface today for experiments. +==== + +== GitHub Actions + +[source,yaml] +---- +- name: Cache idris2x capsules + uses: actions/cache@ + with: + path: ~/.cache/idris2x/store + key: idris2x-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('idris2x.lock') }} +- run: idris2x exec --locked -- idris2 --build my.ipkg +---- + +* The cache key is the lockfile's hash: a new pin means a new cache entry, never a stale compiler. +* `--locked` fails if the lock does not cover the runner's platform (`E-PIN-NOT-FOUND`) instead of resolving something new. +* Exit codes are stable; `--json` prints machine-readable errors; output contains no colour or spinners when not on a TTY. + +== Parallel jobs on one machine + +Per-capsule file locks make concurrent installs safe: the first job installs, the others wait and reuse it +(drilled with four concurrent installs in Phase 0). + +== Estate repositories (PROOF-POLICY) + +The lock's digest plus `idris2x verify` is the version-and-digest assertion PROOF-POLICY §6 asks for. Until the canon lists idris2x as +a sanctioned route, record the deviation; template in +https://github.com/metadatastician/idris2x/blob/main/docs/status/ESTATE-INTEGRATION.adoc[ESTATE-INTEGRATION]. diff --git a/docs/wikis/Capsule-Factory.adoc b/docs/wikis/Capsule-Factory.adoc new file mode 100644 index 00000000..7af00ab4 --- /dev/null +++ b/docs/wikis/Capsule-Factory.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Capsule factory + +[NOTE] +==== +*Planned (Phase 1).* Describes the agreed design (ADRs in `docs/decisions/`); not yet shipped. +==== + +Per Idris 2 release and target: + +. Build Chez Scheme from the sha256-pinned `csv.tar.gz` with `--disable-x11 --disable-curses` (runtime deps: libc and libm only). +. Build Idris 2 from its tag with `make bootstrap` and `make install` using the *same* `PREFIX` and an absolute `CHEZ`. +. Merge both trees, drop bootstrap artifacts, add licences (Apache-2.0 + NOTICE, BSD-3, LZ4, Nanopass, zlib), `capsule.json` and `sha256sums.txt`. +. Relocation probe: move the tree into a path with spaces and run all twelve canaries. +. Pack reproducibly (sorted, fixed mtime, numeric owners), attest, publish as an immutable release, mirror. + +Measured: Chez 164 s, Idris 2 bootstrap 604 s on four cores. diff --git a/docs/wikis/Capsule-Lifecycle.adoc b/docs/wikis/Capsule-Lifecycle.adoc new file mode 100644 index 00000000..2d853959 --- /dev/null +++ b/docs/wikis/Capsule-Lifecycle.adoc @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Capsule lifecycle + +* *Built* from pinned upstream sources (Chez tarball sha256, Idris 2 tag commit) by the factory; never patched. +* *Canaried*: twelve atomic canaries, including a relocation probe into a path with spaces. +* *Published* as an immutable release asset plus a mirror copy; never rewritten. A fix is a new revision (`idris2@0.8.0-2`). +* *Deprecated* two quarters ahead in the channel's `deprecated` list and the changelog; deprecated capsules still run for existing locks. +* *Archived* in long-term copies so that I4 (the past never breaks) holds even after deletion of the original hosting. diff --git a/docs/wikis/Contributing-Guide.adoc b/docs/wikis/Contributing-Guide.adoc new file mode 100644 index 00000000..1052cfea --- /dev/null +++ b/docs/wikis/Contributing-Guide.adoc @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Contributing guide + +Start with link:https://github.com/metadatastician/idris2x/blob/main/CONTRIBUTING.adoc[CONTRIBUTING.adoc]; this page is the idris2x-specific part. + +== Set up + +[source,bash] +---- +git clone https://github.com/metadatastician/idris2x && cd idris2x +mise install # toolchain pinned in mise.toml +just test && just quality # the golden path +---- + +== Rules that reviewers will hold you to + +* Every failure is typed: add it to `src/errors/errors.toml`, then run `scripts/gen-runbooks.sh` and `scripts/gen-issue-forms.sh`. +* The launcher stays under 1,000 lines of our own code. Features that do not fit belong in the channel (data) or the capsule. +* No Python, Go or Node.js. Scripts are bash + jq + awk; the launcher is Rust. +* User-visible output changes need a before/after transcript in the PR (plain, `NO_COLOR=1`, `--json`). +* Signed commits; SPDX header on every file. + +== Where to start + +* `good first issue` and `area:dx` issues. +* Port a prototype behaviour from `scripts/proto/idris2x.sh` into Rust, with its chaos drill. diff --git a/docs/wikis/Daily-Use.adoc b/docs/wikis/Daily-Use.adoc new file mode 100644 index 00000000..03ca7c7d --- /dev/null +++ b/docs/wikis/Daily-Use.adoc @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Pinning and upgrading + +[NOTE] +==== +*Planned (Phase 1).* The Rust launcher and published capsules do not exist yet. Commands on this page describe the +agreed interface (ADRs in `docs/decisions/`). The Linux prototype in `scripts/proto/idris2x.sh` implements the same +surface today for experiments. +==== + +== Resolution order (no network involved) + +CLI flag → `IDRIS2X_VERSION` → `idris2x.toml` → `*.ipkg` hint → `idris2x.lock`. + +== Upgrade a project + +[source,bash] +---- +idris2x pin 0.8.1 # when it exists: verifies the channel, rewrites the lock +git diff idris2x.lock # review: one digest per platform changes +---- + +`--locked` (the default in CI) never changes the lock; only `pin` and `update` resolve new versions. + +== Two versions side by side + +Capsules are content-addressed, so versions never collide: + +[source,bash] +---- +idris2x -p idris2@0.7.0 -- idris2 --check src/Proof.idr +idris2x -p idris2@0.8.0 -- idris2 --check src/Proof.idr +---- + +== Use the compiler from a script or editor + +[source,bash] +---- +eval "$(idris2x env)" # exports IDRIS2_PREFIX, CHEZ, PATH, ... for this shell only +idris2x env --json # the same, for tools +---- diff --git a/docs/wikis/Error-Reference.adoc b/docs/wikis/Error-Reference.adoc new file mode 100644 index 00000000..fed4083b --- /dev/null +++ b/docs/wikis/Error-Reference.adoc @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Error reference + +Generated from `src/errors/errors.toml`. Exit codes are stable and append-only. + +[cols="2,1,4,4",options="header"] +|=== +| ID | Exit | Meaning | Fix +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-USAGE.adoc[`E-USAGE`] | 2 | bad command line | `idris2x --help` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-PIN-NOT-FOUND.adoc[`E-PIN-NOT-FOUND`] | 10 | no lock, or lock/channel has no capsule for this version+target | `idris2x pin ` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-HASH-MISMATCH.adoc[`E-HASH-MISMATCH`] | 11 | downloaded bytes or unpacked tree do not match the pinned digest | `idris2x gc && idris2x install --locked` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-SIG-INVALID.adoc[`E-SIG-INVALID`] | 12 | channel manifest signature or key id does not verify | `do not override; investigate the mirror (runbook)` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-PLATFORM-UNSUPPORTED.adoc[`E-PLATFORM-UNSUPPORTED`] | 13 | no capsule exists for this OS/arch | `see supported targets; consider --from-source (Tier 3)` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-NETWORK.adoc[`E-NETWORK`] | 14 | all mirrors failed | `retry; check proxy; IDRIS2X_OFFLINE=1 with a prefetched bundle` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-LOCK-TIMEOUT.adoc[`E-LOCK-TIMEOUT`] | 15 | another install of the same capsule held the lock too long | `wait, or remove the stale lock file named in the message` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-GLIBC-FLOOR.adoc[`E-GLIBC-FLOOR`] | 16 | host glibc older than the capsule's min_glibc | `upgrade the host or use a musl/static capsule when available` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-PROBE-CODEGEN.adoc[`E-PROBE-CODEGEN`] | 17 | capsule unpacked and verified but a canary failed on this host | `runbook triage; idris2x doctor --json` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-CHANNEL-SCHEMA.adoc[`E-CHANNEL-SCHEMA`] | 18 | channel or lock schema newer than this launcher | `update idris2x` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-PIN-DRIFT.adoc[`E-PIN-DRIFT`] | 19 | idris2x.toml and idris2x.lock disagree | `idris2x pin ` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-OFFLINE.adoc[`E-OFFLINE`] | 20 | cache miss while IDRIS2X_OFFLINE=1 | `idris2x fetch -o bundle on a connected host, then idris2x install --from bundle` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-CAPSULE-INVALID.adoc[`E-CAPSULE-INVALID`] | 21 | capsule archive is malformed or contains unsafe paths/links | `report the digest; never unpack by hand` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-CHANNEL-ROLLBACK.adoc[`E-CHANNEL-ROLLBACK`] | 22 | channel_version went backwards relative to the lock (rollback/freeze attack or stale mirror) | `investigate; do not override` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-CHANNEL-EXPIRED.adoc[`E-CHANNEL-EXPIRED`] | 23 | channel manifest past its expires timestamp (freeze protection) | `fetch a fresh manifest; IDRIS2X_ALLOW_EXPIRED=1 only when you know why` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-STORE-IO.adoc[`E-STORE-IO`] | 24 | store not writable, disk full, or atomic rename failed | `free space / fix permissions; idris2x gc` +| link:https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-INTERNAL.adoc[`E-INTERNAL`] | 70 | launcher bug | `file an issue with idris2x doctor --json` +|=== diff --git a/docs/wikis/Error-Taxonomy-Workflow.adoc b/docs/wikis/Error-Taxonomy-Workflow.adoc new file mode 100644 index 00000000..8a1d0830 --- /dev/null +++ b/docs/wikis/Error-Taxonomy-Workflow.adoc @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Error taxonomy workflow + +The taxonomy is data (ADR 0009). One file, `src/errors/errors.toml`, feeds: + +* the launcher's error table and `--json` output (Phase 1), +* `docs/runbooks/.adoc` headers (`scripts/gen-runbooks.sh`; hand-written triage below the marker survives), +* the *idris2x printed an error* issue form (`scripts/gen-issue-forms.sh`), +* the link:Error-Reference[error reference] page. + +Rules: exit codes are append-only; every entry has a one-line meaning and a copy-pasteable fix; CI runs both generators with `--check`. diff --git a/docs/wikis/FAQ.adoc b/docs/wikis/FAQ.adoc new file mode 100644 index 00000000..92797bac --- /dev/null +++ b/docs/wikis/FAQ.adoc @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += FAQ + +[NOTE] +==== +*Planned (Phase 1).* The Rust launcher and published capsules do not exist yet. Commands on this page describe the +agreed interface (ADRs in `docs/decisions/`). The Linux prototype in `scripts/proto/idris2x.sh` implements the same +surface today for experiments. +==== + +*Is this the official Idris 2 installer?* No. It is an unofficial distribution that replays upstream releases with their own build files, unmodified, and ships their licences. + +*How is this different from pack?* pack is the Idris 2 package manager and builds the compiler from source against your system's Chez. idris2x supplies a prebuilt, verified compiler + Chez pair; pack can run on top of it. + +*Why not Homebrew, Nix or my distro?* They are fine if they serve you. idris2x exists for pinned, identical toolchains across laptops, CI, servers and air-gapped hosts, years apart, with one lockfile. + +*Does it phone home?* No. The only network traffic is fetching the manifest and capsules, on explicit commands, with a generic user agent. + +*What happens if the project is abandoned?* Existing lockfiles keep working as long as the capsule bytes exist (GitHub release assets survive archiving; a second mirror and archival copies cover deletion). See the abandonment contract in MAINTAINERS. + +*Windows?* Tier 2, experimental, after Linux and macOS. diff --git a/docs/wikis/Formal-Model.adoc b/docs/wikis/Formal-Model.adoc new file mode 100644 index 00000000..c0a64393 --- /dev/null +++ b/docs/wikis/Formal-Model.adoc @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Formal model + +== Store state machine + +For a digest `d`, the store directory `S(d)` is in exactly one of three observable states: + +[cols="1,3",options="header"] +|=== +| State | Definition +| Absent | no directory, or a directory without `.complete` (garbage by definition) +| Staged | a private staging directory exists under `tmp/`; invisible to readers +| Complete | `S(d)/.complete` exists and `sha256sums.txt` verifies +|=== + +Transitions: `Absent → Staged` (download, verify, unpack, probe under the per-digest lock), `Staged → Complete` (one atomic +rename, then the marker), any `Staged → Absent` on failure. No transition writes to a Complete directory. + +== Invariants as properties + +* *I1 (no silent drift):* `exec(lock)` either runs a program whose bytes hash to `lock[target]` or returns an error. Formally, the + executor is a total function `Lock × Host → Result(Exec(d), Error)` with `d = lock[target(Host)]`. +* *I2 (atomic or absent):* for every interleaving of installers and crashes, every reader observes Absent or Complete, never a partial + tree. Proof obligation: the marker is written after the rename, and readers test only the marker. +* *I3 (loud):* the error type is a closed sum (`src/errors/errors.toml`); every non-success path returns a constructor. +* *I4 (past never breaks):* `exec` reads neither the channel nor the clock. Its only inputs are the lock, the capsule bytes and the host. +* *I5 (verify before trust):* no edge from Staged to any `execve` exists without passing the digest, archive-safety and probe checks. + +== Tested, not yet proven + +The 43 chaos drills exercise these properties on a real capsule (concurrent installers, crashes via write limits, tampering). +Proof work is planned: link:Proof-Plan[Proof plan]. diff --git a/docs/wikis/Getting-Started.adoc b/docs/wikis/Getting-Started.adoc new file mode 100644 index 00000000..bea870bd --- /dev/null +++ b/docs/wikis/Getting-Started.adoc @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Getting started + +[NOTE] +==== +*Planned (Phase 1).* The Rust launcher and published capsules do not exist yet. Commands on this page describe the +agreed interface (ADRs in `docs/decisions/`). The Linux prototype in `scripts/proto/idris2x.sh` implements the same +surface today for experiments. +==== + +== Five minutes, start to finish + +[source,bash] +---- +# 1. Install the launcher (one static binary, no root). See Install for every method. +# 2. In your Idris 2 project: +idris2x init # writes idris2x.toml: [toolchain] idris2 = "0.8.0" +idris2x pin 0.8.0 # verifies the signed channel and writes idris2x.lock (commit it) +idris2x exec --locked -- idris2 --build my.ipkg +---- + +The first `exec` downloads about 35 MB, verifies it and runs the canaries; later runs start in milliseconds. + +== What just happened + +* `idris2x.toml` says what you *want*; `idris2x.lock` records exactly which capsule (sha256) satisfies it on each platform. Commit both. +* The capsule lives in `~/.cache/idris2x/store/sha256-/` (or `$XDG_CACHE_HOME`). It contains Idris 2, the matching Chez Scheme, the standard libraries and their licences. +* Nothing is installed system-wide and nothing outside the cache and your project is written. + +== Next + +* Several projects on different Idris 2 versions: link:Daily-Use[Pinning and upgrading]. +* CI: link:CI-Usage[Using in CI]. +* Something failed: every error names its fix and a runbook; see link:Troubleshooting[Troubleshooting]. diff --git a/docs/wikis/Glossary.adoc b/docs/wikis/Glossary.adoc new file mode 100644 index 00000000..589e3a64 --- /dev/null +++ b/docs/wikis/Glossary.adoc @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Glossary + +[cols="1,4",options="header"] +|=== +| Term | Meaning +| Capsule | An immutable archive containing Idris 2, its matching Chez Scheme, the standard libraries, licences, `capsule.json` and `sha256sums.txt`, named by its sha256. +| Channel | The signed, data-only JSON manifest mapping versions and targets to capsule digests and URLs. +| Lock (`idris2x.lock`) | The project's record of which capsule digest satisfies its pin on each platform. Execution needs only this and the capsule bytes. +| Store | The content-addressed cache of complete capsules, `$XDG_CACHE_HOME/idris2x/store/`. +| Canary | One of twelve small checks every capsule must pass before use. +| Probe | The subset of canaries run at install time on the user's host. +| Tier | Support level of a target: 1 built and canaried nightly, 2 experimental, 3 source only. +| Risk class | A, B or C: how much human review a change needs. +| Environment contract | The exact set of variables the launcher sets, and resets, before exec. +|=== diff --git a/docs/wikis/Home.adoc b/docs/wikis/Home.adoc new file mode 100644 index 00000000..f4663991 --- /dev/null +++ b/docs/wikis/Home.adoc @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += idris2x wiki + +*One command, exactly the Idris 2 compiler you pinned, or a loud error that tells you how to fix it.* + +idris2x downloads an immutable, signed, self-testing Idris 2 + Chez Scheme *capsule*, verifies it, unpacks it +atomically into a content-addressed cache, and runs the real compiler. No system Chez, no `sudo`, works offline. + +[NOTE] +==== +*Planned (Phase 1).* The Rust launcher and published capsules do not exist yet. Commands on this page describe the +agreed interface (ADRs in `docs/decisions/`). The Linux prototype in `scripts/proto/idris2x.sh` implements the same +surface today for experiments. +==== + +== Find your path + +[cols="1,3",options="header"] +|=== +| You are | Start here +| *A user*: you write Idris 2, teach it, or need a compiler in CI | link:Getting-Started[Getting started] → link:Install[Install] → link:Troubleshooting[Troubleshooting] +| *A platform maintainer*: you run CI fleets, mirrors, labs or servers | link:Platform-Overview[Platform overview] → link:Self-Hosted-Channel[Self-hosted channel] → link:Security-Model[Security model] +| *A developer*: you want to contribute to idris2x | link:Contributing-Guide[Contributing guide] → link:Architecture[Architecture] → link:Prototype-and-Chaos-Suite[Prototype and chaos suite] +| *A theorist*: you care about what is guaranteed and why | link:Theory-Overview[Theory overview] → link:Formal-Model[Formal model] → link:Proof-Plan[Proof plan] +|=== + +== Five promises + +. *No silent drift.* What runs is exactly the pinned digest, or nothing. +. *Atomic or absent.* An interrupted install leaves nothing half-done. +. *Loud by default.* Every failure has a stable ID, an exit code, a runbook and the exact fix. +. *The past never breaks.* A lockfile plus the capsule bytes is enough, forever, even if this project stops. +. *Verify before trust.* Signature, digest and canaries before the first run. + +== Status + +Phase 0 (design tested on real builds) is complete: see the +https://github.com/metadatastician/idris2x/blob/main/docs/status/PHASE0-REPORT.adoc[Phase 0 report]. +Unofficial; not affiliated with the Idris 2 or Chez Scheme projects. diff --git a/docs/wikis/Install.adoc b/docs/wikis/Install.adoc new file mode 100644 index 00000000..21e4c557 --- /dev/null +++ b/docs/wikis/Install.adoc @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Install + +[NOTE] +==== +*Planned (Phase 1).* The Rust launcher and published capsules do not exist yet. Commands on this page describe the +agreed interface (ADRs in `docs/decisions/`). The Linux prototype in `scripts/proto/idris2x.sh` implements the same +surface today for experiments. +==== + +idris2x is one static binary. Installing it never needs `sudo`, a compiler, Chez Scheme, Nix or mise. + +== Methods (planned) + +[cols="1,3",options="header"] +|=== +| Method | Notes +| Release binary | Download from GitHub Releases for your platform and verify it before running it (below). Put it anywhere on `PATH`, e.g. `~/.local/bin`. +| mise / aqua registry | `mise use idris2x`: mise verifies the checksum and provenance for you. +| Homebrew, winget, Nix | Independently reviewed manifests pin the binary's hash; preferred where available. +| From source | `cargo install --locked --path .` in a clone (Rust ≥ 1.80). +|=== + +There is deliberately no `curl | sh` that fetches "latest": the first binary you trust should be pinned by a hash you can check. + +== Verify the binary you downloaded + +[source,bash] +---- +sha256sum -c idris2x--.sha256 +gh attestation verify idris2x-- --repo metadatastician/idris2x +---- + +The root public key's fingerprint is published in the README and in each release's notes. + +== Check it works + +[source,bash] +---- +idris2x doctor # store writable, network or offline mode, platform, probes +---- + +== Where things go + +[cols="1,2",options="header"] +|=== +| What | Where +| Launcher binary | wherever you put it +| Capsules (content-addressed, immutable) | `$XDG_CACHE_HOME/idris2x/store/` (default `~/.cache/idris2x/store/`) +| Cached channel manifest, locks, staging | `~/.cache/idris2x/{manifests,locks,tmp}/` +| Your project's pins | `idris2x.toml`, `idris2x.lock` in the project +|=== + +Removing everything is just as explicit: see link:Uninstall[Uninstall]. diff --git a/docs/wikis/Maintenance-Loop.adoc b/docs/wikis/Maintenance-Loop.adoc new file mode 100644 index 00000000..e1f21ce3 --- /dev/null +++ b/docs/wikis/Maintenance-Loop.adoc @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Maintenance loop + +Target: 15–30 minutes a week for one maintainer. + +. Canary badge green: done. +. Red: read the auto-filed failure record. Classify as a data fix (review the agent's channel patch), an engine fix (monthly train) or an upstream outage (document, wait). +. Merge by risk class: A auto-merges after two green rehearsals, B needs one human approval, C needs an ADR. + +The agent proposes only `compat_patch`, `pin_bump`, `mirror_add` or `escalate`; every proposal is schema-validated and rehearsed on three targets before a human sees it. Label any open issue `agent:kill-switch` to stop it. diff --git a/docs/wikis/Mirrors-and-Caching.adoc b/docs/wikis/Mirrors-and-Caching.adoc new file mode 100644 index 00000000..0d941bfd --- /dev/null +++ b/docs/wikis/Mirrors-and-Caching.adoc @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Mirrors and caching + +[NOTE] +==== +*Planned (Phase 1).* Describes the agreed design (ADRs in `docs/decisions/`); not yet shipped. +==== + +* Each capsule lists several URLs; the launcher tries them in order and verifies every byte against the lock, so a mirror can deny service but cannot substitute content. +* Resume uses HTTP `Range` on immutable capsule downloads only. Some CDNs answer a range request with a full `200`; the launcher detects that and restarts. +* GitHub release download URLs redirect to signed URLs that expire in minutes; always mirror the stable `github.com/.../releases/download/...` URL, never the redirect target. +* A plain directory served over HTTPS (or `file://` for labs) is a valid mirror: copy the capsule files and keep their names. + +== Caching in CI + +Cache `~/.cache/idris2x/store` keyed on the hash of `idris2x.lock`. A restored store is re-verified on use (`.complete` marker plus per-file `sha256sums.txt`), so a corrupted cache produces `E-HASH-MISMATCH`, not a broken compiler. diff --git a/docs/wikis/Offline-and-Air-Gapped.adoc b/docs/wikis/Offline-and-Air-Gapped.adoc new file mode 100644 index 00000000..e563edf9 --- /dev/null +++ b/docs/wikis/Offline-and-Air-Gapped.adoc @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Offline and air-gapped use + +[NOTE] +==== +*Planned (Phase 1).* The Rust launcher and published capsules do not exist yet. Commands on this page describe the +agreed interface (ADRs in `docs/decisions/`). The Linux prototype in `scripts/proto/idris2x.sh` implements the same +surface today for experiments. +==== + +== Prefetch on a connected machine + +[source,bash] +---- +idris2x fetch -o idris2x-bundle.tar.gz # capsule + signed manifest + signature, checked against the lock +---- + +Copy the bundle, the project's `idris2x.lock` and the launcher binary to the isolated host. + +== Install on the isolated host + +[source,bash] +---- +IDRIS2X_OFFLINE=1 idris2x install --from idris2x-bundle.tar.gz +IDRIS2X_OFFLINE=1 idris2x exec --locked -- idris2 --version +---- + +The bundle is verified exactly like a download: wrong bytes fail with `E-HASH-MISMATCH`; a cache miss in offline mode fails with +`E-OFFLINE` and tells you to fetch, instead of reaching for the network. Both paths are drilled in the Phase 0 chaos suite. diff --git a/docs/wikis/Platform-Overview.adoc b/docs/wikis/Platform-Overview.adoc new file mode 100644 index 00000000..5a69579d --- /dev/null +++ b/docs/wikis/Platform-Overview.adoc @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Platform overview + +For people who run idris2x for others: CI fleets, shared build hosts, teaching labs, air-gapped estates. + +[NOTE] +==== +*Planned (Phase 1).* Describes the agreed design (ADRs in `docs/decisions/`); not yet shipped. +==== + +== What you operate + +[cols="1,3",options="header"] +|=== +| Piece | Your concern +| Launcher | One static binary per platform. Pin its sha256 in your images or provisioning. +| Store | `$XDG_CACHE_HOME/idris2x/store`: immutable, content-addressed, safe to share read-only, safe to cache between jobs, safe to delete (it is rebuilt from the lock). +| Channel | A signed JSON manifest. Use ours, or publish your own vetted one (link:Self-Hosted-Channel[Self-hosted channel]). +| Mirrors | Any HTTPS server; untrusted by construction because every byte is checked against the lock (link:Mirrors-and-Caching[Mirrors and caching]). +|=== + +== Guarantees you can build on + +* Execution never contacts the channel: a lockfile plus capsule bytes is enough. +* No root, no system packages, no services, no telemetry. +* Every failure has a stable exit code and `--json` output for your alerting. +* Concurrent installs of the same capsule on one host are serialised by a per-digest lock. diff --git a/docs/wikis/Proof-Plan.adoc b/docs/wikis/Proof-Plan.adoc new file mode 100644 index 00000000..58b1facf --- /dev/null +++ b/docs/wikis/Proof-Plan.adoc @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Proof plan + +Estate PROOF-POLICY assigns verifiers by obligation. Nothing below has been run yet; this is the plan. + +[cols="2,2,3",options="header"] +|=== +| Obligation | Verifier | Scope +| Pure core of the launcher: resolution, lock parsing, digest comparison, archive path containment | *Creusot* with *Pearlite* contracts, and *Verus* | Totality, no panics, containment (`normalise(join(root, p))` stays under `root`) +| Interface contracts: `idris2x.lock` and `capsule.json` | *Idris 2* | Total decoders; every accepted document satisfies the schema +| Store state machine (I2) | TLA+ model, checked with TLC | All interleavings of N installers and crashes; readers see Absent or Complete +| Archive extraction against adversarial inputs | Property tests and fuzzing | Escaping paths and links always rejected +|=== + +Status is tracked with denominators in +link:https://github.com/metadatastician/idris2x/blob/main/docs/status/PROOF-STATUS.adoc[PROOF-STATUS]. A property is reported as proven only with current receipts. diff --git a/docs/wikis/Prototype-and-Chaos-Suite.adoc b/docs/wikis/Prototype-and-Chaos-Suite.adoc new file mode 100644 index 00000000..7ef03d7e --- /dev/null +++ b/docs/wikis/Prototype-and-Chaos-Suite.adoc @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Prototype and chaos suite + +`scripts/proto/` holds the Phase 0 bash prototype: `idris2x.sh` (launcher), `make-capsule.sh` (factory), `chaos.sh` (drills). +The Rust launcher must pass the same drills; `chaos.sh` is its executable specification. + +== Run it (Linux) + +[source,bash] +---- +apt-get install jq zstd signify-openbsd libgmp-dev +cargo build --example fixture_server # Range-capable test server, std only +FIXTURE_SERVER=target/debug/examples/fixture_server \ + scripts/proto/chaos.sh +---- + +== What is drilled (43 checks, all passing) + +404 on the primary mirror, flipped byte, truncation and resume (asserting a 206), four concurrent installs, a disk-full analogue, +tampered manifest, wrong key, rollback, expiry with and without override, offline cache miss, air-gap bundle, lock contention, +unsafe tar members, paths with spaces, garbage collection, and the canaries via `selftest`. + +== Lessons the drills taught + +* Never raise a typed error inside a subshell: its exit code is lost. +* Never resume a mutable document: a range resume spliced new bytes onto a stale manifest. +* Relative symlinks inside the tree are legitimate (Chez's `bin/scheme`); only escaping links are unsafe. diff --git a/docs/wikis/Release-and-Signing.adoc b/docs/wikis/Release-and-Signing.adoc new file mode 100644 index 00000000..45bab7fa --- /dev/null +++ b/docs/wikis/Release-and-Signing.adoc @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Release and signing + +[NOTE] +==== +*Planned (Phase 1).* Describes the agreed design (ADRs in `docs/decisions/`); not yet shipped. +==== + +* Root key: Ed25519, generated offline, two USB copies plus a paper seed; its public half is embedded in the launcher. +* Channel publishes happen in a protected environment with a required reviewer; the factory verifies build attestations before signing. +* Releases are immutable (draft → attach every asset → publish). +* Key rotation: a channel listing both keys for two quarters, then the old one is dropped. +* The maintenance agent never has access to any private key. diff --git a/docs/wikis/Reproducibility-for-Research.adoc b/docs/wikis/Reproducibility-for-Research.adoc new file mode 100644 index 00000000..b911fa5e --- /dev/null +++ b/docs/wikis/Reproducibility-for-Research.adoc @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Reproducibility for research + +For papers, artefact evaluations and course material: + +* Commit `idris2x.lock` with your artefact. It names the exact compiler, runtime and standard libraries by sha256, per platform. +* Cite the capsule digest and the channel version in the paper; a reader runs `idris2x exec --locked -- idris2 ...` years later and + gets the same toolchain or a typed error, never a silent substitute. +* For artefact evaluation boxes without network, ship `idris2x fetch`'s bundle with the artefact (link:Offline-and-Air-Gapped[offline use]). +* Capsule provenance (source digests, build attestations, SBOM) is recorded with each release. + +Bit-for-bit identical capsules across rebuilds are a later goal, not a current claim. diff --git a/docs/wikis/Security-Model.adoc b/docs/wikis/Security-Model.adoc new file mode 100644 index 00000000..9870455d --- /dev/null +++ b/docs/wikis/Security-Model.adoc @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Security model + +Summary of the link:https://github.com/metadatastician/idris2x/blob/main/docs/architecture/THREAT-MODEL.adoc[threat model]. + +* *Two-layer verification.* An Ed25519 signature over the channel manifest (key pinned in the launcher) and a sha256 per capsule, recorded in your lock. Mirrors are untrusted. +* *Rollback and freeze.* Monotonic `channel_version` recorded in the lock, plus an `expires` timestamp. Both gate resolution only. +* *Environment as an attack surface.* Idris 2 treats `IDRIS2_PATH`, `IDRIS2_DATA`, `IDRIS2_LIBS`, `IDRIS2_PACKAGE_PATH` and `IDRIS2_INC_SRC` as code search paths, so the launcher resets them rather than inheriting them. +* *Archive safety.* Absolute paths, `..`, escaping links, devices and setuid bits are rejected before anything is written to the store. +* *Provenance.* Capsules carry SLSA provenance and Sigstore attestations; the factory verifies them before signing the channel. Releases are immutable. +* *Privacy.* No telemetry. GitHub and the mirror host see the IP, user agent and capsule name of each download, nothing more. + +Report vulnerabilities privately through a GitHub security advisory. diff --git a/docs/wikis/Self-Hosted-Channel.adoc b/docs/wikis/Self-Hosted-Channel.adoc new file mode 100644 index 00000000..1736ab6e --- /dev/null +++ b/docs/wikis/Self-Hosted-Channel.adoc @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Self-hosted channel + +[NOTE] +==== +*Planned (Phase 1).* Describes the agreed design (ADRs in `docs/decisions/`); not yet shipped. +==== + +A channel is one signed, data-only JSON document: capsule URLs, digests, sizes, the Idris 2 ↔ Chez compat table and deprecations. +No scripts, ever. A company can publish its own vetted channel with zero code changes: + +[source,bash] +---- +IDRIS2X_CHANNEL_URL=https://capsules.example.org/v1.json idris2x pin 0.8.0 +---- + +== Rules a channel must follow + +* Validates against the schema in link:https://github.com/metadatastician/idris2x/blob/main/src/contracts/channel-v1.schema.json[`src/contracts/channel-v1.schema.json`]. +* `channel_version` increases by exactly one per publish; clients refuse to go backwards past the version in their lock (`E-CHANNEL-ROLLBACK`). +* Carries `expires`; an expired manifest blocks *new pins* (`E-CHANNEL-EXPIRED`) but never execution of existing ones. +* Signed with Ed25519 in signify format (`signify -S`, or `minisign -l`); pre-hashed signatures are rejected. +* All capsule URLs are HTTPS. + +Your channel can reference our capsules (by digest) or your own builds from the same factory recipes. diff --git a/docs/wikis/Supported-Platforms.adoc b/docs/wikis/Supported-Platforms.adoc new file mode 100644 index 00000000..93a6abb8 --- /dev/null +++ b/docs/wikis/Supported-Platforms.adoc @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Supported platforms + +Generated from `src/definitions/targets.toml`. Tier 1: capsules built and canaried nightly. Tier 2: experimental. + +[cols="3,1,2,2,3",options="header"] +|=== +| Target triple | Tier | Chez machine | Floor | Runner +| `x86_64-unknown-linux-gnu` | 1 | `ta6le` | glibc 2.28 | `ubuntu-24.04` +| `aarch64-unknown-linux-gnu` | 1 | `tarm64le` | glibc 2.28 | `ubuntu-24.04-arm` +| `aarch64-apple-darwin` | 1 | `tarm64osx` | macOS 13.0 | `macos-15` +| `x86_64-apple-darwin` | 1 | `ta6osx` | macOS 13.0 | `macos-15-intel` +| `x86_64-pc-windows-msvc` | 2 | `ta6nt` | - | `windows-2025` +|=== + +* Linux capsules are built in `manylinux_2_28` containers so they run on any distribution with glibc ≥ 2.28 (RHEL/Alma 8, Debian 11, Ubuntu 20.04 and later). +* Chez Scheme 10.x is required on every AArch64 target; all capsules use 10.4.1. +* GitHub is retiring Intel macOS runners (around 2027); `x86_64-apple-darwin` may move to cross-built boot files or be demoted. Changes to this table are Class C and need an ADR. diff --git a/docs/wikis/Theory-Overview.adoc b/docs/wikis/Theory-Overview.adoc new file mode 100644 index 00000000..00801fcf --- /dev/null +++ b/docs/wikis/Theory-Overview.adoc @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Theory overview + +idris2x makes one bet: *a toolchain is a value, not a process.* Installing a compiler is usually a stateful, platform-specific +procedure whose result you cannot name. idris2x turns it into a content-addressed artifact whose name is its sha256, plus a small +deterministic executor. Every guarantee follows from that change of representation. + +== The reduction + +* *Liveness becomes an immutable-prefix problem.* "Will this project still build in five years?" reduces to "do these bytes still exist + somewhere?", which archival copies and mirrors can answer, rather than "does the build procedure still work on future systems?". +* *Trust is split by kind.* Freshness and authenticity of *choices* (which capsule satisfies `idris2@0.8.0` on this platform) are signed + data in the channel. Integrity of *bytes* is a digest in your lockfile. Execution depends only on the second. +* *Failure becomes a type.* The error taxonomy is a finite, append-only sum type; every path of the executor ends in success or in + exactly one constructor. "Loud by default" is totality of that function. + +Read on: link:Formal-Model[Formal model] → link:Trust-and-Freshness[Trust and freshness] → link:Proof-Plan[Proof plan]. diff --git a/docs/wikis/Troubleshooting.adoc b/docs/wikis/Troubleshooting.adoc new file mode 100644 index 00000000..9097869d --- /dev/null +++ b/docs/wikis/Troubleshooting.adoc @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Troubleshooting + +[NOTE] +==== +*Planned (Phase 1).* The Rust launcher and published capsules do not exist yet. Commands on this page describe the +agreed interface (ADRs in `docs/decisions/`). The Linux prototype in `scripts/proto/idris2x.sh` implements the same +surface today for experiments. +==== + +== Read the error; it was written for you + +Every failure looks like this: + +[source,text] +---- +idris2x: E-HASH-MISMATCH: capsule bytes do not match the lock: got sha256:3f…, expected sha256:0d… + fix: idris2x gc && idris2x install --locked + see: https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-HASH-MISMATCH.adoc +---- + +* The *ID* is stable across versions and searchable. +* The *fix* line is a command you can paste. +* The *runbook* explains causes and triage. Full list: link:Error-Reference[Error reference]. + +== Gather facts in one command + +[source,bash] +---- +idris2x doctor --json > doctor.json # platform, libc, store state, mirrors, probes; no secrets, no telemetry +---- + +== Common situations + +[cols="1,2",options="header"] +|=== +| Symptom | What to do +| Programs compiled earlier stopped running after `gc` | They embed the removed capsule's path; recompile, or use `--cg refc` for long-lived binaries. +| Compiled programs fail when the cache path contains spaces | The kernel splits shebang lines at spaces; set `IDRIS2X_CACHE` to a path without spaces. The launcher itself works. +| Build fails for a project in a directory with non-ASCII characters | Upstream Idris 2 0.8.0 bug in the Chez backend; move the project or wait for the upstream fix. +| `E-GLIBC-FLOOR` on an old distribution | The host libc is older than the capsule supports (glibc 2.28); upgrade or use a container. +|=== + +Still stuck: open an issue with the *idris2x printed an error* form; it asks for exactly what is needed. diff --git a/docs/wikis/Trust-and-Freshness.adoc b/docs/wikis/Trust-and-Freshness.adoc new file mode 100644 index 00000000..8bf4af24 --- /dev/null +++ b/docs/wikis/Trust-and-Freshness.adoc @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Trust and freshness + +The channel uses a deliberately small subset of The Update Framework's threat model ("TUF-lite"). + +[cols="2,2,3",options="header"] +|=== +| Attack (TUF §1.5.2) | Covered by | Residual +| Arbitrary software | Ed25519 signature + per-capsule sha256 | Root key compromise (rotation list planned) +| Rollback | Monotonic `channel_version` recorded in the lock | A *fresh* client with no lock accepts any manifest still inside its expiry window +| Indefinite freeze | `expires` on every manifest | A frozen-but-unexpired manifest is accepted until it expires +| Mix-and-match | One manifest covers every target and version | none known +| Endless data | Sizes in the manifest and lock | none known +| Fast-forward / key compromise | Not yet | Two-tier keys (offline root signs a rotatable channel key list), Phase 2 +|=== + +The design choice that makes this small model sufficient: *execution never consults the channel*. Freshness matters only when you +choose a new version; once chosen, integrity is a digest, which needs no freshness at all. diff --git a/docs/wikis/Uninstall.adoc b/docs/wikis/Uninstall.adoc new file mode 100644 index 00000000..de5886d4 --- /dev/null +++ b/docs/wikis/Uninstall.adoc @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + += Uninstall + +[NOTE] +==== +*Planned (Phase 1).* The Rust launcher and published capsules do not exist yet. Commands on this page describe the +agreed interface (ADRs in `docs/decisions/`). The Linux prototype in `scripts/proto/idris2x.sh` implements the same +surface today for experiments. +==== + +idris2x keeps everything it owns in two places, so removal is complete and checkable. + +== Remove capsules only (keep the launcher) + +[source,bash] +---- +idris2x gc --keep-last 0 # removes every capsule +idris2x gc --keep-last 3 # or keep the three most recently used +---- + +`gc` removes incomplete installs and staging debris first. It warns before deleting a capsule that programs you compiled with +`--cg chez` may still reference: such programs embed `#!/bin/scheme --program` and stop working once that capsule is gone. +Recompile them, or build long-lived artifacts with `--cg refc`. + +== Remove everything + +[source,bash] +---- +rm -rf "${XDG_CACHE_HOME:-$HOME/.cache}/idris2x" # all capsules, manifests, locks, staging +rm "$(command -v idris2x)" # the launcher (or uninstall it with the tool that installed it) +---- + +That is all: idris2x writes no files elsewhere, sets no shell profile entries, installs no services and sends no telemetry. +Your projects' `idris2x.toml` and `idris2x.lock` remain yours to keep or delete. + +== Check nothing is left + +[source,bash] +---- +ls "${XDG_CACHE_HOME:-$HOME/.cache}/idris2x" 2>/dev/null || echo "idris2x cache: gone" +command -v idris2x || echo "idris2x binary: gone" +---- diff --git a/docs/wikis/_Footer.adoc b/docs/wikis/_Footer.adoc new file mode 100644 index 00000000..a8a8de60 --- /dev/null +++ b/docs/wikis/_Footer.adoc @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + +Generated from `docs/wikis/` in https://github.com/metadatastician/idris2x[metadatastician/idris2x]. Edits here are overwritten; open a pull request instead. Docs: CC-BY-SA-4.0. diff --git a/docs/wikis/_Sidebar.adoc b/docs/wikis/_Sidebar.adoc new file mode 100644 index 00000000..4f87c806 --- /dev/null +++ b/docs/wikis/_Sidebar.adoc @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Source of the GitHub wiki page. Edit here; scripts/sync-wiki.sh publishes on merge to main. + +*link:Home[Home]* + +*Users* + +* link:Getting-Started[Getting started] +* link:Install[Install] +* link:Uninstall[Uninstall] +* link:Daily-Use[Pinning and upgrading] +* link:CI-Usage[Using in CI] +* link:Offline-and-Air-Gapped[Offline and air-gapped] +* link:Troubleshooting[Troubleshooting] +* link:Error-Reference[Error reference] +* link:FAQ[FAQ] + +*Platform maintainers* + +* link:Platform-Overview[Overview] +* link:Supported-Platforms[Supported platforms] +* link:Self-Hosted-Channel[Self-hosted channel] +* link:Mirrors-and-Caching[Mirrors and caching] +* link:CI-Fleet-Operations[CI fleet operations] +* link:Security-Model[Security model] +* link:Capsule-Lifecycle[Capsule lifecycle] + +*Developers* + +* link:Contributing-Guide[Contributing guide] +* link:Architecture[Architecture] +* link:Prototype-and-Chaos-Suite[Prototype and chaos suite] +* link:Error-Taxonomy-Workflow[Error taxonomy workflow] +* link:Capsule-Factory[Capsule factory] +* link:Release-and-Signing[Release and signing] +* link:Maintenance-Loop[Maintenance loop] + +*Theorists* + +* link:Theory-Overview[Overview] +* link:Formal-Model[Formal model] +* link:Trust-and-Freshness[Trust and freshness] +* link:Proof-Plan[Proof plan] +* link:Reproducibility-for-Research[Reproducibility for research] +* link:Glossary[Glossary] diff --git a/examples/fixture_server.rs b/examples/fixture_server.rs new file mode 100644 index 00000000..b9b031a3 --- /dev/null +++ b/examples/fixture_server.rs @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: MPL-2.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// +// fixture_server — static file server for the chaos drills (std only, no crates). +// Honours `Range: bytes=a-b` with 206 so the resume drill takes the same path GitHub +// Releases and R2 take. One line per request on stdout: " ". +// Usage: cargo run --quiet --example fixture_server -- +use std::fs::File; +use std::io::{BufRead, BufReader, Read, Seek, SeekFrom, Write}; +use std::net::{TcpListener, TcpStream}; +use std::path::{Component, Path, PathBuf}; +use std::{env, thread}; + +fn resolve(root: &Path, url: &str) -> Option { + let path = url.split('?').next()?.trim_start_matches('/'); + let rel = Path::new(path); + if rel.components().any(|c| !matches!(c, Component::Normal(_))) { + return None; // no '..', no absolute paths + } + Some(root.join(rel)) +} + +fn parse_range(h: &str, size: u64) -> Option<(u64, u64)> { + let spec = h.trim().strip_prefix("bytes=")?; + let (a, b) = spec.split_once('-')?; + match (a.is_empty(), b.is_empty()) { + (false, true) => Some((a.parse().ok()?, size.checked_sub(1)?)), + (false, false) => Some(( + a.parse().ok()?, + b.parse::().ok()?.min(size.checked_sub(1)?), + )), + (true, false) => { + let n: u64 = b.parse().ok()?; + Some((size.saturating_sub(n), size.checked_sub(1)?)) + } + (true, true) => None, + } +} + +fn serve(mut s: TcpStream, root: PathBuf) -> std::io::Result<()> { + let mut rd = BufReader::new(s.try_clone()?); + let mut line = String::new(); + rd.read_line(&mut line)?; + let mut parts = line.split_whitespace(); + let (method, url) = ( + parts.next().unwrap_or(""), + parts.next().unwrap_or("/").to_string(), + ); + let mut range = None; + loop { + let mut h = String::new(); + if rd.read_line(&mut h)? == 0 || h == "\r\n" || h == "\n" { + break; + } + if let Some((k, v)) = h.split_once(':') { + if k.eq_ignore_ascii_case("range") { + range = Some(v.trim().to_string()); + } + } + } + let reply = |s: &mut TcpStream, code: &str| -> std::io::Result<()> { + println!("{} {}", &code[..3], url); + write!( + s, + "HTTP/1.1 {code}\r\nContent-Length: 0\r\nConnection: close\r\n\r\n" + ) + }; + let Some(path) = resolve(&root, &url) else { + return reply(&mut s, "403 Forbidden"); + }; + let Ok(mut f) = File::open(&path) else { + return reply(&mut s, "404 Not Found"); + }; + let size = f.metadata()?.len(); + if !f.metadata()?.is_file() { + return reply(&mut s, "404 Not Found"); + } + let (status, start, end) = match range.as_deref().map(|r| parse_range(r, size)) { + Some(Some((a, b))) if a <= b && a < size => ("206 Partial Content", a, b), + Some(_) if size > 0 => { + println!("416 {url}"); + return write!(s, "HTTP/1.1 416 Range Not Satisfiable\r\nContent-Range: bytes */{size}\r\nContent-Length: 0\r\nConnection: close\r\n\r\n"); + } + _ => ("200 OK", 0, size.saturating_sub(1)), + }; + let len = if size == 0 { 0 } else { end - start + 1 }; + println!("{} {}", &status[..3], url); + write!(s, "HTTP/1.1 {status}\r\nContent-Type: application/octet-stream\r\nAccept-Ranges: bytes\r\nContent-Length: {len}\r\n")?; + if status.starts_with("206") { + write!(s, "Content-Range: bytes {start}-{end}/{size}\r\n")?; + } + write!(s, "Connection: close\r\n\r\n")?; + if method != "HEAD" { + f.seek(SeekFrom::Start(start))?; + std::io::copy(&mut f.take(len), &mut s)?; + } + s.flush() +} + +fn main() { + let args: Vec = env::args().collect(); + let root = PathBuf::from(args.get(1).map(String::as_str).unwrap_or(".")); + let port = args.get(2).map(String::as_str).unwrap_or("8099"); + let l = TcpListener::bind(format!("127.0.0.1:{port}")).expect("bind"); + println!("listening 127.0.0.1 {port}"); + for s in l.incoming().flatten() { + let r = root.clone(); + thread::spawn(move || { + let _ = serve(s, r); + }); + } +} diff --git a/examples/idris2x.lock b/examples/idris2x.lock new file mode 100644 index 00000000..da119cc9 --- /dev/null +++ b/examples/idris2x.lock @@ -0,0 +1,22 @@ +{ + "schema": 1, + "toolchain": { + "idris2": "0.8.0", + "chez": "10.4.1" + }, + "channel": { + "version": 1, + "url": "https://github.com/metadatastician/idris2x/releases/download/channel/v1.json" + }, + "capsules": { + "x86_64-unknown-linux-gnu": { + "sha256": "0dc9ae684a74ba9ed3fd0b40174e8f24daea268fddde9845a0135c0d4bee6094", + "size": 35374302, + "urls": [ + "https://github.com/metadatastician/idris2x/releases/download/capsules-2026.11/idris2-0.8.0-x86_64-unknown-linux-gnu-chez10.4.1.tar.gz", + "https://capsules.idris2x.example/idris2-0.8.0-x86_64-unknown-linux-gnu-chez10.4.1.tar.gz" + ], + "min_glibc": "2.38" + } + } +} diff --git a/examples/idris2x.lock.license b/examples/idris2x.lock.license new file mode 100644 index 00000000..b535de68 --- /dev/null +++ b/examples/idris2x.lock.license @@ -0,0 +1,2 @@ +SPDX-License-Identifier: MPL-2.0 +SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell diff --git a/examples/idris2x.toml b/examples/idris2x.toml new file mode 100644 index 00000000..8a76b17b --- /dev/null +++ b/examples/idris2x.toml @@ -0,0 +1,10 @@ +# idris2x.toml — the only file humans edit. Everything else is derived (idris2x.lock) or data (the channel). +# Resolution order: CLI flag → IDRIS2X_VERSION → this file → *.ipkg hint → idris2x.lock (no network in resolve). +[toolchain] +idris2 = "0.8.0" # the only required key; chez version comes from the channel's compat table + +# [overlay] # Phase 2: content-addressed micropatches, verified like capsules +# patches = ["sha256:...:fix-example.overlay"] + +# [channel] # self-hosted channel (company mirror); defaults to the embedded URL list +# url = "https://capsules.example.org/v1.json" diff --git a/rsr-template-repo_chora.deed b/idris2x_chora.deed similarity index 85% rename from rsr-template-repo_chora.deed rename to idris2x_chora.deed index c88f77ff..000b1258 100644 --- a/rsr-template-repo_chora.deed +++ b/idris2x_chora.deed @@ -1,6 +1,6 @@ ;; SPDX-License-Identifier: MPL-2.0 ; -; The repo deed of rsr-template-repo: one-deed-per-repo doctrine (standards#837, +; The repo deed of idris2x: one-deed-per-repo doctrine (standards#837, ; owner ruling 2026-09-19, Option A). Folds the former ply manifest tree ; (82 per-directory manifests) and the family-7 AI allocation manifest ; into deed clauses. @@ -16,9 +16,9 @@ ; field; scripts/deed-clause.sh is the one writer. (repo-deed :schema-version "1.0.0" - :canonical-name "rsr-template-repo" + :canonical-name "idris2x" :beholding-chora #uuid"0889b37b-defb-831f-973c-e119500db00e" - :repo-uuid #uuid"8e515699-3fb9-8785-8883-ef2a100c2e02" + :repo-uuid #uuid"77688e35-8b7e-875f-870f-858748238496" ; The canon pin: which release of hyperpolymath/standards canon.lock this ; repo implements. It is the ONLY canon pin in this deed (deed_canon ; refuses zero or two); the (rsr-profile) clause below declares @@ -42,39 +42,70 @@ ; ORDER, not a rejected change: land the spine's adoption first, then the ; canon change is a one-line bump. :order "spine-adopts-then-canon-releases") - ; >>> repo-identity (repo-init replaces this block at mint) - ; The template's OWN identity. `just repo-init` swaps everything between - ; these two markers for build/templates/identity.deed.in, filled for the - ; new repo. Before that swap existed every minted repo inherited this - ; block's uuid and canonical-name and told arriving agents it WAS the - ; template (corrected in chronicles-of-slavia and scaffoldia 2026-07-16). - ; The header :repo-uuid is the template's chora id: the ADR-008 profile C - ; UUIDv8 of its birth path github.com/hyperpolymath/rsr-template-repo in the - ; domain gv-clade-index, minted once and carried opaquely (standards A1 V8, - ; A7 J11). Nothing re-derives it. repo-init writes each child its own. - ; Identity, clade, forges, lineage, status: mapping clade-to-repo-deed. + ; >>> repo-identity + ; Written by `just repo-init` from build/templates/identity.deed.in, in + ; place of the block the template repo ships (template issue #209). It replaces + ; descriptiles/CLADE.a2ml and ECOSYSTEM.a2ml; the mapping is standards + ; 1-formats/deed/mappings/clade-to-repo-deed.adoc and + ; meta-ecosystem-to-repo-deed.adoc. + ; + ; THE ID IS MINTED ONCE, NOT INVENTED. The header :repo-uuid is this repo's + ; chora id: the ADR-008 profile C UUIDv8 of its birth path in the domain + ; chora-registry (standards A1 rules U1 to U4, V8 and V9, A7 J11): + ; bash scripts/uuid-v8.sh chora-registry "github.com/metadatastician/idris2x" + ; repo-init wrote it at mint. It is carried opaquely and never re-derived: + ; a transfer or rename does not change it. Do not edit it. + ; + ; THE ID IS THE CHORA, NOT THE CLADE (standards A1, ruling W10). The deed + ; header's :repo-uuid is the repo's id. A clade placement is an OPTIONAL + ; identity fact (where the repo sits), never the id and never an edict; + ; chora-registry is authoritative for it. No check requires one, and no name + ; prefix is required. When you do + ; choose one, add a clause beside (identity), for example + ; (clade :primary gm :primary-name "Games & Interactive" :secondary () + ; :assigned "YYYY-MM-DD" :rationale "why") + ; and `just validate-rsr` then checks that the code is one of the 12 and + ; agrees with its name. The 12, read off the RIGHT-HAND column, never off + ; the repository name (two real mis-choices read `pt` and `gv` as letters of + ; the slug): + ; fv Formal Verification & Proofs provable correctness, dependent types, theorem proving + ; nl Nextgen Languages compilers, runtimes, language tooling + ; rm Repo Management & Tooling scaffolding, graph analysis, bots, templates + ; gv Governance & Standards licensing, compliance, policy enforcement + ; db Databases database engines, query languages, storage + ; ap Applications end-user apps, web, desktop, services + ; ix Infrastructure & Cloud containers, deployment, sysadmin + ; dx Developer Ecosystem dev tools, package managers, editors, bindings + ; pt Protocols & Interop internet standards, protocol implementations + ; ax AI & Neurosymbolic ML, neural proof synthesis, AI governance + ; gm Games & Interactive game engines, interactive experiences + ; sc Security scanning, vulnerability management, access control + ; The primary clade reflects the project's core value proposition, not its + ; implementation: a game written in Idris2 is `gm`. + ; + ; REGISTRATION IS NOT DERIVATION. Registering means an entry in the + ; chora-registry (formerly gv-clade-index) seed. It is outward-facing + ; and it is the OWNER's act; an agent must not do it. (identity :primary-forge github - :owner "hyperpolymath" - :prefixed-name "rm-rsr-template-repo") - (clade - :primary rm - :primary-name "Repo Management & Tooling" - :secondary () - :assigned "2026-03-16" - :rationale "Repo Management & Tooling (`rm`): the core value proposition is scaffolding repositories — CI/CD, AI manifests, ABI/FFI seams, governance — that other projects are instantiated from. `gv` was previously claimed as a secondary and is dropped: the template SHIPS governance files, but shipping them is not being a governance project. That authority lives in `standards` and `metadatastician-governance`. The inherited [\"gv\"] propagated into every repo created from this template, where it was even less meant.") + :owner "metadatastician") (forges - :github "hyperpolymath/rsr-template-repo" - :gitlab "hyperpolymath/rsr-template-repo" - :bitbucket "hyperpolymath/rsr-template-repo") + :github "metadatastician/idris2x") + ; :type is one of standalone monorepo monorepo-child inflated deflated hub + ; satellite. A hub COORDINATES an ecosystem family; a satellite is + ; coordinated by one and keeps :parent "" (parent names a monorepo parent, + ; never the coordinating hub). (lineage :type standalone :parent "" - :born "2026-03-16" - :previous-names ()) + :born "2026-11-16" + :previous-names () + :instantiated-from "rsr-template-repo") + ; :phase is one of reserved incubating active dormant merged superseded + ; archived extinct. A repo created today has not proven anything yet. (status - :phase active - :since "2026-03-16" + :phase incubating + :since "2026-11-16" :present #t :aliases () :merged-into "" @@ -82,33 +113,25 @@ :successors () :ended "" (history - (entry :phase active :since "2026-03-16" :note "the estate's canonical repository template; in production use"))) - ; Maturity has its own clause (owner decision 2026-10-02; standards - ; 1-formats/deed/vocabulary/maturity.adoc). No :since: the date the - ; template reached production was never recorded. Milestones, next actions - ; and blockers live in docs/status/ROADMAP.adoc. + (entry :phase incubating :since "2026-11-16" :note "created from rsr-template-repo; not yet registered"))) + ; :level is one of experimental alpha beta production lts (standards + ; 1-formats/deed/vocabulary/maturity.adoc). (maturity - :level production) - ; Ecosystem: mapping meta-ecosystem-to-repo-deed. + :level experimental + :since "2026-11-16") + ; Fill in what this repo IS and IS NOT, and the repos it relates to. + ; :relationship is one of standard-source build-tooling validation-tooling + ; signing-tooling verification-tooling minted-from registry. (ecosystem - :project "rsr-template-repo" - :ecosystem "hyperpolymath" - :position-type "repository-template" - :purpose "Canonical RSR-compliant repository template: scaffolding (CI/CD, AI manifests, ABI/FFI standards, container ecosystem, governance) that new hyperpolymath projects are instantiated from." - :not ("a project in its own right" - "Scaffoldia (the full-featured repo designer)" - "standards (the canon source this template operationalises)") - :pipeline-position "foundation" - :chain "standards → rsr-template-repo → (every estate repo)" - :pipeline-notes "rsr-template-repo turns the RSR standard into runnable scaffolding. New repos are created from it via `just repo-init`, which substitutes the {{PLACEHOLDER}} tokens." + :project "idris2x" + :ecosystem "metadatastician" + :position-type "tool" + :purpose "Materialize an exact, verified Idris 2 + Chez Scheme toolchain capsule from a lockfile and run it: signed data channel, content-addressed store, typed loud failures, offline and air-gap paths; built to keep working after its maintainer stops" + :not ("an Idris 2 package manager (that is pack)" "a fork or rebuild-with-patches of Idris 2 or Chez Scheme" "a global default-version manager" "official Idris 2 or Chez Scheme distribution" "telemetry of any kind") + :pipeline-position "toolchain-provider" + :chain "idris-lang/Idris2 + cisco/ChezScheme (upstream source) -> idris2x factory (capsules) -> idris2x launcher -> estate repos (proof and ABI work, mathesis receipts)" :coordination standards - (related :name "standards" :relationship standard-source :notes "Defines the RSR standard, contractile canon, and policies that this template operationalises.") - (related :name "stapeln" :relationship build-tooling :notes "Layer-based container build system; the template ships stapeln.toml scaffolding.") - (related :name "selur-compose" :relationship build-tooling :notes "Service composition; the template ships selur-compose.toml scaffolding.") - (related :name "k9-svc" :relationship validation-tooling :notes "Runs the self-validating k9.ncl checks (.machine_readable/self-validating/).") - (related :name "cerro-torre" :relationship signing-tooling :notes "Container/image signing provider referenced by the container scaffolding.") - (related :name "svalinn" :relationship verification-tooling :notes "Supply-chain verification referenced by the container scaffolding.") - (related :name "vordr" :relationship verification-tooling :notes "Build/artifact verification referenced by the container scaffolding.")) + (related :name "rsr-template-repo" :relationship minted-from :notes "the template this repo was minted from by just repo-init")) ; <<< repo-identity ; Documents that other documents link to by identifier, not by path. ; Template-level convention awaiting canonisation in metadatastician/standards @@ -124,7 +147,7 @@ ; entry is :removed-at-mint #t, and that no tracked page links to a missing file. (documents (document - :id #u8"repo-document:github.com/hyperpolymath/rsr-template-repo#placeholders" + :id #u8"repo-document:github.com/metadatastician/idris2x#placeholders" :role placeholders :path ".machine_readable/ai/PLACEHOLDERS.adoc" :removed-at-mint #t @@ -192,9 +215,9 @@ (methodology :instructions-clause "bot-directives" :default-mode hybrid)) (manifest :version "0.1.0" - :last-updated "{{CURRENT_DATE}}" - :project "[YOUR-REPO-NAME]" - :purpose "Canonical RSR (Rhodium Standard Repository) template — governance, CI/CD, machine-readable metadata, ABI/FFI seam and formal-verification scaffolding that hyperpolymath projects are instantiated from." + :last-updated "2026-11-16" + :project "idris2x" + :purpose "Hermetic, lockfile-pinned toolchain materializer for Idris 2 + Chez Scheme: signed, self-testing capsules and a tiny launcher designed to survive abandonment." (agent :name CLAUDE :role "proofs, compilers, repo-local implementation, CI/CD, formal verification, Rust/Idris2/Zig") (agent :name CHATGPT :role "prose, papers, publication review, standards docs, outreach drafts, letters") (agent :name GEMINI :role "estate audits, cross-repo sweeps, long-context triage, pattern detection") @@ -208,8 +231,8 @@ (ply (directory :ply 1 :path ".github") (directory :id "machine-readable-pillar" :ply 1 :path ".machine_readable" :description "Registry for all machine-readable metadata, policies, and internal\nautomation scripts." - (canonical-locations :ai_configs "ai/" :anchor "rsr-template-repo_chora.deed (anchor)" :compliance "compliance/" :neurosym "rsr-template-repo_chora.deed (neurosym)" :playbook "rsr-template-repo_chora.deed (playbook)" :policies "rsr-template-repo_chora.deed (policies)" :scripts "scripts/") - :invariants ("Repo metadata MUST live in the repo deed (rsr-template-repo_chora.deed) and follow the DEED grammar" "Internal automation MUST live in scripts/ subfolder") + (canonical-locations :ai_configs "ai/" :anchor "idris2x_chora.deed (anchor)" :compliance "compliance/" :neurosym "idris2x_chora.deed (neurosym)" :playbook "idris2x_chora.deed (playbook)" :policies "idris2x_chora.deed (policies)" :scripts "scripts/") + :invariants ("Repo metadata MUST live in the repo deed (idris2x_chora.deed) and follow the DEED grammar" "Internal automation MUST live in scripts/ subfolder") (directory :id "ai-registry" :ply 2 :path ".machine_readable/ai" :description "Sub-registry for ai metadata.") (directory :id "configs-registry" :ply 2 :path ".machine_readable/configs" :description "Sub-registry for configs metadata.") (directory :ply 0 :path ".machine_readable/descriptiles" :description "This manifest declares the AI-assistant context for the descriptiles machine-readable metadata directory." @@ -333,7 +356,7 @@ ; and the golden path. The CLAUDE.md arrival pack reads anchor/golden-path and hashes this clause (ANCHOR@…). (anchor :schema "hyperpolymath.anchor/1" - :repo "{{OWNER}}/{{REPO}}" + :repo "metadatastician/idris2x" :authority "upstream-canonical" :purpose ( "Define canonical semantics and policy boundaries for this repository." @@ -342,13 +365,13 @@ ) (metadata :version "1.0.0" - :last-updated "{{CURRENT_DATE}}") + :last-updated "2026-11-16") (identity - :project "{{PROJECT_NAME}}" + :project "idris2x" ; language | library | service | tool - :kind "{{PROJECT_KIND}}" - :one-sentence "{{PROJECT_PURPOSE}}" - :domain "{{PROJECT_DOMAIN}}") + :kind "cli" + :one-sentence "Hermetic, lockfile-pinned toolchain materializer for Idris 2 + Chez Scheme: signed, self-testing capsules and a tiny launcher designed to survive abandonment" + :domain "rust") (semantic-authority :policy "canonical" :owns ( @@ -503,7 +526,7 @@ (methodology (metadata :version "1.0.0" - :last-updated "{{CURRENT_DATE}}" + :last-updated "2026-11-16" :spec "https://github.com/hyperpolymath/standards/blob/main/1-formats/a2ml/agentic/docs/ADR-002-methodology-layer.adoc") ; ============================================================================ ; MODE SELECTION @@ -547,7 +570,7 @@ ; What makes this project special. Agents should DEEPEN this, not broaden it. ; Customise this per project — the template default is generic. (unique-strength - :description "{{PROJECT_UNIQUE_STRENGTH}}" + :description "Abandonment-safe toolchain distribution: execution needs only a lockfile and capsule bytes, maintenance is approving signed data patches, and every failure is a typed error with a runbook" :deepen-not-broaden #t) ; ============================================================================ ; DIVERGENT INVARIANTS @@ -586,7 +609,7 @@ ; These rules detect corrupt/template/stale state files. (state-validation ; A regex, not a literal list. The list form named the exact strings it was - ; meant to catch ("{{PROJECT}}"), so `just repo-init` substituted the detector along + ; meant to catch ("IDRIS2X"), so `just repo-init` substituted the detector along ; with everything else and shipped reject-if-contains = ["MY_PROJECT", ...] — ; a guard against unfilled tokens that had been eaten by the filling. The ; escaped pattern below contains no token for init to match, and covers every @@ -605,7 +628,7 @@ (coverage (metadata :version "1.0.0" - :last-updated "{{CURRENT_DATE}}") + :last-updated "2026-11-16") ; ============================================================================ ; COVERAGE STATE ; ============================================================================ @@ -623,7 +646,7 @@ (debt (metadata :version "1.0.0" - :last-updated "{{CURRENT_DATE}}")) + :last-updated "2026-11-16")) ; rra — directives for Robot Repo Automaton (RRA) enforcing the Platonic Ideal root. (rra :target "robot-repo-automaton" @@ -638,7 +661,7 @@ ; The pattern ".*" allows hidden dotfiles implicitly; RRA checks specific ; dotfile rules below. (allow-list - :files ("README.adoc" "CHANGELOG.adoc" "Justfile" "LICENSE" "rsr-template-repo_chora.deed" "CITATION.cff" "CLAUDE.md") + :files ("README.adoc" "CHANGELOG.adoc" "Justfile" "LICENSE" "idris2x_chora.deed" "CITATION.cff" "CLAUDE.md") :patterns (".*")) ; Relocation rules: move heavy prose out of the root (relocations @@ -736,8 +759,8 @@ ; See: https://github.com/hyperpolymath/standards/tree/main/groove-protocol (groove :version "1.0" - ; Service identity — replace {{REPO}} with your project name - :service "{{REPO}}" + ; Service identity — replace idris2x with your project name + :service "idris2x" :service-version "0.1.0" ; Primary port — MUST be unique across the ecosystem. Check PORT-REGISTRY.md ; in the standards repo before assigning: @@ -766,7 +789,7 @@ (maintenance-axes (metadata :version "1.0.0" - :last-updated "{{CURRENT_DATE}}" + :last-updated "2026-11-16" :scope "repo") (discovery :human-entrypoints ( @@ -1041,71 +1064,13 @@ "Axis 2 type governs commit categorisation" "Axis 3 focus governs audit depth"))) ; rsr-profile — this repo's declared RSR v2.0 capabilities. - ; It carries no canon pin: the (canon) clause above is the pin, exactly once. - ; - ; It declares which capabilities this repo has, - ; per 0-canon/TEMPLATE-APPLICABILITY-POLICY.adoc; the RSR v2.0 conformance oracle - ; (hypatia Hypatia.Rules.RsrConformance) uses `capabilities` to compute the - ; APPLICABLE criteria set — a gated criterion is scored only when its gating - ; capability appears below; everything else is `na` and excluded from the - ; denominator. - ; - ; rsr-template-repo is deliberately MAXIMAL: it ships scaffolding for FFI/ABI - ; seams, in-tree formal proofs, a container, a reproducible build, benchmarks, - ; a docs site, and the full governance trio — so a repo scaffolded FROM it can - ; adopt any of them. Its declared set is therefore near-total, which is exactly - ; what makes it the dogfood target (the gate requires Gold on the applicable - ; set). Every capability below is grounded in a file/dir that actually exists - ; in this tree; capabilities it does NOT have (rust, affinescript, mobile, - ; web-ui, api-service, published-package) are omitted so the oracle does not - ; score this repo against modules it does not carry. + ; Written by just repo-init on 2026-11-16. The template's maximal + ; profile was replaced at mint: declare only what this tree carries. (rsr-profile :version "1.0.0" :spec "rsr-criteria-v2" :declares-against "2.1.1-draft" - ; Role in the estate pipeline: standards (canon) -> THIS (spine) -> scaffoldia - ; (composer) -> minted repos. A spine may carry capability-gated modules it - ; does not declare, for the repos minted from it; see [carrier] in the canon - ; gates table. A minted repo doing the same is still drift. - :role "spine" - ; Effective capability set (direct declaration; no preset shorthand used). - :capabilities ( - ; src/interface/ffi/build.zig + Zig FFI layer - "zig" - ; src/interface/abi.ipkg + src/interface/Abi/ (dependent-typed ABI) - "idris2" - ; scripts/*.sh automation - "bash" - ; src/ command-line entry scaffolding - "cli" - ; consumed/published as a library surface - "library" - ; C-ABI FFI seam (Zig), src/interface/ffi/ - "ffi" - ; formally specified ABI: src/interface/abi.ipkg + src/interface/Abi/ proofs - "abi" - ; verification/proofs/ (in-tree mechanised proofs) - "formal-proofs" - ; .github/workflows/pages.yml (casket/Pages) - "docs-site" - ; build/container/ + .devcontainer/Containerfile - "container" - ; build/guix.scm - "reproducible-build" - ; benches/ - "benchmarks" - ; full AUDIT/AFFIRMATION/GOVERNANCE/MAINTAINERS trio - "governance-tier" - ) - (notes - ; Capabilities intentionally NOT declared (no corresponding code in tree): - ; rust — no *.rs / Cargo.toml (the FFI/ABI layer is Zig + Idris2) - ; affinescript — no *.affine - ; mobile — no Tauri/Dioxus app - ; web-ui — no browser UI - ; api-service — not a network daemon - ; published-package — a scaffold template, not itself a registry artifact - :omitted-rationale "Declaring a capability this repo lacks would make the oracle score it against a module it does not carry — the over-scaffolding failure v2.0 fixes. See 0-canon/TEMPLATE-APPLICABILITY-POLICY.adoc.")) + :preset "rust-cli") ; Egress attestation (standards ADR-009; grammar ; 1-formats/deed/spec/abnf/clauses/egress.abnf). Every job that reads a real ; secret (anything but GITHUB_TOKEN) is listed with exactly the secrets it @@ -1137,4 +1102,78 @@ :endpoints ("secret:BOJ_SERVER_URL" "var:BOJ_SERVER_URL") :enforcement none :reason "Notifies the BoJ server of a push. The URL is the secret when set, else the variable that also gates the job.")) + ; variant — provenance contract (ADR-0002 shape; ADR-0003 use). + ; Records what this repo was minted from, for re-templating tooling and + ; the drift gate. For a minted repo the gate replays the mint from + ; (provenance) and (mint-answers) and diffs this tree against the + ; replay (scripts/check-mint-drift.sh), so only edits made after the + ; mint count. Declare those in (paths) below; the derived files are + ; declared already, since their own gates keep them fresh. + (variant + :project "idris2x" + :schema-version "0.1.0" + :last-updated "2026-11-16" + :parent "hyperpolymath/rsr-template-repo" + ; template tip at mint + :parent-pin "0044ad92f9e6ef258b89f3e9b5ee7b748a4db2d2" + :role "minted-repo" + :stack "rust-cli" + :direction "generated-from-core" + (normalise :rules "action-pins self-name") + ; Files a minted repo owns from birth are (paths :diverged …). + (paths + :added () + :removed ("archetypes/" "build/docs-seed/" "build/templates/" "build/container/" "src/interface/" "rsr-template-repo_chora.deed") + :diverged ("idris2x_chora.deed" "docs/status/ROADMAP.adoc" "CLAUDE.md" "docs/architecture/REPOSITORY-MAP.adoc"))) + ; provenance — what this repo was minted FROM. Written once, at mint, + ; by build/just/repo-init.just. Tools that want "what is this repo" read + ; the rest of the deed; tools that want "where did it come from" read this. + (provenance + :minted-at "2026-11-16" + :template-repo "hyperpolymath/rsr-template-repo" + :template-branch "main" + :template-commit "0044ad92f9e6ef258b89f3e9b5ee7b748a4db2d2" + :template-tree "44f68bd298a228252e0e84d7f019b3710b5705e2" + ; Contract: branches this repo is EXPECTED to carry beyond the default. + ; Empty means default-only. A mint must never inherit template work + ; branches (coderabbit/, chore/, bot-task or stale branches) — that is + ; how knot-knot received a byte-identical copy of a template work branch + ; with no common ancestor (#203). Enforced by + ; scripts/check-template-conformance.sh. + :extra-branches () + :canon-version "2.1.5" + :criteria-sha256 "6a5aa8857bd0d0d58ef48827938ca17c251b6b854dacf59d306388d61694d82a" + :gates-sha256 "5c510bba025be718deebb12d0333bfe7db2da43c66578b728b1a334df65290b1" + :archetype "rust-cli" + ; Which minting path actually ran (#201/#203 needed this signal). + :minted-by "repo-init" + :mint-mode "non-interactive" + ; A non-empty :unassigned list means the mint did not fully render; + ; the validation step below already fails on a leftover token. + (substitutions :rendered 34 :unassigned ())) + ; mint-answers — what just repo-init was answered on 2026-11-16. + ; Read by scripts/check-mint-drift.sh to replay the mint. Every value + ; here already appears in this repo's rendered files. + (mint-answers + :project-name "idris2x" + :repo "idris2x" + :owner "metadatastician" + :author "Jonathan D.A. Jewell" + :author-email "j.d.a.jewell@open.ac.uk" + :author-org "hyperpolymath" + :author-email-alt "" + :author-orcid "" + :description "Hermetic, lockfile-pinned toolchain materializer for Idris 2 + Chez Scheme: signed, self-testing capsules and a tiny launcher designed to survive abandonment" + :forge "github.com" + :security-email "j.d.a.jewell@open.ac.uk" + :conduct-email "j.d.a.jewell@open.ac.uk" + :project-type "binary" + :website "https://github.com/metadatastician/idris2x" + :openssf-bp-id "" + :service-name "idris2x" + :port "8080" + :registry "ghcr.io/metadatastician" + :archetype "rust-cli" + :package-uuid "" + :mint-date "2026-11-16") ) diff --git a/launcher.sh b/launcher.sh index b1565cd4..0e4a4601 100755 --- a/launcher.sh +++ b/launcher.sh @@ -6,12 +6,12 @@ # ;; SPDX-License-Identifier: MPL-2.0 # (praxis-deed # :schema-version "1.0.0" -# :canonical-name "rsr-template-repo-launcher" +# :canonical-name "idris2x-launcher" # :beholding-chora #uuid"0889b37b-defb-831f-973c-e119500db00e" # (artefact :type "launcher" :version "0.1.0" # :generator "provision-set") -# (app :name "rsr-template-repo" :display "rsr-template-repo" -# :url "https://github.com/hyperpolymath/rsr-template-repo" :archetype "library") +# (app :name "idris2x" :display "idris2x" +# :url "https://github.com/metadatastician/idris2x" :archetype "library") # (compliance :standard-version "0.6.0" # :standards ("launcher-standard.adoc" # "PROVISIONING-STANDARD.adoc")) diff --git a/mise.lock b/mise.lock index 504562b2..77a8362d 100644 --- a/mise.lock +++ b/mise.lock @@ -124,34 +124,3 @@ url = "https://github.com/aquasecurity/trivy/releases/download/v0.74.0/trivy_0.7 url_api = "https://api.github.com/repos/aquasecurity/trivy/releases/assets/514339469" provenance = "cosign" -[[tools.zig]] -version = "0.16.0" -backend = "core:zig" - -[tools.zig."platforms.linux-arm64"] -checksum = "sha256:ea4b09bfb22ec6f6c6ceac57ab63efb6b46e17ab08d21f69f3a48b38e1534f17" -url = "https://ziglang.org/download/0.16.0/zig-aarch64-linux-0.16.0.tar.xz" - -[tools.zig."platforms.linux-arm64-musl"] -checksum = "sha256:ea4b09bfb22ec6f6c6ceac57ab63efb6b46e17ab08d21f69f3a48b38e1534f17" -url = "https://ziglang.org/download/0.16.0/zig-aarch64-linux-0.16.0.tar.xz" - -[tools.zig."platforms.linux-x64"] -checksum = "sha256:70e49664a74374b48b51e6f3fdfbf437f6395d42509050588bd49abe52ba3d00" -url = "https://ziglang.org/download/0.16.0/zig-x86_64-linux-0.16.0.tar.xz" - -[tools.zig."platforms.linux-x64-musl"] -checksum = "sha256:70e49664a74374b48b51e6f3fdfbf437f6395d42509050588bd49abe52ba3d00" -url = "https://ziglang.org/download/0.16.0/zig-x86_64-linux-0.16.0.tar.xz" - -[tools.zig."platforms.macos-arm64"] -checksum = "sha256:b23d70deaa879b5c2d486ed3316f7eaa53e84acf6fc9cc747de152450d401489" -url = "https://ziglang.org/download/0.16.0/zig-aarch64-macos-0.16.0.tar.xz" - -[tools.zig."platforms.macos-x64"] -checksum = "sha256:0387557ed1877bc6a2e1802c8391953baddba76081876301c522f52977b52ba7" -url = "https://ziglang.org/download/0.16.0/zig-x86_64-macos-0.16.0.tar.xz" - -[tools.zig."platforms.windows-x64"] -checksum = "sha256:68659eb5f1e4eb1437a722f1dd889c5a322c9954607f5edcf337bc3684a75a7e" -url = "https://ziglang.org/download/0.16.0/zig-x86_64-windows-0.16.0.zip" diff --git a/mise.toml b/mise.toml index 60c028e9..90565ca2 100644 --- a/mise.toml +++ b/mise.toml @@ -1,23 +1,25 @@ # SPDX-License-Identifier: MPL-2.0 # SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) # -# The toolchain for rsr-template-repo (idris2, zig). Specs are `latest`; mise.lock -# records the concrete version and per-platform checksum of each, so every -# checkout installs the same bits. Refresh both with: just toolchain-refresh +# The toolchain for this repository (rust). Rendered at mint by +# scripts/render-mise.sh from the languages the tree declares; the language→tool +# table is build/just/provision-lib.sh's, so this file and `just doctor` cannot +# disagree. Specs are `latest`; mise.lock records the concrete version and +# per-platform checksum of each. Refresh both with: just toolchain-refresh # Canon: hyperpolymath/standards 3-practice/provisioning (TRUST-DEFAULTS §toolchain). -# Estate policy: no python, node/npm/yarn, make or nix here. JavaScript runs Bun > Deno > -# pnpm from one package.json, so a repository with one pins all three (LANGUAGE-POLICY §1.4). +# Estate policy: no python, node/npm/yarn, make or nix here. JavaScript runs +# Bun > Deno > pnpm from one package.json (LANGUAGE-POLICY §1.4). # -# Idris2 is not a mise tool: it comes from pack (`just setup` says how). -# A repository created from this template gets this file re-minted for its own -# languages by `launch-scaffolder provision-set realign` (the deed's :repo differs). +# Hand-edited project tools belong below the table's end, never by replacing it: +# `scripts/check-mise-language.sh` fails when a tool matches no detected +# language, and when a detected language's tool is missing. [settings] lockfile = true [tools] just = "latest" -shellcheck = "latest" +shellcheck = "latest" # the shell scripts yq = "latest" # scripts/kyaml-format.sh (KYAML configs) +rust = "latest" trivy = "latest" # just deps-audit -zig = "latest" diff --git a/scripts/campaigns/repo-map-trim.campaign b/scripts/campaigns/repo-map-trim.campaign index 6298fdc5..ef311df9 100644 --- a/scripts/campaigns/repo-map-trim.campaign +++ b/scripts/campaigns/repo-map-trim.campaign @@ -24,6 +24,6 @@ # `just repo-map` in the same commit, which a campaign cannot do. [meta] name = chore/rsr-repo-map-trim -description = keep allowlist comments whole in the repository map (rsr-template-repo PR 316) +description = keep allowlist comments whole in the repository map (idris2x PR 316) [paths] scripts/gen-repo-map.sh diff --git a/scripts/campaigns/www-bundle.campaign b/scripts/campaigns/www-bundle.campaign index c1424cef..ed2a9c95 100644 --- a/scripts/campaigns/www-bundle.campaign +++ b/scripts/campaigns/www-bundle.campaign @@ -30,7 +30,7 @@ # # The rest of www/ is deliberately NOT propagated: # -# www/public/ per-repo placeholders ({{PROJECT_NAME}} and friends) +# www/public/ per-repo placeholders (idris2x and friends) # www/policies/ per-repo placeholders # www/dns/ a DNS scaffold most repositories do not operate # www/tls/ as above diff --git a/scripts/canon-pin-check.sh b/scripts/canon-pin-check.sh index 008b309c..821eab78 100755 --- a/scripts/canon-pin-check.sh +++ b/scripts/canon-pin-check.sh @@ -57,7 +57,7 @@ set -euo pipefail usage() { sed -n '36,50p' "$0" >&2; exit 2; } -# The spine's repository id (hyperpolymath/rsr-template-repo). An id, not a +# The spine's repository id (metadatastician/idris2x). An id, not a # slug: a slug changes on a transfer, an id does not. SPINE_REPOSITORY_ID=1306804488 diff --git a/scripts/check-no-placeholders.sh b/scripts/check-no-placeholders.sh index 3946a92e..ad9a0ad5 100755 --- a/scripts/check-no-placeholders.sh +++ b/scripts/check-no-placeholders.sh @@ -46,10 +46,10 @@ fi # # This check deliberately precedes the template exemption below. That exemption # is why the original incident went unseen: the gate skipped `*-template-repo` -# entirely, so nobody noticed that .github/settings.yml shipped `name: "{{REPO}}"` +# entirely, so nobody noticed that .github/settings.yml shipped `name: "idris2x"` # — and .github/settings.yml is not inert content in a template. probot/settings # applies it on every push to the default branch, in the template as much as in -# an instantiation. The template submitted the literal `{{REPO}}` as its own +# an instantiation. The template submitted the literal `idris2x` as its own # name; GitHub collapsed the illegal braces to dashes and renamed the repository # to `-REPO-`, which then read as a deleted repo. # @@ -96,11 +96,11 @@ fi # Identity comes from the git remote, not the directory name. # # This used to be `basename "$(pwd)"`, which is right in CI — GITHUB_REPOSITORY -# is set to `owner/rsr-template-repo` and matches — but wrong anywhere the +# is set to `owner/idris2x` and matches — but wrong anywhere the # checkout is not literally named `*-template-repo`. A git worktree is the common # case: `git worktree add .claude/worktrees/defects` gives basename `defects`, # the exemption misses, and the gate reports every one of the template's ~85 -# deliberate placeholder files as a failure. A clone into `rsr-template-repo-2`, +# deliberate placeholder files as a failure. A clone into `idris2x-2`, # or any renamed directory, does the same. # # The remote URL is the repo's actual identity and survives all of that. The diff --git a/scripts/configure-repo.sh b/scripts/configure-repo.sh new file mode 100755 index 00000000..8b30b057 --- /dev/null +++ b/scripts/configure-repo.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MPL-2.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +# configure-repo.sh [owner/repo] [--dry-run] — the owner's one-time Configure stage: +# description, homepage, wiki/issues/discussions on, and the topics in .github/repo-settings-idris2x.toml. +# Needs the owner's gh login (repository administration). Idempotent. +set -euo pipefail +R=$(cd "$(dirname "$0")/.." && pwd); repo=metadatastician/idris2x; dry=0 +for a in "$@"; do case "$a" in --dry-run) dry=1;; */*) repo=$a;; esac; done +J=$("$R/scripts/lib/toml2json.sh" "$R/.github/repo-settings-idris2x.toml") +desc=$(jq -r '.repo[0].description' <<<"$J"); home=$(jq -r '.repo[0].homepage' <<<"$J") +mapfile -t topics < <(jq -r '.topic[].name' <<<"$J") +[ "${#topics[@]}" -le 20 ] || { echo "GitHub allows at most 20 topics; file has ${#topics[@]}" >&2; exit 1; } +echo "repo: $repo"; echo "description (${#desc} chars): $desc"; echo "homepage: $home"; echo "topics (${#topics[@]}): ${topics[*]}" +[ $dry = 1 ] && { echo "(dry run: nothing changed)"; exit 0; } +gh repo edit "$repo" --description "$desc" --homepage "$home" --enable-wiki --enable-issues --enable-discussions +args=(); for t in "${topics[@]}"; do args+=(-f "names[]=$t"); done +gh api -X PUT "repos/$repo/topics" "${args[@]}" --jq '"topics set: \(.names | length)"' diff --git a/scripts/deed-template-sync.sh b/scripts/deed-template-sync.sh index a2fa9726..90df9848 100755 --- a/scripts/deed-template-sync.sh +++ b/scripts/deed-template-sync.sh @@ -16,7 +16,7 @@ # # DEED is the child's deed. BASE and NEW are the template's own deed at the # commit the child was cut from (or last upgraded to) and at the upgrade -# target, e.g. `git -C