Skip to content

Tool or plugin to accept AI session recordings (append-only JSONL, schema-free) #1853

Closed

Description

@dezren39

Relocated from dezren39/darwin-nix#292 on 2026-10-28 (placement audit): The session-recording tooling idea (a tool/plugin to accept AI session recordings, append-only JSONL) is agent/fleet infrastructure, not nix configuration. Original body below; issue references inside it are historical (dezren39/nix numbering).


Today an agent session produced roughly a dozen observations worth keeping and every one would have died with the session. They are now hand-appended to ~/git/ai_recordings.jsonl, and instructions/recordings.md asks agents to keep doing that (wired into opencode.jsonc). This issue is for the tooling that should eventually replace the hand-append.

What gets recorded

The moments an agent already stops to explain to the user. That framing is the whole trick — it needs no new judgement call, just a second destination for something already being written:

  • a significant discovery
  • a mistake the agent made, including miscounted or stale numbers
  • a subagent that ignored its brief, or followed it too rigidly
  • a review finding that was wrong, or right for the wrong reason
  • a fix that made things worse
  • a tool that lied — reported success while the thing it checked was broken
  • anything producing surprise, guilt, irritation or relief

Real examples from the first session:

  • "Adding a 120s ceiling without an outstanding-worker guard made pool exhaustion faster than the bug it fixed — before the ceiling, a user hammering retry was throttled by the hang itself."
  • "The test was shaped like the assumption under test." (An httpx float timeout=30 is four independent inactivity limits, not a total deadline; the stub modelled it as one budget, so the test certified the same misunderstanding as the code.)
  • "I told the agent __proto__ was the same family as hasOwnProperty. It measured, and it is the only name with that divergence — a transport hazard, not a runtime one. My framing would have sent the fix to the wrong layer."
  • "The verifier had five independent soundness bugs, and the entire cutover proof rested on it."

Schema — deliberately almost none

sentiment is any. A dict of arrays ({"positive": [...], "negative": [...]}), a bare "good", a tag list, {"fixed": true} — whatever expresses it. Do not make agents flatten a feeling to fit a shape; the flattening is where the signal goes.

A starting shape, all fields optional, unknown keys allowed:

{"ts":"2026-09-30T22:41:00Z","pwd":"/where/it/happened","repo":"operations-portal","origin":"git@github.com:org/repo.git","kind":"short-slug","sentiment":{"positive":["measured instead of trusting the brief"],"negative":["my framing sent it to the wrong layer"]},"note":"What happened, with evidence.","lesson":"What to do differently."}

Three submission styles should all be accepted, because all three beat silence:

  1. Copy the segment sent to the user, plus a sentiment tail. Lowest effort, still useful.
  2. Loosely structured, would fail a parser. category=bad judgement | finding: ... | result: ... {grade: F, ...}. Normalise later.
  3. Fully populated schema with the real request/response objects embedded. Ideal.

Only hard rule: append, never edit or rewrite. Reading is allowed but not required.

What the tool should do

  • Accept a line over some cheap interface — a CLI (record '<json>'), an opencode plugin hook, or an MCP tool. Cheapest possible call site; an agent mid-task will not stop for ceremony.
  • Never reject. A malformed line costs one normalisation pass later; a rejected line costs the observation permanently, and the observation is the scarce part. Quarantine unparseable input to a sibling file rather than erroring.
  • Stamp what the agent would otherwise have to gather: timestamp, pwd, repo common dir, origin URL, session id, model, maybe git HEAD.
  • Rotate by size, like the JSONL journals elsewhere in this config.
  • Be a no-op when the target is unwritable — recording must never fail a task.

Later, a dedicated agent extracts these into a database. That is why detail now is cheap and absence is permanent.

Open questions

  • Should the plugin capture automatically (on subagent completion, on a failed gate) or stay agent-initiated? Automatic capture gets volume; agent-initiated gets judgement. Probably both, tagged by origin.
  • Per-repo files or one global? Currently global at ~/git/ai_recordings.jsonl with repo/origin fields, which keeps cross-repo patterns visible.
  • Is there a privacy boundary? Recordings quote real failure text and file paths, and a leak like DETAIL: Key (secret)=(...) was found in a log path today. Probably worth reusing whatever redaction the host repo already has.
  • A schema.md with all-optional fields, common value types, and notes on when each is used — useful without becoming a gate.

Related: instructions/recordings.md, opencode.jsonc (instructions array).

Acceptance criteria

  • A tool (CLI or plugin) appends a recording entry to the recordings file in the documented JSONL shape, replacing the hand-append workflow described in the issue.
  • All schema fields are optional and unknown keys are preserved; sentiment accepts any shape (string, list, or dict of arrays) without flattening or validation loss.
  • Appends are append-only and safe under concurrent agent sessions (no truncation or interleaved partial lines).
  • instructions/recordings.md / opencode.jsonc wiring points agents at the tool instead of the manual file edit.
  • A round-trip test shows an entry written by the tool reads back byte-identical in the fields the agent supplied.

