Skip to content
Draft
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
21 changes: 21 additions & 0 deletions crates/trios-sacred/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# AGENTS.md — trios-sacred

> AAIF-compliant | MCP-compatible

- Crate: trios-sacred (Gold)
- Repo: gHashTag/trios

## Ring map

| Ring | Package | Role |
|------|---------|------|
| SC-00 | trios-sacred-sc00 | geometry primitives |
| SC-01 | trios-sacred-sc01 | sacred ratios |
| BR-OUTPUT | trios-sacred-br-output | assembly |

## Rules

- L-ARCH-001 future logic in rings/
- R9: no sibling imports
- L6: pure Rust
- Anchor: phi^2 + phi^-2 = 3
44 changes: 44 additions & 0 deletions crates/trios-sacred/RING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# RING — trios-sacred (Gold Crate)

## Identity

| Field | Value |
|-------|-------|
| Metal | 🥇 Gold |
| Type | Crate |
| Sealed | No |

## Purpose

Sacred geometry primitives — geometric shapes anchored on phi, and ratio
helpers (golden ratio, sqrt(2), sqrt(3), pi). Foundational for
trinity-aligned spatial reasoning.

## Ring Structure (L-ARCH-001)

```
crates/trios-sacred/
├── src/lib.rs ← preserved (FFI to zig-sacred-geometry)
└── rings/
├── SC-00/ ← geometry primitives (Vec2, Triangle, Circle)
├── SC-01/ ← sacred ratios (phi, sqrt2, sqrt3, pi)
└── BR-OUTPUT/ ← assembly + router
```

## Dependency Flow

```
BR-OUTPUT
SC-01 → SC-00
```

R9: rings cannot import siblings.

## Laws

- L-ARCH-001: Future logic in `rings/`
- R1–R5: Ring Isolation
- R9: No sibling imports
- L6: Pure Rust only
- Anchor: `phi^2 + phi^-2 = 3`
3 changes: 3 additions & 0 deletions crates/trios-sacred/rings/BR-OUTPUT/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# AGENTS.md — BR-OUTPUT (trios-sacred)

May import SC-00, SC-01. L6: pure Rust.
22 changes: 22 additions & 0 deletions crates/trios-sacred/rings/BR-OUTPUT/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions crates/trios-sacred/rings/BR-OUTPUT/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "trios-sacred-br-output"
version = "0.1.0"
edition = "2021"
authors = ["Dmitrii Vasilev"]
license = "MIT"
description = "BR-OUTPUT — assembly for trios-sacred"
publish = false

[dependencies]
trios-sacred-sc00 = { path = "../SC-00" }
trios-sacred-sc01 = { path = "../SC-01" }

[workspace]
3 changes: 3 additions & 0 deletions crates/trios-sacred/rings/BR-OUTPUT/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# BR-OUTPUT — trios-sacred

Re-exports SC-00 + SC-01.
3 changes: 3 additions & 0 deletions crates/trios-sacred/rings/BR-OUTPUT/RING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# RING — BR-OUTPUT (trios-sacred)

Top of ring graph. Imports SC-00, SC-01.
8 changes: 8 additions & 0 deletions crates/trios-sacred/rings/BR-OUTPUT/TASK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# TASK — BR-OUTPUT (trios-sacred)

## Status: SCAFFOLDED
- [x] Re-export SC-00, SC-01
- [x] `Sacred::anchor()`

## Open
- [ ] MCP tools
28 changes: 28 additions & 0 deletions crates/trios-sacred/rings/BR-OUTPUT/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//! BR-OUTPUT — trios-sacred assembly

pub use trios_sacred_sc00::{Circle, Triangle, Vec2};
pub use trios_sacred_sc01::{scale_phi, PHI, PI, SQRT2, SQRT3};

pub struct Sacred;

