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
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ updates:
schedule:
interval: "weekly"

# Nix flakes
- package-ecosystem: "nix"
# Guix flakes
- package-ecosystem: "guix"
directory: "/"
schedule:
interval: "weekly"
4 changes: 2 additions & 2 deletions deno/.machine_readable/6a2/META.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ author = "Jonathan D.A. Jewell (hyperpolymath)"
build-tool = "just"
container-runtime = "podman"
ci-platform = "github-actions"
package-manager = "guix" # guix | nix | cargo | mix
package-manager = "guix" # guix | guix | cargo | mix

[maintenance-axes]
scoping-first = true
Expand All @@ -46,7 +46,7 @@ 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)"
drift-risk-example = "single exception broadening into policy violation (e.g. AffineScript->TypeScript spread)"
effects-evidence = "benchmark execution/results and maintainer status dialogue/review"

[design-rationale]
Expand Down
4 changes: 2 additions & 2 deletions deno/.machine_readable/6a2/STATE.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ milestones = [
{ name = "Phase 1e: Trustfile / contractiles", completion = 100 },
{ name = "Phase 2: Container ecosystem templates (stapeln)", completion = 100 },
{ name = "Phase 3: Multi-forge sync hardening", completion = 0 },
{ name = "Phase 4: Nix/Guix reproducible shells", completion = 50 },
{ name = "Phase 4: Guix/Guix reproducible shells", completion = 50 },
]

[blockers-and-issues]
Expand All @@ -43,7 +43,7 @@ actions = [
"Container templates complete — test with `just container-init`",
"Validate container templates across wolfi-base and static Chainguard images",
"Harden multi-forge sync for GitLab/Bitbucket mirroring edge cases",
"Expand Nix/Guix development shell templates",
"Expand Guix/Guix development shell templates",
]

[maintenance-status]
Expand Down
6 changes: 3 additions & 3 deletions deno/.machine_readable/ai/PLACEHOLDERS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ sed -i "s/{{CURRENT_DATE}}/$(date +%Y-%m-%d)/g" $(grep -rl '{{CURRENT_DATE}}' .)