Activity

  1. developing-today commented on Oct 28, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    History carried over from dezren39/darwin-nix#292 (verbatim, oldest first):


    @dezren39 · 2026-10-27T14:50:42Z

    Intake review

    Fleet-monitor intake pass (2026-10-27). No related open issue covers this tooling (the recordings practice itself lives in instructions/recordings.md and ~/git/ai_recordings.jsonl, per the issue). I appended acceptance criteria and normalized labels (kind/enhancement, priority/low, effort/m).

    Notes / risks: the deliberately-almost-none schema is the feature — any implementation that grows validation will destroy the signal the issue is designed to capture. Suggested approach: a tiny append-only writer (lock + single-line append) plus the instructions wiring; keep parsing permissive on the read side.


    @dezren39 · 2026-10-28T19:19:22Z

    Triage verdict (task 2316): CONFIRMED — still unimplemented; the hand-append workflow this issue replaces is still the live workflow.

    Verified at dezren39/nix main efd3161:

    • instructions/recordings.md still instructs agents to hand-append JSON lines to ~/git/ai_recordings.jsonl, and its closing line points at this issue as the future tool: 'Future: see dezren39/nix for the tracking issue on a tool or plugin to accept these directly.'
    • No tool exists: a recursive tree listing at main finds exactly one path matching 'record' — instructions/recordings.md itself. Code search for ai_recordings hits only docs (instructions/recordings.md, ARCHITECTURE.md, instructions/work-strategies.md).
    • No duplicate or successor issue: search for 'recordings' in this repo returns only CI: the id workflow gates PRs for ~2 hours — split e2e out and fail fast #292.
    • The opencode-global.jsonc wiring still loads the instruction (the 'wired into opencode.jsonc' premise holds).

    Routing: first-slice implementation enqueued as task 2643 (queue repo-health-nix-pilot, dedupe repo-health:v1:fix:dezren39/nix:issue:292) — a record CLI in the repo's script+test pattern covering the acceptance criteria (never-reject + quarantine, stamping, atomic append under concurrency, size rotation, no-op when unwritable, byte-identical round-trip of supplied fields / any sentiment shape), plus pointing instructions/recordings.md at the tool with hand-append as fallback. The open questions (plugin/MCP interface, automatic capture, redaction boundary, per-repo files) stay open here for later slices — the packet does not decide them.

  3. added
    priority/lowNice to have; do when convenient
    effort/mMedium: expected under 1 day of work
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    queue/queuedHas a queued task in the Supabase agent queue
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 28, 2026
  4. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  5. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    Premise check (fresh reads, 2026-10-28):

    • The hand-append workflow is real and current: instructions/recordings.md in dezren39/nix (present on the laptop clone) prescribes appending JSON lines to ~/git/ai_recordings.jsonl, all-optional schema, sentiment is any shape, append-never-edit — and its own footer points at the tracking issue for "a tool or plugin to accept these directly." That tracking issue is this one (relocated from Tool or plugin to accept AI session recordings (append-only JSONL, schema-free) dezren39/darwin-nix#292).
    • No tool exists: code search in developing-today/code finds no ai_recordings reference and no recordings tooling (only an unrelated world-fixtures doc mentions the word); a recursive tree search finds no recording path.
    • Gap the filing didn't state: no ai_recordings.jsonl was found on the sandbox (home, depth 3) or the laptop (home, depth 4) at triage time. Either it lives somewhere else now or the practice currently writes nowhere — in both cases the tool must create the target file on first append, and the fix packet says so.

    Route: v1 is the CLI — the cheapest interface the issue names — with the issue's open questions (plugin auto-capture, per-repo vs global, redaction, schema.md) explicitly deferred, since none of them block the CLI. Fix follow-up enqueued as queue task 2767 (dedupe repo-health:v1:fix:developing-today/code:issue:1853, packet hidden_files/packet-1853-record-cli.json): record CLI in this repo's bin/ style — stamps ts/pwd/repo/origin/HEAD/session/model, single O_APPEND write per entry (concurrency-safe), never rejects (malformed input quarantined verbatim to a sibling file, exit 0), silent no-op when unwritable, round-trip test. As a cross-repo set under this single issue, the same change carries a companion dezren39/nix PR updating instructions/recordings.md to point at the tool — no separate nix issue. This issue stays open at priority/low; this triage task completes as triaged.

  6. 14 remaining items

  7. added
    status/parkedDeliberately paused with a recorded resume condition
    on Oct 28, 2026
  8. added a commit that references this issue on Oct 29, 2026
  9. added a commit that references this issue on Oct 29, 2026
  10. removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/claimedQueue worker lifecycle state
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Oct 29, 2026
  11. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

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

Metadata

Metadata

Assignees

Labels

effort/mMedium: expected under 1 day of workkind/enhancementmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/lowNice to have; do when convenientstatus:done

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions