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
2 changes: 1 addition & 1 deletion .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Both are FOSS with independent governance (no Big Tech).
### Package Management

- **Primary**: Guix (guix.scm)
- **Fallback**: Nix (flake.nix)
- **Fallback**: Guix (flake.guix)
- **JS deps**: Deno (deno.json imports)

### Security Requirements
Expand Down
6 changes: 3 additions & 3 deletions .containerization/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ Builds in local Guix environment (requires Guix installed).
The `Containerfile` uses 4 stages:

1. **guix-base**: Chainguard Wolfi + Guix installation
2. **build-tools**: Install Deno, ReScript, Idris2, Zig via Guix
3. **builder**: Compile extension (ReScript + Idris2 proofs)
2. **build-tools**: Install Deno, AffineScript, Idris2, Zig via Guix
3. **builder**: Compile extension (AffineScript + Idris2 proofs)
4. **runtime**: Minimal image with just the built .xpi

=== Security Scanning Pipeline
Expand All @@ -67,7 +67,7 @@ The `build.sh` script orchestrates:

2. **Build**:
- Guix reproducible environment
- ReScript compilation
- AffineScript compilation
- Idris2 proof checking

3. **Post-build**:
Expand Down
4 changes: 2 additions & 2 deletions .containerization/cerro-terro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ stages:
export PATH="${GUIX_PROFILE}/bin:$PATH"
guix environment --pure fireflag

- name: Build ReScript
run: rescript build
- name: Build AffineScript
run: affinescript build

- name: Verify Idris2 proofs
run: |
Expand Down
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"
6 changes: 3 additions & 3 deletions .machine_readable/6a2/STATE.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ security-tests = 21
benchmarks = 26
total-tests = 94
test-pass-rate = 100
test-language = "rescript"
test-language = "affinescript"

[test-suites]
types = "tests/unit/TypesTest.res"
Expand All @@ -45,12 +45,12 @@ aspect = "DONE"
benchmarks = "DONE"

[recent-changes]
2026-04-18 = "Transpiled the full TS test suite to ReScript per hyperpolymath language policy. 94 tests still pass (42 unit + 18 property + 13 E2E + 21 security) across 26 benchmarks. Extension XPI unaffected (no TS ever shipped). Added @rescript/runtime esm.sh mapping to deno.json; tests/ registered as a dev source dir in rescript.json."
2026-04-18 = "Transpiled the full TS test suite to AffineScript per hyperpolymath language policy. 94 tests still pass (42 unit + 18 property + 13 E2E + 21 security) across 26 benchmarks. Extension XPI unaffected (no TS ever shipped). Added @affinescript/runtime esm.sh mapping to deno.json; tests/ registered as a dev source dir in affinescript.json."
2026-04-04 = "Added comprehensive Deno test suite: 94 tests (42 unit + 21 property + 14 E2E + 17 security), 28 benchmarks, 100% pass rate. Deleted tests/fuzz/placeholder.txt. Updated deno.json with test tasks."

[next-actions]
1 = "Run panic-attack assail scan"
2 = "Verify ReScript build (`just build`)"
2 = "Verify AffineScript build (`just build`)"
3 = "Manual Firefox extension test"
4 = "Manual Chrome extension test"
5 = "Complete CRG B requirements (6 targets)"
24 changes: 12 additions & 12 deletions .machine_readable/contractiles/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ project := "fireflag"
default:
@just --list --unsorted

# Build ReScript sources
# Build AffineScript sources
build:
deno run -A npm:rescript build
deno run -A npm:affinescript build

# Build in watch mode
watch:
deno run -A npm:rescript build -w
deno run -A npm:affinescript build -w

# Clean build artifacts
clean:
deno run -A npm:rescript clean
deno run -A npm:affinescript clean
rm -rf src/**/*.res.js src/**/*.bs.js

# Format ReScript code
# Format AffineScript code
fmt:
deno run -A npm:rescript format src/**/*.res
deno run -A npm:affinescript format src/**/*.res

# Type check
check:
deno run -A npm:rescript build
deno run -A npm:affinescript build

# Run tests
test:
Expand All @@ -40,10 +40,10 @@ test:
example:
deno run --allow-read src/example.js

# Lint (placeholder for future rescript-eslint)
# Lint (placeholder for future affinescript-eslint)
lint:
@echo "Lint: Type checking via rescript build"
deno run -A npm:rescript build
@echo "Lint: Type checking via affinescript build"
deno run -A npm:affinescript build

# Extension development tasks
# --------------------------
Expand Down Expand Up @@ -77,7 +77,7 @@ sign-ext KEY SECRET:
# Build in Guix environment (local)
guix-build:
guix shell -m .containerization/guix-manifest.scm -- \
bash -c "deno run -A npm:rescript build && cd extension && deno run -A npm:web-ext build"
bash -c "deno run -A npm:affinescript build && cd extension && deno run -A npm:web-ext build"

