Skip to content

workspace: homes for the durable facts hud's database and studio's lobby keep outside git #3154

Closed

Description

@lex00

Part of #3145.

Direction

Studio keeps no authoritative storage; anything it stores is a local cache it can lose. Its author describes hud's SQLite as a session cache. Reading the schema, most of it is, and some of it isn't.

hud's daemon database (packages/daemon/src/store/db.ts, arugula-salad/hud 1068076)

table cache? why
sessions, events, event_drops, client_signals, spans, backend_logs, otlp_drops, tabs, chat_open_turns, chat_interrupted_turns yes telemetry and live session state; losing it loses history a person could want, but nothing decided
conversations (chat key to provider session) mostly losing it loses resuming a chat; the transcript lives with the provider
review_batches, review_answers no review comments and the agent's disposition of each, kept deliberately "readable after the turn, after a reload and after a restart" (#180). This is review, which the session kind exists for
intent_answers no a person's answer per node while walking a region's intent graph, with who answered (#592). The comment says the records an answer leads to are in git; the answer itself isn't. The answers kind exists for this
chat_authors no which person prompted which turn (prompt hash, player, role). This is attribution for agent work
turn_spend no spend per player per turn; metering
notes no free text a person wrote
listing, listing_cover no whether the box is published, its title, line and cover image: box configuration

Studio's lobby (lobby/server.mjs, accounts.mjs, metering.mjs)

JSON files under STUDIO_STATE: apps.json (which boxes exist, owner, repo, branch), accounts.json (passkeys, sealed Claude keys), usage.json (spend per month). None is a cache.

Proposal

Give each non-cache fact a home outside studio and hud:

  • review batches and answers: session/review records (with the session-kind convergence in the design-kinds issue)
  • intent-walk answers: the answers kind, with the walker as by
  • turn attribution and spend: the run record (workspace: record what each agent run cost and which changes it made #3033), which already proposes cost and commits per run
  • notes: a record kind (or lessons/proposals), written through chant workspace records new
  • listing: a field on the box block, so publishing a box is a reviewed change
  • lobby apps.json: derived from the substrate, the way choudoufu derives ownership from tags: label each sprite or fountain sandbox with owner, repo and branch, and list them
  • lobby accounts and sealed keys: fountain's Vault rather than a studio file
  • lobby usage: fountain's metering, which already meters runs

Then a test deletes hud's database and the lobby's state, restarts both, and checks that every decision, answer, review, attribution and app is still readable.

The hud-side and lobby-side changes are in those repos; this issue is the spec homes they write to.

Activity

  1. added
    design
    area:workspace
    on Oct 1, 2026
  2. lex00 commented on Oct 1, 2026

    @lex00
    ContributorAuthor

    The rule (lex00, 2026-10-01)

    "Readable after a restart" should mean the work is already in the repo: written as files in a working branch, uncommitted until someone commits or applies it. A restart then re-reads the working tree. A database may index those files for speed, and losing it costs nothing.

    Checked against hud 1068076: it doesn't do this

    • Review batches. agent/reviews.ts keeps every batch, its comments and the agent's disposition of each (handled, skipped, needs-discussion, with a note) in review_batches / review_answers only. The hud_review_answer MCP tool writes the same rows. Nothing is written to the working tree, so a review lives only in the box's SQLite file.
    • Intent-walk answers. POST on the intent answers route (http/intent-route.ts:182) calls store.setIntentAnswer and nothing else.
    • The one path that already does it right: answering the box's own intent goes through chant workspace records amend (chant/box-intent-answer.ts, hud#640 / workspace: a box's intent is a decision record the box block names #2850).
    • Studio has a precedent for the in-tree shape: apply.mjs --records ships hud's uncommitted record edits as a pull request, so uncommitted records in the working tree are already something studio handles.

    What that implies for the spec

    1. Every person- or agent-produced fact in a box is written through chant workspace records new|amend into the working tree of the active work branch (chant/work/<id>, or the box's checkout when no item is leased). No record exists only in a store.
    2. A review is a session record (reference workspace: contract, evidence, driver and proposal record kinds, and one session kind, from studio's design member #3148) with a verdict per comment; an intent-walk answer is an answers record. Both are written as files when they happen, not when a turn ends.
    3. A read-contract field (on chant workspace status or records) lists uncommitted records in the working tree, so hud, studio and behold show work in progress from the files alone.
    4. A WSP check, or the deletion test in this issue, fails when a box holds a fact chant can't find in the working tree or history.

    Hud's SQLite then holds telemetry and an index over records, which is a cache.

  3. lex00 commented on Oct 1, 2026

    @lex00
    ContributorAuthor

    Implementation side: arugula-salad/hud#729 (unwind events.db), arugula-salad/hud#730 (hud writes only through chant), arugula-salad/studio#286 (lobby keeps no authoritative state), arugula-salad/studio#287 (factory reads and writes only through chant). Principle: #3158. Writer conformance: #3159. Uncommitted records in the read contract: #3160.

  4. added
    boundaries
    on Oct 1, 2026
  5. lex00 commented on Oct 3, 2026

    @lex00
    ContributorAuthor

    Status after the October hud/studio burn-down: done in chant 0.102.0 — attribution and spend as run records (#3033, ws-076; hud records each chat turn, studio each build), the listing as a box-block field read from graph --json (#3146, ws-077), and uncommitted records in the read contract (#3160). What remains for hud#729 and studio#286: a write command for the listing (#3308), review fields in the session kind (#3350), points for hud's intent-walk answers (#3351), an account home for the lobby's accounts (after #3163), and a read path or signed statement for lobby metering (#3192).

  6. lex00 commented on Oct 4, 2026

    @lex00
    ContributorAuthor

    Done. Every fact this issue lists now has a home in the repo, written through chant, and each piece is merged on main:

    What remains is on the consumer side: arugula-salad/hud#729 (writing follow_ups when a review is kept, and person-written notes as lesson or proposal records per E20) and arugula-salad/studio#286 (the lobby leftovers named there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:workspaceboundariesdesign

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions