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
18 changes: 9 additions & 9 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ Cross-platform document editor with format tabs, allowing users to view and edit
## Architecture

- **Core**: Rust library with unified AST for format conversion
- **GUI**: Gossamer (own webview shell) with ReScript frontend (not TypeScript!)
- **GUI**: Gossamer (own webview shell) with AffineScript frontend (not TypeScript!)
- **TUI**: Ada with AdaCurses (matches git-hud pattern)
- **Storage**: ArangoDB for graph + document hybrid
- **Pipelines**: Nickel for import/export transformations

## Language Policy

### ALLOWED
- ReScript (UI components)
- AffineScript (UI components)
- Rust (core, GUI backend)
- Ada (TUI)
- Nickel (pipelines, config)
- Guile Scheme (SCM files)
- Deno (runtime)

### BANNED - Do Not Use
- TypeScript (use ReScript)
- TypeScript (use AffineScript)
- Node.js/npm/bun (use Deno)
- Go (use Rust)
- Python (not applicable here)
Expand All @@ -44,11 +44,11 @@ crates/
└── formatrix-pipeline/ # Nickel executor

tui/src/ # Ada TUI source
ui/src/ # ReScript components
ui/src/ # AffineScript components
pipelines/ # Nickel pipeline definitions
container/ # Wolfi container configs
guix/ # Guix channel + packages
nix/ # Nix flake (fallback)
guix/ # Guix flake (fallback)
```

## Build Commands
Expand All @@ -57,7 +57,7 @@ nix/ # Nix flake (fallback)
just build # Build all
just build-core # Build Rust core only
just build-tui # Build Ada TUI only
just build-ui # Build ReScript UI only
just build-ui # Build AffineScript UI only
just test # Run all tests
just fmt # Format all code
just lint # Lint all code
Expand All @@ -84,9 +84,9 @@ Each format implements:
- `Parser` trait: raw content → AST
- `Renderer` trait: AST → raw content

## ReScript Conventions
## AffineScript Conventions

- Use `@rescript/core` for stdlib
- Use `@affinescript/core` for stdlib
- TEA pattern: Model.res, Msg.res, Update logic in App.res
- Components in `src/components/`
- Bindings in `src/bindings/`
Expand All @@ -103,7 +103,7 @@ Each format implements:
```bash
just test-core # Rust unit tests
just test-tui # Ada compilation check
just test-ui # ReScript tests
just test-ui # AffineScript tests
just test-integration # Full integration tests
```

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/governance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# in hyperpolymath/standards instead of carrying per-repo copies.
#
# Replaces the per-repo governance scaffolding removed in the same commit:
# quality.yml, guix-nix-policy.yml, npm-bun-blocker.yml, ts-blocker.yml,
# quality.yml, guix-guix-policy.yml, npm-bun-blocker.yml, ts-blocker.yml,
# security-policy.yml, rsr-antipattern.yml, wellknown-enforcement.yml,
# workflow-linter.yml
#
Expand Down
16 changes: 8 additions & 8 deletions .machine_readable/contractiles/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ info:
# BUILD & COMPILE
# ═══════════════════════════════════════════════════════════════════════════════

# Build all components (Rust + Ada + ReScript)
# Build all components (Rust + Ada + AffineScript)
build: build-core build-gui build-tui build-ui
@echo "All components built!"

Expand Down Expand Up @@ -91,9 +91,9 @@ build-tui:
fi
cd tui && gprbuild -P formatrix_tui.gpr -XMODE=debug

# Build ReScript UI
# Build AffineScript UI
build-ui:
@echo "Building ReScript UI..."
@echo "Building AffineScript UI..."
@cd ui && deno task build:res 2>&1 | tail -5

# Build in release mode
Expand Down Expand Up @@ -128,7 +128,7 @@ test-tui: build-tui
@echo "Testing formatrix-tui..."
@[ -f tui/bin/formatrix-tui ] && echo "TUI binary exists" || echo "SKIP: TUI not built (missing dependencies)"

# Test ReScript UI
# Test AffineScript UI
test-ui:
@echo "Testing UI..."
cd ui && deno task test 2>/dev/null || echo "UI tests not configured yet"
Expand Down Expand Up @@ -376,7 +376,7 @@ state-phase:
@grep -oP '\(phase\s+\.\s+\K[^)]+' STATE.scm 2>/dev/null | head -1 || echo "unknown"

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

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

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

# ═══════════════════════════════════════════════════════════════════════════════
# RELEASE
Expand Down
4 changes: 2 additions & 2 deletions ABI-FFI-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
┌─────────────────────────────────────────────┐
│ Any Language via C ABI │
│ - Rust, ReScript, Julia, Python, etc. │
│ - Rust, AffineScript, Julia, Python, etc. │
└─────────────────────────────────────────────┘
```

Expand Down Expand Up @@ -79,7 +79,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
└── bindings/ # Language-specific wrappers (optional)
├── rust/
├── rescript/
├── affinescript/
└── julia/
```

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
git clone https://github.com/hyperpolymath/docmatrix.git
cd docmatrix

# Using Nix (recommended for reproducibility)
nix develop
# Using Guix (recommended for reproducibility)
guix develop

# Or using toolbox/distrobox
toolbox create docmatrix-dev
Expand Down Expand Up @@ -45,7 +45,7 @@ docmatrix/
├── MAINTAINERS.md
├── README.adoc
├── SECURITY.md
├── flake.nix # Nix flake (Perimeter 1)
├── flake.guix # Guix flake (Perimeter 1)
└── justfile # Task runner (Perimeter 1)
```

Expand Down
12 changes: 6 additions & 6 deletions EXPLAINME.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ____
Cross-platform document editor with format tabs (TXT/MD/ADOC/DJOT/ORG/RST/TYP). Unified AST enables lossless conversion between formats. Gossamer GUI + Ada TUI. Graph visualization via ArangoDB, OCR/TTS/STT accessibility, Nickel pipelines for import/export.
____

Three components orchestrate this: Rust formatrix-core (parsers/renderers), Gossamer GUI (ReScript), Ada TUI. A unified AST allows viewing the same document in 7 different markup languages, each a lossless round-trip.
Three components orchestrate this: Rust formatrix-core (parsers/renderers), Gossamer GUI (AffineScript), Ada TUI. A unified AST allows viewing the same document in 7 different markup languages, each a lossless round-trip.

== Two Verifiable Claims from How-It-Works

Expand All @@ -25,11 +25,11 @@ Three components orchestrate this: Rust formatrix-core (parsers/renderers), Goss

=== Claim 2: Gossamer GUI Routes Document Tabs to Correct Renderer

**Location**: `/var/mnt/eclipse/repos/docmatrix/ui/src/app.res` (ReScript Gossamer GUI)
**Location**: `/var/mnt/eclipse/repos/docmatrix/ui/src/app.res` (AffineScript Gossamer GUI)

**How verified**: The GUI is a ReScript TEA application that loads a document (via ArangoDB), parses it in the primary format, then stores the AST. When the user clicks a format tab (MD, ADOC, DJOT, etc.), the app calls the appropriate `Renderer::render(ast)` and updates the editor view. README (§Features) documents 7 formats; `app.res` has a `FormatTab` selector that dispatches to format-specific renderers in the formatrix-core library. Tests verify tab switching preserves content.
**How verified**: The GUI is a AffineScript TEA application that loads a document (via ArangoDB), parses it in the primary format, then stores the AST. When the user clicks a format tab (MD, ADOC, DJOT, etc.), the app calls the appropriate `Renderer::render(ast)` and updates the editor view. README (§Features) documents 7 formats; `app.res` has a `FormatTab` selector that dispatches to format-specific renderers in the formatrix-core library. Tests verify tab switching preserves content.

**Caveat**: ReScript/JavaScript type checking doesn't catch bugs where a renderer is misconfigured; validation happens at runtime when user clicks tab.
**Caveat**: AffineScript/JavaScript type checking doesn't catch bugs where a renderer is misconfigured; validation happens at runtime when user clicks tab.

== Dogfooded Across The Account

