dotagents

miadi-hooks-interpreter-jamai — get the floor off /tmp

A JamAI atelier lives in two places that do not share a fate:

  1. sessiondata at /a/src/_sessiondata/<id>/ — the hook exhaust. Durable. @miadi/hooks-interpreter reads this.
  2. scratchpad at /tmp/claude-<uid>/<cwd-slug>/<id>/scratchpad/ — the generators, scores, renders, captures. Mode 700 the session owner. Subject to D /tmp 1777 root root 30d.

The interpreter answers what the session became. The scratchpad is what it made. Export both, or the next reader has a projection of a floor that /tmp already swept.

Worked examples:

drop session who
/home/gmusic/atelier-jerry-origin-1937aa47 1937aa47-767f-4543-8cdc-257364ae2c52 Jerry, the origin
…/episode-333-…/salix/songbird-71bbe83b 71bbe83b-8963-4635-b8a2-40bcffbb3aff Guillaume / ava002, the fork

When to use

Do not use this to commit anything. The drop is a drop.

The procedure

1. Resolve the session id — do not invent it

# first look
cat /home/gmusic/.agents/scripts/_env.sh

On 2026-08-19 that file carried:

If several ids are present, ask which one, or take the one the human named (“Jerry’s creation that I forked” = origin, not observer).

Confirm the directory exists:

ls /a/src/_sessiondata/<id>/_claude_user_inputs.jsonl

2. Project the session before you copy anything

miadi-hooks-interpret session  <id> --root /a/src/_sessiondata
miadi-hooks-interpret aspects  <id> --root /a/src/_sessiondata
miadi-hooks-interpret agents   <id> --root /a/src/_sessiondata
miadi-hooks-interpret ceremony <id> --root /a/src/_sessiondata

--json on each, keep both text and json. These go in 00-interpreter/.

Read the projection. Two numbers decide the rest of the night:

3. Find the scratchpad, then test whether you can read it

# cwd-slug is the session cwd with / → -
# Jerry's atelier ran in /home/gmusic        → -home-gmusic
# Guillaume's fork ran in compositions-jamai → -home-gmusic-compositions-jamai
ls /tmp/claude-*/-home-gmusic*/<id>/scratchpad

/tmp/claude-1000 is 700 gmusic. An agent running as mia gets Permission denied. sudo -n true first; if it works, sudo ls. If it does not work, stop and say so — do not pretend the floor is gone.

If the directory is already gone, the sessiondata still projects, and created still names the paths. Export 00-interpreter/ + 09-sessiondata/ and write in the README that the floor was lost.

4. Name the destination before you touch a byte

Pattern: /home/gmusic/<who>-<what>-<short-id>

Refuse to overwrite. If the dest exists, stop.

5. Classify, copy, hash

sudo python3 ~/.agents/skills/miadi-hooks-interpreter-jamai/scripts/export-jamai-session.py \
    --session-id <id> \
    --dest /home/gmusic/<meaningful-name>

The script:

Then you write the README.md. The script will not — the README is where the judgment lives (see What the README must say).

6. Prove the copy

# at least two generators and one score, src vs dest
sudo sha256sum /tmp/claude-1000/.../scratchpad/genNNN.py
sha256sum /home/gmusic/<dest>/01-generators/genNNN.py

Spot-check fails → do not keep the dest. Delete it and rerun.

Classification

class what goes in replaceable?
00-interpreter/ session, aspects, agents, ceremony × {txt,json} + SOURCE.txt yes — rerun the CLI
01-generators/ *.py no
02-scores/ *.abc only if the generator is proven deterministic
03-rendered/midi *.mid that are not device captures yes — abc2midi
03-rendered/audio *.wav *.mp3 rendered *.m4a yes — fluidsynth + ffmpeg
03-rendered/video *.mp4 yes — jamai-defile / jamai-clip
03-rendered/scores *.png *.svg yes — abcm2ps + rsvg-convert
04-captures/ timestamped device *.m4a / Songbird *.mid, named source recordings no
06-analysis/ note-*.md say-*.txt *.log leftover txt working memory
07-surface/ HTML the session published (jamai-cast, tables) snapshot
08-session-writes/ living files the interpreter listed as Write/Edit, outside the scratchpad snapshot of now
09-sessiondata/ the JSONL exhaust, no last_* yes — still on /a/src until it isn’t

Keep relative subdirs (ilex/gen_ava2.py stays 01-generators/ilex/gen_ava2.py). Colliding basenames across subdirs are why.

The four tools that always run after a generator writes ABC:

  1. abc2midi
  2. abcm2ps + rsvg-convert
  3. fluidsynth (cut reverb: %%MIDI control 91 0 / 93 0)
  4. ffmpeg, usually via jamai-defile.py / jamai-clip / jamai-publish-melody

That is the chain GUILLAUME.md asked Jerry to list. It is also why 03-rendered/ is 99% of the bulk and why the interpreter cannot see it.

What the README must say

Write it by hand, after the copy, from the projection and two or three 06-analysis/note-*.md. Minimum:

Ilex is not Jerry’s Android

Ilex (ilex.ferret-harmonic.ts.net) is William’s Android. Jerry’s Android is another node. A scratchpad folder named ilex/ means those files passed through this floor, not that Jerry was watching Ilex.

Classify timestamped ilex/*.m4a and ilex/ava1/*.mid as 04-captures and say so in the README. Do not write “Jerry’s device captures” unless the human has named the node and the files match it.

A capture of a person’s voice entering a pushed git repository cannot be withdrawn. Leave 04-captures/ out of any commit. The manifest still names every file.

Traps (paid for once)

trap what happens guard
agent is not the scratchpad owner Permission denied on /tmp/claude-1000, looks like “floor is gone” id; sudo -n true; sudo ls
dest already exists a second run would mix two copies refuse to overwrite
trusting created N path(s) as the opus you export 24 files and leave 2 GB of music in /tmp always walk the scratchpad
committing 03-rendered/ 2.4 GB of regenerable blobs in git forever drop, don’t repo; keep generators + manifest
committing 04-captures/ a voice you cannot recall named in README, left untracked
08-session-writes/ as “the original” those files have been edited since the Write README says “current-on-disk”
last_* in sessiondata tails of ledgers you already copied skip them
assuming cwd-slug Jerry’s floor was -home-gmusic, Guillaume’s was -home-gmusic-compositions-jamai take the path from the projection
writing the ceremony written=false is the contract never POST it from this skill
calling Ilex Jerry’s phone wrong person, wrong consent boundary see above

Replay against the drop (no /a/src required)

miadi-hooks-interpret session  <id> \
    --root /home/gmusic/<dest>/09-sessiondata
miadi-hooks-interpret aspects  <id> \
    --root /home/gmusic/<dest>/09-sessiondata

Same projection, same aspects (deterministic, no LLM, ≤55 words). If the bytes differ, the drop is incomplete or the package moved.

Boundary

This skill owns:

This skill does not own: