Skip to content

feat(website): /t27f/graph/ draws the T27F graph view of a .t27 spec - #1679

Merged
gHashTag merged 1 commit into
mainfrom
feat/t27f-graph-page
Oct 18, 2026
Merged

gHashTag merged 1 commit into
mainfrom
feat/t27f-graph-page

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner
{
  "version": 1,
  "head_sha": "4de8af4a6e5521c8ff78bb3e6b269b79002fa5a3",
  "summary": "A new page at t27.ai/t27f/graph/ draws the T27F graph view of a .t27 spec: one box per node and one line per edge, placed, sized and coloured by the spec's own layout running as WebAssembly. A spec over the graph cap is refused with its verdict and never drawn truncated.",
  "changes": [
    "apps/website/public/t27f/graph/graph.js: 39 lines of glue that load the wasm, write the spec bytes in, loop over nodes and edges and emit SVG; no layout math",
    "apps/website/public/t27f/graph/index.html: the page with a picker of nine specs (tutorial 08 and eight t27f specs)",
    "apps/website/public/t27f/graph/t27f.wasm and spec_graph_view.mjs: the compiled exporter plus layout and the generated constants, shipped with PROVENANCE.txt (source commit, compiler, sha256 checksums)",
    "apps/website/public/t27f/graph/specs/: nine byte-identical copies of the specs from gHashTag/t27 master 290ff17df",
    "apps/website/README.md: a section describing the page and how its files are reproduced"
  ],
  "tests": [
    {
      "command": "static server over apps/website/public, open /t27f/graph/ and select each of the nine specs",
      "result": "six specs draw and three are refused with the too-many-edges verdict; no console errors",
      "status": "passed",
      "evidence": "Claude built-in browser pane against a local static server on head 4de8af4a6"
    },
    {
      "command": "t27c gen-js, t27c gen and zig build-exe to wasm32-freestanding on the Railway lab from the vendored specs",
      "result": "generated mjs and both Zig files match byte for byte and the rebuilt t27f.wasm has the same sha256 as the shipped file",
      "status": "passed",
      "evidence": "lab run on 2026-10-18, checksums recorded in public/t27f/graph/PROVENANCE.txt"
    }
  ],
  "limitations": [
    "Only exact edges are drawn; derived edges are not wired in yet and the page says so.",
    "No CI check re-verifies the checksums in PROVENANCE.txt yet.",
    "Merge is not deploy: t27.ai is published by a separate publisher, so the page is not live until it deploys."
  ],
  "tags": [
    "t27f",
    "wasm",
    "website",
    "visualization"
  ],
  "blog": {
    "title": "Seeing a t27 spec as a graph, in your browser",
    "summary": "A page on t27.ai now draws any of nine t27 specs as boxes and lines, with the graph and the layout both computed by t27 code running as WebAssembly.",
    "outline": [
      "A t27 spec is turned into a graph of nodes and edges by an exporter that is itself written in t27.",
      "Placement, size and colour of every box come from a second t27 spec, so the page holds no layout math of its own.",
      "The hand-written JavaScript is 39 lines: it moves bytes into the wasm and draws what comes back as SVG.",
      "A spec with more nodes or edges than the cap is refused with its verdict, because a truncated graph would lie about the spec.",
      "Every file on the page ships with its source commit, compiler version and checksum so anyone can rebuild it byte for byte."
    ]
  }
}

Adds the last missing core row of T27F, the renderer in the Trinity UI: a page at /t27f/graph/ that draws one box per node and one line per edge of a .t27 spec. Refs #1648 (RFC #1649).

What it does

  • The graph is read from the spec's bytes by specs/t27f/spec_graph_export.t27 (exact nodes and edges only). Placement, size, colour and dash of every box and line come from specs/t27f/spec_graph_view.t27. Both run as t27f.wasm, compiled from the generated Zig; the constants come from the generated spec_graph_view.mjs.
  • Each box is labelled with kind, name, inference label (exact / derived / suggested / unknown) and line span.
  • A spec picker: tutorial 08 and eight t27f specs. Three of them (spec_graph, spec_graph_view, spec_graph_export, with 642 / 483 / 352 edges) are over the cap of 192 nodes / 254 edges, so the page shows the exporter's refusal with the verdict and draws nothing: never a truncated graph. The rest draw (ui_plan: 113 nodes, 251 of 254 edges).
  • Every edge on the page is exact. Derived edges are not here yet and the page says so.

Hand-written code

public/t27f/graph/graph.js is 39 lines (comments included) and index.html is 33 lines of markup. graph.js loads the wasm, writes the spec's bytes in, loops over nodes and edges and emits SVG. No layout math. The one number it computes is how many characters of "kind name" fit in a box's first line (font px x 0.6, the same text fit as the t27-mcp t27f_graph tool); the full text is in the tooltip.

Provenance (public/t27f/graph/PROVENANCE.txt)

  • Specs: gHashTag/t27 master 290ff17df, byte-identical copies.
  • Compiler: t27c 0.5.2 (built from t27 90fc25b3b), zig 0.16.0, on the Railway lab.
  • The wasm and its byte-in / graph-out glue are the ones feat(t27f): t27f_outline and t27f_graph {path} from the T27F exporter t27-mcp#13 ships (commit 72ecc84), reused so there is one host ABI, not two.
  • Reproduced on the lab from the vendored specs: the generated JS constants and the two generated Zig files match byte for byte, and a rebuild of t27f.wasm from them gives sha256 eaa97ac3...c44e1 exactly.

Tested

In the browser (static server over apps/website/public): all nine picker entries load with no console errors; 6 draw, 3 refuse.

Not in this PR

  • No CI check re-verifies the checksums yet (a check script would be more hand-written JS; it should be a t27 spec).
  • The wasm reaches this repo by copy while t27-mcp#13 is open; once it merges, PROVENANCE.txt can point at a master commit.
  • The t27 t27f SKILL.md row "Renderer in the Trinity UI ... missing" is updated by a separate small t27 PR after this one is live.

Merge is not deploy: t27.ai is published by the ghashtag.github.io publisher.

🤖 Generated with Claude Code

One box per node and one line per edge of a .t27 spec, read from the spec's
bytes by specs/t27f/spec_graph_export.t27 and placed, sized and coloured by
specs/t27f/spec_graph_view.t27, both running as t27f.wasm. A spec picker over
tutorial 08 and eight t27f specs; a spec over 192 nodes or 254 edges shows the
exporter's refusal and nothing is drawn. graph.js is 39 lines of glue.
PROVENANCE.txt records the t27 commit, compiler, checksums and rebuild.

Refs #1648

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) October 18, 2026 04:05
@github-actions github-actions Bot added the status:in-progress 🔵 Agent working label Oct 18, 2026
@gHashTag
gHashTag merged commit aedbc7a into main Oct 18, 2026
18 of 20 checks passed
@github-actions github-actions Bot added status:completed Done and removed status:in-progress 🔵 Agent working labels Oct 18, 2026
github-actions Bot added a commit that referenced this pull request Oct 18, 2026
feat(website): /t27f/graph/ draws the T27F graph view of a .t27 spec (#1679)

One box per node and one line per edge of a .t27 spec, read from the spec's
bytes by specs/t27f/spec_graph_export.t27 and placed, sized and coloured by
specs/t27f/spec_graph_view.t27, both running as t27f.wasm. A spec picker over
tutorial 08 and eight t27f specs; a spec over 192 nodes or 254 edges shows the
exporter's refusal and nothing is drawn. graph.js is 39 lines of glue.
PROVENANCE.txt records the t27 commit, compiler, checksums and rebuild.

Refs #1648

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant