neural/rune/PLAN.md

rune implementation plan

rune = open-computation language for the cyber soft3 stack. Full spec: ~/cyber/cyber/root/rune.md.

architecture

cybermark sigils (13)
    ↓  address + inline computation
rune inline  (sigil[expr] — reactive prose, living documents)
    ↓  + block grammar
rune         (gates, doors, kernels, agents — full language)
    ↓  pure subset
trident      (consensus-critical, proof-mandatory, frozen)
    ↓  jets
Rs           (native-speed primitives)

Two registers, one AST, one Nox target:

  • rust — classic, Rust-familiar surface
  • rune — pure, Hoon-style sigil surface

Three proof tiers:

  • pure: unconditional
  • reactive (hint): conditional on event log
  • host: conditional on host results (only genuine trust boundary)

crate map

rune-ast       Expr + Noun — shared representation
rune-lex       tokenizer (both registers share one lexer)
rune-parse     classic register parser [pure: M4]
rune-lower     Expr → Nox noun
rune-interp    tree-walking Nox interpreter (all 12 patterns)
rune-subject   subject model (~self ~now ~here ~caps ~code ~libs ~mem ~world)
rune-mold      mold system (types as runtime normalizing functions)
rune           CLI: run / eval / fmt / check

External deps (added per milestone, not upfront):

  • nox/rs — M6 (compile path, jets)
  • hemera/rs — M2 (particle hashing)
  • strata — M3 (algebra molds: @nebu, @kuro, @jali…)
  • trident — M6 (TIR compile path)
  • zheng — M9 (lazy proof generation)

milestones

M1 — instant start proof-of-concept

Goal: rune eval '42' and rune run file.rune work end-to-end. Every Nox pattern (0–11) covered in the interpreter.

Work packages:

  • rune-interp: implement remaining Nox patterns (6–11: if, compose, push, call, hint, scry-stub)
  • rune-parse: implement full classic gate syntax (fn, let, if, loop, function calls)
  • rune-lower: complete lowering for all Expr variants (Gate, Let, If, Trap, Call, Eq, Inc, Eval, Compose)
  • rune: rune eval as REPL-on-one-expression (read line, eval, print, loop)
  • tests: double(5) = 10, fibonacci(10) = 55, if 0 == 0 { 1 } else { 0 } = 1

Completion signal: all Nox patterns tested; double and fibonacci work end-to-end.

M2 — subject model + cybermark addresses

Goal: ~self, ~now, ~here, ~world resolve correctly; #path addresses thread through subject.

Work packages:

  • rune-subject: flesh out Subject construction; add graph-slice stub for ~world
  • rune-lower: wire subject-slot axis constants from rune-subject::axis
  • rune-interp: implement scry (pattern 11) against subject's ~world slot
  • hemera: add hemera/rs as dep; replace string_to_atom stub with real hemera hash
  • rune-parse: parse ~hint:%tag.selector hint form; parse ~host:%target.args host form
  • tests: ~self resolves to subject slot 2; #cyber/truth threaded through ~world stub

Completion signal: rune eval '~self' returns the neuron atom from the constructed subject.

M3 — mold system + type checking

Goal: @ud, @da, #, @neuron work as runtime mold-gates; static mold checking catches type errors.

Work packages:

  • rune-mold: add @p (phonetic name), @tas (term), @t (text cord) base molds
  • strata: add strata dep; wire @nebu, @kuro, @jali, @trop, @genies
  • rune-interp: apply mold normalization at cast sites (^- and ^+ equivalents)
  • rune-parse: parse mold annotation syntax (name: @mold in function params)
  • rune-lower: emit cast formulas for annotated bindings
  • rune check command: run static mold pass, report mismatches as errors
  • tests: let x: @ud = "bad" fails check; let x: @ud = 42 passes

Completion signal: rune check catches @ud / cell mismatches; algebra molds (@nebu) available.

M4 — pure register (rune sigil syntax)

Goal: both registers parse to the same AST; rune fmt --to=rune and --to=rust round-trip.

