ontology editorsalt writes the rules, pepper brokers the inputs, the artifact holds the truth
The model
Everything in the editor is one of three primitives. Concept is a named node — a noun the ontology can refer to. Context is a directed triple subject → predicate → target; the predicate is itself a Concept, so the graph is reflective. Pattern is a body of triples used by an Implication: an OF pattern matches the current artifact, a GENERATES pattern materializes new triples when the match fires. Match → fire → mutate → re-match, until quiescent.
Type membership lives in the artifact, not on objects. A concept is a Block because some IS triple says so. isA walks IS edges transitively; there is no separate type registry. This is what lets a rule like c:Choice CHOSE o:Option → o IS Chosen actually change what queries see — the type query reads the same edges the rule just wrote.
Layers
Every Concept, Pattern and Implication lives in exactly one layer, and a triple lives in the highest layer of the two concepts it joins — engine < rule < content < runtime — so an instance's IS edge to its type is content, and a minted Choice's CHOSE edge to a rule-layer option is runtime. The layer is derived, never declared — there is no authoring switch. A new type, relation, pattern or rule is rule; an instance made with + Instance, a stamp or the node-paint tool is content; a triple follows its ends. The layer tabs in the activity bar are a partition.
Every Concept and Context lives in one of four layers. bundle is the imported schema you got for free — read-only, deleted only by un-importing the bundle as a unit. rule is your authored schema: predicates, types, implications you wrote yourself. content is the dataset — facts about the world. runtime is disposable: positions minted by gravity, choices minted by NextStep, anything the engine produced and the engine can throw away. Compost only touches runtime.
Salt: writing rules
An implication is a pair of patterns. The OF body is the precondition expressed as triples; the GEN body is the consequence. The matcher binds typed variables (p:Position means "any concept that isA Position") to live concepts, applies NOT and NEQ filters, and returns every binding that satisfies the whole body. The GEN body then materializes its triples with the variables substituted. MINT v:Type in the GEN body asks for a fresh concept named TypeN, registered as the variable for this one fire.
// "When a falling position has empty south, mint a new position one cell south."
Tetris_StepDownOf: Tetris_StepDownGen:
step:Choice IS Step MINT next:Position
step:Choice CHOSE Down next FOR b:Block
p:Position FOR b:Block next AT_CELL south:Tile
p AT_CELL c:Tile next UPDATES p:Position
NOT newer:Position UPDATES p
south:Tile SOUTH-OF c
The rule fires once per matching binding per pass. fireToQuiescence keeps running passes until a pass adds nothing new, capped at five passes and 200 new concepts to bound runaway rules in self-similar ontologies. Rules can't accidentally infinitely cascade — the budget catches it; reach the cap and a warning appears in the log.
Pepper: brokering inputs
Salt is pure: rules can't ask "what should happen next." When the artifact needs the outside world to pick something, it mints a Choice with OF options. The fulfillment is a single edge: choice CHOSE option. Pepper enforces the contract — pepper.notifyInput(choice, value) validates that choice IS Choice, that value appears in its OF options, and that no prior CHOSE exists, then writes the triple. The rules downstream see CHOSE and cascade.
The pepper panel (right sidebar in pepper mode) is itself just a subscriber. It uses only notifyInput, query, pendingInputs, subscribe — exactly the API a remote consumer would have. Same UI works against an out-of-process artifact behind a WebSocket. Pepper is a role, not a layer.
Cartridges
A cartridge is a specialized pepper UI for a specific bundle — Tetris, Tic-Tac-Toe, others. It mounts in pepper mode, owns the main canvas, and talks to the artifact ONLY through the pepper passed to it. Subscribe to Quiescent for fixpoint re-renders, ContextAdded for incremental updates. Write only via pep.notifyInput. Never reach into state.graph for state input — that bypasses the validation. (Cartridges may still call state.graph.addContext for pure annotation, like ensureShapes minting tetromino extras, but never to fulfill a Choice.)
Shaker
Shaker is the assistant: a language model briefed with this documentation and a live digest of the artifact, reachable from the shaker button in the header in either mode. It is a fourth role with the same two lawful ways to write that you have. When it authors, it is an editor user: rule- and content-layer concepts, relations, triples, patterns and implications — never runtime. When it plays, it is a pepper client: pepper.notifyInput(choice, option), validated like any other. It never writes a CHOSE edge itself. Its best trick is reading: ask why a rule fired, fired twice, or never fired, and it runs the OF body and reports the bindings rather than guessing. Everything it authors is a fact in the artifact — X AUTHORED_BY Shaker — so MATCH (n)-[:AUTHORED_BY]->(Shaker) finds it, and a ledger in the drawer undoes it block by block or all at once. Four levels: Off (reads only), Explain (shows proposed edits, never applies), Suggest (one-tap apply), Author (applies as it goes, undo is one tap, and it looks on its own when a fire halts at the budget). The connection — Anthropic, any OpenAI-compatible endpoint, or local Ollama — is stored in this browser only.
Tabs, Actors, Axioms, Webs
The strip above the workspace holds real tabs. A view (Graph, Imports, Projects…) is one tab; a concept, pattern, implication or triple opens as its own tab — ⌘/ctrl-click or middle-click it in the sidebar, or press ⧉ in the side panel — showing its summary as a page. Actors is every concept that is a thing (not a relation, not a rule), grouped by layer; Axioms is what the artifact asserts: the implications, then every triple by relation. Both filter as you type and open rows as tabs.
A web is a curated view of the graph, Silky's idea: a named set of nodes with its own layout and physics switch, kept in the project. The Webs button swaps the sidebar for the list; + web takes the graph's current selection or query result. A web opens as a tab on the graph, filtered to its members, with a bar for adding or removing the selection, pulling in neighbours, toggling physics, and saving the layout — saved positions are pinned when physics is off.
Projects, files, Neo4j
The artifact persists in this browser. Name the graph in Save / Load and it becomes a project in IndexedDB, autosaved after every change — every layer, folders, locks, loaded-bundle bookkeeping, and the Shaker transcript and ledger — so a reload puts you back exactly where you were. The header shows which project is open; scratch means nothing is being saved. A project also travels as a file: download .salt.json and upload round-trip it (uploading a bare ontology JSON, such as a bundle or the lean export below, merges into the current graph instead). In Chromium, connect a folder mirrors every project to disk as name.salt.json through the File System Access API and pulls in any newer files it finds there. download .cypher writes the artifact as a Neo4j script: (:Concept) nodes labelled by layer and by IS type, relationships typed by context name with layer and origin properties, (:Pattern) nodes holding bodies as JSON, and (:Value) nodes for value-typed targets. Shaker can save, open and download with the save_project, open_project and download actions.
Compost
Long-running play accumulates runtime junk: superseded Positions whose successor exists, resolved Choices that already have a CHOSE and a THEN successor. Compost sweeps both, plus every triple touching the removed concept. Toggled in the pepper panel; on by default for Tetris because hundreds of steps each leave four superseded Positions behind. Compost never schedules a fire (removal doesn't trigger the auto-fire hook) so it's a pure shrink — no cascade. When composting a middle link in a THEN chain, compost rewires the chain (predecessor → successor) so a bundle-layer head doesn't lose its successor and re-fire.
Good patterns
Ontology is canonical, runtime is disposable, runner is dumb
The artifact is the source of truth. Anything you can derive from triples should be derived, not cached. The runner has no opinions — it matches patterns and fires. If a behavior isn't expressible as "given these triples, materialize these triples," it doesn't belong in a rule. Why: debugging is grep-the-artifact. There's nowhere for stale state to hide.
Current-state via FOR + AT_CELL + NOT newer UPDATES
Don't mutate position triples in place — mint a new position with UPDATES pointing at the old one. The current state is "every Position with no successor." This is the additive Position+UPDATES model: history is preserved, queries are local, compost is mechanical. Why: mutation is a debug-time enemy; a position chain you can walk lets you see every step the block took.
Bundle for structure, runtime for state
Cells, Rows, SOUTH-OF — bundle layer. Positions, Choices, FullRow stamps — runtime layer. The bundle survives compost; runtime gets cleaned. Why: the topology of the board never changes, so it should never have to be re-derived. The state of the board changes every tick, so it should be cheap to throw away.
Pepper-only writes for input
Any time the outside world makes a choice — a key press, a click, an actuator — go through pep.notifyInput. Don't write the CHOSE triple directly. Why: the pepper validation is the contract. Bypass it once and you can CHOSE a value that isn't in OF, or double-resolve a Choice, or fulfill something that isn't a Choice at all. The bug appears later, far from the bypass.
Quiescent over per-edge
For UI that renders the artifact's state, subscribe to Quiescent and render the whole view. Don't subscribe to ContextAdded and try to diff. Why: rules fire many edges per pass; a partial render between them shows torn states. Quiescent is the only event where the artifact is internally consistent.
Antipatterns
Multi-hop traversal in a single rule body
If your rule needs "any cell two-or-more rows above the cleared row," writing row1 ROW_ABOVE row2, row2 ROW_ABOVE row3 in one OF body only matches a fixed distance. Each rule fires once per binding per pass; salt doesn't do transitive closure. Why this fails: in Tetris, single-hop ShiftAbove meant cells one row above a cleared row dropped, but cells two-plus rows up never moved. Floaters everywhere. Fix is either to express the cascade as a single cartridge-side computation, or seed a transitive predicate at bundle time.
Bundle-layer concept as a chain head, runtime successor as the next link
Tetris seeds Spawn_0 (bundle) → Choice2 (runtime, minted by NextSpawn) → Choice_X (also runtime). When Choice2 gets composted, every triple touching it disappears, including Spawn_0 THEN Choice2. Spawn_0 is preserved (bundle), still has its CHOSE Cell_0_7, and no longer has a THEN successor — so the rule guard NOT spawn THEN nxt opens back up. Tetris_Spawn re-fires. A new block appears at Cell_0_7 on top of the still-falling current block. Why this fails: the bundle/runtime boundary is asymmetric in cleanup. Fix: compost rewires the THEN chain on removal (predecessor THEN composted-link's successor). Or: don't make the chain head a bundle concept; mint it at runtime.
Skipping the NOT newer UPDATES p guard
The at_cell pattern is three triples: p FOR b, p AT_CELL c, NOT newer UPDATES p. Drop the NOT and you match every historical position the block ever had. Gravity then moves all of them — past, present, and ghost — and the block "stretches" into a streak. Why this fails: the additive model keeps history precisely because nothing rewrites; the cost is that every "current" query must explicitly say "no successor."
Cell-by-cell rule bodies on a large grid
Writing a full-row detector as "N distinct cells in the same row with all-different bindings" is N! search work for the matcher. On a 15-wide grid that's already 1.3 trillion combinations to enumerate per pass. Why this fails: the matcher is brute-force across bindings; there's no row-aware index. Do scans like this in the cartridge with an occupancy map. Salt is for "given a specific local triple pattern, what follows" — not for aggregate queries over the whole board.
Direct graph mutation from a cartridge to fulfill input
Calling state.graph.addContext("CHOSE", choice, value) from cartridge code instead of pep.notifyInput(choice, value) works — once, with no validation. Then you find yourself debugging why an already-resolved Choice is firing twice, or why a value that isn't in the OF options is being processed. Why this fails: pepper is the broker because the artifact alone can't tell a legitimate input from a bypass. The validation is the difference.
Closures over state.graph across re-mounts
If a cartridge mount captures const g = state.graph and then the graph is replaced (file load, mode switch, etc.), the cartridge holds a reference to the old graph. Writes go to a graph nobody reads. Why this fails: state.graph is the indirection — always reach through state, never cache. Or pass pep down and use pep.query, which always reads the live graph.
Reading concept.types directly
The Concept object's types array is a denormalized hint set at construction time. The truth is the IS triples in the artifact. If a rule fires c IS Chosen at runtime, concept.types still says ["Option"], but isA(c, "Chosen") returns true via the IS edge. Code that reads .types sees a stale view. Why this fails: the artifact is the truth; the object is the cache. Always go through isA.
The short version
Write rules as if the artifact is going to be inspected with grep, because that's how it gets debugged. Make state additive — supersede, don't mutate. Push aggregate queries to the cartridge; keep rules local. Funnel every input through pepper. Compost runtime, preserve bundle. When something behaves strangely, walk the position chain — the answer is in the triples.