miadi-orchestration-kit

02 · Intent: a session that has a page

Phase 2 (I). What the prototype’s creator wanted to bring into being, the current reality, and the tension between them.

Desired outcome

Every session that asks for it has one GitHub issue, opened by its first prompt and found by its session id. A person opens that issue to read what the session was asked. After each /exit they read what it did: how many prompts and tool calls it ran, which files it wrote, what it published (commits, pushes, issues, releases, pages), and its last answer. They retitle it, link it to an episode, and comment on it like any other issue.

The page comes from a plugin installed beside the capture plugin, so it needs no hand-wired settings.json. A session asks for it at launch or midway, and a session that does not ask is untouched (revised 2026-10-14, 03-specify.md § Revised).

When a host also records sessions as traces, the same opening and closing land as a trace under a miadi-tracing: reference, and the issue names that reference.

How they know it holds: one issue per session id, one comment per exit, nothing posted unsanitized, nothing posted to a public repository, and nothing at all for a session that did not ask.

Current reality

Structural tension

The desired page exists today as a pattern people used and kept: they retitled issues around the session id and turned one issue into a ceremony record. It is held by two scripts that no installed host runs. The plugin that every Miadi host installs already captures richer material than the prototype could, and it has no place on GitHub to put it.

The tension resolves when the two hooks become a plugin of their own beside the capture plugin. A session asks for its page at launch or midway, and the closing comment draws on the capture’s indexes. Then ilex installs it, and the page returns, on the host where it was born, for the sessions Guillaume chooses.

Beloved qualities

What people would miss, and what must survive the port:

  1. One session, one issue, found by its id. The title prefix Session <id8>: is what people kept when they retitled. The opener never changes a title after creating it.
  2. The first prompt is the body. The issue says what was asked, in the asker’s words.
  3. A comment at every exit. A resumed session’s issue grows a comment per /exit with running totals, so the issue reads as the session’s story across days.
  4. It never slows the session. Both calls run detached. A hook prints nothing and exits 0, even when GitHub is unreachable.
  5. The marker contract. .issue_created holds the URL on its first line. The chronicle-sessions CLAUDE.md names it as a state indicator.
  6. Failures are written where a person looks. trace.log lines in the same words as the prototype’s.
  7. The repository is chosen, not assumed. It comes from the session’s ask, else the host’s MIADI_CHRONICLE_SESSION_REPO. The prototype’s CHRONICLE_SESSIONS_REPO was not kept: Miadi hosts already name the repository in MIADI_CHRONICLE_SESSION_REPO.

What the port changes, and why

Prototype Port Because
Every session on the host Only a session that asks: MIADI_SESSION_ISSUE at launch, or /session-issue Guillaume wants issues for some sessions, not all (2026-10-14)
Default repository when unset No repository, no issue The plugin runs on hosts and users that never asked for issues
Raw prompt and answer Through claude_sanitize_text The capture already redacts token shapes everywhere else
Any repository A public repository is refused Prompts and answers are private material
Marker written after gh returns A lock taken before gh runs One issue per session, even with fast prompts
Title of 80 raw characters The first non-empty line, whitespace collapsed, at most 80 characters Multi-line prompts made broken titles
jq -rs over the transcript last_claude_AssistantResponse.json, then the transcript’s tail Transcripts reach tens of MB on a phone
Files touched = Write and Edit only _claude_files_written.jsonl Bash, MCP and moves write files too
Background subshell at SessionEnd Detached with setsid Claude Code cancels SessionEnd hooks after 1.5 s
Headless runs open issues Headless runs open none unless asked (proposed default, held by Guillaume) On 2026-07-27, seven PDE steps opened seven issues among the sessions people read
Nothing about publications The comment lists what the session published since the previous comment The plugin already indexes it

Boundaries