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
64 changes: 39 additions & 25 deletions apps/website/public/agents.t27
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; GENERATED by apps/website/scripts/onboarding-from-spec.mjs (gHashTag/trinity)
; from specs/catalog/onboarding.t27, sha256 b2a2376e1a81aa892ffd90b0a329532097d5f7569e86d51e2ca39c3192d0de9f
; from specs/catalog/onboarding.t27, sha256 d70522d6b66222b1e81e13f3be901162916aaa09a0d84de3c1138af878339758
; Served as https://t27.ai/agents.t27 and https://t27.ai/llms.txt -- the same bytes at both addresses.
; Do not edit either file: edit the spec and re-run the generator.

Expand Down Expand Up @@ -102,37 +102,44 @@ pub const REQUIRES_RUNNING_OUR_CODE : bool = false;

; --- The corpus on the day this was written --------------------------------------------------
pub const MEASURED_AT : str = "2026-09-21";
pub const SPEC_COUNT : u16 = 1414;
pub const SPEC_LINES : u32 = 372417;
pub const SPEC_COUNT : u16 = 1419;
pub const SPEC_LINES : u32 = 373151;
; Health as the manifest reports it. The three add up to SPEC_COUNT, and the test below says so.
; These moved a long way on 2026-09-21, and the cause was the instrument, not the corpus: the
; wasm served here until then was built from no committed source, and it accepted anything.
; Fed a Zig file, a Markdown file or a string literal left open, it answered typecheck.ok and
; emitted C, Rust, Verilog and Zig. The binary now served is built from bootstrap/src, and it
; reads what is actually in the file. Nothing in the corpus got worse; it got measured.
pub const HEALTH_OK : u16 = 976;
pub const HEALTH_WARN : u16 = 100;
pub const HEALTH_FAIL : u16 = 338;
pub const HEALTH_OK : u16 = 1017;
pub const HEALTH_WARN : u16 = 184;
pub const HEALTH_FAIL : u16 = 218;
; Repositories the manifest was built from, and the worlds the scan found on GitHub.
pub const REPO_COUNT : u8 = 10;
pub const WORLD_COUNT : u8 = 5;
; "fail" is several different things wearing one label: a spec that never parsed (no backend
; ran, so its clean counters mean nothing ran, not that nothing went wrong), and a spec that
; parsed and then lost a backend. Do not report the second count as the first, and do not read
; the total as "338 broken specs" -- measured on 2026-09-21, 145 of the 338 are not t27 at all:
; 68 are Zig source, 49 are an older `spec Name { }` dialect, 14 are Markdown prose and 23 are
; fixtures this repository damages on purpose so the compiler has something to reject. Counting
; them as specs is what the extension does, not what the contents are.
; "fail" is two different things wearing one label, and the split is measured rather than
; described: a spec that NEVER PARSED, so no backend ran and its clean counters mean nothing
; ran rather than nothing went wrong -- and a spec that parsed and then lost a backend.
; Do not report the second count as the first, and do not read the total as "218 broken specs".
; A file with the .t27 extension is not always t27: Zig source, Markdown prose, an older
; `spec Name { }` dialect and fixtures this repository damages on purpose all sit in the first
; group. This file no longer prints a count per class. It carried one until 2026-09-21, hand
; typed, adding to 154 beside a sentence that said 145 -- a breakdown nothing checked, which is
; the one kind of number this document is not allowed to hold.
pub const HEALTH_FAIL_NOTE : str = "health=fail covers both a spec that did not parse and a spec whose backend failed; the manifest's backendFailures separates them";
; The largest single class: js and ts are declarations-only backends, so a const whose
; initialiser is an expression rather than a literal has nothing for them to emit and they
; say so by name. Those files parse, typecheck and emit five other languages.
; The name of this constant is now half-true and kept anyway: nothing in the corpus fails
; on js alone or on ts alone, so the class it counts is the same 122 files it always was --
; renaming it would move a number that did not move. What CHANGED is that the manifest now
; reports each of those files twice, once per backend, which is why backendFailures reads
; js=335 ts=335 and not js=335 ts=0.
pub const HEALTH_FAIL_JS_ONLY : u16 = 122;
pub const HEALTH_FAIL_UNPARSED : u16 = 211;
; What is left once the unparsed are set aside: seven specs that parse, typecheck, and emit
; six of seven languages. That is the honest size of "broken and readable".
; The largest class used to be a different one. js and ts are declarations-only backends, and
; a const whose initialiser they had no spelling for failed the WHOLE module -- costing every
; declaration that was fine to refuse the one that was not, on files the other five backends
; accepted. They now announce that declaration by name, in the artifact, and emit the rest.
; The constant below is what that change did to this number, and it is checked against the
; manifest; the size of the class before the change is not, so it is not printed here.
pub const HEALTH_FAIL_JS_ONLY : u16 = 0;
; Announced, not dropped. A spec here emits a real module that says inside itself what it left
; out, as data -- `__NOT_EMITTED__`, a list a tool can read without parsing comments. That is
; neither whole nor broken, so it is counted apart and coloured a warning, never a pass.
pub const HEALTH_PARTIAL : u16 = 71;

