[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77KFF76X7AVWR519R4DDAZH":3,"skill-same:01M77KFF76X7AVWR519R4DDAZH":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M77KFF76X7AVWR519R4DDAZH","agent-result-persist-interface",null,"The contract for the sdlc-agent-result-persist CLI — its modes, its flags, the paths it composes, the line grammar of the round log and the agents log it writes, the per-round records and review files it stores, and the derivation modes — next, dispose and summary — that derive a round's arm and outstanding work, its dispositions, severities and verdicts, and its review body. Preloaded into sdlc:theorem-based-pr-reviewer, sdlc:theorem-generator, sdlc:theorem-disprover, sdlc:counterexample-verifier, sdlc:pr-finalizer, and sdlc:pr-merge-readiness via their skills frontmatter; not invoked from the user's slash menu.","TheVoskamps\u002Fclaude-plugins-marketplace","TheVoskamps","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235012489?v=4","01M77K5ZCP12QCJPQ85WVJSHTS","Irene and Edwin Voskamp","01M77K5ZDS7DB0PA1W8FM7G2QD",0,"GPL-3.0","https:\u002F\u002Fgithub.com\u002FTheVoskamps\u002Fclaude-plugins-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fsdlc\u002Fskills\u002Fagent-result-persist-interface\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: agent-result-persist-interface\ndescription: The contract for the sdlc-agent-result-persist CLI — its modes, its flags, the paths it composes, the line grammar of the round log and the agents log it writes, the per-round records and review files it stores, and the derivation modes — next, dispose and summary — that derive a round's arm and outstanding work, its dispositions, severities and verdicts, and its review body. Preloaded into sdlc:theorem-based-pr-reviewer, sdlc:theorem-generator, sdlc:theorem-disprover, sdlc:counterexample-verifier, sdlc:pr-finalizer, and sdlc:pr-merge-readiness via their skills frontmatter; not invoked from the user's slash menu.\nuser-invocable: false\n---\n\n# Agent Result Persist Interface\n\n`sdlc-agent-result-persist` keeps one review round's evidence outside\nevery worktree: a **round log** of one-line records, one **result file**\nper child holding that child's full report, the round's **records file**\nholding its theorem records, and the round's **review file** holding the\nargued review it composed. Any instance of\n`sdlc:theorem-based-pr-reviewer` learns what is left to do from the\nscript's derivation modes, which read the log and the result files and\nnothing it heard back; the next round\nreads its predecessor's theorem records out of the records file, and the\nend of an orchestrate loop assembles the run's detail out of the review\nfiles. Beside the rounds, the PR's **agents log** records every agent\nspawned for the PR, so the cleanup after the PR can find each one's\nworktree by its agent id.\n\nThat is the whole design. A child that ran, finished and reported can\nstill skip its own last call, and a `\u003Ctask-notification>` can go\nundelivered; both failures look identical from the caller's side, and\nneither is recoverable from the caller's memory. So **the child writes\nits own entry and its own exit**, and the caller's view of a child is\ntelemetry rather than truth.\n\n`sdlc:theorem-based-pr-reviewer` anchors the round, records each spawn,\nreads the log back, records a child it writes off, and at the end of the\nround stores its records file and its review file. The theorem\ngenerator, `sdlc:theorem-disprover` and `sdlc:counterexample-verifier`\neach write their own `enter` and `leave`. **Every log record is a\nsingle atomic append**, so no two writers can be ordered wrongly and no\ncall has to know what the log already holds. The records file and the\nreview file are not records: each is written whole and replaces\nwhatever the round held before, so a resumed instance that re-derives\nthe round stores its own version over its predecessor's rather than\nadding to it. The carry form below builds the records from the round\nbelow `--round`, never from the round's own, so the resumed instance's\nrecords are rebuilt from the same input its predecessor's were.\n\n## Invocation\n\n```text\nsdlc-agent-result-persist --mode \u003Cmode> \\\n  --pr \u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>#\u003Cn> [--round \u003Cn>] \\\n  [mode-specific flags]\nsdlc-agent-result-persist --mode list [\u003Crepository>]\nsdlc-agent-result-persist --mode repos\n```\n\nSpell the command as a bare name, never by path: the rule that lets a\nchild run it unattended — `Bash(sdlc-agent-result-persist:*)` — is\nkeyed on that spelling, and it lives in the caller's own settings\nbecause this plugin ships no permission rules.\n\n## The payload: `--from \u003Cpath>`, or stdin\n\n`leave`, `records` and `review` each store a **payload** — a report, a\nround's records, a round's review. The payload is read from the file\n`--from \u003Cpath>` names, or from **stdin** when no `--from` is passed.\nWith both present, `--from` wins and stdin is not read. `next` and\n`dispose` read the round's new records from `--from`, per \"The\nderivation modes\" below; every other mode refuses it.\n\nPass the payload with `--from`, naming a file you wrote with the Write\ntool. The harness's worktree-isolation guard grades a heredoc on the\ntext it carries, and refuses the call when that text names `git`\nanywhere — so a report that quotes a `git log` line or a\npath under `.git\u002F` cannot travel in a heredoc, and quoting it changes\nnothing. The guard does not read a Write tool's content, and it never\nsees the file's bytes on the persist call.\n\nA child stages its `leave` payload in the session scratchpad the\nharness names in its environment, at\n`\u003Csession-scratchpad>\u002Fpr\u003Cpr>-r\u003Cround>-\u003Cstage>-\u003Ctheorem>-\u003Cagent>-report.md`,\nfilling in the `--pr`, `--round`, `--stage`, `--theorem` and `--agent`\nvalues of its own `leave` call, `pr\u003Cpr>` spelled as the state directory\nspells it — the number after the `#` of `--pr`. Every child in a\nfan-out shares that one scratchpad, so a name missing the stage, the\ntheorem or the agent would let two concurrent children stage over each\nother's reports; theorem ids restart at `T1` on every PR, so a name\nmissing the PR would let two PRs' fan-outs in one session do the same;\nand the persist script never\nremoves the file, so a name missing the round would leave an earlier\nround of the same PR in the same session holding the path a later\nround's child stages at.\n\nIf Write refuses because a file already exists at that path, Read it,\nthen Write again.\n\n- A `--from` path that is not an existing file is refused, non-zero,\n  with a message naming the path, before anything is written.\n- A `--from` file that exists but cannot be read is refused, non-zero,\n  with a message naming that file.\n- An empty payload is refused either way, except by `records --carry`,\n  whose payload is only the round's new records, and by `next` and\n  `dispose`, which read the same. With no `--from`, empty stdin\n  gets `--mode \u003Cmode> takes the \u003Cnoun> on stdin, and nothing arrived`;\n  an empty `--from` file gets a message naming that file.\n- The file is read, never moved or removed: it stays where its writer\n  put it.\n\n## The identifying flags\n\nThese two go on **every** call, and \"The paths\" below says what they\ncompose, except where a mode acts above the level a flag names and\nrefuses it: `delete` removes the whole PR's directory, `print-root`\nnames it, `agent` and `print-agents` write and read the PR's agents\nlog beside its rounds, and `rounds` lists the rounds themselves, so each\nrefuses `--round`, `list` reads across\nevery PR of a repository, so it refuses `--pr` and `--round` alike and takes the\nrepository instead, and\n`repos` reads across every repository, so it refuses both and takes no\nrepository. `print-records` selects the round itself, so `--round` is\noptional there and bounds that selection rather than naming a round.\n\n- `--pr \u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>#\u003Cn>` — the PR, by the canonical\n  reference `\u002Fgithub-prs:pr-view \u003CPR> --ref` prints: its repository,\n  host included, since one machine holds state for repositories on\n  several hosts and the same owner\u002Frepo on two of them is two\n  repositories, then `#` and its number. Pass the reference you were\n  given; never resolve the repository yourself. A bare number, or a\n  reference without a host, is a usage error. Each of host, owner and\n  repo may hold only letters, digits, `.`, `_` and `-`, and none may be\n  `.` or `..`.\n- `--round \u003Cn>` — a number. Rounds count review passes from 1, and\n  **`--round 0` is valid**: the pre-loop seed, settled by the\n  orchestrator before any implementer ran.\n\n`list`'s repository is an optional operand, never a flag:\n`\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>`, `https:\u002F\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>`, or a shorter\n`\u003Cowner>\u002F\u003Crepo>` or `\u003Crepo>`. Omitted, it is the current repository —\nthe one the checkout's remote names — and a shorter form takes the\nsegments it omits from the current repository. The script resolves the\ncurrent repository itself; pass the operand as you were given it, or\nnone.\n\n**One round is one log.** There is no per-fan-out file and no `--agent`\nin the path: the `stage` column below says which fan-out a record\nbelongs to, so two files can never disagree about the round and a\nreader answers every stage's question from one `--mode print`.\n\n**A round has a type**, the class of file it reviews:\n`code-and-instruction-markdown` or `documentation`, the reviewer's\n`--mode`. Rounds of both types share one sequence per PR, so a\ndocumentation round takes the number after the last code round, and\nthe paths do not change with the type. The `anchor` call is where the\ntype is written, as `--round-type \u003Ctype>`, and every read bounded by a\nround takes that round's type from there: a round whose log carries no\nanchor naming\na type — round 0, which holds the seed and its generator's `spawn`\nrecord and no anchor, or a round anchored before\nrounds had a type — is a `code-and-instruction-markdown` round. A round\ncarries only the records of its own type, so the first documentation\nround carries nothing; theorem ids run in one sequence across both\ntypes, so its first new id is still one above the highest id any round\nbelow it holds.\n\n## The paths\n\nThe script composes every path below and **no caller ever reads or\nwrites one by path** — there is no path string to mistype, and none to carry\nacross a turn boundary. A reader learns a result file's path by reading\nit out of the log it just printed, and reaches the records and review\nfiles through the print modes named for them rather than by path at\nall.\n\nA caller does spell the PR's state root\n`${XDG_STATE_HOME:-$HOME\u002F.local\u002Fstate}\u002Fsdlc\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpr\u003Cpr>\u002F` in\nprose that points a **human** at the directory: the review body\n`--mode summary` renders names it once and hangs a round-relative path\noff each theorem and finding line, and every file that tells a reader\nwhere a round's detail is spells the same root. That is a signpost, not\na route: nothing composes it to open a file with.\n\nThe round gets a **directory of its own**, and the identifying flags\nare the whole of what composes it — no session is part of the path.\nEach is a fact about the PR under review, which is what makes a round\nsurvive the session that opened it: a reviewer resumed in a session\nthat never saw the first one holds both already, composes the same\npath, and reads the same log. The script uses the state variable when\nset and non-empty and `$HOME\u002F.local\u002Fstate` otherwise. This directory is where\nthe whole of a round's output lives: the theorem\nrecords that the next round carries forward, and the argued review it\ncomposed, are files here rather than text on the PR.\n\n```text\n${XDG_STATE_HOME:-$HOME\u002F.local\u002Fstate}\u002Fsdlc\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpr\u003Cpr>\u002Fround\u003Cround>\u002Flog\n\u003Cthe same directory>\u002F\u003Ctheorem>-\u003Cagent>\n\u003Cthe same directory>\u002Frecords\n\u003Cthe same directory>\u002Freview\n${XDG_STATE_HOME:-$HOME\u002F.local\u002Fstate}\u002Fsdlc\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpr\u003Cpr>\u002Fagents\n~\u002F.claude\u002Fprojects\u002F\u003Cproject>\u002F\u003Csession>\u002Fsubagents\u002Fagent-\u003Cagent-id>.jsonl\n```\n\n`log` is the round log, `\u003Ctheorem>-\u003Cagent>` a child's result file,\n`records` the round's theorem records, and `review` the round's argued\nreview; `agents` is the PR's agents log, beside its rounds rather than\nin one, since an agent spawned for the PR belongs to no round and a\nvoided round's rename must not carry it away. The `.jsonl` under\n`~\u002F.claude\u002Fprojects\u002F` is the harness's own transcript of a child, which\n`--mode enter` records. The records and\nthe review are written at the end of the round, and a voided round's\nrename carries both with it exactly as it carries the log and the\nresult files.\n`\u003Cproject>` is the **primary clone's** path with every character\noutside `[A-Za-z0-9-]` replaced by a dash — measured on a `\u002F` and on a\n`.` alike. Every child runs in a worktree, so its own cwd is the wrong\nbasis: the primary root is `git rev-parse --git-common-dir` passed\nthrough `dirname`. `\u003Csession>` is `CLAUDE_CODE_SESSION_ID` and\n`\u003Cagent-id>` is the child's own worktree name with `agent-` stripped.\nThe harness's per-session scratchpad holds an `.output` symlink to that\ntranscript; the record carries the target, which outlives the symlink.\n\nWith any of those unavailable the record still lands, carrying `-` in\nthe transcript column. A missing path is worth less than a missing\nrecord.\n\nThe repository's directory, `sdlc\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002F`, carries a\n`repo.yml` naming the repository it holds, which the script writes when\nit creates the directory:\n\n```yaml\nschema-version: 1\nhost: github.com\nowner: \u003Cowner>\nrepo: \u003Crepo>\n```\n\nThe file is what identifies the directory; no reader derives the\nrepository from the path's depth or segment names, and where the file\nand the path disagree the file wins. State written before the host was\npart of the path sits at `sdlc\u002F\u003Cowner>\u002F\u003Crepo>\u002F`. Every run, of every\nmode but `repos`, first moves that directory to `sdlc\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002F`,\nhost from `--pr` or from `list`'s repository, and writes its\n`repo.yml`; no mode reads the old path afterwards. A run that finds\nstate at both paths refuses, non-zero, naming both, and moves nothing.\n\n**Nothing here is deleted but by `--mode delete`, and that mode is\ncalled only by `sdlc-orchestrate-cleanup`, which the human invokes and\nwhich `\u002Fsdlc:orchestrate` runs for a PR after that PR has merged.** A\nround's files are the evidence a stalled or voided round is diagnosed\nfrom, so no mode that runs during a review removes one, and none ever\nexpires: a PR's directory stays until `\u002Fsdlc:orchestrate` cleans up\nafter the PR's merge — a merged PR's evidence is no longer needed to\ndiagnose a round — or the human decides its evidence is no longer\nwanted.\n\n## The modes\n\nOne word, one meaning: **every mode is named for what it writes** — the\nrecord, or the file — the `print` modes for the ones that read one\nround, `print-root` for the PR directory it names, `print-agents` for\nthe agent ids it reads across the PR's logs, `rounds` for the rounds it\nlists, `list` and `delete`\nfor what they do across a repo's PR directories, `repos` for what\nit lists across the state root, `wait` for what it does, and `next`,\n`dispose` and `summary`, under \"The derivation modes\", for what they\nderive.\n\n- **`anchor`** — writes the `anchor` line carrying `--head-sha \u003Csha>`\n  and `--round-type \u003Ctype>`, both required. One call per round, and\n  **idempotent**, which is what lets the reviewer make it without\n  knowing whether a child has already written:\n\n  - **No `anchor` in the log** — the line is appended, creating the log\n    when it is absent. A child that started first has already created\n    it with its own `enter`, so the anchor is not necessarily the first\n    line and no reader may assume it is.\n  - **An `anchor` naming the same head SHA and type** — this same\n    round's, so the call writes nothing and exits zero.\n  - **An `anchor` naming the same head SHA and another type** — the\n    round is the other loop's, and nothing moved under it, so the call\n    is refused, non-zero, naming both types, and writes nothing.\n  - **An `anchor` naming a different head SHA** — the records describe\n    a tree that no longer exists, so the round's whole directory is\n    renamed to `round\u003Cround>.voided-\u003Cinstant>` — kept as the evidence\n    of what the voided round did — and a fresh `round\u003Cround>\u002F` holding\n    only the new anchor takes its place. Nothing is deleted. The result\n    files move with the log because a reader takes a report's existence\n    as a settled theorem, and one left under its own name would settle\n    the fresh round's theorem from the voided tree.\n- **`spawn`** — appends one `spawn` record for `--theorem` in\n  `--stage`, carrying `--agent`, `--model` and `--effort`. The\n  caller's, once per child it spawns, and the orchestrator's once, at\n  `--round 0`, for the seed generator it spawned before the PR existed.\n  Model and effort are on this\n  record because the caller chose them and a child can read neither;\n  pass the token `default` where the spawn named none and the\n  definition's own frontmatter decided.\n- **`enter`** — appends one `enter` record for `--theorem` in\n  `--stage`. A child's first act, before it does any work. The script\n  derives the agent id from the child's own worktree and composes the\n  transcript path, so nothing is passed in.\n- **`leave`** — writes the child's report, read as its payload, to that\n  child's result file, then appends one `leave` record naming the file.\n  A child's final act. `--agent` is half the file's name. The report is\n  stored byte for byte: no size limit, no encoding, no quoting. Empty\n  input is refused — a `leave` exists to carry a report. The report is\n  written before the record that names it, so a run that dies between\n  the two leaves the report readable rather than a record pointing at\n  nothing. Once both have landed, the call prints the result file's\n  path on stdout, and that line is what a child's hand-back opens with,\n  per \"A child's hand-back\" below; a refused `leave` prints nothing\n  there.\n\n  The payload lands first in `\u003Cresult-file>.partial-\u003Cpid>` and is renamed into\n  place only once it is whole, because a result file's mere existence\n  settles its theorem: a report streamed straight to its own name would\n  settle the theorem from a fragment the moment the first byte landed,\n  and a child killed mid-write would leave that fragment there for\n  good. The rename is what makes the file appear complete or not at\n  all, and the `-\u003Cpid>` suffix is what keeps two writers from staging\n  over each other. A refused report — empty, a `--from` file that\n  could not be read, a result-file path carrying whitespace, a\n  `THEOREM:` mismatch or an id refusal below — leaves nothing behind:\n  the staging file is removed before the call exits non-zero, and no\n  `leave` record is appended.\n\n  With `--stage disprove` or `--stage verify`, the report must answer\n  the theorem it is filed under. The first line of the report that\n  starts `THEOREM:` names that theorem, and the call is refused,\n  non-zero, when no such line names one or when it names a theorem\n  other than `--theorem`; the message names the `--theorem` value and,\n  on a mismatch, the one the report named. A result file is named for\n  `--theorem`, and its existence settles that theorem, so a report\n  handed over from another child would otherwise settle a theorem it\n  never answered.\n\n  With `--stage generate` the report is the theorem list, filed under\n  `--theorem list`, and its new ids must continue the PR's sequence: one\n  above the highest id the records of any round below `--round` hold,\n  of either type, or `T1` when none holds any — round 0 included. Its\n  ids are the lines holding nothing but `T\u003Cn>`, above any `RETIREMENTS`\n  line, in order, and each is held to the rule the carry form holds a\n  new record to: a new id a carried record — one `print-records --round\n  \u003Cround>` would print — already holds, or one that is not the next id\n  in sequence, is refused, non-zero, with a message naming that id and\n  the expected next one. The call is refused as `print-records` would\n  be, too, when a round above `--round` holds records.\n- **`return`** — appends one `return` record for `--theorem` in\n  `--stage`, carrying `--agent-id` and the optional `--tokens`,\n  `--tools` and `--ms`. The caller's, from a final `\u003Ctask-notification>`\n  it received. It is **best-effort telemetry and never evidence**, and a\n  stage never waits on one. An omitted number leaves its column empty\n  rather than dropping the column.\n- **`stopped`** — appends one `stopped` record for `--theorem` in\n  `--stage`, carrying `--agent-id`, the id of the child it writes off,\n  as that child's `enter` record names it — or `-`, as `--mode next`\n  prints it, for a child written off before it wrote its `enter`. The\n  caller's, when it writes\n  a child off. It writes one whether or not it `TaskStop`ped that\n  child — a predecessor instance's child is never its to stop, and the\n  record is what says the child was written off either way.\n  `--agent-id` is required: without it the call exits non-zero and\n  appends nothing, since a record naming only the theorem would write\n  off whichever child the theorem had when it landed, a replacement\n  included.\n- **`print`** — writes the round log to stdout, followed by one\n  `result` line per result file present and then one `round-type` line\n  naming the round's type. A `.partial-\u003Cpid>` staging\n  from a `leave` still in flight is **skipped**, so a report reaches a\n  reader whole or not at all, and so are the round's `records` and\n  `review` files, which are the round's own output rather than any\n  child's report. Exits non-zero when the log\n  does not exist, which means neither the round's `anchor` call nor any\n  child's `enter` has run — the fresh-round case the reviewer branches\n  on before spawning anything.\n- **`print-in-flight`** — writes to stdout one line per theorem with a\n  child in flight in `--stage`, `\u003Ctheorem> \u003Cagent-id> \u003Cinstant>`: the\n  child's agent id and the instant of its `enter`, which is what its\n  deadline runs from. `--stage` and `--agent` are required, `--agent`\n  naming the definition whose result file settles the theorem —\n  `theorem-generator`, `theorem-disprover` or\n  `counterexample-verifier`. \"What the reader derives\" below states\n  what in flight means. Exits non-zero when the log does not exist, as\n  `print` does.\n- **`wait`** — blocks until a child in `--stage` settles or runs out of\n  time, then exits zero. `--stage` and `--deadline-minutes` are required.\n  It waits on each theorem with a child in flight in the stage, and on\n  each with a child yet to enter there, as \"What the reader derives\"\n  below defines both. It exits on whichever\n  comes first, printing one line, `\\t` standing for a tab:\n\n  - `leave\\t\u003Ctheorem>\\t\u003Cagent-id>` — a `leave` record in the stage\n    landed after the call started;\n  - `deadline\\t\u003Ctheorem>\\t\u003Cagent-id>` — `--deadline-minutes` have passed\n    since the `enter` of the earliest child it waits on, or since the\n    last `spawn` of a child yet to enter, whose agent id is `-`;\n  - `none` — no child is left to wait on, at once when there was none\n    from the start, a round with no log included.\n\n  It reads the log every two seconds, and writes and creates nothing.\n- **`records`** — writes the round's theorem records to the round's\n  `records` file. Without `--carry` it stores its payload whole: the\n  orchestrator's once, at `--round 0`, for the ruled seed, and the\n  reviewer's on a round with nothing to carry. With `--carry`, below, it\n  builds the file from the carried round: the reviewer's on every other\n  round that reaches disposition, an empty-delta round included. In the\n  plain form empty input is refused, and in both the bytes land in a\n  staging name and are renamed into place only once whole, for the\n  reason `leave` gives: a reader takes the file's existence as the\n  round's records, and half a file would carry half a round's theorems\n  into the next round with nothing saying so.\n\n  A records file is a sequence of records in id order, separated by one\n  blank line. Each opens with its id, `T\u003Cn>`, on a line of its own,\n  followed by one `key: value` line per field: `claim`, `issues`,\n  `settle-mode`, `pointers`, then, when present, `state`,\n  `state-detail`, `settled-at`, `severity-override`, in that order. Ids\n  are never reused.\n\n  **With `--carry` the script builds the file itself** rather than\n  taking one whole, and makes no decision while doing so — what each\n  record's new state is arrives as an edit:\n\n  1. It reads the records of the highest-numbered round **below**\n     `--round` that holds a records file and is of the type\n     `--round`'s own anchor names, skipping the\n     `.voided-\u003Cinstant>` directories as `print-records` does. A records\n     file at `--round` itself is not read: `--round` may be the latest\n     round holding records, and the carry then rebuilds that round's\n     file from the round below, so a resumed reviewer stores its round's\n     records again and gets the same file from the same edits. It\n     refuses when any round **above** `--round` holds a records file,\n     of either type.\n  2. It applies the **edits file** `--edits \u003Cpath>`, one edit per line:\n     `\u003Cid>`, a tab, `\u003Cfield>`, a tab, `\u003Cvalue>`. `\u003Cvalue>` is the rest\n     of the line and may be empty; an empty line is skipped. `\u003Cfield>`\n     is one of `state`, `state-detail`, `settled-at` and\n     `severity-override`. An edit to a field the record has replaces its\n     line in place; an edit to a field it lacks adds the line after the\n     record's other fields, the added lines in that same order. Only\n     `state` is validated — it is `disproved`, `unsettled` or `retired`\n     — and the other three are stored verbatim. `--edits` is optional:\n     a round that changes no carried record passes none.\n  3. It appends the **new records** read as its payload, in the record\n     shape above. Their ids, in payload order, are exactly `T\u003Cm+1>`,\n     `T\u003Cm+2>`, … where `T\u003Cm>` is the highest id the records of any round\n     below `--round` hold, of either type. The payload may\n     be empty here, so an empty-delta round and a round that only\n     retires are both written.\n  4. It writes the result in id order, staged and renamed into place as\n     the plain form is.\n\n  No carried record gains or changes a field that no edit names. Every\n  round from 1 on stamps a `state` on every record, so the result must\n  hold one on each.\n\n  Each of these is refused, non-zero, writing nothing and creating no\n  round directory, with a message naming the offending line or id:\n\n  - an edit line that is not three tab-separated parts;\n  - an edit naming an id no carried record has;\n  - an edit to a field outside the four;\n  - a `state` value outside the three;\n  - a second edit to the same field of the same record;\n  - a new record whose id a carried record already holds, or that is not\n    the next id in the `T\u003Cm+1>`, `T\u003Cm+2>`, … sequence;\n  - a result that leaves any record without `state` — a round-0 seed\n    record carried into round 1 unstamped is the case this catches —\n    naming each such id;\n  - `--carry` when no round below `--round` of its type holds a records\n    file, naming the type, or when a round above it does, naming that\n    round;\n  - `--edits` without `--carry` in any mode but `next` and `dispose`,\n    and `--carry` in any mode but `records`.\n- **`review`** — writes the round's argued review, read as its payload,\n  to the round's `review` file, on the same terms as `records`.\n- **`print-records`** — writes to stdout the records of the\n  **highest-numbered** round that holds a records file, ignoring the\n  `.voided-\u003Cinstant>` directories, whose records describe a tree that no\n  longer exists. The round to carry forward is the most recent one\n  there is, not one a caller names. A `--round \u003Cn>` bounds the\n  selection to the rounds **below** `\u003Cn>` of the type round `\u003Cn>`'s\n  anchor names, and `\u003Cn>` need not hold records itself: a round under\n  way passes its own number, so it reads the round it carries from even\n  when an earlier instance of it already stored this round's records.\n  With `--round \u003Cn>` it exits non-zero, printing no records, when any\n  round **above** `\u003Cn>` holds a records file — the condition `--carry`\n  refuses on, decided by the same code — so a stale `--round` fails at\n  this read rather than at the carry that follows it. Without\n  `--round`, `--round-type \u003Ctype>` narrows the selection to the rounds\n  of that type; beside `--round` it is refused, since that round's\n  anchor already names the type. Its first line is `round \u003Cn>`, naming the\n  round it selected, so a reader that needs the rest of that round's\n  state — its `anchor` line's head SHA, its review file — has the number\n  to ask for it with; the records follow from the second line on. Exits\n  non-zero when no round it considers holds a records file — a PR whose\n  round 1 has no round-0 seed to read, or a first documentation round —\n  naming the type it selected by.\n- **`print-round-records`** — writes the named round's records file\n  to stdout, byte for byte, with no `round \u003Cn>` line in front: the\n  caller named the round. It is the read for a caller that walks every\n  round rather than carrying the most recent one forward, and it\n  creates nothing. Exits non-zero when that round holds no records\n  file.\n- **`print-review`** — writes the named round's review file to stdout.\n  Exits non-zero when that round holds none.\n- **`print-root`** — writes the PR's state root to stdout as two lines,\n  each with its trailing `\u002F`: first expanded, then as the signpost \"The\n  paths\" describes, with `\u003Chost>`, `\u003Cowner>`, `\u003Crepo>` and `\u003Cpr>` filled\n  in and the state variable and its fallback left unexpanded. It is\n  composed here so a caller that names a file to a human relative to\n  the root spells no root of its own; it opens nothing. It takes **no\n  `--round`** and refuses one, creates nothing, and exits zero whether\n  or not the directory exists.\n- **`agent`** — appends one `agent` record to the PR's agents log,\n  carrying `--agent`, the definition spawned, and `--agent-id`, the id\n  the `Agent` tool's result names for the spawn — the `\u003Cagent-id>` of\n  the harness's `.claude\u002Fworktrees\u002Fagent-\u003Cagent-id>` worktree and its\n  `worktree-agent-\u003Cagent-id>` branch. The spawner's, once per agent it\n  spawns for the PR, whether or not that agent runs in a worktree of its\n  own. It takes **no `--round`** and refuses one; both `--agent` and\n  `--agent-id` are required.\n- **`print-agents`** — writes to stdout every agent id the PR's state\n  names, one per line, sorted and each once: every `agent` record's,\n  and every `enter` record's in every round log, the\n  `.voided-\u003Cinstant>` rounds included, since a voided round's children\n  left worktrees too. It takes **no `--round`** and refuses one, creates\n  nothing, and prints nothing for a PR with no state.\n- **`rounds`** — writes to stdout one round number per line, ascending,\n  for each round from 1 whose log exists. Round 0, the seed, is not\n  printed, nor is a `.voided-\u003Cinstant>` round. The numbers need not\n  start at 1 or run unbroken, so a caller visiting every round visits\n  what this prints rather than counting up from 1. It takes **no\n  `--round`** and refuses one, creates nothing, and prints nothing and\n  exits zero for a PR with no log.\n- **`list`** — writes to stdout one PR per line, as the\n  `\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>#\u003Cn>` reference `--pr` takes, in ascending\n  order of `\u003Cn>`, one per `pr\u003Cn>\u002F` directory under the repository's\n  `\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002F` state directory, and nothing else on the line; an\n  entry whose name is not `pr` followed by digits, or that is not a\n  directory, is skipped. The repository is the operand \"The identifying\n  flags\" describes. It takes **no `--pr` and no `--round`**, and\n  refuses either, and refuses a second operand. A repository no review\n  has run against has no directory, so the output is empty and the exit\n  zero; the mode creates nothing.\n- **`delete`** — removes `pr\u003Cn>\u002F` recursively, every round under it,\n  every voided round and the agents log with them. It takes **no `--round`** and\n  refuses one, and it refuses a missing `--pr` with the usual\n  `--pr is required` message. A directory already absent is the state\n  the call asks for, so it exits zero and prints nothing.\n- **`repos`** — writes to stdout one line per repository directory the\n  state root holds, `\u003Ckind> \u003Crepository> \u003Cdirectory>`, the directory\n  relative to `sdlc\u002F`. Every directory holding a `repo.yml` is read\n  from that file: `repo` when the file names the directory's own path,\n  `mismatch` when it names another, the repository being the file's\n  `\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>` either way. A directory two levels down\n  that has no `repo.yml` in it or one level down, and holds\n  `pr\u003Cn>\u002F` directories directly, is old-layout state:\n  `old \u003Cowner>\u002F\u003Crepo> \u003Cowner>\u002F\u003Crepo>`, its host unknown. It takes **no\n  repository and no flag but `--mode`**, refuses each with exit 2 before\n  it lists anything, moves nothing, and prints nothing for a state root\n  that does not exist.\n\n  **`delete` is the only mode that deletes stored state.** The one\n  thing any other mode removes is its own staging file, when `leave`,\n  `records` or `review` refuses its payload as empty or as a `--from`\n  file that could not be read, or `leave` refuses a report whose\n  `THEOREM:` line does not name `--theorem` or a theorem list whose ids\n  do not continue the carried records; `anchor` renames a voided round rather\n  than removing it.\n\nThe script stamps every record's time itself: the writer owns when the\nrecord was made.\n\nA refusal and a malformed call both exit non-zero, so the status says\nonly that the call did nothing. The message says which.\n\n### The derivation modes\n\n`next`, `dispose` and `summary` each read one round, named by `--pr`\nand `--round`, store no record and no file, and create no directory.\nIn the line shapes below `\\t` is the one tab that separates two fields,\nand in a field `-` stands for no value.\n\n**The round's theorems.** `next` and `dispose` read the round's records\nfrom three inputs:\n\n- the **carried records** — those `print-records --round \u003Cround>` would\n  print, refused as that read refuses, and none when no round below\n  holds records;\n- **`--edits \u003Cpath>`** — this round's adjustments to the carried\n  records, a retirement or a `severity-override`, one per line in the\n  carry form's edit grammar;\n- **`--from \u003Cpath>`** — this round's new records, generated and minted,\n  in the record shape, before any `state` is stamped.\n\nEach file is optional and may be empty, and each is refused on the\ncarry form's terms, with its messages. The **live list** is the\ntheorems that get a disprover this round: every record this round's\nedits do not retire that holds no `state`, or `disproved` or\n`unsettled`. `--full` makes it every record whose `state-detail` is not\n`human-refuted`, retired ones included, except those this round's edits\nretire.\n\n**A report's grammar.** A disprover's or verifier's result file is\nclassified on the template its sender's file gives under \"Output\" —\n`theorem-disprover.md` and `counterexample-verifier.md`. Exactly one\n`VERDICT:` line is required, and then:\n\n| Verdict | Well formed when it carries |\n| --- | --- |\n| `SURVIVED` | a non-empty `CHECKED:` |\n| `UNSETTLED` | a non-empty `REASON:` and a non-empty `CHECKED:` |\n| `DISPROVED` | a non-empty `COUNTEREXAMPLE:`, an `EVIDENCE:` line followed by a `>` quote, a non-empty `CONSEQUENCE:`, and a `CONSEQUENCE-CLASS:` line |\n| `REFUTED` | a non-empty `REASON:` |\n| `STANDS` | a non-empty `CONSEQUENCE:`, and a `CONSEQUENCE-CLASS:` holding one of the four tokens |\n\nAny other report is malformed. A `DISPROVED` report whose class line\nholds no token is well formed with its class underivable. The grammar\ndoes not check that a quote is verbatim; the verifier does.\n\n- **`next`** — prints the arm the round is in, alone on the first line,\n  then one line per theorem with work left in each stage up to that\n  arm's:\n\n  ```text\n  \u003Cstage>\\t\u003Ctheorem-id>\\t\u003Coutstanding|in-flight|spawned|overdue|returned-unsaved>\\t\u003Cagent-id>\\t\u003Center-time>\n  ```\n\n  The last two fields are empty for `outstanding`; for a child yet to\n  enter they are `-` and its theorem's last `spawn` time. It takes\n  `--head-sha \u003Csha>`, `--deadline-minutes \u003Cn>`, `--edits`, `--from` and\n  `--full`, all optional.\n\n  | Token | The log shows |\n  | --- | --- |\n  | `no-log` | no round log; nothing else is read or printed |\n  | `moved-head` | an `anchor` naming a head other than `--head-sha`, only when `--head-sha` is given; nothing else is printed |\n  | `generate` | `list` not settled in the `generate` stage |\n  | `disprove` | a live theorem neither settled nor in flight in the `disprove` stage, or one in flight there |\n  | `verify` | no live theorem outstanding in the `disprove` stage, and a well-formed `DISPROVED` report whose verifier is unsettled |\n  | `dispose` | no theorem outstanding in the `verify` stage |\n\n  A stage's members are `list` for `generate`, the live list for\n  `disprove`, and for `verify` the live theorems whose disprover report\n  is a well-formed `DISPROVED` one; a malformed one earns no verifier.\n  Outstanding and in flight are as \"What the reader derives\" below\n  defines them. An outstanding theorem is printed `outstanding`, and a\n  theorem with a child in flight is printed with its child's state and\n  never as `outstanding`, member or not:\n\n  - **`returned-unsaved`** — a `return` record in the stage names the\n    child, which finished without saving and never will, so this is work\n    at once, whatever the deadline;\n  - **`overdue`** — the child, with no `return`, has an `enter` at least\n    `--deadline-minutes` before the clock at the time of the call.\n    Without `--deadline-minutes` nothing is overdue;\n  - **`in-flight`** — any other child in flight.\n\n  A theorem with no child in flight that the stage has not settled, and\n  a child yet to enter there, as \"What the reader derives\" below defines\n  one, is printed with that child's state, never as `outstanding`:\n\n  - **`overdue`** — its last `spawn` is at least `--deadline-minutes`\n    before the clock at the time of the call;\n  - **`spawned`** — otherwise.\n- **`dispose`** — prints one row per live theorem, in id order, then one\n  verdict line per member of `--issues`, in the order given, and per\n  other issue the records tag, in first-tagged order, then the overall\n  verdict:\n\n  ```text\n  \u003Ctheorem-id>\\t\u003Cdisposition>\\t\u003Cclass>\\t\u003Cseverity>\\t\u003Cstate>\\t\u003Cstate-detail>\n  verdict\\t\u003Cissue-number>\\t\u003Cverdict>\n  verdict\\toverall\\t\u003Cverdict>\n  ```\n\n  `\u003Cissue-number>` is the issue without its `#`. `--issues \u003Cissues>`,\n  required, is the issue set under review, its members separated by\n  spaces or commas, each `N` or `#N`. It also takes `--edits`,\n  `--from`, `--full` and `--loop-exited`, all optional.\n  `--loop-exited` says the resume-pass loop has exited for the round.\n  Without it, a live theorem with no result file for its stage gets no\n  row: the mode prints nothing on stdout, names each such theorem and\n  its stage on stderr, and exits 3. With it, such a theorem takes its\n  stage's no-verdict row.\n\n  | Disprover | Verifier | `\u003Cdisposition>` |\n  | --- | --- | --- |\n  | `SURVIVED` | not spawned | `verified-survived` |\n  | `DISPROVED` | `REFUTED` | `verified-refuted` |\n  | `DISPROVED` | `STANDS` | `finding`, class from the verifier |\n  | `DISPROVED` | malformed | `finding-verifier-malformed`, class from the disprover's proposal |\n  | `DISPROVED` | no result file, with `--loop-exited` | `disproved-unverified` — no finding, no severity |\n  | `UNSETTLED` | not spawned | `unsettled-disprover-unsettled`, no severity |\n  | malformed | not spawned | `unsettled-disprover-malformed`, no severity |\n  | no result file, with `--loop-exited` | not spawned | `unsettled-no-verdict`, no severity |\n\n  \"Could not be settled\" and \"unsettled\" name the `unsettled-` rows.\n  `\u003Cclass>` and `\u003Cseverity>` are `-` on every row but a finding's. The\n  state each row stamps:\n\n  | Rows | `\u003Cstate>` | `\u003Cstate-detail>` |\n  | --- | --- | --- |\n  | the two `verified-` rows | `retired`, its `settled-at` this round's head SHA | `survived` or `disproved-but-refuted` |\n  | the two `finding` rows | `disproved` | `finding \u003Cn>, \u003Cseverity>`, with `, class-underivable` after it on such a finding |\n  | `disproved-unverified` | `disproved` | `unverified` |\n  | the `unsettled-` rows | `unsettled` | `-`, the field emptied |\n\n  Findings are numbered from 1 by severity, highest first, then by id. A\n  theorem that got no disprover this round has no row and keeps the\n  state and head SHA it had; a round whose log holds no `spawn` and no\n  `enter` record — the empty-delta round — gives no theorem a row.\n\n  **The severity** is the class table's, or High where the class is\n  underivable, and a `severity-override` on the record,\n  case-insensitively one of the four severities, replaces it. Nothing\n  else adjusts it. An override that is none of the four is refused,\n  exit 2, on a theorem whose finding it would grade.\n\n  | Consequence class | Severity |\n  | --- | --- |\n  | `breaks-production` | Critical |\n  | `behavior-broken-or-criterion-unmet` | High |\n  | `defect-no-shipped-breakage` | Medium |\n  | `optional-polish` | Low |\n\n  The class is **underivable** — `class-underivable` in `\u003Cclass>` — when\n  the verifier's report is malformed and the disprover's proposal is not\n  a token either.\n\n  **The verdicts** are derived per issue, over the findings and\n  unsettled theorems tagged to it, and overall over all of them: any\n  unsettled theorem → `BLOCKED`, whatever the findings; else any\n  Critical, High or Medium finding → `NEEDS_CHANGES`; else, with only\n  Low findings or none, `APPROVED`. A theorem with a row contributes by\n  its row; any other by the state it carries — `unsettled` as an\n  unsettled theorem, and `disproved` with a `finding \u003Cn>, \u003Cseverity>`\n  state-detail as a finding at that severity, or at its override.\n- **`summary`** — renders the review body to post from the round's\n  `records` and `review` files, and prints it as Markdown and nothing\n  else. It takes no flag but the two identifying ones, and exits\n  non-zero, printing nothing, when the round lacks either file or the\n  review lacks a section it copies. The body is an index into the round's state\n  directory, never a copy of the argued review. In order:\n\n  1. the stamp `\u003C!-- sdlc:review-round \u003Cn> -->`, `\u003Cn>` being\n     `--round`, which marks the posted review as this round's;\n  2. the review's `## Verdicts` section, copied through unchanged;\n  3. its `## Review method` section, copied through unchanged;\n  4. `## Theorems`, naming the state root once as\n     `${XDG_STATE_HOME:-$HOME\u002F.local\u002Fstate}\u002Fsdlc\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpr\u003CN>\u002F`,\n     then one line per recorded theorem in id order —\n     `- \u003Cid> — \u003Cstate>, \u003Cstate-detail> — \u003Cwhat changed> — \u003Cpaths>` —\n     where what changed is `new` for a record the carried records lack,\n     `unchanged` when its state, state-detail and `settled-at` are as\n     they held them, and otherwise `was \u003Cstate>, \u003Cstate-detail>` as they\n     held it, `unattacked` standing for no state;\n  5. `## Findings`, one line per finding in number order —\n     `- \u003Cn> — \u003Cseverity> — from \u003Cid>, \u003Cissues> — \u003Cpaths>` — or `none`;\n  6. its `## Overall verdict` section, copied through unchanged;\n  7. its `## Closing-line corrections` section, copied through\n     unchanged.\n\n  A review section runs from its `## \u003Cname>` heading to the next\n  level-two heading outside a code fence. `, \u003Cstate-detail>` is left\n  out where a theorem has none. Every `\u003Cpaths>` is the backquoted paths,\n  relative to that root, of each file holding the line's detail: a\n  finding's argued text is in its round's `review` file, and a child's\n  report in `round\u003Cn>\u002F\u003Ctheorem>-\u003Cagent>`, this round's when it has one,\n  else the highest round below holding one — so a carried-forward\n  retired theorem points at the older round its detail is in. A\n  theorem with no report anywhere points at this round's `records`. No\n  argued text, no quoted counterexample and no record field but a\n  theorem's state and state-detail and a finding's `issues` appear in\n  the output.\n\n## The line grammar\n\nOne record per line, whitespace-separated columns, appended, and **no\nline is ever revised in place**:\n\n```text\nanchor  \u003Cinstant> \u003Chead-sha> \u003Cround-type>\nspawn   \u003Ctheorem> \u003Cstage> \u003Cinstant> \u003Cagent> \u003Cmodel> \u003Ceffort>\nenter   \u003Ctheorem> \u003Cstage> \u003Cinstant> \u003Cagent-id> \u003Ctranscript-path>\nleave   \u003Ctheorem> \u003Cstage> \u003Cinstant> \u003Cagent-id> \u003Cresult-file>\nreturn  \u003Ctheorem> \u003Cstage> \u003Cinstant> \u003Cagent-id> tokens=\u003Cn> tools=\u003Cn> ms=\u003Cn>\nstopped \u003Ctheorem> \u003Cstage> \u003Cinstant> \u003Cagent-id>\n```\n\n`--mode print` adds one line per result file it finds, synthesized from\nthe directory at read time and stored nowhere, and then the round's\ntype as \"The identifying flags\" above settles it, so no reader applies the\nrule for an anchor naming none itself:\n\n```text\nresult      \u003Ctheorem> \u003Cagent> \u003Cresult-file>\nround-type  \u003Cround-type>\n```\n\nEvery instant is `date -u +%Y-%m-%dT%H:%M:%SZ`. `\u003Cstage>` is\n`generate`, `disprove` or `verify`, and `\u003Cround-type>`\n`code-and-instruction-markdown` or `documentation`. The script rejects\nany column value carrying whitespace, which would shift its own line's\ncolumns.\n\nA `result` line carries the agent rather than the stage because that is\nwhat the file's own name holds, and the name is split back apart at its\nfirst dash — so a theorem id carries no dash and the script refuses one\nthat does. Which stage a result belongs to follows from the agent that\nwrote it.\n\nThe generation stage answers no single theorem, so its theorem column\nis the literal `list` — the thing it produces. Every other stage's is a\ntheorem id.\n\nThe agents log holds one record kind, on the same terms — one line per\nrecord, appended, never revised, every column a single token:\n\n```text\nagent   \u003Cinstant> \u003Cagent> \u003Cagent-id>\n```\n\n**Two lifecycles share the log, and the split is what keeps the\nvocabulary from drifting the next time a kind is added.** `spawn`,\n`return` and `stopped` are the caller's view of a child — it asked for\none, it heard back about one, it wrote one off. `enter` and `leave` are\nthe child's own — it began, and it finished. A caller therefore never\nwrites an `enter` or a `leave`, and a child never writes any of the\nother three.\n\nA `spawn` record is written per child rather than per theorem, so a\ntheorem re-spawned in a later wave carries one for each attempt. That\nis what makes a child that never started distinguishable from one that\nstarted and vanished. The derivations below read `spawn` as a set of\ntheorem ids, so the repeats change nothing they answer.\n\nThe `anchor` line's `\u003Chead-sha>` is the head commit the round's\ntheorems were generated against, and it is what a resume compares\nagainst `origin\u002F\u003Cbranch>` before trusting a single record: a scheduled\nsweep force-rebases open PR branches and can fire mid-round, and\nverdicts from two trees must never be mixed.\n\n## What the reader derives\n\n**Everything that changes as the round runs is derived on each read,\nnever stored.** A stored list is a line that must be revised to stay\ntrue; a derived one cannot go stale. The script is the reader: `next`\nand `dispose`, under \"The derivation modes\", apply the rules below, and\na caller asks them rather than deriving anything off the log itself.\n\n**A theorem is settled in a stage when its child wrote `leave`, or when\nits result file exists** — never when the caller heard back: a `return`\nrecord settles nothing, and a hand-back is never read. The two are\nalmost always the same fact, and the second is what covers a child that\nwrote its report and died before the record landed.\n\nThe result file is the one under the stage's agent, `theorem-generator`,\n`theorem-disprover` or `counterexample-verifier`, whatever effort a\n`spawn` record gave it.\n\nA stage's **outstanding** theorems are its members, over the live list\nrather than over the theorems the log was told about, less the settled\nones, the in-flight ones and those with a child yet to enter, which is\nwhat puts a theorem no instance ever spawned back in play.\n\nA theorem has a **child yet to enter** in a stage exactly when its last\n`spawn` there is followed by neither an `enter` nor a `stopped` there.\n`--mode next` and `--mode wait` apply that one rule, deciding it by the\norder of the records, never by comparing counts of `spawn` and `enter`\nrecords. A `stopped` naming an earlier child — one an `enter` of the\ntheorem in the stage named before it — writes off that child alone, so\nlanding after a later `spawn` it leaves the replacement yet to enter.\nAny other `stopped`, `-` included, writes off the child the last\n`spawn` started, before its `enter`, so the theorem is outstanding\nagain until a later `spawn` — unless an earlier child of the theorem is\nstill in flight in the stage, which leaves it in flight.\n\nThe verdict itself is in the result file, which the `leave` line names\nand the `result` line names again, and is never inferred from the log.\n\n**Whether an outstanding theorem has a child in flight is a second\nquestion, and it is keyed on the child rather than on the theorem.** A\ntheorem is in flight when its **last** `enter` in that stage carries an\nagent id that no `leave` and no `stopped` of that theorem carries, and\nno result file for it under `--agent` exists. `--mode print-in-flight`,\n`--mode next` and `--mode wait` apply that derivation. A `stopped` is\nmatched to an `enter` by agent id, never by where it lands, so an\noriginal child's `stopped` that lands after its replacement's `enter`\nwrites off the original alone and leaves the replacement in flight.\n\nThat is the question a deadline arm asks — an outstanding theorem with\nno child in flight has nothing to be overdue — and the one the next\nwave asks before spawning.\n\n`stopped` kills the **child**, not the **theorem**: it subtracts from\nin-flight and not from outstanding. A derivation that left the child in\nflight would report the theorem overdue on every later read and take\nthe deadline arm against a child already written off; one that\nsubtracted the theorem from the outstanding set would report an\nunanswered theorem as settled. The `enter` record, not this one, is\nwhat names the stopped child's worktree for cleanup.\n\n**A duplicate `leave` is a diagnostic, not a conflict, and the later\none wins.** A child written off as lost can report anyway, leaving one\ntheorem with two `leave` records. There being one definition per\nstage, the replacement carries the same `--agent` name as the child it\nreplaced, so the two share a result-file name and there is one file,\nthe later child's, since its rename overwrote the earlier report. So\nthe theorem's verdict is the later child's by construction: it is the\nverdict in the one file there is to read, and no reader has a tie to\nbreak. Both records stay in the log, because the pair is evidence that\na child believed dead was alive, and the reader reports it as such. No\nline is revised, so concurrent appends cannot collide.\n\n## A child's hand-back\n\nA child's `leave` record and result file land before the child\nreturns, so by the time its final `\u003Ctask-notification>` — the one\nsaying it finished — reaches the caller a missing `leave` is final\nrather than a race. A notification saying the child may still be\nrunning is interim: a child that ends its turn with background work of\nits own running wakes when that work exits and carries on, so its\n`leave` can still land. A child therefore makes\nits `leave` call before it composes its hand-back, and composes one only\nfrom what that call did:\n\n- **The call succeeded** — the hand-back's first line is the\n  result-file path the call printed, and the report the file holds\n  follows it.\n- **The call failed** — the hand-back is a failure report carrying no\n  verdict and no theorem, so nothing the caller reads from it can stand\n  in for the result file that was never written:\n\n  ```text\n  LEAVE FAILED\n  COMMAND: \u003Cthe leave command, as run>\n  OUTPUT: \u003Ceverything it printed, verbatim>\n  ```\n","# Agent Result Persist Interface\n\n`sdlc-agent-result-persist` keeps one review round's evidence outside\nevery worktree: a **round log** of one-line records, one **result file**\nper child holding that child's full report, the round's **records file**\nholding its theorem records, and the round's **review file** holding the\nargued review it composed. Any instance of\n`sdlc:theorem-based-pr-reviewer` learns what is left to do from the\nscript's derivation modes, which read the log and the result files and\nnothing it heard back; the next round\nreads its predecessor's theorem records out of the records file, and the\nend of an orchestrate loop assembles the run's detail out of the review\nfiles. Beside the rounds, the PR's **agents log** records every agent\nspawned for the PR, so the cleanup after the PR can find each one's\nworktree by its agent id.\n\nThat is the whole design. A child that ran, finished and reported can\nstill skip its own last call, and a `\u003Ctask-notification>` can go\nundelivered; both failures look identical from the caller's side, and\nneither is recoverable from the caller's memory. So **the child writes\nits own entry and its own exit**, and the caller's view of a child is\ntelemetry rather than truth.\n\n`sdlc:theorem-based-pr-reviewer` anchors the round, records each spawn,\nreads the log back, records a child it writes off, and at the end of the\nround stores its records file and its review file. The theorem\ngenerator, `sdlc:theorem-disprover` and `sdlc:counterexample-verifier`\neach write their own `enter` and `leave`. **Every log record is a\nsingle atomic append**, so no two writers can be ordered wrongly and no\ncall has to know what the log already holds. The records file and the\nreview file are not records: each is written whole and replaces\nwhatever the round held before, so a resumed instance that re-derives\nthe round stores its own version over its predecessor's rather than\nadding to it. The carry form below builds the records from the round\nbelow `--round`, never from the round's own, so the resumed instance's\nrecords are rebuilt from the same input its predecessor's were.\n\n## Invocation\n\n```text\nsdlc-agent-result-persist --mode \u003Cmode> \\\n  --pr \u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>#\u003Cn> [--round \u003Cn>] \\\n  [mode-specific flags]\nsdlc-agent-result-persist --mode list [\u003Crepository>]\nsdlc-agent-result-persist --mode repos\n```\n\nSpell the command as a bare name, never by path: the rule that lets a\nchild run it unattended — `Bash(sdlc-agent-result-persist:*)` — is\nkeyed on that spelling, and it lives in the caller's own settings\nbecause this plugin ships no permission rules.\n\n## The payload: `--from \u003Cpath>`, or stdin\n\n`leave`, `records` and `review` each store a **payload** — a report, a\nround's records, a round's review. The payload is read from the file\n`--from \u003Cpath>` names, or from **stdin** when no `--from` is passed.\nWith both present, `--from` wins and stdin is not read. `next` and\n`dispose` read the round's new records from `--from`, per \"The\nderivation modes\" below; every other mode refuses it.\n\nPass the payload with `--from`, naming a file you wrote with the Write\ntool. The harness's worktree-isolation guard grades a heredoc on the\ntext it carries, and refuses the call when that text names `git`\nanywhere — so a report that quotes a `git log` line or a\npath under `.git\u002F` cannot travel in a heredoc, and quoting it changes\nnothing. The guard does not read a Write tool's content, and it never\nsees the file's bytes on the persist call.\n\nA child stages its `leave` payload in the session scratchpad the\nharness names in its environment, at\n`\u003Csession-scratchpad>\u002Fpr\u003Cpr>-r\u003Cround>-\u003Cstage>-\u003Ctheorem>-\u003Cagent>-report.md`,\nfilling in the `--pr`, `--round`, `--stage`, `--theorem` and `--agent`\nvalues of its own `leave` call, `pr\u003Cpr>` spelled as the state directory\nspells it — the number after the `#` of `--pr`. Every child in a\nfan-out shares that one scratchpad, so a name missing the stage, the\ntheorem or the agent would let two concurrent children stage over each\nother's reports; theorem ids restart at `T1` on every PR, so a name\nmissing the PR would let two PRs' fan-outs in one session do the same;\nand the persist script never\nremoves the file, so a name missing the round would leave an earlier\nround of the same PR in the same session holding the path a later\nround's child stages at.\n\nIf Write refuses because a file already exists at that path, Read it,\nthen Write again.\n\n- A `--from` path that is not an existing file is refused, non-zero,\n  with a message naming the path, before anything is written.\n- A `--from` file that exists but cannot be read is refused, non-zero,\n  with a message naming that file.\n- An empty payload is refused either way, except by `records --carry`,\n  whose payload is only the round's new records, and by `next` and\n  `dispose`, which read the same. With no `--from`, empty stdin\n  gets `--mode \u003Cmode> takes the \u003Cnoun> on stdin, and nothing arrived`;\n  an empty `--from` file gets a message naming that file.\n- The file is read, never moved or removed: it stays where its writer\n  put it.\n\n## The identifying flags\n\nThese two go on **every** call, and \"The paths\" below says what they\ncompose, except where a mode acts above the level a flag names and\nrefuses it: `delete` removes the whole PR's directory, `print-root`\nnames it, `agent` and `print-agents` write and read the PR's agents\nlog beside its rounds, and `rounds` lists the rounds themselves, so each\nrefuses `--round`, `list` reads across\nevery PR of a repository, so it refuses `--pr` and `--round` alike and takes the\nrepository instead, and\n`repos` reads across every repository, so it refuses both and takes no\nrepository. `print-records` selects the round itself, so `--round` is\noptional there and bounds that selection rather than naming a round.\n\n- `--pr \u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>#\u003Cn>` — the PR, by the canonical\n  reference `\u002Fgithub-prs:pr-view \u003CPR> --ref` prints: its repository,\n  host included, since one machine holds state for repositories on\n  several hosts and the same owner\u002Frepo on two of them is two\n  repositories, then `#` and its number. Pass the reference you were\n  given; never resolve the repository yourself. A bare number, or a\n  reference without a host, is a usage error. Each of host, owner and\n  repo may hold only letters, digits, `.`, `_` and `-`, and none may be\n  `.` or `..`.\n- `--round \u003Cn>` — a number. Rounds count review passes from 1, and\n  **`--round 0` is valid**: the pre-loop seed, settled by the\n  orchestrator before any implementer ran.\n\n`list`'s repository is an optional operand, never a flag:\n`\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>`, `https:\u002F\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>`, or a shorter\n`\u003Cowner>\u002F\u003Crepo>` or `\u003Crepo>`. Omitted, it is the current repository —\nthe one the checkout's remote names — and a shorter form takes the\nsegments it omits from the current repository. The script resolves the\ncurrent repository itself; pass the operand as you were given it, or\nnone.\n\n**One round is one log.** There is no per-fan-out file and no `--agent`\nin the path: the `stage` column below says which fan-out a record\nbelongs to, so two files can never disagree about the round and a\nreader answers every stage's question from one `--mode print`.\n\n**A round has a type**, the class of file it reviews:\n`code-and-instruction-markdown` or `documentation`, the reviewer's\n`--mode`. Rounds of both types share one sequence per PR, so a\ndocumentation round takes the number after the last code round, and\nthe paths do not change with the type. The `anchor` call is where the\ntype is written, as `--round-type \u003Ctype>`, and every read bounded by a\nround takes that round's type from there: a round whose log carries no\nanchor naming\na type — round 0, which holds the seed and its generator's `spawn`\nrecord and no anchor, or a round anchored before\nrounds had a type — is a `code-and-instruction-markdown` round. A round\ncarries only the records of its own type, so the first documentation\nround carries nothing; theorem ids run in one sequence across both\ntypes, so its first new id is still one above the highest id any round\nbelow it holds.\n\n## The paths\n\nThe script composes every path below and **no caller ever reads or\nwrites one by path** — there is no path string to mistype, and none to carry\nacross a turn boundary. A reader learns a result file's path by reading\nit out of the log it just printed, and reaches the records and review\nfiles through the print modes named for them rather than by path at\nall.\n\nA caller does spell the PR's state root\n`${XDG_STATE_HOME:-$HOME\u002F.local\u002Fstate}\u002Fsdlc\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpr\u003Cpr>\u002F` in\nprose that points a **human** at the directory: the review body\n`--mode summary` renders names it once and hangs a round-relative path\noff each theorem and finding line, and every file that tells a reader\nwhere a round's detail is spells the same root. That is a signpost, not\na route: nothing composes it to open a file with.\n\nThe round gets a **directory of its own**, and the identifying flags\nare the whole of what composes it — no session is part of the path.\nEach is a fact about the PR under review, which is what makes a round\nsurvive the session that opened it: a reviewer resumed in a session\nthat never saw the first one holds both already, composes the same\npath, and reads the same log. The script uses the state variable when\nset and non-empty and `$HOME\u002F.local\u002Fstate` otherwise. This directory is where\nthe whole of a round's output lives: the theorem\nrecords that the next round carries forward, and the argued review it\ncomposed, are files here rather than text on the PR.\n\n```text\n${XDG_STATE_HOME:-$HOME\u002F.local\u002Fstate}\u002Fsdlc\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpr\u003Cpr>\u002Fround\u003Cround>\u002Flog\n\u003Cthe same directory>\u002F\u003Ctheorem>-\u003Cagent>\n\u003Cthe same directory>\u002Frecords\n\u003Cthe same directory>\u002Freview\n${XDG_STATE_HOME:-$HOME\u002F.local\u002Fstate}\u002Fsdlc\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpr\u003Cpr>\u002Fagents\n~\u002F.claude\u002Fprojects\u002F\u003Cproject>\u002F\u003Csession>\u002Fsubagents\u002Fagent-\u003Cagent-id>.jsonl\n```\n\n`log` is the round log, `\u003Ctheorem>-\u003Cagent>` a child's result file,\n`records` the round's theorem records, and `review` the round's argued\nreview; `agents` is the PR's agents log, beside its rounds rather than\nin one, since an agent spawned for the PR belongs to no round and a\nvoided round's rename must not carry it away. The `.jsonl` under\n`~\u002F.claude\u002Fprojects\u002F` is the harness's own transcript of a child, which\n`--mode enter` records. The records and\nthe review are written at the end of the round, and a voided round's\nrename carries both with it exactly as it carries the log and the\nresult files.\n`\u003Cproject>` is the **primary clone's** path with every character\noutside `[A-Za-z0-9-]` replaced by a dash — measured on a `\u002F` and on a\n`.` alike. Every child runs in a worktree, so its own cwd is the wrong\nbasis: the primary root is `git rev-parse --git-common-dir` passed\nthrough `dirname`. `\u003Csession>` is `CLAUDE_CODE_SESSION_ID` and\n`\u003Cagent-id>` is the child's own worktree name with `agent-` stripped.\nThe harness's per-session scratchpad holds an `.output` symlink to that\ntranscript; the record carries the target, which outlives the symlink.\n\nWith any of those unavailable the record still lands, carrying `-` in\nthe transcript column. A missing path is worth less than a missing\nrecord.\n\nThe repository's directory, `sdlc\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002F`, carries a\n`repo.yml` naming the repository it holds, which the script writes when\nit creates the directory:\n\n```yaml\nschema-version: 1\nhost: github.com\nowner: \u003Cowner>\nrepo: \u003Crepo>\n```\n\nThe file is what identifies the directory; no reader derives the\nrepository from the path's depth or segment names, and where the file\nand the path disagree the file wins. State written before the host was\npart of the path sits at `sdlc\u002F\u003Cowner>\u002F\u003Crepo>\u002F`. Every run, of every\nmode but `repos`, first moves that directory to `sdlc\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002F`,\nhost from `--pr` or from `list`'s repository, and writes its\n`repo.yml`; no mode reads the old path afterwards. A run that finds\nstate at both paths refuses, non-zero, naming both, and moves nothing.\n\n**Nothing here is deleted but by `--mode delete`, and that mode is\ncalled only by `sdlc-orchestrate-cleanup`, which the human invokes and\nwhich `\u002Fsdlc:orchestrate` runs for a PR after that PR has merged.** A\nround's files are the evidence a stalled or voided round is diagnosed\nfrom, so no mode that runs during a review removes one, and none ever\nexpires: a PR's directory stays until `\u002Fsdlc:orchestrate` cleans up\nafter the PR's merge — a merged PR's evidence is no longer needed to\ndiagnose a round — or the human decides its evidence is no longer\nwanted.\n\n## The modes\n\nOne word, one meaning: **every mode is named for what it writes** — the\nrecord, or the file — the `print` modes for the ones that read one\nround, `print-root` for the PR directory it names, `print-agents` for\nthe agent ids it reads across the PR's logs, `rounds` for the rounds it\nlists, `list` and `delete`\nfor what they do across a repo's PR directories, `repos` for what\nit lists across the state root, `wait` for what it does, and `next`,\n`dispose` and `summary`, under \"The derivation modes\", for what they\nderive.\n\n- **`anchor`** — writes the `anchor` line carrying `--head-sha \u003Csha>`\n  and `--round-type \u003Ctype>`, both required. One call per round, and\n  **idempotent**, which is what lets the reviewer make it without\n  knowing whether a child has already written:\n\n  - **No `anchor` in the log** — the line is appended, creating the log\n    when it is absent. A child that started first has already created\n    it with its own `enter`, so the anchor is not necessarily the first\n    line and no reader may assume it is.\n  - **An `anchor` naming the same head SHA and type** — this same\n    round's, so the call writes nothing and exits zero.\n  - **An `anchor` naming the same head SHA and another type** — the\n    round is the other loop's, and nothing moved under it, so the call\n    is refused, non-zero, naming both types, and writes nothing.\n  - **An `anchor` naming a different head SHA** — the records describe\n    a tree that no longer exists, so the round's whole directory is\n    renamed to `round\u003Cround>.voided-\u003Cinstant>` — kept as the evidence\n    of what the voided round did — and a fresh `round\u003Cround>\u002F` holding\n    only the new anchor takes its place. Nothing is deleted. The result\n    files move with the log because a reader takes a report's existence\n    as a settled theorem, and one left under its own name would settle\n    the fresh round's theorem from the voided tree.\n- **`spawn`** — appends one `spawn` record for `--theorem` in\n  `--stage`, carrying `--agent`, `--model` and `--effort`. The\n  caller's, once per child it spawns, and the orchestrator's once, at\n  `--round 0`, for the seed generator it spawned before the PR existed.\n  Model and effort are on this\n  record because the caller chose them and a child can read neither;\n  pass the token `default` where the spawn named none and the\n  definition's own frontmatter decided.\n- **`enter`** — appends one `enter` record for `--theorem` in\n  `--stage`. A child's first act, before it does any work. The script\n  derives the agent id from the child's own worktree and composes the\n  transcript path, so nothing is passed in.\n- **`leave`** — writes the child's report, read as its payload, to that\n  child's result file, then appends one `leave` record naming the file.\n  A child's final act. `--agent` is half the file's name. The report is\n  stored byte for byte: no size limit, no encoding, no quoting. Empty\n  input is refused — a `leave` exists to carry a report. The report is\n  written before the record that names it, so a run that dies between\n  the two leaves the report readable rather than a record pointing at\n  nothing. Once both have landed, the call prints the result file's\n  path on stdout, and that line is what a child's hand-back opens with,\n  per \"A child's hand-back\" below; a refused `leave` prints nothing\n  there.\n\n  The payload lands first in `\u003Cresult-file>.partial-\u003Cpid>` and is renamed into\n  place only once it is whole, because a result file's mere existence\n  settles its theorem: a report streamed straight to its own name would\n  settle the theorem from a fragment the moment the first byte landed,\n  and a child killed mid-write would leave that fragment there for\n  good. The rename is what makes the file appear complete or not at\n  all, and the `-\u003Cpid>` suffix is what keeps two writers from staging\n  over each other. A refused report — empty, a `--from` file that\n  could not be read, a result-file path carrying whitespace, a\n  `THEOREM:` mismatch or an id refusal below — leaves nothing behind:\n  the staging file is removed before the call exits non-zero, and no\n  `leave` record is appended.\n\n  With `--stage disprove` or `--stage verify`, the report must answer\n  the theorem it is filed under. The first line of the report that\n  starts `THEOREM:` names that theorem, and the call is refused,\n  non-zero, when no such line names one or when it names a theorem\n  other than `--theorem`; the message names the `--theorem` value and,\n  on a mismatch, the one the report named. A result file is named for\n  `--theorem`, and its existence settles that theorem, so a report\n  handed over from another child would otherwise settle a theorem it\n  never answered.\n\n  With `--stage generate` the report is the theorem list, filed under\n  `--theorem list`, and its new ids must continue the PR's sequence: one\n  above the highest id the records of any round below `--round` hold,\n  of either type, or `T1` when none holds any — round 0 included. Its\n  ids are the lines holding nothing but `T\u003Cn>`, above any `RETIREMENTS`\n  line, in order, and each is held to the rule the carry form holds a\n  new record to: a new id a carried record — one `print-records --round\n  \u003Cround>` would print — already holds, or one that is not the next id\n  in sequence, is refused, non-zero, with a message naming that id and\n  the expected next one. The call is refused as `print-records` would\n  be, too, when a round above `--round` holds records.\n- **`return`** — appends one `return` record for `--theorem` in\n  `--stage`, carrying `--agent-id` and the optional `--tokens`,\n  `--tools` and `--ms`. The caller's, from a final `\u003Ctask-notification>`\n  it received. It is **best-effort telemetry and never evidence**, and a\n  stage never waits on one. An omitted number leaves its column empty\n  rather than dropping the column.\n- **`stopped`** — appends one `stopped` record for `--theorem` in\n  `--stage`, carrying `--agent-id`, the id of the child it writes off,\n  as that child's `enter` record names it — or `-`, as `--mode next`\n  prints it, for a child written off before it wrote its `enter`. The\n  caller's, when it writes\n  a child off. It writes one whether or not it `TaskStop`ped that\n  child — a predecessor instance's child is never its to stop, and the\n  record is what says the child was written off either way.\n  `--agent-id` is required: without it the call exits non-zero and\n  appends nothing, since a record naming only the theorem would write\n  off whichever child the theorem had when it landed, a replacement\n  included.\n- **`print`** — writes the round log to stdout, followed by one\n  `result` line per result file present and then one `round-type` line\n  naming the round's type. A `.partial-\u003Cpid>` staging\n  from a `leave` still in flight is **skipped**, so a report reaches a\n  reader whole or not at all, and so are the round's `records` and\n  `review` files, which are the round's own output rather than any\n  child's report. Exits non-zero when the log\n  does not exist, which means neither the round's `anchor` call nor any\n  child's `enter` has run — the fresh-round case the reviewer branches\n  on before spawning anything.\n- **`print-in-flight`** — writes to stdout one line per theorem with a\n  child in flight in `--stage`, `\u003Ctheorem> \u003Cagent-id> \u003Cinstant>`: the\n  child's agent id and the instant of its `enter`, which is what its\n  deadline runs from. `--stage` and `--agent` are required, `--agent`\n  naming the definition whose result file settles the theorem —\n  `theorem-generator`, `theorem-disprover` or\n  `counterexample-verifier`. \"What the reader derives\" below states\n  what in flight means. Exits non-zero when the log does not exist, as\n  `print` does.\n- **`wait`** — blocks until a child in `--stage` settles or runs out of\n  time, then exits zero. `--stage` and `--deadline-minutes` are required.\n  It waits on each theorem with a child in flight in the stage, and on\n  each with a child yet to enter there, as \"What the reader derives\"\n  below defines both. It exits on whichever\n  comes first, printing one line, `\\t` standing for a tab:\n\n  - `leave\\t\u003Ctheorem>\\t\u003Cagent-id>` — a `leave` record in the stage\n    landed after the call started;\n  - `deadline\\t\u003Ctheorem>\\t\u003Cagent-id>` — `--deadline-minutes` have passed\n    since the `enter` of the earliest child it waits on, or since the\n    last `spawn` of a child yet to enter, whose agent id is `-`;\n  - `none` — no child is left to wait on, at once when there was none\n    from the start, a round with no log included.\n\n  It reads the log every two seconds, and writes and creates nothing.\n- **`records`** — writes the round's theorem records to the round's\n  `records` file. Without `--carry` it stores its payload whole: the\n  orchestrator's once, at `--round 0`, for the ruled seed, and the\n  reviewer's on a round with nothing to carry. With `--carry`, below, it\n  builds the file from the carried round: the reviewer's on every other\n  round that reaches disposition, an empty-delta round included. In the\n  plain form empty input is refused, and in both the bytes land in a\n  staging name and are renamed into place only once whole, for the\n  reason `leave` gives: a reader takes the file's existence as the\n  round's records, and half a file would carry half a round's theorems\n  into the next round with nothing saying so.\n\n  A records file is a sequence of records in id order, separated by one\n  blank line. Each opens with its id, `T\u003Cn>`, on a line of its own,\n  followed by one `key: value` line per field: `claim`, `issues`,\n  `settle-mode`, `pointers`, then, when present, `state`,\n  `state-detail`, `settled-at`, `severity-override`, in that order. Ids\n  are never reused.\n\n  **With `--carry` the script builds the file itself** rather than\n  taking one whole, and makes no decision while doing so — what each\n  record's new state is arrives as an edit:\n\n  1. It reads the records of the highest-numbered round **below**\n     `--round` that holds a records file and is of the type\n     `--round`'s own anchor names, skipping the\n     `.voided-\u003Cinstant>` directories as `print-records` does. A records\n     file at `--round` itself is not read: `--round` may be the latest\n     round holding records, and the carry then rebuilds that round's\n     file from the round below, so a resumed reviewer stores its round's\n     records again and gets the same file from the same edits. It\n     refuses when any round **above** `--round` holds a records file,\n     of either type.\n  2. It applies the **edits file** `--edits \u003Cpath>`, one edit per line:\n     `\u003Cid>`, a tab, `\u003Cfield>`, a tab, `\u003Cvalue>`. `\u003Cvalue>` is the rest\n     of the line and may be empty; an empty line is skipped. `\u003Cfield>`\n     is one of `state`, `state-detail`, `settled-at` and\n     `severity-override`. An edit to a field the record has replaces its\n     line in place; an edit to a field it lacks adds the line after the\n     record's other fields, the added lines in that same order. Only\n     `state` is validated — it is `disproved`, `unsettled` or `retired`\n     — and the other three are stored verbatim. `--edits` is optional:\n     a round that changes no carried record passes none.\n  3. It appends the **new records** read as its payload, in the record\n     shape above. Their ids, in payload order, are exactly `T\u003Cm+1>`,\n     `T\u003Cm+2>`, … where `T\u003Cm>` is the highest id the records of any round\n     below `--round` hold, of either type. The payload may\n     be empty here, so an empty-delta round and a round that only\n     retires are both written.\n  4. It writes the result in id order, staged and renamed into place as\n     the plain form is.\n\n  No carried record gains or changes a field that no edit names. Every\n  round from 1 on stamps a `state` on every record, so the result must\n  hold one on each.\n\n  Each of these is refused, non-zero, writing nothing and creating no\n  round directory, with a message naming the offending line or id:\n\n  - an edit line that is not three tab-separated parts;\n  - an edit naming an id no carried record has;\n  - an edit to a field outside the four;\n  - a `state` value outside the three;\n  - a second edit to the same field of the same record;\n  - a new record whose id a carried record already holds, or that is not\n    the next id in the `T\u003Cm+1>`, `T\u003Cm+2>`, … sequence;\n  - a result that leaves any record without `state` — a round-0 seed\n    record carried into round 1 unstamped is the case this catches —\n    naming each such id;\n  - `--carry` when no round below `--round` of its type holds a records\n    file, naming the type, or when a round above it does, naming that\n    round;\n  - `--edits` without `--carry` in any mode but `next` and `dispose`,\n    and `--carry` in any mode but `records`.\n- **`review`** — writes the round's argued review, read as its payload,\n  to the round's `review` file, on the same terms as `records`.\n- **`print-records`** — writes to stdout the records of the\n  **highest-numbered** round that holds a records file, ignoring the\n  `.voided-\u003Cinstant>` directories, whose records describe a tree that no\n  longer exists. The round to carry forward is the most recent one\n  there is, not one a caller names. A `--round \u003Cn>` bounds the\n  selection to the rounds **below** `\u003Cn>` of the type round `\u003Cn>`'s\n  anchor names, and `\u003Cn>` need not hold records itself: a round under\n  way passes its own number, so it reads the round it carries from even\n  when an earlier instance of it already stored this round's records.\n  With `--round \u003Cn>` it exits non-zero, printing no records, when any\n  round **above** `\u003Cn>` holds a records file — the condition `--carry`\n  refuses on, decided by the same code — so a stale `--round` fails at\n  this read rather than at the carry that follows it. Without\n  `--round`, `--round-type \u003Ctype>` narrows the selection to the rounds\n  of that type; beside `--round` it is refused, since that round's\n  anchor already names the type. Its first line is `round \u003Cn>`, naming the\n  round it selected, so a reader that needs the rest of that round's\n  state — its `anchor` line's head SHA, its review file — has the number\n  to ask for it with; the records follow from the second line on. Exits\n  non-zero when no round it considers holds a records file — a PR whose\n  round 1 has no round-0 seed to read, or a first documentation round —\n  naming the type it selected by.\n- **`print-round-records`** — writes the named round's records file\n  to stdout, byte for byte, with no `round \u003Cn>` line in front: the\n  caller named the round. It is the read for a caller that walks every\n  round rather than carrying the most recent one forward, and it\n  creates nothing. Exits non-zero when that round holds no records\n  file.\n- **`print-review`** — writes the named round's review file to stdout.\n  Exits non-zero when that round holds none.\n- **`print-root`** — writes the PR's state root to stdout as two lines,\n  each with its trailing `\u002F`: first expanded, then as the signpost \"The\n  paths\" describes, with `\u003Chost>`, `\u003Cowner>`, `\u003Crepo>` and `\u003Cpr>` filled\n  in and the state variable and its fallback left unexpanded. It is\n  composed here so a caller that names a file to a human relative to\n  the root spells no root of its own; it opens nothing. It takes **no\n  `--round`** and refuses one, creates nothing, and exits zero whether\n  or not the directory exists.\n- **`agent`** — appends one `agent` record to the PR's agents log,\n  carrying `--agent`, the definition spawned, and `--agent-id`, the id\n  the `Agent` tool's result names for the spawn — the `\u003Cagent-id>` of\n  the harness's `.claude\u002Fworktrees\u002Fagent-\u003Cagent-id>` worktree and its\n  `worktree-agent-\u003Cagent-id>` branch. The spawner's, once per agent it\n  spawns for the PR, whether or not that agent runs in a worktree of its\n  own. It takes **no `--round`** and refuses one; both `--agent` and\n  `--agent-id` are required.\n- **`print-agents`** — writes to stdout every agent id the PR's state\n  names, one per line, sorted and each once: every `agent` record's,\n  and every `enter` record's in every round log, the\n  `.voided-\u003Cinstant>` rounds included, since a voided round's children\n  left worktrees too. It takes **no `--round`** and refuses one, creates\n  nothing, and prints nothing for a PR with no state.\n- **`rounds`** — writes to stdout one round number per line, ascending,\n  for each round from 1 whose log exists. Round 0, the seed, is not\n  printed, nor is a `.voided-\u003Cinstant>` round. The numbers need not\n  start at 1 or run unbroken, so a caller visiting every round visits\n  what this prints rather than counting up from 1. It takes **no\n  `--round`** and refuses one, creates nothing, and prints nothing and\n  exits zero for a PR with no log.\n- **`list`** — writes to stdout one PR per line, as the\n  `\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>#\u003Cn>` reference `--pr` takes, in ascending\n  order of `\u003Cn>`, one per `pr\u003Cn>\u002F` directory under the repository's\n  `\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002F` state directory, and nothing else on the line; an\n  entry whose name is not `pr` followed by digits, or that is not a\n  directory, is skipped. The repository is the operand \"The identifying\n  flags\" describes. It takes **no `--pr` and no `--round`**, and\n  refuses either, and refuses a second operand. A repository no review\n  has run against has no directory, so the output is empty and the exit\n  zero; the mode creates nothing.\n- **`delete`** — removes `pr\u003Cn>\u002F` recursively, every round under it,\n  every voided round and the agents log with them. It takes **no `--round`** and\n  refuses one, and it refuses a missing `--pr` with the usual\n  `--pr is required` message. A directory already absent is the state\n  the call asks for, so it exits zero and prints nothing.\n- **`repos`** — writes to stdout one line per repository directory the\n  state root holds, `\u003Ckind> \u003Crepository> \u003Cdirectory>`, the directory\n  relative to `sdlc\u002F`. Every directory holding a `repo.yml` is read\n  from that file: `repo` when the file names the directory's own path,\n  `mismatch` when it names another, the repository being the file's\n  `\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>` either way. A directory two levels down\n  that has no `repo.yml` in it or one level down, and holds\n  `pr\u003Cn>\u002F` directories directly, is old-layout state:\n  `old \u003Cowner>\u002F\u003Crepo> \u003Cowner>\u002F\u003Crepo>`, its host unknown. It takes **no\n  repository and no flag but `--mode`**, refuses each with exit 2 before\n  it lists anything, moves nothing, and prints nothing for a state root\n  that does not exist.\n\n  **`delete` is the only mode that deletes stored state.** The one\n  thing any other mode removes is its own staging file, when `leave`,\n  `records` or `review` refuses its payload as empty or as a `--from`\n  file that could not be read, or `leave` refuses a report whose\n  `THEOREM:` line does not name `--theorem` or a theorem list whose ids\n  do not continue the carried records; `anchor` renames a voided round rather\n  than removing it.\n\nThe script stamps every record's time itself: the writer owns when the\nrecord was made.\n\nA refusal and a malformed call both exit non-zero, so the status says\nonly that the call did nothing. The message says which.\n\n### The derivation modes\n\n`next`, `dispose` and `summary` each read one round, named by `--pr`\nand `--round`, store no record and no file, and create no directory.\nIn the line shapes below `\\t` is the one tab that separates two fields,\nand in a field `-` stands for no value.\n\n**The round's theorems.** `next` and `dispose` read the round's records\nfrom three inputs:\n\n- the **carried records** — those `print-records --round \u003Cround>` would\n  print, refused as that read refuses, and none when no round below\n  holds records;\n- **`--edits \u003Cpath>`** — this round's adjustments to the carried\n  records, a retirement or a `severity-override`, one per line in the\n  carry form's edit grammar;\n- **`--from \u003Cpath>`** — this round's new records, generated and minted,\n  in the record shape, before any `state` is stamped.\n\nEach file is optional and may be empty, and each is refused on the\ncarry form's terms, with its messages. The **live list** is the\ntheorems that get a disprover this round: every record this round's\nedits do not retire that holds no `state`, or `disproved` or\n`unsettled`. `--full` makes it every record whose `state-detail` is not\n`human-refuted`, retired ones included, except those this round's edits\nretire.\n\n**A report's grammar.** A disprover's or verifier's result file is\nclassified on the template its sender's file gives under \"Output\" —\n`theorem-disprover.md` and `counterexample-verifier.md`. Exactly one\n`VERDICT:` line is required, and then:\n\n| Verdict | Well formed when it carries |\n| --- | --- |\n| `SURVIVED` | a non-empty `CHECKED:` |\n| `UNSETTLED` | a non-empty `REASON:` and a non-empty `CHECKED:` |\n| `DISPROVED` | a non-empty `COUNTEREXAMPLE:`, an `EVIDENCE:` line followed by a `>` quote, a non-empty `CONSEQUENCE:`, and a `CONSEQUENCE-CLASS:` line |\n| `REFUTED` | a non-empty `REASON:` |\n| `STANDS` | a non-empty `CONSEQUENCE:`, and a `CONSEQUENCE-CLASS:` holding one of the four tokens |\n\nAny other report is malformed. A `DISPROVED` report whose class line\nholds no token is well formed with its class underivable. The grammar\ndoes not check that a quote is verbatim; the verifier does.\n\n- **`next`** — prints the arm the round is in, alone on the first line,\n  then one line per theorem with work left in each stage up to that\n  arm's:\n\n  ```text\n  \u003Cstage>\\t\u003Ctheorem-id>\\t\u003Coutstanding|in-flight|spawned|overdue|returned-unsaved>\\t\u003Cagent-id>\\t\u003Center-time>\n  ```\n\n  The last two fields are empty for `outstanding`; for a child yet to\n  enter they are `-` and its theorem's last `spawn` time. It takes\n  `--head-sha \u003Csha>`, `--deadline-minutes \u003Cn>`, `--edits`, `--from` and\n  `--full`, all optional.\n\n  | Token | The log shows |\n  | --- | --- |\n  | `no-log` | no round log; nothing else is read or printed |\n  | `moved-head` | an `anchor` naming a head other than `--head-sha`, only when `--head-sha` is given; nothing else is printed |\n  | `generate` | `list` not settled in the `generate` stage |\n  | `disprove` | a live theorem neither settled nor in flight in the `disprove` stage, or one in flight there |\n  | `verify` | no live theorem outstanding in the `disprove` stage, and a well-formed `DISPROVED` report whose verifier is unsettled |\n  | `dispose` | no theorem outstanding in the `verify` stage |\n\n  A stage's members are `list` for `generate`, the live list for\n  `disprove`, and for `verify` the live theorems whose disprover report\n  is a well-formed `DISPROVED` one; a malformed one earns no verifier.\n  Outstanding and in flight are as \"What the reader derives\" below\n  defines them. An outstanding theorem is printed `outstanding`, and a\n  theorem with a child in flight is printed with its child's state and\n  never as `outstanding`, member or not:\n\n  - **`returned-unsaved`** — a `return` record in the stage names the\n    child, which finished without saving and never will, so this is work\n    at once, whatever the deadline;\n  - **`overdue`** — the child, with no `return`, has an `enter` at least\n    `--deadline-minutes` before the clock at the time of the call.\n    Without `--deadline-minutes` nothing is overdue;\n  - **`in-flight`** — any other child in flight.\n\n  A theorem with no child in flight that the stage has not settled, and\n  a child yet to enter there, as \"What the reader derives\" below defines\n  one, is printed with that child's state, never as `outstanding`:\n\n  - **`overdue`** — its last `spawn` is at least `--deadline-minutes`\n    before the clock at the time of the call;\n  - **`spawned`** — otherwise.\n- **`dispose`** — prints one row per live theorem, in id order, then one\n  verdict line per member of `--issues`, in the order given, and per\n  other issue the records tag, in first-tagged order, then the overall\n  verdict:\n\n  ```text\n  \u003Ctheorem-id>\\t\u003Cdisposition>\\t\u003Cclass>\\t\u003Cseverity>\\t\u003Cstate>\\t\u003Cstate-detail>\n  verdict\\t\u003Cissue-number>\\t\u003Cverdict>\n  verdict\\toverall\\t\u003Cverdict>\n  ```\n\n  `\u003Cissue-number>` is the issue without its `#`. `--issues \u003Cissues>`,\n  required, is the issue set under review, its members separated by\n  spaces or commas, each `N` or `#N`. It also takes `--edits`,\n  `--from`, `--full` and `--loop-exited`, all optional.\n  `--loop-exited` says the resume-pass loop has exited for the round.\n  Without it, a live theorem with no result file for its stage gets no\n  row: the mode prints nothing on stdout, names each such theorem and\n  its stage on stderr, and exits 3. With it, such a theorem takes its\n  stage's no-verdict row.\n\n  | Disprover | Verifier | `\u003Cdisposition>` |\n  | --- | --- | --- |\n  | `SURVIVED` | not spawned | `verified-survived` |\n  | `DISPROVED` | `REFUTED` | `verified-refuted` |\n  | `DISPROVED` | `STANDS` | `finding`, class from the verifier |\n  | `DISPROVED` | malformed | `finding-verifier-malformed`, class from the disprover's proposal |\n  | `DISPROVED` | no result file, with `--loop-exited` | `disproved-unverified` — no finding, no severity |\n  | `UNSETTLED` | not spawned | `unsettled-disprover-unsettled`, no severity |\n  | malformed | not spawned | `unsettled-disprover-malformed`, no severity |\n  | no result file, with `--loop-exited` | not spawned | `unsettled-no-verdict`, no severity |\n\n  \"Could not be settled\" and \"unsettled\" name the `unsettled-` rows.\n  `\u003Cclass>` and `\u003Cseverity>` are `-` on every row but a finding's. The\n  state each row stamps:\n\n  | Rows | `\u003Cstate>` | `\u003Cstate-detail>` |\n  | --- | --- | --- |\n  | the two `verified-` rows | `retired`, its `settled-at` this round's head SHA | `survived` or `disproved-but-refuted` |\n  | the two `finding` rows | `disproved` | `finding \u003Cn>, \u003Cseverity>`, with `, class-underivable` after it on such a finding |\n  | `disproved-unverified` | `disproved` | `unverified` |\n  | the `unsettled-` rows | `unsettled` | `-`, the field emptied |\n\n  Findings are numbered from 1 by severity, highest first, then by id. A\n  theorem that got no disprover this round has no row and keeps the\n  state and head SHA it had; a round whose log holds no `spawn` and no\n  `enter` record — the empty-delta round — gives no theorem a row.\n\n  **The severity** is the class table's, or High where the class is\n  underivable, and a `severity-override` on the record,\n  case-insensitively one of the four severities, replaces it. Nothing\n  else adjusts it. An override that is none of the four is refused,\n  exit 2, on a theorem whose finding it would grade.\n\n  | Consequence class | Severity |\n  | --- | --- |\n  | `breaks-production` | Critical |\n  | `behavior-broken-or-criterion-unmet` | High |\n  | `defect-no-shipped-breakage` | Medium |\n  | `optional-polish` | Low |\n\n  The class is **underivable** — `class-underivable` in `\u003Cclass>` — when\n  the verifier's report is malformed and the disprover's proposal is not\n  a token either.\n\n  **The verdicts** are derived per issue, over the findings and\n  unsettled theorems tagged to it, and overall over all of them: any\n  unsettled theorem → `BLOCKED`, whatever the findings; else any\n  Critical, High or Medium finding → `NEEDS_CHANGES`; else, with only\n  Low findings or none, `APPROVED`. A theorem with a row contributes by\n  its row; any other by the state it carries — `unsettled` as an\n  unsettled theorem, and `disproved` with a `finding \u003Cn>, \u003Cseverity>`\n  state-detail as a finding at that severity, or at its override.\n- **`summary`** — renders the review body to post from the round's\n  `records` and `review` files, and prints it as Markdown and nothing\n  else. It takes no flag but the two identifying ones, and exits\n  non-zero, printing nothing, when the round lacks either file or the\n  review lacks a section it copies. The body is an index into the round's state\n  directory, never a copy of the argued review. In order:\n\n  1. the stamp `\u003C!-- sdlc:review-round \u003Cn> -->`, `\u003Cn>` being\n     `--round`, which marks the posted review as this round's;\n  2. the review's `## Verdicts` section, copied through unchanged;\n  3. its `## Review method` section, copied through unchanged;\n  4. `## Theorems`, naming the state root once as\n     `${XDG_STATE_HOME:-$HOME\u002F.local\u002Fstate}\u002Fsdlc\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpr\u003CN>\u002F`,\n     then one line per recorded theorem in id order —\n     `- \u003Cid> — \u003Cstate>, \u003Cstate-detail> — \u003Cwhat changed> — \u003Cpaths>` —\n     where what changed is `new` for a record the carried records lack,\n     `unchanged` when its state, state-detail and `settled-at` are as\n     they held them, and otherwise `was \u003Cstate>, \u003Cstate-detail>` as they\n     held it, `unattacked` standing for no state;\n  5. `## Findings`, one line per finding in number order —\n     `- \u003Cn> — \u003Cseverity> — from \u003Cid>, \u003Cissues> — \u003Cpaths>` — or `none`;\n  6. its `## Overall verdict` section, copied through unchanged;\n  7. its `## Closing-line corrections` section, copied through\n     unchanged.\n\n  A review section runs from its `## \u003Cname>` heading to the next\n  level-two heading outside a code fence. `, \u003Cstate-detail>` is left\n  out where a theorem has none. Every `\u003Cpaths>` is the backquoted paths,\n  relative to that root, of each file holding the line's detail: a\n  finding's argued text is in its round's `review` file, and a child's\n  report in `round\u003Cn>\u002F\u003Ctheorem>-\u003Cagent>`, this round's when it has one,\n  else the highest round below holding one — so a carried-forward\n  retired theorem points at the older round its detail is in. A\n  theorem with no report anywhere points at this round's `records`. No\n  argued text, no quoted counterexample and no record field but a\n  theorem's state and state-detail and a finding's `issues` appear in\n  the output.\n\n## The line grammar\n\nOne record per line, whitespace-separated columns, appended, and **no\nline is ever revised in place**:\n\n```text\nanchor  \u003Cinstant> \u003Chead-sha> \u003Cround-type>\nspawn   \u003Ctheorem> \u003Cstage> \u003Cinstant> \u003Cagent> \u003Cmodel> \u003Ceffort>\nenter   \u003Ctheorem> \u003Cstage> \u003Cinstant> \u003Cagent-id> \u003Ctranscript-path>\nleave   \u003Ctheorem> \u003Cstage> \u003Cinstant> \u003Cagent-id> \u003Cresult-file>\nreturn  \u003Ctheorem> \u003Cstage> \u003Cinstant> \u003Cagent-id> tokens=\u003Cn> tools=\u003Cn> ms=\u003Cn>\nstopped \u003Ctheorem> \u003Cstage> \u003Cinstant> \u003Cagent-id>\n```\n\n`--mode print` adds one line per result file it finds, synthesized from\nthe directory at read time and stored nowhere, and then the round's\ntype as \"The identifying flags\" above settles it, so no reader applies the\nrule for an anchor naming none itself:\n\n```text\nresult      \u003Ctheorem> \u003Cagent> \u003Cresult-file>\nround-type  \u003Cround-type>\n```\n\nEvery instant is `date -u +%Y-%m-%dT%H:%M:%SZ`. `\u003Cstage>` is\n`generate`, `disprove` or `verify`, and `\u003Cround-type>`\n`code-and-instruction-markdown` or `documentation`. The script rejects\nany column value carrying whitespace, which would shift its own line's\ncolumns.\n\nA `result` line carries the agent rather than the stage because that is\nwhat the file's own name holds, and the name is split back apart at its\nfirst dash — so a theorem id carries no dash and the script refuses one\nthat does. Which stage a result belongs to follows from the agent that\nwrote it.\n\nThe generation stage answers no single theorem, so its theorem column\nis the literal `list` — the thing it produces. Every other stage's is a\ntheorem id.\n\nThe agents log holds one record kind, on the same terms — one line per\nrecord, appended, never revised, every column a single token:\n\n```text\nagent   \u003Cinstant> \u003Cagent> \u003Cagent-id>\n```\n\n**Two lifecycles share the log, and the split is what keeps the\nvocabulary from drifting the next time a kind is added.** `spawn`,\n`return` and `stopped` are the caller's view of a child — it asked for\none, it heard back about one, it wrote one off. `enter` and `leave` are\nthe child's own — it began, and it finished. A caller therefore never\nwrites an `enter` or a `leave`, and a child never writes any of the\nother three.\n\nA `spawn` record is written per child rather than per theorem, so a\ntheorem re-spawned in a later wave carries one for each attempt. That\nis what makes a child that never started distinguishable from one that\nstarted and vanished. The derivations below read `spawn` as a set of\ntheorem ids, so the repeats change nothing they answer.\n\nThe `anchor` line's `\u003Chead-sha>` is the head commit the round's\ntheorems were generated against, and it is what a resume compares\nagainst `origin\u002F\u003Cbranch>` before trusting a single record: a scheduled\nsweep force-rebases open PR branches and can fire mid-round, and\nverdicts from two trees must never be mixed.\n\n## What the reader derives\n\n**Everything that changes as the round runs is derived on each read,\nnever stored.** A stored list is a line that must be revised to stay\ntrue; a derived one cannot go stale. The script is the reader: `next`\nand `dispose`, under \"The derivation modes\", apply the rules below, and\na caller asks them rather than deriving anything off the log itself.\n\n**A theorem is settled in a stage when its child wrote `leave`, or when\nits result file exists** — never when the caller heard back: a `return`\nrecord settles nothing, and a hand-back is never read. The two are\nalmost always the same fact, and the second is what covers a child that\nwrote its report and died before the record landed.\n\nThe result file is the one under the stage's agent, `theorem-generator`,\n`theorem-disprover` or `counterexample-verifier`, whatever effort a\n`spawn` record gave it.\n\nA stage's **outstanding** theorems are its members, over the live list\nrather than over the theorems the log was told about, less the settled\nones, the in-flight ones and those with a child yet to enter, which is\nwhat puts a theorem no instance ever spawned back in play.\n\nA theorem has a **child yet to enter** in a stage exactly when its last\n`spawn` there is followed by neither an `enter` nor a `stopped` there.\n`--mode next` and `--mode wait` apply that one rule, deciding it by the\norder of the records, never by comparing counts of `spawn` and `enter`\nrecords. A `stopped` naming an earlier child — one an `enter` of the\ntheorem in the stage named before it — writes off that child alone, so\nlanding after a later `spawn` it leaves the replacement yet to enter.\nAny other `stopped`, `-` included, writes off the child the last\n`spawn` started, before its `enter`, so the theorem is outstanding\nagain until a later `spawn` — unless an earlier child of the theorem is\nstill in flight in the stage, which leaves it in flight.\n\nThe verdict itself is in the result file, which the `leave` line names\nand the `result` line names again, and is never inferred from the log.\n\n**Whether an outstanding theorem has a child in flight is a second\nquestion, and it is keyed on the child rather than on the theorem.** A\ntheorem is in flight when its **last** `enter` in that stage carries an\nagent id that no `leave` and no `stopped` of that theorem carries, and\nno result file for it under `--agent` exists. `--mode print-in-flight`,\n`--mode next` and `--mode wait` apply that derivation. A `stopped` is\nmatched to an `enter` by agent id, never by where it lands, so an\noriginal child's `stopped` that lands after its replacement's `enter`\nwrites off the original alone and leaves the replacement in flight.\n\nThat is the question a deadline arm asks — an outstanding theorem with\nno child in flight has nothing to be overdue — and the one the next\nwave asks before spawning.\n\n`stopped` kills the **child**, not the **theorem**: it subtracts from\nin-flight and not from outstanding. A derivation that left the child in\nflight would report the theorem overdue on every later read and take\nthe deadline arm against a child already written off; one that\nsubtracted the theorem from the outstanding set would report an\nunanswered theorem as settled. The `enter` record, not this one, is\nwhat names the stopped child's worktree for cleanup.\n\n**A duplicate `leave` is a diagnostic, not a conflict, and the later\none wins.** A child written off as lost can report anyway, leaving one\ntheorem with two `leave` records. There being one definition per\nstage, the replacement carries the same `--agent` name as the child it\nreplaced, so the two share a result-file name and there is one file,\nthe later child's, since its rename overwrote the earlier report. So\nthe theorem's verdict is the later child's by construction: it is the\nverdict in the one file there is to read, and no reader has a tie to\nbreak. Both records stay in the log, because the pair is evidence that\na child believed dead was alive, and the reader reports it as such. No\nline is revised, so concurrent appends cannot collide.\n\n## A child's hand-back\n\nA child's `leave` record and result file land before the child\nreturns, so by the time its final `\u003Ctask-notification>` — the one\nsaying it finished — reaches the caller a missing `leave` is final\nrather than a race. A notification saying the child may still be\nrunning is interim: a child that ends its turn with background work of\nits own running wakes when that work exits and carries on, so its\n`leave` can still land. A child therefore makes\nits `leave` call before it composes its hand-back, and composes one only\nfrom what that call did:\n\n- **The call succeeded** — the hand-back's first line is the\n  result-file path the call printed, and the report the file holds\n  follows it.\n- **The call failed** — the hand-back is a failure report carrying no\n  verdict and no theorem, so nothing the caller reads from it can stand\n  in for the result file that was never written:\n\n  ```text\n  LEAVE FAILED\n  COMMAND: \u003Cthe leave command, as run>\n  OUTPUT: \u003Ceverything it printed, verbatim>\n  ```\n",{"name":5,"description":7,"user-invocable":20},"main","9624e4c102c881edce90d80fc9d4efc2439bd3d6","plugins\u002Fsdlc\u002Fskills\u002Fagent-result-persist-interface","https:\u002F\u002Fgithub.com\u002FTheVoskamps\u002Fclaude-plugins-marketplace","https:\u002F\u002Fgithub.com\u002FTheVoskamps","2026-11-14 13:16:57",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add TheVoskamps\u002Fclaude-plugins-marketplace --skill agent-result-persist-interface",{"tool":36,"command":37},"bunx","bunx skills add TheVoskamps\u002Fclaude-plugins-marketplace --skill agent-result-persist-interface",{"tool":39,"command":40},"pnpm","pnpm dlx skills add TheVoskamps\u002Fclaude-plugins-marketplace --skill agent-result-persist-interface","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTheVoskamps\u002Fclaude-plugins-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fsdlc\u002Fskills\u002Fagent-result-persist-interface\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M77KH3GAXPPXNQS96KDEEZBS","mask-inappropriate-language","Replace inappropriate language (profanity, slurs, strong insults) in provided text or a file with asterisks, character-for-character, preserving everything else.","https:\u002F\u002Fgithub.com\u002FTheVoskamps\u002Fclaude-plugins-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fwriting-tools\u002Fskills\u002Fmask-inappropriate-language\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M77KGY5TZDQT8QR23Y0R8P7A","theorem-agents-interface","The interface between the sdlc reviewer and the theorem agents it spawns — what each double-dash brief parameter means, and what each consequence class means. Preloaded into every theorem agent (sdlc:theorem-generator, the disprover, and the verifier) via its skills frontmatter, and read by name by the sdlc:theorem-based-pr-reviewer agent for what its briefs' parameters mean; not invoked from the user's slash menu.","https:\u002F\u002Fgithub.com\u002FTheVoskamps\u002Fclaude-plugins-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fsdlc\u002Fskills\u002Ftheorem-agents-interface\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M77KGT5HW0XAE500WSSM0PZY","sdlc-config-user","Interactively create or merge-update the repo user sdlc config, `\u003Crepo-root>\u002F.sdlc\u002Fuser-config.yml` (tier 3 — this user, this repo, never committed), and add it to the repo's tracked `.gitignore`.","https:\u002F\u002Fgithub.com\u002FTheVoskamps\u002Fclaude-plugins-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fsdlc\u002Fskills\u002Fsdlc-config-user\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M77KGQGQVB0NYZX0WJRJPDEK","sdlc-config-repo","Interactively create or merge-update the shared repo sdlc config, `\u003Crepo-root>\u002F.sdlc\u002Frepo-config.yml` (tier 2 — tracked, every user of this repo).","https:\u002F\u002Fgithub.com\u002FTheVoskamps\u002Fclaude-plugins-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fsdlc\u002Fskills\u002Fsdlc-config-repo\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M77KGKPEN7C5RCEDSEP3Z1XB","sdlc-config-global","Interactively create or merge-update the global user sdlc config, `$XDG_CONFIG_HOME\u002Fsdlc\u002Fuser-config.yml` (tier 1 — this user, every repo on this machine).","https:\u002F\u002Fgithub.com\u002FTheVoskamps\u002Fclaude-plugins-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fsdlc\u002Fskills\u002Fsdlc-config-global\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M77KGFX95J2XEQBBD49QHTXK","pr-read-cli-interface","The contract for sdlc's PR-read CLIs — sdlc-pr-round, sdlc-pr-adjustments, sdlc-fixer-brief and sdlc-records-chain — their arguments, exit codes and output grammar. Preloaded into sdlc:theorem-based-pr-reviewer, sdlc:issue-fixer, sdlc:docs-writer and sdlc:pr-finalizer via their skills frontmatter; not invoked from the user's slash menu.","https:\u002F\u002Fgithub.com\u002FTheVoskamps\u002Fclaude-plugins-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fsdlc\u002Fskills\u002Fpr-read-cli-interface\u002FSKILL.md",[],[]]