This was written agentically; verify its assertions:
North star
Six times on 2026-09-16 a Codex approvals-reviewer session was spun up to judge a session-ledger.sh append, costing 290k tokens and 5-9 s each, all verdict allow. Every one was triggered by the recipe at parallel-issues/SKILL.md:117-119: quote_file=$(mktemp) lands in /tmp, outside the workspace roots, so the harness asks. The helper already accepts --quote TEXT inline (.shared/scripts/session-ledger.sh:28-31). Separately the root hand-hashed three different strings to derive run-ids and produced two ids for the same PR (review-pr-7dcf51e0… and review-pr-f7aae90d… for #511), so the ledger holds three receipts for one grant.
North star rules this change must obey
- Runbook first, hooks second. The skill preamble (env contract, helper output, composed prompt) hands the agent a complete runbook before the first mutating call. Hooks only nudge when the agent drifts; a hook or guard that manufactures tool calls is itself a defect.
- No new refusal that a retry can trip. The remedy for every failure path is a helper that does the right thing or an exact line to paste, never "run it again". A stricter kit makes the agent try harder and burn turns getting blocked.
- Diff shape: negative in prose (
agentkit/skills/**/*.md), positive in scripts, hooks, or tests. If the prose line count goes up, the PR needs a stated reason.
- Show the number it buys. Every acceptance criterion below is measurable on the next
parallel-issues run from the rollout files.
Problem
A recipe that writes outside the workspace is a recipe that costs an approval; a run-id computed by the model is a run-id computed differently every time. Both are helper jobs.
Change
Prose (cut):
parallel-issues/SKILL.md:117-119, review-remote-pr/SKILL.md and pr-to-green/SKILL.md equivalents: replace the mktemp recipe with the one-line session-ledger.sh append … --quote "$QUOTE"; delete the run-id derivation formulas (printf 'scope=…;flags=…' | sha256sum | cut -c1-32).
Scripts (add):
.shared/scripts/session-ledger.sh: new run-id --procedure-set NAME --scope CSV [--flags CSV] --repo SLUG --base BRANCH printing the canonical id; append accepts --quote-stdin for multi-line quotes so no temp file is ever needed; if a temp file is still required, create it under $repo_root/.agent/cache.
review-remote-pr/scripts/run-dir.sh: derive from session-ledger.sh run-id.
tests/test-session-ledger-run-id.sh: same inputs → same id; scope order-insensitive; a second append with identical decision/scope/quote/run-id is a no-op that prints the existing record.
Acceptance criteria
🤖 Co-authored by Claude Fable 5.1.
This was written agentically; verify its assertions:
North star
Six times on 2026-09-16 a Codex approvals-reviewer session was spun up to judge a
session-ledger.sh append, costing 290k tokens and 5-9 s each, all verdictallow. Every one was triggered by the recipe atparallel-issues/SKILL.md:117-119:quote_file=$(mktemp)lands in/tmp, outside the workspace roots, so the harness asks. The helper already accepts--quote TEXTinline (.shared/scripts/session-ledger.sh:28-31). Separately the root hand-hashed three different strings to derive run-ids and produced two ids for the same PR (review-pr-7dcf51e0…andreview-pr-f7aae90d…for #511), so the ledger holds three receipts for one grant.North star rules this change must obey
agentkit/skills/**/*.md), positive in scripts, hooks, or tests. If the prose line count goes up, the PR needs a stated reason.parallel-issuesrun from the rollout files.Problem
A recipe that writes outside the workspace is a recipe that costs an approval; a run-id computed by the model is a run-id computed differently every time. Both are helper jobs.
Change
Prose (cut):
parallel-issues/SKILL.md:117-119,review-remote-pr/SKILL.mdandpr-to-green/SKILL.mdequivalents: replace the mktemp recipe with the one-linesession-ledger.sh append … --quote "$QUOTE"; delete the run-id derivation formulas (printf 'scope=…;flags=…' | sha256sum | cut -c1-32).Scripts (add):
.shared/scripts/session-ledger.sh: newrun-id --procedure-set NAME --scope CSV [--flags CSV] --repo SLUG --base BRANCHprinting the canonical id;appendaccepts--quote-stdinfor multi-line quotes so no temp file is ever needed; if a temp file is still required, create it under$repo_root/.agent/cache.review-remote-pr/scripts/run-dir.sh: derive fromsession-ledger.sh run-id.tests/test-session-ledger-run-id.sh: same inputs → same id; scope order-insensitive; a secondappendwith identical decision/scope/quote/run-id is a no-op that prints the existing record.Acceptance criteria
grep -rn 'mktemp' agentkit/skills/**/*.mdreturns 0 lines.🤖 Co-authored by Claude Fable 5.1.