diff --git a/docs/README.md b/docs/README.md index 0caf3911b..dc841b802 100644 --- a/docs/README.md +++ b/docs/README.md @@ -25,6 +25,12 @@ First-party docs follow the **27-agent trinity alphabet** grouping: **three nona | [`coordination/ROLLING-INTEGRATION-PLAN-SEED-TO-QUEEN.md`](coordination/ROLLING-INTEGRATION-PLAN-SEED-TO-QUEEN.md) | Phased plan: seed → tests → Queen brain (`tri`/`t27c`, conformance, codegen gap). | | [`coordination/inter-agent-handoff/`](coordination/inter-agent-handoff/) | Portable handoff bundle. | +## [`system/`](system/) — system documentation bodies (rendered at `t27.ai/#/docs`) + +| Path | Role | +|---|---| +| [`system/project.md`](system/project.md) .. [`system/evidence.md`](system/evidence.md) | English canonical prose of the seven chapters declared in [`specs/docs/`](../specs/docs/); sections are checked against `SECTIONS` at site build. | + ## [`nona-01-foundation/`](nona-01-foundation/) — agents **A–I** Architecture, seed rings, brain charter, language purge, sandbox. diff --git a/docs/now/2026-09-09-system-documentation-as-a-declared-t27-document.md b/docs/now/2026-09-09-system-documentation-as-a-declared-t27-document.md new file mode 100644 index 000000000..e3e016c16 --- /dev/null +++ b/docs/now/2026-09-09-system-documentation-as-a-declared-t27-document.md @@ -0,0 +1,13 @@ +# NOW -- System documentation as a declared .t27 document (2026-09-09) + +## System documentation as a declared .t27 document (Closes #3550) + +- `specs/docs/system.t27` (module `docs_system`, `KIND = "docs"`) declares the system documentation of t27.ai (`#/docs`) as one document: CHAPTERS (7 ids in reading order), SOURCES (the four catalogs, `specs/i18n`, `SOUL.md`, `AGENTS.md`, `CLAUDE.md`, `docs/agents/AGENTS_ALPHABET.md`, `docs/T27-CONSTITUTION.md`), DIAGRAMS (6 figures the site draws from data: `ladder`, `agent-ring`, `phase-cycle`, `law-hierarchy`, `skills-crons-agents`, `tools-map`), LOCALES (`en`, `ru`), ENABLED. One `specs/docs/chapters/.t27` per chapter (`docs_chapter_`, `KIND = "docs-chapter"`: DOCUMENT, ORDER, TITLE, SOURCES, SECTIONS, DIAGRAM, TABLE, BODY_EN, ENABLED). Schema in `specs/docs/README.md`. +- Chapters: 1 `project` (what t27 and Trinity are, claims with status tags, boundaries: no silicon, FPGA AX7203 only, 83 formats declared, hardware axes as measured in the trinity-fpga v0.2 transcription, no ranking words), 2 `rules` (constitutional stack, SOUL Articles I-VIII, laws L1-L7 with priority, AGENTS.md non-negotiables, TASK protocol, issue gate and TDD mandate -- quoted, not paraphrased into stronger rules), 3 `layers` (Specs -> Skills -> Crons -> Agents -> Tools; how specs generate the site, how crons name skills, how agents hold skills and tools, how experience is logged), 4 `alphabet` (three nonas; table generated from `spec-agents.json`), 5 `queen` (6-phase cycle + Phase 7 git from the alphabet document; cell, seal, verdict), 6 `tooling` (tri CLI + MCP from `spec-tools.json`), 7 `evidence` (measured / declared / external, witness labels, wasm verdicts, CI gates, how to reproduce, published record: `README-ZENODO.md`, `docs/reports/TNF-ARTICLE-AUDIT-W845.md`, `docs/reports/TNF-ARTICLE-RECONCILIATION.md` -- cited by path, no new scientific claim). +- English canonical prose lives in Markdown named by BODY_EN (`docs/system/.md`, 7 files, ASCII only), not inside the `.t27` (LANG-EN). Every SECTIONS entry is a level-2 heading in the body, in order; the site's generator checks this. `docs/README.md` gains the `system/` row (Article DOCS-TREE). +- Russian travels through a new translation contract `specs/i18n/docs-ru.t27` (module `i18n_docs_ru`: SCOPE `specs/docs`, `specs/docs/chapters`; FIELDS `TITLE`, `BODY`; bundle `trinity:apps/website/i18n/docs.ru.json` keyed by ID; FALLBACK `en`; COVERAGE_REQUIRED false; ORPHANS_ALLOWED false). Not a word of Cyrillic in this repository. +- Measured under the vendored compiler wasm (sha256 `4d9c0447b5ca2887...`): **9/9** typecheck ok (system, 7 chapters, i18n), nothing discarded. `typecheck.ok` is lenient; the site's generator (`scripts/docs-from-specs.mjs`, gHashTag/trinity) checks the field schema, that every SOURCES path exists in the vendored tree or the checkout, that every generated table is non-empty, and that no ranking word appears in EN or RU prose (`check:docs`). +- Three canon discrepancies are recorded in the prose, not resolved: `AGENTS.md` section 5 says "L1-L8" while its own table and `docs/T27-CONSTITUTION.md` define L1-L7 and no L8 exists; the alphabet document's PLAN / ASSIGN / RUN / TEST & BENCH / VERDICT / EVOLVE + GIT WORKFLOW cycle differs from `CLAUDE.md`'s AEL v2.0 loop (OBSERVE / PLAN / DELEGATE / VERIFY / SYNTHESIZE / LEARN); the `tri git` of Phase 7 has no variant in the clap enum of `cli/tri/src/main.rs` at this commit, so the tool catalog has no card for it. +- No absolute developer home path appears in any file; the t27 checkout is referred to as `T27_ROOT` or `git rev-parse --show-toplevel`. +- Not claimed: the bootstrap compiler on `master` was not run against these files; whether SOUL Article II applies to declarative catalog modules is not ruled here; `gate-topology` and `untrusted-input` still fail on `master` for already-merged PRs and are not addressed. +- `specs/OWNERS.md` gains the row `docs/` -> **Z-Zeta** (with **T-Queen** for `chapters/queen.t27`). diff --git a/docs/system/alphabet.md b/docs/system/alphabet.md new file mode 100644 index 000000000..f185a3ebc --- /dev/null +++ b/docs/system/alphabet.md @@ -0,0 +1,63 @@ +# The 27-agent alphabet + +## Twenty-seven letters, three nonas + +`docs/agents/AGENTS_ALPHABET.md` (v3.0, 2026-04-07) is the canon: "The Trinity system +employs 27 named agents -- corresponding to the 27 registers in `isa/registers.t27` +(Coptic / Trinity alphabet)." Each agent is bound to a letter and a register, has a domain +(physics, numeric, compiler, graph, experience, verdict, bench, DePIN, UI and so on), logs +to `.trinity/experience/` and is linked to nodes in `graph_v2.json`. + +The alphabet is read in three layers of nine, which the document also calls nonas: + +- **Archetypal, A-I (1-9)** -- "pure concept -- foundation: soul, base, types". A is the + architecture and `SOUL.md` as primary cause; C the compiler; E the experience; I the ISA. +- **Spiritual, J-R (10-18)** -- "inner process -- life of the system: tasks, language, + numbers, physics". L is the language; M the metrics; N the numeric formats; P the physics + constants; Q the queue. +- **Physical, S-27th (19-27)** -- "manifestation -- proof: standards, verdict, deploy, + gift". S is the specs; T the Queen, who "puts the final seal on everything"; V the + verdict; W the workflow and tri cell ("double hash-seal"); Z the zero-touch UX and docs; + the 27th letter, Ti, is security. + +The same three-by-nine layout organises the documentation tree of the repository +(`docs/nona-01-foundation/`, `docs/nona-02-organism/`, `docs/nona-03-manifest/`, Article +DOCS-TREE of the constitution) and the ring on the site next to this chapter, where each +letter sits at its ordinal and is coloured by its layer. + +## The table + +The table the site renders next to this chapter is generated from +`public/agents/spec-agents.json`, which is itself generated from the 27 files +`specs/agents/.t27` through the compiler wasm -- it is not typed here. Per letter it +shows the ordinal, the letter name, the domain, the archetype, the register, the layer, and +the skills and tools the agent holds with their evidence. The FULL TABLE of the alphabet +document (letter, domain, archetype, key files, entry invariant, exit invariant, CLARA role) +is the source each spec was transcribed from; the spec's header names the row. + +Two conventions of the table are worth stating. A letter's register comes from the schema +section of the alphabet document (for example T is R19, V is R21, W is R22); the ordinal is +the position in the alphabet, 1..27, so T is 20 and the 27th letter is 27. Where the +alphabet document names two agents with the same Greek letter name (C and G are both +written "Gamma"), the spec keeps the document's spelling and the ID stays unambiguous +because it is the Latin letter, `t27/C` and `t27/G`. + +## What a card carries + +Beyond the alphabet row, an agent card on the site carries what the other layers say about +the letter: + +- **Skills** -- IDs from `specs/skills` the agent holds, bound only where a source names the + skill. At the commit this documentation was generated from one letter holds skills: T, + from `.claude/agents/trinity.md`, which names `phi-loop` and `tri-pipeline` in its Phase 2 + and Phase 4. The other 26 carry an empty list and a note saying which sources were read. +- **Tools** -- IDs from `specs/tools` the agent holds, bound in both directions (the tool + spec names the letter back). Five commands are bound today: `tri gen` (C, T), `tri test` + (T, V), `tri verdict` (V), `tri experience` (E), `tri cell` (W); the sources are the phase + descriptions of the alphabet document and the `.claude/agents/*.md` files. +- **Crons** -- jobs whose `RUNS` names a skill the agent holds; empty while every `RUNS` is + empty. +- **Experience** -- episodes attributed to the letter in `.trinity/experience/`; none is + attributed today, and the card says so rather than showing a number it cannot source. +- **Sources** -- the three binding documents (`SOUL.md`, `AGENTS.md`, the alphabet) at the + pinned commit, and the spec file itself. diff --git a/docs/system/evidence.md b/docs/system/evidence.md new file mode 100644 index 000000000..b08bc0254 --- /dev/null +++ b/docs/system/evidence.md @@ -0,0 +1,92 @@ +# Evidence and witnesses + +## Measured, declared, external + +The project separates what was measured from what was declared, and both from what was taken +from outside. The tags are defined in the chapter "The project"; this chapter says how each tag is +earned on the site. + +A **measured** number has a producer in a repository -- a script, a workflow, a test -- whose +output is committed or published, and the page names the commit. The ladder counts, the +`typecheck.ok` verdicts, the coverage of a translation bundle, the number of episodes in an +experience tree are measured in this sense: the generator that produces them runs in +`prebuild` and its inputs are pinned. + +A **declared** value is stated in a spec or a canon document. The catalog size of 83 +formats, the seven laws, the seven phases are declared: the site renders them from the file +that states them and links the file at the commit, but running nothing. + +An **external** value is cited with its source and not reproduced. The site does not restate +hardware figures of `gHashTag/trinity-fpga` beyond what `siliconHistory.ts` transcribes with +its provenance note. + +## Witness labels + +Each catalog card carries a witness label that says how the card relates to the thing it +describes: + +- Skills and crons: `spec+code` (spec and source both exist), `spec-only` (spec without + source), `code-only` (source without spec). The counts per label are in the header of the + Skill and Cron Explorers. +- Tools: `source-parse` (the command list was read from the source at a recorded commit; + `cargo` was not run) or `help-output` (the list was diffed against `tri --help`). At the + commit this documentation was generated from every tri card is `source-parse`. +- Agents: each skill and tool binding cites a source line in `SKILLS_NOTE` / `TOOLS_NOTE`, or + the list is empty and the note says what was read. +- Experience: attributed only where an episode names a letter; otherwise counted as + unattributed, never guessed. + +The table the site renders next to this chapter collects these labels with their counts from +the generated JSON of every layer. + +## Wasm verdicts + +Every `.t27` the site shows was compiled at build time by the vendored `t27_compiler.wasm`, +and the JSON records `typecheck.ok` per file. Two limits of that verdict are stated on every +layer README and repeated here. First, the wasm's `typecheck.ok` is necessary, not +sufficient: it stays `true` for a wrong annotation such as `str = 5`, so the generator checks +the field schema of every card on top of it. Second, the bootstrap compiler on `master` was +not run against the catalog files in the commits that added them; the wasm is a build of the +compiler at a recorded sha, and that sha is in the generated JSON. + +## CI gates + +`gHashTag/t27` gates a pull request with workflows named for what they check (issue gate, +gate topology, conformance integrity, emit bit-exact, catalog count, now-sync, untrusted +input, among others under `.github/workflows/`). Two of them, `gate-topology` and +`untrusted-input`, fail on `master` for already-merged pull requests at the time of writing; +the catalog pull requests record this and do not bless or bypass them. + +`gHashTag/trinity` gates the site with `npm run` checks that run in `prebuild` and in CI: +`check:spec-catalog`, `check:skills-catalog`, `check:crons-catalog`, `check:agents`, +`check:tools`, `check:docs`, the explorer and Queen language contracts, the Queen viewport +contract, `typecheck:ratchet` and `eslint`. A check that fails on `main` before a change is +reported as pre-existing, with its name, and is not counted as passing. + +## Reproducing a number + +To reproduce a count on the site, run the generator that produced it, in `apps/website` of +a checkout of `gHashTag/trinity`, with a sibling checkout of `gHashTag/t27` (or `T27_ROOT` +pointing to one): + +- `node scripts/agents-from-specs.mjs` -- skills, crons, agents, tools JSON and their counts; + `--check` compares against the committed JSON. +- `node scripts/docs-from-specs.mjs` -- this documentation's JSON, including the sources with + their sha256 and the pinned commit. +- `node scripts/sync-agents-experience.mjs` -- the experience snapshot. +- `npm run check:docs` -- the chapter bodies, the sources, the generated tables, the + forbidden-words scan in English and Russian. + +Each JSON names the commit its inputs were read at. Comparing that commit with the one in +front of you is step one of any reproduction; a number that cannot be tied to a +commit is not a measurement. + +## Published record + +Two kinds of record exist outside the generated pages, and this documentation points to +them without adding to their claims. The TNF manuscript audit and reconciliation reports +live under `docs/reports/` in `gHashTag/t27` (`TNF-ARTICLE-AUDIT-W845.md`, +`TNF-ARTICLE-RECONCILIATION.md`); they record which statements of the article were checked +against which producer and what changed. The Zenodo README (`README-ZENODO.md`) describes +the archived package. No scientific claim is made in this documentation that is not in those +files or in the site's own content with its status tag. diff --git a/docs/system/layers.md b/docs/system/layers.md new file mode 100644 index 000000000..3cbc260a6 --- /dev/null +++ b/docs/system/layers.md @@ -0,0 +1,83 @@ +# The five-layer system + +The site orders what the repositories ship into five layers and shows the same ladder in +the header of every Explorer: **Specs -> Skills -> Crons -> Agents -> Tools**. Each layer +is a directory of `.t27` files in `gHashTag/t27`, each has a README that states its schema, +and each is rendered from those files by one generator through the compiler wasm. The +ladder counts on the site are read from the generated JSON at build time; the table next +to this chapter shows them for the commit the documentation was generated from. + +## Specs + +The base layer is the `.t27` corpus itself: everything under `specs/` in `gHashTag/t27`, +from the language core and the numeric formats to the catalogs below. The site vendors a +byte-identical copy under `apps/website/public/t27/files/` and compiles every file with the +vendored `t27_compiler.wasm` at build time. The Spec Explorer (`#/specs`) shows each file +with its verdict; the manifest that lists them (`public/t27/manifest.json`) is generated +and never hand-edited. + +## Skills + +A skill is a published procedure an agent can run -- a `SKILL.md` in one of the +repositories. `specs/skills/.t27` declares each one (KIND, ID, NAME, REPO, SOURCE, +SUMMARY_EN, COMMAND, SPECS, TAGS, ENABLED, TIMEOUT_MIN). The witness label on a skill card +says how the card relates to the code: `spec+code` when both the spec and the `SKILL.md` +exist, `spec-only` when only the spec does, `code-only` when a skill file has no spec yet. +Skill Explorer: `#/skills`. + +## Crons + +A cron is a scheduled job: a workflow schedule, a Railway timer, a daemon loop. +`specs/crons/.t27` declares each (HOST, REPO, SERVICE, INTERVAL_MS, TZ, RUNS, +RUNS_NOTE, ENABLED, NOTE, ON_FAILURE, CONTROL). `RUNS` lists the skill IDs a job invokes, +and only where the source shows the invocation; where none is found `RUNS` is empty and +`RUNS_NOTE` says so ("no skill invocation found in source"). The Cron Explorer (`#/crons`) +computes the next firing from `INTERVAL_MS` and `TZ`. A job that runs no skill is a job the +site cannot tie to the layers above; that is recorded, not hidden. + +## Agents + +The 27 letters of the alphabet, one spec each: `specs/agents/.t27` with LETTER, +ORDINAL, LETTER_NAME, NAME, DOMAIN, ARCHETYPE, REGISTER, LAYER, SUMMARY_EN, the three +binding documents (SOUL, AGENTS_DOC, ALPHABET), KEY_FILES, the entry and exit invariants, +CLARA_ROLE, SKILLS with SKILLS_NOTE and TOOLS with TOOLS_NOTE. An agent holds a skill or a +tool only where a source line binds it -- a `.claude/agents/*.md` file, the alphabet, a +phase description -- and the note cites that line or says why the list is empty. The +generator fails the build on an unknown skill or tool ID and on a binding stated on one +side only. Agent Explorer: `#/agents`. The full table is the next chapter. + +## Tools + +What an agent can call: the commands of the `tri` CLI and the tools of the MCP servers. +`specs/tools/tri/.t27` is read from the clap `Commands` enum in +`cli/tri/src/main.rs` (one card per variant, with its nested actions and arguments); +`specs/tools/mcp/.t27` from the server sources, manifests and `.mcp.json` entries of +both repositories, with the tool names, descriptions and input-schema keys. The witness on +every tri card is `source-parse` (the enum was read at a recorded commit) until someone +diffs the list against `tri --help` and relabels it `help-output`. Servers whose code is a published +package outside the repositories carry `EXTERNAL = true`. Tool Explorer: `#/tools`. + +## From spec to site + +One generator, `scripts/agents-from-specs.mjs` in `gHashTag/trinity`, reads the vendored +`.t27` files, compiles each through the wasm, reads the constants of the compiled module, +checks them against the schema of the layer, resolves every cross-reference (skill IDs in +crons and agents, tool IDs in agents, agent letters in tools, spec paths in skills), and +writes one JSON per layer under `public/`. It runs in `prebuild`, so a spec that does not +compile or a reference that does not resolve stops the site from building. No `.t27` is +parsed with a regular expression anywhere in that path. + +Translations follow the same rule. `specs/i18n/-.t27` declares which fields +of which specs a bundle may translate and where the bundle lives; the bundle +(`apps/website/i18n/*.json`) carries the text; the generator checks that every bundle entry +names an existing spec and reports coverage. The specs stay English-only. + +## Experience + +Agents log what happened under `.trinity/experience/` in each repository: episodes as JSON, +notes as Markdown. `scripts/sync-agents-experience.mjs` reads both trees at their current +commit and writes `public/agents/experience.json` with counts per repository and, where an +episode names an agent letter, the attribution. At the commit this documentation was +generated from no episode is attributed to any letter -- the field the sync looks for is +absent from every episode -- and the agent cards say so. The snapshot records the commit of +each tree, not the path of the checkout. diff --git a/docs/system/project.md b/docs/system/project.md new file mode 100644 index 000000000..ad5b37f0a --- /dev/null +++ b/docs/system/project.md @@ -0,0 +1,91 @@ +# The project + +## What t27 and Trinity are + +**t27** is a specification language and a toolchain. A `.t27` file declares behaviour, +constants, tests and invariants in one place; the compiler (`t27c`, driven by the `tri` +command) validates the file, generates code for the target backends (Zig, C, Verilog) and +runs the tests written inside the spec. The repository `gHashTag/t27` holds the language, +the compiler, the spec corpus and the canon documents that govern how agents and people +work in it (`SOUL.md`, `AGENTS.md`, `docs/T27-CONSTITUTION.md`). + +**Trinity** is the programme around t27: the GoldenFloat family of numeric formats built on +the identity phi^2 + 1/phi^2 = 3, hardware validation of those formats on one FPGA board, +and the public site `t27.ai` (repository `gHashTag/trinity`, `apps/website`) that renders +the spec corpus, the skills, the scheduled jobs, the agents and the tools through the real +compiler compiled to WebAssembly. The site does not paraphrase the specs; it compiles them +in the browser build and shows the verdicts. + +The rule that ties the two together is spec-first: project logic originates in `.t27`, and +host languages -- Rust for the bootstrap compiler, TypeScript for the site, Zig, C and +Verilog as generated output -- are subordinate implementations. `docs/T27-CONSTITUTION.md`, +Article SSOT-MATH, states it for mathematics and numerics; `AGENTS.md` section 3 restates +it for every change ("Specs are source of truth"). + +## Claims and their status + +Every claim in this documentation carries one of five status tags, and the table the site +renders next to this chapter repeats them with their source file: + +- `[measured]` -- a number produced by running something whose output is in a repository + or a public CI log, with the command and the commit recorded. +- `[declared]` -- stated in a spec or a canon document; not (yet) exercised by a run. +- `[specified]` -- exists as a `.t27` spec that typechecks; no implementation is claimed. +- `[external]` -- a value taken from a source outside the two repositories; cited, not + reproduced here. +- `[not claimed]` -- explicitly outside what the project asserts today. + +The statements this chapter is prepared to make, with their tags: + +- The GoldenFloat catalog holds 83 formats `[declared]` -- `FAMILY_TOTALS.catalog` in + `trinity:apps/website/src/data/siliconHistory.ts`, transcribed from the hardware + conformance report of `gHashTag/trinity-fpga` (v0.2), which is the published source of + every hardware figure on the site. +- Hardware numbers exist for a subset of the catalog `[measured]`: at v0.2 the same file + records 27 formats at Tier E (public chain: CI run id, bitstream SHA-256, JTAG flash, + UART log), 13 with decode in hardware, 7 with ADD and 7 with MUL in hardware, and 62 with + a bit-exact software reference. The union of the hardware axes is a smaller number than + 83; the exact union is stated in the trinity-fpga report and is not restated here. +- Every hardware number was measured on one board `[measured]`: ALINX AX7203, Xilinx + Artix-7 `xc7a200tfbg484-2`, open toolchain (yosys, nextpnr-xilinx, Project X-Ray), + `DEVICE` and `TOOLCHAIN` in the same file. +- Skills, crons, agents and tools on the site are generated from `.t27` specs through the + vendored compiler wasm `[measured]`: the counts are in the ladder header of every + Explorer and in the "Evidence and witnesses" chapter; `typecheck.ok` for each spec is + recorded in the JSON the site serves. + +## Boundaries + +What the project does **not** claim, in its own words: + +- **No silicon.** `[not claimed]` A SKY130 design was prepared through Tiny Tapeout; the + TTSKY26a/TTSKY26b submissions were withdrawn before fabrication and refunded, so no die + exists and no measurement on silicon is claimed (`trinity:apps/website/src/content/tnf.ts`, + the "Is this an ASIC result?" answer). ASIC mapping and multi-corner characterisation are + not claimed either. The hardware boundary is the FPGA named above. +- **No ranking words.** The canon forbids "first", "only", "best" and their translations in + first-party prose; the site's QA (`check:docs`, `check:queen-honesty`) fails a build that + contains them. Comparisons are stated as numbers with a source or not at all. +- **The Verilog the t27 compiler emits from a format spec is a module shell** -- across the + corpus it yields 0 LUTs and 0 flip-flops (`siliconHistory.ts`, provenance note). The + silicon results belong to hand-written RTL verified against an independent oracle. The + spec and the RTL describe the same format; they are not the same artifact. +- **`typecheck.ok` from the wasm is necessary, not sufficient.** It stays `true` for a wrong + annotation such as `str = 5`; the site's generators check the field schema of every card + on top of it (`specs/skills/README.md`). +- **Two repositories, two lists.** Tools, agents and jobs of `gHashTag/t27` and of + `gHashTag/trinity` are recorded under their own `REPO`; nothing is merged into one list. + +## How to read this documentation + +The seven chapters are declared in `specs/docs/system.t27` and one spec per chapter under +`specs/docs/chapters/`. Each chapter spec names its `SOURCES` (the files it quotes), its +`SECTIONS` (the headings of this Markdown, checked at build time), the figure the site draws +from data (`DIAGRAM`) and the table it generates from the catalogs (`TABLE`). The English +prose is canonical and lives in `docs/system/.md` in `gHashTag/t27`; the Russian text +travels through the translation contract `specs/i18n/docs-ru.t27` and the bundle it names +in `gHashTag/trinity`. When the two disagree, English wins. + +Every figure on the site carries a caption and a data-source line: the JSON it was drawn +from and the commit that JSON was generated at. Every table is generated; none is typed by +hand. A number without a source line is a defect -- report it as one. diff --git a/docs/system/queen.md b/docs/system/queen.md new file mode 100644 index 000000000..39963687b --- /dev/null +++ b/docs/system/queen.md @@ -0,0 +1,73 @@ +# Queen orchestration + +## The six-phase cycle and Phase 7 + +Agent T, the Queen, is the central orchestrator: "reads `graph_v2.json` and knows all module +dependencies", "conducts 26 sub-agents (A..Z, except T) by their domains", gathers results, +validates architecture invariants and enforces that the source of truth is in `.t27` / `.tri` +with Zig, Verilog and C only as backends (`docs/agents/AGENTS_ALPHABET.md`, section +"AGENT T -- QUEEN TRINITY", Responsibilities). Her module is `specs/queen/lotus.t27`. + +The alphabet document draws the cycle she runs as six phases and a seventh added by the SOUL +law on git. The site renders the cycle from that document; in short: + +1. **PLAN** -- analyse the task and select a strategy; read `graph_v2.json` for impact; + decide which agents participate; check `.trinity/experience/` for similar tasks. +2. **ASSIGN** -- distribute tasks to agents by domain (A architecture, N numeric, P physics, + F conformance, ...); set dependencies; create a tri cell for each agent (W seals). +3. **RUN** -- parallel execution; heartbeats; agents report to `.trinity/agent_events.jsonl`; + T redistributes if necessary. +4. **TEST & BENCH** -- F checks conformance vectors, V runs benchmarks, G measures impact + changes; metrics are collected in M for V's verdict. +5. **VERDICT** -- V analyses the metrics; `tri verdict --toxic` asks whether the change is + toxic; E records the experience; if toxic, Q blocks the task. +6. **EVOLVE** -- update `graph_v2.json` if dependencies changed; update experience in E and + M; S updates standards; W seals the tri-cell commit; Z updates documentation; T puts the + final TAW seal. +7. **GIT WORKFLOW** ("new -- SOUL law") -- commit with `--all` and the message + `cell:{id} issue:{N} ...`, then push `HEAD` to origin in strict mode; checks: sealed cell, + non-toxic verdict, artifacts; the registry records the commit hash and the pushed flag. + The alphabet writes both steps as a `git` subcommand of tri; the current clap surface + does not expose one (witness: `cli/tri/src/main.rs` has no such variant), so they are + quoted here as steps, not as commands to copy. + +The document's SOUL law for TDD follows the seventh phase: any P0/P1 episode in `--strict` +mode is considered COMPLETE only after a successful push to `github.com/gHashTag/t27` with +bound sealed-cell and non-toxic verdict (the law names the push as a tri subcommand; see the +note on the seventh phase above). Where an agent letter appears in a phase +description, the tools chapter and the agent cards use that line as the source of a binding +(`tri cell` to W, `tri verdict` to V). + +## Cell, seal, verdict + +Three steps carry the cycle's state; two of them are tri commands with a spec under +`specs/tools/tri/` read from the clap enum of `cli/tri/src/main.rs`: + +- **`tri cell`** -- the unit of work of one agent: created in ASSIGN, sealed by W with a hash + in EVOLVE. Nested actions are listed on the tool card (`specs/tools/tri/cell.t27`). +- **`tri verdict`** -- V's decision over the metrics; `--toxic` is the question the cycle asks + in VERDICT (`specs/tools/tri/verdict.t27`). +- **the git step** -- the seventh phase as the alphabet document writes it, as a `git` + subcommand of tri. At the commit this documentation was generated from the clap enum of + `cli/tri/src/main.rs` has no such variant, so the tool catalog has no card for it; the + phase is documented from the alphabet and marked `[declared]`, and the gap is recorded here + rather than filled with a card. + +The seal itself is a hash. At the compiler level the same idea is the seal of the bootstrap +compiler (`bootstrap/stage0/FROZEN_HASH`, `CANON.md` section 0) and the ring canon: a ring +freezes when its hash is recorded, and drift between the recorded seal and the working tree +is a fact the dashboard shows. + +## Two statements of the loop + +The repository states the Queen's loop twice, and the two statements differ. The alphabet +document gives the seven phases above (PLAN, ASSIGN, RUN, TEST & BENCH, VERDICT, EVOLVE, GIT +WORKFLOW). `CLAUDE.md`, "Autonomous Execution Loop (AEL v2.0)", gives a six-phase loop for +an agent operating as the Queen -- OBSERVE (E), PLAN (T), DELEGATE (C/V), VERIFY (V), +SYNTHESIZE (L), LEARN (L) -- and, separately, the nine-phase PHI LOOP for ring-based +development (Issue, Spec, TDD, Code, Gen, Seal, Verify, Land, Learn). + +This documentation renders the alphabet's cycle, because it is the one that names the tri +commands and the agent letters per phase, and records the AEL loop as the second statement +without reconciling them. Which one binds an autonomous agent in a given situation is a +question for `AGENTS.md` and its owners, not for a generated page. diff --git a/docs/system/rules.md b/docs/system/rules.md new file mode 100644 index 000000000..39ee7e4ea --- /dev/null +++ b/docs/system/rules.md @@ -0,0 +1,129 @@ +# Constitution and the rules of the game for agents + +## The constitutional stack + +`AGENTS.md` is the entry point for humans and coding agents; its first section fixes the +reading order and which document wins when two disagree: + +1. `SOUL.md` -- the canonical constitution: language policy, TDD mandate, validation. +2. `docs/nona-03-manifest/SOUL.md` -- the expanded reference; if it conflicts with root + `SOUL.md`, root wins. +3. `docs/T27-CONSTITUTION.md` -- Articles SSOT-MATH, LANG-EN and DOCS-TREE, and the + invariant laws. +4. `TASK.md` with `docs/coordination/TASK_PROTOCOL.md` -- multi-agent coordination, locks, + anchor issue. +5. The nearest `OWNERS.md` -- domain ownership for the directories you edit. + +`CLAUDE.md` adds the operational loop for an autonomous agent and says, in its first line, +that repo-specific law always overrides generic tooling defaults. The rest of this chapter +quotes these files; the site links each quotation to the file at the commit the +documentation was generated from. + +## SOUL articles + +`SOUL.md` is organised in articles. The ones every change touches: + +- **Article I, The Language Policy.** Source files must be ASCII-only (U+0000..U+007F); + identifiers and comments must be English. The rule names `.t27`, `.tri`, `.zig`, `.c`, + `.h`, `.v` and build scripts. Cyrillic and other non-Latin scripts are forbidden in + identifiers and comments unless an Architect-approved exception exists (section 1.1). + First-party documentation is English (section 1.2, restated as Article LANG-EN of the + constitution). +- **Article II, The TDD Mandate.** "Every `.t27` specification MUST contain at least one of" + a `.test` section, an `.invariant` section or a `.bench` section. "No exceptions. A spec + without tests is not a specification -- it is a draft." (section 2.1, the Iron Law). +- **Article III, No Prototype Mode.** There is no `--allow-no-tests` flag and no grace + period; the parser rejects a spec without tests with `TDD contract violated`. +- **Article IV, Validation Requirements.** Enforcement at parser level, at codegen level and + at build time. +- **Article V, Amendment Process.** What can and cannot be amended. +- **Article VI, Enforcement.** Agent compliance, human compliance, automated enforcement. +- **Article VII, Sacred Trinity.** Three pillars: the identity phi^2 + 1/phi^2 = 3, ternary + computation, and TDD inside the spec. "Violating any violates the whole." +- **Article VIII, NO-NEW-SHELL.** No new `*.sh` on the engineering critical path; the + permitted exceptions are the exec-only shim `scripts/tri` and the one-time + `scripts/setup-git-hooks.sh`. Section 8.3 extends the rule to Python: validation, + conformance gates and doc language checks live in `t27c` (Rust). + +The catalog specs under `specs/skills`, `specs/crons`, `specs/agents`, `specs/tools` and +`specs/docs` are declarative constant modules and carry no `.test` block; the site's +generators check their field schema instead. Whether Article II applies to declarative +catalog modules is not decided in `SOUL.md` today; this documentation records the practice +and does not claim a ruling. + +## Invariant laws and their priority + +`docs/T27-CONSTITUTION.md`, section 2, defines seven Invariant Laws that "never change +without constitutional amendment". The site renders the table from that file; in short: + +- **L1 TRACEABILITY** -- no code merged without `Closes #N`; every PR references an issue. + Enforced by `.github/workflows/issue-gate.yml`. +- **L2 GENERATION** -- files under `gen/` are generated; edit the `.t27` spec instead. +- **L3 PURITY** -- ASCII-only identifiers and comments in `.t27`, `.zig`, `.v`, `.c`. +- **L4 TESTABILITY** -- every `.t27` spec must contain `test`, `invariant` or `bench`. +- **L5 IDENTITY** -- phi^2 = phi + 1 on the reals, hence phi^2 + 1/phi^2 = 3; IEEE + binary64 checks use a tolerance. +- **L6 CEILING** -- `conformance/FORMAT-SPEC-001.json` and `specs/numeric/gf16.t27` are the + numeric ceiling, never forked. +- **L7 UNITY** -- no new `*.sh` on the critical path for validation, generation or data; + `t27c` and `tri` only. + +Priority is Asimov-style: L1 > L2 > L3 > L4 > L5 > L6 > L7. "In conflict scenarios, the +higher-priority law prevails." The legacy names (ISSUE-GATE, NO-HAND-EDIT-GEN, SOUL-ASCII, +TDD-MANDATE, PHI-IDENTITY, TRINITY-SACRED, NO-NEW-SHELL) map one-to-one onto L1..L7 in the +constitution's alias index. + +One discrepancy is recorded rather than resolved: `AGENTS.md` section 5 speaks of "the seven +Invariant Laws (L1-L8)" and writes the priority as "L1 > ... > L8", while its table and the +constitution define L1..L7 only. No L8 is defined in either file at the commit this +documentation was generated from. The figure next to this chapter therefore shows seven +laws. + +## Non-negotiables for changes + +`AGENTS.md` section 3 lists six non-negotiables, quoted in short: + +1. Specs are source of truth -- behaviour belongs in `.t27` / `.tri`; generated `gen/` + output is not hand-edited except for documented exceptions. +2. TDD inside specs -- new or changed specs need `test`, `invariant` and/or `bench` where + SOUL requires it. +3. English + ASCII -- first-party Markdown and source comments per LANG-EN and ADR-004. +4. No new Python on the verification critical path. +5. Issue gate -- PRs link issues (`Closes #N`) where project policy requires it. +6. Ring / gold work -- parser, compiler and spec changes follow the golden-rings canon; the + compiler seal path is `bootstrap/stage0/FROZEN_HASH`. + +Two rules of this documentation's own owner belong beside them, because the site enforces +them: no absolute developer home path in any committed file (a checkout is `T27_ROOT` or +`git rev-parse --show-toplevel`), and no hand edits to generated manifests -- change the +spec and regenerate. + +## TASK protocol + +`docs/coordination/TASK_PROTOCOL.md` governs how several agents work in one tree at the same +time. Its artifacts are the root `TASK.md` (anchor link, protocol version, locks, handoff +log, work units) and the protocol document itself. The semantics, in short: + +- **Lock (soft).** Before editing sensitive paths the active agent should set lock holder, + lock scope and lock until in the coordination state; others must not override without a + handoff-log entry and an epoch bump. Locks are "social + procedural", not file locks. +- **Epoch.** A version counter for the coordination state. +- **Handoff log.** Append-preferred; handoffs are treated "like narrow API contracts". +- **Read / write order.** `github-sync.json` (queue snapshot), then `TASK.md` (locks and + handoffs), then the anchor issue, then the target issue for the code change (section 4.4). + +Validation of `TASK.md`'s shape is automated (section 5); verification is human plus CI +(section 6). + +## Issue gate and TDD mandate + +The issue gate is law L1 in executable form: the constitution names +`.github/workflows/issue-gate.yml` as the enforcement of "no code merged without `Closes #N`". Everything the site documents +came in through it -- the skills, crons, agents, tools and docs catalogs each have their +issue and their `docs/now/` entry. + +The TDD mandate is law L4 and SOUL Article II in executable form: the parser rejects a spec +without a `test`, `invariant` or `bench` block. For the catalog specs the site adds its own +gate on top: a generator that compiles every card through the wasm and fails on a schema +violation, an unknown cross-reference, or a binding stated on one side only (an agent that +names a tool the tool does not name back, and the reverse). diff --git a/docs/system/tooling.md b/docs/system/tooling.md new file mode 100644 index 000000000..937673210 --- /dev/null +++ b/docs/system/tooling.md @@ -0,0 +1,58 @@ +# Tooling + +## The tri CLI + +`tri` is the command of the toolchain: `./scripts/tri` is an exec-only shim (SOUL Article +VIII, section 8.2) that resolves the Rust binary `t27c`, passes `--repo-root` and executes +it. The catalog in `specs/tools/tri/` holds one spec per variant of the clap `Commands` enum +in `cli/tri/src/main.rs`: the command word, the enum variant, the source file and the entry +point, the doc comment as `ABOUT` with `ABOUT_SOURCE` naming where the text came from, the +nested actions with their own doc comments, the arguments, the agent letters that own the +command with the evidence line, when to use it, and the witness. + +The table the site renders next to this chapter is generated from +`public/tools/spec-tools.json` -- command, actions, owners, witness -- and the counts in its +header are read from the same file. The witness on every tri card at the commit this +documentation was generated from is `source-parse`: the enum and its `///` comments were +read from the source at a recorded commit, and `cargo` was not run. A card is relabelled +`help-output` only when someone diffs the list against `tri --help` and records the result; +until then the label says what was and was not done. + +Commands whose variant has no doc comment quote the source they borrow their description +from (for example `tri cell` quotes the `tri-mcp` tool descriptions), so that no `ABOUT` is +invented. + +## MCP servers + +The second family is the Model Context Protocol servers the two repositories ship or +register: for `gHashTag/t27` the `tri-mcp` crate, the `tri-ssot` manifest, `t27-traceability` +and the entries of `.mcp.json`; for `gHashTag/trinity` the `trinity` and `needle` Zig servers +and its `.mcp.json` entries. `specs/tools/mcp/.t27` carries the launch line, +transport, version, environment variables, config path, repository, source, the tool names +with descriptions and input-schema keys, resources, and the witness. + +Servers whose code is a published package outside the repositories carry `EXTERNAL = true` +and a `TOOLS_NOTE` saying the tool list is not in either tree; nothing is invented for them. +Two facts are recorded rather than fixed: `tri-mcp` is not registered in `.mcp.json` at the +pinned commit (`CONFIG` is empty), and the `tri-ssot` manifest names a module the tree does +not contain. + +Two repositories are two lists. `gHashTag/trinity` has no `tri` binary at the pinned commit +(`build.zig` defines none; its `.claude/skills/tri/SKILL.md` is a skill and is in the skills +catalog), so its tools are its MCP servers only, under `REPO = "gHashTag/trinity"`. + +## Who owns a tool + +A tool names the agent letters that own it (`AGENTS`) only where a source line does, and +`AGENTS_NOTE` cites that line or names the sources that were checked and found silent. The +agent spec names the tool back (`TOOLS`), and the site's generator fails the build on a +binding stated on one side only. Today five commands are bound -- `tri gen` (C, T), +`tri test` (T, V), `tri verdict` (V), `tri experience` (E), `tri cell` (W) -- from the phase +descriptions of `docs/agents/AGENTS_ALPHABET.md` and the `.claude/agents/*.md` files; the +other commands and every MCP server carry an empty `AGENTS` with a note. Skills are +cross-linked when a skill spec's own `COMMAND` or `SUMMARY_EN` names a tri command. + +The map the site draws next to this chapter groups the tri commands by owning letter (with a +group for the unowned) and the MCP servers by repository, with the external ones marked. It +is drawn from the generated JSON, so a new binding in a spec moves a command on the map +without anyone editing the figure. diff --git a/specs/OWNERS.md b/specs/OWNERS.md index 24e124894..cbc356cf5 100644 --- a/specs/OWNERS.md +++ b/specs/OWNERS.md @@ -23,6 +23,7 @@ | `agents/` | **T-Queen** | The 27 agents of `docs/agents/AGENTS_ALPHABET.md` as `.t27` specs (`agents/.t27`, `KIND = "agent"`): letter, domain, archetype, register, invariants, the documents that bind it (`SOUL.md`, `AGENTS.md`, the alphabet) and the skills a source evidently binds; the site joins experience by LETTER | | `functions/` | **T-Queen** | The 28 Inngest functions of `999-multibots-telegraf` as `.t27` specs (`functions/.t27`, `KIND = "function"`): canonical and legacy ids and events, trigger, steps, retries, failure handling, side effects, guard and the 2026-09-09 safe-probe result; the site joins them to a vendored copy of the functions manifest | | `tools/` | **T-Queen** | The `tri` CLI commands and the MCP servers as `.t27` specs (`tools/tri/.t27`, `tools/mcp/.t27`, `KIND = "tool"`): what a command or server is for, its actions or tools, its source and witness (`source-parse` / `help-output`), and the agent letters a source evidently binds; the three older files at the top of `tools/` are ordinary corpus specs | +| `docs/` | **Z-Zeta** (with **T-Queen** for `chapters/queen.t27`) | The system documentation of `t27.ai/#/docs` as `.t27` specs (`docs/system.t27`, `KIND = "docs"`; `docs/chapters/.t27`, `KIND = "docs-chapter"`): chapter ids, sections, sources, the figure and table the site generates; English prose in `docs/system/.md`, Russian via `i18n/docs-ru.t27` | Each subtree with substantial churn should keep a local **`OWNERS.md`** (see below). diff --git a/specs/docs/README.md b/specs/docs/README.md new file mode 100644 index 000000000..bab4d50a5 --- /dev/null +++ b/specs/docs/README.md @@ -0,0 +1,90 @@ +# specs/docs — the system documentation as a declared document + +> **Where this lives.** `specs/docs/` and the Markdown bodies under `docs/system/` in +> `gHashTag/t27` are the canonical home of the system documentation — edit them here. +> `gHashTag/trinity` keeps a byte-identical vendored copy under +> `apps/website/public/t27/files/specs/docs/` and `apps/website/public/t27/files/docs/system/`; +> its build reads that copy through the vendored compiler wasm (`t27_compiler.wasm`) and +> renders it at `t27.ai/#/docs`. The wasm's `typecheck.ok` is necessary, not sufficient, so +> the site's generator (`scripts/docs-from-specs.mjs`) also checks the field schema below. +> The bootstrap compiler on `master` was not run against these files in the commit that +> added them. A checkout of this repository is referred to as `T27_ROOT` (an environment +> variable) or `git rev-parse --show-toplevel`; no file here names an absolute path. + +The documentation describes the project, the rules of the game for agents, the five-layer +system (Specs -> Skills -> Crons -> Agents -> Tools), the 27-agent alphabet, the Queen's +cycle, the tooling and the evidence. One `.t27` module declares the document, one per +chapter declares the chapter; the English prose is Markdown in `docs/system/.md` +(LANG-EN: canonical prose is English and lives outside the spec); the Russian prose travels +through the translation contract `specs/i18n/docs-ru.t27` and the bundle it names. + +Nothing in `public/docs/system-docs.json` on the site is typed by hand: chapters, sections, +tables (laws, phases, agents, tools, ladder counts, witnesses) and the source list with +sha256 per file are generated from these specs and the catalogs they point to. + +## Files + +| File | Module | Role | +|---|---|---| +| `system.t27` | `docs_system` | The document: `KIND = "docs"`, `ID`, `TITLE`, `CHAPTERS` (ids in reading order), `SOURCES` (catalogs and canon documents), `DIAGRAMS` (figures the site draws from data), `LOCALES`, `ENABLED` | +| `chapters/.t27` | `docs_chapter_` | One chapter: `KIND = "docs-chapter"`, `ID = "docs/"`, `DOCUMENT`, `ORDER`, `TITLE`, `SOURCES`, `SECTIONS`, `DIAGRAM`, `TABLE`, `BODY_EN`, `ENABLED` | +| `../i18n/docs-ru.t27` | `i18n_docs_ru` | Translation contract for Russian: scope, fields, bundle path in `gHashTag/trinity` | +| `../../docs/system/.md` | — | English canonical prose of chapter ``; every `SECTIONS` entry is a level-2 heading, in order | + +## Chapters + +| Order | ID | Title | Figure | Table | +|---|---|---|---|---| +| 1 | `docs/project` | The project | `ladder` | `claims` | +| 2 | `docs/rules` | Constitution and the rules of the game for agents | `law-hierarchy` | `laws` | +| 3 | `docs/layers` | The five-layer system | `skills-crons-agents` | `ladder-counts` | +| 4 | `docs/alphabet` | The 27-agent alphabet | `agent-ring` | `agents` | +| 5 | `docs/queen` | Queen orchestration | `phase-cycle` | `phases` | +| 6 | `docs/tooling` | Tooling | `tools-map` | `tools` | +| 7 | `docs/evidence` | Evidence and witnesses | — | `witnesses` | + +## Schema + +`system.t27` + +| Constant | Type | Meaning | +|---|---|---| +| `KIND` | `str` | Always `"docs"` | +| `ID` | `str` | `"docs/system"` | +| `TITLE` | `str` | Document title, English | +| `CHAPTERS` | `[N]str` | Chapter ids in reading order; each must resolve to `chapters/.t27` with `ENABLED = true` | +| `SOURCES` | `[N]str` | Catalog directories and canon files the chapters draw on; each must exist in the tree | +| `DIAGRAMS` | `[N]str` | Figure ids the site knows how to draw; a chapter's `DIAGRAM` must be one of them or empty | +| `LOCALES` | `[N]str` | `"en"` first; each other locale must have `specs/i18n/docs-.t27` | +| `ENABLED` | `bool` | Whether the site renders the document | + +`chapters/.t27` + +| Constant | Type | Meaning | +|---|---|---| +| `KIND` | `str` | Always `"docs-chapter"` | +| `ID` | `str` | `"docs/"`, `` = file stem | +| `DOCUMENT` | `str` | `"docs/system"` | +| `ORDER` | `u8` | Position in the document; must match the index in `CHAPTERS` | +| `TITLE` | `str` | Chapter title, English | +| `SOURCES` | `[N]str` | Files the chapter quotes or is generated from; paths from the t27 root, or from the trinity root with the prefix `trinity:`; each must exist | +| `SECTIONS` | `[N]str` | Section headings in order; the body must carry each as `## ` in the same order, and no other level-2 heading | +| `DIAGRAM` | `str` | One of `DIAGRAMS` or `""` | +| `TABLE` | `str` | One of `claims`, `laws`, `ladder-counts`, `agents`, `phases`, `tools`, `witnesses`, or `""`; the generator must be able to produce it non-empty | +| `BODY_EN` | `str` | `docs/system/.md`; must exist and start with a level-1 heading | +| `ENABLED` | `bool` | Whether the chapter is rendered | + +## Rules of the catalog + +- English and ASCII only in the `.t27` and in `docs/system/*.md` (SOUL Article I, LANG-EN); + translations live in bundles declared by `specs/i18n/docs-.t27`. +- No ranking words ("first", "only", "best" and their translations) in English or Russian + prose; the site's `check:docs` fails a build that contains them. +- Every number in the prose carries a status tag (`[measured]`, `[declared]`, `[specified]`, + `[external]`, `[not claimed]`) or is generated into a table with a source line. +- Quote canon files; do not paraphrase a rule into a stronger one. Where two canon files + disagree, record the disagreement (the chapters do this for L1-L7 versus "L1-L8" and for + the two statements of the Queen's loop). +- Change the spec or the body and regenerate; never edit `public/docs/system-docs.json`. +- Ownership: `Z-Zeta` (documentation), with `T-Queen` for the orchestration chapter + (`specs/OWNERS.md`). diff --git a/specs/docs/chapters/alphabet.t27 b/specs/docs/chapters/alphabet.t27 new file mode 100644 index 000000000..a99cf0d0d --- /dev/null +++ b/specs/docs/chapters/alphabet.t27 @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 +; specs/docs/chapters/alphabet.t27 -- chapter 4 of the system documentation, docs/alphabet +; Source of truth for the system documentation on t27.ai (#/docs). The English prose +; lives in the Markdown file named by BODY_EN (LANG-EN: canonical prose is English); +; this module declares the chapter's identity, its sections, its sources and the +; figure and table the site renders from data. The JSON the site serves is generated +; from this file by the real compiler, nothing below is parsed with a regex. ASCII only (L3). +; phi^2 + 1/phi^2 = 3 | TRINITY + +module docs_chapter_alphabet; + +pub const KIND : str = "docs-chapter"; +pub const ID : str = "docs/alphabet"; +pub const DOCUMENT : str = "docs/system"; +; position in the document, 1..7 +pub const ORDER : u8 = 4; +pub const TITLE : str = "The 27-agent alphabet"; +; Repository files this chapter quotes or is generated from (paths from the t27 root, +; or from the trinity root when prefixed with trinity:). +pub const SOURCES : [2]str = ["docs/agents/AGENTS_ALPHABET.md", "specs/agents/README.md"]; +; Section headings, in order. The Markdown body must carry each as a level-2 heading. +pub const SECTIONS : [3]str = ["Twenty-seven letters, three nonas", "The table", "What a card carries"]; +; Figure the site renders from data next to this chapter; one of DIAGRAMS in system.t27, +; or empty when the chapter has none. +pub const DIAGRAM : str = "agent-ring"; +; Generated table the site renders from the catalogs; empty when the chapter has none. +pub const TABLE : str = "agents"; +; English canonical prose, Markdown, path from the t27 root. +pub const BODY_EN : str = "docs/system/alphabet.md"; +pub const ENABLED : bool = true; diff --git a/specs/docs/chapters/evidence.t27 b/specs/docs/chapters/evidence.t27 new file mode 100644 index 000000000..717e93edb --- /dev/null +++ b/specs/docs/chapters/evidence.t27 @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 +; specs/docs/chapters/evidence.t27 -- chapter 7 of the system documentation, docs/evidence +; Source of truth for the system documentation on t27.ai (#/docs). The English prose +; lives in the Markdown file named by BODY_EN (LANG-EN: canonical prose is English); +; this module declares the chapter's identity, its sections, its sources and the +; figure and table the site renders from data. The JSON the site serves is generated +; from this file by the real compiler, nothing below is parsed with a regex. ASCII only (L3). +; phi^2 + 1/phi^2 = 3 | TRINITY + +module docs_chapter_evidence; + +pub const KIND : str = "docs-chapter"; +pub const ID : str = "docs/evidence"; +pub const DOCUMENT : str = "docs/system"; +; position in the document, 1..7 +pub const ORDER : u8 = 7; +pub const TITLE : str = "Evidence and witnesses"; +; Repository files this chapter quotes or is generated from (paths from the t27 root, +; or from the trinity root when prefixed with trinity:). +pub const SOURCES : [5]str = ["specs/skills/README.md", "specs/tools/README.md", "README-ZENODO.md", "docs/reports/TNF-ARTICLE-AUDIT-W845.md", "docs/reports/TNF-ARTICLE-RECONCILIATION.md"]; +; Section headings, in order. The Markdown body must carry each as a level-2 heading. +pub const SECTIONS : [6]str = ["Measured, declared, external", "Witness labels", "Wasm verdicts", "CI gates", "Reproducing a number", "Published record"]; +; Figure the site renders from data next to this chapter; one of DIAGRAMS in system.t27, +; or empty when the chapter has none. +pub const DIAGRAM : str = ""; +; Generated table the site renders from the catalogs; empty when the chapter has none. +pub const TABLE : str = "witnesses"; +; English canonical prose, Markdown, path from the t27 root. +pub const BODY_EN : str = "docs/system/evidence.md"; +pub const ENABLED : bool = true; diff --git a/specs/docs/chapters/layers.t27 b/specs/docs/chapters/layers.t27 new file mode 100644 index 000000000..44bfffb3b --- /dev/null +++ b/specs/docs/chapters/layers.t27 @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 +; specs/docs/chapters/layers.t27 -- chapter 3 of the system documentation, docs/layers +; Source of truth for the system documentation on t27.ai (#/docs). The English prose +; lives in the Markdown file named by BODY_EN (LANG-EN: canonical prose is English); +; this module declares the chapter's identity, its sections, its sources and the +; figure and table the site renders from data. The JSON the site serves is generated +; from this file by the real compiler, nothing below is parsed with a regex. ASCII only (L3). +; phi^2 + 1/phi^2 = 3 | TRINITY + +module docs_chapter_layers; + +pub const KIND : str = "docs-chapter"; +pub const ID : str = "docs/layers"; +pub const DOCUMENT : str = "docs/system"; +; position in the document, 1..7 +pub const ORDER : u8 = 3; +pub const TITLE : str = "The five-layer system"; +; Repository files this chapter quotes or is generated from (paths from the t27 root, +; or from the trinity root when prefixed with trinity:). +pub const SOURCES : [5]str = ["specs/skills/README.md", "specs/crons/README.md", "specs/agents/README.md", "specs/tools/README.md", "specs/i18n/agents-ru.t27"]; +; Section headings, in order. The Markdown body must carry each as a level-2 heading. +pub const SECTIONS : [7]str = ["Specs", "Skills", "Crons", "Agents", "Tools", "From spec to site", "Experience"]; +; Figure the site renders from data next to this chapter; one of DIAGRAMS in system.t27, +; or empty when the chapter has none. +pub const DIAGRAM : str = "skills-crons-agents"; +; Generated table the site renders from the catalogs; empty when the chapter has none. +pub const TABLE : str = "ladder-counts"; +; English canonical prose, Markdown, path from the t27 root. +pub const BODY_EN : str = "docs/system/layers.md"; +pub const ENABLED : bool = true; diff --git a/specs/docs/chapters/project.t27 b/specs/docs/chapters/project.t27 new file mode 100644 index 000000000..39d4cf559 --- /dev/null +++ b/specs/docs/chapters/project.t27 @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 +; specs/docs/chapters/project.t27 -- chapter 1 of the system documentation, docs/project +; Source of truth for the system documentation on t27.ai (#/docs). The English prose +; lives in the Markdown file named by BODY_EN (LANG-EN: canonical prose is English); +; this module declares the chapter's identity, its sections, its sources and the +; figure and table the site renders from data. The JSON the site serves is generated +; from this file by the real compiler, nothing below is parsed with a regex. ASCII only (L3). +; phi^2 + 1/phi^2 = 3 | TRINITY + +module docs_chapter_project; + +pub const KIND : str = "docs-chapter"; +pub const ID : str = "docs/project"; +pub const DOCUMENT : str = "docs/system"; +; position in the document, 1..7 +pub const ORDER : u8 = 1; +pub const TITLE : str = "The project"; +; Repository files this chapter quotes or is generated from (paths from the t27 root, +; or from the trinity root when prefixed with trinity:). +pub const SOURCES : [5]str = ["SOUL.md", "AGENTS.md", "specs/docs/system.t27", "trinity:apps/website/src/data/siliconHistory.ts", "trinity:apps/website/src/content/tnf.ts"]; +; Section headings, in order. The Markdown body must carry each as a level-2 heading. +pub const SECTIONS : [4]str = ["What t27 and Trinity are", "Claims and their status", "Boundaries", "How to read this documentation"]; +; Figure the site renders from data next to this chapter; one of DIAGRAMS in system.t27, +; or empty when the chapter has none. +pub const DIAGRAM : str = "ladder"; +; Generated table the site renders from the catalogs; empty when the chapter has none. +pub const TABLE : str = "claims"; +; English canonical prose, Markdown, path from the t27 root. +pub const BODY_EN : str = "docs/system/project.md"; +pub const ENABLED : bool = true; diff --git a/specs/docs/chapters/queen.t27 b/specs/docs/chapters/queen.t27 new file mode 100644 index 000000000..a13f81f2a --- /dev/null +++ b/specs/docs/chapters/queen.t27 @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 +; specs/docs/chapters/queen.t27 -- chapter 5 of the system documentation, docs/queen +; Source of truth for the system documentation on t27.ai (#/docs). The English prose +; lives in the Markdown file named by BODY_EN (LANG-EN: canonical prose is English); +; this module declares the chapter's identity, its sections, its sources and the +; figure and table the site renders from data. The JSON the site serves is generated +; from this file by the real compiler, nothing below is parsed with a regex. ASCII only (L3). +; phi^2 + 1/phi^2 = 3 | TRINITY + +module docs_chapter_queen; + +pub const KIND : str = "docs-chapter"; +pub const ID : str = "docs/queen"; +pub const DOCUMENT : str = "docs/system"; +; position in the document, 1..7 +pub const ORDER : u8 = 5; +pub const TITLE : str = "Queen orchestration"; +; Repository files this chapter quotes or is generated from (paths from the t27 root, +; or from the trinity root when prefixed with trinity:). +pub const SOURCES : [5]str = ["docs/agents/AGENTS_ALPHABET.md", "CLAUDE.md", "specs/agents/t.t27", "specs/tools/tri/cell.t27", "specs/tools/tri/verdict.t27"]; +; Section headings, in order. The Markdown body must carry each as a level-2 heading. +pub const SECTIONS : [3]str = ["The six-phase cycle and Phase 7", "Cell, seal, verdict", "Two statements of the loop"]; +; Figure the site renders from data next to this chapter; one of DIAGRAMS in system.t27, +; or empty when the chapter has none. +pub const DIAGRAM : str = "phase-cycle"; +; Generated table the site renders from the catalogs; empty when the chapter has none. +pub const TABLE : str = "phases"; +; English canonical prose, Markdown, path from the t27 root. +pub const BODY_EN : str = "docs/system/queen.md"; +pub const ENABLED : bool = true; diff --git a/specs/docs/chapters/rules.t27 b/specs/docs/chapters/rules.t27 new file mode 100644 index 000000000..2b8c290d5 --- /dev/null +++ b/specs/docs/chapters/rules.t27 @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 +; specs/docs/chapters/rules.t27 -- chapter 2 of the system documentation, docs/rules +; Source of truth for the system documentation on t27.ai (#/docs). The English prose +; lives in the Markdown file named by BODY_EN (LANG-EN: canonical prose is English); +; this module declares the chapter's identity, its sections, its sources and the +; figure and table the site renders from data. The JSON the site serves is generated +; from this file by the real compiler, nothing below is parsed with a regex. ASCII only (L3). +; phi^2 + 1/phi^2 = 3 | TRINITY + +module docs_chapter_rules; + +pub const KIND : str = "docs-chapter"; +pub const ID : str = "docs/rules"; +pub const DOCUMENT : str = "docs/system"; +; position in the document, 1..7 +pub const ORDER : u8 = 2; +pub const TITLE : str = "Constitution and the rules of the game for agents"; +; Repository files this chapter quotes or is generated from (paths from the t27 root, +; or from the trinity root when prefixed with trinity:). +pub const SOURCES : [5]str = ["SOUL.md", "AGENTS.md", "CLAUDE.md", "docs/T27-CONSTITUTION.md", "docs/coordination/TASK_PROTOCOL.md"]; +; Section headings, in order. The Markdown body must carry each as a level-2 heading. +pub const SECTIONS : [6]str = ["The constitutional stack", "SOUL articles", "Invariant laws and their priority", "Non-negotiables for changes", "TASK protocol", "Issue gate and TDD mandate"]; +; Figure the site renders from data next to this chapter; one of DIAGRAMS in system.t27, +; or empty when the chapter has none. +pub const DIAGRAM : str = "law-hierarchy"; +; Generated table the site renders from the catalogs; empty when the chapter has none. +pub const TABLE : str = "laws"; +; English canonical prose, Markdown, path from the t27 root. +pub const BODY_EN : str = "docs/system/rules.md"; +pub const ENABLED : bool = true; diff --git a/specs/docs/chapters/tooling.t27 b/specs/docs/chapters/tooling.t27 new file mode 100644 index 000000000..eb6bc352c --- /dev/null +++ b/specs/docs/chapters/tooling.t27 @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 +; specs/docs/chapters/tooling.t27 -- chapter 6 of the system documentation, docs/tooling +; Source of truth for the system documentation on t27.ai (#/docs). The English prose +; lives in the Markdown file named by BODY_EN (LANG-EN: canonical prose is English); +; this module declares the chapter's identity, its sections, its sources and the +; figure and table the site renders from data. The JSON the site serves is generated +; from this file by the real compiler, nothing below is parsed with a regex. ASCII only (L3). +; phi^2 + 1/phi^2 = 3 | TRINITY + +module docs_chapter_tooling; + +pub const KIND : str = "docs-chapter"; +pub const ID : str = "docs/tooling"; +pub const DOCUMENT : str = "docs/system"; +; position in the document, 1..7 +pub const ORDER : u8 = 6; +pub const TITLE : str = "Tooling"; +; Repository files this chapter quotes or is generated from (paths from the t27 root, +; or from the trinity root when prefixed with trinity:). +pub const SOURCES : [4]str = ["specs/tools/README.md", "specs/tools/tri/cell.t27", "specs/agents/README.md", "SOUL.md"]; +; Section headings, in order. The Markdown body must carry each as a level-2 heading. +pub const SECTIONS : [3]str = ["The tri CLI", "MCP servers", "Who owns a tool"]; +; Figure the site renders from data next to this chapter; one of DIAGRAMS in system.t27, +; or empty when the chapter has none. +pub const DIAGRAM : str = "tools-map"; +; Generated table the site renders from the catalogs; empty when the chapter has none. +pub const TABLE : str = "tools"; +; English canonical prose, Markdown, path from the t27 root. +pub const BODY_EN : str = "docs/system/tooling.md"; +pub const ENABLED : bool = true; diff --git a/specs/docs/system.t27 b/specs/docs/system.t27 new file mode 100644 index 000000000..4337212e0 --- /dev/null +++ b/specs/docs/system.t27 @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: Apache-2.0 +; specs/docs/system.t27 -- the system documentation of t27 / Trinity as one declared document +; Source of truth for the system documentation on t27.ai (#/docs). The English prose +; lives in the Markdown file named by BODY_EN (LANG-EN: canonical prose is English); +; this module declares the chapter's identity, its sections, its sources and the +; figure and table the site renders from data. The JSON the site serves is generated +; from this file by the real compiler, nothing below is parsed with a regex. ASCII only (L3). +; phi^2 + 1/phi^2 = 3 | TRINITY + +module docs_system; + +pub const KIND : str = "docs"; +pub const ID : str = "docs/system"; +pub const TITLE : str = "t27 / Trinity -- the system, its rules and its evidence"; +; Chapter IDs in reading order; each resolves to specs/docs/chapters/.t27. +pub const CHAPTERS : [7]str = ["project", "rules", "layers", "alphabet", "queen", "tooling", "evidence"]; +; Catalogs and canon documents the chapters are generated from or quote. +pub const SOURCES : [10]str = ["specs/skills", "specs/crons", "specs/agents", "specs/tools", "specs/i18n", "SOUL.md", "AGENTS.md", "CLAUDE.md", "docs/agents/AGENTS_ALPHABET.md", "docs/T27-CONSTITUTION.md"]; +; Figures the site renders from data (inline SVG, no static images); a chapter names one. +pub const DIAGRAMS : [6]str = ["ladder", "agent-ring", "phase-cycle", "law-hierarchy", "skills-crons-agents", "tools-map"]; +; Locales the site serves; "en" is canonical, others come through specs/i18n/docs-.t27. +pub const LOCALES : [2]str = ["en", "ru"]; +pub const ENABLED : bool = true; diff --git a/specs/i18n/docs-ru.t27 b/specs/i18n/docs-ru.t27 new file mode 100644 index 000000000..9a0096e9c --- /dev/null +++ b/specs/i18n/docs-ru.t27 @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: Apache-2.0 +; specs/i18n/docs-ru.t27 -- translation contract, Russian, for the system documentation +; Specs are English-only (LANG-EN). This module does not carry a single translated +; word: it declares WHICH fields of WHICH specs a bundle may translate, WHERE that +; bundle lives and HOW it is keyed, and what the site must do when a translation +; is missing. The Cyrillic payload is in the bundle file named below, never here. +; One module per locale: copy this file to docs-.t27 and change LOCALE and +; BUNDLE_PATH; the generator discovers every specs/i18n/*.t27 and hardcodes no +; locale list. +; phi^2 + 1/phi^2 = 3 | TRINITY + +module i18n_docs_ru; + +pub const KIND : str = "i18n"; +pub const LOCALE : str = "ru"; +pub const SOURCE_LOCALE : str = "en"; +; Spec directories whose modules this bundle may translate; an entry ID must +; resolve to a spec in one of them. +pub const SCOPE : [2]str = ["specs/docs", "specs/docs/chapters"]; +; Spec fields a bundle entry may carry. TITLE maps to TITLE; BODY maps to the Markdown +; body named by BODY_EN and must carry the same level-2 headings, in the same order. +pub const FIELDS : [2]str = ["TITLE", "BODY"]; +pub const BUNDLE_REPO : str = "trinity"; +pub const BUNDLE_PATH : str = "apps/website/i18n/docs.ru.json"; +pub const BUNDLE_FORMAT : str = "json"; +; Bundle entries are keyed by the spec's ID constant. +pub const KEY : str = "ID"; +; What the site shows when an entry or a field has no translation. +pub const FALLBACK : str = "en"; +; false: a chapter with no translation is a warning, not a build failure. +pub const COVERAGE_REQUIRED : bool = false; +; false: a bundle entry whose ID matches no spec in SCOPE fails the build. +pub const ORPHANS_ALLOWED : bool = false; +pub const ENABLED : bool = true;