Repository navigation
feat: write the approval record from the person's yes - #157
Merged
Merged
Conversation
The skills wrote .review/jira-approval.json with a command after the yes, and the model mostly skipped that step, so each write of an approved plan prompted. - Add hooks/approval.sh and scripts/approval.py: the answer and prompt modes write the record from a gate answered Write all <n> or Publish <n> to <page title>, with the count checked against the plan file; created puts a new key in place of new:<slug>; guard denies writes to either record and an AskUserQuestion carrying answers - Skills write .review/jira-plan.json or github-plan.json as they show the plan; Drop some and Paste instead show it again; conversions run before the plan is shown; a failure keeps the record - Let atlassian-gate.sh allow jira_edit_comment and Confluence writes a plan lists; an update carrying parent_id still asks - Route every main-session Jira write through a write plan, and put the Confluence publish and revise gates in the plan form - Move both approval records to version 2 in docs/contracts.md and update README, design.md, ROADMAP and .claude/CLAUDE.md - Add tests/test_approval.py and gate tests that build the record through the hook; add the drop and self-record sandbox scenarios Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The hook spends each item after a successful gated write and deletes
the record with its last item; the model no longer removes it
- The gates' target mode is the one definition the spend matches on
- Read the real mcp-atlassian {"result": ...} and GitHub
{"issue": {...}} create results; the sandbox stub returns the latter
- Skills write the plan file with `approval.py plan` from
`<tool> <target>` lines; the command checks the shape the hook reads
- The plan command runs in the turn that shows the plan, before the gate
- The guard denies hand-writes of plan files and copies naming .review/,
checks heredocs a shell or interpreter runs, and lets reads through
- Document the guard's accepted residual routes
- Sandbox write scenarios ask to see the plan before the scripted yes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…swer # Conflicts: # skills/ticket-draft/SKILL.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Origin: the maintainer's note: gate decisions in their sessions from 2026-10-19 to 2026-12-03, with write plans prompting at nearly every Jira write after the yes
Sandbox: tracker-gh-* (11 scenarios). Haiku, current plugin vs branch from
run.py compare --check: 8/11 vs 10/11; main fails self-record (writes the record itself), audit-duplicates and unrecorded-ask. Branch--check --repeat 2: Haiku 20/22, Sonnet 19/22; must-not-write 10/10 on both; draft-write (new, refine, unrecorded, drop) Haiku 7/8, Sonnet 6/8, each failure a one-off model slip with the gate holding; no write allowed without approval in any run. On the final guard, Haiku--repeat 2on new, refine, drop, audit-duplicates and self-record: 9/10, the drop check corrected to allow a follow-up's own comment and replayed on those runs; no guard denial of the plan command.Canary: pending: a week of real ticket-draft, ticket-audit and design-doc use on this branch
Why
The Atlassian gate lets a Jira write through without a prompt only when
.review/jira-approval.jsonlists it. The skills were meant to write that record with ajqcommand after the person approved the write plan, and the model mostly skipped the step. In the maintainer's sessions from 2026-10-19 to 2026-12-03, 103 Jira writes prompted and 36 were allowed. 71 of the prompts came in sessions where no record was ever written: a person who answered "All 12" then confirmed 13 creates and 12 transitions one at a time. The rest were records past their 30 minutes (17), records already removed (11), comment edits no plan could hold (5) and Confluence writes, which asked at every call (3). Once this merges, one yes to a write plan covers exactly the writes it lists, and the record comes from the person's answer, so a skipped step no longer turns into a prompt per write.How the yes becomes the record
scripts/approval.py plan, one<tool> <target>line per item, in the turn that shows the plan, before the gate. The command checks the shape the hook reads and refuses a bad line while the model can still fix it: hand-written JSON plans came out in shapes of the model's own, so every write prompted. The skills no longer write the record.hooks/approval.shreads the person's answer: PostToolUse onAskUserQuestion, or a typed reply through UserPromptSubmit, since the sandbox and the prose fallback answer by typing. Only a fixed label carrying the count is a yes,Write all <n>orPublish <n> to <page title>, and the count must match the plan. Any other answer, Drop some and Paste instead included, records nothing, and the skill shows the plan again.AskUserQuestionthe model filled with answers. In Claude Code 2.1.335 a model-filled answer reaches PostToolUse identical to a person's, so this is the only place to catch it; a widget dismissed with Esc fires no event, so the next prompt clears a pending plan.new:<slug>in later items, read from the real mcp-atlassian{"result": ...}and GitHub{"issue": {...}}results.A signed record or a transcript check would be no stronger than the guard, since the model can read a key file and write the transcript as easily as the record. The guard stops a plain write or copy naming
.review/, a heredoc a shell or interpreter runs included, and lets reads and commit messages through. A deliberate route, such as a directory copy, a tar pipe or a name built inside a script, is not seen, and it fails open withoutpython3;docs/design.mdsays so.What a plan can now hold
jira_edit_comment, only when the person asked for the edit, and the three Confluence writes, so the publish and revise gates stop prompting per call. Aconfluence_update_pagecarryingparent_idmoves the page and still asks. Every main-session Jira write, a direct request included, now goes through a write plan.For the reviewer
tracker-gh-audit-duplicatesnow ends "Write all.": ticket-audit's plan has noLooks rightto come before it.tests/test_approval.pyguards the parsing and every refusal;tests/test_atlassian_gate.shbuilds records through the hook for the new targets.Tests:
bash tests/checks.sh🤖 Generated with Claude Code. AI assistance level: 5/5 (not read by a person).