; --- The game --------------------------------------------------------------------------------
pub const GAME : str = "Queen Hive";
Expand Down Expand Up @@ -184,10 +191,17 @@ pub const ASKS_TO_ACT_ALONE : bool = false;
test health_accounts_for_every_spec {
assert HEALTH_OK + HEALTH_WARN + HEALTH_FAIL == SPEC_COUNT;
assert HEALTH_FAIL > 0;
// The qualifier is part of the count, not a footnote to it: js-only failures are a subset
// of fail, so a reading of HEALTH_FAIL that ignores them is reading a smaller number wrong.
// The qualifier is part of the count, not a footnote to it: each of these is a SUBSET of
// fail, so a reading of HEALTH_FAIL that ignores them is reading a smaller number wrong.
assert HEALTH_FAIL_JS_ONLY < HEALTH_FAIL;
assert HEALTH_FAIL_JS_ONLY > 0;
assert HEALTH_FAIL_UNPARSED < HEALTH_FAIL;
// The subset that is worth stating on its own: 209 of the 216 never reached a backend at
// all. An earlier version of this test demanded HEALTH_FAIL_JS_ONLY > 0, which was true
// the day it was written and is a lie the moment the class it counts is fixed. A test
// that forbids its own subject from reaching zero is a test against the work.
assert HEALTH_FAIL_UNPARSED > 0;
// A partial artifact is a warning, never a pass, so it cannot outnumber the warnings.
assert HEALTH_PARTIAL <= HEALTH_WARN;
}

