Repository navigation
Conversation
Sensitive Change ReviewSensitive files changed:
How to clear this check:
Only the author's comment counts this way. A reviewer can instead |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change reuses the existing card-apply pattern, writes only through the Hooks tab's own create route, and changes nothing when the card flag is absent. [DESIGN-REVIEWED] 3a40d04 Description read[DESCRIPTION-READ] 1ef1a08c2c5dd84a4a160feb9e23915f851499c0bb200cc152b2d759b442e82f That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: the screenshots cover every new control and state, and the blind reader read the main controls (Create hook, Decline, Runs in) correctly. Notes
[UX-REVIEWED] 3a40d04 Description read[DESCRIPTION-READ] e626fb7518034cebc5fb53b08f749c279971768faa326c89e71d667ac3256647 That sha256 names everything this verdict read: the PR description, plus the 16 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. This is an additive card that only a person's press turns into a hook. No default changes, and no existing capability is removed. Notes
What this change shipsInventory (10 items) — 8 justifiedIntent: let an agent turn a repeated mistake into a hook the person creates with one press. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 3a40d04 Description read[DESCRIPTION-READ] 408006cdce24f66af3f4b40953ee32395ed31e81f916e6f43a88b37956736159 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — 🔴 changes requested (blocking)GPT 6.1 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- test/test_change_card_hook.py:315 -- Supply a directory junction instead of skipping the folder-swap check
[BLOCK-MERGE] 3a40d04 |
Security Scope Review -- ✅ PASSWhich legitimate operations does Verdict basis: adjudicated, zero confirmed regressions. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. Scope-Verdict: PASS Reason: This diff leaves all three shell deny tiers unchanged ( TIGHTENING: ADJUDICATED: 14 candidates. The harness has handed back no confirmed newly-refused rows, so this review reports none. PLATFORM COVERAGE: Rows cover posix, windows and any.
The diff's other platform assumption is in path resolution ( UNADJUDICATED:
[SCOPE-REVIEWED] 3a40d04 |
166196a to
0f5c3df
Compare
5be6368 to
bc6432d
Compare
0f5c3df to
94a5e58
Compare
bc6432d to
d9bd7c2
Compare
94a5e58 to
c621f40
Compare
c621f40 to
3ec500c
Compare
d9bd7c2 to
e0dab22
Compare
3ec500c to
cc0429c
Compare
e0dab22 to
a87e0af
Compare
|
Review dispositions for Opus / GPT F3 — card-created hooks missing from backup, export and restore — fixed. Class, every site that bundles, restores or switches off GPT F1 — a failed approved-file write leaves an ordinary change committed — fixed. A mutation of one hook now writes only the file that holds it ( GPT F2 — Undo deletes a hook edited after creation — fixed. The card's state now includes the created hook's settings (name, event, matcher, command, skills, timeout, enabled, scope), not its run counts, so Undo after an edit on the Hooks tab answers 409 and keeps the edit. Test: UX — "the card never says in plain words what the hook does" — rebutted, with two changes. The card states the effect in its title ( |
a87e0af to
23ba2c9
Compare
|
Review dispositions for First Principles — the second hook store is oversized — removed as suggested. Card hooks are stored like any other hook: the card's apply posts to UX — a plain-words line saying what the hook does. The previous review read the earlier description. The card states the effect in its title ( |
fa10cf4 to
2327768
Compare
a3b1e33 to
3295cae
Compare
2327768 to
dcebc6d
Compare
3295cae to
4537074
Compare
dcebc6d to
2104887
Compare
4537074 to
3b1c2db
Compare
2104887 to
f1b8f53
Compare
3b1c2db to
993301b
Compare
f1b8f53 to
5ac2d08
Compare
|
Review dispositions for GPT — a descriptive hook name in Chinese or Japanese is refused as too short — fixed. A name with at least 4 letters from a script written without spaces (CJK, Hiragana, Katakana, Thai, Lao, Khmer, Myanmar) now passes. Test: GPT — applying a card for a bot deleted while the card waited creates a hook that never runs — fixed. The card step of |
993301b to
495a700
Compare
5ac2d08 to
8e1e4c0
Compare
|
Review dispositions for GPT F1 — a POSIX hook proposed on Windows runs through cmd.exe and denies every call — fixed. The Also in this push:
|
|
Disposition for the review round on 30e3f8d. Fixed in d9ae478, which is rebased onto A's 7f0f60b.
|
|
Disposition for the UX review on d9ae478. Fixed in c776c17, which is rebased onto A's 1f4485c.
|
|
Disposition for head 8e20ad5 (rebased on #47124's new head). GPT: the first-person word list for Same assumption, two more places, fixed in this push.
|
|
Disposition for the UX Review BLOCK on 8e20ad5, fixed on head 2c815a1. The frames in the body are new, from this head. Blocker: "Runs before" showed internal tool ids, and Does read as technical as the code. Fixed.
The command itself stays on the card whole: it is what runs, and the Does row above the notice is the plain-words line for a reader who does not read it. Notes.
|
|
Disposition for head 95cbdf1. UX Review round 3 (2c815a1): the reader would not press Create hook.
First Principles blocker: a second lookup of a bot by First Principles note on item 6 (raise-time checks). Kept. Those checks compare what the card shows with what the Hooks create route would store, so the card never shows one command and stores another; they are not a second schema. A hook command is the one place where a hidden character or a trimmed space would change what runs. |
|
Disposition for head d46ced1. The frames in the body are from this head ( UX Review round 4 (95cbdf1): a reader who cannot read the command had nothing from the system to decide on. Redesigned rather than reworded:
GPT security-class finding: a matcher named like an Object property crashed the card. Fixed. Both lookups ( |
Any chat or bot can call propose_hook with a PreToolUse hook's name, matcher and command. The gateway raises a hook.create card in that chat with the whole command and tick boxes for where it runs: the bot and its tasks, the folder of the chat's project, or all chats. The bot or folder that fits the chat is ticked; the person changes the ticks and presses Create, which stores what the card shows in hooks.json like any other hook, through the Hooks create route. The name must say what the hook does, since it is the card's title. A command the create route would save differently, or one holding a character the card cannot show, is refused when the card is raised. Undo deletes the hook unless it was edited after the press. The shared prompt gains one line telling agents to propose a hook for a mistake a rule can catch.
A hook.create card press checked that the confirmed folder still resolved to itself, then waited on the bot check, and the store resolved the folder a second time. A link swapped in between saved the other tree as the hook's scope. The store now does the check where it resolves the folder (ScriptHookStore.create(confirmed_folder=True) raises hook_scope.FolderMoved) and saves the value that passed, so nothing after the handler's waits can widen the scope.
Problem / Motivation
Goal: An agent in any chat or bot can propose a PreToolUse hook on a card, and the person creates it with one press, choosing where it runs.
An agent that keeps making a mistake a rule could catch can only save a lesson, which works only when it is read, or describe a hook and send the person to the Hooks tab to type it in. Other gateway settings (goals, MCP servers, capabilities) already reach the person as a card they apply; hooks do not.
Why it matters
A hook stops the call every time; a lesson does not. Making the hook one press away turns "I made that mistake again" into a rule that holds, without the person writing a shell script by hand.
Not a goal
What changed (motivation → approach → change)
propose_hook(kirocrew-core, so every chat and bot has it) sends a name, a one-sentencedoesline, matcher, command and reason toPOST /api/cards/agent/request-hook. Only a turn the person sent in the dashboard raises the card; a task, schedule, sub-agent or channel turn gets a refusal saying who should ask instead. The body cannot name a scope.hook.create) shows the matcher, a Does row with the agent's plain sentence of what the hook stops (above the command, for a person who will not read the code; not stored with the hook), the whole command as a numbered code block that wraps (a wrapped part hangs in under its line, so every character is in view), the reason, and tick boxes: the bot and its tasks, chats working in the folder, all chats. The bot is ticked in a bot's chat, the folder in an ordinary chat. While All chats is ticked the other two are locked; unticking it brings back the earlier ticks. Each tick re-previews the card, so Create stores what the boxes show; a tick can only name the offered bot or folder.POST /api/hooks; on an admittedhook.createapply step (REQ_CARD_HOOK_CREATE) it also refuses a folder that now resolves elsewhere than the card showed. The hook is stored inhooks.jsonlike any other and listed on the Hooks tab, where the person edits, switches off or deletes it. The card has no Undo (offers_no_undo): the Hooks tab is where a hook is removed. The yellow notice ends "Turn it off in Hooks.", where Hooks is a link to the Hooks page, and after Create the card's result line carries the same "Hooks" link. A refused press says why on the card, in the dashboard's own words: "That bot was deleted, so no hook was created. Ask for a new card." or "That folder now leads somewhere else, so no hook was created. Ask for a new card."; the person can close that line, and a later failure shows again. The card says what the hook does in its title (Add hook: {name}), andpropose_hook's description asks for a name and adoesline that say it in plain words. Only their shape is checked, so both may be in any language: adoesline that is empty, more than one sentence (Latin, Devanagari or CJK stops) or only repeats the name is refused, and no word list or word count decides the rest. A matcher of plain tool names reads in the words the agent's Tools list uses (toolMeta):execute_bash|shellreads "Run shell commands" (KAS'sshellis the same tool, said once), andfs_write|@git/pushreads "Write files or @git/push"; a pattern stays as written.propose_hookasks for adoesline that says the effect the person will see, not a list of commands. The card's first rows, above the yellow notice, are the bot's own words, labelled "{bot} says" (or "The bot says"), and "When it matches", which the system writes from the hook's event, never from agent text: "Can stop the call. The command decides each time, and the agent is told why." Then Runs before, Command, Why and Runs in. After a press refused because the bot was deleted (named when the card knows it) or the folder now leads elsewhere, the card shows no Create; other refusals keep it. The command stays whole. Each caption says whose chat raised the card: in a bot's chat the card offers that bot and the chat's folder; in an ordinary chat it has no bot row and offers the folder./api/cards/agentprefix, with the same verified-caller and user-turn gaterequest_serveruses; no bind or listener change.Backwards compatibility
Compatible: hooks in
hooks.jsonload and save as before, and the create route behaves as before whenfrom_cardis absent.Removes nothing: no field, route, hook or behaviour is taken away.
Tests
test/test_change_card_hook.py: hidden and control characters, text the route would store differently, a missing, two-sentence (CJK stops included) or name-repeatingdoesline, a name anddoesline in Chinese, Japanese, Korean, Hindi and German accepted, and a tick naming another bot or folder are refused; the kind is raised only throughpropose_hook; the preview shows the whole command and plans the card's create; the Does row sits above Command and is not in the create body; the card offers no Undo; end to end over the real card routes and Hooks routes: nothing exists before the press, the agent cannot name a scope or create a hook as the card's itself, a re-tick re-previews, a replay of the earlier plan is refused, the press stores exactly the ticked scope inhooks.json, a cancelled card creates nothing, and a bot deleted while the card waited creates nothing.website/src/cards/ConversationCard.test.tsx: a refused hook press shows the localized reason, closes on its ✕, and shows again on the next failure; a refused tick shows again after the same refusal was closed.test/test_request_server_schema_parity.py:propose_hook's validator matches its advertised schema.website/src/cards/HookCard.test.tsx: title, the scope drawn as boxes with the bot name and full folder, re-preview on each tick, all chats clears both and locks the other two, unticking it restores the earlier ticks, a long command wraps with one number per source line.Proof: not provable -- other: feature PR, the base has no hook card for the tests to exercise
Manual verification
UI copy, signed off by the owner: kind label Hook · title "Add hook: {name}" · risk line "This command runs on this computer before each matching tool call. Turn it off in Hooks." (Hooks is a link) · refusals "That bot was deleted, so no hook was created. Ask for a new card." and "That folder now leads somewhere else, so no hook was created. Ask for a new card." · rows {bot} says / When it matches / Runs before / Command / Why · empty matcher "Every tool call" · Runs in boxes "{bot} and its tasks", "Chats working in {folder}", "All chats" · button Create hook. Tool and prompt text:
propose_hook's description and the one prompt line.Real-machine verification
Machine: a new throwaway cloud dev box (label
hcb-c2833), Amazon Linux 2023, x86_64, with a scratch data home holding one bot,mate. Each side was installed from agit archiveof its commit into a fresh venv on a standalone CPython 3.12.16.Path: in process, not a live agent turn (the box has no model sign-in). The card is built by the gateway's own card catalog from an agent's
propose_hookparameters (validate_params, thenbuild_preview), as the request route does. The press is the card's planned apply step,POST /api/hookswith its create body; the script stores that body withScriptHookStore.create, which the route calls. The created hook then fires through the gateway's PreToolUse gate,permission_pre_tool_block, with the real sandboxed runner. The hook's command is the card's own:grep -q 'git checkout' && { echo 'Work in a worktree instead.' >&2; exit 2; } || exit 0, a shell one-liner that starts inside the hook sandbox and reads the call. The bot's task is recorded with the real record writer (note_crewmate_worker_session). Script:proof-b.py, the same file on both sides.Before (base: #47124's head
bba91530a1):python proof-b.py->After (head
d46ced162d): same command ->The hook the card created runs its own check: it denies
git checkoutin the bot's task with its own reason, lets that task'sgit statusthrough, and lets another chat'sgit checkoutthrough because the card scoped it to the bot.Cleanup: the box was deleted at 2026-12-05T15:01:18Z. The provider's listing filtered to its label (and the earlier box's), at 15:01:44Z:
Screenshots / video
All from head d46ced1 (the card is unchanged at ae434b1, which only restacks it on #47124's rebase), rendered by the real
ChangeCard. The Runs in rows are 28px apart, and each whole row is the press target. A long command wraps at spaces and after shell punctuation; it breaks inside a word only when one word is wider than the line. A refused press shows its reason in the dashboard's own words with a close (✕); the next failure shows again.After a successful Create (head
ae434b1450, the same capture page with the card's status set to applied): the card collapses to its result line, which links to the Hooks page (href="/hooks"), where the hook is turned off.More
Related Issues
Stacked on #47124 (hook scope); merge that first.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); PR Hygiene does not count commitsContribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.