KITSOKI
Learn · Notebook

The technical vision: one closure, one log, one language

A runtime like git plus sqlite, an application log that is a cube of minimum facts, and one model from the pixel to every crossing.

Kitsoki·
Read the paper and learn more
Contents
  1. Four guarantees, six moves
  2. Git plus SQLite: the closure and its sidecars
  3. Event sourced by the A-WAL: the minimum facts that replay
  4. Kitlark: one model from the pixel to every crossing
  5. A dynamic, executable ontology
  6. Observation is a pivot of facts
  7. Followers: clones, delegation, federation and merge
  8. One program, every reality
  9. Order without a clock
  10. The agent is a function on one plane of authority
  11. One door for change, steered by measures
  12. Three primitives underneath
  13. This page is a projection too

Kitsoki treats an application the way git treats source and SQLite treats a database: as one self-contained, versioned unit that moves anywhere and means the same thing when it arrives. An application is a closure plus sidecars. Its history is a log of the minimum facts that replay it. One language, Kitlark, models it from the pixel to every interaction with its environment, and that model is the domain's ontology, running. Observing it, simulating it, federating it and improving it are the same few mechanisms applied again.

This page is the map. Each section states one move of the vision in a paragraph, shows it small, and presents the features and requirements that carry it; the linked chapters hold the detail. The page plays as a deck, one slide per section, and as a lesson in the same order.

Four guarantees, six moves

Kitsoki makes four guarantees about every application it runs: its order is causal, its world is closed and proven, its decisions are pure over durable state, and its authority is one plane. Six moves deliver them, and each is a section of this page:

Move In one line
Closure plus sidecar The application is one digest; what belongs to an environment is bound to it
The A-WAL History is the minimum facts that replay it, and those facts are a cube
Kitlark, end to end One model from each UI part to each crossing, checked whole
The executable ontology The domain model and the program are the same thing, and it keeps changing
Observation is a pivot Watching any domain, the system included, is a cube over facts
Followers Clones, drafts, children, replicas and federations are one mechanism

The remaining sections name what those moves rest on and what they make possible: one program on every reality, order without a clock, authority that never widens, change through one door toward measured goals, three primitives underneath, and documents that are projections of the same graph.

Git plus SQLite: the closure and its sidecars

A git repository is its history, whole, in one directory. A SQLite database is its data, whole, in one file. A Kitsoki application is both: its code, its data and its config are one content-addressed closure, named by a digest. Two environments that hold the digest hold the same application, byte for byte. Rollback is reselection, a preview is a selection for one person, and a clone is a fork.

What does not belong in the closure is what belongs to an environment or a person: credentials, personal data, provider endpoints, a tenant's keys. Those live in sidecars. The closure names each sidecar by id and by the capability it needs, never by value:

class Release(Record):
    repo: Repo
    forge: Secret[ForgeToken]        # a handle; the value stays in its sidecar
    owner: Pii[Email]

class App(Application):
    forge: Sidecar[Forge @ "1.4"]    # any binding that offers Forge 1.4
    directory: Sidecar[Directory]

The checker proves the closure against the capability. The environment binds a sidecar that offers it: production's forge credential, a tenant's own, a recorded cassette, a simulation. So the same digest runs for another environment or another person with a functional equivalent bound in, and moving an application moves no secret and no personal data.

Event sourced by the A-WAL: the minimum facts that replay

Every change an application makes goes through the Application Write Ahead Log. A crossing is written before it runs and its outcome before the program sees it; a change to data is a changeset appended at a position. If it is in the log it happened, and if it is not it did not.

The log holds the minimum facts a deterministic playback needs, and nothing a pure function of them can rebuild:

Fact Holds
intent what was asked, with its typed slots
read the snapshot position the decision read
crossing the request key and the outcome
transition the stage the item moved to

Code and artifacts appear as immutable references by digest. Sidecars appear as ids, so history holds handles and never a sealed value. Tables, indexes, screens and reports are projections of these facts.

Because decisions are pure and every input is a fact, replay is exact: a session runs again turn by turn with no operation called and no model asked, a crash resumes at the last recorded point, and a replay against a fix stops at the first turn that decides differently. The same facts, with sidecars bound by capability, play back on a laptop, in a test or in another environment.

Kitlark: one model from the pixel to every crossing

Kitlark is a system modeling language that reads like typed Python. One program states the whole application: the parts a person sees, the queries those parts bind, the stages and intents behind them, the data model, and every crossing to the environment (an operation, a model, a clock, a store, a person).

class Editing(Proposal):                       # a stage is a class
    def submit(self, title: str) -> Opening:   # an intent is a method, and it is pure
        return Opening(self, title=title)

class Opening(Proposal):
    def work(self) -> Effect:                  # the one crossing this stage issues
        return forge.open_pr[PullRequest](title=self.title, branch=self.branch)

Nothing is ambient and nothing is implicit. The checker reads the program as a closed world and follows every path through it before anything runs: a button to its intent, the intent to its stage, the stage to its crossings, each crossing to the capability granted for it, each query to its cost on the real instance's statistics. A defect the source decides is refused at draft time, in seconds, with one diagnostic that names it. A failure at run time that a check could have caught is a defect in the checker.

A dynamic, executable ontology

An ontology says what exists in a domain. The tradition that produced ontologies stopped at the edge of behaviour: a schema says a reservoir has a capacity and cannot say how it fills or when it must release. Kitlark puts both in one program. Kinds are classes, relations are typed edges, measures say how things add up, laws say what must hold, and stories say what happens.