test the_cycle_is_five_steps_in_order {
Expand Down
64 changes: 39 additions & 25 deletions apps/website/public/llms.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; GENERATED by apps/website/scripts/onboarding-from-spec.mjs (gHashTag/trinity)
; from specs/catalog/onboarding.t27, sha256 b2a2376e1a81aa892ffd90b0a329532097d5f7569e86d51e2ca39c3192d0de9f
; from specs/catalog/onboarding.t27, sha256 d70522d6b66222b1e81e13f3be901162916aaa09a0d84de3c1138af878339758
; Served as https://t27.ai/agents.t27 and https://t27.ai/llms.txt -- the same bytes at both addresses.
; Do not edit either file: edit the spec and re-run the generator.

Expand Down Expand Up @@ -102,37 +102,44 @@ pub const REQUIRES_RUNNING_OUR_CODE : bool = false;

; --- The corpus on the day this was written --------------------------------------------------
pub const MEASURED_AT : str = "2026-09-21";
pub const SPEC_COUNT : u16 = 1414;
pub const SPEC_LINES : u32 = 372417;
pub const SPEC_COUNT : u16 = 1419;
pub const SPEC_LINES : u32 = 373151;
; Health as the manifest reports it. The three add up to SPEC_COUNT, and the test below says so.
; These moved a long way on 2026-09-21, and the cause was the instrument, not the corpus: the
; wasm served here until then was built from no committed source, and it accepted anything.
; Fed a Zig file, a Markdown file or a string literal left open, it answered typecheck.ok and
; emitted C, Rust, Verilog and Zig. The binary now served is built from bootstrap/src, and it
; reads what is actually in the file. Nothing in the corpus got worse; it got measured.
pub const HEALTH_OK : u16 = 976;
pub const HEALTH_WARN : u16 = 100;
pub const HEALTH_FAIL : u16 = 338;
pub const HEALTH_OK : u16 = 1017;
pub const HEALTH_WARN : u16 = 184;
pub const HEALTH_FAIL : u16 = 218;
; Repositories the manifest was built from, and the worlds the scan found on GitHub.
pub const REPO_COUNT : u8 = 10;
pub const WORLD_COUNT : u8 = 5;
; "fail" is several different things wearing one label: a spec that never parsed (no backend
; ran, so its clean counters mean nothing ran, not that nothing went wrong), and a spec that
; parsed and then lost a backend. Do not report the second count as the first, and do not read
; the total as "338 broken specs" -- measured on 2026-09-21, 145 of the 338 are not t27 at all:
; 68 are Zig source, 49 are an older `spec Name { }` dialect, 14 are Markdown prose and 23 are
; fixtures this repository damages on purpose so the compiler has something to reject. Counting
; them as specs is what the extension does, not what the contents are.
; "fail" is two different things wearing one label, and the split is measured rather than
; described: a spec that NEVER PARSED, so no backend ran and its clean counters mean nothing
; ran rather than nothing went wrong -- and a spec that parsed and then lost a backend.
; Do not report the second count as the first, and do not read the total as "218 broken specs".
; A file with the .t27 extension is not always t27: Zig source, Markdown prose, an older
; `spec Name { }` dialect and fixtures this repository damages on purpose all sit in the first
; group. This file no longer prints a count per class. It carried one until 2026-09-21, hand
; typed, adding to 154 beside a sentence that said 145 -- a breakdown nothing checked, which is
; the one kind of number this document is not allowed to hold.
pub const HEALTH_FAIL_NOTE : str = "health=fail covers both a spec that did not parse and a spec whose backend failed; the manifest's backendFailures separates them";
; The largest single class: js and ts are declarations-only backends, so a const whose
; initialiser is an expression rather than a literal has nothing for them to emit and they
; say so by name. Those files parse, typecheck and emit five other languages.
; The name of this constant is now half-true and kept anyway: nothing in the corpus fails
; on js alone or on ts alone, so the class it counts is the same 122 files it always was --
; renaming it would move a number that did not move. What CHANGED is that the manifest now
; reports each of those files twice, once per backend, which is why backendFailures reads
; js=335 ts=335 and not js=335 ts=0.
pub const HEALTH_FAIL_JS_ONLY : u16 = 122;
pub const HEALTH_FAIL_UNPARSED : u16 = 211;
; What is left once the unparsed are set aside: seven specs that parse, typecheck, and emit
; six of seven languages. That is the honest size of "broken and readable".
; The largest class used to be a different one. js and ts are declarations-only backends, and
; a const whose initialiser they had no spelling for failed the WHOLE module -- costing every
; declaration that was fine to refuse the one that was not, on files the other five backends
; accepted. They now announce that declaration by name, in the artifact, and emit the rest.
; The constant below is what that change did to this number, and it is checked against the
; manifest; the size of the class before the change is not, so it is not printed here.
pub const HEALTH_FAIL_JS_ONLY : u16 = 0;
; Announced, not dropped. A spec here emits a real module that says inside itself what it left
; out, as data -- `__NOT_EMITTED__`, a list a tool can read without parsing comments. That is
; neither whole nor broken, so it is counted apart and coloured a warning, never a pass.
pub const HEALTH_PARTIAL : u16 = 71;

; --- The game --------------------------------------------------------------------------------
pub const GAME : str = "Queen Hive";
Expand Down Expand Up @@ -184,10 +191,17 @@ pub const ASKS_TO_ACT_ALONE : bool = false;
test health_accounts_for_every_spec {
assert HEALTH_OK + HEALTH_WARN + HEALTH_FAIL == SPEC_COUNT;
assert HEALTH_FAIL > 0;
// The qualifier is part of the count, not a footnote to it: js-only failures are a subset
// of fail, so a reading of HEALTH_FAIL that ignores them is reading a smaller number wrong.
// The qualifier is part of the count, not a footnote to it: each of these is a SUBSET of
// fail, so a reading of HEALTH_FAIL that ignores them is reading a smaller number wrong.
assert HEALTH_FAIL_JS_ONLY < HEALTH_FAIL;
assert HEALTH_FAIL_JS_ONLY > 0;
assert HEALTH_FAIL_UNPARSED < HEALTH_FAIL;
// The subset that is worth stating on its own: 209 of the 216 never reached a backend at
// all. An earlier version of this test demanded HEALTH_FAIL_JS_ONLY > 0, which was true
// the day it was written and is a lie the moment the class it counts is fixed. A test
// that forbids its own subject from reaching zero is a test against the work.
assert HEALTH_FAIL_UNPARSED > 0;
// A partial artifact is a warning, never a pass, so it cannot outnumber the warnings.
assert HEALTH_PARTIAL <= HEALTH_WARN;
}

test the_cycle_is_five_steps_in_order {
Expand Down
24 changes: 12 additions & 12 deletions apps/website/public/t27/files/specs/hslm/forward_pass.t27
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ module ForwardPass {
// Single-head attention: query = bind(Q, K), score similarity with V
// Returns best-matching role vector as value
// Complexity: O(n) where n = ROLE_DIM (VSA bind + similarity)
pub fn singleHeadAttention(positioned: []RoleVector, q_role: &RoleVector, k_role: &RoleVector, v_role: &RoleVector) -> RoleVector;
pub fn singleHeadAttention(positioned: []RoleVector, q_role: &RoleVector, k_role: &RoleVector, v_role: &RoleVector) -> RoleVector { }

// multiHeadAttention(context: []HyperVector, roles: []RoleVector, num_heads: usize) -> ForwardOutput
// Multi-head attention: 3 independent heads merged via bundle3
// Computes separate Q/K/V attention heads, merges via bundle3
// Complexity: O(n * h) where n = ROLE_DIM, h = HEAD_COUNT
pub fn multiHeadAttention(context: []HyperVector, roles: []RoleVector, num_heads: usize) -> ForwardOutput;
pub fn multiHeadAttention(context: []HyperVector, roles: []RoleVector, num_heads: usize) -> ForwardOutput { }

// ========================================================================
// 6. Forward Pass Functions
Expand All @@ -95,13 +95,13 @@ module ForwardPass {
// v2.29 single-head forward pass
// Uses Q/K/V attention to compute value = bind(Q/K/V)
// Complexity: O(n) where n = ROLE_DIM (VSA operations)
pub fn forwardPass(context: []HyperVector, roles: []RoleVector, target: &HyperVector) -> ForwardOutput;
pub fn forwardPass(context: []HyperVector, roles: []RoleVector, target: &HyperVector) -> ForwardOutput { }

// forwardPassMultiHead(context: []HyperVector, roles: []RoleVector) -> ForwardOutput
// v2.30 multi-head forward pass (3 heads merged)
// Uses independent Q/K/V attention heads, merges via bundle3
// Complexity: O(n * h) where n = ROLE_DIM, h = HEAD_COUNT
pub fn forwardPassMultiHead(context: []HyperVector, roles: []RoleVector) -> ForwardOutput;
pub fn forwardPassMultiHead(context: []HyperVector, roles: []RoleVector) -> ForwardOutput { }

// ========================================================================
// 7. Training Functions
Expand All @@ -112,13 +112,13 @@ module ForwardPass {
// Uses bind-based targeted correction
// Returns loss (1 - similarity) for this sample
// Complexity: O(n * h) where n = ROLE_DIM, h = 2 (FF roles)
pub fn resonatorTrainStep(context: []HyperVector, target: &HyperVector, roles: []RoleVector, dim: usize) -> f64;
pub fn resonatorTrainStep(context: []HyperVector, target: &HyperVector, roles: []RoleVector, dim: usize) -> f64 { }

// refineDirectRole(corpus: []const u8, dim: usize, initial_role: &RoleVector, num_passes: usize) -> RoleVector
// Iteratively refine direct role using error measurement
// Measures error, computes sparse correction, blends with sparsified annealing
// Complexity: O(p * n * m) where p = num_passes, n = dim, m = CORPUS_SIZE
pub fn refineDirectRole(corpus: []const u8, dim: usize, initial_role: &RoleVector, num_passes: usize) -> RoleVector;
pub fn refineDirectRole(corpus: []const u8, dim: usize, initial_role: &RoleVector, num_passes: usize) -> RoleVector { }

// ========================================================================
// 8. Context Functions
Expand All @@ -128,7 +128,7 @@ module ForwardPass {
// Permute and bundle 8 context vectors into 1 summary HV
// Uses positional permutation then sequential bundling
// Complexity: O(n) where n = ROLE_DIM (permute + bundle operations)
pub fn summarizeContext(context: []HyperVector) -> HyperVector;
pub fn summarizeContext(context: []HyperVector) -> HyperVector { }

// ========================================================================
// 9. Direct Role Functions
Expand All @@ -138,13 +138,13 @@ module ForwardPass {
// Pre-compute ideal direct role from corpus
// Uses charToHV encoding and bundle operations
// Complexity: O(c * n) where c = context_size, n = dim
pub fn computeDirectRole(corpus: []const u8, dim: usize, offsets: []const usize, context_size: usize) -> RoleVector;
pub fn computeDirectRole(corpus: []const u8, dim: usize, offsets: []const usize, context_size: usize) -> RoleVector { }

// directDecode(context: []HyperVector, role: &RoleVector, dim: usize) -> []u8
// Decode output HV to character sequence
// Uses learned role to predict next character
// Complexity: O(n) where n = output length
pub fn directDecode(context: []HyperVector, role: &RoleVector, dim: usize) -> []u8;
pub fn directDecode(context: []HyperVector, role: &RoleVector, dim: usize) -> []u8 { }

// ========================================================================
// 10. Generation Functions
Expand All @@ -154,7 +154,7 @@ module ForwardPass {
// Autoregressive generation using pre-computed direct role
// Shifts context, predicts tokens using directDecode
// Complexity: O(t * n) where t = max_tokens, n = ROLE_DIM
pub fn generateWithDirectRole(initial_context: []HyperVector, role: &RoleVector, output_buf: []u8, max_tokens: usize) -> usize;
pub fn generateWithDirectRole(initial_context: []HyperVector, role: &RoleVector, output_buf: []u8, max_tokens: usize) -> usize { }

// ========================================================================
// 11. Hebbian Functions
Expand All @@ -164,13 +164,13 @@ module ForwardPass {
// Build character-pair association matrix from corpus
// Returns counts[a][b] = frequency of char b following char a
// Complexity: O(c * m) where c = corpus.len, m = HEBBIAN_CHARS^2
pub fn buildHebbianCounts(corpus: []const u8) -> [HEBBIAN_CHARS][HEBBIAN_CHARS]u16;
pub fn buildHebbianCounts(corpus: []const u8) -> [HEBBIAN_CHARS][HEBBIAN_CHARS]u16 { }

// hebbianLookup(counts: *const [HEBBIAN_CHARS][HEBBIAN_CHARS]u16, char_idx: usize, dim: usize) -> HyperVector
// Look up character successor using Hebbian matrix
// Bundles successors weighted by count, proportional to frequency
// Complexity: O(n * m) where n = HEBBIAN_CHARS, m = dim
pub fn hebbianLookup(counts: *const [HEBBIAN_CHARS][HEBBIAN_CHARS]u16, char_idx: usize, dim: usize) -> HyperVector;
pub fn hebbianLookup(counts: *const [HEBBIAN_CHARS][HEBBIAN_CHARS]u16, char_idx: usize, dim: usize) -> HyperVector { }

// ========================================================================
// TDD - Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,13 @@ test bench_proxy_compute_pass_at_1_none_match
when p = compute_pass_at_1(template, problems)
then p == 0.0

test run_full_baseline_inner_singleton
given templates = ["adder"]
given problems = verilog_eval_problems()
when scores = run_full_baseline_inner(templates, problems, 0)
then len(scores) == 1 && scores[0] >= 0.0 && scores[0] <= 1.0


// ============================================================================
// 5. Invariants
// ============================================================================
Expand Down
Loading
Loading