Command Palette

Search for a command to run...

Назад к скиллам
скилл № 72356

verify-session-lifecycle

TLA+ model check of the agent-tty session lifecycle when several agent-tty processes use one Home at the same time - create, the session host (start-up…

БесплатноЗапускает вложенные скрипты
coderот coder★ 33 звезды на GitHub

Установить verify-session-lifecycle в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Verify the session lifecycle (TLA+)

Many agents share one Home (~/.agent-tty by default). Each agent-tty command is its own process, and they all read and write the same session.json files with no lock. A test runs one order of those steps. This check runs every order of them in a small model of one session, and it reports any order that breaks a rule below.

The model is model/SessionLifecycle.tla. Each action in it is one indivisible step of the real code: one file read, the rename that makes a manifest write visible, one rm, one unlink, a process start or end, or a block of synchronous code with no await in it. Every action has a comment that names the code it stands for.

The tool is TLC, the TLA+ model checker, pinned to release 1.7.4 by sha256. The question here is "can these steps happen in a bad order", and a model checker answers that for every order. No verifier runs on this TypeScript code across processes.

The rules

Rule What must hold Harm when it breaks
R1 NoLiveSessionDeleted gc never removes the folder of a session whose host can still write to it. A running or starting session loses its manifest and event log.
R2 HostDeathOnlyWhenDead The manifest says "failed, host died" only when the host process is dead. list and inspect show a live session as failed. Commands refuse it.
R3 TerminalIsFinal Once the manifest shows exited, failed or destroyed, it never shows running again. A finished session looks running, and the next reconcile marks it failed.
R4 RecordedExitKept Once the manifest records that the program exited, only destroy changes it, to destroyed, and keeps the exit code. A program that exited 0 is reported as failed, with its exit code lost.
R5 RunningSessionReachable While the host serves a running program, the socket file exists. The session runs, but no command can reach it.
R6 HostStartsWhenCreated A host never fails to start because another process removed or rewrote its files. create fails with HOST_UNREACHABLE for a session nobody touched.
R7 TerminalIsLastWrite Once the manifest shows exited, failed or destroyed, the host has no write left to make.
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • coverage.json
  • model/SessionLifecycle.tla
  • model/statechart-view.mjs
  • scripts/check.sh
  • scripts/facts.mjs
  • scripts/replay-hold.mjs

FAQ

Что делает скилл verify-session-lifecycle?

TLA+ model check of the agent-tty session lifecycle when several agent-tty processes use one Home at the same time - create, the session host (start-up, resize, destroy, SIGTERM shutdown, exit), reconcileSession (list, inspect, destroy, gc), gc and destroy (with and without --force). Use it before you change src/host/lifecycle.ts, src/host/programGroup.ts, the start-up, shutdown or exit path of src/host/hostMain.ts, src/host/manifestWriter.ts, src/cli/commands/gc.ts, src/cli/commands/create.ts, src/cli/commands/destroy.ts, src/storage/manifests.ts or src/protocol/sessionStatusPolicy.ts, before you add a new writer of session.json, and when you must know whether a race can delete a session, corrupt its status, leave its program running or kill a process group that is not the session's.

Как установить скилл verify-session-lifecycle?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл verify-session-lifecycle запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить verify-session-lifecycle с