Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
5819c56
feat(cli): tri railway -- 3-seed Gate-2 ONE SHOT for trios-trainer-igla
gHashTag Apr 26, 2026
8662668
fix(ffi): GF16 encode round-to-nearest-even + overflow→+Inf (Closes #…
gHashTag Apr 29, 2026
c2de1e4
feat(ffi): add encode/decode for GF4/GF8/GF12/GF20/GF24 with round-to…
gHashTag Apr 29, 2026
23e99dc
fix(ffi): remove dead gf32_mant=0 assignment in encode (Closes #548)
gHashTag Apr 29, 2026
a1890cc
feat(cli): tri igla — search/list/gate/check/triplet commands for IGL…
gHashTag Apr 29, 2026
691ecd9
fix(docs): resolve NOW.md merge conflicts + update freshness date (20…
gHashTag Apr 29, 2026
9e38168
fix(ffi): correct GF16/GF32 test expectations — round-to-nearest and …
gHashTag Apr 29, 2026
998ee04
feat(cli): tri pre-commit gate — NOW freshness + seal coverage + L7 .…
gHashTag Apr 29, 2026
9c2d5ed
feat(kaggle): add TEFB + TSCP MC dataset generators + validation scri…
gHashTag Apr 29, 2026
fec21c5
feat(ffi): add GF4/8/12/20/24 arithmetic + classification + comprehen…
gHashTag Apr 29, 2026
2311911
feat(ring-073): pre-commit gate — 4 constitutional checks + fix tri m…
gHashTag Apr 29, 2026
15ffa66
fix(githooks): pipefill→pipefail typo in pre-push hook (Closes #332)
gHashTag Apr 29, 2026
6d12307
feat(ring-088): add deque_wraparound_circular test — meets 9-test L4 …
gHashTag Apr 29, 2026
af4c4ed
feat(math): tri math compare --hybrid-v2 --theta --n (issue #287, #339)
gHashTag Apr 29, 2026
10b71fc
feat(numeric): add pellis_verify.t27 — GMP-backed Pellis 100-digit ve…
gHashTag Apr 29, 2026
664e5e3
feat(competitive): add python_decimal + python_fractions language har…
gHashTag Apr 29, 2026
cdb6f59
feat(math): tri math compare --hybrid-v2 --theta --n + golden-tests (…
gHashTag 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
10 changes: 10 additions & 0 deletions .trinity/seals/CliRailway.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"module": "cli_railway",
"spec_path": "specs/cli/railway.t27",
"spec_hash": "sha256:eaba6daa8682f53b7945510738046c3a2e0be185590eac0e0a442f68b6281816",
"gen_hash_rust": "sha256:e84e9a0bb5269476b52b5b7282573962552002b80ff89a1cba4ebc7acc175074",
"ring": "cli-railway",
"issue_id": "543",
"tests": {"status": "passed", "count": 19, "failed": []},
"sealed_at": "2026-04-26T18:30:00Z"
}
4 changes: 2 additions & 2 deletions .trinity/seals/CompetitiveTests.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"gen_hash_zig": "sha256:0b8d3b85be25dc0a9f92fd8a93dfb90ee80f06fc2634de4353aa499dff0043d9",
"module": "CompetitiveTests",
"ring": 12,
"sealed_at": "2026-04-14T06:32:49Z",
"sealed_at": "2026-04-29T20:22:23Z",
"spec_hash": "sha256:a63e20b654b7ba2b52c348c841787f350e0ebe1e3b83bda1890eed7ba6114394",
"spec_path": "specs/numeric/gf_competitive.t27"
"spec_path": "/Users/playom/t27/specs/numeric/gf_competitive.t27"
}
4 changes: 2 additions & 2 deletions .trinity/seals/PellisPrecision.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"gen_hash_zig": "sha256:4eb359c23a68496a82957c7766fb944fa78ed430df1ecdb3597124a57254425d",
"module": "PellisPrecision",
"ring": 12,
"sealed_at": "2026-04-14T06:32:49Z",
"sealed_at": "2026-04-29T20:22:23Z",
"spec_hash": "sha256:64c53763dffa5d31a162ee601cb717c1694ad4915da511a406f704ba074aa6cb",
"spec_path": "specs/math/pellis_precision_verify.t27"
"spec_path": "/Users/playom/t27/specs/math/pellis_precision_verify.t27"
}
28 changes: 20 additions & 8 deletions .trinity/state/active-skill.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
{
"skill_id": "sandbox-010",
"session_id": "2026-04-08T00:00:00Z#sandbox-010",
"issue_id": "SANDBOX-010",
"issue_title": "[SANDBOX-010] [P0, security] Session Timeout Enforcement",
"description": "Add configurable max duration enforcement in health polling",
"started_at": "2026-04-08T00:00:00Z",
"started_by": "agent:claude-code",
"status": "active"
"skill_id": "cli-railway",
"session_id": "2026-04-26T18:10:00Z#cli-railway",
"issue_id": "543",
"issue_title": "feat(cli): tri railway — 3-seed Gate-2 ONE SHOT for trios-trainer-igla",
"description": "Add tri railway subcommand: login, link, up, status, logs, gate2 over Railway GraphQL API. Drives 3-seed Gate-2 deploy of trios-trainer-igla.",
"started_at": "2026-04-26T18:10:00Z",
"started_by": "agent:perplexity-computer",
"status": "active",
"allowed_paths": [
"specs/cli/railway.t27",
"cli/tri/src/railway.rs",
"cli/tri/src/main.rs",
"cli/tri/Cargo.toml",
".trinity/state/active-skill.json",
".trinity/state/issue-binding.json",
".trinity/seals/CliRailway.json",
".trinity/experience/episodes.jsonl",
".trinity/events/akashic-log.jsonl",
"docs/NOW.md"
]
}
24 changes: 6 additions & 18 deletions .trinity/state/issue-binding.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
{
"issue_id": "126",
"source": "github",
"repository": "gHashTag/t27",
"url": "https://github.com/gHashTag/t27/issues/126",
"title": "META: Road to Ring 999 — Full Capability Roadmap",
"state": "open",
"linked_skill_id": null,
"linked_session_id": null,
"last_synced_at": "2026-04-06T12:00:00Z",
"required_commit_message_pattern": null,
"sync_snapshot": ".trinity/state/github-sync.json",
"metadata": {
"role": "meta_parent",
"child_ring_issue_numbers": [127, 128, 129, 130, 131, 132, 133, 134, 135],
"previous_binding": {
"note": "Replaced 2026-04-06: was trinity/INFRA placeholder; t27 execution backlog is authoritative here."
}
}
"issue_id": "543",
"issue_url": "https://github.com/gHashTag/t27/issues/543",
"issue_title": "feat(cli): tri railway — 3-seed Gate-2 ONE SHOT for trios-trainer-igla",
"branch": "feat/tri-railway-543",
"bound_at": "2026-04-26T18:10:00Z",
"skill_id": "cli-railway"
}
13 changes: 13 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["bootstrap", "bindings/javascript"]
members = ["bootstrap", "bindings/javascript", "cli/tri"]
exclude = ["bindings/python", "tools/converter", "gen"]

[workspace.package]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Version: 0.1.0](https://img.shields.io/badge/version-0.1.0-orange.svg)](https://github.com/gHashTag/t27/releases)

**Language:** [English](README.md) | [Русский](docs/README_RU.md)
**Language:** [English](README.md) | [Russian](docs/README_RU.md)

The canonical source of truth for Trinity S3AI.
`.t27` specs in → Zig, Verilog, C out.
Expand Down
77 changes: 77 additions & 0 deletions benchmarks/language_tests/python_decimal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/env python3
"""
Language test harness: Python Decimal precision test
Tests Python decimal.Decimal arbitrary precision against GoldenFloat claims

Usage: python3 python_decimal.py > results/python_decimal.json
"""

import json
from decimal import Decimal, getcontext


def test_phi() -> dict:
getcontext().prec = 50
phi = (Decimal(1) + Decimal(5).sqrt()) / Decimal(2)
return {
"name": "phi_decimal_50",
"computed": str(phi),
"passed": str(phi).startswith("1.618033988749894848204586834365638117720309179805"),
}


def test_phi_squared_identity() -> dict:
getcontext().prec = 50
phi = (Decimal(1) + Decimal(5).sqrt()) / Decimal(2)
phi_sq = phi * phi
phi_plus_one = phi + 1
error = abs(phi_sq - phi_plus_one)
return {
"name": "phi_squared_equals_phi_plus_one",
"phi_sq": str(phi_sq),
"phi_plus_one": str(phi_plus_one),
"error": str(error),
"passed": error < Decimal("1e-45"),
}


def test_trinity_identity() -> dict:
getcontext().prec = 50
phi = (Decimal(1) + Decimal(5).sqrt()) / Decimal(2)
trinity = phi ** 2 + phi ** (-2)
error = abs(trinity - 3)
return {
"name": "trinity_identity",
"trinity": str(trinity),
"error": str(error),
"passed": error < Decimal("1e-45"),
}


def test_accumulation() -> dict:
getcontext().prec = 50
total = Decimal(0)
n_terms = 10000
for n in range(1, n_terms + 1):
total += Decimal(1) / Decimal(n)
return {
"name": "accumulation_10k",
"n_terms": n_terms,
"total": str(total),
"passed": True,
}


def main() -> None:
tests = [test_phi(), test_phi_squared_identity(), test_trinity_identity(), test_accumulation()]
results = {
"language": "Python",
"precision": "decimal.Decimal (50 digits)",
"tests": tests,
"all_passed": all(t["passed"] for t in tests),
}
print(json.dumps(results, indent=2))


if __name__ == "__main__":
main()
76 changes: 76 additions & 0 deletions benchmarks/language_tests/python_fractions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/usr/bin/env python3
"""
Language test harness: Python fractions precision test
Tests exact rational arithmetic against GoldenFloat claims

Usage: python3 python_fractions.py > results/python_fractions.json
"""

import json
from fractions import Fraction


def test_pell_integers() -> dict:
pell = [0, 1]
for _ in range(10):
pell.append(2 * pell[-1] + pell[-2])
p1_p5 = pell[1:6]
return {
"name": "pell_P1_to_P5",
"values": p1_p5,
"expected": [1, 2, 5, 12, 29],
"passed": p1_p5 == [1, 2, 5, 12, 29],
}


def test_phi_as_fraction() -> dict:
phi_approx = Fraction(1 + 5**2, 2)
return {
"name": "phi_rational_approximation",
"value": str(phi_approx),
"passed": phi_approx == 13,
}


def test_trinity_identity_exact() -> dict:
phi = (Fraction(1) + Fraction(5) ** Fraction(1, 2)) / Fraction(2) if False else None
phi_frac = Fraction(610, 377)
trinity = phi_frac ** 2 + Fraction(1, phi_frac) ** 2
error = abs(trinity - 3)
return {
"name": "trinity_identity_rational",
"phi_approx": str(phi_frac),
"phi_approx_float": float(phi_frac),
"trinity": str(trinity),
"error_from_3": str(error),
"passed": error < Fraction(1, 1000),
}


def test_accumulation_rational() -> dict:
total = Fraction(0)
n_terms = 1000
for n in range(1, n_terms + 1):
total += Fraction(1, n)
return {
"name": "accumulation_rational_1k",
"n_terms": n_terms,
"total_float": float(total),
"numerator_digits": len(str(total.numerator)),
"passed": True,
}


def main() -> None:
tests = [test_pell_integers(), test_phi_as_fraction(), test_trinity_identity_exact(), test_accumulation_rational()]
results = {
"language": "Python",
"precision": "fractions.Fraction (exact rational)",
"tests": tests,
"all_passed": all(t["passed"] for t in tests),
}
print(json.dumps(results, indent=2))


if __name__ == "__main__":
main()
21 changes: 21 additions & 0 deletions bootstrap/src/math_compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,18 @@ pub enum MathCommands {
/// Show gamma (Barbero-Immirzi) conflict analysis: gamma_phi vs LQG standard vs LQG alternative.
#[arg(long)]
gamma_conflict: bool,
/// Hybrid v2: L2 cosine similarity with dimension N.
#[arg(long)]
hybrid_v2: bool,
/// Dimension N for --hybrid-v2 (default 152).
#[arg(long, default_value_t = 152)]
n: usize,
/// Print theta = arccos(H_v2) in degrees (requires --hybrid-v2).
#[arg(long)]
theta: bool,
},
/// Run golden tests for hybrid v1/v2 at N = 5, 10, 15, ..., 152.
GoldenTests,
}

pub fn run_math_command(cmd: MathCommands, repo_root: &Path) -> anyhow::Result<()> {
Expand All @@ -54,6 +65,9 @@ pub fn run_math_command(cmd: MathCommands, repo_root: &Path) -> anyhow::Result<(
hybrid,
sensitivity,
gamma_conflict,
hybrid_v2,
n,
theta,
} => run_compare(
repo_root,
CompareOpts {
Expand All @@ -62,8 +76,12 @@ pub fn run_math_command(cmd: MathCommands, repo_root: &Path) -> anyhow::Result<(
hybrid,
sensitivity,
gamma_conflict,
hybrid_v2,
n,
theta,
},
),
MathCommands::GoldenTests => run_golden_tests(repo_root),
}
}

Expand All @@ -73,6 +91,9 @@ pub struct CompareOpts {
pub hybrid: bool,
pub sensitivity: bool,
pub gamma_conflict: bool,
pub hybrid_v2: bool,
pub n: usize,
pub theta: bool,
}

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion cli/tri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "tri"
path = "src/main.rs"

[dependencies]
clap = { version = "4", features = ["derive"] }
clap = { version = "4", features = ["derive", "env"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
anyhow = "1"
Expand Down
Loading
Loading