| 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_NAME}}` | Human-readable project name | `My Project` | SECURITY.md, CODE_OF_CONDUCT.md, TOPOLOGY.md, STATE.a2ml, Justfile, GOVERNANCE.md, MAINTAINERS.md, flake.guix, devcontainer.json |
| `{{PROJECT_DESCRIPTION}}` | One-line description | `A tool for X` | flake.guix |
| `{{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 |
Expand Down Expand Up @@ -133,7 +133,7 @@ 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='Justfile' --include='*.guix' --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'
Expand Down
4 changes: 2 additions & 2 deletions deno/.machine_readable/contractiles/dust/Dustfile.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ These are maintenance tasks — not blocking, but should be addressed.
- run: test -z "$(git ls-files server/_build/ server/deps/ 2>/dev/null)"
- severity: warning

### no-tracked-rescript-build
- description: No ReScript build artifacts tracked in git
### no-tracked-affinescript-build
- description: No AffineScript build artifacts tracked in git
- run: test -z "$(git ls-files 'client/web/src/**/*.res.mjs' client/web/lib/ 2>/dev/null)"
- severity: warning

Expand Down
12 changes: 6 additions & 6 deletions deno/.machine_readable/contractiles/must/Mustfile.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ These are hard requirements — CI and pre-commit hooks fail if any check fails.

## Web Client

### rescript-json-present
- description: ReScript config exists for web client
- run: test -f client/web/rescript.json
### affinescript-json-present
- description: AffineScript config exists for web client
- run: test -f client/web/affinescript.json
- severity: warning

### web-entry-point
Expand Down Expand Up @@ -98,7 +98,7 @@ These are hard requirements — CI and pre-commit hooks fail if any check fails.
- severity: critical

### no-unsafe-coerce
- description: No unsafeCoerce in ReScript/Haskell code
- description: No unsafeCoerce in AffineScript/Haskell code
- run: test -z "$(find . \( -name '*.res' -o -name '*.hs' \) -not -path '*/deps/*' -not -path '*/node_modules/*' -exec grep -l 'unsafeCoerce\|Obj.magic' {} \; 2>/dev/null)"
- severity: critical

Expand All @@ -117,12 +117,12 @@ These are hard requirements — CI and pre-commit hooks fail if any check fails.
## Language Policy

### no-typescript
- description: No TypeScript files (use ReScript)
- description: No TypeScript files (use AffineScript)
- run: test -z "$(find . -name '*.ts' -not -name '*.d.ts' -not -path '*/deps/*' -not -path '*/node_modules/*' 2>/dev/null)"
- severity: warning

### no-python
- description: No Python files (use Julia/Rust/ReScript)
- description: No Python files (use Julia/Rust/AffineScript)
- run: test -z "$(find . -name '*.py' -not -path '*/deps/*' -not -path '*/node_modules/*' 2>/dev/null)"
- severity: warning

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ compliance-seams-check = true
exception-register-required = true
exception-bounded-scope-required = true
policy-drift-contamination-check = true
example-drift-risk = "single TypeScript exception causing broad ReScript->TypeScript migration"
example-drift-risk = "single TypeScript exception causing broad AffineScript->TypeScript migration"
compliance-tooling = "panic-attack"
effects-tooling = "ecological checking with sustainabot guidance"

Expand Down
2 changes: 1 addition & 1 deletion deno/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ We welcome contributions in many forms:
## Getting Started

1. **Read the AI Manifest:** Start with `0-AI-MANIFEST.a2ml` (if present) to understand the repository structure.
2. **Environment:** Use `nix develop` or `direnv allow` to set up your tools.
2. **Environment:** Use `guix develop` or `direnv allow` to set up your tools.
3. **Task Runner:** Use `just` to see available commands (`just --list`).

## Development Workflow
Expand Down
12 changes: 6 additions & 6 deletions deno/EXPLAINME.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ The README makes claims. This file backs them up.

=== Claim 1: "Complete parser and renderer for A2ML documents with attestation provenance and trust-level tracking"

**How it works:** The ReScript parser (`src/A2ML_Parser.res`) implements a line-oriented grammar recognizing: headings (`# Title`), paragraphs, inline formatting (bold `**x**`, italic `*x*`, code `` `x` ``), directives (`@key(val):`), attestation blocks (`!attest...!end`), and trust levels (`trust-level: verified|reviewed|automated|unverified`). The AST (in `src/A2ML_Types.res`) represents documents as a tree of blocks and inlines. The `A2ML_Renderer.res` walks the AST and emits back A2ML text, preserving structure (round-trip fidelity: parse then render equals original text). Trust levels are enums tracked in attestation records, enabling queries like "which claims are verified?"
**How it works:** The AffineScript parser (`src/A2ML_Parser.res`) implements a line-oriented grammar recognizing: headings (`# Title`), paragraphs, inline formatting (bold `**x**`, italic `*x*`, code `` `x` ``), directives (`@key(val):`), attestation blocks (`!attest...!end`), and trust levels (`trust-level: verified|reviewed|automated|unverified`). The AST (in `src/A2ML_Types.res`) represents documents as a tree of blocks and inlines. The `A2ML_Renderer.res` walks the AST and emits back A2ML text, preserving structure (round-trip fidelity: parse then render equals original text). Trust levels are enums tracked in attestation records, enabling queries like "which claims are verified?"

**Caveat:** Trust level is metadata only—the parser doesn't cryptographically verify attestations. If a `trust-level: verified` claim is false, the parser won't detect it. Verification requires external validation (signature checking, authority lookup). The parser is linear (single pass), so it doesn't detect forward references or cross-attestation consistency.

**Evidence:** `src/A2ML_Parser.res` implements parse(text): Result<Document> with explicit trust-level variants. `src/A2ML_Renderer.res` implements render(doc): String. Tests in `src/tests/` verify round-trip fidelity and all syntax forms.

=== Claim 2: "Deno-native with zero dependencies, compiled from ReScript to ES6 JavaScript modules"
=== Claim 2: "Deno-native with zero dependencies, compiled from AffineScript to ES6 JavaScript modules"

**How it works:** The library is written in ReScript (.res files) and compiled to JavaScript ES6 modules using ReScript's toolchain (invoked via `deno task build`). The generated JavaScript has no external dependencies—it uses only Deno's standard library (console for logging, Uint8Array for buffers if needed). The build output is ESM (ECMAScript Modules) with proper import/export statements. Users add the package to their Deno project via `deno add jsr:@hyperpolymath/a2ml`, and Deno's dependency resolver caches it. No package.json, no node_modules, no npm—pure Deno integration.
**How it works:** The library is written in AffineScript (.res files) and compiled to JavaScript ES6 modules using AffineScript's toolchain (invoked via `deno task build`). The generated JavaScript has no external dependencies—it uses only Deno's standard library (console for logging, Uint8Array for buffers if needed). The build output is ESM (ECMAScript Modules) with proper import/export statements. Users add the package to their Deno project via `deno add jsr:@hyperpolymath/a2ml`, and Deno's dependency resolver caches it. No package.json, no node_modules, no npm—pure Deno integration.

**Caveat:** ReScript compilation adds a build step. If Deno directly executes .res files, there's a type-checking overhead. The generated JavaScript is readable but less idiomatic than hand-written JavaScript. ReScript's error messages can be cryptic for beginners.
**Caveat:** AffineScript compilation adds a build step. If Deno directly executes .res files, there's a type-checking overhead. The generated JavaScript is readable but less idiomatic than hand-written JavaScript. AffineScript's error messages can be cryptic for beginners.

**Evidence:** `deno.json` specifies build task (`deno task build` → rescript compile); `src/A2ML.res` exports public API (`parse`, `render`, `parseErrorToString`); generated JS in `lib/` is published to JSR.
**Evidence:** `deno.json` specifies build task (`deno task build` → affinescript compile); `src/A2ML.res` exports public API (`parse`, `render`, `parseErrorToString`); generated JS in `lib/` is published to JSR.

== Technology Choices

[cols="1,2"]
|===
| Technology | Learn More

| **ReScript** | Compiles to ES6 JavaScript, type-safe
| **AffineScript** | Compiles to ES6 JavaScript, type-safe
| **Deno** | Modern runtime (no Node/npm), JSR package registry
| **A2ML Spec** | Markup language with attestation and trust levels
|===
Expand Down
16 changes: 8 additions & 8 deletions deno/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ init:

# Check for remaining placeholders
PATTERN="${LB}[A-Z_]*${RB}"
REMAINING=$(grep -rl "$PATTERN" . --include='*.md' --include='*.adoc' --include='*.yml' --include='*.yaml' --include='*.a2ml' --include='*.toml' --include='*.scm' --include='*.ncl' --include='*.nix' --include='*.json' --include='*.sh' 2>/dev/null | grep -v '.git/' | grep -v '.machine_readable/ai/PLACEHOLDERS.adoc' || true)
REMAINING=$(grep -rl "$PATTERN" . --include='*.md' --include='*.adoc' --include='*.yml' --include='*.yaml' --include='*.a2ml' --include='*.toml' --include='*.scm' --include='*.ncl' --include='*.guix' --include='*.json' --include='*.sh' 2>/dev/null | grep -v '.git/' | grep -v '.machine_readable/ai/PLACEHOLDERS.adoc' || true)
if [ -n "$REMAINING" ]; then
echo "WARNING: Remaining placeholders in:"
echo "$REMAINING" | sed 's/^/ /'
Expand Down Expand Up @@ -272,7 +272,7 @@ build *args:
# cargo build {{args}} # Rust
# mix compile {{args}} # Elixir
# zig build {{args}} # Zig
# deno task build {{args}} # Deno/ReScript
# deno task build {{args}} # Deno/AffineScript
@echo "Build complete"

# Build in release mode with optimizations
Expand Down Expand Up @@ -791,7 +791,7 @@ state-phase:
@grep -oP 'phase\s*=\s*"\K[^"]+' .machine_readable/STATE.a2ml 2>/dev/null | head -1 || echo "unknown"

# ═══════════════════════════════════════════════════════════════════════════════
# GUIX & NIX
# GUIX & GUIX
# ═══════════════════════════════════════════════════════════════════════════════

# Enter Guix development shell (primary)
Expand All @@ -802,9 +802,9 @@ guix-shell:
guix-build:
guix build -f guix.scm

# Enter Nix development shell (fallback)
nix-shell:
@if [ -f "flake.nix" ]; then nix develop; else echo "No flake.nix"; fi
# Enter Guix development shell (fallback)
guix-shell:
@if [ -f "flake.guix" ]; then guix develop; else echo "No flake.guix"; fi

# ═══════════════════════════════════════════════════════════════════════════════
# HYBRID AUTOMATION
Expand Down Expand Up @@ -936,7 +936,7 @@ doctor:
check "just" just "1.25"
check "git" git "2.40"
check "Deno" deno "2.0"
check "ReScript (resc)" rescript "12.0"
check "AffineScript (resc)" affinescript "12.0"
# Optional tools
if command -v panic-attack >/dev/null 2>&1; then
echo " [OK] panic-attack — available"
Expand Down Expand Up @@ -981,7 +981,7 @@ tour:
echo " A2Ml Deno — Guided Tour"
echo "═══════════════════════════════════════════════════"
echo ""
echo '**Deno-native parser library for A2ML (Attested Markup Language), written in ReScript.**'
echo '**Deno-native parser library for A2ML (Attested Markup Language), written in AffineScript.**'
echo ""
echo "Key directories:"
echo " src/ Source code"
Expand Down
2 changes: 1 addition & 1 deletion deno/PROOF-NEEDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Current state
- ABI directory exists (template-level)
- No dangerous patterns found
- 2.2K lines; ReScript-based A2ML parser with trust-level hierarchy
- 2.2K lines; AffineScript-based A2ML parser with trust-level hierarchy

## What needs proving
- **Trust-level ordering**: Prove the trust hierarchy (Unverified < Automated < Reviewed < Verified) forms a total order and that attestation operations never silently upgrade trust level
Expand Down
12 changes: 6 additions & 6 deletions deno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ SPDX-FileCopyrightText: 2025-2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
# Overview

**Deno-native parser library for A2ML (Attested Markup Language),
written in ReScript.**
written in AffineScript.**

A2ML is a structured markup language with built-in attestation
provenance, directive metadata, and trust-level tracking. This library
provides a complete parser and renderer for A2ML documents, compiled
from ReScript to JavaScript ES modules for use with Deno.
from AffineScript to JavaScript ES modules for use with Deno.

# Features

Expand All @@ -28,12 +28,12 @@ from ReScript to JavaScript ES modules for use with Deno.

- Attestation provenance chain

- Zero dependencies beyond ReScript standard library
- Zero dependencies beyond AffineScript standard library

# Quick Start

```bash
# Build ReScript to JS
# Build AffineScript to JS
deno task build

# Use in your Deno project
Expand Down Expand Up @@ -81,14 +81,14 @@ const result = parse("# Hello World\n\nSome **bold** text.\n");

> Block quote text

```rescript
```affinescript
let x = 42
```

# Development

```bash
deno task build # Compile ReScript
deno task build # Compile AffineScript
deno task clean # Clean build artifacts
deno task test # Run tests
```
Expand Down
6 changes: 3 additions & 3 deletions deno/TEST-NEEDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## CRG Grade: C — ACHIEVED 2026-04-04

## Current State
- Unit tests: NONE (no Deno/ReScript test files found)
- Unit tests: NONE (no Deno/AffineScript test files found)
- Integration tests: 1 Zig integration test (ABI/FFI template)
- E2E tests: NONE
- Benchmarks: NONE (benchmark dir has only README placeholder)
Expand Down Expand Up @@ -35,7 +35,7 @@
### Build & Execution
- [ ] deno check — not verified
- [ ] deno test — not verified
- [ ] ReScript build — not verified
- [ ] AffineScript build — not verified
- [ ] Zig build — not verified
- [ ] Self-diagnostic — none

Expand All @@ -49,4 +49,4 @@
- [ ] Built-in doctor/check command (if applicable)

## Priority
- **HIGH** — A2ML is a critical format in the ecosystem. 4 ReScript source files + 3 Idris2 ABI + 2 Zig FFI files with ZERO functional tests. The fuzz directory contains only a placeholder.txt. As a library consumed by other projects, this needs comprehensive tests.
- **HIGH** — A2ML is a critical format in the ecosystem. 4 AffineScript source files + 3 Idris2 ABI + 2 Zig FFI files with ZERO functional tests. The fuzz directory contains only a placeholder.txt. As a library consumed by other projects, this needs comprehensive tests.
4 changes: 2 additions & 2 deletions deno/TOPOLOGY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

## Purpose

Deno-native parser and renderer for A2ML (Attested Markup Language), written in ReScript and compiled to JavaScript ES modules. Provides parse-render round-trip support for A2ML documents with trust-level hierarchy and directive blocks. Consumed by Deno runtimes and published to JSR.
Deno-native parser and renderer for A2ML (Attested Markup Language), written in AffineScript and compiled to JavaScript ES modules. Provides parse-render round-trip support for A2ML documents with trust-level hierarchy and directive blocks. Consumed by Deno runtimes and published to JSR.

## Module Map

```
a2ml-deno/
├── src/
│ ├── A2ML.res # Main public API
│ ├── A2ML_Types.res # AST types (ReScript variants)
│ ├── A2ML_Types.res # AST types (AffineScript variants)
│ ├── A2ML_Parser.res # Document parser
│ ├── A2ML_Renderer.res # AST-to-surface renderer
│ └── (compiled .mjs files co-located)
Expand Down
2 changes: 1 addition & 1 deletion deno/contractiles/intend/Intentfile.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Declared intent and purpose for A2Ml Deno.

## Purpose

A2Ml Deno — **Deno-native parser library for A2ML (Attested Markup Language), written in ReScript.**
A2Ml Deno — **Deno-native parser library for A2ML (Attested Markup Language), written in AffineScript.**

## Anti-Purpose

Expand Down
8 changes: 4 additions & 4 deletions deno/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
".": "./mod.ts"
},
"tasks": {
"build": "deno run -A npm:rescript build",
"clean": "deno run -A npm:rescript clean",
"build": "deno run -A npm:affinescript build",
"clean": "deno run -A npm:affinescript clean",
"test": "deno test --allow-read"
},
"imports": {
"rescript": "npm:rescript@11.*",
"@rescript/core": "npm:@rescript/core@1.*"
"affinescript": "npm:affinescript@11.*",
"@affinescript/core": "npm:@affinescript/core@1.*"
},
"nodeModulesDir": "auto"
}
Loading
Loading