Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions apps/website/i18n/docs.ru.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"check:spec-catalog": "node --experimental-strip-types qa/spec-catalog-contract.mjs",
"core": "node scripts/spec-core.mjs",
"check:shared-core": "node --experimental-strip-types qa/shared-spec-core.mjs",
"prebuild": "npm run core -- index && node scripts/skills-core.mjs index && node scripts/agents-from-specs.mjs",
"prebuild:ci": "npm run core -- index && node scripts/skills-core.mjs index && node scripts/agents-from-specs.mjs",
"prebuild": "npm run core -- index && node scripts/skills-core.mjs index && node scripts/agents-from-specs.mjs && node scripts/docs-from-specs.mjs",
"prebuild:ci": "npm run core -- index && node scripts/skills-core.mjs index && node scripts/agents-from-specs.mjs && node scripts/docs-from-specs.mjs",
"dev": "vite",
"build": "vite build",
"build:ci": "vite build",
Expand Down Expand Up @@ -67,7 +67,9 @@
"test:sync-crons": "node --test scripts/sync-crons.test.mjs",
"check:agents": "node --experimental-strip-types qa/agents-spec-contract.mjs",
"check:tools": "node --experimental-strip-types qa/tools-spec-contract.mjs",
"test:agents-specs": "node --test scripts/agents-from-specs.test.mjs"
"test:agents-specs": "node --test scripts/agents-from-specs.test.mjs",
"check:docs": "node --experimental-strip-types qa/docs-spec-contract.mjs",
"test:docs-specs": "node --test scripts/docs-from-specs.test.mjs"
},
"dependencies": {
"@babylonjs/core": "^9.25.0",
Expand Down
6 changes: 3 additions & 3 deletions apps/website/public/agents/experience.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": 1,
"generatedAt": "2026-09-09T17:03:41.298Z",
"generatedAt": "2026-09-09T17:16:31.473Z",
"attribution": {
"fields": [
"agent_letter",
Expand Down Expand Up @@ -51,7 +51,7 @@
"sources": [
{
"repo": "trinity",
"commit": "da84d38795aa97f9170bb670f04a328032aa6ffe",
"commit": "ddceafb50cd0e620387161228fa2c9ae134047de",
"dir": ".trinity/experience",
"files": 440,
"episodes": 383,
Expand All @@ -69,7 +69,7 @@
},
{
"repo": "t27",
"commit": "95c9b61b97d487bec4279ca63eb3132da8d1721c",
"commit": "93727f733e23baf032d54505095777f16676d70b",
"dir": ".trinity/experience",
"files": 2,
"episodes": 3,
Expand Down
2 changes: 1 addition & 1 deletion apps/website/public/agents/spec-agents.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/website/public/crons/spec-crons.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apps/website/public/docs/system-docs.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/website/public/functions/spec-functions.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/website/public/skills/spec-skills.json

Large diffs are not rendered by default.

93 changes: 93 additions & 0 deletions apps/website/public/t27/files/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# AGENTS — Trinity S³AI / t27

This file is the **repository entry point** for humans and coding agents. It summarizes **where law lives** and **how to work safely** in this tree.

---

## 1. Read first (constitutional stack)

| Order | File | Role |
|------:|------|------|
| 1 | [`SOUL.md`](SOUL.md) | **Canonical** constitution (language policy, TDD mandate, validation). |
| 2 | [`docs/nona-03-manifest/SOUL.md`](docs/nona-03-manifest/SOUL.md) | Expanded reference; if it conflicts with root `SOUL.md`, **root wins**. |
| 3 | [`docs/T27-CONSTITUTION.md`](docs/T27-CONSTITUTION.md) | **SSOT-MATH**, **LANG-EN**, **DOCS-TREE** (where `docs/` files may live). |
| 4 | [`TASK.md`](TASK.md) + [`docs/coordination/TASK_PROTOCOL.md`](docs/coordination/TASK_PROTOCOL.md) | Multi-agent coordination, locks, anchor issue. |
| 5 | [`OWNERS.md`](OWNERS.md) | Domain ownership; each major directory may have its own `OWNERS.md`. |

Supporting: [`CONTRIBUTING.md`](CONTRIBUTING.md), [`SECURITY.md`](SECURITY.md), [`architecture/ADR-004-language-policy.md`](architecture/ADR-004-language-policy.md).

---

## 2. Agent model (27-letter alphabet)

- **Documentation map:** [`docs/README.md`](docs/README.md) — where first-party docs live (`agents/`, `coordination/`, `nona-01..03/`, `clara/`).
- **Full alphabet and roles:** [`docs/agents/AGENTS_ALPHABET.md`](docs/agents/AGENTS_ALPHABET.md) — canon for T, N, P, C, B, etc.
- **Operational agent specs (e.g. watchdogs, schemas):** [`docs/agents/AGENTS.md`](docs/agents/AGENTS.md) — complements the alphabet; not a second constitution.

Use **domain directories**, not “one folder per agent.” Primary contact for a path is the **Primary** listed in the nearest `OWNERS.md`.

---

## 3. Non-negotiables for changes

1. **Specs are source of truth** — behavior belongs in `.t27` / `.tri`; generated `gen/` output is not hand-edited (except 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**; grandfathered paths only in [`docs/.legacy-non-english-docs`](docs/.legacy-non-english-docs).
4. **No new Python on the verification critical path** — see **SSOT-MATH** and [`docs/nona-02-organism/TZ-T27-001-NO-PYTHON-CRITICAL-PATH.md`](docs/nona-02-organism/TZ-T27-001-NO-PYTHON-CRITICAL-PATH.md).
5. **Issue gate** — PRs should link issues (`Closes #N`) where project policy requires it.
6. **Ring / gold work** — follow [`docs/nona-01-foundation/GOLDEN-RINGS-CANON.md`](docs/nona-01-foundation/GOLDEN-RINGS-CANON.md) for parser/compiler/spec changes; compiler seal path: `bootstrap/stage0/FROZEN_HASH`.

---

## 4. Layout reminders (after repo hygiene refactors)

- **Core:** `specs/`, `compiler/`, `bootstrap/`, `gen/`, `conformance/`, `tests/`.
- **Non-core services & tooling:** `contrib/backend/`, `contrib/portable-claude-setup/`.
- **Vendored / datasets / upstream:** `external/` (e.g. OpenCode submodule, `external/kaggle/`).

---

## 5. Law Reference

The seven **Invariant Laws (L1–L8)** are defined in [`docs/T27-CONSTITUTION.md`](docs/T27-CONSTITUTION.md#2--invariant-laws-never-change-without-constitutional-amendment):

| Law | Name | Legacy alias | Summary |
|-----|------|-------------|---------|
| **L1** | TRACEABILITY | ISSUE-GATE | No code merged without `Closes #N` |
| **L2** | GENERATION | NO-HAND-EDIT-GEN | Files under `gen/` are generated; edit specs instead |
| **L3** | PURITY | SOUL-ASCII | Source files must be ASCII-only with English identifiers |
| **L4** | TESTABILITY | TDD-MANDATE | Every `.t27` spec must contain `test`/`invariant`/`bench` |
| **L5** | IDENTITY | PHI-IDENTITY | φ² = φ + 1; φ² + φ⁻² = 3; IEEE f64 checks use tolerance |
| **L6** | CEILING | TRINITY-SACRED | `FORMAT-SPEC-001.json` + `gf16.t27` are numeric SSOT |
| **L7** | UNITY | NO-NEW-SHELL | No new `*.sh` on critical path; use `tri`/`t27c` |

**Law Priority:** L1 > L2 > L3 > L4 > L5 > L6 > L7 > L8 (Asimov-style hierarchy)

---

## 6. Cursor / automation

- Rule file: [`.cursor/rules/t27-ssot-math.mdc`](.cursor/rules/t27-ssot-math.mdc) — keep in sync with **SSOT-MATH** and this entry point.

---

**φ² + 1/φ² = 3 | TRINITY**

---

## 5. Law Reference

The seven **Invariant Laws (L1–L8)** are defined in [`docs/T27-CONSTITUTION.md`](docs/T27-CONSTITUTION.md#2--invariant-laws-never-change-without-constitutional-amendment):

| Law | Name | Legacy alias | Summary |
|-----|------|-------------|---------|
| **L1** | TRACEABILITY | ISSUE-GATE | No code merged without `Closes #N` |
| **L2** | GENERATION | NO-HAND-EDIT-GEN | Files under `gen/` are generated; edit specs instead |
| **L3** | PURITY | SOUL-ASCII | Source files must be ASCII-only with English identifiers |
| **L4** | TESTABILITY | TDD-MANDATE | Every `.t27` spec must contain `test`/`invariant`/`bench` |
| **L5** | IDENTITY | PHI-IDENTITY | φ² = φ + 1; φ² + φ⁻² = 3; IEEE f64 checks use tolerance |
| **L6** | CEILING | TRINITY-SACRED | `FORMAT-SPEC-001.json` + `gf16.t27` are numeric SSOT |
| **L7** | UNITY | NO-NEW-SHELL | No new `*.sh` on critical path; use `tri`/`t27c` |

**Law Priority:** L1 > L2 > L3 > L4 > L5 > L6 > L7 > L8 (Asimov-style hierarchy)

175 changes: 175 additions & 0 deletions apps/website/public/t27/files/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# CLAUDE.md — Instructions for Claude Code and autonomous agents (t27)

Use this file **together with** `[AGENTS.md](AGENTS.md)`. Repo-specific law always overrides generic tooling defaults.

---

## Autonomous Execution Loop (AEL v2.0)

When operating as the Trinity Agent (Queen), follow this 6-phase loop:

```
┌─────────────────────────────────────────────────────────────┐
│ OBSERVE → PLAN → DELEGATE → VERIFY → SYNTHESIZE → LEARN │
│ ↓ ↓ ↓ ↓ ↓ ↓ │
│ [E] [T] [C/V] [V] [L] [L] │
└─────────────────────────────────────────────────────────────┘
```

### Phase 1: OBSERVE
- Call Experience Agent (E) for context
- Read `.trinity/current-issue.md` for issue details
- Check ring and phase state from branch name
- Gather relevant files and context

### Phase 2: PLAN
- Break down task into subtasks
- Identify required skills: `/phi-loop`, `/tri-pipeline`, `/experience-save`
- Determine which agents to delegate to
- Estimate complexity and dependencies

### Phase 3: DELEGATE
- Delegate implementation to Creator Agent (C)
- Delegate validation to Verifier Agent (V)
- Coordinate parallel execution where possible
- Monitor agent progress

### Phase 4: VERIFY
- Review agent outputs
- Run conformance tests via `/tri-pipeline`
- Check L1-L7 law compliance
- Ensure quality standards

### Phase 5: SYNTHESIZE
- Combine agent results
- Resolve conflicts
- Create cohesive solution
- Prepare for integration

### Phase 6: LEARN
- Call Learner Agent (L) for pattern extraction
- Update `.trinity/experience.md` via `/experience-save`
- Save ring-specific learnings
- Improve future execution

---

## 1. Mandatory read order for this repository

1. `[AGENTS.md](AGENTS.md)` — entry point and constitutional stack.
2. `[SOUL.md](SOUL.md)` — canonical law (TDD, language, validation).
3. `[docs/T27-CONSTITUTION.md](docs/T27-CONSTITUTION.md)` — **SSOT-MATH**, **LANG-EN**, **DOCS-TREE**.
4. `[TASK.md](TASK.md)` and `[docs/coordination/TASK_PROTOCOL.md](docs/coordination/TASK_PROTOCOL.md)` — if the task touches coordination, locks, or shared hot paths.
5. Nearest `[OWNERS.md](OWNERS.md)` for the directories you edit.

Do **not** add parallel math/physics implementations in ad-hoc scripts when the same belongs in `*.t27` and the **`tri`** pipeline (`./scripts/tri`).

---

## 2. Engineering workflow

- **Bootstrap compiler:** from repo root, `cargo build --release -p t27c` (runs `build.rs` language checks). `bootstrap/` is a **workspace member**, so the binary lands at the workspace root: `./target/release/t27c` — *not* `./bootstrap/target/release/t27c`.
- **Local sweep (CI-like):** from repo root, `./scripts/tri test` or `./target/release/t27c suite --repo-root .` (Rust runner; no shell test harness under `tests/`).
- **Generated code:** under `gen/` — do not hand-edit for routine fixes; change specs and regenerate.
- **Pull requests:** follow project Issue Gate and linking policy; **do not approve** PRs unless explicitly authorized.

---

## 3. PHI LOOP Execution

Follow the 9-phase PHI LOOP for ring-based development:

1. **Issue** - Define problem or requirement
2. **Spec** - Write .t27 specification
3. **TDD** - Write tests in spec before implementation
4. **Code/Impl** - Implement according to spec
5. **Gen** - Run `tri gen` to generate code from spec
6. **Seal** - Verify generated code and seal hash
7. **Verify** - Run `tri test` or conformance checks
8. **Land** - Merge changes to main branch
9. **Learn** - Capture learnings and update knowledge base

### Phase Completion Marker

When a phase is complete, include in your output:
```
Phase complete: [phase name]
→ Phase [next phase number]: [next phase name]
```

This triggers automatic branch creation for the next phase.

---

## 4. Autonomous subagent behavior (when spawned unattended)

- Finish the assigned task without waiting for clarification unless the repo's own rules require human input.
- If blocked after reasonable retries, stop and report what failed (logs, commands, file paths).
- Prefer small, reviewable diffs; match existing style and naming in touched files.
- **Output persistence:** when the parent workflow requires it, write the full final report to `/tmp/claude_code_output.md` (analysis, commands, diffs summary).

---

## 5. Skills and tooling

### Available Skills

- `/phi-loop` - Execute 9-phase PHI LOOP
- `/tri-pipeline` - Execute tri commands (gen, test, verify, seal)
- `/experience-save` - Save learnings to persistent memory

Load these skills when their functionality matches the task.

---

## FPGA hardware & flashing (SSOT)

**`[fpga/HARDWARE_SSOT.md](fpga/HARDWARE_SSOT.md)` is the single source of truth**
for the FPGA board, JTAG cable, host toolchain, and program/flash path. Read it
before touching anything under `fpga/`. Non-negotiables:

- Target board is **QMTech Wukong V1 / XC7A200T-FGG676** (`xc7a200tfgg676-1`),
IDCODE `0x03636093`. Not the Arty A7 (`csg324`), and **not the 100T** — this
file said `XC7A100T` / `0x13631093` until 2026-08-14, contradicting the SSOT
it points to. Measured on all three attached boards: `idcode 0x3636093`,
`family artix a7 200t`. For place-and-route use the `fbg676` chipdb
(`xc7a200tfbg676-1`) — same die and pinout, per HARDWARE_SSOT.md §2026-07-05.
- **Flash with `openFPGALoader -c digilent_hs2`.** The attached cables are
**Digilent FTDI `0x0403:0x6014`**, not the Xilinx `0x03FD` Platform Cable, and
`cli/dlc10` speaks only to `0x03FD` — it answers `DLC10 cable not found` on this
bench. Address the three boards with `--busdev-num 1:4 / 1:6 / 1:8`; they share
serial `210512180081`, so serial-based addressing cannot separate them.
See `fpga/HARDWARE_SSOT.md` §"Note" and §"Programming".
*Corrected W791 (T460/T461): the previous text here forbade `openFPGALoader` on
the grounds that it cannot drive a `0x03FD` cable — true, and irrelevant, since
no `0x03FD` cable is attached. That sentence contradicted the SSOT this file
names as authoritative, and it was reported as a hardware blocker for thirteen
waves. `cli/dlc10` remains correct for a DLC10 bench and is not removed.*
- No native macOS Vivado exists. Synthesis is Vivado-in-Docker or OpenXC7 only.
- If any other FPGA doc contradicts the SSOT, the SSOT wins — fix the other doc.

---

## 6. Security and secrets

- Never commit secrets. See `[SECURITY.md](SECURITY.md)`. Root `.env` patterns are gitignored; use `.env.example` patterns only in docs.

---

## The 7 Invariant Laws

| Law | Name | Description |
|------|------|-------------|
| L1 | TRACEABILITY | No code merged without `Closes #N` |
| L2 | GENERATION | Files under `gen/` are generated; edit specs instead |
| L3 | PURITY | Source files must be ASCII-only with English identifiers |
| L4 | TESTABILITY | Every `.t27` spec must contain `test`/`invariant`/`bench` |
| L5 | IDENTITY | φ² = φ + 1; φ² + φ⁻² = 3; IEEE f64 checks use tolerance |
| L6 | CEILING | `FORMAT-SPEC-001.json` + `gf16.t27` are numeric SSOT |
| L7 | UNITY | No new `*.sh` on critical path; use `tri`/`t27c` |

See [`docs/T27-CONSTITUTION.md`](docs/T27-CONSTITUTION.md#2--invariant-laws-never-change-without-constitutional-amendment) for full details.

---

**Repository:** Trinity S³AI — **t27** (spec-first ternary / TRI-27). **φ² + 1/φ² = 3 | TRINITY**
81 changes: 81 additions & 0 deletions apps/website/public/t27/files/README-ZENODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# T27 Zenodo Publication

This repository is published to Zenodo with DOI: `https://doi.org/10.5281/zenodo.19456875`

## Authors

Vasilev, Dmitrii — Trinity Computing

## Repository Structure

**Main framework:** `https://github.com/gHashTag/trinity` — Trinity S³AI Framework
**Spec language (this repo):** `https://github.com/gHashTag/t27` — T27 specification language

This Zenodo entry publishes the **T27 specification language** which is used within the Trinity framework.

## Citation

```bibtex
@software{t27_v0_1_0,
title = {T27: TRI-27 — Spec-First Language for Ternary Computing},
author = {Vasilev, Dmitrii},
year = {2026},
month = {4},
version = {0.1.0},
doi = {10.5281/zenodo.19456875},
publisher = {Zenodo},
keywords = {ternary computing, specification language, Zig, Coq, formal verification, t27, tri CLI}
}
```

## Abstract

T27 is a spec-first language for ternary computing built on Zig with formal verification support via Coq. Provides comprehensive tooling for software development, specification, and testing.

## Description

T27 implements the TRI-27 spec-first language with:

- **Specification Language (`.t27`)**: Declarative, testable specifications for all software components
- **Formal Verification (Coq)**: Machine-checked proofs for mathematical theorems
- **Build System (`tri` CLI)**: Compiler and toolchain for generating verified software
- **Testing Framework**: Comprehensive test runner with TDD-Inside-Spec methodology
- **Documentation Generation**: Automatic documentation from `.t27` specifications

## Key Features

- **Spec-first development**: Write `.t27` specifications, generate code
- **TDD-Inside-Spec**: Every spec includes `test`/`invariant`/`bench` sections
- **Formal verification**: Coq proofs for core mathematical properties
- **Zero-parameter mechanism**: Theorem 3 proves φ emerges as universal fixed-point attractor from balancing recursion

## References

Whitepaper: "GoldenFloat: φ-Optimal Floating-Point Formats" (in-progress)

**Trinity framework:** https://github.com/gHashTag/trinity — Main repository
**T27 spec language:** https://github.com/gHashTag/t27 — This repository

## Zenodo Rules

- **Open Access**: Published under CC-BY 4.0 or MIT license
- **Versioned**: Semantic versioning (v0.1.0) for tracking changes
- **Preserved**: Zenodo creates permanent DOI for all versions
- **DOI**: Each version gets unique DOI in 10.5281/zenodo.* namespace

## Publication Checklist

- [x] .zenodo.json configured with complete metadata
- [x] CITATION.cff created with author information
- [x] GitHub workflow for automated Zenodo publishing
- [x] Version 0.1.0 created
- [ ] GitHub release v0.1.0 created
- [ ] DOI generated and verified

## How to Cite

Use the Bibtex entry above or visit: https://doi.org/10.5281/zenodo.19456875

---

**Note:** This is the t27 companion repository. The main trinity framework repository is published separately under the trinity community.
Loading
Loading