符 · code
Highlighting that follows intent, not grammar
Okibi does not do static rainbow highlighting. Code colouring is three cumulative bands: a calm resting register that is always on, identity tints summoned only when you focus a block, and a risk layer only while you edit — each engages as you engage, and withdraws on the way out. Full algorithm: spec/dynamic-highlighting.md.
01 · obi
The bands
Band 1 is the register for code anywhere it is merely shown. Bands 2–3 need a live editor with real symbol resolution (LSP in production; the prototype uses a regex stand-in).
Identity is relational: a variable is tinted by how far you must look to find where it is bound; weight marks the in/out-of-function boundary.
Assignment is an ordering problem, not hashing: pre-vetted pool, interleaved slots, salience ranking, first-appearance stability. Overflow → neutral, never recycle.
Only escaping mutation is marked. Local bookkeeping is silent — marking all mutation lights the file like a christmas tree.
Seven alternatives were tried and rejected (hash tints, HRW, tint-all, tint-only-globals, whole-function focus, dim-the-rest, smart hysteresis) — the ledger is in the spec §10; don’t re-tread them.
02 · hashigo
The capability ladder
The fallback is not a second theme — tiers drop, colours never substitute. Ports: spec/static-fallback.md.
1 · Truecolor + LSP — the full dynamic system. Live demo: the workbench · the transition machine.
2 · Grammar only — band 1 via TextMate / tree-sitter / Prism / hljs / CodeMirror. Artifacts in Tools.
3 · Strict-16 ANSI — the terminal mapping; bands 2–3 disabled.
4 · Monochrome — weight + underline style only. Still works; that is what redundancy is for.