From 46560942e4e4ed15ea4a35edaf4621141ef5c2d2 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Sat, 19 Sep 2026 09:24:29 +0000 Subject: [PATCH] refactor(root): move root artefacts to their canonical locations Applies the estate root-shape rollout: files that are not root-level by necessity move to where their tooling and the estate canon expect them, and every reference to them is updated in the same change. * .githooks/install.sh (deleted) * .github/actions/code-hygiene-check/check.sh * .github/hooks/install.sh (new) * .github/hooks/pre-push (from .githooks/pre-push) -> .github/hooks/pre-push * .github/hooks/validate-a2ml.sh (from .githooks/validate-a2ml.sh) -> .github/hooks/validate-a2ml.sh * .github/hooks/validate-k9.sh (from .githooks/validate-k9.sh) -> .github/hooks/validate-k9.sh * .github/workflows/dogfood-gate.yml * .gitignore * .machine_readable/root-allow.txt * .machine_readable/root-allow.txt.backup * .machine_readable/rsr-profile.a2ml * AFFIRMATION.adoc * CONTRIBUTING.adoc (deleted) * scripts/validate-template.sh * src/interface/abi.ipkg (from abi.ipkg) Verified with `git apply --check` against current main before committing; no behaviour change intended, the Justfile entry points keep working. --- .githooks/install.sh | 9 -- .github/actions/code-hygiene-check/check.sh | 2 +- .github/hooks/install.sh | 9 ++ {.githooks => .github/hooks}/pre-push | 4 +- {.githooks => .github/hooks}/validate-a2ml.sh | 0 {.githooks => .github/hooks}/validate-k9.sh | 0 .github/workflows/dogfood-gate.yml | 6 +- .gitignore | 2 +- .machine_readable/root-allow.txt | 4 +- .machine_readable/root-allow.txt.backup | 2 +- .machine_readable/rsr-profile.a2ml | 4 +- AFFIRMATION.adoc | 2 +- CONTRIBUTING.adoc | 109 ------------------ scripts/validate-template.sh | 4 +- abi.ipkg => src/interface/abi.ipkg | 4 +- 15 files changed, 25 insertions(+), 136 deletions(-) delete mode 100755 .githooks/install.sh create mode 100755 .github/hooks/install.sh rename {.githooks => .github/hooks}/pre-push (94%) rename {.githooks => .github/hooks}/validate-a2ml.sh (100%) rename {.githooks => .github/hooks}/validate-k9.sh (100%) delete mode 100644 CONTRIBUTING.adoc rename abi.ipkg => src/interface/abi.ipkg (94%) diff --git a/.githooks/install.sh b/.githooks/install.sh deleted file mode 100755 index 28f09d5..0000000 --- a/.githooks/install.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: MPL-2.0 -# Point this clone's git hooks at .githooks/ so the local Dogfood Gate runs -# on push. Idempotent; safe to re-run. -set -euo pipefail -cd "$(git rev-parse --show-toplevel)" -git config core.hooksPath .githooks -chmod +x .githooks/pre-push .githooks/validate-a2ml.sh .githooks/validate-k9.sh 2>/dev/null || true -echo "Installed: core.hooksPath -> .githooks (pre-push A2ML+K9 gate active)." diff --git a/.github/actions/code-hygiene-check/check.sh b/.github/actions/code-hygiene-check/check.sh index 118ee6a..fe45243 100755 --- a/.github/actions/code-hygiene-check/check.sh +++ b/.github/actions/code-hygiene-check/check.sh @@ -26,7 +26,7 @@ fi # machine-readable templates, packaging recipes, and container templates are # not silently relabelled as application source. exclude_paths=( - ':(exclude).github/**' ':(exclude).githooks/**' + ':(exclude).github/**' ':(exclude).github/hooks/**' ':(exclude).machine_readable/**' ':(exclude)docs/**' ':(exclude)packaging/**' ':(exclude)container/**' ":(exclude)$allow_file" diff --git a/.github/hooks/install.sh b/.github/hooks/install.sh new file mode 100755 index 0000000..309354d --- /dev/null +++ b/.github/hooks/install.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MPL-2.0 +# Point this clone's git hooks at .github/hooks/ so the local Dogfood Gate runs +# on push. Idempotent; safe to re-run. +set -euo pipefail +cd "$(git rev-parse --show-toplevel)" +git config core.hooksPath .github/hooks +chmod +x .github/hooks/pre-push .github/hooks/validate-a2ml.sh .github/hooks/validate-k9.sh 2>/dev/null || true +echo "Installed: core.hooksPath -> .githooks (pre-push A2ML+K9 gate active)." diff --git a/.githooks/pre-push b/.github/hooks/pre-push similarity index 94% rename from .githooks/pre-push rename to .github/hooks/pre-push index 7c46d92..6ca2f7f 100755 --- a/.githooks/pre-push +++ b/.github/hooks/pre-push @@ -11,8 +11,8 @@ # refreshed by the estate `refresh-githooks` sweep. # # Enable once per clone: -# git config core.hooksPath .githooks -# (or run: .githooks/install.sh) +# git config core.hooksPath .github/hooks +# (or run: .github/hooks/install.sh) # # Override for an emergency push: git push --no-verify # diff --git a/.githooks/validate-a2ml.sh b/.github/hooks/validate-a2ml.sh similarity index 100% rename from .githooks/validate-a2ml.sh rename to .github/hooks/validate-a2ml.sh diff --git a/.githooks/validate-k9.sh b/.github/hooks/validate-k9.sh similarity index 100% rename from .githooks/validate-k9.sh rename to .github/hooks/validate-k9.sh diff --git a/.github/workflows/dogfood-gate.yml b/.github/workflows/dogfood-gate.yml index 492c7f6..eaea3d4 100644 --- a/.github/workflows/dogfood-gate.yml +++ b/.github/workflows/dogfood-gate.yml @@ -48,14 +48,14 @@ jobs: # That action repository does not exist — `gh api repos/...` returns 404 # and the job failed at Set up job with "Unable to resolve action ..., # repository not found", so it never ran. Meanwhile the real - # implementation ships here as .githooks/validate-a2ml.sh and takes the + # implementation ships here as .github/hooks/validate-a2ml.sh and takes the # same INPUT_PATH / INPUT_STRICT interface the action was passed. - name: Validate A2ML manifests if: steps.detect.outputs.count > 0 env: INPUT_PATH: '.' INPUT_STRICT: 'false' - run: bash .githooks/validate-a2ml.sh + run: bash .github/hooks/validate-a2ml.sh - name: Write summary run: | @@ -106,7 +106,7 @@ jobs: env: INPUT_PATH: '.' INPUT_STRICT: 'false' - run: bash .githooks/validate-k9.sh + run: bash .github/hooks/validate-k9.sh - name: Write summary run: | diff --git a/.gitignore b/.gitignore index d314b76..829881c 100644 --- a/.gitignore +++ b/.gitignore @@ -117,7 +117,7 @@ dist/ !/build/ !/build/** -# ...but never track Idris2 typecheck output. `idris2 --typecheck abi.ipkg` +# ...but never track Idris2 typecheck output. `idris2 --typecheck src/interface/abi.ipkg` # writes compiled .ttc/.ttm under build/ttc/; these are generated artifacts. /build/ttc/ diff --git a/.machine_readable/root-allow.txt b/.machine_readable/root-allow.txt index 62d2b48..cae1ccb 100644 --- a/.machine_readable/root-allow.txt +++ b/.machine_readable/root-allow.txt @@ -25,7 +25,6 @@ LICENSE LICENSES/ # REUSE licence texts (MPL-2.0.txt + CC-BY-SA-4.0.txt) for the dual-licence model (code MPL-2.0 / docs CC-BY-SA-4.0) CHANGELOG.md CHANGELOG.adoc # Current changelog after the AsciiDoc migration. -CONTRIBUTING.adoc # Current contributor guide after the AsciiDoc migration. SECURITY.adoc # Current security policy after the AsciiDoc migration. CITATION.cff # citation metadata (surfaced at root by #96) RSR-PHILOSOPHY.adoc # RSR philosophy statement (root authority file; was drift until 2026-07-07) @@ -33,7 +32,6 @@ RSR-PHILOSOPHY.adoc # RSR philosophy statement (root authority file; was # ─── Build entry points (must live at root for their tooling) ──────────────── Justfile # delegates phases to build/just/*.just coordination.k9 # repo-local session binding (template-mandated) -abi.ipkg # Idris2 package for the ABI seam; sourcedir=src/interface (estate canon: root-level *-abi.ipkg). Single case-consistent src/interface/Abi/ dir. Typecheck: `idris2 --typecheck abi.ipkg`. # ─── Conventional dotfiles (tool-required at root) ─────────────────────────── .editorconfig @@ -46,7 +44,7 @@ CLAUDE.md # AI session instructions, generated by the arrival-p sonar-project.properties # SonarCloud analysis config; the SonarQube scan action reads it from the repo root # ─── Directories ───────────────────────────────────────────────────────────── -.githooks/ # git hooks (install.sh, pre-push, validate-a2ml.sh); tool-required at root — git's core.hooksPath resolves relative to the worktree root, exactly like .devcontainer/. Tracked since #141 (pre-push Dogfood Gate) but never allow-listed, so scripts/check-root-shape.sh failed on this repo itself and on every repo instantiated from it. +.github/hooks/ # git hooks (install.sh, pre-push, validate-a2ml.sh); tool-required at root — git's core.hooksPath resolves relative to the worktree root, exactly like .devcontainer/. Tracked since #141 (pre-push Dogfood Gate) but never allow-listed, so scripts/check-root-shape.sh failed on this repo itself and on every repo instantiated from it. .devcontainer/ # VS Code dev container spec; tool-required at root .git/ .github/ # CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, workflows/ diff --git a/.machine_readable/root-allow.txt.backup b/.machine_readable/root-allow.txt.backup index 60ccd94..191a9f8 100644 --- a/.machine_readable/root-allow.txt.backup +++ b/.machine_readable/root-allow.txt.backup @@ -45,7 +45,7 @@ ?generated/ ?geo/ ?.gitattributes -?.githooks/ +?.github/hooks/ ?.github/ ?.gitignore ?.gitlab-ci.yml diff --git a/.machine_readable/rsr-profile.a2ml b/.machine_readable/rsr-profile.a2ml index 1d540e2..10cece5 100644 --- a/.machine_readable/rsr-profile.a2ml +++ b/.machine_readable/rsr-profile.a2ml @@ -28,12 +28,12 @@ declares-against = "2.0.0-draft" # Effective capability set (direct declaration; no preset shorthand used). capabilities = [ "zig", # src/interface/ffi/build.zig + Zig FFI layer - "idris2", # abi.ipkg + src/interface/Abi/ (dependent-typed ABI) + "idris2", # src/interface/abi.ipkg + src/interface/Abi/ (dependent-typed ABI) "bash", # scripts/*.sh automation "cli", # src/ command-line entry scaffolding "library", # consumed/published as a library surface "ffi", # C-ABI FFI seam (Zig), src/interface/ffi/ - "abi", # formally specified ABI: abi.ipkg + src/interface/Abi/ proofs + "abi", # formally specified ABI: src/interface/abi.ipkg + src/interface/Abi/ proofs "formal-proofs", # verification/proofs/ (in-tree mechanised proofs) "docs-site", # .github/workflows/pages.yml (casket/Pages) "container", # container/ + .devcontainer/Containerfile diff --git a/AFFIRMATION.adoc b/AFFIRMATION.adoc index d77e883..1f7e9ff 100644 --- a/AFFIRMATION.adoc +++ b/AFFIRMATION.adoc @@ -68,7 +68,7 @@ file. Bring a counter-example, a failing run, or a contradicting source. |=== | Claim | Status | Evidence (command / `file:line`) | _e.g. The library builds clean_ | affirmed | `just build` at the anchor SHA -| _e.g. The ABI seam typechecks_ | affirmed | `idris2 --typecheck abi.ipkg` +| _e.g. The ABI seam typechecks_ | affirmed | `idris2 --typecheck src/interface/abi.ipkg` | _e.g. Feature X is complete_ | aspiration | README §… (not yet checked) |=== diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc deleted file mode 100644 index 37107d8..0000000 --- a/CONTRIBUTING.adoc +++ /dev/null @@ -1,109 +0,0 @@ -== Clone the repository - -git clone https://github.com/hyperpolymath/nextgen-databases.git cd -nextgen-databases - -== Using Nix (recommended for reproducibility) - -nix develop - -== Or using toolbox/distrobox - -toolbox create nextgen-databases-dev toolbox enter nextgen-databases-dev -# Install dependencies manually - -== Verify setup - -just check # or: cargo check / mix compile / etc. just test # Run test -suite - -.... - -### Repository Structure -.... - -nextgen-databases/ ├── src/ # Source code (Perimeter 1-2) ├── lib/ # -Library code (Perimeter 1-2) ├── extensions/ # Extensions (Perimeter 2) -├── plugins/ # Plugins (Perimeter 2) ├── tools/ # Tooling (Perimeter 2) -├── docs/ # Documentation (Perimeter 3) │ ├── architecture/ # ADRs, -specs (Perimeter 2) │ └── proposals/ # RFCs (Perimeter 3) ├── examples/ -# Examples (Perimeter 3) ├── spec/ # Spec tests (Perimeter 3) ├── tests/ -# Test suite (Perimeter 2-3) ├── .well-known/ # Protocol files -(Perimeter 1-3) ├── .github/ # GitHub config (Perimeter 1) │ ├── -ISSUE_TEMPLATE/ │ └── workflows/ ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md -├── CONTRIBUTING.md # This file ├── GOVERNANCE.md ├── LICENSE ├── -MAINTAINERS.md ├── README.adoc ├── SECURITY.md ├── flake.nix # Nix flake -(Perimeter 1) └── Justfile # Task runner (Perimeter 1) - -.... - ---- - -## How to Contribute - -### Reporting Bugs - -**Before reporting**: -1. Search existing issues -2. Check if it's already fixed in `main` -3. Determine which perimeter the bug affects - -**When reporting**: - -Use the [bug report template](.github/ISSUE_TEMPLATE/bug_report.md) and include: - -- Clear, descriptive title -- Environment details (OS, versions, toolchain) -- Steps to reproduce -- Expected vs actual behaviour -- Logs, screenshots, or minimal reproduction - -### Suggesting Features - -**Before suggesting**: -1. Check the [roadmap](docs/lithoglyph/ROADMAP.adoc) if available -2. Search existing issues and discussions -3. Consider which perimeter the feature belongs to - -**When suggesting**: - -Use the [feature request template](.github/ISSUE_TEMPLATE/feature_request.md) and include: - -- Problem statement (what pain point does this solve?) -- Proposed solution -- Alternatives considered -- Which perimeter this affects - -### Your First Contribution - -Look for issues labelled: - -- [`good first issue`](https://github.com/hyperpolymath/nextgen-databases/labels/good%20first%20issue) — Simple Perimeter 3 tasks -- [`help wanted`](https://github.com/hyperpolymath/nextgen-databases/labels/help%20wanted) — Community help needed -- [`documentation`](https://github.com/hyperpolymath/nextgen-databases/labels/documentation) — Docs improvements -- [`perimeter-3`](https://github.com/hyperpolymath/nextgen-databases/labels/perimeter-3) — Community sandbox scope - ---- - -## Development Workflow - -### Branch Naming -.... - -docs/short-description # Documentation (P3) test/what-added # Test -additions (P3) feat/short-description # New features (P2) -fix/issue-number-description # Bug fixes (P2) refactor/what-changed # -Code improvements (P2) security/what-fixed # Security fixes (P1-2) - -.... - -### Commit Messages - -We follow [Conventional Commits](https://www.conventionalcommits.org/): -.... - -(): - -{empty}[optional body] - -{empty}[optional footer] diff --git a/scripts/validate-template.sh b/scripts/validate-template.sh index 894fdb1..a3bfede 100755 --- a/scripts/validate-template.sh +++ b/scripts/validate-template.sh @@ -310,8 +310,8 @@ fi # 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 + if [ -f "$REPO_ROOT/src/interface/abi.ipkg" ]; then + if (cd "$REPO_ROOT" && idris2 --typecheck src/interface/abi.ipkg) > /dev/null 2>&1; then log_pass "Idris2 ABI typechecks (abi.ipkg)" else log_error "Idris2 ABI does NOT typecheck (abi.ipkg)" diff --git a/abi.ipkg b/src/interface/abi.ipkg similarity index 94% rename from abi.ipkg rename to src/interface/abi.ipkg index 4b62c0b..14ec249 100644 --- a/abi.ipkg +++ b/src/interface/abi.ipkg @@ -14,7 +14,7 @@ -- A bare `idris2 --check src/interface/Abi/Foo.idr` still warns ("module name -- does not match file name") because Idris derives the expected module from the -- full path; that is expected. Use the package for a real typecheck: --- idris2 --typecheck abi.ipkg (or --build) +-- idris2 --typecheck src/interface/abi.ipkg (or --build) -- -- The RSR validators accept either Abi/ (canonical, case-consistent) or a -- lowercase abi/ for downstream repos that ship lowercase — but never both. @@ -27,7 +27,7 @@ authors = "Jonathan D.A. Jewell" brief = "Formally-typed ABI/FFI seam (Idris2 type + layout proofs) for an RSR-templated repository" -sourcedir = "src/interface" +sourcedir = "." depends = base