# Build using Guix package definition
guix-package:
Expand Down Expand Up @@ -190,7 +190,7 @@ doctor:
}
check "just" just "1.25"
check "git" git "2.40"
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
16 changes: 8 additions & 8 deletions 0-AI-MANIFEST.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ The `.machine_readable/` directory contains structured metadata required for aut

| Language/Tool | Use Case | Notes |
|---------------|----------|-------|
| ReScript | Application code | Type-safe, compiles to JS |
| AffineScript | Application code | Type-safe, compiles to JS |
| Deno | Runtime and package management | Replaces Node/npm/bun |
| Rust | Systems, performance-critical, WASM | Preferred for CLI tools |
| Tauri 2.0+ | Mobile apps (iOS/Android) | Rust backend + web UI |
| Dioxus | Mobile apps (native UI) | Pure Rust, React-like |
| Gleam | Backend services | BEAM or JS targets |
| Bash/POSIX Shell | Automation scripts | Keep minimal |
| JavaScript | Only where ReScript cannot | MCP glue, Deno APIs |
| JavaScript | Only where AffineScript cannot | MCP glue, Deno APIs |
| Nickel | Configuration | Complex config logic |
| Guile Scheme | Metadata/state files | For all `.scm` artefacts |
| Julia | Batch/data processing | Per RSR |
Expand All @@ -67,13 +67,13 @@ The `.machine_readable/` directory contains structured metadata required for aut

| Banned | Replacement |
|--------|-------------|
| TypeScript | ReScript |
| TypeScript | AffineScript |
| Node.js | Deno |
| npm | Deno |
| Bun | Deno |
| pnpm/yarn | Deno |
| Go | Rust |
| Python | Julia / Rust / ReScript |
| Python | Julia / Rust / AffineScript |
| Java/Kotlin | Rust / Tauri / Dioxus |
| Swift | Tauri / Dioxus |
| React Native | Tauri / Dioxus |
Expand All @@ -83,24 +83,24 @@ The `.machine_readable/` directory contains structured metadata required for aut

A strict Rust-first approach applies.

- Use **Tauri 2.0+** for web UI (ReScript) + Rust backend.
- Use **Tauri 2.0+** for web UI (AffineScript) + Rust backend.
- Use **Dioxus** for pure Rust native UI.

Both are FOSS with independent governance.

## Enforcement Rules

- Do not create new TypeScript files; convert existing TS to ReScript.
- Do not create new TypeScript files; convert existing TS to AffineScript.
- Do not use `package.json` for runtime dependencies; use `deno.json` imports.
- Do not include `node_modules` in production; Deno handles dependency caching.
- Do not use Go; use Rust.
- Do not use Python; use Julia (data/batch), Rust (systems), or ReScript (apps).
- Do not use Python; use Julia (data/batch), Rust (systems), or AffineScript (apps).
- Do not use Kotlin/Swift; use Tauri 2.0+ or Dioxus for mobile.

## Package Management

- Primary: Guix (`guix.scm`)
- Fallback: Nix (`flake.nix`)
- Fallback: Guix (`flake.guix`)
- JavaScript dependencies: Deno (`deno.json` imports)

## Security Requirements
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
14 changes: 7 additions & 7 deletions BUILD-REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>

### Libraries
- ✅ `lib/idris/` - Idris2 proof modules (FlagSafety, FlagTransaction, SafeUI)
- ✅ `lib/rescript/` - ReScript type definitions
- ✅ `lib/affinescript/` - AffineScript type definitions

