Docs/Data model

Data model

What a lesson is on disk, and how the graph is shaped.

Node — one lesson at one level of abstraction#

id: n_7f2a91
family: retry
title: Retrying flaky services
gist: Retry idempotent remote calls; S3 needs body parsing.   # the routing view
level: 3
status: active            # active | superseded | demoted | disputed | archived
origin: compression       # reflection | compression | manual
conflict: ""              # an unresolved contradiction, surfaced at recall
derived_from: [n_c41b, n_9de1]   # points DOWN, toward detail
parents: [n_aa01]                # points UP, toward abstraction
covers_tasks: [e_4f1a, e_9c22]   # the regression set
dropped: [...]                   # the delta manifest
preserve: [...]                  # hints from rejected compressions
load_bearing: [...]              # spans observed doing work, for the compressor
stats: {attempts, successes, failures, expansions, rescues, last_used}
Both edges are lists, so this is a DAG, not a tree. A lesson can be abstracted along more than one line, and a lesson reached from two directions must acknowledge both. While the parent link was a single field, the second abstraction silently destroyed the first.

Episode — a replayable regression test#

id: e_4f1a
prompt: "add retry to the http client"
outcome: success
served: [n_7f2a, n_c41b]   # what was injected
used:   [n_7f2a]           # what actually bore on the work
accepted_summary: "..."    # what the agent ended up doing

This is the ambient oracle. Nobody writes YAML oracles for their own repo, so instead ROSE records what happened when work was accepted, and later asks whether a compressed lesson still reproduces it.

Store layout#

.rose/
  config.yaml          settings
  nodes/<family>/*.md  the graph. Worth committing.
  episodes/*.json      the replay corpus. Worth committing.
  sessions/*.json      per-session scratch. Machine-local.
  events.jsonl         telemetry. Machine-local.
  judge-cache.json     cached judgements. Machine-local.

Two scopes. If ~/.rose exists it is layered under the project store: both are recalled, new lessons are written to the project one, and editing a global lesson writes back to it rather than forking a local copy that drifts.