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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# It carries NO `name`, `description`, `homepage` or `private` key, and it must
# never gain one. The reason is a real incident, not a hypothetical:
#
# This file previously read `name: "{{REPO}}"`. probot/settings applies it on
# This file previously read `name: "[REPO]"`. probot/settings applies it on
# every push to the default branch, so it submitted the literal string
# `{{REPO}}` as the repository name. GitHub sanitises an invalid name by
# collapsing each run of illegal characters to a dash — `{{REPO}}` became
# `[REPO]` as the repository name. GitHub sanitises an invalid name by
# collapsing each run of illegal characters to a dash — `[REPO]` became
# `-REPO-`. The template renamed itself on every push, its old URL 404'd, and
# it was mistaken for a deleted repository. `description` was likewise left
# reading the literal `{{DESCRIPTION}}` on the live repo.
# reading the literal `[DESCRIPTION]` on the live repo.
#
# Two properties make identity keys unsafe here specifically:
#
Expand All @@ -41,7 +41,7 @@
# of that repo's name, purpose or visibility.
#
# Enforced by `scripts/check-no-placeholders.sh`, which fails if this file
# contains a `{{` token or declares any of the four identity keys.
# contains a placeholder token or declares any of the four identity keys.

# ─── Repository Settings ───────────────────────────────────────────────────────

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/openssf-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ jobs:
done

for f in $REQUIRED_FILES; do
# Match {{ANYTHING}} placeholder tokens
# Match [ANYTHING] placeholder tokens
PLACEHOLDERS=$(grep -cE '\{\{[A-Z_]+\}\}' "$f" 2>/dev/null || true)
if [ "$PLACEHOLDERS" -gt 0 ]; then
echo "::error::$f contains $PLACEHOLDERS unfilled {{PLACEHOLDER}} tokens"
echo "::error::$f contains $PLACEHOLDERS unfilled [PLACEHOLDER] tokens"
grep -nE '\{\{[A-Z_]+\}\}' "$f" | head -5
ERRORS=$((ERRORS + 1))
fi
Expand Down
8 changes: 4 additions & 4 deletions .machine_readable/6a2/STATE.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
[metadata]
project = "krl"
version = "0.2.0"
last-updated = "2026-02-28"
last-updated = "2026-09-20"
status = "active" # active | paused | archived

[project-context]
name = "krl"
purpose = "Canonical RSR-compliant repository template providing scaffolding for all hyperpolymath projects — including CI/CD, AI manifests, ABI/FFI standards, container ecosystem, and governance infrastructure."
purpose = "KRL (Knot Resolution Language, pronounced 'curl') — standalone DSL for knot/tangle construction, transformation, resolution, and retrieval"
completion-percentage = 95

[position]
Expand Down Expand Up @@ -52,8 +52,8 @@ open-warnings = 0
open-failures = 0

[ecosystem]
part-of = ["RSR Framework", "stapeln ecosystem"]
depends-on = ["stapeln", "selur-compose", "cerro-torre", "svalinn", "vordr", "k9-svc"]
part-of = ["KRL Stack", "QuandleDB ecosystem"]
depends-on = ["tangle", "quandledb", "Skein.jl", "KnotTheory.jl"]

