factfactfactanchorfactfactnewappend-only

Context from Tape

A unified fact model for long-running, multi-team work.
It also extends to observability, eval, and training.
Practiced in bub.build, view source

Explore
01

The Minimal Model

Four core primitives

TapeEntriesAnchorsIndexderivedViewExecutionnew entries
Tape
Chronological sequence of facts
Entry
An immutable fact record
Anchor
Logical checkpoint for state reconstruction
View
Task-oriented assembled context window
Invariants
01

History is append-only, never overwritten

02

Derivatives never replace original facts

03

Context is constructed, not inherited wholesale

02

Append

The sole operation that mutates facts — writing to the tape’s tail

WorkerTapeappend(entry_101)append(entry_102)append(correction_103)corrects 101; keeps 101[... 101, 102, 103]time
01

Order is trackable via monotonic IDs

02

Old facts cannot be modified in-place

03

Corrections are made by appending, not deleting

03

Anchor

A reconstruction marker, not a deletion point

e1e2A1discoverye4A2implemente6e7preservedrebuild from here
01

Full history preserved before the anchor

02

Rebuild from anchor, skip full scans

03

Anchors can carry structured state payloads

04

Handoff

A constrained phase transition

DiscoveryhandoffImplementhandoffVerifystate: { phase: "implement", summary: "Discovery complete." source_ids: [128, 130, 131], owner: "agent" }
01

Write a new anchor

02

Attach minimum inherited state

03

Shift execution origin past the new anchor

State Contract Example
{ phase: "implement",
  summary: "Discovery complete.",
  next_steps: ["Run migration", "Integration tests"],
  source_ids: [128, 130, 131],
  owner: "agent" }
05

Session Modeling

Defining the boundaries of context selection

A

Single Session

Entries share one timeline

Session Aturn 1turn 2turn 3turn 4...entries share one timeline
B

Multi-turn

Assembled from latest anchor

T1T2T3T4T5T6anchornot in default viewassembled on demand
C

Multi-session

Independent timelines; cross-session is opt-in

Session Atape A timelineSession Btape B timelineisolated by defaultexplicit cross-query(actively chosen)
D

Topic Threading

Each topic binds an anchor; repeats trigger recall

T1T2T3T1*anchor recallTopic View (T1)Topic View (T2)human and agent collaborate via organized anchors
06

Context Strategies

Three mechanism Budugs for compact, summary, and fork-merge

Compact

problemContext exceeds the window limit

e1e2e3e4e5e6e7e8...preserved, not in viewdefault read sethandoff + anchor + selective view

key:compact ≠ delete history; shrink default read set

Summary

problemNeed a high-level overview for the next phase

e128e130e132anchor.state"Discovery is complete."source_entry_ids: [128, 130, 131]nextraw entries (jump back)

key:Summaries cite sources; hints only

Fork / Merge

problemNeed parallel exploration with controlled convergence

Main TapeFork Tapefork(at id=120)120append121122123merge(new entries only)append delta only, no rewrite

key:Merge appends deltas only; no mainline rewrites

07

Memory

Complex memory assembled from anchor graphs

TapeAnchor GraphMemory Viewe101e102e103A1A2A3A4Viewassembledanchorsassemble
Why Complex
01

Anchors can form non-linear graphs, not a single timeline

02

Memory views assemble from multiple nodes, guided by policy

03

Graph structure requires explicit lineage and provenance

08

Teams

Teams coordinate via shared tapes and cross-tape views.

A

Shared Tape

Multiple agents append the same tape; entries keep their origin

Shared TapeAgent AAgent BAgent CA:201B:202C:203A:204append-only timeline

Append-only; ownership remains traceable

B

Cross-Tape View

Teams read each other's tapes via views to coordinate

Team ATeam BTape ATape BA1A2A3B1B2B3View from Tape BView from Tape Aviews assemble cross-tape context

Views are assembled; tapes remain isolated

09

DAG Workflow

A topic automation model split into task semantics, behavioral constraints, task description, and runtime truth

Task SchemaTask ConfigTask HarnessTask CreationTask DescriptionRuntime Source of TruthArtifactsdag node scopeAtask_initAnode_inite*entriesAnode_finAtask_checkpoint{...}dag.node*Atask_findag.node#0dag.node#1dag.node#2dag.node#3
Task as View Assembler

Here, Task is a special View Assembler: one task maps to one topic, assembling Task Schema, Task Config, Task Harness, and Task Description into a runtime-executable view; each DAG Node maps to one turn boundary inside that topic.

01schema

Task Schema

Declares task structure: node boundaries, dependencies, artifact contracts, and task presentation.

It answers which structure this task runs through.

02config

Task Config

Holds stable task-level configuration such as defaults, business rules, target environments, and external system constraints.

It answers which rules this task runs with.

03task

Task Description

Captures one task's business brief, scope, interpretation, delivery preference, and human confirmation.

It answers what this run should do.

04harness

Task Harness

Constrains executable agent behavior, for example with scripts/*.feature files that fix acceptance boundaries, run paths, and forbidden moves.

It answers what the agent must do and must not do.

05runtime

Runtime Source of Truth

After topic creation, runtime owns the authoritative projection; DAG anchors only record summaries, audit events, and lookup checkpoints.

Read runtime snapshots for state; read DAG anchors for boundary events.

10

Appendix

Four extensions: access control, observability, eval, and training.

A

Access Control

If each tenant owns a database and tape is just one table inside it, the database and table already define the isolation boundary. Auditing a child account only needs explicit read access to the target tape table or a read-only view.

Adminaudit scoperead roleBoundaryownergrantread-onlyUser ADatabaseTape TableUser BDatabaseTape TableAuditread-onlymulti-userno owner / no write

Keep the database objects themselves as the source of truth. Audit access should use constrained read-only roles instead of reusing the owner identity.

B

Observability

Tape can retain sessions, tool calls, and runtime events. The same append-only facts can power replay in the UI or let bub explain what happened.

SessionTapeanchormsgtooleventsame append-only factsderived viewstimelinereplayqa contextTrace UItimeline / replayAsk Bubinspect / explain

Context assembly and observability consume the same append-only tape, and every outlet is built from derived views. So besides the UI, you can ask bub directly.

refbub architecture
C

Eval

Slice by anchor, replay history, inspect decisions, then write scores and labels back as derived facts.

Tape SliceHuman ReviewDerived Factsanchor A12tool / event / msganchor A13bounded by anchorshistory replaydecision checknotesappendscorelabelrationaleReplayhistory stays visibleCheckdecisions stay inspectableRecalllabels stay linked

Show the path and decisions to people first, then append derived annotations.

refPhoenix
D

Training / RL

Tape works with frameworks such as AReaL: slice by anchor, attach rewards, and export trajectories.

Agent RuntimeTapeRL Trainersession/starttool + event traceassistant turnsexportepisoderewardprovenanceProxy InputOpenAI-compatible runtimeAsync Updatetrain after enough episodesNext Sessionserve newer weightsepisode refresh / weight refresh

The training layer should consume tape exports, not replace tape as the raw record.

refopenclaw example
11

Conclusion

Placing context problems back into this model yields a stable research framework

01Define Factstape / append02Phase Boundariesanchor / handoff03Assembly Strategycompact / summary / fork-merge04Advanced Collaborationmemory / teams05Appendixobserve / eval / traina stable research framework