So the data model, the actions a domain allows, the interactions with its environment and the structure of the application are one ontology, and it executes. The program is an ontology too: its stages, intents, operations, grants and tests are entities in the same graph, which is why validation, coverage and diagnosis are queries.

It is dynamic. A new kind, a corrected law or a changed stage is a revision like any other change: checked against the live bindings, admitted, and taken up by running sessions at their migration points, while the system it describes keeps running. Every ontology teaches itself: its course, its lessons and its playground are views of the same model.

Observation is a pivot of facts

Observing a domain is reading a cube of facts about it. A measure's readings are fact rows whose dimensions are graph members, never strings: this reservoir, this stage, this operation, this closure. The same aggregate read answers how full the basin is and why an endpoint is slow.

The system observes itself the same way. Each A-WAL entry is a typed fact, so an application's own history pivots by stage, intent, crossing and actor. Runtime samples, model calls, landed code edits and a study's results are fact types beside it. One client reads, caches and re-pivots them for every page, the pivot zoom matrix walks them at every scale, and a watch over an observed, forecast or simulated measure raises the same decision.

Followers: clones, delegation, federation and merge

Everything that holds a copy is a follower, and a Link declares how it follows and what comes back. One mechanism at different scopes:

Follower Follows Returns
draft the head it tracks, with its own edits on top a commit
clone or child a fork at a position a pull request over its log
read replica, warm standby everything, continuously nothing, or everything by switchover
worker, field task a scope at a position records, when online
federation member the namespaces it mounts writes to the namespaces it owns

A namespace has one writer. A mount names where a subgraph lives, a writer record names who writes it, and readers resolve once and go direct, so a parent delegates a subtree and stays out of its data path. Owners federate the same way: each agency or company writes its own namespaces, and a shared picture is a union read with every part's provenance, with no central copy.

What comes back merges by declared strategy: lines, syntax, identity, field rules, regeneration. What does not merge is a Conflict, a tracked Thing with one decision, shown where the item is.

One program, every reality

A program touches the world only through crossings, and a crossing is answered by whichever provider the environment injects. That is the sidecar idea applied to every effect. The same closure runs on each tire with only the answerer changing:

Tire Each crossing is answered by
explorer every outcome the declaration allows
simulation a model of the provider, at accelerated time
replay the recorded outcome in the A-WAL
cassette a sealed recording of a real run
real the provider

Simulation is the test tier: a design is studied on paired seeds before it is built, and simulation and the real instance are held to agree. A capability matrix places every effect on the host that can answer it (browser, CLI, edge, cloud, worker) or refuses the story at draft time.

Order without a clock

There is no global clock and none is needed. Every actor carries a cone: one position for each namespace it has seen. Every request carries the cone, and a receiver joins it before acting, so no actor sees an effect before its cause. Two events compare as before, after, indeterminate or dead, and nobody is shown an order that nobody knows.

Each actor stays available in its own region through a partition and meets the others at a namespace's one writer. Outside declared contention points, admission order changes no state. Agreement has a scope: one cone for a writer, two for a Link, n for a federation, and its cost is the round trip to the farthest cone in scope.

The agent is a function on one plane of authority

The state machine is the main loop. A stage decides who decides the next move: the program, a person or a model. A model is called as a typed function over one bounded snapshot, chooses among the moves the stage offers, and returns data checked against a schema. It never defines a move and never holds control flow.

Authority is one plane for people, sessions, jobs and agents: one catalog of operations, one authorizer on every crossing, the import section as the grant, references that cannot be forged. Code and authority are held apart, so a model edits the application it runs in, and any person runs their own checked revision of any application, and neither widens what it can reach. Sealed values reach programs and models as handles.

One door for change, steered by measures

Every change to anything is a commit through one door: a graph item, a document section, a data row, an application. The door is draft, check, review by explicit reviewers, gate, pin, ship. A draft is a follower with its own edits on top. Every commit carries its audit record in the same append.

What the system is for is stated the same way it is observed. A measure is a cube reading, an objective is a target on a measure, and GoalSeek works the gap of any Thing through the change flow. Judgment enters at typed decisions on one channel, and every decision improves through one governed Improvement Process under a fixed charter. A north-star document describes the finished system; its distance is computed from the items its sections present, and its unshipped sections are GoalSeek's work.

Three primitives underneath

Correctness rests on three things every provider offers: an object store with conditional writes, a machine that runs one binary with a disk it may lose, and HTTP ingress. The object store is the durable state and a disk is a cache. A second writer is fenced by the conditional write, at the place the damage would happen.

A namespace is one file with one writer, and capacity is the number of namespaces. An application nobody is using costs storage and nothing else, and serves again within seconds. Any host serves any namespace. The same closure runs in a browser tab, a CLI, an edge worker and a dense cell host, and a person host works offline and syncs through the authority.

This page is a projection too

A document is a Thing of Things. Its prose carries no fact of its own: every claim is a graph item a section presents, with its chain to the evidence. This page reads as the north star, located with each section's gap, or projected at a readiness.

A deck is a projection of a notebook for an audience: one slide per section, speaking the section's words and linking the items it presents. A lesson is the same notebook with a play order. A corpus is a Thing whose parts are notebooks, so the whole body of documents nests into one deck, and the navigator walks it at every scale. The technical vision is presented from the system it describes.

← All of Learn