Expand All @@ -50,8 +50,8 @@ The formatrix-core library uses the hyperpolymath ABI/FFI standard for OCR/TTS b
| `crates/formatrix-core/src/traits.rs` | Parser and Renderer traits used by all format modules
| `crates/formatrix-db/src/lib.rs` | ArangoDB client; stores documents and relationships
| `crates/formatrix-pipeline/src/lib.rs` | Nickel executor for import/export transformations
| `ui/src/app.res` | ReScript Gossamer GUI app (TEA pattern); format tab switching, editor
| `ui/src/components/` | ReScript components: editor, tabs, toolbar, preview
| `ui/src/app.res` | AffineScript Gossamer GUI app (TEA pattern); format tab switching, editor
| `ui/src/components/` | AffineScript components: editor, tabs, toolbar, preview
| `tui/src/main.adb` | Ada TUI entry point using Terminal_Interface.Curses
| `tui/src/tui.adb` | Ada TUI widget management (windows, input, rendering)
| `Containerfile` | Wolfi container; includes all build dependencies
Expand Down
16 changes: 8 additions & 8 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ info:
# BUILD & COMPILE
# ═══════════════════════════════════════════════════════════════════════════════

# Build all components (Rust + Ada + ReScript)
# Build all components (Rust + Ada + AffineScript)
build: build-core build-gui build-tui build-ui
@echo "All components built!"

Expand Down Expand Up @@ -92,9 +92,9 @@ build-tui:
fi
cd tui && gprbuild -P formatrix_tui.gpr -XMODE=debug

# Build ReScript UI
# Build AffineScript UI
build-ui:
@echo "Building ReScript UI..."
@echo "Building AffineScript UI..."
@cd ui && deno task build:res 2>&1 | tail -5

# Build in release mode
Expand Down Expand Up @@ -129,7 +129,7 @@ test-tui: build-tui
@echo "Testing formatrix-tui..."
@[ -f tui/bin/formatrix-tui ] && echo "TUI binary exists" || echo "SKIP: TUI not built (missing dependencies)"

# Test ReScript UI
# Test AffineScript UI
test-ui:
@echo "Testing UI..."
cd ui && deno task test 2>/dev/null || echo "UI tests not configured yet"
Expand Down Expand Up @@ -377,7 +377,7 @@ state-phase:
@grep -oP '\(phase\s+\.\s+\K[^)]+' STATE.scm 2>/dev/null | head -1 || echo "unknown"

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

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

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

# ═══════════════════════════════════════════════════════════════════════════════
# RELEASE
Expand Down
8 changes: 4 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Cross-platform document editor with format tabs (TXT/MD/ADOC/DJOT/ORG/RST/TYP).

* *Format Tabs* - View and edit the same document in multiple markup formats
* *Unified AST* - Lossless conversion between formats
* *GUI* - Gossamer with ReScript frontend
* *GUI* - Gossamer with AffineScript frontend
* *TUI* - Ada with AdaCurses for terminal usage
* *Graph Visualization* - ArangoDB for document relationships
* *Accessibility* - OCR, TTS, STT support
Expand Down Expand Up @@ -75,7 +75,7 @@ crates/
└── formatrix-pipeline/ # Nickel executor

tui/src/ # Ada TUI source
ui/src/ # ReScript components
ui/src/ # AffineScript components
pipelines/ # Nickel pipeline definitions
container/ # Wolfi container configs
----
Expand All @@ -96,7 +96,7 @@ container/ # Wolfi container configs
just build # Build all
just build-core # Build Rust core only
just build-tui # Build Ada TUI only
just build-ui # Build ReScript UI only
just build-ui # Build AffineScript UI only
just test # Run all tests
just fmt # Format all code
just lint # Lint all code
Expand Down Expand Up @@ -135,7 +135,7 @@ Automation scripts from https://github.com/hyperpolymath/scripts[hyperpolymath/s
| `touchscreen_hunter_killer.sh` | Touchscreen calibration/management
|===

These scripts follow the same language policy (Bash, Rust, ReScript, Deno, Gleam, Guile Scheme) and multi-forge mirroring strategy.
These scripts follow the same language policy (Bash, Rust, AffineScript, Deno, Gleam, Guile Scheme) and multi-forge mirroring strategy.

== License

