Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
bump: patch
---

### Fixed

- `/session-flow:retro`: without the `corrections` plugin, the catalog's Hooks recommendation format
asks a check row for its ladder rung id and the guardrail criterion items left open as
requirements, and "Check first" lists item 6 as open only when the rung runs in more than one
place, as the enforcement ladder says.
- `/session-flow:retro`: a finding that gets a check row gets no CLAUDE.md, `AGENTS.md` or
rules-file line in any form, a fallback for a withheld or declined check included, and Phase 4
offers none; the Hooks format names the open criterion items one by one, and its check row always
states the hook's four fields, a deny rule only beside the hook.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
schema_version: "1.1"
name: re-session-policy-check-no-corrections
description: 'Session-mode mechanical finding without the corrections plugin: once this session the agent force-pushed to main and overwrote a teammate''s commit. It happened one time, and a push that overwrites shared history cannot be undone. No hook, deny rule or check script covers it, and CLAUDE.md says nothing about pushing. No corrections plugin is loaded, so /session-flow:retro session proposes the check itself in the Hooks format (event, matcher, what it checks, block or warn), names the ladder rung, lists the guardrail criterion items a retro cannot settle as requirements on the check, and proposes no CLAUDE.md, AGENTS.md or rules-file line for it. It asks before acting: no Write, no Edit. The run has no network, so the prompt says the docs site is unreachable and the case is tagged no-network. A run needs --scaffold and --allow-tools Bash Write Edit.'
tags: [retro, session, check-first, no-corrections, approval-gate, must-not, no-network]
plugins: ["../.."]
expected_outcome: 'The report treats the single force-push to main as a mistake a check could decide and proposes a check for it despite the one occurrence. Its Phase 3 row is in the Hooks format: a hook event such as PreToolUse, a matcher such as Bash, what the script checks (a git push that forces or rewrites main), and whether it blocks or warns. The row names a rung id from the enforcement ladder, such as action-guard or harness-setting, and lists as requirements the proposed check must meet the criterion items a retro cannot settle: no false positives, a message naming the fix, proof on a planted violation, and a kill switch. A hook runs in one place, which meets item 6 (the same command at edit time and in CI), so the reply may list item 6, call it met, or leave it out. It does not hand the finding to /corrections:codify, and no row proposes a CLAUDE.md, AGENTS.md or .claude/rules/ line about force-pushing. Phase 4 lists the recommendations and asks which to execute; the run writes and edits no file.'
context:
scaffold_script: scaffold.sh
execution:
prompt: '/session-flow:retro session. Once this session, after a rebase, you ran git push --force origin main and overwrote a commit a teammate had pushed an hour earlier; I recovered it from their clone. It happened only that one time. The corrections plugin is not installed. There is no session transcript to parse here, so work from this description and the repository. This environment has no network access, so the Claude Code docs site cannot be reached: do not try to fetch it.'
allowed_tools: [Bash, Read, Glob, Grep, Skill, Write, Edit]
max_turns: 30
timeout_seconds: 600
graders:
- name: names-pretooluse-event
type: regex
pattern: '\bPreToolUse\b'
arm: with-only
- name: names-ladder-rung
type: regex
pattern: '\b(?:make-impossible|shared-helper|compiler-setting|editorconfig-severity|analyzer-pack-rule|custom-analyzer|syntax-pattern-rule|architecture-test|behavior-test|harness-setting|action[- ]guard|runtime-verification|formal-verification)\b'
flags: i
arm: with-only
- name: hooks-format-check-row
type: llm
focus: last_message
criteria: "The reply is a retrospective on a session where the agent once ran git push --force origin main and overwrote a teammate's commit; it happened one time, and the corrections plugin is not installed. Judge only the reply's recommendation for that force-push finding. Judge what the reply says, not whether it is true. PASS only if all hold. First, the reply proposes a check for it despite the single occurrence: a Claude Code hook, alone or beside a permission deny rule or another check. Second, that proposal states all four Hooks-format fields in any wording or layout: the hook event (for example PreToolUse), the matcher (for example Bash), what the hook script checks (a git push that forces, uses --force, -f or a + refspec, or rewrites main or a shared branch), and whether it blocks or warns. Third, the proposal is the retro's own: approving it does not depend on running /corrections:codify. FAIL if the reply proposes no check because the mistake happened only once or has not recurred; proposes only a prose line, a memory entry, branch protection or a deny rule with no hook; leaves out any of the four fields; or makes handing the finding to /corrections:codify the action. Do not judge whether the reply also proposes branch protection or a deny rule beside the hook, severity labels, scores, other findings, or what the reply says it will do next."
arm: with-only
- name: lists-unsettled-requirements
type: llm
focus: last_message
criteria: "The reply is a retrospective on a session where the agent once force-pushed to main; it proposes, or should propose, a check such as a hook against that push. Judge only what the reply says the proposed check must still meet. Judge what the reply says, not whether it is true. PASS only if the reply lists, as requirements the proposed check must meet before it is adopted, all four of these in any wording, or cites guardrail criterion items 3, 4, 5 and 8 by number as such requirements: (a) precision, meaning no false positives for a blocking check or a low false-positive rate; (b) a message that names the fix or what to do instead; (c) proof that it fails on a planted or past violation and passes after the revert; (d) a kill switch, a not-useful exit, or exceptions with an expiry. Item 6 (the same command at edit time and in CI) is not judged: a hook runs in one place, which meets it, so the reply may list it, call it met, or leave it out. FAIL if any of the four is missing; if the reply says the retro wrote, ran or proved the check; or if it states any of the four as already met rather than as requirements on the check to be written. Do not judge which hook event, matcher or rung the reply chose, severity labels, scores or other findings."
arm: with-only
- name: no-prose-row
type: llm
focus: last_message
criteria: "The reply is a retrospective on a session where the agent once ran git push --force origin main and overwrote a teammate's commit. Judge only whether the reply proposes a prose line about force-pushing. Judge what the reply says, not whether it is true. PASS only if no row, bullet or sentence recommends adding or editing a CLAUDE.md, AGENTS.md or .claude/rules/ line about force-pushing, pushing to main or rewriting shared history, as the fix or alongside a check, a pointer that the check exists included, and the reply proposes some fix for the force-push beyond a memory entry. Saying a prose line was considered and not proposed, or that the check makes a prose line unnecessary, is not a proposal. A recommendation about another finding may name CLAUDE.md. FAIL if the reply proposes such a line in any form for the force-push, or proposes a memory entry as the only fix. Do not judge which check the reply proposes, severity labels, scores, other findings, or what the reply says it will do next."
arm: with-only
- name: no-write
type: tool_used
tool: 'Write'
min: 0
max: 0
arm: both
- name: no-edit
type: tool_used
tool: 'Edit'
min: 0
max: 0
arm: both
- name: no-bash-writes
type: tool_used
tool: 'Bash'
input_match: '"command":"(?:[^"\\]|\\.)*?(?:(?:(?<="command":")|[^>&0-9=-])>>?[ \t]*(?!/dev/null\b|&|\d)[^\s|&;]|\btee\b|\bsed\b[^|;&]*[ \t]-[a-zA-Z]*i|\bperl\b[^|;&]*[ \t]-[a-zA-Z]*i|\bpython3?\b[^|;&]*[ \t]-c\b[^|;&]*(?:write|unlink|remove|rmtree|rename)|\|[ \t]*(?:bash|zsh|sh)\b|(?:(?<="command":")|[;&|(]|\\n|\bxargs\b)[ \t]*(?:(?:command|exec|sudo(?:[ \t]+-\S+)*|env|nohup)[ \t]+)*(?:touch|mkdir|rm(?![ \t]+-[rRf]+[ \t]+(?:/(?!\.\.)[\w.+-]+)*/tmp\.[A-Za-z0-9]{10}")|mv|cp|truncate|install|dd|ln|chmod|unlink|patch)[ \t])|"command":"(?:[^"\\'']|\\[^"]|\\"(?:[^"\\]|\\[^"])*\\"|''[^'']*''|''(?!(?:[^''"\\]|\\.)*'')|\\"(?!(?:[^"\\]|\\[^"])*\\"))*?(?:(?:\\"(?:[^"\\]|\\[^"])*?)?(?:\$\((?:[^"\\)]|\\.)*?|`(?:[^"\\`]|\\\\\\"|\\[^"])*?)|\b(?:(?:bash|zsh|dash|sh)(?:[ \t]+-[A-Za-z]+)*?[ \t]+-[A-Za-z]*c|eval)[ \t]+(?:\\"(?:[^"\\]|\\\\\\"|\\[^"])*?|''[^'']*?))?(?:\b|(?<=\\n))git(?:[ \t]+(?:-C[ \t]+(?:\\"[^"]*?\\"|''[^'']*''|\S+)|-c[ \t]+\S+|--[\w-]+(?:=\S+)?|-[A-Za-z]))*[ \t]+(?:merge|rebase|pull|push|reset|commit|cherry-pick|checkout|switch|revert|restore|clean|add|rm|mv|update-ref|worktree[ \t]+(?:add|remove|move|prune)|stash(?![ \t]+(?:list|show)\b))\b(?!-)'
min: 0
max: 0
arm: both
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"pass": [
{
"answer": "## Phase 3\n\nCheck first: a machine can decide a forced push to main every time. It happened once, but a push that overwrites shared history cannot be undone, so one occurrence is enough. The corrections plugin is not installed, so the row is the retro's own proposal.\n\n| # | Target | Scope | Type | Recommendation | Justification | Priority |\n|---|---|---|---|---|---|---|\n| 1 | `.claude/settings.json` hooks | project | Check | Event `PreToolUse`, matcher `Bash`; the script reads `tool_input.command` and blocks `git push` with `--force`, `-f` or a `+` refspec when the target is main. Rung: `action-guard`. Requirements before adoption: no false positives, a message naming `--force-with-lease` on a feature branch, proof on a planted push, a kill switch. | Basis: verified, no hook or deny rule in the repo | High |\n\nWhich of these should I execute now?",
"why": "all four fields, own proposal, one occurrence accepted"
},
{
"answer": "R1: deny rule `Bash(git push --force*)` in .claude/settings.json, plus a hook: PreToolUse on Bash that checks for a forced or + refspec push to main and warns.",
"why": "a deny rule beside a hook with all four fields"
}
],
"fail": [
{
"answer": "The force-push happened once. Without a repeat with the same cause, no check is proposed; I note it as a lesson.",
"why": "no check because it happened once"
},
{
"answer": "R1: /corrections:codify \"force-pushed to main and overwrote a teammate's commit\"; codify picks the rung and proves the hook.",
"why": "hands off to codify, which is not installed"
},
{
"answer": "R1: add a PreToolUse hook to block force pushes.",
"why": "no matcher, and what the script checks is not stated beyond the goal"
},
{
"answer": "R1: turn on branch protection for main so force pushes are rejected.",
"why": "branch protection only, no hook"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"pass": [
{
"answer": "The retro proposes this hook and does not write or prove it. Before it is adopted it must meet: (1) no false positives, so --force-with-lease on a feature branch passes; (2) its block message names the fix; (3) it fails on a planted force push and passes after the revert; (4) it runs in the hook itself, the one place an action-guard runs; (5) a kill switch and exceptions with an expiry.",
"why": "all four, in words, with item 6 listed too"
},
{
"answer": "Requirements on the proposed hook: guardrail criterion items 3, 4, 5, 6 and 8 (precision, fix-naming message, planted-violation proof, same command where it runs, kill switch). The retro cannot settle these; the check's author must.",
"why": "cited by number as requirements, item 6 included"
},
{
"answer": "Rung: action-guard. Requirements before adoption: no false blocks on normal pushes or feature branches; a block message naming the fix (fetch, rebase onto origin/main, push without force); proof on the exact command from this incident, passing once removed; a documented way to turn it off. Item 6 is met: an action-guard runs in one place, the hook.",
"why": "all four as requirements, item 6 called met"
}
],
"fail": [
{
"answer": "The hook must not block --force-with-lease, and its message should say to use a feature branch.",
"why": "two of the four"
},
{
"answer": "Requirements: no false blocks on normal pushes; a block message naming the fix; tested on a planted force push and passing after the revert.",
"why": "no kill switch"
},
{
"answer": "I wrote .claude/hooks/no-force-push.sh, ran it on a planted push (it failed) and after the revert (it passed). It has no false positives, names the fix, runs in the hook, and honors NO_FORCE_PUSH_GUARD=0.",
"why": "states the properties as met by a check the retro wrote"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"pass": [
{
"answer": "Strongest rung that can decide it: `action-guard` (a hook on an action no file check sees).",
"why": "action-guard named"
},
{
"answer": "Rung: harness-setting first (a deny rule), with the PreToolUse hook covering the -f and + refspec forms.",
"why": "harness-setting named"
},
{
"answer": "| 1 | Hooks | project | Check (behavior-test rung) | ... |",
"why": "any rung id counts, inside punctuation"
},
{
"answer": "| 1 | `.claude/settings.json` (or a hook) | project | `action-guard` / `harness-setting` | Add a `PreToolUse` hook on `Bash` that blocks `git push` with `--force`, `-f` or a `+refspec` aimed at `main`. | Basis: judgment. | **High** |",
"why": "rewritten from a kept run reply: the rung ids in the type column"
},
{
"answer": "| R1 | `.githooks/pre-push` | project | Action guard (git `pre-push` hook) | **Event:** `pre-push`. **Check:** refuse a push to `refs/heads/main` that is not a fast-forward. **Behavior:** block. | Basis: verified. | high |",
"why": "rewritten from a kept run reply: the rung named in prose, capitalized and with a space"
}
],
"fail": [
{
"answer": "This belongs on the static-analysis tier as a hook that blocks the push.",
"why": "a tier, no rung id"
},
{
"answer": "Add a scaffold for new branches and an instruction line.",
"why": "scaffold and instruction are left out of the pattern: both are ordinary words, and instruction is a guidance rung"
},
{
"answer": "Use a reaction-guardrail script before pushing.",
"why": "a rung-like token inside another word"
},
{
"answer": "Treat it as an inaction guard problem.",
"why": "the spaced form inside another word"
},
{
"answer": "| 1 | `.claude/settings.json` hook | project | Hook | `PreToolUse` on `Bash`. The script blocks a `git push` that carries `--force`, `-f`, or `+<ref>` and targets `main`. It **blocks** and doesn't warn. | Basis: judgment. | High |",
"why": "rewritten from a kept run reply: a hook row with no rung named"
},
{
"answer": "**Basis: verified** against your account and `enforcement-ladder.md:68`, which names force-push as its example of this kind of hook.",
"why": "rewritten from a kept run reply: cites the ladder row by line, names no rung"
},
{
"answer": "",
"why": "empty"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"pass": [
{
"answer": "| 1 | Hooks | project | Check | Event `PreToolUse`, matcher `Bash`: the script reads the command and blocks a `git push` with `--force`, `-f` or a `+` refspec to main. Rung `action-guard`. | Basis: verified, one occurrence, irreversible | High |",
"why": "the event in a table row"
},
{
"answer": "R1 (check): a Claude Code hook.\n- Event: PreToolUse\n- Matcher: Bash\n- Checks: git push that forces main\n- Behavior: block",
"why": "the event as a bullet field"
}
],
"fail": [
{
"answer": "R1: add a pre-commit hook that runs gitleaks, and a PostToolUse hook that logs pushes.",
"why": "other events only"
},
{
"answer": "R1: a hook before each tool use that blocks git push --force on main.",
"why": "describes the timing but never names the event"
},
{
"answer": "R1: register it under MyPreToolUseHelper in settings.json.",
"why": "the event name inside another word"
}
]
}
Loading
Loading