Skip to content

Commit 39aba69

Browse files
committed
docs: complete documentation — EXPLAINME, contractiles, manifests
- EXPLAINME.adoc: comprehensive human/agent orientation document covering all core concepts (Echo types, paradoxes, stability score, gutter zone), architecture, file map, and next steps - contractiles/: fully populated with Error-Lang-specific content * must/Mustfile: 11 invariant checks (SPDX headers, Echo decomposition visibility, grammar canonicity, banned languages, AI manifest presence) * dust/Dustfile: 7 recovery handlers including echo-invariant-violation, stability-debit-missing, residue-unified-with-echo, ci-governance-failure (documents the pre-existing ReScript ban clearly) * trust/Trustfile.hs: trust model and 7 verification steps * lust/Intentfile: 5 intent items (INTENT-001 AffineScript re-target through INTENT-005 LSP Echo decomposition tracking) - .machine_readable/6a2/STATE.a2ml: updated to v0.5.0 with full session history, CI status, known pre-existing failure documented - 0-AI-MANIFEST.a2ml: fixed all path references (.scm → 6a2/*.a2ml), added EXPLAINME, contractiles, and compiler file locations; added known pre-existing CI failure section; added session exit sequence https://claude.ai/code/session_012vdXtQduudBNugv3ZPtQik
1 parent 4403fe0 commit 39aba69

8 files changed

Lines changed: 945 additions & 113 deletions

File tree

.machine_readable/6a2/STATE.a2ml

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,79 @@
44
# STATE.a2ml — Error Lang project state
55
[metadata]
66
project = "error-lang"
7-
version = "0.4.0"
8-
last-updated = "2026-02-07"
7+
version = "0.5.0"
8+
last-updated = "2026-06-02"
99
status = "active"
10-
session = "converted from scheme — 2026-04-11"
10+
session = "Echo types (structured loss) — 2026-06-02"
1111

1212
[project-context]
1313
name = "Error Lang"
14-
purpose = """Merge error-lang-playground into main repo"""
14+
purpose = """
15+
Add Echo types (Echo<A,B> / EchoR<A,B>) as Error-Lang's first-class, visible
16+
form of structured loss. Port the echo-types (Agda) / EchoTypes.jl (Julia)
17+
lineage into the compiler pipeline, type checker, VM, and documentation.
18+
Governing invariant: decomposition must be visible.
19+
"""
1520
completion-percentage = 100
1621

1722
[position]
1823
phase = "production-ready" # design | implementation | testing | maintenance | archived
19-
maturity = "experimental" # experimental | alpha | beta | production | lts
24+
maturity = "experimental" # experimental | alpha | beta | production | lts
2025

21-
[route-to-mvp]
22-
milestones = [
23-
# No milestones recorded
26+
[what-was-done]
27+
# Session 2026-06-02 — Echo types (structured loss)
28+
additions = [
29+
"Echo<A,B> and EchoR<A,B> types added to: lexer (keywords), parser (type annotations), type checker (TyEcho/TyEchoR, unification, builtins), codegen (dedicated opcodes), VM (VEcho/VResidue, stability debit)",
30+
"Five builtins mirroring EchoTypes.jl: echo, echo_to_residue, echo_input, echo_output, residue_strictly_loses",
31+
"Stability debit: echoEraseCost = 15.0 charged by OpEchoToResidue, never on projection",
32+
"Irreversibility: TyEcho never unifies with TyEchoR; echo_input is type+runtime error on EchoR",
33+
"Tests: type-checker (10), parser (1 comprehensive), lexer (2), runtime (5) across three decomposition planes",
34+
"New docs: docs/Echo-Decomposition.adoc (authoritative), spec/type-system.md §7, docs/Design-Philosophy.adoc section, docs/Error-Lang.adoc section, docs/Curriculum.adoc Lesson 11, docs/Educational-Framework.adoc, docs/Error-Categories.adoc echo-erasure row",
35+
"New example: examples/11-echo-decomposition.err (narrated, with gutter zone)",
36+
"Updated manifests: 0-AI-MANIFEST.a2ml (core narrative + invariants), META.a2ml (ADR-0001), NEUROSYM.a2ml (3 symbolic rules), ECOSYSTEM.a2ml (lineage), AGENTIC.a2ml (constraint)",
37+
"README.adoc decompositional framing and Echo introduction",
38+
"EXPLAINME.adoc created (human/agent orientation document)",
39+
"contractiles/ updated: Mustfile (Error-Lang invariants), Dustfile (recovery handlers), trust/Trustfile.hs (verification), lust/Intentfile (roadmap)",
40+
"CI hardening: casket-pages.yml, codeql.yml, hypatia-scan.yml get timeout-minutes (separate PR #18)",
2441
]
2542

43+
[current-ci-status]
44+
# As of 2026-06-02, PR #17 (Echo types) check status:
45+
passing = [
46+
"Hypatia Neurosymbolic Analysis",
47+
"CodeQL Analysis (javascript-typescript)",
48+
"governance / Licence consistency",
49+
"governance / Guix primary / Nix fallback policy",
50+
"governance / Well-Known (RFC 9116 + RSR)",
51+
"governance / Workflow security linter",
52+
"governance / Trusted-base reduction policy",
53+
"governance / Validate Hypatia baseline",
54+
"governance / Code quality + docs",
55+
"governance / Security policy checks",
56+
]
57+
failing = [
58+
"governance / Language / package anti-pattern policy",
59+
]
60+
failing-reason = """
61+
The anti-pattern policy bans ReScript (.res files) estate-wide. This failure
62+
is PRE-EXISTING on main — it fails identically there. It is NOT caused by
63+
Echo types or any recent work. Resolution: AffineScript re-target (INTENT-001,
64+
ADR-pending). Do NOT attempt to fix by removing .res files.
65+
"""
66+
2667
[blockers-and-issues]
2768
issues = [
28-
"Backend architecture decision: bytecode VM vs transpile to JS",
69+
"governance / Language / package anti-pattern policy — permanent pre-existing failure (ReScript ban); resolves only with AffineScript re-target",
2970
]
3071

3172
[critical-next-actions]
3273
actions = [
33-
"Decide on backend strategy (bytecode vs transpile)",
34-
"Complete Zig FFI bindings",
35-
"Start LSP server skeleton",
36-
"Design computational haptics visualization protocol",
37-
"Complete backend/codegen",
38-
"Complete LSP server",
39-
"Create VS Code extension prototype",
74+
"AffineScript re-target: migrate compiler/src/*.res to standard dialect (INTENT-001)",
75+
"First-class functions in VM: enable whole-fibre Echo (INTENT-002)",
76+
"LSP hover for Echo decomposition tracking (INTENT-005)",
4077
]
4178

4279
[maintenance-status]
43-
last-run-utc = "2026-02-07T00:00:00Z"
44-
last-result = "unknown" # unknown | pass | warn | fail
80+
last-run-utc = "2026-06-02T00:00:00Z"
81+
last-result = "pass" # unknown | pass | warn | fail
82+
notes = "All checks pass except the pre-existing governance ReScript ban."

0-AI-MANIFEST.a2ml

Lines changed: 86 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: MPL-2.0
22
# 0-AI-MANIFEST.a2ml — error-lang
33
# Universal AI Agent Gateway — Read This First
4-
# Generated: 2026-03-14
4+
# Last updated: 2026-06-02
55

66
## Identity
77

@@ -12,8 +12,8 @@ description: >
1212
A dissembling / decompositional educational programming language. Programs,
1313
syntax, semantics, and types can decay, decompose, and destabilise over time,
1414
and the language EXPOSES that decomposition (consequence amplification +
15-
stability scoring) rather than hiding it. Error-first with graduated error
16-
levels and a ReScript playground compiler.
15+
stability scoring) rather than hiding it. Echo types give structured loss a
16+
first-class shape. Error-first with graduated error levels.
1717
license: MPL-2.0
1818

1919
## Core Narrative (read before reasoning about features)
@@ -33,55 +33,105 @@ debit is never hidden. See docs/Echo-Decomposition.adoc and spec/type-system.md
3333
- Decomposition must be visible: never make echo_to_residue a silent cast,
3434
never let EchoR behave like Echo, never hide the erasure stability debit
3535
- SCM files ONLY in `.machine_readable/` (root copies are symlinks)
36-
- NEVER delete spec files: grammar, SPEC.core.scm
36+
- NEVER delete spec files: spec/grammar.ebnf, spec/SPEC.core.scm
3737
- NEVER use banned languages: TypeScript, Node.js, npm, Go, Python
3838
- All GitHub Actions must be SHA-pinned
39-
- All source files must have SPDX headers
39+
- All source files must have SPDX-License-Identifier: MPL-2.0 headers
4040
- Root symlinks MUST be maintained when moving files
41+
- NEVER use the AGPL license (use MPL-2.0)
42+
- DO NOT remove compiler/*.res files — they are a legacy reference frontend
43+
pending AffineScript re-target. The governance CI failure is pre-existing.
44+
45+
## Known Pre-existing CI Failure
46+
47+
governance / Language / package anti-pattern policy FAILS on every PR and on
48+
main because compiler/src/*.res files exist. This is intentional/legacy — the
49+
compiler is a reference frontend in a non-standard early ReScript dialect. The
50+
runnable implementation is in cli/. Resolution: AffineScript re-target
51+
(contractiles/lust/Intentfile INTENT-001). Do NOT work around it by removing
52+
.res files or patching governance.yml.
4153

4254
## Canonical File Locations
4355

44-
### Machine-Readable Metadata (.machine_readable/)
45-
- `.machine_readable/AGENTIC.scm`
46-
- `.machine_readable/ECOSYSTEM.scm`
47-
- `.machine_readable/META.scm`
48-
- `.machine_readable/NEUROSYM.scm`
49-
- `.machine_readable/PLAYBOOK.scm`
50-
- `.machine_readable/STATE.scm`
56+
### Human Orientation
57+
- `EXPLAINME.adoc` — Comprehensive human/agent orientation (read this too)
58+
- `README.adoc` — GitHub landing page overview
59+
60+
### Machine-Readable Metadata (.machine_readable/6a2/)
61+
- `.machine_readable/6a2/STATE.a2ml` — Current project state and session history
62+
- `.machine_readable/6a2/META.a2ml` — Architecture decisions (ADR-0001: Echo types)
63+
- `.machine_readable/6a2/AGENTIC.a2ml` — Agent permissions and constraints
64+
- `.machine_readable/6a2/ECOSYSTEM.a2ml` — Ecosystem position and related projects
65+
- `.machine_readable/6a2/NEUROSYM.a2ml` — Hypatia symbolic rules for Echo invariants
66+
- `.machine_readable/6a2/PLAYBOOK.a2ml` — Operational playbook
5167

68+
### Operational Framework (contractiles/)
69+
- `contractiles/must/Mustfile` — Required invariants and validation checks
70+
- `contractiles/dust/Dustfile` — Recovery and rollback handlers
71+
- `contractiles/trust/Trustfile.hs` — Trust model and verification steps
72+
- `contractiles/lust/Intentfile` — Roadmap and intent (INTENT-001 through 005)
5273

5374
### Specification (spec/)
54-
- `spec/grammar.ebnf` — Canonical EBNF grammar (@taxonomy: spec/grammar)
75+
- `spec/grammar.ebnf` — Canonical EBNF grammar (@taxonomy: spec/grammar)
76+
- `spec/type-system.md` — Type system spec including §7 Echo Types
77+
- `spec/README.adoc` — Specification index
5578

56-
- `spec/README.adoc` — Specification index
79+
### Key Documentation (docs/)
80+
- `docs/Echo-Decomposition.adoc` — Echo types authoritative narrative
81+
- `docs/Design-Philosophy.adoc` — Why the language is designed this way
82+
- `docs/Error-Lang.adoc` — Full language reference
83+
- `docs/Error-Categories.adoc` — Nine error categories + stability debits
84+
- `docs/Curriculum.adoc` — Lesson sequence (Lessons 1–11)
5785

5886
### Verification (verification/)
59-
- `verification/proofs/` — Formal proofs
60-
- `verification/tests/` — Test suite ../compiler/test
61-
(symlink)
62-
- `verification/conformance/` — Conformance tests ../conformance
63-
(symlink)
64-
- `verification/benchmarks/` — Performance benchmarks ../bench
65-
(symlink)
66-
- `verification/fuzzing/` — Fuzz targets ../compiler/fuzz
67-
(symlink)
68-
- `verification/README.adoc` — Verification index
87+
- `verification/proofs/` — Formal proofs
88+
- `verification/tests/` — Test suite (symlink → ../compiler/test)
89+
- `verification/conformance/` — Conformance tests (symlink → ../conformance)
90+
- `verification/benchmarks/` — Performance benchmarks (symlink → ../bench)
91+
- `verification/fuzzing/` — Fuzz targets (symlink → ../compiler/fuzz)
92+
93+
### Compiler (reference frontend — non-standard ReScript dialect)
94+
- `compiler/src/Types.res` — Token + type AST (TyEcho, TyEchoResidue)
95+
- `compiler/src/Lexer.res` — Tokenizer (Echo, EchoR keywords)
96+
- `compiler/src/Parser.res` — AST builder (type expression parser)
97+
- `compiler/src/TypeChecker.res` — Type inference + unification (Echo rules)
98+
- `compiler/src/Bytecode.res` — VEcho/VResidue values + Echo opcodes
99+
- `compiler/src/VM.res` — Stack VM (echoEraseCost = 15.0)
100+
- `compiler/src/Codegen.res` — AST → bytecode
101+
102+
### CLI (runnable implementation)
103+
- `cli/runtime.js` — Main runtime (Deno)
104+
- `cli/analyze.js` — Stability analysis
105+
- `cli/five-whys.js` — Root cause tracing
106+
- `cli/layer-navigator.js` — Five-layer view
107+
108+
### Examples
109+
- `examples/01-hello-world.err` — Baseline
110+
- `examples/11-echo-decomposition.err` — Echo types (full demo with gutter zone)
69111

70112
## Taxonomy Index
71113

72-
- `spec/grammar.ebnf` — @taxonomy: spec/grammar
73-
74-
- `spec/README.adoc` — @taxonomy: spec/index
75-
- `verification/README.adoc` — @taxonomy: verification/index
76-
- `playground/compiler/src/lexer/Lexer.res` — @taxonomy: compiler/lexer
77-
- `playground/compiler/src/parser/Parser.res` — @taxonomy: compiler/parser
78-
- `editors/error-lang.tmLanguage.json` — @taxonomy: editors/textmate-grammar
79-
- `docs/Echo-Decomposition.adoc` — @taxonomy: docs/echo-decomposition
80-
- `spec/type-system.md` — @taxonomy: spec/type-system
114+
- `spec/grammar.ebnf` — @taxonomy: spec/grammar
115+
- `spec/type-system.md` — @taxonomy: spec/type-system
116+
- `spec/README.adoc` — @taxonomy: spec/index
117+
- `docs/Echo-Decomposition.adoc` — @taxonomy: docs/echo-decomposition
118+
- `verification/README.adoc` — @taxonomy: verification/index
119+
- `compiler/src/Lexer.res` — @taxonomy: compiler/lexer
120+
- `compiler/src/Parser.res` — @taxonomy: compiler/parser
121+
- `compiler/src/TypeChecker.res` — @taxonomy: compiler/typechecker
122+
- `compiler/src/VM.res` — @taxonomy: compiler/vm
81123

82124
## Session Startup Sequence
83125

84126
1. Read this manifest (0-AI-MANIFEST.a2ml)
85-
2. Read `.machine_readable/STATE.scm` for current progress
86-
3. Read `.machine_readable/META.scm` for architecture decisions
87-
4. Read `.machine_readable/ECOSYSTEM.scm` for ecosystem context
127+
2. Read `EXPLAINME.adoc` for comprehensive orientation
128+
3. Read `.machine_readable/6a2/STATE.a2ml` for current project state
129+
4. Read `.machine_readable/6a2/META.a2ml` for architecture decisions
130+
5. Read `.machine_readable/6a2/AGENTIC.a2ml` for agent constraints
131+
6. Read `.machine_readable/6a2/ECOSYSTEM.a2ml` for ecosystem context
132+
133+
## Session Exit Sequence
134+
135+
1. Update `.machine_readable/6a2/STATE.a2ml` with session outcomes
136+
2. Ensure all new files have SPDX-License-Identifier: MPL-2.0 headers
137+
3. Ensure Echo decomposition invariants are intact (run contractiles/must/Mustfile checks)

0 commit comments

Comments
 (0)