**Total Files:** 37 files
**Total Size:** 119 KB (compressed)
Expand Down Expand Up @@ -78,7 +78,7 @@ fireflag-0.1.0.xpi
│ └── flags-schema.json
└── lib/
├── idris/ ✓
└── rescript/ ✓
└── affinescript/ ✓
```

## Build Notes
Expand All @@ -89,15 +89,15 @@ fireflag-0.1.0.xpi
- Icon set (5 sizes + SVG source)
- Background service worker
- Idris2 safety proof modules
- ReScript type definitions
- AffineScript type definitions

### What Was NOT Built (Optional)
- ReScript compilation (UI already in JavaScript)
- AffineScript compilation (UI already in JavaScript)
- WASM optimizations (not required for v1.0)
- Idris2 compiled binaries (proof checking only)

### Build Method
Used `web-ext build` to package extension without ReScript compilation.
Used `web-ext build` to package extension without AffineScript compilation.
JavaScript UI files are complete and functional.

## Testing Recommendations
Expand Down Expand Up @@ -128,7 +128,7 @@ sha256sum -c extension/web-ext-artifacts/SHA256SUMS
### Build Warnings (Non-Critical)
- npm engine warnings for Node 20.11 vs 20.18 (can be ignored)
- Deprecated packages (cheerio, whatwg-encoding) - from web-ext dependencies
- ReScript code has deprecation warnings (not compiled in this build)
- AffineScript code has deprecation warnings (not compiled in this build)

### Not Blocking Release
These warnings are from development dependencies and don't affect the extension functionality.
Expand All @@ -145,7 +145,7 @@ These warnings are from development dependencies and don't affect the extension
7. ⏳ Submit to Mozilla Add-ons

### Optional Improvements
- Compile ReScript code for type safety
- Compile AffineScript code for type safety
- Add WASM optimizations
- Run containerized build for reproducibility
- Generate SLSA provenance
Expand Down
34 changes: 17 additions & 17 deletions BUILD_INSTRUCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This document explains how to build FireFlag from source code.
## Prerequisites

- **Deno** 2.1.4 or later (JavaScript/TypeScript runtime)
- **ReScript** compiler (for .res → .js compilation)
- **AffineScript** compiler (for .res → .js compilation)
- **Idris2** 0.7.0 or later (optional - for rebuilding formally verified libraries)

## Quick Build (Reviewers)
Expand All @@ -33,26 +33,26 @@ ls -lh ../fireflag-0.1.0.zip

## Full Build from Source (Optional)

If you want to rebuild the ReScript files:
If you want to rebuild the AffineScript files:

### 1. Install Dependencies

```bash
# Install Deno (if not already installed)
curl -fsSL https://deno.land/install.sh | sh

# Install ReScript globally
deno install -g @rescript/core
# Install AffineScript globally
deno install -g @affinescript/core
```

### 2. Rebuild ReScript Files
### 2. Rebuild AffineScript Files

```bash
# Navigate to lib/rescript directory
cd extension/lib/rescript/
# Navigate to lib/affinescript directory
cd extension/lib/affinescript/

# Compile .res files to .res.js
rescript build
affinescript build

# OR use Deno to compile
deno task build
Expand All @@ -68,7 +68,7 @@ deno task build

```bash
# Check that .res.js files exist
ls -l extension/lib/rescript/*.res.js
ls -l extension/lib/affinescript/*.res.js

# Should show: Types.res.js
```
Expand Down Expand Up @@ -113,7 +113,7 @@ fireflag/
│ ├── options/ # Options page
│ ├── devtools/ # DevTools panel
│ ├── lib/ # Libraries
│ │ ├── rescript/ # ReScript source (.res)
│ │ ├── affinescript/ # AffineScript source (.res)
│ │ │ └── *.res.js # Compiled JavaScript
│ │ ├── idris/ # Idris2 proofs (.idr)
│ │ └── dom-utils.js # Safe DOM utilities
Expand Down Expand Up @@ -150,12 +150,12 @@ diff submitted.txt built.txt

## Code Generators Used

1. **ReScript Compiler**
1. **AffineScript Compiler**
- Version: Latest stable
- Input: `.res` files (ReScript source)
- Input: `.res` files (AffineScript source)
- Output: `.res.js` files (JavaScript)
- Purpose: Type-safe JavaScript generation
- Repository: https://github.com/rescript-lang/rescript-compiler
- Repository: https://github.com/affinescript-lang/affinescript-compiler

2. **Idris2** (Optional, for proofs only)
- Version: 0.7.0+
Expand All @@ -178,9 +178,9 @@ diff submitted.txt built.txt

## Notes for Reviewers

### Why ReScript?
### Why AffineScript?

ReScript provides:
AffineScript provides:
- **Type safety:** Compile-time guarantees against common JavaScript errors
- **Memory safety:** No null/undefined errors at runtime
- **Performance:** Generates optimized JavaScript
Expand All @@ -203,6 +203,6 @@ All source code is available at:

---

**Build Time:** < 5 seconds (ReScript compilation only)
**Build Time:** < 5 seconds (AffineScript compilation only)
**Build Reproducibility:** Deterministic (same source → same output)
**Build Dependencies:** Deno + ReScript (optional: Idris2 for proofs)
**Build Dependencies:** Deno + AffineScript (optional: Idris2 for proofs)
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ this project aims to follow [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- refactor(tests): transpile TS test suite to ReScript
- refactor(tests): transpile TS test suite to AffineScript
- refactor: migrate 6SCM → 6A2 (.scm → .a2ml format)

### Documentation

- docs(tests): sync STATE.a2ml + TEST-NEEDS + CRG audit to ReScript tests
- docs(tests): sync STATE.a2ml + TEST-NEEDS + CRG audit to AffineScript tests
- docs(governance): CRG v2.0 STRICT audit — C (declared) -> D (honest)
- docs: add submission ready checklist
- docs: add release notes for v0.1.0
Expand Down
Loading
Loading