Work packages:

  • new crate rune-parse-pure: parser for sigil-form syntax
    • tall form: |= sample body (layout-sensitive, two-space continuation)
    • flat form: (|= sample body)
    • all 25 digraphs recognized and mapped to Expr variants
    • cybermark address forms (#, @, ~, /, $, ^, !, .) in expression position
  • rune-parse: expose parse_register(src, Register::Classic | Register::Pure) entry point
  • file-level pragma: :: register: rune at top of file selects pure register
  • rune fmt --to=rust: pretty-print AST in classic register
  • rune fmt --to=rune: pretty-print AST in pure register
  • tests: round-trip every Expr variant through fmt in both directions

Completion signal: the double example parses from both fn double(x: @ud) { x * 2 } and |= x=@ud (mul x 2) to the same AST.

M5 — dynamic extensions (hint + host + eval)

Goal: graph reactor example works; hint parks and resumes; host calls WASM; eval runs dynamic formulas.

Work packages:

  • rune-interp: implement hint as parking mechanism
    • HintHandle returned when ~hint: form is reached
    • runtime drives the event loop: deliver event noun → resume continuation
  • event loop in rune CLI: mock event source (stdin JSON lines) for development
  • rune-interp: implement host bridge
    • wasmi crate for WASM modules
    • host::wasm(module_particle, fn_name, args) → Noun
    • host::gpu and host::infer stubs (return Noun::Atom(0) until wGPU/glia land)
  • rune-lower: lower Expr::Hint and Expr::Host to Nox patterns 10 and runtime hooks
  • rune-lower: lower Expr::Eval to Nox pattern 2 (already handled in lowering)
  • tests: graph reactor loop with mock event source terminates after N events

Completion signal: graph reactor example from rune.md runs with mock events.

M6 — compile back-end

Goal: pure rune routes through trident's TIR pipeline; compiled .nox artifacts produced; background compilation and transparent swap.

Work packages:

  • add nox = { path = "../nox/rs" } and trident deps to workspace
  • rune-lower: emit trident-compatible IR for pure (dynamic-free) functions
  • background compilation thread: compile_in_background(source_particle) -> compiled_artifact
  • swap mechanism: hot-function counter in interpreter; trigger compile above threshold
  • compiled artifact cached as particle (hemera hash of source → compiled .nox)
  • three new TIR opcodes for hint/host/eval (rune-only extension to trident's TIR)

Completion signal: double(5) eventually runs from compiled .nox after threshold; interpreter still handles first N calls.

M7 — planetary cache

Goal: compiled artifacts published as particles in the cybergraph; cold start amortized across neurons.

Work packages:

  • particle storage interface: store_particle(noun) -> Hash, fetch_particle(hash) -> Option<Noun>
  • cache key: hemera(source_particle) → compiled artifact particle
  • rune run --cache-dir option for local particle cache (no cybergraph dep in dev mode)
  • invalidation: source particle change → cache miss → recompile

Completion signal: second rune run of the same file skips compilation, fetches cached artifact.

M8 — profile-guided tiering

Goal: hot-path detection, background compilation, transparent swap — user never waits.

Work packages:

  • call-site counter in interpreter (per arm/gate)
  • background compile queue (tokio task)
  • swap on next call after compile finishes
  • #![compile] pragma for explicit AOT; #![interpret-only] to suppress

Completion signal: fibonacci(35) starts interpreted, silently upgrades to compiled mid-run.

M9 — lazy proof generation

Goal: zheng proofs produced on demand for compiled pure regions; cached by trace particle.

Work packages:

  • add zheng dep
  • proof hook in compiled back-end: capture execution trace for pure regions
  • rune prove <file> command: run, capture trace, produce proof particle
  • proof cached: hemera(trace) → proof particle
  • rune verify <file> <proof> command

Completion signal: rune prove double.rune produces a verifiable zheng proof for double(5) = 10.

M10 — Kelvin freeze

Goal: declare rune-core stable; publish K-number; pure grammar matches trident's freeze.

Work packages:

  • audit: every Expr variant has a test, every Nox pattern has a test
  • version all digraphs and subject slots as frozen
  • rune-core Kelvin inherits trident's K-number when trident freezes
  • rune-dyn (hint/host/eval) carries its own Kelvin, evolves above frozen core

open questions (from rune.md spec)

These must be resolved before the relevant milestone:

  1. Register interleaving (M4): can a single function body mix classic and pure on a per-line basis? Leaning toward per-block via fenced markdown code block or file-level pragma.

  2. Mold inference across algebras (M3): does the type system need explicit algebra parameters or can it always infer from sample? @nebu and @kuro are distinct molds.

  3. Subject capability model (M2–M3): what restricts which code can read or write subject slots? Capability tokens in subject itself? Per-block declared imports?

  4. Markdown hosting (M1): rune in fenced blocks (graph-native) vs .rune files (file-native)? Probably both; cybergraph canonical.

  5. Wet gate caching in compiled mode (M6): wet gates re-typecheck at each call site. Need dedup by argument-type fingerprint to avoid compilation explosion.

  6. Hint event matching (M5): by type, by selector pattern, by subject slot path? Leaning toward selector patterns over cybermark addresses.

  7. Scry pure-or-async (M5): .^ reads from cybergraph — pure when local, hint when remote. Unified primitive with mode inferred from address scope, or two distinct primitives?

  8. Host call typing (M5): fully typed (optimizer reasons about return shape) or untyped? Leaning typed with a typed-void escape for genuinely opaque calls.

  9. Parallel doors (M5–M6): doors are state-isolated by construction. Can a runtime run multiple doors in parallel without coordination? Likely yes; cyberlinks as only cross-door channel.

current state

M1 complete. M2–M6 substantially implemented, M8 partially done. M7 skipped (not needed).

completed

M1 — all Nox patterns (0–17) covered; rune eval '42' and rune run file.rune work.

  • workspace: rune-ast, rune-lex, rune-parse, rune-lower, rune-interp, rune-subject, rune-mold, rune CLI
  • Nox patterns 0–17 in rune-interp (44 unit tests)
  • classic register parser: atoms, let, fn, if, loop, match, impl/door, rebind/continue, cybermark addresses, < > <= >= == != + - * /
  • lowering: all Expr variants including Trap/Loop (dynamic $ axis), Rebind (depth-d subject rebuild), Door/Arm, Match, Gate (call-site inlining for closures)
  • integration tests: double(5)=10, fibonacci(10)=55, factorial(5)=120, closures

M2 — done. Subject slots resolve and cybermark addresses scry the world.

  • ~self … ~world lower to axis reads (reserved names resolve via slot_axis, with or without ~)
  • #path / @neuron / ~name addresses lower to [17 [1 key] [0 255]] — scry over ~world
  • rune_subject::path_atom is the one address→key hash (real hemera Poseidon2); lower and the world builder share it; rune_subject::world(&[(path, val)]) builds a graph slice
  • Subject::standalone() — resolvable ~self/~here; the CLI injects a live ~now
  • fixed: the scry key was emitted unquoted ([17 [k …]]); look evaluates the path, so it is now [1 k]. Verified: rune eval '~self' → neuron atom; #cyber/truth resolves through a populated world

M3 — done. Base molds (@ud @da # @neuron @p @tas @t @flag) + strata molds (@nebu @kuro @jali @trop @genies); resolve() registry; rune check.

  • the checker now runs the real molds on atom/cell literals (via resolve + normalize), so every mold enforces its own constraint — @flag = 2, @ud = [1 2], etc. — not two hard-coded heuristics. Text literals keep the structural check (they lower to a tape cell the atom molds don't model).
  • deferred: param/return annotations are parsed but not yet enforced (needs a typed-Gate AST + call-site checking); runtime mold-gates wait on molds lowering to Nox (M6); ^-/^+ casts land with the pure register (M4).

M4 — done. Both registers parse to one AST and execute.

  • rune-parse-pure: 25 digraphs (tall + flat). Verified: fn double(x: @ud) { x * 2 } and (|= x=@ud (mul x 2)) parse to the same AST (the completion signal).
  • fmt is bi-directional: detects the input register (pragma) and outputs --to=rust/--to=rune, so pure↔classic round-trips both ways.
  • pure register now executes: rune eval --pure '(mul 6 7)' → 42; files with a :: register: rune pragma run/check/fmt as pure (Register::Pure + detect_register; the CLI dispatches since it has both parsers).
  • deferred: per-line register mixing in the REPL; ^-/^+ → Expr::Cast (the AST variant exists; wiring it is small follow-up).

M5 (partial) — hint passthrough (opcode 16 body evaluates correctly); host stub (identity); scry stub (returns 0)

M6 (partial) — rune-compile TierRouter: hot-path counter, background compile stub, artifact cache

M8 (partial) — ResultCache in TierRouter: (formula_hash, subject_hash) memoization for pure formulas after hot_threshold

pending

  • M2: ~world is empty in standalone — populated by a real graph source (cyb/bbg) later
  • M3: param/return annotation enforcement (typed Gate + call-site checking)
  • M3: runtime mold-gates (molds lowering to Nox — with M6)
  • M5: deep hint parking (CPS suspend/resume) — shallow top-level parking exists (eval_step/resume)
  • M5: host WASM bridge (wasmi) — the generic Host/act seam is in; no wasmi yet
  • M6: trident TIR emission for pure functions (no trident dep wired)
  • M8: background compile + transparent swap (only result-memoization exists)
  • M9: zheng proof generation
  • M10: Kelvin freeze audit

Homonyms

plan
plan the schedule: standing orders and deferred intents. the seed exists — the mining standing order in cy/specs/body|body is the first plan entry; it generalizes into the robot acting at 3am so you don't have to. cyb/parts/time|time reads the plan forward as the future half of its screen. part of…
warriors/erga/plan
erga — ERGO (Autolykos v2) miner for Apple Silicon Zero-copy Autolykos v2 miner on Rust using the honeycrisp hardware driver stack. ERGO uses Autolykos v2: a memory-hard k-sum PoW where each nonce attempt requires 32 random reads from a 2+ GB precomputed table R, summed, and Blake2b256-hashed…
cy/specs/plan
neural/inf/rs/plan
plan
soft3/mir/docs/plan
Graph World — Rendering Implementation Plan Protocol spec: `cybergraph/reference/render.md` (R-1.0) Implementation spec: `cyb/render/specs/render.md` (R-1.0-cyb) Architectural decisions Barnes-Hut vs BVH The deeper question is not "which algorithm for rendering cull" but "does this manifold need…
soft3/radio/audit/2026-10-11-bao-bounded-traversal/plan
Checked traversal PLAN evidence Research and proposed tests only, on actual Radio parent `a96d86e28d384cdf656aadc4282c78c0c170c102` (PR38). Production is unchanged. The [PLAN](/soft3/radio/.claude/tasks/bao-bounded-traversal/plan) specifies one admitted byte range, one emitted geometric item per…
soft3/nox/.claude/tasks/hemera-no-std/plan
Preserve nox's no_std dependency boundary Stage: revised PLAN v2, awaiting fresh different-vendor review. Parent: `0b1407a4b855e4961ede07e1b7ea199cb8018c30`. Lineage and measured failures are in [research.md](/soft3/nox/.claude/tasks/hemera-no-std/research); exact feature/ring analysis is in…
soft3/radio/.claude/tasks/bao-root-policy/plan
Canonical BAO ROOT finalization Status: draft v3, awaiting correction PLAN review; no implementation. Serves: Kadek phase-1 foundation row 4 and runtime proof-before-admission clause; radio's Hemera BAO dependency, pinned tree ROOT finalization contract. Base: radio…
warriors/erga/.claude/tasks/blake-batch-owner/plan
Close the Blake benchmark batch owner Stage draft; awaits root and fresh different-vendor PLAN approval. No production changes. Base Erga848e17e2522db2f6225ad72d9b1797f8735d26d0; Honeycrisp9cbd4807, Strata494df7, exact full pins/source evidence in research.md. Serves Kadek native Image ownership…
soft3/radio/.claude/tasks/kadek-slice-traversal/plan
Correct sync slice traversal Status: implementation source frozen for fresh code review. Scoped tests pass; unrelated Clippy/full-workspace/tooling failures remain visible in research. Base: radio `db1d62e2cd1e4b2f309fa19bcc158bd29b44753d`, freshly fetched origin/main. Owned worktree:…
warriors/erga/.claude/tasks/mine-owner/plan
Mine owner plan Stage draft; implementation waits for fresh different-vendor PLAN approval. Serves Kadek foundation row6; discovered-from Honeycrisp PR14 and Erga PR2. Base `8dcb33888868d74ddfda3eeeb9bc90e58677b394`, Honeycrisp `9cbd4807`, Strata `494df7a`; full pins/evidence in research. No…
soft3/radio/.claude/tasks/bao-bounded-reducer/plan
Bounded BAO group reducer — proposed PLAN Serves: owner's Kadek phase-1 closure · Radio/soft3 · foundation row 4, bounded authenticated-range prerequisite. Source research is pinned in research-inputs.json at Radio `a11d342594949d4ea542b26366f71d56ef21662d` and Hemera…
cyb/honeycrisp/.claude/tasks/nebu-package-identity/plan
nebu package identity — plan One manifest identity repair restores origin-source Cargo resolution for the unimem gate prerequisite. Root owns implementation/review/commit/PR; this unit does not overlap the Block constructor's source/spec files. 1. Record `rustc -Vv`, `cargo -V`, host and target:…
soft3/radio/.claude/tasks/bao-empty-status/plan
Fs synthetic empty status — PLAN amendment Stage: active. Fresh Grok4.7 PLAN APPROVE preceded production edits; the exact reviewed draft and raw verdict remain frozen in the audit. Fresh CODE APPROVE and root disposition are retained in audit/2026-10-11-empty-status/. Serves Kadek phase 1…
soft3/radio/.claude/tasks/bao-bounded-traversal/plan
Bounded BAO range traversal Stage: draft; independent PLAN review pending, no production changed. Serves the owner's Kadek phase-1 closure, Radio/soft3 and foundation row 4 (bounded authenticated source ranges). Discovered from the [measured traversal…
soft3/radio/audit/2026-10-12-bao-proof-research/task/plan
Bounded complete-buffer BAO proof verification Proposed PLAN; no production implementation or approval. Serves Kadek foundation row 4 through Radio, declared part of soft3; the future Kadek adapter reaches Cyb. Radio implementation parent is b933829cbe273d2f31fe75ca83125f3ddd8917a2 (PR39); research…
soft3/radio/.claude/tasks/kadek-export-pairs/plan
Correct actual BAO exporter pair width Status: source-only plan awaiting fresh different-vendor approval; no code/tests edited or builds run. Base origin/main `764d732ac38fb9116c4cf525a6d1bb463d409a06`. Owned branch/worktree: `fix/kadek-export-pairs` /…
cyb/honeycrisp/.claude/tasks/unimem-block-creation/plan
Checked Block creation — plan PLAN approved with binding conditions in `/tmp/unimem-block-creation-plan-review.txt`. Implementation follows those conditions; fresh CODE review remains required. Base: `9593c7218e14e2b5b816d9008b45ab60b9580cf3`, branch `fix/unimem-block-creation`. Serves kadek…
soft3/radio/.claude/tasks/kadek-memstore-pairs/plan
Canonical in-memory BAO parent pairs Status: proposed PLAN v2; fresh different-vendor approval required before source edits. Serves: Kadek phase-1 row4, existing radio verified-range import/storage dependency. Base radio `0d11468503c052aa5dcefb0dabc4602bd8efdc60`, exact Hemera…
soft3/radio/.claude/tasks/bao-bounded-proof/plan
Bounded complete-buffer BAO proof verification Proposed PLAN; no production implementation or approval. Serves Kadek foundation row 4 through Radio, declared part of soft3; the future Kadek adapter reaches Cyb. Radio implementation parent is b933829cbe273d2f31fe75ca83125f3ddd8917a2 (PR39); research…
warriors/erga/.claude/tasks/rtable-owner/plan
RTable owner plan Stage draft; implementation waits for fresh different-vendor PLAN approval. Serves Kadek foundation row 6; discovered-from Honeycrisp PR14 and Erga PR1. Base `14b40d667b7fa927f62f46423cd8096f01cf704f`, Honeycrisp `9cbd4807`, Strata `494df7a`; full revisions/evidence are in…
cyb/honeycrisp/.claude/tasks/unimem-block-access/plan
Raw Block access — PLAN v3 candidate Serves Kadek foundation row6/native ownership prerequisite; upstream unimem CPU access and aruminium import contracts. Base `7b148906263da5ea8aabc5ddb0e2e44ff2288ecc`; [research](/cyb/honeycrisp/.claude/tasks/unimem-block-access/research) records parent and…
soft3/radio/.claude/tasks/audit-cargo-packaging/plan
Lossless archival Cargo manifests Status: draft; fresh different-vendor PLAN approval required before edits to existing artifacts. Serves Kadek foundation row 4 through Radio; discovered from PR40's committed Git consumer. Parent: `ce0fb312faa8770e80efe9afa864106ae6b51552`. Result Rename exactly…
soft3/radio/.claude/tasks/bao-hemera-pin/plan
Pin the shared Hemera dependency Serves: owner's Kadek phase-1 closure · Radio/soft3 · consumable dependency prerequisite for bounded BAO verification, foundation row 4. Stage: draft. Source parent Radio a11d342594949d4ea542b26366f71d56ef21662d; Hemera source…
soft3/radio/audit/2026-10-12-bao-proof-research/prerequisite/plan
Bounded BAO range traversal Stage: draft; independent PLAN review pending, no production changed. Serves the owner's Kadek phase-1 closure, Radio/soft3 and foundation row 4 (bounded authenticated source ranges). Discovered from the [measured traversal…

Graph