Skip to content

Commit 3ead975

Browse files
committed
docs: substantive CRG C annotation (EXPLAINME.adoc)
1 parent bdfebca commit 3ead975

1 file changed

Lines changed: 41 additions & 13 deletions

File tree

EXPLAINME.adoc

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,60 @@
55

66
The README makes claims. This file backs them up.
77

8-
[quote, README]
9-
____
10-
ES modules for use with Deno.
11-
____
8+
== Claims Substantiation
9+
10+
=== Claim 1: "Complete parser and renderer for A2ML documents with attestation provenance and trust-level tracking"
11+
12+
**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?"
13+
14+
**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.
15+
16+
**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.
17+
18+
=== Claim 2: "Deno-native with zero dependencies, compiled from ReScript to ES6 JavaScript modules"
19+
20+
**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.
21+
22+
**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.
23+
24+
**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.
1225

1326
== Technology Choices
1427

1528
[cols="1,2"]
1629
|===
1730
| Technology | Learn More
1831

19-
| **Deno** | https://deno.land
20-
| **ReScript** | https://rescript-lang.org
32+
| **ReScript** | Compiles to ES6 JavaScript, type-safe
33+
| **Deno** | Modern runtime (no Node/npm), JSR package registry
34+
| **A2ML Spec** | Markup language with attestation and trust levels
2135
|===
2236

2337
== File Map
2438

25-
[cols="1,2"]
39+
[cols="1,3"]
2640
|===
27-
| Path | What's There
41+
| Path | Purpose
2842

29-
| `src/` | Source code
30-
| `lib/` | Library code
31-
| `test(s)/` | Test suite
43+
| `src/A2ML.res` | Main module: public API (parse, render, parseErrorToString)
44+
| `src/A2ML_Types.res` | Core types: Document, Block, Inline, Directive, Attestation, TrustLevel
45+
| `src/A2ML_Parser.res` | Line-oriented parser: text → AST with error recovery
46+
| `src/A2ML_Renderer.res` | AST → text renderer: walk tree, emit A2ML syntax
47+
| `src/tests/` | Test suite: parser tests, renderer tests, round-trip validation
48+
| `src/tests/ParserTest.res` | Unit tests: headings, paragraphs, inline, directives, attestations
49+
| `src/tests/RendererTest.res` | Renderer tests: AST → text round-trip fidelity
50+
| `deno.json` | Deno config: build task, JSR metadata, permissions
51+
| `lib/` | Generated JavaScript output (ES6 modules, no build needed for users)
52+
| `jsr.json` | JSR package metadata (version, exports, scope)
3253
|===
3354

34-
== Questions?
55+
== Dogfooted Across The Account
56+
57+
| Project | Integration |
58+
| **panic-attacker** | A2ML manifests in 0-AI-MANIFEST.a2ml can be parsed and analyzed for attestation chain
59+
| **reposystem** | Metadata about repos can be stored in A2ML format with provenance
60+
| **vql-ut** | Proof clauses in queries can be annotated with A2ML attestation blocks
61+
62+
== Readiness
3563

36-
Open an issue or reach out directly — happy to explain anything in more detail.
64+
**CRG Grade:** C (Beta) - Parser and renderer working, round-trip fidelity tested, Deno integration stable. Production-ready for parsing A2ML documents; cryptographic attestation verification delegated to consumers.

0 commit comments

Comments
 (0)