impl Sacred {
pub const fn anchor() -> f64 {
3.0
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn anchor_const() {
assert_eq!(Sacred::anchor(), 3.0);
}

#[test]
fn rings_link() {
let v = scale_phi(Vec2::new(1.0, 1.0));
assert!((v.x - PHI).abs() < 1e-12);
}
}
7 changes: 7 additions & 0 deletions crates/trios-sacred/rings/SC-00/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# AGENTS.md — SC-00

- Ring: SC-00
- Package: trios-sacred-sc00
- R1: no imports from SC-01, BR-OUTPUT
- R9: no sibling imports
- L6: pure Rust
7 changes: 7 additions & 0 deletions crates/trios-sacred/rings/SC-00/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions crates/trios-sacred/rings/SC-00/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "trios-sacred-sc00"
version = "0.1.0"
edition = "2021"
authors = ["Dmitrii Vasilev"]
license = "MIT"
description = "SC-00 — sacred geometry primitives"
publish = false

[workspace]
9 changes: 9 additions & 0 deletions crates/trios-sacred/rings/SC-00/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SC-00 — sacred geometry primitives

Bottom of the ring graph for trios-sacred.

## API

- `Vec2 { x, y }` with `dot`
- `Triangle([Vec2; 3])`
- `Circle { center, radius }`
11 changes: 11 additions & 0 deletions crates/trios-sacred/rings/SC-00/RING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# RING — SC-00 (trios-sacred)

| Metal | 🥈 Silver |
| Package | trios-sacred-sc00 |

Geometry primitives. Bottom of dependency graph.

## Laws
- R1: no SC-01/BR-OUTPUT
- R9: no sibling imports
- L6: pure Rust
12 changes: 12 additions & 0 deletions crates/trios-sacred/rings/SC-00/TASK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# TASK — SC-00

## Status: SCAFFOLDED

## Completed
- [x] Vec2, Triangle, Circle
- [x] dot product test

## Open
- [ ] Migrate from `crates/trios-sacred/src/sacred/`
- [ ] Add Pentagon (phi-anchored)
- [ ] Add Hexagon, Vesica Piscis
40 changes: 40 additions & 0 deletions crates/trios-sacred/rings/SC-00/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//! SC-00 — sacred geometry primitives
//!
//! Bottom of the ring graph for trios-sacred.

#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Vec2 {
pub x: f64,
pub y: f64,
}

impl Vec2 {
pub const fn new(x: f64, y: f64) -> Self {
Self { x, y }
}

pub fn dot(self, other: Vec2) -> f64 {
self.x * other.x + self.y * other.y
}
}

#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Triangle(pub [Vec2; 3]);

#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Circle {
pub center: Vec2,
pub radius: f64,
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn vec2_dot() {
let a = Vec2::new(1.0, 0.0);
let b = Vec2::new(0.0, 1.0);
assert_eq!(a.dot(b), 0.0);
}
}
7 changes: 7 additions & 0 deletions crates/trios-sacred/rings/SC-01/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# AGENTS.md — SC-01

- Package: trios-sacred-sc01
- R1: no BR-OUTPUT imports
- R9: no sibling imports
- May import SC-00 only
- L6: pure Rust
14 changes: 14 additions & 0 deletions crates/trios-sacred/rings/SC-01/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions crates/trios-sacred/rings/SC-01/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "trios-sacred-sc01"
version = "0.1.0"
edition = "2021"
authors = ["Dmitrii Vasilev"]
license = "MIT"
description = "SC-01 — sacred ratios (phi, sqrt2, sqrt3, pi)"
publish = false

[dependencies]
trios-sacred-sc00 = { path = "../SC-00" }

[workspace]
3 changes: 3 additions & 0 deletions crates/trios-sacred/rings/SC-01/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SC-01 — sacred ratios

phi, sqrt2, sqrt3, pi. Depends on SC-00 for `Vec2` scaling.
11 changes: 11 additions & 0 deletions crates/trios-sacred/rings/SC-01/RING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# RING — SC-01

Sacred ratios (phi, sqrt2, sqrt3, pi).

## Dependencies
- SC-00

## Laws
- R1: no BR-OUTPUT
- R9: no sibling imports
- L6: pure Rust
12 changes: 12 additions & 0 deletions crates/trios-sacred/rings/SC-01/TASK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# TASK — SC-01

## Status: SCAFFOLDED

## Completed
- [x] PHI, SQRT2, SQRT3, PI
- [x] scale_phi
- [x] phi anchor test

## Open
- [ ] Migrate phi-engine from legacy `src/phi-engine/`
- [ ] Add Beal-conjecture search helpers from FFI
32 changes: 32 additions & 0 deletions crates/trios-sacred/rings/SC-01/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//! SC-01 — sacred ratios
//!
//! phi (golden ratio), sqrt(2), sqrt(3), pi.

use trios_sacred_sc00::Vec2;

pub const PHI: f64 = 1.618_033_988_749_894_8;
pub const SQRT2: f64 = std::f64::consts::SQRT_2;
pub const SQRT3: f64 = 1.732_050_807_568_877_2;
pub const PI: f64 = std::f64::consts::PI;

/// Scale a Vec2 by phi.
pub fn scale_phi(v: Vec2) -> Vec2 {
Vec2::new(v.x * PHI, v.y * PHI)
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn phi_anchor() {
let lhs = PHI * PHI + (1.0 / PHI) * (1.0 / PHI);
assert!((lhs - 3.0).abs() < 1e-12);
}

#[test]
fn scale_phi_works() {
let v = scale_phi(Vec2::new(1.0, 0.0));
assert!((v.x - PHI).abs() < 1e-12);
}
}
Loading