# ---------------------------------------------------------------------------
# NOTE: The milestones above describe the krl repository's evolution.
Expand Down
4 changes: 2 additions & 2 deletions .machine_readable/6a2/anchor/ANCHOR.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ purpose = [

[identity]
project = "KRL"
kind = "{{PROJECT_KIND}}" # language | library | service | tool
kind = "language" # language | library | service | tool
one-sentence = "KRL (Knot Resolution Language, pronounced 'curl') — standalone DSL for knot/tangle construction, transformation, resolution, and retrieval"
domain = "{{PROJECT_DOMAIN}}"
domain = "knot-theory"

[semantic-authority]
policy = "canonical"
Expand Down
71 changes: 61 additions & 10 deletions .machine_readable/META.a2ml
Original file line number Diff line number Diff line change
@@ -1,10 +1,61 @@
;; SPDX-License-Identifier: MPL-2.0
;; Architecture decisions and development practices
(meta
(version "1.0.0")
(project "krl")
(architecture-decisions)
(development-practices
(code-review "required")
(branch-protection "enabled")
(ci-cd "github-actions")))
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
#
# META.a2ml — Project meta-level information
# Architecture decisions, design rationale, governance.
# KRL — Knot Resolution Language surface.

[metadata]
version = "1.0.0"
last-updated = "2026-09-20"
project = "krl"

[project-info]
type = "library"
languages = ["zig", "julia"]
license = "MPL-2.0"
author = "Jonathan D.A. Jewell (hyperpolymath)"

[architecture-decisions]
# ADR format: status = proposed | accepted | deprecated | superseded | rejected
# RSR standard adopted 2026-02-14
# KRL is resolution DSL not query language 2026-09-07
# KRLAdapter.jl discarded, fragment grammar vs parser agreement now KR-6 2026-09-20

[development-practices]
build-tool = "just"
container-runtime = "podman"
ci-platform = "github-actions"
package-manager = "guix"
code-review = "required"
branch-protection = "enabled"

[maintenance-axes]
scoping-first = true
execution-order = "axis-1 > axis-2 > axis-3"
axis-1 = "must > intend > like"
axis-2 = "corrective > adaptive > perfective"
axis-3 = "systems > compliance > effects"

[scoping]
sources = "README, roadmap, status docs, maintenance checklist, CI/security docs"
marker-scan = "TODO/FIXME/XXX/HACK/STUB/PARTIAL"
idris-unsound-scan = "believe_me/assert_total"

[axis-2-maintenance-rules]
corrective-first = true
adaptive-second = true
adaptive-focus = "scope-change reconciliation, stale-reference removal, obsolete-work culling"
perfective-third = true
perfective-source = "axis-1 honest state after corrective/adaptive updates"

[axis-3-audit-rules]
audit-focus = "systems in place, documentation explains actual state, safety/security accounted for, observed effects reviewed"
compliance-focus = "seams/compromises/exception register, bounded exceptions, anti-drift checks"
drift-risk-example = "single exception broadening into policy violation (e.g. ReScript->TypeScript spread)"
effects-evidence = "benchmark execution/results and maintainer status dialogue/review"

[design-rationale]
# KRL is resolution DSL: Construct / Transform / Resolve / Retrieve
# Lower to TangleIR, rest on Tangle type-safety, run against QuandleDB+Skein substrate
# Not merely a query language
104 changes: 77 additions & 27 deletions .machine_readable/STATE.a2ml
Original file line number Diff line number Diff line change
@@ -1,27 +1,77 @@
;; SPDX-License-Identifier: MPL-2.0
;; Project state — update throughout each session
(state
(metadata
(version "1.0.1")
(project "rsr-template-repo")
(last-updated "2026-04-04"))
(project-context
(description "RSR Standard Repository Template — baseline for all hyperpolymath projects")
(primary-language "Idris2 (ABI) + Zig (FFI)")
(status "testing-complete"))
(current-position
(phase "testing")
(completion-percentage 100)
(milestone "CRG C - Testing & Benchmarking complete"))
(testing-summary
(validation-script "scripts/validate-template.sh: PASS (0 errors)")
(workflow-tests "tests/workflows/validate_workflows_test.sh: PASS (21/21 workflows)")
(integration-tests "test/integration_test.zig: PASS (placeholder template)")
(e2e-tests "tests/e2e/template_instantiation_test.sh: READY")
(benchmarks "benches/template_bench.sh: PASS (5 suites)")
(zig-build "Zig 0.15.2 compatible: PASS"))
(critical-next-actions
("Commit test suite"
"Push to GitHub"
"Verify CI workflows pass"
"Document test instantiation patterns")))
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
#
# STATE.a2ml — Project state checkpoint
# KRL (Knot Resolution Language, pronounced 'curl') — standalone DSL

[metadata]
project = "krl"
version = "0.2.0"
last-updated = "2026-09-20"
status = "active"

[project-context]
name = "krl"
purpose = "KRL (Knot Resolution Language, pronounced 'curl') — standalone DSL for knot/tangle construction, transformation, resolution, and retrieval"
primary-language = "Idris2 (ABI) + Zig (FFI) + Julia (QuandleDB parser)"
completion-percentage = 85

[position]
phase = "maintenance"
maturity = "beta"

[route-to-mvp]
milestones = [
{ name = "Phase 0: Core scaffolding (justfile, CI/CD, .machine_readable)", completion = 100 },
{ name = "Phase 1: ABI/FFI standard (Idris2/Zig templates)", completion = 100 },
{ name = "Phase 1b: AI Gatekeeper Protocol (0-AI-MANIFEST.a2ml)", completion = 100 },
{ name = "Phase 1c: TOPOLOGY.md standard and guide", completion = 100 },
{ name = "Phase 1d: Maintenance gate (axes, checklist, approach)", completion = 100 },
{ name = "Phase 1e: Trustfile / contractiles", completion = 100 },
{ name = "Phase 2: RSR template instantiation complete", completion = 100 },
{ name = "Phase 2b: KR-6 fragment conformance + v0.1.0 subset doc", completion = 100 },
{ name = "Phase 3: PROOF-NEEDS discharge (KR-1..KR-8)", completion = 37 },
{ name = "Phase 4: Container ecosystem templates (stapeln)", completion = 100 },
]

[testing-summary]
validation-script = "just validate-rsr: PASS"
verify-template = "just verify-template: PASS"
workflow-tests = "tests/workflows/validate_workflows_test.sh: PASS"
integration-tests = "src/interface/ffi/test/integration_test.zig: PASS (requires zig)"
e2e-tests = "tests/e2e.sh: PASS (requires zig)"
grammar-smoke = "tests/smoke/grammar_smoke.sh: PASS 20"
aspect-tests = "tests/aspect_tests.sh: PASS 4"
fragment-conformance = "tests/conformance/retrieval_fragment.jl: PASS (requires Julia + quandledb)"
differential-test = "tests/conformance/differential_test.jl: PASS (design + determinism, two-parser VOID)"
benchmarks = "benches/: pending"
zig-build = "Zig 0.16.0 compatible: PASS (requires zig)"

[blockers-and-issues]
# No active blockers. Issues #38 and #24 closed 2026-09-20.

[critical-next-actions]
actions = [
"Discharge remaining PROOF-NEEDS obligations KR-1..KR-8",
"Implement full KRL parser in Zig with Idris2 proofs",
"Expand Nix/Guix development shell templates",
]

[maintenance-status]
last-run-utc = "2026-09-20"
last-report = "docs/reports/maintenance/latest.json"
last-result = "pass"
open-warnings = 0
open-failures = 0

[ecosystem]
part-of = ["KRL Stack", "QuandleDB ecosystem"]
depends-on = ["tangle", "quandledb", "Skein.jl", "KnotTheory.jl"]

# ---------------------------------------------------------------------------
# KRL specific state:
# - RSR instantiation complete 2026-09-20 (Issue #38)
# - KR-6 two-parser equivalence VOID, fragment conformance now (Issue #24)
# - v0.1.0 subset documented in docs/v0.1.0-subset.md
# - canonical projection design preserved in tests/conformance/differential_test.jl
# ---------------------------------------------------------------------------
2 changes: 1 addition & 1 deletion .machine_readable/ai/AI.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
- `krl` is treated as a Rhodium Standard Repository; 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.

Expand Down
65 changes: 65 additions & 0 deletions .machine_readable/anchors/ANCHOR.a2ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
#
# ANCHOR.a2ml - authoritative anchor for krl (canonical location)

[metadata]
version = "1.0.0"
last-updated = "2026-09-20"

[anchor]
schema = "hyperpolymath.anchor/1"
repo = "hyperpolymath/krl"
authority = "upstream-canonical"

purpose = [
"Define canonical semantics and policy boundaries for KRL.",
"Declare what downstream/satellite repos (quandledb, tangle) can extend but not redefine.",
"Provide a stable golden path and invariant contract for release readiness.",
]

[identity]
project = "KRL"
kind = "language"
one-sentence = "KRL (Knot Resolution Language, pronounced 'curl') — standalone DSL for knot/tangle construction, transformation, resolution, and retrieval"
domain = "knot-theory"

[semantic-authority]
policy = "canonical"

owns = [
"Project semantics and specification (spec/grammar.ebnf)",
"Invariant definitions and contractiles",
"Reference implementation behavior (via QuandleDB server/krl)",
"ABI/FFI definitions (Idris2 + Zig)",
]

[implementation-policy]
allowed = ["Idris2", "Zig", "Julia", "Rust", "Scheme", "Shell", "Just", "AsciiDoc", "Markdown"]
forbidden = ["Node.js", "npm"]

[golden-path]
smoke-test-command = [
"bash tests/smoke/grammar_smoke.sh",
"just test",
]
success-criteria = [
"Grammar smoke tests pass",
"FFI unit tests pass (zig build test)",
"No unresolved critical security findings",
]

[satellite-policy]
must-pin-upstream = true
must-declare-authority = true
must-have-anchor = true
must-have-golden-path = true

[semantic-authority-files]
language-spec = "spec/grammar.ebnf"
grammar-overview = "spec/grammar-overview.md"
surfaces = "spec/SURFACES.adoc"
formal-proofs = "docs/proofs/PROOFS.adoc"
type-theory = "docs/theory/THEORY.adoc"
abi = "src/interface/abi/"
ffi = "src/interface/ffi/"
4 changes: 2 additions & 2 deletions .machine_readable/bot_directives/methodology.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "KRL — Knot Resolution Language: compositional DSL for constructing, transforming, resolving, and retrieving topological objects (tangles, knots, links) with Idris2 ABI and Zig FFI"
deepen-not-broaden = true

# ============================================================================
Expand Down Expand Up @@ -101,7 +101,7 @@ constraints = [
# These rules detect corrupt/template/stale state files.

[methodology.state-validation]
reject-if-contains = ["{{PLACEHOLDER}}", "KRL", "rsr-template-repo"]
reject-if-contains = ["PLACEHOLDER", "rsr-template"] # detects uninstantiated template state via keyword markers
reject-if-project-name-mismatch = true
staleness-threshold-days = 90
fallback-files = ["TODO.md", "TODO.adoc", "ROADMAP.adoc", "README.adoc"]
6 changes: 3 additions & 3 deletions .machine_readable/contractiles/Adjustfile.a2ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: MPL-2.0
# Adjustfile — Drift-tolerance contract for rsr-template-repo
# Adjustfile — Drift-tolerance contract for krl
# Author: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
#
# Cumulative-drift catchment: tolerance bands + corrective actions.
Expand All @@ -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 krl. Unlike
MUST (hard gate), ADJUST tracks cumulative drift against tolerance bands
and proposes corrective actions. Advisory — it warns and trends, it does
not block.
Expand All @@ -19,7 +19,7 @@ not block.
### placeholder-drift
- description: Template placeholders should be replaced when copied
- tolerance: 0 placeholder markers in copied repos
- corrective: Search and replace all {{PLACEHOLDER}} markers
- corrective: Search and replace all PLACEHOLDER markers
- severity: advisory
- notes: This check only applies to repos that copied from this template

Expand Down
6 changes: 3 additions & 3 deletions .machine_readable/contractiles/Intentfile.a2ml
Original file line number Diff line number Diff line change
@@ -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 krl
# Author: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
#
# Paired runner: intend.ncl
Expand All @@ -20,14 +20,14 @@
# contractile for hard gates.

@abstract:
North-star contractile for rsr-template-repo. This repository is the
North-star contractile for krl. This repository is the
canonical template for Rhodium Standard Repository compliance. It provides
the scaffold that all hyperpolymath repos should copy and customize.
@end

## Purpose

The rsr-template-repo serves as the master template for all hyperpolymath
The krl 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.

Expand Down
Loading
Loading