diff --git a/.devcontainer/Containerfile b/.devcontainer/Containerfile index b0a6fd1..b26092c 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 (hyperpolymath) # -# Dev Container image for {{PROJECT_NAME}} +# Dev Container image for Scaffoldia # Base: Chainguard Wolfi (minimal, supply-chain-secure) -# Build: podman build -t {{PROJECT_NAME}}-dev -f .devcontainer/Containerfile . +# Build: podman build -t Scaffoldia-dev -f .devcontainer/Containerfile . FROM cgr.dev/chainguard/wolfi-base:latest @@ -24,7 +24,7 @@ RUN groupadd -g 1000 nonroot || true \ && useradd -m -u 1000 -g 1000 -s /bin/bash nonroot || true # Set workspace directory -WORKDIR /workspaces/{{PROJECT_NAME}} +WORKDIR /workspaces/Scaffoldia # Default shell ENV SHELL=/bin/bash diff --git a/.devcontainer/README.adoc b/.devcontainer/README.adoc index 5eee18b..3c0af1c 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 @@ -25,4 +25,4 @@ This dev container uses `cgr.dev/chainguard/wolfi-base` with git, curl, bash, an == Customization -Replace `{{PROJECT_NAME}}` placeholders in both `devcontainer.json` and `Containerfile` with your actual project name. Run `just deps` to verify the environment after first launch. +Replace `Scaffoldia` placeholders in both `devcontainer.json` and `Containerfile` with your actual project name. Run `just deps` to verify the environment after first launch. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a4b33e0..325d807 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MPL-2.0 -// Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) // -// Dev Container configuration for {{PROJECT_NAME}} +// Dev Container configuration for Scaffoldia // Works with: VS Code Dev Containers, GitHub Codespaces, Gitpod // Container runtime: Podman (recommended) or any OCI-compliant runtime { - "name": "{{PROJECT_NAME}}", + "name": "Scaffoldia", "build": { "dockerfile": "Containerfile", diff --git a/.envrc b/.envrc index 0b5b702..6a42850 100644 --- a/.envrc +++ b/.envrc @@ -18,7 +18,7 @@ if has nix && [ -f flake.nix ]; then fi # Project environment variables -export PROJECT_NAME="{{PROJECT_NAME}}" +export PROJECT_NAME="Scaffoldia" export RSR_TIER="infrastructure" # export DATABASE_URL="..." # export API_KEY="..." diff --git a/.github/.mailmap b/.github/.mailmap index 0ada9de..37c6e83 100644 --- a/.github/.mailmap +++ b/.github/.mailmap @@ -1 +1 @@ -{{AUTHOR}} <{{AUTHOR_EMAIL}}> <{{AUTHOR_EMAIL_ALT}}> +Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 611b5a8..c57d956 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,14 +1,12 @@ # SPDX-License-Identifier: MPL-2.0 # 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 # Default owners for everything -* @{{OWNER}} +* @hyperpolymath # Security-sensitive files require explicit review -SECURITY.md @{{OWNER}} -.github/workflows/ @{{OWNER}} -Trustfile.a2ml @{{OWNER}} -.machine_readable/ @{{OWNER}} +SECURITY.md @hyperpolymath +.github/workflows/ @hyperpolymath +Trustfile.a2ml @hyperpolymath +.machine_readable/ @hyperpolymath diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 287e86a..2a3d5b2 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -4,29 +4,9 @@ Copyright (c) Jonathan D.A. Jewell --> # Code of Conduct - - ## Our Pledge -We as members, contributors, and leaders pledge to make participation in {{PROJECT_NAME}} a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, colour, religion, or sexual identity and orientation. +We as members, contributors, and leaders pledge to make participation in Scaffoldia a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, colour, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. @@ -140,7 +120,7 @@ If you experience or witness unacceptable behaviour, or have any other concerns, | Method | Details | Best For | |--------|---------|----------| -| **Email** | {{CONDUCT_EMAIL}} | Detailed reports, sensitive matters | +| **Email** | j.d.a.jewell@open.ac.uk | Detailed reports, sensitive matters | | **Private Message** | Contact any maintainer directly | Quick questions, minor issues | | **Anonymous Form** | [Link to form if available] | When you need anonymity | @@ -156,8 +136,8 @@ If you experience or witness unacceptable behaviour, or have any other concerns, **What Happens Next** -1. You will receive acknowledgment within **{{RESPONSE_TIME}}** -2. The {{CONDUCT_TEAM}} will review the report +1. You will receive acknowledgment within **48 hours** +2. The the maintainer will review the report 3. We may ask for additional information 4. We will determine appropriate action 5. We will inform you of the outcome (respecting others' privacy) @@ -173,7 +153,7 @@ All reports will be handled with discretion: ### Conflicts of Interest -If a {{CONDUCT_TEAM}} member is involved in an incident: +If a the maintainer member is involved in an incident: - They will recuse themselves from the process - Another maintainer or external party will handle the report @@ -183,7 +163,7 @@ If a {{CONDUCT_TEAM}} member is involved in an incident: ## Enforcement Guidelines -The {{CONDUCT_TEAM}} will follow these guidelines in determining consequences: +The the maintainer will follow these guidelines in determining consequences: ### 1. Correction @@ -235,13 +215,13 @@ For contributors with elevated access (Perimeter 2 or 1): If you believe an enforcement decision was made in error: 1. **Wait 7 days** after the decision (cooling-off period) -2. **Email** {{CONDUCT_EMAIL}} with subject line "Appeal: [Original Report ID]" +2. **Email** j.d.a.jewell@open.ac.uk with subject line "Appeal: [Original Report ID]" 3. **Explain** why you believe the decision should be reconsidered 4. **Provide** any new information not previously available **Appeals Process** -- Appeals are reviewed by a different {{CONDUCT_TEAM}} member than the original +- Appeals are reviewed by a different the maintainer member than the original - You will receive a response within 14 days - The appeals decision is final - You may only appeal once per incident @@ -314,8 +294,8 @@ We thank these communities for their leadership in creating welcoming spaces. If you have questions about this Code of Conduct: -- Open a [Discussion](https://{{FORGE}}/{{OWNER}}/{{REPO}}/discussions) (for general questions) -- Email {{CONDUCT_EMAIL}} (for private questions) +- Open a [Discussion](https://github.com/hyperpolymath/scaffoldia/discussions) (for general questions) +- Email j.d.a.jewell@open.ac.uk (for private questions) - Contact any maintainer directly --- @@ -328,4 +308,4 @@ We're all here because we care about this project. Let's make it a place where e --- -Last updated: {{CURRENT_YEAR}} · Based on Contributor Covenant 2.1 +Last updated: 2026 · Based on Contributor Covenant 2.1 diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6dafb5b..7dd1cb1 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -3,15 +3,15 @@ SPDX-License-Identifier: CC-BY-SA-4.0 Copyright (c) Jonathan D.A. Jewell --> # Clone the repository -git clone https://{{FORGE}}/{{OWNER}}/{{REPO}}.git -cd {{REPO}} +git clone https://github.com/hyperpolymath/scaffoldia.git +cd scaffoldia # Using Nix (recommended for reproducibility) nix develop # Or using toolbox/distrobox -toolbox create {{REPO}}-dev -toolbox enter {{REPO}}-dev +toolbox create scaffoldia-dev +toolbox enter scaffoldia-dev # Install dependencies manually # Verify setup @@ -21,7 +21,7 @@ just test # Run test suite ### Repository Structure ``` -{{REPO}}/ +scaffoldia/ ├── src/ # Source code (Perimeter 1-2) ├── lib/ # Library code (Perimeter 1-2) ├── extensions/ # Extensions (Perimeter 2) @@ -62,7 +62,7 @@ just test # Run test suite **Before reporting**: 1. Search existing issues -2. Check if it's already fixed in `{{MAIN_BRANCH}}` +2. Check if it's already fixed in `main` 3. Determine which perimeter the bug affects **When reporting**: @@ -95,10 +95,10 @@ Use the [feature request template](.github/ISSUE_TEMPLATE/feature_request.md) an Look for issues labelled: -- [`good first issue`](https://{{FORGE}}/{{OWNER}}/{{REPO}}/labels/good%20first%20issue) — Simple Perimeter 3 tasks -- [`help wanted`](https://{{FORGE}}/{{OWNER}}/{{REPO}}/labels/help%20wanted) — Community help needed -- [`documentation`](https://{{FORGE}}/{{OWNER}}/{{REPO}}/labels/documentation) — Docs improvements -- [`perimeter-3`](https://{{FORGE}}/{{OWNER}}/{{REPO}}/labels/perimeter-3) — Community sandbox scope +- [`good first issue`](https://github.com/hyperpolymath/scaffoldia/labels/good%20first%20issue) — Simple Perimeter 3 tasks +- [`help wanted`](https://github.com/hyperpolymath/scaffoldia/labels/help%20wanted) — Community help needed +- [`documentation`](https://github.com/hyperpolymath/scaffoldia/labels/documentation) — Docs improvements +- [`perimeter-3`](https://github.com/hyperpolymath/scaffoldia/labels/perimeter-3) — Community sandbox scope --- diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index c078261..688a442 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MPL-2.0 -# Funding platforms for {{OWNER}} projects +# Funding platforms for hyperpolymath projects # See: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository -github: {{OWNER}} -ko_fi: {{OWNER}} -liberapay: {{OWNER}} +github: hyperpolymath +ko_fi: hyperpolymath +liberapay: hyperpolymath diff --git a/.github/GOVERNANCE.md b/.github/GOVERNANCE.md index 4a7f376..b6c7a92 100644 --- a/.github/GOVERNANCE.md +++ b/.github/GOVERNANCE.md @@ -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 **Scaffoldia**. --- ## Project Governance Model -{{PROJECT_NAME}} follows a **Benevolent Dictator For Life (BDFL)** governance model. +Scaffoldia 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 hyperpolymath. Licensed under MPL-2.0. diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS index 145c4e9..63989c7 100644 --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -4,7 +4,7 @@ # Format: Name (role) # Replace placeholders with actual maintainer information. -{{AUTHOR}} <{{AUTHOR_EMAIL}}> (Lead Maintainer) +Jonathan D.A. Jewell (Lead Maintainer) # Additional maintainers: # Name (role) diff --git a/.github/SECURITY.md b/.github/SECURITY.md index 76a954d..f8958a4 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -38,26 +38,13 @@ This method ensures: - Coordinated disclosure tooling - Automatic credit when the advisory is published -### Alternative: Encrypted Email +### Alternative: Email If you cannot use GitHub Security Advisories, you may email us directly: | | | |---|---| | **Email** | j.d.a.jewell@open.ac.uk | -| **PGP Key** | [Download Public Key](https://github.com/hyperpolymath.gpg) | -| **Fingerprint** | `4A03639C1EB1F86C7F0C97A91835A14A2867091E` | - -```bash -# Import our PGP key -curl -sSL https://github.com/hyperpolymath.gpg | gpg --import - -# Verify fingerprint -gpg --fingerprint j.d.a.jewell@open.ac.uk - -# Encrypt your report -gpg --armor --encrypt --recipient j.d.a.jewell@open.ac.uk report.txt -``` > **⚠️ Important:** Do not report security vulnerabilities through public GitHub issues, pull requests, discussions, or social media. @@ -356,7 +343,6 @@ When using Scaffoldia, we recommend: ## Additional Resources -- [Our PGP Public Key](https://github.com/hyperpolymath.gpg) - [Security Advisories](https://github.com/hyperpolymath/scaffoldia/security/advisories) - [Changelog](CHANGELOG.md) - [Contributing Guidelines](CONTRIBUTING.md) diff --git a/.github/SUPPORT b/.github/SUPPORT index b06c59a..d6dfde7 100644 --- a/.github/SUPPORT +++ b/.github/SUPPORT @@ -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/hyperpolymath/scaffoldia/discussions +- GitHub Issues: https://github.com/hyperpolymath/scaffoldia/issues - Documentation: See README.adoc in the root directory. diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 7048f63..1cf2861 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 @@ -16,7 +16,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 (hyperpolymath) ` ## Code Style diff --git a/.github/settings.yml b/.github/settings.yml index 92306c4..675628d 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -6,15 +6,13 @@ # This file defines repository-level configuration that is automatically # applied by the probot/settings app when changes are pushed to the default # branch. Install the app at: https://github.com/apps/settings -# -# Template file — replace {{REPO}} and {{DESCRIPTION}} with actual values. # ─── Repository Settings ─────────────────────────────────────────────────────── repository: - name: "{{REPO}}" - description: "{{DESCRIPTION}}" - homepage: "https://github.com/hyperpolymath/{{REPO}}" + name: "scaffoldia" + description: "Full-featured repository designer for the RSR estate: composes spine × variant pack × features × profile into new repos and retrofits existing ones." + homepage: "https://github.com/hyperpolymath/scaffoldia" private: false has_issues: true has_projects: true diff --git a/.github/workflows/dogfood-gate.yml b/.github/workflows/dogfood-gate.yml index 3d9b0b1..b019e9f 100644 --- a/.github/workflows/dogfood-gate.yml +++ b/.github/workflows/dogfood-gate.yml @@ -367,6 +367,6 @@ jobs: | eclexiaiser | ${ECLEX_STATUS} | Energy/carbon budgets for container services | --- - *Generated by the [Dogfood Gate](https://github.com/hyperpolymath/rsr-template-repo) workflow.* + *Generated by the [Dogfood Gate](https://github.com/hyperpolymath/scaffoldia/blob/main/.github/workflows/dogfood-gate.yml) workflow.* *Dogfooding is guinea pig fooding — we test our tools on ourselves.* EOF diff --git a/.machine_readable/ENSAID_CONFIG.a2ml b/.machine_readable/ENSAID_CONFIG.a2ml index 1384822..dfc716d 100644 --- a/.machine_readable/ENSAID_CONFIG.a2ml +++ b/.machine_readable/ENSAID_CONFIG.a2ml @@ -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 (hyperpolymath) # # ENSAID_CONFIG.a2ml — eNSAID Environment Configuration # Per-repo configuration for PanLL and eNSAID-compatible tools. @@ -89,8 +89,8 @@ version = "1.0.0" # Example: a custom portfolio for this project # [[portfolios.custom]] -# id = "{{project}}-dev" -# name = "{{PROJECT_NAME}} Development" -# description = "Panels for {{PROJECT_NAME}} development" +# id = "scaffoldia-dev" +# name = "Scaffoldia Development" +# description = "Panels for Scaffoldia development" # panels = ["valence-shell", "editor-bridge", "build-dashboard"] # default-isolation = "native" diff --git a/.machine_readable/ai/.clinerules b/.machine_readable/ai/.clinerules index 30d21a5..32565bc 100644 --- a/.machine_readable/ai/.clinerules +++ b/.machine_readable/ai/.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 (hyperpolymath) # Authoritative source: docs/AI-CONVENTIONS.md # STARTUP: Read 0-AI-MANIFEST.a2ml first, then .machine_readable/descriptiles/STATE.a2ml. @@ -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 (hyperpolymath) # STATE FILES (.machine_readable/ ONLY) # Never create in repo root: STATE.a2ml, META.a2ml, ECOSYSTEM.a2ml, diff --git a/.machine_readable/ai/.cursorrules b/.machine_readable/ai/.cursorrules index c13b393..5255a80 100644 --- a/.machine_readable/ai/.cursorrules +++ b/.machine_readable/ai/.cursorrules @@ -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 (hyperpolymath) # Authoritative source: docs/AI-CONVENTIONS.md # Read 0-AI-MANIFEST.a2ml in the repo root FIRST for canonical file locations. @@ -7,7 +7,7 @@ # LICENSE # All original code: MPL-2.0 (SPDX header required on every file). # Never use AGPL-3.0. Fallback to MPL-2.0 only when platform requires it. -# Copyright: {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +# Copyright: Jonathan D.A. Jewell (hyperpolymath) # STATE FILES # .a2ml metadata files go in .machine_readable/ ONLY. diff --git a/.machine_readable/ai/.windsurfrules b/.machine_readable/ai/.windsurfrules index 30d21a5..32565bc 100644 --- a/.machine_readable/ai/.windsurfrules +++ b/.machine_readable/ai/.windsurfrules @@ -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 (hyperpolymath) # Authoritative source: docs/AI-CONVENTIONS.md # STARTUP: Read 0-AI-MANIFEST.a2ml first, then .machine_readable/descriptiles/STATE.a2ml. @@ -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 (hyperpolymath) # STATE FILES (.machine_readable/ ONLY) # Never create in repo root: STATE.a2ml, META.a2ml, ECOSYSTEM.a2ml, diff --git a/.machine_readable/ai/AI.a2ml b/.machine_readable/ai/AI.a2ml index ed3cd3c..22761f6 100644 --- a/.machine_readable/ai/AI.a2ml +++ b/.machine_readable/ai/AI.a2ml @@ -2,7 +2,7 @@ # AI Assistant Instructions ## Repository Focus -- `rsr-template-repo` is treated as a Rhodium Standard Repository; obey the Rhodium policies and keep `.machine_readable/` authoritative. +- `scaffoldia` is a Rhodium Standard Repository (instantiated from `rsr-template-repo`); obey the Rhodium policies and keep `.machine_readable/` authoritative. - All machine-readable content lives under `.machine_readable/` — state files (a2ml), bot directives, and contractiles. - Prefer to keep generated files out of source control, and regenerate them with the documented commands before committing. diff --git a/.machine_readable/ai/PLACEHOLDERS.adoc b/.machine_readable/ai/PLACEHOLDERS.adoc deleted file mode 100644 index 2a80900..0000000 --- a/.machine_readable/ai/PLACEHOLDERS.adoc +++ /dev/null @@ -1,144 +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 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, .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 | - -### Project Identity - -| Placeholder | Description | Example | Files | -|---|---|---|---| -| `{{PROJECT_NAME}}` | Human-readable project name | `My Project` | SECURITY.md, CODE_OF_CONDUCT.md, TOPOLOGY.md, STATE.a2ml, Justfile, GOVERNANCE.md, MAINTAINERS.md, flake.nix, devcontainer.json | -| `{{PROJECT_DESCRIPTION}}` | One-line description | `A tool for X` | flake.nix | -| `{{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` | STATE.a2ml, 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` | STATE.a2ml | - -### AI Manifest - -| Placeholder | Description | Example | Files | -|---|---|---|---| -| `[YOUR-REPO-NAME]` | Repository name | `my-project` | 0-AI-MANIFEST.a2ml | -| `[DATE]` | Creation date | `2026-02-14` | 0-AI-MANIFEST.a2ml | -| `[YOUR-NAME/ORG]` | Maintainer name | `hyperpolymath` | 0-AI-MANIFEST.a2ml | - -### 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='*.a2ml' \ - --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/bot_directives/coverage.a2ml b/.machine_readable/bot_directives/coverage.a2ml index 1bd30fa..1012748 100644 --- a/.machine_readable/bot_directives/coverage.a2ml +++ b/.machine_readable/bot_directives/coverage.a2ml @@ -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 (hyperpolymath) # # coverage.a2ml — Session coverage tracking # Updated at the end of each AI agent session. @@ -9,7 +9,7 @@ [metadata] version = "1.0.0" -last-updated = "{{CURRENT_DATE}}" +last-updated = "2026-07-27" # ============================================================================ # COVERAGE STATE diff --git a/.machine_readable/bot_directives/debt.a2ml b/.machine_readable/bot_directives/debt.a2ml index 3289cbe..708a6f1 100644 --- a/.machine_readable/bot_directives/debt.a2ml +++ b/.machine_readable/bot_directives/debt.a2ml @@ -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 (hyperpolymath) # # debt.a2ml — Meander debt list # Things found but not fixed. Carried between sessions. @@ -9,7 +9,7 @@ [metadata] version = "1.0.0" -last-updated = "{{CURRENT_DATE}}" +last-updated = "2026-07-27" # ============================================================================ # DEBT ITEMS diff --git a/.machine_readable/bot_directives/methodology.a2ml b/.machine_readable/bot_directives/methodology.a2ml index a88ab49..51ea7b1 100644 --- a/.machine_readable/bot_directives/methodology.a2ml +++ b/.machine_readable/bot_directives/methodology.a2ml @@ -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 (hyperpolymath) # # methodology.a2ml — AI agent methodology configuration # Declares how agents should approach work in this repository. @@ -9,7 +9,7 @@ [metadata] version = "1.0.0" -last-updated = "{{CURRENT_DATE}}" +last-updated = "2026-07-27" spec = "https://github.com/hyperpolymath/standards/blob/main/agentic-a2ml/docs/ADR-002-methodology-layer.adoc" # ============================================================================ @@ -55,7 +55,7 @@ perfective = 10 # % for SPDX headers, doc updates, formatting, style # Customise this per project — the template default is generic. [methodology.unique-strength] -description = "{{PROJECT_UNIQUE_STRENGTH}}" +description = "Treats variation as data: consumes each variant template's VARIANT.a2ml contract (parent pin + declared path divergences) so the composed path and GitHub's 'Use this template' path can never silently diverge, and re-synchronises existing repos with the same pack-diff machinery that composes new ones." deepen-not-broaden = true # ============================================================================ diff --git a/.machine_readable/compliance/reuse/dep5 b/.machine_readable/compliance/reuse/dep5 index 49aaed6..382f4a4 100644 --- a/.machine_readable/compliance/reuse/dep5 +++ b/.machine_readable/compliance/reuse/dep5 @@ -1,54 +1,54 @@ 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: Scaffoldia +Upstream-Contact: Jonathan D.A. Jewell +Source: https://github.com/hyperpolymath/scaffoldia # Default: all files are MPL-2.0 Files: * -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (hyperpolymath) 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 (hyperpolymath) 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 (hyperpolymath) License: MPL-2.0 # Bot directives Files: .machine_readable/bot_directives/* -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (hyperpolymath) License: MPL-2.0 # Contractiles Files: .machine_readable/contractiles/* -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (hyperpolymath) License: MPL-2.0 # GitHub/CI configuration Files: .github/* .github/**/* -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (hyperpolymath) License: MPL-2.0 # Generated files Files: generated/* -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (hyperpolymath) 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 (hyperpolymath) 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 (hyperpolymath) License: MPL-2.0 # Git-cliff config Files: cliff.toml -Copyright: {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright: 2026 Jonathan D.A. Jewell (hyperpolymath) License: MPL-2.0 diff --git a/.machine_readable/configs/eclexiaiser.toml b/.machine_readable/configs/eclexiaiser.toml index abc542e..94e643b 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 = "scaffoldia" [[functions]] name = "build" diff --git a/.machine_readable/configs/git-cliff/cliff.toml b/.machine_readable/configs/git-cliff/cliff.toml index 5c39b48..984a2ff 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 (hyperpolymath) # # 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 +# hyperpolymath — GitHub organization or username +# scaffoldia — 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/hyperpolymath/scaffoldia {%- 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/hyperpolymath/scaffoldia {%- endmacro -%} {% for release in releases -%} diff --git a/.machine_readable/contractiles/Adjustfile.a2ml b/.machine_readable/contractiles/Adjustfile.a2ml index 6f01e89..18d8f9d 100644 --- a/.machine_readable/contractiles/Adjustfile.a2ml +++ b/.machine_readable/contractiles/Adjustfile.a2ml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MPL-2.0 -# Adjustfile — Drift-tolerance contract for rsr-template-repo +# Adjustfile — Drift-tolerance contract for scaffoldia # Author: Jonathan D.A. Jewell # # Cumulative-drift catchment: tolerance bands + corrective actions. @@ -8,7 +8,7 @@ # Fix with: adjust fix (applies deterministic patches; advisory otherwise) @abstract: -Drift tolerances and corrective actions for rsr-template-repo. Unlike +Drift tolerances and corrective actions for scaffoldia. Unlike MUST (hard gate), ADJUST tracks cumulative drift against tolerance bands and proposes corrective actions. Advisory — it warns and trends, it does not block. diff --git a/.machine_readable/contractiles/Intentfile.a2ml b/.machine_readable/contractiles/Intentfile.a2ml index ef74f45..cf4f5a4 100644 --- a/.machine_readable/contractiles/Intentfile.a2ml +++ b/.machine_readable/contractiles/Intentfile.a2ml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MPL-2.0 -# Intentfile (A2ML Canonical) — north-star contractile for rsr-template-repo +# Intentfile (A2ML Canonical) — north-star contractile for scaffoldia # Author: Jonathan D.A. Jewell # # Paired runner: intend.ncl @@ -20,28 +20,30 @@ # contractile for hard gates. @abstract: -North-star contractile for rsr-template-repo. This repository is the -canonical template for Rhodium Standard Repository compliance. It provides -the scaffold that all hyperpolymath repos should copy and customize. +North-star contractile for scaffoldia. This repository was instantiated +from rsr-template-repo, the canonical RSR (Rhodium Standard Repository) +template; it is itself a downstream, RSR-compliant project — not the +template. Its own job is the top layer of the estate's scaffolding stack +(standards → rsr-template-repo → scaffoldia): the full-featured designer +that composes spine × variant pack × features × profile into new repos and +retrofits existing ones. @end ## Purpose -The rsr-template-repo serves as the master template for all hyperpolymath -repositories. It contains the complete set of contractile files, machine-readable -specifications, and governance documentation that define the Rhodium Standard. - -Every new repository in the hyperpolymath estate should be initialized by -copying this template and substituting the placeholder values with -repo-specific content. +scaffoldia consumes each variant template's variant contract +(`VARIANT.a2ml`) so that GitHub's "Use this template" path and the composed +path can never silently diverge. See README.adoc, "What this is", for the +current authoritative description. ## Anti-Purpose This repository is NOT: +- rsr-template-repo itself (it is a consumer/producer of RSR-shaped repos) - A general-purpose project scaffold for external use (hyperpolymath-only) - A replacement for per-repo customization (all files must be bespoke) -- A static template that never changes (evolves with RSR spec) -- A runtime library or framework (build-time only) +- A runtime library or framework in the composition engine's current phase + (design phase — see `.machine_readable/descriptiles/STATE.a2ml`) ## If In Doubt diff --git a/.machine_readable/contractiles/Justfile b/.machine_readable/contractiles/Justfile index 2db3d94..5e6b22e 100644 --- a/.machine_readable/contractiles/Justfile +++ b/.machine_readable/contractiles/Justfile @@ -19,9 +19,9 @@ set positional-arguments := true import? "build/contractile.just" # Project metadata — customize these -project := "rsr-template-repo" +project := "scaffoldia" OWNER := "hyperpolymath" -REPO := "rsr-template-repo" +REPO := "scaffoldia" version := "0.1.0" tier := "infrastructure" # 1 | 2 | infrastructure @@ -681,7 +681,7 @@ assail: # Self-diagnostic — checks dependencies, permissions, paths doctor: - @echo "Running diagnostics for rsr-template-repo..." + @echo "Running diagnostics for scaffoldia..." @echo "Checking required tools..." @command -v just >/dev/null 2>&1 && echo " [OK] just" || echo " [FAIL] just not found" @command -v git >/dev/null 2>&1 && echo " [OK] git" || echo " [FAIL] git not found" @@ -691,7 +691,7 @@ doctor: # Guided tour of key features tour: - @echo "=== rsr-template-repo Tour ===" + @echo "=== scaffoldia Tour ===" @echo "" @echo "1. Project structure:" @ls -la @@ -706,12 +706,12 @@ tour: # Open feedback channel with diagnostic context help-me: - @echo "=== rsr-template-repo Help ===" + @echo "=== scaffoldia 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/hyperpolymath/scaffoldia/issues/new" @echo "" @echo "Include the output of 'just doctor' in your report." diff --git a/.machine_readable/contractiles/Mustfile.a2ml b/.machine_readable/contractiles/Mustfile.a2ml index d269daf..d2563e9 100644 --- a/.machine_readable/contractiles/Mustfile.a2ml +++ b/.machine_readable/contractiles/Mustfile.a2ml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MPL-2.0 -# Mustfile — Physical state contract for rsr-template-repo +# Mustfile — Physical state contract for scaffoldia # Author: Jonathan D.A. Jewell # # What MUST be true about this repository. Hard requirements. @@ -7,9 +7,9 @@ # Fix with: must fix (where a deterministic fix exists) @abstract: -Physical-state invariants for rsr-template-repo. This is the canonical -RSR template repository. These are hard requirements — CI and pre-commit -hooks fail if any check fails. +Physical-state invariants for scaffoldia. This repository was instantiated +from rsr-template-repo, the canonical RSR template repository. These are +hard requirements — CI and pre-commit hooks fail if any check fails. @end ## File Presence diff --git a/.machine_readable/contractiles/Trustfile.a2ml b/.machine_readable/contractiles/Trustfile.a2ml index e2028b5..065a503 100644 --- a/.machine_readable/contractiles/Trustfile.a2ml +++ b/.machine_readable/contractiles/Trustfile.a2ml @@ -1,12 +1,12 @@ # SPDX-License-Identifier: MPL-2.0 -# Trustfile — Trust boundaries and integrity invariants for rsr-template-repo +# Trustfile — Trust boundaries and integrity invariants for scaffoldia # Author: Jonathan D.A. Jewell # # Defines what LLM/SLM agents are trusted to do without asking, and # integrity invariants that verify the repo has not been tampered with. @abstract: -Trust boundaries and integrity checks for rsr-template-repo. This file +Trust boundaries and integrity checks for scaffoldia. This file combines the trust-level definitions from the original TRUST.contractile with the integrity invariants from the old Trustfile.a2ml. It defines what AI agents may do autonomously and what requires human approval, @@ -15,7 +15,7 @@ plus checks that verify repository integrity. ## Trust Levels -The rsr-template-repo operates at trust level: maximal +scaffoldia operates at trust level: maximal Trust levels: - maximal: Agent may read, build, test, lint, format, heal freely. diff --git a/.machine_readable/contractiles/bust/Bustfile.a2ml b/.machine_readable/contractiles/bust/Bustfile.a2ml index c7fec2b..b7b65d6 100644 --- a/.machine_readable/contractiles/bust/Bustfile.a2ml +++ b/.machine_readable/contractiles/bust/Bustfile.a2ml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MPL-2.0 -# Bustfile — failure mode contractile for rsr-template-repo +# Bustfile — failure mode contractile for scaffoldia # Author: Jonathan D.A. Jewell # # Paired runner: bust.ncl @@ -13,13 +13,15 @@ # contractile bust check → list failure modes + recovery status # contractile bust drill → inject failures, verify recovery paths # -# This repository: rsr-template-repo is the canonical template for RSR compliance. -# Failure modes here relate to template distribution and substitution. +# This repository: scaffoldia, instantiated from rsr-template-repo (the +# canonical template for RSR compliance). Failure modes here relate to +# template distribution and substitution as they affect scaffoldia's own +# composer/retrofit machinery. @abstract: -Bustfile for rsr-template-repo. Lists failure modes specific to the template -repository itself, particularly around template distribution, substitution, -and synchronization across the hyperpolymath estate. +Bustfile for scaffoldia. Lists failure modes around template distribution, +substitution, and synchronization across the hyperpolymath estate, as +inherited from the rsr-template-repo mechanism this repository builds on. @end ## Failure Modes diff --git a/.machine_readable/contractiles/dust/Dustfile.a2ml b/.machine_readable/contractiles/dust/Dustfile.a2ml index c6bf986..743bd2e 100644 --- a/.machine_readable/contractiles/dust/Dustfile.a2ml +++ b/.machine_readable/contractiles/dust/Dustfile.a2ml @@ -1,18 +1,20 @@ # SPDX-License-Identifier: MPL-2.0 -# Dustfile — Cleanup and hygiene contract for rsr-template-repo +# Dustfile — Cleanup and hygiene contract for scaffoldia # Author: Jonathan D.A. Jewell # # Paired runner: dust.ncl # Verb: dust # Semantics: What should be cleaned up. Housekeeping, not blockers. # -# This repository: rsr-template-repo is the canonical template. -# Cleanup items here ensure the template itself remains pristine. +# This repository: scaffoldia, instantiated from rsr-template-repo (the +# canonical template). Cleanup items here ensure this repository — and any +# rsr-*-template-repo copies it composes/retrofits — remain pristine. @abstract: -Cleanup and hygiene items for rsr-template-repo. These are maintenance tasks -that ensure the template repository remains clean and ready for distribution -to new repositories. +Cleanup and hygiene items for scaffoldia. These are maintenance tasks +that ensure the repository remains clean, plus (per scaffoldia's own +composer/retrofit role) that generated/retrofitted downstream repos stay +clean too. @end ## Stale Files diff --git a/.machine_readable/descriptiles/anchors/ANCHOR.a2ml b/.machine_readable/descriptiles/anchors/ANCHOR.a2ml index 8723899..d3547df 100644 --- a/.machine_readable/descriptiles/anchors/ANCHOR.a2ml +++ b/.machine_readable/descriptiles/anchors/ANCHOR.a2ml @@ -1,15 +1,15 @@ # SPDX-License-Identifier: MPL-2.0 -# Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) # # ANCHOR.a2ml - authoritative anchor for this repository [metadata] version = "1.0.0" -last-updated = "{{CURRENT_DATE}}" +last-updated = "2026-07-27" [anchor] schema = "hyperpolymath.anchor/1" -repo = "{{OWNER}}/{{REPO}}" +repo = "hyperpolymath/scaffoldia" authority = "upstream-canonical" purpose = [ @@ -19,10 +19,10 @@ purpose = [ ] [identity] -project = "{{PROJECT_NAME}}" -kind = "{{PROJECT_KIND}}" # language | library | service | tool -one-sentence = "{{PROJECT_PURPOSE}}" -domain = "{{PROJECT_DOMAIN}}" +project = "Scaffoldia" +kind = "tool" # language | library | service | tool +one-sentence = "Full-featured repository designer for the RSR estate: composes spine x variant pack x features x profile into new repos and retrofits existing ones." +domain = "developer-tooling / repository-scaffolding" [semantic-authority] policy = "canonical" diff --git a/.machine_readable/integrations/groove.a2ml b/.machine_readable/integrations/groove.a2ml index ea3fb8b..c673ca2 100644 --- a/.machine_readable/integrations/groove.a2ml +++ b/.machine_readable/integrations/groove.a2ml @@ -9,8 +9,8 @@ (groove-manifest (version "1.0") - ; Service identity — replace {{REPO}} with your project name - (service "{{REPO}}") + ; Service identity — replace scaffoldia with your project name + (service "scaffoldia") (service-version "0.1.0") ; Primary port — MUST be unique across the ecosystem. diff --git a/.machine_readable/policies/MAINTENANCE-AXES.a2ml b/.machine_readable/policies/MAINTENANCE-AXES.a2ml index c073b9a..ff985ae 100644 --- a/.machine_readable/policies/MAINTENANCE-AXES.a2ml +++ b/.machine_readable/policies/MAINTENANCE-AXES.a2ml @@ -1,11 +1,11 @@ # SPDX-License-Identifier: MPL-2.0 -# Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) # # Canonical maintenance governance model [metadata] version = "1.0.0" -last-updated = "{{CURRENT_DATE}}" +last-updated = "2026-07-27" scope = "repo" [discovery] diff --git a/.machine_readable/scripts/maintenance/maint-assault.sh b/.machine_readable/scripts/maintenance/maint-assault.sh index f170cab..fd7cfbe 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="scaffoldia" 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 0062207..4aca2fd 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/hyperpolymath/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/hyperpolymath/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/hyperpolymath/k9-svc/blob/main/SPEC.adoc +- **K9 User Guide:** https://github.com/hyperpolymath/k9-svc/blob/main/GUIDE.adoc +- **Security Documentation:** https://github.com/hyperpolymath/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/hyperpolymath/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 1f38e2d..9fe314e 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 c8e6ebf..b2299b4 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/hyperpolymath/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 = "The Open University", }, license = "MPL-2.0", @@ -45,7 +45,7 @@ K9! keywords = [ "rhodium-standard", "rsr", - "{{OWNER}}", + "hyperpolymath", ], }, diff --git a/.machine_readable/self-validating/examples/setup-repo.k9.ncl b/.machine_readable/self-validating/examples/setup-repo.k9.ncl index df79a55..d1fc8bb 100644 --- a/.machine_readable/self-validating/examples/setup-repo.k9.ncl +++ b/.machine_readable/self-validating/examples/setup-repo.k9.ncl @@ -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'", ], }, @@ -132,7 +132,7 @@ K9! "add-license" = { description = "Add PMPL-1.0 license", commands = [ - "curl -sL https://raw.githubusercontent.com/{{OWNER}}/pmpl/main/LICENSE -o LICENSE", + "curl -sL https://raw.githubusercontent.com/hyperpolymath/pmpl/main/LICENSE -o LICENSE", "echo '✓ License added'", ], }, diff --git a/.machine_readable/self-validating/methodology-guard.k9.ncl b/.machine_readable/self-validating/methodology-guard.k9.ncl index 789beb5..37559f9 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 (hyperpolymath) # # K9 Validator: Methodology Guard # Checks that agent work respects methodology constraints declared in diff --git a/.machine_readable/self-validating/template-hunt.k9.ncl b/.machine_readable/self-validating/template-hunt.k9.ncl index a9cc350..b3fcb47 100644 --- a/.machine_readable/self-validating/template-hunt.k9.ncl +++ b/.machine_readable/self-validating/template-hunt.k9.ncl @@ -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 b/.machine_readable/self-validating/template-kennel.k9.ncl index fa7e3f3..4228b26 100644 --- a/.machine_readable/self-validating/template-kennel.k9.ncl +++ b/.machine_readable/self-validating/template-kennel.k9.ncl @@ -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 b/.machine_readable/self-validating/template-yard.k9.ncl index 358671c..a723f5a 100644 --- a/.machine_readable/self-validating/template-yard.k9.ncl +++ b/.machine_readable/self-validating/template-yard.k9.ncl @@ -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/.well-known/humans.txt b/.well-known/humans.txt index e062f4b..0ce0944 100644 --- a/.well-known/humans.txt +++ b/.well-known/humans.txt @@ -2,12 +2,12 @@ # humanstxt.org /* TEAM */ -Maintainer: {{AUTHOR}} ({{OWNER}}) -Contact: {{AUTHOR_EMAIL}} +Maintainer: Jonathan D.A. Jewell (hyperpolymath) +Contact: j.d.a.jewell@open.ac.uk From: United Kingdom /* SITE */ -Last update: {{CURRENT_DATE}} +Last update: 2026-07-27 Standards: RSR (Rhodium Standard Repository) License: MPL-2.0 (Palimpsest MPL) Components: Idris2 ABI, Zig FFI diff --git a/.well-known/security.txt b/.well-known/security.txt index 5414d50..857627e 100644 --- a/.well-known/security.txt +++ b/.well-known/security.txt @@ -2,10 +2,8 @@ # RFC 9116 - security.txt # https://securitytxt.org/ -Contact: mailto:{{SECURITY_EMAIL}} -Expires: {{CURRENT_YEAR}}-12-31T23:59:59.000Z -Encryption: {{PGP_KEY_URL}} +Contact: mailto:j.d.a.jewell@open.ac.uk +Expires: 2026-12-31T23:59:59.000Z Preferred-Languages: en -Canonical: https://{{FORGE}}/{{OWNER}}/{{REPO}}/.well-known/security.txt -Policy: https://{{FORGE}}/{{OWNER}}/{{REPO}}/blob/main/SECURITY.md -Hiring: https://{{WEBSITE}}/careers +Canonical: https://github.com/hyperpolymath/scaffoldia/.well-known/security.txt +Policy: https://github.com/hyperpolymath/scaffoldia/blob/main/SECURITY.md diff --git a/0-AI-MANIFEST.a2ml b/0-AI-MANIFEST.a2ml index 68aad8c..54e9bdb 100644 --- a/0-AI-MANIFEST.a2ml +++ b/0-AI-MANIFEST.a2ml @@ -5,11 +5,11 @@ # [metadata] version = "0.1.0" -last-updated = "{{CURRENT_DATE}}" +last-updated = "2026-07-27" [project] name = "[YOUR-REPO-NAME]" -purpose = "{{PROJECT_DESCRIPTION}}" +purpose = "Full-featured repository designer for the RSR estate: composes spine × variant pack × features × profile into new repos and retrofits existing ones. Design phase — consumes VARIANT.a2ml contracts; top of the scaffolding stack (standards → rsr-template-repo → scaffoldia)." [ai-allocation] agents = [ diff --git a/Justfile b/Justfile index cb0bf09..0b6e976 100644 --- a/Justfile +++ b/Justfile @@ -83,22 +83,15 @@ import? "build/just/assess.just" # Build the project (debug mode) build *args: @echo "Building {{project}} (debug)..." - # TODO: Replace with your build command - # Examples: - # cargo build {{args}} # Rust - # mix compile {{args}} # Elixir - # zig build {{args}} # Zig - # deno task build {{args}} # Deno/ReScript + idris2 --build abi.ipkg + cd src/interface/ffi && zig build {{args}} @echo "Build complete" # Build in release mode with optimizations build-release *args: @echo "Building {{project}} (release)..." - # TODO: Replace with your release build command - # Examples: - # cargo build --release {{args}} - # MIX_ENV=prod mix compile {{args}} - # zig build -Doptimize=ReleaseFast {{args}} + idris2 --build abi.ipkg + cd src/interface/ffi && zig build -Doptimize=ReleaseFast {{args}} @echo "Release build complete" # Build and watch for changes (requires entr or similar) @@ -110,11 +103,14 @@ build-watch: # mix compile --force --warnings-as-errors # deno task dev +# NOTE: `build/` itself is a tracked orchestration directory (build/just/*.just, +# build/contractile.just, build/guix.scm, ...) — do NOT rm -rf it. Only its +# `ttc/` subdirectory (idris2's compiled .ttc/.ttm output) and the Zig +# `.zig-cache`/`zig-out` directories are generated artifacts. # Clean build artifacts [reversible: rebuild with `just build`] clean: @echo "Cleaning..." - # TODO: Customize for your build system - rm -rf target/ _build/ build/ dist/ out/ obj/ bin/ + rm -rf build/ttc/ src/interface/ffi/.zig-cache/ src/interface/ffi/zig-out/ # Deep clean including caches [reversible: rebuild] clean-all: clean @@ -127,63 +123,33 @@ clean-all: clean # Run all tests test *args: @echo "Running tests..." - # TODO: Replace with your test command - # Examples: - # cargo test {{args}} - # mix test {{args}} - # zig build test {{args}} - # deno test {{args}} + idris2 --typecheck abi.ipkg + cd src/interface/ffi && zig build test {{args}} @echo "Tests passed!" # Run tests with verbose output test-verbose: @echo "Running tests (verbose)..." - # TODO: Replace with verbose test command + idris2 --typecheck abi.ipkg + cd src/interface/ffi && zig build test --summary all -# Smoke test +# Smoke test — compiles without running the test suite test-smoke: @echo "Smoke test..." - # TODO: Add basic sanity checks + idris2 --typecheck abi.ipkg + cd src/interface/ffi && zig build # Run end-to-end tests (full pipeline: build → run → verify) e2e: - @echo "Running E2E tests..." - # TODO: Replace with your E2E test command. Examples: - # bash tests/e2e.sh # Shell-based E2E - # npx playwright test # Browser E2E - # mix test test/integration/e2e_test.exs # Elixir E2E - # cargo test --test end_to_end # Rust E2E - @echo "E2E tests passed!" + bash tests/e2e.sh # Run aspect tests (cross-cutting concern validation) aspect: - @echo "Running aspect tests..." - # TODO: Replace with your aspect test command. Examples: - # bash tests/aspect_tests.sh # Shell-based aspect tests - # cargo test --test aspects # Rust aspect tests - # Aspect tests validate architectural invariants: - # - Thread safety (mutex in FFI modules) - # - ABI/FFI contract (declarations match exports) - # - SPDX compliance (all files have license headers) - # - No dangerous patterns (believe_me, assert_total, etc.) - @echo "Aspect tests passed!" + bash tests/aspect_tests.sh # Run benchmarks (performance regression detection) bench: - @echo "Running benchmarks..." - # TODO: Replace with your benchmark command. Examples: - # cargo bench # Rust criterion - # zig build bench # Zig benchmarks - # mix run bench/benchmarks.exs # Elixir benchee - # deno bench # Deno bench - @echo "Benchmarks complete!" - -# Run readiness tests (Component Readiness Grade: D/C/B) -readiness: - @echo "Running readiness tests..." - # TODO: Replace with your readiness test command. Examples: - # cargo test --test readiness -- --nocapture - @echo "Readiness tests complete!" + bash benches/template_bench.sh . human # Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line) crg-grade: @@ -209,7 +175,7 @@ crg-badge: # Run the full merge-requirement test suite (ALL categories) # Per STANDING rule: P2P + E2E + aspect + execution + lifecycle + bench -test-all: test e2e aspect bench readiness +test-all: test e2e aspect bench @echo "All test categories passed — safe to merge!" # Run all quality checks @@ -227,49 +193,30 @@ fix: fmt # Format all source files [reversible: git checkout] fmt: @echo "Formatting source files..." - # TODO: Replace with your formatter - # Examples: - # cargo fmt - # mix format - # gleam format - # deno fmt + zig fmt src/interface/ffi # Check formatting without changes fmt-check: @echo "Checking formatting..." - # TODO: Replace with your format check - # Examples: - # cargo fmt --check - # mix format --check-formatted - # gleam format --check + zig fmt --check src/interface/ffi -# Run linter +# Run linter. There is no separate Idris2/Zig linter — a typecheck and a +# build are where real warnings/errors from either toolchain surface. lint: @echo "Linting source files..." - # TODO: Replace with your linter - # Examples: - # cargo clippy -- -D warnings - # mix credo --strict - # gleam check + idris2 --typecheck abi.ipkg + cd src/interface/ffi && zig build # ═══════════════════════════════════════════════════════════════════════════════ -# RUN & EXECUTE +# INSTALL # ═══════════════════════════════════════════════════════════════════════════════ - -# Run the application -run *args: build - # TODO: Replace with your run command - echo "Run not configured yet" - -# Run with verbose output -run-verbose *args: build - # TODO: Replace with verbose run command - echo "Run not configured yet" +# (No `run`/`run-verbose` recipes — {{project}} is a library, not an +# executable; there is nothing for them to run.) # Install to user path -install: build-release +install prefix="~/.local": build-release @echo "Installing {{project}}..." - # TODO: Replace with your install command + cd src/interface/ffi && zig build --prefix {{prefix}} -Doptimize=ReleaseFast # ═══════════════════════════════════════════════════════════════════════════════ # DEPENDENCIES @@ -278,12 +225,9 @@ install: build-release # Install/check all dependencies deps: @echo "Checking dependencies..." - # TODO: Replace with your dependency check - # Examples: - # cargo check - # mix deps.get - # gleam deps download - @echo "All dependencies satisfied" + @command -v idris2 >/dev/null 2>&1 && echo " OK: idris2 ($(idris2 --version))" || echo " MISSING: idris2" + @command -v zig >/dev/null 2>&1 && echo " OK: zig ($(zig version))" || echo " MISSING: zig" + @command -v just >/dev/null 2>&1 && echo " OK: just ($(just --version))" || echo " MISSING: just" # Audit dependencies for vulnerabilities deps-audit: diff --git a/README.adoc b/README.adoc index 58a66a6..249ca43 100644 --- a/README.adoc +++ b/README.adoc @@ -82,9 +82,7 @@ just validate # structure + metadata checks (RSR shape) == Where to go next * `EXPLAINME.adoc` — the engineering deep-dive: how the pieces actually work. -* `AFFIRMATION.adoc` — the dated, signed honesty snapshot of the repo's true state. * `AUDIT.adoc` — the release audit gate. -* `.machine_readable/ai/PLACEHOLDERS.adoc` — the full placeholder reference. == Licence diff --git a/benches/template_bench.sh b/benches/template_bench.sh index 5fb58a8..f95a96e 100755 --- a/benches/template_bench.sh +++ b/benches/template_bench.sh @@ -2,8 +2,9 @@ # SPDX-License-Identifier: MPL-2.0 # Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) # -# Template Benchmarks -# Measures performance characteristics of template validation and build system +# Scaffoldia Benchmarks +# Measures performance characteristics of the Zig build/test cycle and +# workflow validation. set -euo pipefail @@ -34,45 +35,14 @@ TIME_CMD="/usr/bin/time -f %e" 2>/dev/null || TIME_CMD="time" echo "" echo "═══════════════════════════════════════════════════════════════════════════════" -echo "Template Benchmarks" +echo "Scaffoldia Benchmarks" echo "═══════════════════════════════════════════════════════════════════════════════" echo "" declare -A results #============================================================================== -# BENCHMARK 1: Template Validation -#============================================================================== - -log_info "Running template validation benchmark" - -# Warm-up run -if [ -f "$REPO_ROOT/scripts/validate-template.sh" ]; then - bash "$REPO_ROOT/scripts/validate-template.sh" "$REPO_ROOT" 0 > /dev/null 2>&1 || true -fi - -# Timed runs -BENCH_RUNS=3 -TOTAL_TIME=0 - -for i in $(seq 1 $BENCH_RUNS); do - START=$(date +%s%N) - bash "$REPO_ROOT/scripts/validate-template.sh" "$REPO_ROOT" 0 > /dev/null 2>&1 || true - END=$(date +%s%N) - - # Convert to milliseconds - RUN_TIME=$(( (END - START) / 1000000 )) - TOTAL_TIME=$(( TOTAL_TIME + RUN_TIME )) - - [ "$OUTPUT_FORMAT" = "human" ] && echo " Run $i: ${RUN_TIME}ms" -done - -AVG_VALIDATION_TIME=$(( TOTAL_TIME / BENCH_RUNS )) -results[validation]=$AVG_VALIDATION_TIME -log_pass "Validation: ${AVG_VALIDATION_TIME}ms average (${BENCH_RUNS} runs)" - -#============================================================================== -# BENCHMARK 2: Zig Build +# BENCHMARK 1: Zig Build #============================================================================== log_info "Running Zig build benchmark" @@ -91,7 +61,7 @@ else TOTAL_TIME=0 for i in $(seq 1 $BENCH_RUNS); do - rm -rf zig-cache + rm -rf .zig-cache zig-out START=$(date +%s%N) zig build --summary off > /dev/null 2>&1 || true @@ -111,7 +81,7 @@ else fi #============================================================================== -# BENCHMARK 3: Zig Tests +# BENCHMARK 2: Zig Tests #============================================================================== log_info "Running Zig test benchmark" @@ -141,7 +111,7 @@ else fi #============================================================================== -# BENCHMARK 4: Workflow Validation +# BENCHMARK 3: Workflow Validation #============================================================================== log_info "Running workflow validation benchmark" @@ -156,22 +126,6 @@ if [ -f "$REPO_ROOT/tests/workflows/validate_workflows_test.sh" ]; then log_pass "Workflow validation: ${WORKFLOW_TIME}ms" fi -#============================================================================== -# BENCHMARK 5: Template Instantiation -#============================================================================== - -log_info "Running template instantiation benchmark" - -if [ -f "$REPO_ROOT/tests/e2e/template_instantiation_test.sh" ]; then - START=$(date +%s%N) - bash "$REPO_ROOT/tests/e2e/template_instantiation_test.sh" "$REPO_ROOT" > /dev/null 2>&1 || true - END=$(date +%s%N) - - INSTANTIATION_TIME=$(( (END - START) / 1000000 )) - results[instantiation]=$INSTANTIATION_TIME - log_pass "Template instantiation: ${INSTANTIATION_TIME}ms" -fi - #============================================================================== # SUMMARY #============================================================================== diff --git a/build/.guix-channel b/build/.guix-channel index f9bdf68..e61781f 100644 --- a/build/.guix-channel +++ b/build/.guix-channel @@ -1,20 +1,20 @@ ;; SPDX-License-Identifier: MPL-2.0 -;; Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +;; Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) ;; -;; Guix channel definition for {{PROJECT_NAME}} +;; Guix channel definition for scaffoldia ;; ;; To use this channel, add to ~/.config/guix/channels.scm: ;; ;; (channel -;; (name '{{PROJECT_NAME}}) -;; (url "https://github.com/{{OWNER}}/{{PROJECT_NAME}}") +;; (name 'scaffoldia) +;; (url "https://github.com/hyperpolymath/scaffoldia") ;; (branch "main")) ;; ;; Then: guix pull (channel (version 0) - (url "https://github.com/{{OWNER}}/{{PROJECT_NAME}}") + (url "https://github.com/hyperpolymath/scaffoldia") (dependencies (channel (name 'guix) diff --git a/build/Containerfile b/build/Containerfile index d7266bc..778553f 100644 --- a/build/Containerfile +++ b/build/Containerfile @@ -1,10 +1,10 @@ # SPDX-License-Identifier: MPL-2.0 -# Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) # -# Containerfile for {{PROJECT_NAME}} -# Build: podman build -t {{project}}:latest -f Containerfile . -# Run: podman run --rm -it {{project}}:latest -# Seal: selur seal {{project}}:latest +# Containerfile for Scaffoldia +# Build: podman build -t scaffoldia:latest -f Containerfile . +# Run: podman run --rm -it scaffoldia:latest +# Seal: selur seal scaffoldia:latest # --- Build stage --- FROM cgr.dev/chainguard/wolfi-base:latest AS build @@ -30,12 +30,12 @@ FROM cgr.dev/chainguard/static:latest # Copy built artifact from build stage # TODO: Replace with your binary/artifact path # Examples: -# COPY --from=build /build/target/release/{{project}} /usr/local/bin/ -# COPY --from=build /build/_build/prod/rel/{{project}} /app/ -# COPY --from=build /build/zig-out/bin/{{project}} /usr/local/bin/ +# COPY --from=build /build/target/release/scaffoldia /usr/local/bin/ +# COPY --from=build /build/_build/prod/rel/scaffoldia /app/ +# COPY --from=build /build/zig-out/bin/scaffoldia /usr/local/bin/ # Non-root user (chainguard images default to nonroot) USER nonroot # TODO: Replace with your entrypoint -# ENTRYPOINT ["/usr/local/bin/{{project}}"] +# ENTRYPOINT ["/usr/local/bin/scaffoldia"] diff --git a/build/guix.scm b/build/guix.scm index 33b1a9a..e6ab314 100644 --- a/build/guix.scm +++ b/build/guix.scm @@ -1,13 +1,15 @@ ;; SPDX-License-Identifier: MPL-2.0 -;; Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +;; Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) ;; -;; Guix package definition for {{PROJECT_NAME}} +;; Guix package definition for scaffoldia ;; ;; Usage: ;; guix shell -D -f guix.scm # Enter development shell ;; guix build -f guix.scm # Build package ;; -;; TODO: Replace {{PROJECT_NAME}} and customize inputs for your language/stack. +;; TODO: real build/check phases (Idris2 + Zig) are not yet wired — see the +;; `(delete 'build) (delete 'check)` phases below. No Guix toolchain was +;; available to verify a real build; this stays a stub until it can be. ;; See: https://guix.gnu.org/manual/en/html_node/Defining-Packages.html (use-modules (guix packages) @@ -18,7 +20,7 @@ (gnu packages base)) (package - (name "{{PROJECT_NAME}}") + (name "scaffoldia") (version "0.1.0") (source (local-file "." "source" #:recursive? #t @@ -63,9 +65,13 @@ (list ;; TODO: Add runtime dependencies )) - (home-page "https://github.com/{{OWNER}}/{{PROJECT_NAME}}") - (synopsis "{{PROJECT_PURPOSE}}") - (description "RSR-compliant project. See README.adoc for details.") + (home-page "https://github.com/hyperpolymath/scaffoldia") + (synopsis "Full-featured repository designer for the RSR estate") + (description "Composes spine, variant pack, features, and profile into new +repositories, and retrofits existing ones. Consumes each variant template's +VARIANT.a2ml contract; sits at the top of the estate's scaffolding stack +(standards -> rsr-template-repo -> scaffoldia). See README.adoc for +details.") (license (list ;; MPL-2.0 extends MPL-2.0 mpl2.0))) diff --git a/build/setup.sh b/build/setup.sh index 24c7e5e..1701adf 100755 --- a/build/setup.sh +++ b/build/setup.sh @@ -1,12 +1,12 @@ #!/bin/sh # SPDX-License-Identifier: MPL-2.0 -# setup.sh — Universal setup script for rsr-template-repo +# setup.sh — Universal setup script for scaffoldia # # Detects your shell, platform, and installs prerequisites. # Then hands off to `just setup` for project-specific configuration. # # Usage: -# curl -fsSL https://raw.githubusercontent.com/hyperpolymath/rsr-template-repo/main/setup.sh | sh +# curl -fsSL https://raw.githubusercontent.com/hyperpolymath/scaffoldia/main/setup.sh | sh # # or after cloning: # ./setup.sh # @@ -167,7 +167,7 @@ install_just() { # ── Main ── main() { - printf "%s=== rsr-template-repo Setup ===%s\n\n" "$BOLD" "$RESET" + printf "%s=== scaffoldia Setup ===%s\n\n" "$BOLD" "$RESET" # Detect environment SHELL_NAME=$(detect_shell) @@ -198,8 +198,8 @@ main() { # Step 2: Check if we're in the repo directory if [ ! -f "Justfile" ] && [ ! -f "justfile" ]; then warn "Not in a repo directory (no Justfile found)" - info "Clone first: git clone https://github.com/hyperpolymath/rsr-template-repo.git" - info "Then: cd rsr-template-repo && ./setup.sh" + info "Clone first: git clone https://github.com/hyperpolymath/scaffoldia.git" + info "Then: cd scaffoldia && ./setup.sh" exit 1 fi diff --git a/docs/QUICKSTART.adoc b/docs/QUICKSTART.adoc index 754fd5e..f72fe10 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/hyperpolymath/rsr-template-repo my-project cd my-project rm -rf .git && git init -b main just init # interactive placeholder replacement diff --git a/docs/architecture/THREAT-MODEL.adoc b/docs/architecture/THREAT-MODEL.adoc index 5f36b22..c165dfe 100644 --- a/docs/architecture/THREAT-MODEL.adoc +++ b/docs/architecture/THREAT-MODEL.adoc @@ -2,18 +2,18 @@ // Copyright (c) Jonathan D.A. Jewell = Threat Model - + -# Threat Model: {{PROJECT_NAME}} +# Threat Model: Scaffoldia ## Document Info | Field | Value | |---------------|--------------------------------| -| Project | {{PROJECT_NAME}} | +| Project | Scaffoldia | | Version | 1.0 | -| Last Reviewed | {{DATE}} | -| Author | {{AUTHOR}} | +| Last Reviewed | 2026-07-27 | +| Author | Jonathan D.A. Jewell | | Methodology | STRIDE | ## Scope @@ -36,7 +36,7 @@ ## System Overview -Brief description of {{PROJECT_NAME}} and its architecture. +Brief description of Scaffoldia and its architecture. > See [STATE-VISUALIZER.adoc](../STATE-VISUALIZER.adoc) for the full architecture diagram and completion dashboard. diff --git a/docs/attribution/CITATION.cff b/docs/attribution/CITATION.cff index 05d36d9..2caa3e3 100644 --- a/docs/attribution/CITATION.cff +++ b/docs/attribution/CITATION.cff @@ -1,14 +1,14 @@ 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}}" +- family-names: "Jewell" + given-names: "Jonathan" orcid: "https://orcid.org/0000-0000-0000-0000" # Placeholder -title: "{{PROJECT_NAME}}" +title: "Scaffoldia" version: 0.1.0 -date-released: {{CURRENT_DATE}} -url: "https://{{FORGE}}/{{OWNER}}/{{REPO}}" -repository-code: "https://{{FORGE}}/{{OWNER}}/{{REPO}}" +date-released: 2026-07-27 +url: "https://github.com/hyperpolymath/scaffoldia" +repository-code: "https://github.com/hyperpolymath/scaffoldia" license: MPL-2.0 keywords: - "rsr" diff --git a/docs/attribution/CITATIONS.adoc b/docs/attribution/CITATIONS.adoc index 0a8b419..751d9de 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 += Scaffoldia - 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{Scaffoldia_2026, + author = {Jewell, Jonathan}, + title = {Scaffoldia}, + year = {2026}, + url = {https://github.com/hyperpolymath/scaffoldia}, 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.D.A. (2026) _Scaffoldia_ [Computer software]. Available at: https://github.com/hyperpolymath/scaffoldia == OSCOLA -{{AUTHOR}}, '{{PROJECT_NAME}}' ({{CURRENT_YEAR}}) +Jonathan D.A. Jewell, 'Scaffoldia' (2026) == MLA -{{AUTHOR_LAST}}, {{AUTHOR_FIRST}} "{{PROJECT_NAME}}." {{CURRENT_YEAR}}, github.com/{{OWNER}}/{{PROJECT_NAME}}. +Jewell, Jonathan "Scaffoldia." 2026, github.com/hyperpolymath/scaffoldia. == APA 7 -{{AUTHOR_LAST}}, {{AUTHOR_INITIALS}} ({{CURRENT_YEAR}}). _{{PROJECT_NAME}}_ [Computer software]. GitHub. https://github.com/{{OWNER}}/{{PROJECT_NAME}} +Jewell, J.D.A. (2026). _Scaffoldia_ [Computer software]. GitHub. https://github.com/hyperpolymath/scaffoldia == See Also diff --git a/docs/attribution/MAINTAINERS.adoc b/docs/attribution/MAINTAINERS.adoc index 7908bff..aa23a55 100644 --- a/docs/attribution/MAINTAINERS.adoc +++ b/docs/attribution/MAINTAINERS.adoc @@ -11,9 +11,9 @@ This document lists the maintainers of this project and their responsibilities. |=== | Name | Role | Contact -| {{AUTHOR}} +| Jonathan D.A. Jewell | Lead Maintainer -| https://github.com/{{OWNER}}[@{{OWNER}}] +| https://github.com/hyperpolymath[@hyperpolymath] |=== == Responsibilities diff --git a/docs/decisions/0000-template.adoc b/docs/decisions/0000-template.adoc index 6abe098..465cf47 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 - + # [NUMBER]. [TITLE] diff --git a/docs/decisions/0001-adopt-rsr-standard.adoc b/docs/decisions/0001-adopt-rsr-standard.adoc index e8c6ed5..ab983a8 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 - + # 1. Adopt Rhodium Standard Repository (RSR) Template @@ -53,7 +53,7 @@ The RSR template provides: New repositories are created by cloning the template: ```bash -git clone https://github.com/{{OWNER}}/rsr-template-repo new-repo-name +git clone https://github.com/hyperpolymath/rsr-template-repo new-repo-name cd new-repo-name rm -rf .git && git init ``` diff --git a/docs/developer/ABI-FFI-README.adoc b/docs/developer/ABI-FFI-README.adoc index 7681474..979c98b 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 +# SCAFFOLDIA 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/scaffoldia.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 libscaffoldia.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}}/ +scaffoldia/ ├── 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) +│ └── scaffoldia.h # C header (optional, can be generated) │ ├── generated/ # Auto-generated files │ └── abi/ -│ └── {{project}}.h # Generated from Idris2 ABI +│ └── scaffoldia.h # Generated from Idris2 ABI │ └── bindings/ # Language-specific wrappers (optional) ├── rust/ @@ -202,7 +202,7 @@ zig build test # Run tests ```bash cd src/abi -idris2 --cg c-header Types.idr -o ../../generated/abi/{{project}}.h +idris2 --cg c-header Types.idr -o ../../generated/abi/scaffoldia.h ``` ### Cross-Compile @@ -225,32 +225,32 @@ zig build -Dtarget=x86_64-windows ### From C ```c -#include "{{project}}.h" +#include "scaffoldia.h" int main() { - void* handle = {{project}}_init(); + void* handle = scaffoldia_init(); if (!handle) return 1; - int result = {{project}}_process(handle, 42); + int result = scaffoldia_process(handle, 42); if (result != 0) { - const char* err = {{project}}_last_error(); + const char* err = scaffoldia_last_error(); fprintf(stderr, "Error: %s\n", err); } - {{project}}_free(handle); + scaffoldia_free(handle); return 0; } ``` Compile with: ```bash -gcc -o example example.c -l{{project}} -L./zig-out/lib +gcc -o example example.c -lscaffoldia -L./zig-out/lib ``` ### From Idris2 ```idris -import {{PROJECT}}.ABI.Foreign +import Abi.Foreign main : IO () main = do @@ -267,22 +267,22 @@ main = do ### From Rust ```rust -#[link(name = "{{project}}")] +#[link(name = "scaffoldia")] 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 scaffoldia_init() -> *mut std::ffi::c_void; + fn scaffoldia_free(handle: *mut std::ffi::c_void); + fn scaffoldia_process(handle: *mut std::ffi::c_void, input: u32) -> i32; } fn main() { unsafe { - let handle = {{project}}_init(); + let handle = scaffoldia_init(); assert!(!handle.is_null()); - let result = {{project}}_process(handle, 42); + let result = scaffoldia_process(handle, 42); assert_eq!(result, 0); - {{project}}_free(handle); + scaffoldia_free(handle); } } ``` @@ -290,21 +290,21 @@ fn main() { ### From Julia ```julia -const lib{{project}} = "lib{{project}}" +const libscaffoldia = "libscaffoldia" function init() - handle = ccall((:{{project}}_init, lib{{project}}), Ptr{Cvoid}, ()) + handle = ccall((:scaffoldia_init, libscaffoldia), 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((:scaffoldia_process, libscaffoldia), Cint, (Ptr{Cvoid}, UInt32), handle, input) result end function cleanup(handle) - ccall((:{{project}}_free, lib{{project}}), Cvoid, (Ptr{Cvoid},), handle) + ccall((:scaffoldia_free, libscaffoldia), Cvoid, (Ptr{Cvoid},), handle) end # Usage @@ -358,7 +358,7 @@ When modifying the ABI/FFI: 2. **Generate C header** ```bash - idris2 --cg c-header src/abi/Types.idr -o generated/abi/{{project}}.h + idris2 --cg c-header src/abi/Types.idr -o generated/abi/scaffoldia.h ``` 3. **Update FFI implementation** (`ffi/zig/src/main.zig`) @@ -377,10 +377,10 @@ When modifying the ABI/FFI: ## License -{{LICENSE}} +MPL-2.0 ## See Also - [Idris2 Documentation](https://idris2.readthedocs.io) - [Zig Documentation](https://ziglang.org/documentation/master/) -- [Rhodium Standard Repositories](https://github.com/{{OWNER}}/rhodium-standard-repositories) +- [Rhodium Standard Repositories](https://github.com/hyperpolymath/rhodium-standard-repositories) diff --git a/docs/governance/CRG-AUDIT-TEMPLATE.adoc b/docs/governance/CRG-AUDIT-TEMPLATE.adoc index 9e61e2c..80de25f 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}} += Scaffoldia — CRG Audit (2026-07-27) +Jonathan D.A. Jewell +2026-07-27 :toc: :sectnums: @@ -18,7 +18,7 @@ == Scope and Standard -Evaluates the `{{REPO}}` repository against +Evaluates the `scaffoldia` repository against *Component Readiness Grades v2.0 (STRICT)*, 2026-03-30 revision. - Standard: `standards/component-readiness-grades/COMPONENT-READINESS-GRADES.md` @@ -27,8 +27,8 @@ Evaluates the `{{REPO}}` repository against * `.machine_readable/descriptiles/STATE.a2ml` → `grade = ""` * `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-07-27 +- 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-07-27) === 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:hyperpolymath/scaffoldia.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-07-27. |=== === Test matrix @@ -281,7 +281,7 @@ them. Examples: - `docs/READINESS.md` — per-component table. Note v1.0-vs-v2.0 schema alignment. - `.machine_readable/descriptiles/STATE.a2ml` — authoritative self-declared state. -- `docs/governance/CRG-LIFT-PLAN-{{CURRENT_DATE}}.adoc` — companion plan for +- `docs/governance/CRG-LIFT-PLAN-2026-07-27.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-STANDARDS-AUDIT.adoc b/docs/governance/TEMPLATE-STANDARDS-AUDIT.adoc index aef1d25..b0a26a7 100644 --- a/docs/governance/TEMPLATE-STANDARDS-AUDIT.adoc +++ b/docs/governance/TEMPLATE-STANDARDS-AUDIT.adoc @@ -11,13 +11,13 @@ v1.0, 2026-04-07 Audit scope: -* Repository: `rsr-template-repo` +* Repository: `scaffoldia` * Focus: root authority docs/manifests, Justfile integration, session bindings * Recursive inventory method: `rg --files -g '!.git' | sort` Inventory snapshot at audit time: -* `rsr-template-repo` total tracked files discovered: `240` +* `scaffoldia` total tracked files discovered: `240` * Session-local binding files discovered: `4` under `session/` plus `coordination.k9` == Claim Vs Actual @@ -29,9 +29,9 @@ Inventory snapshot at audit time: | Placeholder badge tokens in README | `README.adoc` | `{{OPENSSF_PROJECT_ID}}`, `{{OWNER}}`, `{{REPO}}` -| placeholder -| Template placeholders are intentional pre-bootstrap content. -| Keep; document clearly as template tokens. +| resolved (2026-07-27 instantiation cure) +| README's badges now use scaffoldia's real identity (`hyperpolymath/scaffoldia`); no placeholder tokens remain. +| Closed. | Docs links used `.adoc` files not present | legacy `README.adoc` (pre-migration) @@ -130,7 +130,7 @@ Inventory snapshot at audit time: * Any future full protocol text drafts should move to `standards/session-management-standards/`. -=== Stay In `rsr-template-repo` +=== Stay In `scaffoldia` * Local aliases, hooks, coordination wiring, and repo-local checks. @@ -152,7 +152,7 @@ Current status: [source,text] ---- -rsr-template-repo/ +scaffoldia/ README.adoc AUDIT.adoc 0-AI-MANIFEST.a2ml diff --git a/docs/onboarding/QUICKSTART-DEV.adoc b/docs/onboarding/QUICKSTART-DEV.adoc index 5be2757..f8952bd 100644 --- a/docs/onboarding/QUICKSTART-DEV.adoc +++ b/docs/onboarding/QUICKSTART-DEV.adoc @@ -1,14 +1,15 @@ // 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 +// QUICKSTART-DEV.adoc — clone → build → test → PR += scaffoldia — Quick Start for Developers :toc: :toclevels: 2 == Tech Stack -{{LANG_STACK}} +Idris2 (typed ABI/FFI seam — `src/interface/Abi/`) + Zig (FFI implementation +— `src/interface/ffi/`), coordinated via `coordination.k9` and the +`.machine_readable/descriptiles/` A2ML machine-readable design files. == Set Up Development Environment @@ -30,8 +31,8 @@ nix develop [source,bash] ---- -git clone https://github.com/hyperpolymath/rsr-template-repo.git -cd rsr-template-repo +git clone https://github.com/hyperpolymath/scaffoldia.git +cd scaffoldia just setup-dev ---- @@ -39,29 +40,30 @@ just setup-dev [source,bash] ---- -{{BUILD_CMD}} +idris2 --build abi.ipkg +cd src/interface/ffi && zig build ---- == Test [source,bash] ---- -{{TEST_CMD}} +idris2 --typecheck abi.ipkg +cd src/interface/ffi && zig build test --summary all ---- == Project Structure [source] ---- -rsr-template-repo/ -├── src/ # Source code -├── src/abi/ # Idris2 ABI definitions (if applicable) -├── ffi/zig/ # Zig FFI bridge (if applicable) -├── tests/ # Test suite +scaffoldia/ +├── src/interface/Abi/ # Idris2 ABI definitions (typed FFI seam) +├── src/interface/ffi/ # Zig FFI bridge (build.zig, src/, test/) +├── tests/ # Test suite (e2e.sh, aspect_tests.sh) ├── docs/ # Documentation ├── .machine_readable/ # Checkpoint files (STATE, META, ECOSYSTEM) ├── Justfile # Task runner recipes -├── guix.scm # Guix environment +├── build/guix.scm # Guix environment ├── flake.nix # Nix environment (fallback) └── 0-AI-MANIFEST.a2ml # AI agent entry point ---- @@ -89,10 +91,14 @@ just panic-scan # No new security issues == Contractile Invariants -Read `.machine_readable/MUST.contractile` before making changes. +Read `.machine_readable/contractiles/Mustfile.a2ml` before making changes. Key invariants that must never be violated: -{{MUST_INVARIANTS}} +* License, README, security policy, AI manifest, and governance docs present +* `.machine_readable/contractiles/` directory structure complete (must/trust/dust/intend files) +* No placeholder (`{{...}}`) values remain outside the generic-template exclusions +* No untracked files under `.machine_readable/contractiles/` +* Commits are signed == LLM/AI Agent Development @@ -108,5 +114,5 @@ Or read `0-AI-MANIFEST.a2ml` 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/hyperpolymath/scaffoldia/wiki * **Report issue**: `just help-me` diff --git a/docs/onboarding/QUICKSTART-MAINTAINER.adoc b/docs/onboarding/QUICKSTART-MAINTAINER.adoc index 9e6039e..a82be21 100644 --- a/docs/onboarding/QUICKSTART-MAINTAINER.adoc +++ b/docs/onboarding/QUICKSTART-MAINTAINER.adoc @@ -1,30 +1,33 @@ // 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 +// QUICKSTART-MAINTAINER.adoc — packaging, deploying, and maintaining += scaffoldia — Quick Start for Platform Maintainers :toc: :toclevels: 2 == Overview -This guide covers packaging, deploying, and maintaining rsr-template-repo for -distribution on your platform. +This guide covers building and packaging scaffoldia. scaffoldia is currently +a library (the design-phase RSR substrate plus a typed ABI/FFI seam), not a +standalone executable — see `.machine_readable/descriptiles/STATE.a2ml` for +the honest current state. -== Runtime Dependencies +== Build-Time Dependencies -{{DEPS}} +* Idris2 0.7.0+ (typed ABI seam, `abi.ipkg`) +* Zig 0.16+ (FFI implementation, `src/interface/ffi/`) +* `just` (task runner) == Build from Source [source,bash] ---- -git clone https://github.com/hyperpolymath/rsr-template-repo.git -cd rsr-template-repo +git clone https://github.com/hyperpolymath/scaffoldia.git +cd scaffoldia just build-release ---- -Output: `{{BUILD_OUTPUT_PATH}}` +Output: `src/interface/ffi/zig-out/lib/libscaffoldia.a` == Packaging @@ -42,19 +45,11 @@ guix build -f guix.scm nix build ---- -=== Container (Stapeln) - -[source,bash] ----- -just stapeln-export # Generates Containerfile -podman build -t rsr-template-repo . ----- - === Manual Package [source,bash] ---- -just install --prefix=/usr/local +just install prefix=/usr/local ---- Files installed: @@ -63,35 +58,21 @@ Files installed: |=== | Path | Contents -| `$PREFIX/bin/` -| Executables - -| `$PREFIX/share/{{PACKAGE_NAME}}/` -| Data files, assets - -| `$PREFIX/share/doc/{{PACKAGE_NAME}}/` -| Documentation - -| `$PREFIX/share/applications/` -| .desktop file (Linux, if GUI) - -| `$PREFIX/share/man/man1/` -| Man pages +| `$PREFIX/lib/libscaffoldia.a` +| Static library (Zig, `-Doptimize=ReleaseFast`) |=== -== Configuration - -Default config location: `$XDG_CONFIG_HOME/{{PACKAGE_NAME}}/config.toml` - -Fallback: `$HOME/.config/{{PACKAGE_NAME}}/config.toml` +NOTE: There is no packaged executable, config file, `.desktop` entry, or man +page yet — scaffoldia is a library in its design phase. This section will +grow once the composition engine ships. == Health Checks [source,bash] ---- -just doctor # Full diagnostic -just run --version # Version check -just run --selftest # Built-in self-test +just doctor # Full diagnostic (tool checks, hardcoded-path scan) +just build # Confirms the Idris2 ABI + Zig FFI both compile +just test # Confirms the Idris2 ABI typechecks + Zig tests pass ---- == Updating @@ -100,31 +81,17 @@ just run --selftest # Built-in self-test ---- git pull just build-release -just install --prefix=/usr/local +just install prefix=/usr/local ---- -Or via OPSM: `opsm update {{PACKAGE_NAME}}` - == Security Notes -* License: MPL-2.0 (Palimpsest License) +* License: MPL-2.0 (Palimpsest MPL — see docs/legal/EXHIBIT-A-ETHICAL-USE.txt, docs/legal/EXHIBIT-B-QUANTUM-SAFE.txt) * All dependencies SHA-pinned -* `panic-attacker` scan results: link:INSTALL-SECURITY-REPORT.adoc[] +* `panic-attacker` scan results: link:../reports/security/README.adoc[] * OpenSSF Scorecard: see badge in README -== Multi-Instance Deployment - -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 ----- - -Each instance has isolated config, data, and logs. - == Reporting Issues -* Upstream: https://github.com/hyperpolymath/rsr-template-repo/issues +* Upstream: https://github.com/hyperpolymath/scaffoldia/issues * With diagnostic: `just help-me` (pre-fills context) diff --git a/docs/onboarding/QUICKSTART-USER.adoc b/docs/onboarding/QUICKSTART-USER.adoc index 0893e63..6218d79 100644 --- a/docs/onboarding/QUICKSTART-USER.adoc +++ b/docs/onboarding/QUICKSTART-USER.adoc @@ -1,125 +1,68 @@ // 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 +// QUICKSTART-USER.adoc — what using scaffoldia means today += scaffoldia — Quick Start for Users :toc: :toclevels: 2 -== What is rsr-template-repo? +[NOTE] +==== +*Status: design phase.* scaffoldia does not yet have an installable +end-user application — there is no `just run`, `just uninstall`, or `just +heal` recipe, because there is nothing yet to run. What exists today is the +RSR substrate plus a typed ABI/FFI seam (Idris2 + Zig) that the composition +engine will build on. See `.machine_readable/descriptiles/STATE.a2ml` for +the honest current state. -Rsr Template Repo — See README.adoc for details. +If you want to *develop* scaffoldia (build it, run its tests, contribute), +see link:QUICKSTART-DEV.adoc[QUICKSTART-DEV.adoc] instead — that is the +accurate quick start for this repository right now. +==== -== Prerequisites +== What is scaffoldia? -Before you begin, ensure you have: +Full-featured repository designer for the RSR (Rhodium Standard Repository) +estate: composes spine × variant pack × features × profile into new +repositories, and retrofits existing ones. It sits at the top of the +estate's scaffolding stack: `standards → rsr-template-repo → scaffoldia`. +See README.adoc, "What this is", for the full description. -* **just** — task runner (https://github.com/casey/just[install guide]) -* Platform-specific requirements listed below +== Prerequisites (to build it yourself) -[cols="1,3"] -|=== -| Platform | Additional Requirements +* Git 2.40+ +* `just` — task runner (https://github.com/casey/just[install guide]) +* Idris2 0.7.0+ and Zig 0.16+ (see link:QUICKSTART-DEV.adoc[QUICKSTART-DEV.adoc]) -| Linux -| See README.adoc - -| macOS -| See README.adoc - -| Windows -| See README.adoc -|=== - -== Install - -=== Option 1: Standard Install (recommended) +== Build [source,bash] ---- -# Clone and set up -git clone https://github.com/hyperpolymath/rsr-template-repo.git -cd rsr-template-repo -just setup +git clone https://github.com/hyperpolymath/scaffoldia.git +cd scaffoldia +just build ---- -The setup script will: - -* Detect your platform and shell -* Install missing dependencies (with your permission) -* Configure the application -* Offer install location choices -* Run a self-diagnostic to verify everything works - -=== Option 2: Container (via Stapeln) - -[source,bash] ----- -just stapeln-run ----- - -=== Option 3: Portable (no system changes) - -[source,bash] ----- -just install --portable --prefix=./rsr-template-repo-portable ----- - -== First Run - -[source,bash] ----- -just run ----- - -Expected output: - -[source] ----- -Rsr Template Repo started successfully. ----- +This builds the typed ABI (Idris2, `abi.ipkg`) and the FFI implementation +(Zig, `src/interface/ffi/`) into a static library. There is no interactive +application to run yet. == Self-Diagnostic -If something isn't working: - [source,bash] ---- just doctor ---- -This checks all dependencies, permissions, paths, and connectivity. -If it finds issues, it will suggest fixes. - -To attempt automatic repair: - -[source,bash] ----- -just heal ----- +Checks required tools and scans for hardcoded paths. == Get Help -* **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 - -== Uninstall - -[source,bash] ----- -just uninstall ----- - -You will be asked: - -1. Which uninstall tier (Bennett reversible, parameter-based, standard, or secure) -2. Whether to include or exclude your data -3. Whether to clear caches and LLM models +* **Wiki**: https://github.com/hyperpolymath/scaffoldia/wiki == Next Steps -* Read the link:README.adoc[README] for full feature overview -* Read the link:EXPLAINME.adoc[EXPLAINME] for architecture and design decisions -* Try `just tour` for a guided walkthrough +* Read the link:../../README.adoc[README] for the full overview +* Read the link:../../EXPLAINME.adoc[EXPLAINME] for architecture and design decisions +* Read link:QUICKSTART-DEV.adoc[QUICKSTART-DEV.adoc] if you intend to build, test, or contribute diff --git a/docs/onboarding/llm-warmup-dev.adoc b/docs/onboarding/llm-warmup-dev.adoc index f12ada8..def29af 100644 --- a/docs/onboarding/llm-warmup-dev.adoc +++ b/docs/onboarding/llm-warmup-dev.adoc @@ -1,18 +1,16 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -= LLM Warmup — rsr-template-repo (Developer) += LLM Warmup — scaffoldia (Developer) -== What is rsr-template-repo? +== What is scaffoldia? See `README.adoc` for overview. == Key Commands -* `just setup` — set up development environment -* `just build` — build the project +* `just build` — build the project (Idris2 ABI + Zig FFI) * `just test` — run tests * `just doctor` — diagnose issues -* `just heal` — attempt auto-repair == Quick Context diff --git a/docs/onboarding/llm-warmup-user.adoc b/docs/onboarding/llm-warmup-user.adoc index 2127530..edb6e8d 100644 --- a/docs/onboarding/llm-warmup-user.adoc +++ b/docs/onboarding/llm-warmup-user.adoc @@ -1,18 +1,17 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -= LLM Warmup — rsr-template-repo (User) += LLM Warmup — scaffoldia (User) -== What is rsr-template-repo? +== What is scaffoldia? -See `README.adoc` for overview. +See `README.adoc` for overview. There is no installable end-user application +yet (design phase) — see `docs/onboarding/QUICKSTART-USER.adoc`. == Key Commands -* `just setup` — set up development environment -* `just build` — build the project +* `just build` — build the project (Idris2 ABI + Zig FFI) * `just test` — run tests * `just doctor` — diagnose issues -* `just heal` — attempt auto-repair == Quick Context diff --git a/docs/practice/AI-CONVENTIONS.adoc b/docs/practice/AI-CONVENTIONS.adoc index 868015d..fa35643 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 - + # AI Conventions (Authoritative Source) @@ -29,9 +29,9 @@ Per-tool config files (.cursorrules, .clinerules, etc.) reference this document. ## 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 (hyperpolymath) ` ## State Files diff --git a/docs/practice/STATE-VISUALIZER-GUIDE.adoc b/docs/practice/STATE-VISUALIZER-GUIDE.adoc index 49dfd55..6252911 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 (hyperpolymath) :toc: :sectnums: @@ -153,4 +153,4 @@ _structured data_ for tooling. Both should agree. == Copyright -Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}> +Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) diff --git a/docs/status/PROOF-NEEDS.adoc b/docs/status/PROOF-NEEDS.adoc index 96b529d..412147d 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 — SCAFFOLDIA == Proof Tier diff --git a/docs/status/PROOF-STATUS.adoc b/docs/status/PROOF-STATUS.adoc index aca702c..0b355ff 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 // Tracks proof completion. Requirements defined in PROOF-NEEDS.adoc -= Proof Status — {{PROJECT}} += Proof Status — SCAFFOLDIA == Summary diff --git a/docs/status/READINESS.adoc b/docs/status/READINESS.adoc index 51dfcd5..45f3faa 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 += Scaffoldia 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/hyperpolymath/standards/tree/main/component-readiness-grades[Component Readiness Grades (CRG) v2.0 STRICT] + +*Assessed:* 2026-07-27 + +*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-07-27) [cols="2,3,3", options="header"] |=== @@ -67,7 +67,7 @@ Below B, any publication must be explicitly abstract or provisional. | Test count | __ | `.machine_readable/descriptiles/STATE.a2ml` 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-07-27 | 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-07-27 +| __ | … | … | … | … | 2026-07-27 +| __ | … | … | … | … | 2026-07-27 |=== *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-07-27) * 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`). + `docs/governance/CRG-AUDIT-TEMPLATE.adoc`, already present in this repo). * `docs/practice/DOGFOOD-LOG.adoc` — dated dogfood evidence (required for C). * `.machine_readable/descriptiles/STATE.a2ml` — authoritative state (canonical keys `[dogfooding-status]`, `[external-targets]`, `[issues-fed-back]`, diff --git a/docs/status/TEST-NEEDS.adoc b/docs/status/TEST-NEEDS.adoc index 59fbf85..cd165c3 100644 --- a/docs/status/TEST-NEEDS.adoc +++ b/docs/status/TEST-NEEDS.adoc @@ -1,118 +1,64 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell -= TEST-NEEDS: rsr-template-repo += TEST-NEEDS: scaffoldia -== CRG Grade: C — ACHIEVED 2026-04-04 +== Current State (Updated 2026-07-27 — instantiation cure) -== Current State (Updated 2026-04-04) +This file previously described the template's own dogfooding of its +now-deleted validation machinery (`scripts/validate-template.sh`, +`tests/e2e/template_instantiation_test.sh`). Those scripts existed only to +validate an *un-instantiated* RSR template and made no sense once scaffoldia +was instantiated with its own real identity — they have been removed. This +section instead describes the test infrastructure scaffoldia actually has. [cols="2,1,4", options="header"] |=== | Category | Count | Details -| *Source modules* | 6 | 3 Idris2 ABI (Foreign, Layout, Types), 2 Zig FFI (build, main), 1 Zig integration test template -| *Unit tests* | 0 | None in main source (inline tests in main.zig) -| *Integration tests* | 1 | `test/integration_test.zig` (documented template, 1 placeholder test) -| *E2E tests* | 1 | `tests/e2e/template_instantiation_test.sh` (full instantiation + validation) -| *Workflow tests* | 1 | `tests/workflows/validate_workflows_test.sh` (21 workflows validated) -| *Validation tests* | 1 | `scripts/validate-template.sh` (8-phase comprehensive validation) -| *Benchmarks* | 5 | `benches/template_bench.sh` (validation, Zig build, tests, workflows, instantiation) -| *Fuzz tests* | 0 | `README.adoc` scaffold with harness instructions +| *Source modules* | 6 | 3 Idris2 ABI (Foreign, Layout, Types), 2 Zig FFI (build.zig, main.zig), 1 Zig integration test module +| *Unit tests* | 3 | Inline `test` blocks in `src/interface/ffi/src/main.zig` (lifecycle, error handling, version) +| *Integration tests* | 10 | `src/interface/ffi/test/integration_test.zig` — real tests against the exported FFI (lifecycle, operations, strings, version, build_info, error handling) +| *E2E tests* | 1 | `tests/e2e.sh` — real preflight + `idris2 --build abi.ipkg` + `zig build`/`zig build test` +| *Aspect tests* | 1 | `tests/aspect_tests.sh` — SPDX header coverage + dangerous-pattern grep (real, pre-existing, unchanged by the cure) +| *Workflow tests* | 1 | `tests/workflows/validate_workflows_test.sh` (unchanged by the cure) +| *Benchmarks* | 3 | `benches/template_bench.sh` — Zig build, Zig tests, workflow validation |=== -== Completed Work (CRG C - Testing & Benchmarking) - -=== Template Validation Script ✅ - -* [x] `scripts/validate-template.sh` — 8-phase validation -** Phase 1: Core repository structure (root files, directories) -** Phase 2: Machine-readable metadata (`.machine_readable/`) -** Phase 3: GitHub Actions workflows (17 required + all present) -** Phase 4: Idris2 ABI and Zig FFI source files -** Phase 5: Placeholder token replacement (skipped in template) -** Phase 6: SPDX license headers (100% coverage, 6/6 files) -** Phase 7: Build system verification (`zig build` + `idris2` syntax check) -** Phase 8: Documentation requirements (TOPOLOGY, ABI-FFI-README, etc) -* Status: *PASSING* (0 errors, 3 warnings about template placeholders) - -=== E2E Template Instantiation Test ✅ - -* [x] `tests/e2e/template_instantiation_test.sh` — full workflow -** Clones template to temp directory -** Replaces all `{{PLACEHOLDER}}` tokens with test values -** Validates resulting structure with `scripts/validate-template.sh` -** Verifies Zig build works after instantiation -** Checks no remaining placeholders -** Cleans up temp directory -* Status: *READY TO TEST* (can be verified by CI) - -=== Workflow Validation Test ✅ - -* [x] `tests/workflows/validate_workflows_test.sh` -** Validates all 21 workflows exist and have proper structure -** Checks SPDX headers, `name` field -** Verifies all 15 required workflows present -* Status: *PASSING* (0 errors, 15/15 required workflows found) - -=== Zig FFI Tests ✅ - -* [x] `src/interface/ffi/test/integration_test.zig` — template with examples -** Converted from `{{project}}` placeholders to "template" namespace -** Added comprehensive comments for how to instantiate -** Tests grouped by category (lifecycle, operations, strings, errors, version, memory safety, threading) -** Compiles and passes placeholder test -* Status: *PASSING* (1 test: `placeholder_test_implementation_required` passes) - -=== Benchmarks ✅ - -* [x] `benches/template_bench.sh` — 5 benchmark suites -** Validation script: ~5.8s average (3 runs) -** Zig build: ~19ms (clean build) -** Zig tests: ~20ms -** Workflow validation: ~117ms -** Template instantiation: ~427ms -* Formats: human, json, csv -* Status: *PASSING* (all benchmarks execute) - -=== Build System ✅ - -* [x] `src/interface/ffi/build.zig` — updated for Zig 0.15.2 -** Simplified to test-only configuration -** Supports both unit tests and integration tests -** Works with `zig build` without errors -* Status: *PASSING* (builds successfully) - -== Test Results Summary - ----- -Validation Script: PASS (0 errors, 3 warnings) -Workflow Validation: PASS (21/21 workflows valid) -Integration Tests: PASS (1/1 placeholder test) -E2E Instantiation: READY (needs CI confirmation) -Benchmarks: PASS (5/5 benchmark suites) -Build System: PASS (zig build succeeds) ----- - -== CRG C Compliance - -* *Coverage*: 6/6 test categories (unit, integration, E2E, workflow, validation, benchmarks) -* *Documentation*: All test files have SPDX headers + inline documentation -* *Author Attribution*: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> -* *License*: MPL-2.0 on all new files -* *Automation*: All scripts executable + working - -== FLAGGED ISSUES - ALL RESOLVED - -* [.line-through]#*Template repo used by ALL new repos has 0 validation tests*# → FIXED: 4 test suites + validation script -* [.line-through]#*fuzz/placeholder.txt*# → FIXED: replaced with `README.adoc` containing real harness instructions -* [.line-through]#*No E2E tests for template instantiation*# → FIXED: full E2E test suite -* [.line-through]#*Zig FFI integration tests are placeholders*# → FIXED: converted to documented template format +== Zig Build & Test (Verified) + +* `zig fmt --check .` — exit 0 +* `cd src/interface/ffi && zig build` — exit 0 +* `cd src/interface/ffi && zig build test --summary all` — exit 0, **13/13 tests pass** (3 unit + 10 integration) +* `idris2 --build abi.ipkg` — exit 0 (2 pre-existing shadowing warnings in `Abi.Layout`, unrelated to this cure, out of scope) + +== What Changed From the Template State + +* [.line-through]#`scripts/validate-template.sh` (8-phase template validation)# → REMOVED (validated an un-instantiated template; scaffoldia is instantiated) +* [.line-through]#`tests/e2e/template_instantiation_test.sh`# → REMOVED (same reason) +* `src/interface/ffi/build.zig` was a no-op stub (Zig 0.15-era comment claiming + tests "are run directly with zig build-exe -ftest-runner") → now a real + `build.zig`: static library target + `zig build test` wired to both the + main module and the integration-test module. +* `src/interface/ffi/src/main.zig` had three real Zig 0.16 compile bugs + beyond placeholder substitution (`opaque` type with fields; `callconv(.C)` + invalid casing; `std.heap.c_allocator` used without linking libc) — fixed. +* `src/interface/ffi/test/integration_test.zig` was a fully-commented-out + placeholder (`test "placeholder test - implementation required"`) → now 10 + real tests exercising every exported `scaffoldia_*` function. +* `tests/e2e.sh` was a fully-commented-out template with only a preflight + header → now runs the real Idris2 build + Zig build/test and reports + PASS/FAIL with the script's existing `check`/`green`/`red` helpers. +* `benches/template_bench.sh` — the "Template Validation" and "Template + Instantiation" benchmark sections (which called the two now-deleted + scripts) were removed; the Zig build/test and workflow-validation + benchmarks were kept and renumbered. + +== Author Attribution + +Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> == Next Steps (Future Sessions) -* [ ] Integrate test scripts into CI/CD workflows +* [ ] Integrate `just test-all` into CI/CD workflows * [ ] Generate test coverage reports -* [ ] Add more specialized benchmarks (memory, threading stress) -* [ ] Document test instantiation patterns for new repos - -== Priority: P0 (COMPLETE) ✅ +* [ ] Add benchmarks for the composition engine once it exists (currently design phase — see `.machine_readable/descriptiles/STATE.a2ml`) diff --git a/examples/web-project-deno.json b/examples/web-project-deno.json index 028e4f1..5ddd3bd 100644 --- a/examples/web-project-deno.json +++ b/examples/web-project-deno.json @@ -10,7 +10,7 @@ "imports": { "rescript": "^12.0.0", "@rescript/core": "npm:@rescript/core@^1.6.0", - "safe-dom/": "https://raw.githubusercontent.com/{{OWNER}}/rescript-dom-mounter/main/src/", + "safe-dom/": "https://raw.githubusercontent.com/hyperpolymath/rescript-dom-mounter/main/src/", "proven/": "../proven/bindings/rescript/src/" }, "compilerOptions": { diff --git a/scripts/validate-template.sh b/scripts/validate-template.sh deleted file mode 100755 index 243aeef..0000000 --- a/scripts/validate-template.sh +++ /dev/null @@ -1,384 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: MPL-2.0 -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -# -# RSR Template Validation Script -# Verifies that a repository follows the RSR template structure and contains all required files -# -# Exit codes: -# 0 = validation passed -# 1 = validation failed with errors -# 2 = validation failed with warnings (but can proceed) - -set -euo pipefail - -REPO_ROOT="${1:-.}" -VERBOSE="${2:-0}" -ERRORS=0 -WARNINGS=0 - -# ANSI colors -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -NC='\033[0m' # No Color - -# Helper functions -log_error() { - echo -e "${RED}ERROR${NC}: $*" >&2 - ERRORS=$((ERRORS + 1)) -} - -log_warning() { - echo -e "${YELLOW}WARN${NC}: $*" >&2 - WARNINGS=$((WARNINGS + 1)) -} - -log_info() { - echo -e "${BLUE}INFO${NC}: $*" >&2 -} - -log_pass() { - echo -e "${GREEN}PASS${NC}: $*" >&2 -} - -check_file_exists() { - local file="$1" - local description="${2:-}" - if [ -f "$REPO_ROOT/$file" ]; then - [ "$VERBOSE" = "1" ] && log_pass "File exists: $file" - return 0 - else - log_error "Required file missing: $file ${description:+(${description})}" - return 1 - fi -} - -check_dir_exists() { - local dir="$1" - local description="${2:-}" - if [ -d "$REPO_ROOT/$dir" ]; then - [ "$VERBOSE" = "1" ] && log_pass "Directory exists: $dir" - return 0 - else - log_error "Required directory missing: $dir ${description:+(${description})}" - return 1 - fi -} - -# Case-tolerant ABI seam checks: accept the canonical case-consistent -# src/interface/Abi/ (matches `module Abi.*`) OR a lowercase src/interface/abi/ -# that some downstream repos ship. Never require BOTH (that would be a case-fold -# collision on case-insensitive filesystems). -check_abi_dir_exists() { - local description="${1:-}" - if [ -d "$REPO_ROOT/src/interface/Abi" ] || [ -d "$REPO_ROOT/src/interface/abi" ]; then - [ "$VERBOSE" = "1" ] && log_pass "Directory exists: src/interface/{Abi,abi}" - return 0 - fi - log_error "Required directory missing: src/interface/Abi ${description:+(${description})}" - return 1 -} -check_abi_file_exists() { - local fname="$1" - local description="${2:-}" - if [ -f "$REPO_ROOT/src/interface/Abi/$fname" ] || [ -f "$REPO_ROOT/src/interface/abi/$fname" ]; then - [ "$VERBOSE" = "1" ] && log_pass "File exists: src/interface/{Abi,abi}/$fname" - return 0 - fi - log_error "Required file missing: src/interface/Abi/$fname ${description:+(${description})}" - return 1 -} - -has_spdx_header() { - local file="$1" - if head -10 "$file" | grep -q "SPDX-License-Identifier"; then - return 0 - fi - return 1 -} - -has_placeholder() { - local file="$1" - if grep -q "{{REPO\|{{OWNER\|{{FORGE\|{{PROJECT\|{{project\|{{AUTHOR" "$file" 2>/dev/null; then - return 0 - fi - return 1 -} - -#============================================================================== -# VALIDATION PHASE 1: CORE STRUCTURE -#============================================================================== - -echo "" -log_info "Phase 1: Core repository structure" -echo "" - -# Root files -check_file_exists "0-AI-MANIFEST.a2ml" "AI manifest (universal entry point)" -check_file_exists "README.adoc" "High-level pitch" -check_file_exists "EXPLAINME.adoc" "Developer deep-dive" -check_file_exists "LICENSE" "License file" -check_file_exists "Justfile" "Task runner" -check_file_exists "AUDIT.adoc" "Release audit gate" - -# Directories -check_dir_exists ".machine_readable" "Machine-readable metadata" -check_dir_exists ".github" "GitHub community metadata" -check_abi_dir_exists "Idris2 ABI definitions" -check_dir_exists "src/interface/ffi" "Zig FFI implementation" -check_dir_exists "src/interface/generated/abi" "Generated C headers" -check_dir_exists "docs" "Documentation" - -#============================================================================== -# VALIDATION PHASE 2: MACHINE-READABLE METADATA -#============================================================================== - -echo "" -log_info "Phase 2: Machine-readable metadata (.machine_readable/)" -echo "" - -check_file_exists ".machine_readable/descriptiles/STATE.a2ml" "Project state" -check_file_exists ".machine_readable/descriptiles/META.a2ml" "Architecture decisions" -check_file_exists ".machine_readable/descriptiles/ECOSYSTEM.a2ml" "Ecosystem position" -check_file_exists ".machine_readable/descriptiles/anchors/ANCHOR.a2ml" "Semantic boundary anchor" -check_file_exists ".machine_readable/policies/MAINTENANCE-AXES.a2ml" "Maintenance axes" - -#============================================================================== -# VALIDATION PHASE 3: REQUIRED WORKFLOWS (17 minimum) -#============================================================================== - -echo "" -log_info "Phase 3: GitHub Actions workflows" -echo "" - -REQUIRED_WORKFLOWS=( - "hypatia-scan.yml" - "codeql.yml" - "scorecard.yml" - "quality.yml" - "mirror.yml" - "instant-sync.yml" - "guix-nix-policy.yml" - "rsr-antipattern.yml" - "security-policy.yml" - "wellknown-enforcement.yml" - "workflow-linter.yml" - "npm-bun-blocker.yml" - "ts-blocker.yml" - "scorecard-enforcer.yml" - "secret-scanner.yml" -) - -# Check required workflows -for workflow in "${REQUIRED_WORKFLOWS[@]}"; do - if [ -f "$REPO_ROOT/.github/workflows/$workflow" ]; then - [ "$VERBOSE" = "1" ] && log_pass "Workflow found: $workflow" - else - log_error "Required workflow missing: $workflow" - fi -done - -# Verify all workflows have SPDX headers and proper structure -WORKFLOW_FILES=$(find "$REPO_ROOT/.github/workflows" -name "*.yml" -type f 2>/dev/null || true) -WORKFLOW_COUNT=$(echo "$WORKFLOW_FILES" | grep -c "." || true) - -if [ "$WORKFLOW_COUNT" -ge 15 ]; then - log_pass "Found $WORKFLOW_COUNT workflows (>= 15 expected)" -else - log_warning "Found only $WORKFLOW_COUNT workflows (expected >= 15)" -fi - -# Spot-check workflow files for issues -while IFS= read -r workflow_file; do - if [ -z "$workflow_file" ]; then continue; fi - - # Check for SPDX header (optional in YAML workflows, but best practice) - if ! head -5 "$workflow_file" | grep -q "SPDX-License-Identifier"; then - log_warning "Workflow missing SPDX header: $(basename "$workflow_file")" - fi - - # Check for proper YAML structure - if ! grep -q "^name:" "$workflow_file"; then - log_error "Workflow missing 'name' field: $(basename "$workflow_file")" - fi -done <<< "$WORKFLOW_FILES" - -#============================================================================== -# VALIDATION PHASE 4: ABI/FFI SOURCE FILES -#============================================================================== - -echo "" -log_info "Phase 4: Idris2 ABI and Zig FFI source files" -echo "" - -# Idris2 ABI files -check_abi_file_exists "Types.idr" "Core type definitions" -check_abi_file_exists "Layout.idr" "Memory layout specifications" -check_abi_file_exists "Foreign.idr" "FFI foreign declarations" - -# Zig FFI files -check_file_exists "src/interface/ffi/build.zig" "Zig build configuration" -check_file_exists "src/interface/ffi/src/main.zig" "Zig implementation" -check_file_exists "src/interface/ffi/test/integration_test.zig" "Integration tests" - -#============================================================================== -# VALIDATION PHASE 5: PLACEHOLDER TOKENS -#============================================================================== - -echo "" -log_info "Phase 5: Placeholder token replacement (skipped in template repo)" -echo "" - -# Note: Template repo is allowed to have placeholders -# For derived repos, we'd check that placeholders are replaced -if [ "$(basename "$REPO_ROOT")" = "rsr-template-repo" ]; then - log_pass "Skipping placeholder check for template repo" -else - # Check that key files don't have unresolved placeholders - for file in "$REPO_ROOT/README.adoc" "$REPO_ROOT/Justfile" "$REPO_ROOT/.machine_readable/descriptiles/STATE.a2ml"; do - if [ -f "$file" ]; then - if has_placeholder "$file"; then - log_warning "File contains unresolved placeholders: $(basename "$file")" - fi - fi - done -fi - -#============================================================================== -# VALIDATION PHASE 6: SPDX LICENSE HEADERS -#============================================================================== - -echo "" -log_info "Phase 6: SPDX License Headers" -echo "" - -# Check source files for SPDX headers (excluding build artifacts) -SOURCE_FILES=$(find "$REPO_ROOT/src" -type f \( -name "*.idr" -o -name "*.zig" \) \ - ! -path "*/.zig-cache/*" ! -path "*/zig-cache/*" 2>/dev/null || true) -SOURCE_COUNT=$(echo "$SOURCE_FILES" | grep -c "." || true) -SPDX_COUNT=0 - -while IFS= read -r src_file; do - if [ -z "$src_file" ]; then continue; fi - if has_spdx_header "$src_file"; then - SPDX_COUNT=$((SPDX_COUNT + 1)) - else - log_warning "Source file missing SPDX header: $(basename "$src_file")" - fi -done <<< "$SOURCE_FILES" - -if [ "$SOURCE_COUNT" -gt 0 ]; then - PERCENT=$((SPDX_COUNT * 100 / SOURCE_COUNT)) - log_pass "SPDX headers: $SPDX_COUNT/$SOURCE_COUNT ($PERCENT%)" - if [ "$PERCENT" -lt 100 ]; then - log_warning "Not all source files have SPDX headers" - fi -fi - -#============================================================================== -# VALIDATION PHASE 7: BUILD VERIFICATION -#============================================================================== - -echo "" -log_info "Phase 7: Build system verification" -echo "" - -# Check Zig build -if [ -f "$REPO_ROOT/src/interface/ffi/build.zig" ]; then - if command -v zig &> /dev/null; then - cd "$REPO_ROOT/src/interface/ffi" - if zig build 2>&1 | grep -q "error"; then - log_error "Zig build failed" - else - log_pass "Zig build successful" - fi - cd - > /dev/null - else - log_warning "Zig compiler not found - skipping Zig build check" - fi -else - log_error "Zig build.zig not found" -fi - -# Check Idris2. Prefer a REAL typecheck via the package (abi.ipkg sets the -# sourcedir so the `module Abi.*` namespace resolves); this catches namespace / -# path / import breakage that a bare per-file `idris2 --check` masks as a -# tolerated "module name does not match file name" warning. -if command -v idris2 &> /dev/null; then - if [ -f "$REPO_ROOT/abi.ipkg" ]; then - if (cd "$REPO_ROOT" && idris2 --typecheck abi.ipkg) > /dev/null 2>&1; then - log_pass "Idris2 ABI typechecks (abi.ipkg)" - else - log_error "Idris2 ABI does NOT typecheck (abi.ipkg)" - fi - else - # No package: fall back to a best-effort per-file syntax check (warns on - # the expected namespace/path mismatch). Look in either case of the dir. - IDS_FILES=$(find "$REPO_ROOT/src/interface/Abi" "$REPO_ROOT/src/interface/abi" -name "*.idr" -type f 2>/dev/null || true) - while IFS= read -r ids_file; do - if [ -z "$ids_file" ]; then continue; fi - if ! idris2 --check "$ids_file" 2>&1 | grep -q "Error"; then - log_pass "Idris2 syntax OK: $(basename "$ids_file")" - else - log_warning "Idris2 syntax issue: $(basename "$ids_file")" - fi - done <<< "$IDS_FILES" - fi -else - log_warning "Idris2 compiler not found - skipping Idris2 syntax checks" -fi - -#============================================================================== -# VALIDATION PHASE 8: DOCUMENTATION -#============================================================================== - -echo "" -log_info "Phase 8: Documentation requirements" -echo "" - -check_file_exists "docs/developer/ABI-FFI-README.adoc" "ABI/FFI documentation" -# TOPOLOGY may live at root or under docs/architecture/, .md or .adoc -if [ -f "$REPO_ROOT/TOPOLOGY.adoc" ] || [ -f "$REPO_ROOT/TOPOLOGY.md" ] || \ - [ -f "$REPO_ROOT/docs/architecture/TOPOLOGY.adoc" ] || [ -f "$REPO_ROOT/docs/architecture/TOPOLOGY.md" ]; then - [ "$VERBOSE" = "1" ] && log_pass "Architecture topology found" -else - log_error "Required file missing: TOPOLOGY (root or docs/architecture/, .adoc or .md)" -fi -# CONTRIBUTING.md may live at root or in .github/ (GitHub auto-discovers either) -if [ -f "$REPO_ROOT/CONTRIBUTING.md" ] || [ -f "$REPO_ROOT/.github/CONTRIBUTING.md" ]; then - [ "$VERBOSE" = "1" ] && log_pass "Contribution guide found" -else - log_error "Required file missing: CONTRIBUTING.md (root or .github/)" -fi - -# Governance can be at root or in docs/governance/ -if [ -f "$REPO_ROOT/GOVERNANCE.adoc" ] || [ -f "$REPO_ROOT/GOVERNANCE.md" ] || [ -d "$REPO_ROOT/docs/governance" ]; then - [ "$VERBOSE" = "1" ] && log_pass "Governance files found" -else - log_warning "Governance documentation not found" -fi - -#============================================================================== -# VALIDATION SUMMARY -#============================================================================== - -echo "" -echo "═══════════════════════════════════════════════════════════════════════════════" -echo "VALIDATION SUMMARY" -echo "═══════════════════════════════════════════════════════════════════════════════" -echo "" -echo -e "Errors: ${RED}${ERRORS}${NC}" -echo -e "Warnings: ${YELLOW}${WARNINGS}${NC}" -echo "" - -if [ "$ERRORS" -eq 0 ]; then - echo -e "${GREEN}✓ Validation PASSED${NC}" - [ "$WARNINGS" -gt 0 ] && echo -e " (with $WARNINGS warnings)" - exit 0 -else - echo -e "${RED}✗ Validation FAILED${NC}" - echo " Please fix the errors above." - exit 1 -fi diff --git a/src/interface/ffi/build.zig b/src/interface/ffi/build.zig index 2607c11..356d340 100644 --- a/src/interface/ffi/build.zig +++ b/src/interface/ffi/build.zig @@ -1,19 +1,53 @@ // SPDX-License-Identifier: MPL-2.0 // Copyright (c) Jonathan D.A. Jewell // -// Template FFI Build Configuration (Zig 0.15.2+) -// Note: This is a minimal build file that demonstrates Zig integration +// Scaffoldia FFI Build Configuration (Zig 0.16+) const std = @import("std"); pub fn build(b: *std.Build) void { - _ = b.standardTargetOptions(.{}); - _ = b.standardOptimizeOption(.{}); - - // In Zig 0.15+, tests are run directly with: - // zig build-exe -ftest-runner src/main.zig - // zig build-exe -ftest-runner test/integration_test.zig - // - // This minimal build file provides scaffolding for future expansion. - // Tests can be invoked via command line without explicit build.zig configuration. + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + // Main FFI implementation module — links libc because it uses + // std.heap.c_allocator. + const main_mod = b.createModule(.{ + .root_source_file = b.path("src/main.zig"), + .target = target, + .optimize = optimize, + .link_libc = true, + }); + + const lib = b.addLibrary(.{ + .name = "scaffoldia", + .linkage = .static, + .root_module = main_mod, + }); + b.installArtifact(lib); + + const main_tests = b.addTest(.{ + .root_module = main_mod, + }); + const run_main_tests = b.addRunArtifact(main_tests); + + // Integration test module — imports the main module by name so it can + // exercise the exported FFI functions directly (not just via the C ABI). + const integration_mod = b.createModule(.{ + .root_source_file = b.path("test/integration_test.zig"), + .target = target, + .optimize = optimize, + .link_libc = true, + .imports = &.{ + .{ .name = "scaffoldia", .module = main_mod }, + }, + }); + + const integration_tests = b.addTest(.{ + .root_module = integration_mod, + }); + const run_integration_tests = b.addRunArtifact(integration_tests); + + const test_step = b.step("test", "Run unit and integration tests"); + test_step.dependOn(&run_main_tests.step); + test_step.dependOn(&run_integration_tests.step); } diff --git a/src/interface/ffi/src/main.zig b/src/interface/ffi/src/main.zig index f1b2633..9d576ab 100644 --- a/src/interface/ffi/src/main.zig +++ b/src/interface/ffi/src/main.zig @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MPL-2.0 // Copyright (c) Jonathan D.A. Jewell -// {{PROJECT}} FFI Implementation +// SCAFFOLDIA FFI Implementation // // This module implements the C-compatible FFI declared in src/abi/Foreign.idr // All types and layouts must match the Idris2 ABI definitions. @@ -10,7 +10,7 @@ const std = @import("std"); // Version information (keep in sync with project) const VERSION = "0.1.0"; -const BUILD_INFO = "{{PROJECT}} built with Zig " ++ @import("builtin").zig_version_string; +const BUILD_INFO = "SCAFFOLDIA built with Zig " ++ @import("builtin").zig_version_string; /// Thread-local error storage threadlocal var last_error: ?[]const u8 = null; @@ -38,8 +38,10 @@ pub const Result = enum(c_int) { null_pointer = 4, }; -/// Library handle (opaque to prevent direct access) -pub const Handle = opaque { +/// Library handle. Still opaque to C callers (they only ever see a pointer), +/// but cannot be declared `opaque {}` in Zig since opaque types may not have +/// fields. +pub const Handle = struct { // Internal state hidden from C allocator: std.mem.Allocator, initialized: bool, @@ -52,7 +54,7 @@ pub const Handle = opaque { /// Initialize the library /// Returns a handle, or null on failure -export fn {{project}}_init() ?*Handle { +pub export fn scaffoldia_init() ?*Handle { const allocator = std.heap.c_allocator; const handle = allocator.create(Handle) catch { @@ -71,7 +73,7 @@ export fn {{project}}_init() ?*Handle { } /// Free the library handle -export fn {{project}}_free(handle: ?*Handle) void { +pub export fn scaffoldia_free(handle: ?*Handle) void { const h = handle orelse return; const allocator = h.allocator; @@ -87,7 +89,7 @@ export fn {{project}}_free(handle: ?*Handle) void { //============================================================================== /// Process data (example operation) -export fn {{project}}_process(handle: ?*Handle, input: u32) Result { +pub export fn scaffoldia_process(handle: ?*Handle, input: u32) Result { const h = handle orelse { setError("Null handle"); return .null_pointer; @@ -111,7 +113,7 @@ export fn {{project}}_process(handle: ?*Handle, input: u32) Result { /// Get a string result (example) /// Caller must free the returned string -export fn {{project}}_get_string(handle: ?*Handle) ?[*:0]const u8 { +pub export fn scaffoldia_get_string(handle: ?*Handle) ?[*:0]const u8 { const h = handle orelse { setError("Null handle"); return null; @@ -133,7 +135,7 @@ export fn {{project}}_get_string(handle: ?*Handle) ?[*:0]const u8 { } /// Free a string allocated by the library -export fn {{project}}_free_string(str: ?[*:0]const u8) void { +pub export fn scaffoldia_free_string(str: ?[*:0]const u8) void { const s = str orelse return; const allocator = std.heap.c_allocator; @@ -146,7 +148,7 @@ export fn {{project}}_free_string(str: ?[*:0]const u8) void { //============================================================================== /// Process an array of data -export fn {{project}}_process_array( +pub export fn scaffoldia_process_array( handle: ?*Handle, buffer: ?[*]const u8, len: u32, @@ -182,7 +184,7 @@ export fn {{project}}_process_array( /// Get the last error message /// Returns null if no error -export fn {{project}}_last_error() ?[*:0]const u8 { +pub export fn scaffoldia_last_error() ?[*:0]const u8 { const err = last_error orelse return null; // Return C string (static storage, no need to free) @@ -196,12 +198,12 @@ export fn {{project}}_last_error() ?[*:0]const u8 { //============================================================================== /// Get the library version -export fn {{project}}_version() [*:0]const u8 { +pub export fn scaffoldia_version() [*:0]const u8 { return VERSION.ptr; } /// Get build information -export fn {{project}}_build_info() [*:0]const u8 { +pub export fn scaffoldia_build_info() [*:0]const u8 { return BUILD_INFO.ptr; } @@ -210,10 +212,10 @@ export fn {{project}}_build_info() [*:0]const u8 { //============================================================================== /// Callback function type (C ABI) -pub const Callback = *const fn (u64, u32) callconv(.C) u32; +pub const Callback = *const fn (u64, u32) callconv(.c) u32; /// Register a callback -export fn {{project}}_register_callback( +pub export fn scaffoldia_register_callback( handle: ?*Handle, callback: ?Callback, ) Result { @@ -244,7 +246,7 @@ export fn {{project}}_register_callback( //============================================================================== /// Check if handle is initialized -export fn {{project}}_is_initialized(handle: ?*Handle) u32 { +pub export fn scaffoldia_is_initialized(handle: ?*Handle) u32 { const h = handle orelse return 0; return if (h.initialized) 1 else 0; } @@ -254,22 +256,22 @@ export fn {{project}}_is_initialized(handle: ?*Handle) u32 { //============================================================================== test "lifecycle" { - const handle = {{project}}_init() orelse return error.InitFailed; - defer {{project}}_free(handle); + const handle = scaffoldia_init() orelse return error.InitFailed; + defer scaffoldia_free(handle); - try std.testing.expect({{project}}_is_initialized(handle) == 1); + try std.testing.expect(scaffoldia_is_initialized(handle) == 1); } test "error handling" { - const result = {{project}}_process(null, 0); + const result = scaffoldia_process(null, 0); try std.testing.expectEqual(Result.null_pointer, result); - const err = {{project}}_last_error(); + const err = scaffoldia_last_error(); try std.testing.expect(err != null); } test "version" { - const ver = {{project}}_version(); + const ver = scaffoldia_version(); const ver_str = std.mem.span(ver); try std.testing.expectEqualStrings(VERSION, ver_str); } diff --git a/src/interface/ffi/test/integration_test.zig b/src/interface/ffi/test/integration_test.zig index 484e156..1eb12d3 100644 --- a/src/interface/ffi/test/integration_test.zig +++ b/src/interface/ffi/test/integration_test.zig @@ -1,66 +1,89 @@ // SPDX-License-Identifier: MPL-2.0 // Copyright (c) Jonathan D.A. Jewell -// RSR Template FFI Integration Tests +// Scaffoldia FFI Integration Tests // -// These tests verify that the Zig FFI correctly implements the Idris2 ABI. -// This is a TEMPLATE FILE — when instantiating a new project: -// 1. Replace "template" with your project name in lowercase -// 2. Link against your actual FFI implementation library -// 3. Uncomment the test functions below -// -// For now, this file contains documentation of what tests should exist. +// These tests verify that the Zig FFI correctly implements the Idris2 ABI +// (src/interface/Abi/Foreign.idr). They import the main FFI module by its +// registered build.zig module name ("scaffoldia") and exercise the exported +// functions directly, rather than only via the raw C ABI. const std = @import("std"); +const scaffoldia = @import("scaffoldia"); -// NOTE: When instantiated, declare the actual FFI functions here: -// extern fn mylib_init() ?*Handle; -// extern fn mylib_free(?*Handle) void; -// ... etc +test "lifecycle: create and destroy handle" { + const handle = scaffoldia.scaffoldia_init() orelse return error.InitFailed; + defer scaffoldia.scaffoldia_free(handle); -// And define Handle appropriately: -// const Handle = opaque {}; + try std.testing.expect(scaffoldia.scaffoldia_is_initialized(handle) == 1); +} -test "placeholder test - implementation required" { - // This test ensures the file compiles - // Actual tests depend on FFI implementation - try std.testing.expect(true); +test "lifecycle: free on a null handle is a safe no-op" { + // scaffoldia_free(null) must not crash — the implementation returns + // early via `handle orelse return`. Note: freeing the SAME live handle + // twice is NOT safe (it would double-free through allocator.destroy), + // so that is deliberately not exercised here. + scaffoldia.scaffoldia_free(null); } -// ============================================================================== -// Example tests (uncomment when instantiated with real FFI): -// ============================================================================== -// -// test "lifecycle: create and destroy handle" { -// const handle = mylib_init() orelse return error.InitFailed; -// defer mylib_free(handle); -// } -// -// test "operations: process with valid handle" { -// const handle = mylib_init() orelse return error.InitFailed; -// defer mylib_free(handle); -// -// const result = mylib_process(handle, 42); -// try std.testing.expectEqual(@as(c_int, 0), result); -// } -// -// test "memory safety: double free is safe" { -// const handle = mylib_init() orelse return error.InitFailed; -// mylib_free(handle); -// mylib_free(handle); // Should not crash -// } -// -// test "strings: get string result from handle" { -// const handle = mylib_init() orelse return error.InitFailed; -// defer mylib_free(handle); -// -// const str = mylib_get_string(handle); -// defer if (str) |s| mylib_free_string(s); -// -// try std.testing.expect(str != null); -// } -// -// test "version: returns non-empty version string" { -// const ver = mylib_version(); -// const ver_str = std.mem.span(ver); -// try std.testing.expect(ver_str.len > 0); -// } +test "operations: process with valid handle" { + const handle = scaffoldia.scaffoldia_init() orelse return error.InitFailed; + defer scaffoldia.scaffoldia_free(handle); + + const result = scaffoldia.scaffoldia_process(handle, 42); + try std.testing.expectEqual(scaffoldia.Result.ok, result); +} + +test "operations: process_array with valid buffer" { + const handle = scaffoldia.scaffoldia_init() orelse return error.InitFailed; + defer scaffoldia.scaffoldia_free(handle); + + const buf = [_]u8{ 1, 2, 3, 4 }; + const result = scaffoldia.scaffoldia_process_array(handle, &buf, buf.len); + try std.testing.expectEqual(scaffoldia.Result.ok, result); +} + +test "operations: process_array with null buffer returns null_pointer" { + const handle = scaffoldia.scaffoldia_init() orelse return error.InitFailed; + defer scaffoldia.scaffoldia_free(handle); + + const result = scaffoldia.scaffoldia_process_array(handle, null, 0); + try std.testing.expectEqual(scaffoldia.Result.null_pointer, result); +} + +test "strings: get_string returns a value that can be freed" { + const handle = scaffoldia.scaffoldia_init() orelse return error.InitFailed; + defer scaffoldia.scaffoldia_free(handle); + + const str = scaffoldia.scaffoldia_get_string(handle); + defer if (str) |s| scaffoldia.scaffoldia_free_string(s); + + try std.testing.expect(str != null); + if (str) |s| { + const slice = std.mem.span(s); + try std.testing.expect(slice.len > 0); + } +} + +test "version: returns non-empty version string" { + const ver = scaffoldia.scaffoldia_version(); + const ver_str = std.mem.span(ver); + try std.testing.expect(ver_str.len > 0); +} + +test "build_info: returns non-empty build info string" { + const info = scaffoldia.scaffoldia_build_info(); + const info_str = std.mem.span(info); + try std.testing.expect(info_str.len > 0); +} + +test "error handling: null handle on process returns null_pointer and sets last_error" { + const result = scaffoldia.scaffoldia_process(null, 0); + try std.testing.expectEqual(scaffoldia.Result.null_pointer, result); + + const err = scaffoldia.scaffoldia_last_error(); + try std.testing.expect(err != null); +} + +test "error handling: is_initialized on null handle returns 0" { + try std.testing.expect(scaffoldia.scaffoldia_is_initialized(null) == 0); +} diff --git a/tests/aspect_tests.sh b/tests/aspect_tests.sh index 028b2c0..c29f358 100755 --- a/tests/aspect_tests.sh +++ b/tests/aspect_tests.sh @@ -39,7 +39,7 @@ fail() { red " FAIL: $1"; FAIL=$((FAIL + 1)); } warn() { yellow " WARN: $1"; WARN=$((WARN + 1)); } echo "═══════════════════════════════════════════════════════════════" -echo " {{PROJECT}} — Aspect Tests (Cross-Cutting Concerns)" +echo " SCAFFOLDIA — Aspect Tests (Cross-Cutting Concerns)" echo "═══════════════════════════════════════════════════════════════" echo "" diff --git a/tests/e2e.sh b/tests/e2e.sh index 11143fc..df9073f 100755 --- a/tests/e2e.sh +++ b/tests/e2e.sh @@ -62,69 +62,63 @@ skip_test() { } echo "═══════════════════════════════════════════════════════════════" -echo " {{PROJECT}} — End-to-End Tests" +echo " SCAFFOLDIA — End-to-End Tests" echo "═══════════════════════════════════════════════════════════════" echo "" # ─── Preflight ─────────────────────────────────────────────────────── bold "Preflight checks" -# TODO: Check that your binary/server is built -# Example: -# BINARY="$PROJECT_DIR/target/release/my-tool" -# if [ ! -f "$BINARY" ]; then -# red "Binary not found at $BINARY — run 'just build' first" -# exit 1 -# fi -# green " Binary found: $BINARY" +if ! command -v idris2 >/dev/null 2>&1; then + red "idris2 not found on PATH — run 'just deps' to check requirements" + exit 1 +fi +green " idris2 found: $(command -v idris2)" -# TODO: Check dependencies -# command -v curl >/dev/null 2>&1 || { red "curl not found"; exit 1; } -# command -v jq >/dev/null 2>&1 || { red "jq not found"; exit 1; } +if ! command -v zig >/dev/null 2>&1; then + red "zig not found on PATH — run 'just deps' to check requirements" + exit 1 +fi +green " zig found: $(command -v zig)" echo "" -# ═══════════════════════════════════════════════════════════════════════ -# TODO: Add your E2E test sections below. Examples: -# ═══════════════════════════════════════════════════════════════════════ - -# ─── Example: CLI tool E2E ─────────────────────────────────────────── -# bold "Section 1: CLI happy path" -# OUTPUT=$($BINARY --help 2>&1) -# check "help flag works" "Usage:" "$OUTPUT" -# -# OUTPUT=$($BINARY process input.txt --output /tmp/e2e-output.json 2>&1) -# check "process command succeeds" "complete" "$OUTPUT" -# -# OUTPUT=$(cat /tmp/e2e-output.json) -# check "output is valid JSON" '"status"' "$OUTPUT" - -# ─── Example: Server E2E ──────────────────────────────────────────── -# bold "Section 2: Server lifecycle" -# $BINARY serve --port 9999 & -# SERVER_PID=$! -# trap "kill $SERVER_PID 2>/dev/null" EXIT -# sleep 2 -# -# STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:9999/health) -# check_status "health endpoint" "200" "$STATUS" -# -# BODY=$(curl -s http://localhost:9999/health) -# check "health response" '"status":"ok"' "$BODY" -# -# kill $SERVER_PID 2>/dev/null - -# ─── Example: VeriSimDB integration ───────────────────────────────── -# bold "Section 3: VeriSimDB persistence" -# VERISIM_URL="${VERISIM_API_URL:-http://localhost:9090}" -# if ! curl -sf "$VERISIM_URL/health" >/dev/null 2>&1; then -# skip_test "VeriSimDB integration" "gateway not available" -# else -# STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST "$VERISIM_URL/api/v1/hexads" \ -# -H "Content-Type: application/json" \ -# -d '{"tool":"{{PROJECT}}","modality":"document","content":"e2e test"}') -# check_status "hexad POST" "201" "$STATUS" -# fi +# ─── Section 1: Idris2 ABI build ────────────────────────────────────── +bold "Section 1: Idris2 ABI (abi.ipkg)" + +cd "$PROJECT_DIR" +if IDRIS_OUTPUT=$(idris2 --build abi.ipkg 2>&1); then + # A from-scratch build prints "N/M: Building ..." lines; an incremental + # no-op rebuild prints nothing at all — both are success (exit 0). + green " PASS: idris2 --build abi.ipkg" + PASS=$((PASS + 1)) +else + red " FAIL: idris2 --build abi.ipkg" + echo "$IDRIS_OUTPUT" | tail -20 + FAIL=$((FAIL + 1)) +fi + +# ─── Section 2: Zig FFI build + tests ───────────────────────────────── +bold "Section 2: Zig FFI (src/interface/ffi)" + +cd "$PROJECT_DIR/src/interface/ffi" +if ZIG_BUILD_OUTPUT=$(zig build 2>&1); then + green " PASS: zig build" + PASS=$((PASS + 1)) +else + red " FAIL: zig build" + echo "$ZIG_BUILD_OUTPUT" | tail -20 + FAIL=$((FAIL + 1)) +fi + +if ZIG_TEST_OUTPUT=$(zig build test --summary all 2>&1); then + check "zig build test" "tests passed" "$ZIG_TEST_OUTPUT" +else + red " FAIL: zig build test" + echo "$ZIG_TEST_OUTPUT" | tail -20 + FAIL=$((FAIL + 1)) +fi +cd "$PROJECT_DIR" # ═══════════════════════════════════════════════════════════════════════ # Summary diff --git a/tests/e2e/template_instantiation_test.sh b/tests/e2e/template_instantiation_test.sh deleted file mode 100755 index 73a7d8d..0000000 --- a/tests/e2e/template_instantiation_test.sh +++ /dev/null @@ -1,268 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: MPL-2.0 -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -# -# E2E Test: Template Instantiation -# Verifies that the template can be cloned and instantiated into a working project -# -# This test: -# 1. Clones the template to a temp directory -# 2. Replaces all placeholder tokens with test values -# 3. Validates the resulting repository structure -# 4. Verifies builds work after instantiation -# 5. Cleans up - -set -euo pipefail - -# Test configuration -TEMPLATE_ROOT="${1:-.}" -TEST_DIR="${TMPDIR:-/tmp}/rsr-template-test-$$" -TEST_REPO_NAME="test-instantiated-repo" -TEST_OWNER="test-owner" -TEST_FORGE="github" -TEST_AUTHOR="Test Author" -TEST_AUTHOR_EMAIL="test@example.com" -TEST_PROJECT_NAME="Test Project" -TEST_DESCRIPTION="A test project instantiated from the RSR template" -TEST_PRIMARY_LANGUAGE="Rust" - -# ANSI colors -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -NC='\033[0m' # No Color - -# Helper functions -log_step() { - echo "" - echo -e "${BLUE}→${NC} $*" -} - -log_pass() { - echo -e "${GREEN}✓${NC} $*" -} - -log_error() { - echo -e "${RED}✗${NC} $*" >&2 -} - -cleanup() { - if [ -d "$TEST_DIR" ]; then - log_step "Cleaning up test directory: $TEST_DIR" - rm -rf "$TEST_DIR" - log_pass "Cleanup complete" - fi -} - -trap cleanup EXIT - -#============================================================================== -# PHASE 1: SETUP -#============================================================================== - -echo "" -echo "═══════════════════════════════════════════════════════════════════════════════" -echo "E2E TEST: Template Instantiation" -echo "═══════════════════════════════════════════════════════════════════════════════" -echo "" - -log_step "Creating test directory: $TEST_DIR" -mkdir -p "$TEST_DIR" -log_pass "Test directory created" - -#============================================================================== -# PHASE 2: CLONE TEMPLATE -#============================================================================== - -log_step "Cloning template from $TEMPLATE_ROOT" - -# Copy template to test location (simulating git clone) -TEST_REPO_PATH="$TEST_DIR/$TEST_REPO_NAME" -cp -r "$TEMPLATE_ROOT" "$TEST_REPO_PATH" -log_pass "Template cloned to $TEST_REPO_PATH" - -# Remove .git directory for clean state -if [ -d "$TEST_REPO_PATH/.git" ]; then - rm -rf "$TEST_REPO_PATH/.git" - log_pass ".git directory removed (fresh clone)" -fi - -#============================================================================== -# PHASE 3: PLACEHOLDER REPLACEMENT -#============================================================================== - -log_step "Replacing placeholder tokens" - -# Function to replace all occurrences of a placeholder in a file -replace_placeholder() { - local file="$1" - local placeholder="$2" - local value="$3" - - if [ ! -f "$file" ]; then - return 0 - fi - - # Use sed to replace (platform-portable) - if grep -q "$placeholder" "$file" 2>/dev/null; then - sed -i "s|$placeholder|$value|g" "$file" - echo " Replaced $placeholder in $(basename "$file")" - fi -} - -# Replace in all text files -find "$TEST_REPO_PATH" -type f \ - \( -name "*.md" -o -name "*.adoc" -o -name "*.a2ml" -o -name "*.zig" -o -name "*.idr" \ - -o -name "Justfile" -o -name "Containerfile" -o -name "*.yml" -o -name "*.yaml" \ - -o -name "*.json" -o -name "*.scm" -o -name "contractile" \) \ - -exec bash -c ' - file="$1" - placeholder_pairs=( - "{{REPO}}|$TEST_REPO_NAME" - "{{OWNER}}|$TEST_OWNER" - "{{FORGE}}|$TEST_FORGE" - "{{PROJECT}}|$TEST_PROJECT_NAME" - "{{project}}|'"${TEST_REPO_NAME//-/_}"'" - "{{REPO_DESCRIPTION}}|$TEST_DESCRIPTION" - "{{PRIMARY_LANGUAGE}}|$TEST_PRIMARY_LANGUAGE" - "{{AUTHOR}}|$TEST_AUTHOR" - "{{AUTHOR_EMAIL}}|$TEST_AUTHOR_EMAIL" - "{{CURRENT_DATE}}|2026-04-04" - ) - - for pair in "${placeholder_pairs[@]}"; do - IFS="|" read -r placeholder value <<< "$pair" - if grep -q "$placeholder" "$file" 2>/dev/null; then - sed -i "s|$placeholder|$value|g" "$file" - fi - done - ' _ "$file" - -log_pass "All placeholder tokens replaced" - -#============================================================================== -# PHASE 4: VALIDATE STRUCTURE -#============================================================================== - -log_step "Validating instantiated repository structure" - -# Run validation script on the instantiated repo -if [ -f "$TEMPLATE_ROOT/scripts/validate-template.sh" ]; then - bash "$TEMPLATE_ROOT/scripts/validate-template.sh" "$TEST_REPO_PATH" 0 - log_pass "Repository structure validation passed" -else - log_error "Validation script not found" - exit 1 -fi - -#============================================================================== -# PHASE 5: VERIFY BUILD -#============================================================================== - -log_step "Verifying build system works after instantiation" - -if [ -f "$TEST_REPO_PATH/src/interface/ffi/build.zig" ]; then - if command -v zig &> /dev/null; then - cd "$TEST_REPO_PATH/src/interface/ffi" - if zig build 2>&1; then - log_pass "Zig build successful" - else - log_error "Zig build failed" - exit 1 - fi - cd - > /dev/null - else - log_error "Zig compiler not found - cannot verify build" - exit 1 - fi -fi - -#============================================================================== -# PHASE 6: VERIFY NO REMAINING PLACEHOLDERS -#============================================================================== - -log_step "Checking for remaining placeholders" - -REMAINING_PLACEHOLDERS=$( - find "$TEST_REPO_PATH" -type f \ - \( -name "*.md" -o -name "*.adoc" -o -name "*.a2ml" -o -name "*.zig" -o -name "*.idr" \ - -o -name "Justfile" -o -name "*.yml" \) \ - -exec grep -l "{{[A-Z_]*}}" {} \; 2>/dev/null || true -) - -if [ -z "$REMAINING_PLACEHOLDERS" ]; then - log_pass "No remaining placeholders found" -else - log_error "Found remaining placeholders in:" - echo "$REMAINING_PLACEHOLDERS" | sed 's/^/ /' - exit 1 -fi - -#============================================================================== -# PHASE 7: VERIFY CRITICAL FILES ARE NOT TEMPLATES -#============================================================================== - -log_step "Verifying critical files have been instantiated" - -CRITICAL_FILES=( - "README.adoc" - "EXPLAINME.adoc" - "Justfile" -) - -for file in "${CRITICAL_FILES[@]}"; do - if [ -f "$TEST_REPO_PATH/$file" ]; then - # Check that it's not just a template (contains some actual content) - if grep -q "$TEST_PROJECT_NAME\|$TEST_AUTHOR\|$TEST_REPO_NAME" "$TEST_REPO_PATH/$file" 2>/dev/null || \ - [ $(wc -l < "$TEST_REPO_PATH/$file") -gt 10 ]; then - log_pass "File instantiated: $file" - else - log_error "File appears to be a template: $file" - exit 1 - fi - else - log_error "Critical file missing: $file" - exit 1 - fi -done - -#============================================================================== -# PHASE 8: VERIFY METADATA -#============================================================================== - -log_step "Verifying machine-readable metadata" - -METADATA_FILES=( - ".machine_readable/descriptiles/STATE.a2ml" - ".machine_readable/descriptiles/META.a2ml" -) - -for file in "${METADATA_FILES[@]}"; do - if [ -f "$TEST_REPO_PATH/$file" ]; then - log_pass "Metadata file exists: $file" - else - log_error "Metadata file missing: $file" - exit 1 - fi -done - -#============================================================================== -# SUMMARY -#============================================================================== - -echo "" -echo "═══════════════════════════════════════════════════════════════════════════════" -echo -e "${GREEN}✓ E2E TEMPLATE INSTANTIATION TEST PASSED${NC}" -echo "═══════════════════════════════════════════════════════════════════════════════" -echo "" -echo "Summary:" -echo " - Template cloned successfully" -echo " - All placeholders replaced" -echo " - Repository structure valid" -echo " - Build system works" -echo " - No remaining placeholders" -echo " - Metadata intact" -echo "" -echo "Test repository: $TEST_REPO_PATH (will be cleaned up)" -echo ""