Expand Down
4 changes: 2 additions & 2 deletions RSR_COMPLIANCE.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ This document certifies that *formatrix-docs* complies with the Rhodium Standard
| TUI implementation
| COMPLIANT

| ReScript
| AffineScript
| UI components
| COMPLIANT

Expand Down Expand Up @@ -94,7 +94,7 @@ No banned languages (TypeScript, Node.js, npm, Go, Python) are present in this r
- `build-core` - Rust core
- `build-gui` - Tauri GUI
- `build-tui` - Ada TUI
- `build-ui` - ReScript UI
- `build-ui` - AffineScript UI
- `build-release` - Release mode

=== Quality Recipes
Expand Down
8 changes: 4 additions & 4 deletions RSR_OUTLINE.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ project/

=== Language Tiers

* **Tier 1** (Gold): Rust, Elixir, Zig, Ada, Haskell, ReScript
* **Tier 2** (Silver): Nickel, Racket, Guile Scheme, Nix
* **Tier 1** (Gold): Rust, Elixir, Zig, Ada, Haskell, AffineScript
* **Tier 2** (Silver): Nickel, Racket, Guile Scheme, Guix
* **Infrastructure**: Guix channels, derivations

=== Required Files
Expand All @@ -163,12 +163,12 @@ project/
* `.well-known/security.txt`
* `.well-known/ai.txt`
* `.well-known/humans.txt`
* `guix.scm` OR `flake.nix`
* `guix.scm` OR `flake.guix`

=== Prohibited

* Python outside `salt/` directory
* TypeScript/JavaScript (use ReScript)
* TypeScript/JavaScript (use AffineScript)
* CUE (use Guile/Nickel)
* `Dockerfile` (use `Containerfile`)

Expand Down
4 changes: 2 additions & 2 deletions TOPOLOGY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
▼ ▼
┌───────────────────┐ ┌───────────────────┐
│ GUI (TAURI 2.0) │ │ TUI (ADA) │
│ (ReScript / React)│ │ (AdaCurses) │
│ (AffineScript / React)│ │ (AdaCurses) │
└──────────┬────────┘ └──────────┬────────┘
│ │
└──────────┬───────────┘
Expand Down Expand Up @@ -66,7 +66,7 @@ CORE ENGINE (RUST)
ArangoDB Client ██████████ 100% Document persistence stable

USER INTERFACES
Tauri 2.0 GUI ████████░░ 80% ReScript UI components active
Tauri 2.0 GUI ████████░░ 80% AffineScript UI components active
Ada TUI (AdaCurses) ██████░░░░ 60% Layout logic in progress
Graph Visualization ████░░░░░░ 40% Initial D3.js prototyping

Expand Down
8 changes: 4 additions & 4 deletions docs/DOCUMENTATION-SYSTEM-ARCHITECTURE.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ formatrix-docs/
│ ├── formatrix-db/ # ArangoDB client
│ └── formatrix-pipeline/ # Nickel executor
├── tui/ # Ada TUI (matches git-hud)
├── ui/ # ReScript frontend
├── ui/ # AffineScript frontend
└── pipelines/ # Nickel transform definitions
----

Expand Down Expand Up @@ -122,7 +122,7 @@ pub struct Document {
----
recon-silly-ation/
├── src/
│ ├── ReconForth.res # ReScript bindings to WASM
│ ├── ReconForth.res # AffineScript bindings to WASM
│ ├── EnforcementBot.res # Policy enforcement
│ ├── PackShipper.res # Bundle distribution
│ ├── LogicEngine.res # Datalog-style inference
Expand Down Expand Up @@ -351,7 +351,7 @@ Collections:

Components communicate via structured messages:

[source,rescript]
[source,affinescript]
----
type DocumentEvent =
| DocumentCreated(hash, path, format)
Expand Down Expand Up @@ -447,7 +447,7 @@ services:
[ "Missing SPDX header" emit-warning ] unless ;
----

2. Add to EnforcementBot schedule in ReScript
2. Add to EnforcementBot schedule in AffineScript
3. Configure in Docudactyl pipeline

=== Adding a New Pack Specification
Expand Down
Loading
Loading