|
1 | 1 | # SPDX-License-Identifier: MPL-2.0 |
2 | 2 | # 0-AI-MANIFEST.a2ml — error-lang |
3 | 3 | # Universal AI Agent Gateway — Read This First |
4 | | -# Generated: 2026-03-14 |
| 4 | +# Last updated: 2026-06-02 |
5 | 5 |
|
6 | 6 | ## Identity |
7 | 7 |
|
8 | 8 | project: error-lang |
9 | 9 | type: programming-language |
10 | 10 | owner: hyperpolymath |
11 | 11 | description: > |
12 | | - Error-first programming language with graduated error levels and ReScript playground compiler. |
| 12 | + A dissembling / decompositional educational programming language. Programs, |
| 13 | + syntax, semantics, and types can decay, decompose, and destabilise over time, |
| 14 | + and the language EXPOSES that decomposition (consequence amplification + |
| 15 | + stability scoring) rather than hiding it. Echo types give structured loss a |
| 16 | + first-class shape. Error-first with graduated error levels. |
13 | 17 | license: MPL-2.0 |
14 | 18 |
|
| 19 | +## Core Narrative (read before reasoning about features) |
| 20 | + |
| 21 | +Error-Lang is not merely "a language with errors." It is decompositional: |
| 22 | +the distinctive claim is that decomposition is itself something the language |
| 23 | +exposes and reasons about. Echo types make STRUCTURED LOSS first-class: |
| 24 | + - Echo<A, B> retained witness + visible output (a fibre witness) |
| 25 | + - EchoR<A, B> residue after irreversible erasure (witness gone) |
| 26 | + - echo_to_residue explicit decomposition step; debits stability ([Stab-Erase]) |
| 27 | +Governing invariant: DECOMPOSITION MUST BE VISIBLE — echo_to_residue is never a |
| 28 | +silent cast, EchoR is never an Echo with a missing field, and the stability |
| 29 | +debit is never hidden. See docs/Echo-Decomposition.adoc and spec/type-system.md §7. |
| 30 | + |
15 | 31 | ## Critical Invariants |
16 | 32 |
|
| 33 | +- Decomposition must be visible: never make echo_to_residue a silent cast, |
| 34 | + never let EchoR behave like Echo, never hide the erasure stability debit |
17 | 35 | - SCM files ONLY in `.machine_readable/` (root copies are symlinks) |
18 | | -- NEVER delete spec files: grammar, SPEC.core.scm |
| 36 | +- NEVER delete spec files: spec/grammar.ebnf, spec/SPEC.core.scm |
19 | 37 | - NEVER use banned languages: TypeScript, Node.js, npm, Go, Python |
20 | 38 | - All GitHub Actions must be SHA-pinned |
21 | | -- All source files must have SPDX headers |
| 39 | +- All source files must have SPDX-License-Identifier: MPL-2.0 headers |
22 | 40 | - 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. |
23 | 53 |
|
24 | 54 | ## Canonical File Locations |
25 | 55 |
|
26 | | -### Machine-Readable Metadata (.machine_readable/) |
27 | | -- `.machine_readable/AGENTIC.scm` |
28 | | -- `.machine_readable/ECOSYSTEM.scm` |
29 | | -- `.machine_readable/META.scm` |
30 | | -- `.machine_readable/NEUROSYM.scm` |
31 | | -- `.machine_readable/PLAYBOOK.scm` |
32 | | -- `.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 |
33 | 67 |
|
| 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) |
34 | 73 |
|
35 | 74 | ### Specification (spec/) |
36 | | -- `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 |
37 | 78 |
|
38 | | -- `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) |
39 | 85 |
|
40 | 86 | ### Verification (verification/) |
41 | | -- `verification/proofs/` — Formal proofs |
42 | | -- `verification/tests/` — Test suite ../compiler/test |
43 | | -(symlink) |
44 | | -- `verification/conformance/` — Conformance tests ../conformance |
45 | | -(symlink) |
46 | | -- `verification/benchmarks/` — Performance benchmarks ../bench |
47 | | -(symlink) |
48 | | -- `verification/fuzzing/` — Fuzz targets ../compiler/fuzz |
49 | | -(symlink) |
50 | | -- `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) |
51 | 92 |
|
52 | | -## Taxonomy Index |
| 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 |
53 | 101 |
|
54 | | -- `spec/grammar.ebnf` — @taxonomy: spec/grammar |
| 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 |
55 | 107 |
|
56 | | -- `spec/README.adoc` — @taxonomy: spec/index |
57 | | -- `verification/README.adoc` — @taxonomy: verification/index |
58 | | -- `playground/compiler/src/lexer/Lexer.res` — @taxonomy: compiler/lexer |
59 | | -- `playground/compiler/src/parser/Parser.res` — @taxonomy: compiler/parser |
60 | | -- `editors/error-lang.tmLanguage.json` — @taxonomy: editors/textmate-grammar |
| 108 | +### Examples |
| 109 | +- `examples/01-hello-world.err` — Baseline |
| 110 | +- `examples/11-echo-decomposition.err` — Echo types (full demo with gutter zone) |
| 111 | + |
| 112 | +## Taxonomy Index |
| 113 | + |
| 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 |
61 | 123 |
|
62 | 124 | ## Session Startup Sequence |
63 | 125 |
|
64 | 126 | 1. Read this manifest (0-AI-MANIFEST.a2ml) |
65 | | -2. Read `.machine_readable/STATE.scm` for current progress |
66 | | -3. Read `.machine_readable/META.scm` for architecture decisions |
67 | | -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