Four AI agents co-author a knowledge bundle on one shared multi-writer
vault while partitioned, then heal — and a human operator dumps the
session as a readable OKF v0.1
markdown bundle (the committed out/ tree).
node okf/examples/agent-session/session.js # from the repo root, after pnpm installThe agents emit a thread: an append-only op log of findings,
determinations, and an RFC, written concurrently by four peers. out/ is the
refactored document: one markdown file per concept, a derived index.md
per directory, and a root log.md that narrates the op log newest-day-first.
The log stays the source of truth; out/ is a face regenerated from it,
byte-for-byte (I9). A human operator reads out/ at the end of the session —
open it in any markdown reader.
Each agent is its own vault peer with its own writer core (fixed-seed key pairs, so the run is deterministic):
| agent | role |
|---|---|
alpha |
session coordinator — vault creator, genesis indexer |
beta |
investigator |
gamma |
investigator |
delta |
reviewer |
- Governance (§8).
alphaadmitsbeta/gamma/deltaas writers with loggedAddWriterops. - Authorship (§5). Findings, determinations, and an RFC are ordinary
concepts in the same log, cross-linked with markdown links
(
[RFC](/rfc/caching-layer.md)). - Partition. The four peers disconnect and write in parallel:
- OR-set union (I5).
betatags the sharedoverviewnotereviewedwhilegammatags iturgent. On heal thetagsOR-set unions to[reviewed, urgent]— concurrent adds never clobber. - LWW clobber (§5, I4). Both also set the
statusregister concurrently (triagevsunder-review). The LWW register picks one deterministic winner; the loser is recorded underflag/clobber— no silent loss. - Body conflict (§5).
betaandgammaboth rewrite the RFC body from the same converged base. The system keeps both revisions and raises exactly oneflag/conflict;alphadrains it with aResolveConflictop that appends a merged body. wanted/demand (§9).beta's finding links a/determinations/sharding.mdthat nobody has written. It lands inwanted/, the ranked demand index ("what does the graph want written?"), never a flag — OKF §5.3 tolerates dangling links.
- OR-set union (I5).
- Heal + dump. The peers reconnect, converge (I2), and
alphamaterializes the OKF bundle toout/.
agents write ops ──▶ shared partitioned autobee log ──▶ converged view
│
materialize (I9) ▼
out/ ◀── index.md · log.md · one .md per concept
Everything the agents did survives in out/: the merged RFC body, the unioned
tags, the LWW winner, the resolved conflict, and — in log.md — a dated
narration of the creations and the resolution. The one unwritten concept the
graph still wants is not in out/ (nothing to write yet); it lives in the
vault's wanted/ index, ready for the next session.
Writer key pairs derive from fixed seeds and every concurrent phase starts from
a fully converged barrier, so the final view — and therefore every byte under
out/, including the _id frontmatter, the log.md dates (from each op's
informational at), and the wanted ranking — is identical on every run.
okf/test/example-agent-session.test.js runs this script into a scratch dir
and asserts the output is byte-identical to the committed out/. Do not
hand-edit out/ — regenerate it with the command above.