Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
606272a
Add repository best-practices configs and templates
Apr 11, 2026
2d5c69c
Add initial MDPI LaTeX skeleton for Trinity paper
Apr 11, 2026
9d7ab14
fix(fpga): add all generated Rust files for t27c compilation (Closes …
Apr 13, 2026
6db4ffb
fix(fpga): add generated memory Rust files (Closes #409)
Apr 13, 2026
22dfb88
fix(fpga): add gen/rust/memory files for correct include path (Closes…
Apr 13, 2026
54ac5f0
fix(ci): remove --profile argument from fpga-build command (Closes #409)
Apr 13, 2026
1d5736a
fix(fpga): add ternary_encoding.rs (Closes #409)
Apr 14, 2026
df2d92c
docs(now): update date to 2026-04-14, add CI fixes note (Closes #409)
Apr 14, 2026
d8efcb3
fix(ci): skip merge commits in L1 TRACEABILITY check
Apr 14, 2026
8362b59
fix(ci): check full commit message for issue references (Closes #409)
Apr 14, 2026
e154069
fix(ci): L2 check only flag modified files, not new additions (Closes…
Apr 14, 2026
319ad7a
temp: save work before moving to dev
Apr 14, 2026
237a57f
merge: resolve conflicts, keep temp-save-work versions
Apr 14, 2026
2160e22
GitButler Workspace Commit
gitbutler-client Apr 14, 2026
ef2f83e
restore: apply stash@{49} - oldest stash
Apr 14, 2026
29cc428
restore: stash@{48}
Apr 14, 2026
71b955d
restore: stash@{46}
Apr 14, 2026
2c432ca
restore: stash@{45}
Apr 14, 2026
b512fc5
restore: stash@{44}
Apr 14, 2026
76e4680
restore: stash@{43}
Apr 14, 2026
bc6102b
restore: stash@{41}
Apr 14, 2026
0bb24fd
restore: stash@{39}
Apr 14, 2026
cf16377
restore: stash@{38}
Apr 14, 2026
1ee7f20
restore: stash@{36}
Apr 14, 2026
88a6c2c
restore: stash@{34}
Apr 14, 2026
287dd36
restore: stash@{32}
Apr 14, 2026
edb50d6
restore: stash@{31}
Apr 14, 2026
599ffe9
restore: stash@{28}
Apr 14, 2026
576dc2a
restore: stash@{26}
Apr 14, 2026
feb3395
restore: stash@{24}
Apr 14, 2026
9ce3bd9
restore: stash@{23}
Apr 14, 2026
9db596a
restore: stash@{22}
Apr 14, 2026
1b363ba
restore: stash@{21}
Apr 14, 2026
00c5139
restore: stash@{20}
Apr 14, 2026
319fe20
restore: stash@{19}
Apr 14, 2026
fd0a6fe
restore: stash@{18}
Apr 14, 2026
33c25f6
restore: stash@{16}
Apr 14, 2026
d06b939
restore: stash@{14}
Apr 14, 2026
8995fd2
restore: stash@{13}
Apr 14, 2026
c365ede
restore: stash@{12}
Apr 14, 2026
35d79f6
restore: stash@{6}
Apr 14, 2026
c8bab11
restore: stash@{5}
Apr 14, 2026
36ad20c
restore: stash@{4}
Apr 14, 2026
44c5360
restore: stash@{2}
Apr 14, 2026
7a70b14
restore: stash@{23}
Apr 14, 2026
0a4e84e
restore: stash@{0}
Apr 14, 2026
b67fd75
restore: stash@{1}
Apr 14, 2026
970c803
restore: stash@{2}
Apr 14, 2026
e60f8c8
restore: stash@{4}
Apr 14, 2026
013911b
restore: stash@{5}
Apr 14, 2026
dc93b8a
restore: stash@{6}
Apr 14, 2026
f4650b8
restore: stash@{7}
Apr 14, 2026
6c2d86e
restore: stash@{9}
Apr 14, 2026
8228c66
restore: stash@{10}
Apr 14, 2026
ea11868
restore: stash@{11}
Apr 14, 2026
6b5e9fe
restore: stash@{12}
Apr 14, 2026
1dd7b13
restore: stash@{13}
Apr 14, 2026
8f2fd2f
restore: stash@{14}
Apr 14, 2026
6745e73
restore: stash@{16}
Apr 14, 2026
37f144f
restore: stash@{17}
Apr 14, 2026
24a58eb
restore: stash@{18}
Apr 14, 2026
70787a1
feat(scripts): add PSLQ verification via Ramanujan API v1 (Closes #999)
Apr 14, 2026
291410b
дальше!!
Apr 14, 2026
91653d2
fix(bootstrap): restore working main.rs — recovery from detached HEAD…
gHashTag Apr 18, 2026
6249a3a
chore: sync .trinity tracking from feat/typescript-codegen-525
Apr 18, 2026
3879a12
chore: sync .trinity tracking from TypeScript codegen
Apr 18, 2026
979d1f4
chore: tracking update post-PR #529
Apr 18, 2026
db181d1
chore(now): update NOW.md to 2026-04-19 state
Apr 18, 2026
fb63feb
feat(compiler): add Zig, C, Verilog codegen backends to meta_compile …
gHashTag Apr 18, 2026
1513024
fix(build): regenerate Cargo.lock, fix compiler.rs syntax error
Apr 18, 2026
40035d3
fix(compiler): add missing emit_rust() to meta_compile spec on dev
gHashTag Apr 18, 2026
c539af3
fix(build): restore bootstrap compiler build
Apr 18, 2026
33bb046
fix(bootstrap): complete modular compiler refactor — restore working …
Apr 18, 2026
3ae5d52
feat(compiler): add GF16-native Rust codegen backend to meta_compile …
Apr 18, 2026
45b85d8
feat(memory): add native remember/recall/forget primitives (Issue #51…
Apr 18, 2026
fda2805
docs(memory): add Phase 0 experience log (Closes #517)
Apr 19, 2026
850e96b
feat(compiler): complete all 5 backend codegen in meta_compile.t27
Apr 18, 2026
4cc415b
Merge pull request #524 from gHashTag/fix/ring-018-mainrs-only
gHashTag Apr 19, 2026
d2d0105
feat(memory): Phase 1 — Rust memory store backend (Closes #517)
Apr 19, 2026
ee12e8a
docs(memory): Phase 1 experience log — Rust store backend (Closes #517)
Apr 19, 2026
f7e4442
docs(ring-32): PHI LOOP sealed — cloud orchestration complete (Closes…
Apr 19, 2026
ce04b04
docs: add architecture specification for T27 ↔ Zig ecosystem
Apr 19, 2026
9886b22
Merge master into feat/phi-bias-full-family
Apr 29, 2026
fea597c
fix: take master versions for NOW.md and .legacy-non-english-docs
Apr 29, 2026
0280dc0
Merge remote-tracking branch 'origin/master' into feat/phi-bias-full-…
Apr 29, 2026
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
84 changes: 84 additions & 0 deletions .claude/mcp/tri-ssot/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"name": "tri-ssot",
"description": "SSOT Integration for t27: GitHub Issues + PRs + Documentation → NotebookLM",
"version": "1.0.0",
"executable": {
"command": "python3",
"args": ["-m", "contrib.backend.github.mcp_server"]
},
"tools": [
{
"name": "tri_issue",
"description": "GitHub Issue management: create, update, list, close",
"inputSchema": {
"type": "object",
"properties": {
"action": {
"type": "string",
"enum": ["create", "update", "list", "close", "get"]
},
"title": {"type": "string"},
"body": {"type": "string"},
"labels": {"type": "string"},
"issue_id": {"type": "string"},
"state": {"type": "string", "enum": ["open", "in_progress", "closed"]}
}
}
},
{
"name": "tri_pr",
"description": "GitHub PR management: create, merge, close, get status",
"inputSchema": {
"type": "object",
"properties": {
"action": {
"type": "string",
"enum": ["create", "merge", "close", "get"]
},
"title": {"type": "string"},
"body": {"type": "string"},
"pr_id": {"type": "string"},
"issue_id": {"type": "string"}
}
}
},
{
"name": "tri_docs",
"description": "Documentation management: upload to NotebookLM, sync, query",
"inputSchema": {
"type": "object",
"properties": {
"action": {
"type": "string",
"enum": ["upload", "sync", "query"]
},
"file_path": {"type": "string"},
"title": {"type": "string"}
}
}
},
{
"name": "tri_sync",
"description": "Unified sync: sync all entities (issues, prs, docs) with NotebookLM",
"inputSchema": {
"type": "object",
"properties": {
"scope": {
"type": "string",
"enum": ["all", "issues", "prs", "docs"]
}
}
}
},
{
"name": "tri_search",
"description": "Unified search across GitHub Issues, PRs, NotebookLM docs",
"inputSchema": {
"type": "object",
"properties": {
"query": {"type": "string"}
}
}
}
]
}
110 changes: 110 additions & 0 deletions .claude/plans/replicated-finding-plum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Issue: Full meta_compile.t27 Implementation

## Context

The `specs/compiler/meta_compile.t27` specification was added with PRs #529 and #531, defining a multi-backend compilation system with 5 target backends (Zig, C, Verilog, Rust, TypeScript). However, the current implementations are just stub functions that count newlines - they don't actually generate working code for any backend.

**Problem**: The spec exists but has no functional implementation. Bootstrap codegen doesn't integrate with `meta_compile.t27` at all.

## Current State

**In `specs/compiler/meta_compile.t27`:**
- ✅ `CompileResult` struct with all 5 backend fields
- ✅ Stub implementations: `emit_zig()`, `emit_c()`, `emit_verilog()`, `emit_rust()`, `emit_typescript()`
- ✅ Helper functions: `is_full_success()`, `total_lines()`, `any_backend_ok()`
- ✅ 36 tests and invariants

**In `gen/compiler/` (generated output):**
- ✅ `meta_compile.zig` - Zig stub (line-counting only)
- ✅ `meta_compile.c` - C stub (line-counting only)
- ✅ `meta_compile.v` - Verilog stub (line-counting only)

**In `bootstrap/`:**
- ❌ No integration with `meta_compile.t27` spec
- ❌ Existing `emit_verilog()` in `compiler.rs` is for testbench emission, unrelated to spec
- ❌ No TypeScript or Rust code generation for `meta_compile` spec

## Implementation Plan

### Phase 1: Design Real Codegen Architecture
1. Review existing parser and AST structures in `bootstrap/src/compiler.rs`
2. Define codegen patterns for each backend target
3. Design integration point between parser output and multi-backend codegen

### Phase 2: Implement Target-Specific Codegen

#### 2.1 Zig Backend
- Implement actual Zig code emission from T27 AST
- Generate syntactically valid Zig code for:
- Module declarations
- Function declarations with T27 types (φ, u32, i32, etc.)
- Expression statements (literals, calls, arithmetic, logic)
- Control flow (if, while, for)
- φ arithmetic operations

#### 2.2 C Backend
- Implement C code emission from T27 AST
- Map T27 types to C types (φ → `uint16_t`, i32 → `int32_t`, etc.)
- Generate valid C code for all AST node types

#### 2.3 Verilog Backend
- Implement Verilog code emission for hardware target
- Map T27 constructs to Verilog (modules, wires, regs, always blocks)
- Generate testbench-compatible output

#### 2.4 Rust Backend
- Implement Rust code emission from T27 AST
- Map T27 types to Rust types
- Generate valid Rust with proper type annotations

#### 2.5 TypeScript Backend
- Implement TypeScript code emission for web/browser target
- Map T27 types to TS types (φ → `number`, i32 → `number`, etc.)
- Generate valid TypeScript declarations and functions

### Phase 3: Bootstrap Integration
1. Add `meta_compile` module integration to `bootstrap/src/compiler.rs`
2. Wire parser output to `meta_compile` backends
3. Add CLI flags for target backend selection
4. Add `--all-backends` flag to compile to all targets

### Phase 4: Testing
1. Run existing `tri test` suite for `meta_compile.t27`
2. Add integration tests for generated code compilation
3. Verify generated Zig/C/Verilog/Rust/TypeScript actually compiles

### Phase 5: Documentation
1. Update `docs/NOW.md` with issue closure
2. Document multi-backend usage in README
3. Add examples showing cross-compilation to different targets

## Critical Files

**Spec:**
- `/Users/playra/t27/specs/compiler/meta_compile.t27`

**Bootstrap (to modify):**
- `/Users/playra/t27/bootstrap/src/compiler.rs` - Add meta_compile integration
- `/Users/playra/t27/bootstrap/src/main.rs` - Add CLI flags for backend selection

**Generated (verify after tri gen):**
- `/Users/playra/t27/gen/compiler/meta_compile.zig`
- `/Users/playra/t27/gen/compiler/meta_compile.c`
- `/Users/playra/t27/gen/compiler/meta_compile.v`
- `/Users/playra/t27/gen/compiler/meta_compile.rs` (to be created)
- `/Users/playra/t27/gen/compiler/meta_compile.ts` (to be created)

## Verification

1. Run `./scripts/tri gen compiler/meta_compile.t27` to generate code
2. Run `./scripts/tri test compiler/meta_compile.t27` to verify conformance
3. Manually test: compile a simple T27 module to each backend
4. Verify generated Zig/C/Verilog/Rust/TypeScript files compile with their respective compilers
5. Close issue with `Closes #<issue>` in commit message

## Notes

- This is a multi-hour task involving both spec updates and bootstrap changes
- The existing stub implementations in `meta_compile.t27` should be replaced with real codegen logic
- Bootstrap needs new CLI options for backend targeting
- Consider making backends pluggable for future targets (e.g., WASM, Python)
189 changes: 189 additions & 0 deletions .claude/skills/tri/skill.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,77 @@ tri wrapup --summary "completed <task>" \
- "known issues with <spec>" — Find blockers
- "architecture of <component>" — Get design context

<<<<<<< Updated upstream
## MANDATORY WORKFLOW: Start Task Before Pushing

**L7 UNITY Requirement:** Every push to the repository must have an active NotebookLM notebook.

<<<<<<< Updated upstream
```bash
=======
```
>>>>>>> Stashed changes
# Step 1: ALWAYS start a task before beginning work
t27c bridge task start --title "Your task description"

# This creates:
# - .trinity/current_task/.notebook_id (tracked in git)
# - .trinity/current_task/notebook_meta.json
# - A new NotebookLM notebook linked to your session

# Step 2: Do your work (PHI LOOP, edits, commits, etc.)

# Step 3: Push (gate will check for notebook)
git push # Succeeds only if .notebook_id exists and is valid
```

**Alternative: Attach existing notebook**

<<<<<<< Updated upstream
```bash
=======
```
>>>>>>> Stashed changes
t27c bridge task attach --notebook_id "abc123def456"
```

**Check current task status**

<<<<<<< Updated upstream
```bash
=======
```
>>>>>>> Stashed changes
t27c bridge task status
```

**Verify notebook is valid**

<<<<<<< Updated upstream
```bash
=======
```
>>>>>>> Stashed changes
t27c bridge task verify
```

**Emergency bypass (NOT recommended)**

<<<<<<< Updated upstream
```bash
=======
```
>>>>>>> Stashed changes
SKIP_NOTEBOOK_GATE=1 git push
# Bypass is logged to .trinity/gate_bypasses.log
```

**Branch Protection Rule (to be configured):**
- Required status check: "NotebookLM Gate / 🔒 NotebookLM notebook required"
- Require branches to be up to date before merging: YES
- Include administrators: YES

<<<<<<< Updated upstream
## /tri wrapup

Automatic session wrap-up with NotebookLM upload. This is the canonical way to end a session and preserve context for future agents.
Expand Down Expand Up @@ -222,6 +293,124 @@ t27 #343 — Restore phi-loop-ci.yml
t27 #350 — NotebookLM Integration
└─ Source 1: "Session 2026-04-08 17:00 — Spec creation"
└─ Source 2: "Session 2026-04-08 18:00 — Backend impl"
=======
## tri task — Task Notebook Management (via t27c bridge)

Quick NotebookLM commands for notebook management:

```bash
# Create a new notebook
t27c bridge nb create --title "Sprint 9: NeurIPS"

# List all notebooks
t27c bridge nb list

# Add a file as source to current notebook
t27c bridge nb add --file path/to/file.md

# Query current notebook with prompt
t27c bridge nb query --prompt "что сделано вчера?"

# Upload activity.md to notebook
t27c bridge nb upload-log

# Link current notebook to GitHub issue
t27c bridge nb link --issue 370
```

**Configuration:**
- Backend: `contrib/backend/notebooklm/` (Playwright-based)
- Storage: `~/.notebooklm/storage_state.json`
- Auth: Cookie-based via `notebooklm login` CLI
- Python: `python3.10` (where `notebooklm-py` is installed)

**MCP Integration:**
- Server: `notebooklm-mcp` (installed via `npm install -g notebooklm-mcp`)
- Config: `.claude/mcp.json`
- Claude Code can directly create notebooks, upload sources, and query with Gemini citations

**Bulk Creation:**
```bash
# Create notebooks for all open issues
scripts/bulk-create-notebooks.sh
>>>>>>> Stashed changes
=======
## Task Notebook Management (L7 UNITY Enforcement)

**MANDATORY:** Every task must have a NotebookLM notebook assigned before pushing code.

### Starting a New Task

```bash
# Initialize task with a new notebook
t27c task start --title "Implement feature X" --sources "specs/*.t27,README.md"

# This creates:
# - A NotebookLM notebook with the given title
# - .trinity/current_task/.notebook_id (tracked in git)
# - .trinity/current_task/notebook_meta.json

# Then proceed with PHI LOOP work
tri notebook query "status of feature X" # Check existing work
tri spec edit <module>
# ... rest of PHI LOOP ...
```

### Attaching Existing Notebook

```bash
# Use an existing notebook if one already exists for this work
t27c task attach --notebook-id "existing-notebook-id"
```

### Checking Task Status

```bash
# Show current task notebook status
t27c task status

# Output shows:
# - Notebook ID and URL
# - Task title
# - Branch
# - Sources count
```

### Verifying Notebook Gate

```bash
# Verify notebook gate requirement is satisfied (called by pre-push hook)
t27c task verify
```

### Mandatory Workflow Order

1. **Before starting work:** Query NotebookLM to avoid duplication
```bash
tri notebook query "status of <task>"
```

2. **Initialize task:** Create notebook if starting new work
```bash
t27c task start --title "task description"
```

3. **Execute PHI LOOP:** tri spec edit, tri gen, tri test, etc.

4. **After completing work:** Upload wrap-up
```bash
tri notebook wrapup --summary "completed <task>" --decisions "..." --files "..." --next "..."
```

5. **Git push:** Pre-push hook verifies .notebook_id exists
```bash
git push # Blocked if no valid notebook
```

**Emergency Bypass** (logged to `.trinity/gate_bypasses.log`):
```bash
SKIP_NOTEBOOK_GATE=1 git push
>>>>>>> Stashed changes
```

## Standard /tri Status Output
Expand Down
Loading
Loading