Skip to content

feat(decisions): let Jev flag risky tool calls on the tool card - #12253

Merged
bolichen97 merged 1 commit into
mainfrom
feat/decisions-tool-risk
Sep 20, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
feat/decisions-tool-risk

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

What this adds

A second point on the shipped Jev decision seam, tool.risk, that puts a small note on a tool card — Jev: risky (0.88) — and decides nothing.

In a session that approves its own tool calls (trust or YOLO) nothing stops to describe what is about to run. That is where the note lives. A session that prompts is never annotated: the person reading the call is already the annotation, and a second opinion beside a control they are operating is noise.

Screenshots

Three tool cards in one transcript, because the badge's claim is comparative: a read the seam answered safe for — which stamps no record, so that card is exactly what every tool card looks like without this feature — then a risky tree clear and a caution config rewrite.

Light Dark

The two badges up close, each with the pill it annotates:

Light Dark
risky
caution

Produced by website/scripts/capture-tool-risk-badge.mjs (new here, the sibling of capture-decision-strip.mjs): the real built SPA behind the shared transcript harness, every /api/** call answered from fixtures. No gateway, no agent, no Jev — so readToolRiskRecord, the transcript virtualizer, ToolCallLine and the badge render exactly as in production, and the record arrives through meta.decisions_tool_risk on a tool row, the same door a scrollback read goes through.

Permission behaviour is byte-identical, and that is a test

The hook sits in the tool_call event branch of chat_runner — the one funnel that appends the tool card row, and a region of the file containing no approval code at all. It is deliberately not in the permission branch: an await beside approve_tool would make "nothing about approval changed" a claim about the ordering of two adjacent statements instead of a claim about two disjoint regions.

test_decisions_tool_risk_card.py::TestPermissionBehaviourIsUnchanged runs one scripted turn twice — with the point answering risky and with it silent — and holds the approve_tool / reject_tool call lists and the SEL audit rows equal. A sibling test asserts the request really was answered in both runs, so the equality cannot hold by measuring nothing.

Two things this does NOT claim, because neither is true, and both are stated in the docs rather than implied away. It is not free of timing: the tool_call frame arrives before the permission request, so awaiting the point delays when the turn's next event is read, by up to its own wait budget — bounded, sampled, paid only where the seam is on. And a badge is not a verdict on whether the call ran: a host gate, a PreToolUse hook or a batch cascade can refuse a call that already carries one, which test_a_badged_call_can_still_be_refused drives through a real turn.

The shape

Point decisions/points/tool_risk.py, one Choice over safe / caution / risky with a one-sentence rubric per tier
State tool name, arguments, message excerpt — each bounded (120 / 2000 / 2000 chars)
Secrets arguments pass through the canonical redactors first, clipped after
Badge only caution and risky; safe is recorded in the log and draws nothing
Budget one oracle call per tool call, at most 20 per turn, the same wait clamp skills.select uses; the row is written off the loop under LOG_BUDGET_SECS
Verdict the strip's own thumbs pair, side: "jev", POST /api/decisions/feedback
New routes / knobs none

Two design points worth reading, because both are the opposite of what the sibling point does:

Redaction, not refusal. The gate refuses a state carrying a credential, which is right for a message excerpt — a secret there is a finding. A credential in a tool argument is ordinary (an aws command, a curl header), so refusing on it would mean the seam never annotates the calls most worth annotating. The point replaces it with the shipped placeholder, and the gate then scans the placeholder. Pinned in both directions: the redacted state passes gate.scrub_reason, the raw one is refused as scrubbed:credential. This is also why tool_risk.py is a registered redaction_paths sink while its sibling decisions/gate.py is allowlisted as a non-egress detector — the gate emits nothing on a hit, this module's scrubbed bytes are what leaves the machine.

safe is recorded and not badged. The log is the observation, so a log that only kept the alarming answers could not say how often the seam is wrong. A badge on every card of a sampled session would cost the flag its meaning. So the note's presence is the flag, and toolRiskRecord.ts refuses the safe tier too — a producer that started stamping safe records could not quietly badge every card.

Why policy and not a per-call verdict

The row carries policy — the grant that answers the call (yolo / trust / trust_scope, from the shipped _auto_approve_reason) — rather than allowed/blocked/asked. It cannot carry the latter: the harness sends the tool_call notification before it asks for permission (acp/_dispatch: "the preceding tool_call notification"), so the card this record rides exists before any verdict about it does. A later refusal — a host gate, a PreToolUse hook, a batch cascade — is already recorded by the SEL tool-invocation audit. Guessing at it here would give the log two descriptions of one call and make the weaker one look authoritative.

No new registry entry

decisions.outcomes holds one outcome per session and consume pops it — right for a strip describing one turn, wrong for an annotation describing one of several calls inside one turn. Producer and consumer here are the same line of code, so the record is handed straight to the slot.append that carries it — before the append, so it reaches both doors (the live chat_message frame and the persisted transcript line) from one write.

Frontend

  • pages/chat/toolRiskRecord.ts — the pure reader; validates the record, refuses safe, an unknown tier, a missing turn_id and a probability outside 0..1.
  • pages/chat/ToolRiskBadge.tsx — the row under the pill. risky uses the warning colour, never the danger colour this transcript uses for a call that was blocked, and the tooltip says in words that the call ran anyway and that flagging it changed nothing.
  • pages/chat/DecisionVerdictThumbs.tsx — extracted out of DecisionStrip.tsx so both surfaces post one implementation of the verdict. The log's summary is keyed on side, and a second copy would be a second chance to send the wrong one.
  • ToolCallLine.tsx reads the record off its own message, so no host wiring changes.

Tested

  • test/test_decisions_tool_risk.py (36) — the record, the request, every refusal, both budgets, the wait clamp held equal to skills.select's, and a source check that the point imports no dashboard or permission code.
  • test/test_decisions_tool_risk_card.py (14) — the ride-along through the real _run_chat on both doors, the tool row rather than the reply, one record per card across two calls in one turn, the absence case, and the permission mutation check.
  • test/test_decisions_tool_risk_end_to_end.py (2) — the whole chain with nothing stubbed between the links: real _run_chat, real gate, real scrub, real day-file, real verdict route; plus the credential case through the real scrub.
  • website/src/test/ToolRiskBadge.test.tsx (22) and ToolRiskBadgeContract.test.ts (7) — the latter parses the record fixture out of spec § 9 and asserts the reader accepts it field for field, the same way decisionStripContract.test.ts does for the strip.

Gates green locally: black, mypy, comment-history, subprocess-encoding, sync-io-in-async, brand, focus-cue, changelog-history, harness-parity, feature-map, tsc, eslint, and all 19 i18n checks including the eleven per-locale style suites.

Two doc sentences corrected

src/kiro_crew/docs/decisions.md said "Nothing in this version displays that record" and "This version has no button for that verdict". Both were already false on main — the strip and its thumbs shipped — and the new section directly contradicts them, so they are corrected rather than left standing beside it. The page's title and its two index rows widen from "Jev skill selection" to "Jev decisions", since the page now covers two things.

Known, and deliberately not in this PR

The consent card's egress sentence does not yet mention tool arguments. decisions_egress says "the text of your messages and the names and descriptions of your skills leave this machine"; with this point on, a trusting session also sends a tool name and its (redacted) arguments. The spec's own rule is that consent is recorded against the text the owner reviewed, so that sentence should widen. It is one changed value across 13 locales and each one re-enters the per-locale style gates, so it is held out of this push rather than bundled into a red-clearing round — happy to land it here on request, otherwise it follows immediately.

Backend Tests (Windows) (1) is main-side. Four test/test_acp_runtime.py failures ([returncode=-15] vs [returncode=<not reaped>]). That file and src/kiro_crew/acp/runtime.py were both last touched by this PR's own base commit, #12005, which landed at 01:17 UTC; the Windows shard's last green run on main predates it. PRs #12251 and #12252 fail the same four tests with unrelated diffs. This PR touches no acp/ or runtime file.

@iamwhatever
iamwhatever requested review from a team and chenmingwei23 September 20, 2026 09:07
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ✅ human override accepted

@iamwhatever overrode this lane for fed1e4375cc0d0d9afe45e23eeb4344fafe2c819 via /ai-review override (this commit only).

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

Design-level review of a8fe2f053beccc44590c4a276eb67abbaac3064d — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Description contradicts HEAD's consent design: it says tool-argument egress rides existing consent with widening deferred, but commit 2 added a separate consent gate.

Watch

The PR body's "Known, and deliberately not in this PR" section and the "New routes / knobs: none" row describe commit 1; HEAD adds STATE_KEY_TOOL_ARGS, a tool_args field on PUT /api/decisions/consent, a new settings switch ("Also send tool-call arguments…"), and 13-locale strings — so a reader of the merged PR gets the wrong (looser) consent model for the feature's egress, and the new consent switch — the text the owner actually reviews before granting tool-argument egress — appears in none of the six screenshots.
Clears when: the description is rewritten to state the second-consent design (feature inert until tool_args is granted) and a screenshot of the Decisions card showing the new switch is attached.

[DESIGN-REVIEWED] a8fe2f0

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of a8fe2f053beccc44590c4a276eb67abbaac3064d — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

tool_risk.py re-spells the wait and log budgets its siblings already own, and the frontend record carries a tool field nothing renders.

Not justified as shipped

  • Item 9 — duplicate of src/kiro_crew/decisions/points/skills_select.py: WAIT_MARGIN_SECS/MIN_WAIT_SECS/MAX_WAIT_SECS plus wait_budget() are re-declared verbatim (grep WAIT_MARGIN_SECS: 2 copies, skills_select.py:115 and tool_risk.py:141), and LOG_BUDGET_SECS re-spells gate._LOG_BUDGET_SECS (0.05, gate.py:92) with no equality pin at all; the description's own "held equal by test so a point cannot invent its own ceiling" is the maintenance cost the second spelling creates.
    Subtraction: replace tool_risk's four constants and wait_budget() with the existing symbols (one shared home in the decisions package) and delete the equality test.
    Clears when: the deletion is made, or a stated reason the two points must be able to diverge.
  • Item 10 — zero consumers: ToolRiskRecord.tool is validated and returned (toolRiskRecord.ts:82) but no render site reads it — grep record.tool across ToolRiskBadge.tsx/ToolCallLine.tsx: 0; only tests touch it.
    Subtraction: drop tool from ToolRiskRecord and readToolRiskRecord (the log row keeps it).
    Clears when: the field is deleted or a render site consumes it.
  • Item 8 — rides along, undeclared: src/kiro_crew/docs/decisions.md drops the stale "Nothing in this version displays that record" / "no button for that verdict" prose (the strip and thumbs ship on base); the description never mentions it. Harm-free.

What this change ships

Inventory (10 items) — 7 justified

Intent: let a person whose session auto-approves its tool calls see which calls Jev flagged as risky, without changing any permission — an ADDITION, off by default behind two consents.

  1. Tool cards in trusting/YOLO sessions can carry "Jev: risky/caution (score)" with thumbs — justified
  2. A second consent switch "Also send tool-call arguments…" under the Decisions switch, off even for already-consented installs — justified
  3. The consent keystone records a tool_args scope; omitted preserves, disable clears, non-boolean refused — justified
  4. A consented install without the scope gets nothing sent and one warning naming why — justified
  5. The decision log gains a row per judged call (safe included) and a turn-cap row past 20 — justified
  6. A sampled auto-approving turn's next event is read up to the wait budget later per judged call — justified
  7. Badge and strip thumbs are one shared component posting the existing feedback route — justified
  8. Packaged user doc now says the strip and its thumbs are visible — rides along, undeclared stale-doc fix
  9. tool_risk re-declares the seam's wait clamp and log budget — duplicate of points/skills_select.py / gate.py
  10. The frontend risk record carries tool — zero consumers, no render site reads it

[FIRST-PRINCIPLES-REVIEWED] a8fe2f0

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ human override accepted

Human judgment by @iamwhatever overrides the GPT 5.6 finding for a8fe2f053beccc44590c4a276eb67abbaac3064d; the recorded reason is authoritative for this commit.

This comment is updated in place on each push.

The model was not re-run because an authorized human decision supersedes it.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt a8fe2f053beccc44590c4a276eb67abbaac3064d: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed a8fe2f053beccc44590c4a276eb67abbaac3064d — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] a8fe2f0

Verdict parsed from the review's SHA-scoped output markers for commit a8fe2f053beccc44590c4a276eb67abbaac3064d.

False positive or not applicable? A repository writer can comment:
/ai-review override fable a8fe2f053beccc44590c4a276eb67abbaac3064d: <one-sentence reason>

@iamwhatever

Copy link
Copy Markdown
Contributor Author

[operator: iamwhatever] Screenshot evidence for the tool risk badge.

Captured by website/scripts/capture-tool-risk-badge.mjs (new in this PR, the sibling of capture-decision-strip.mjs): the real built SPA behind the shared transcript harness, every /api/** call answered from fixtures. No gateway, no agent, no Jev — so readToolRiskRecord, the transcript virtualizer, ToolCallLine and the badge render exactly as in production, and the record arrives through meta.decisions_tool_risk on a tool row, the same door a scrollback read goes through.

Three tool cards in one shot, because the badge's claim is comparative: a read the seam answered safe for (which stamps no record, so that card is exactly what every tool card looks like without this feature), a risky tree clear, and a caution config rewrite.

transcript-light

transcript-dark

badge-risky-light

badge-caution-light

badge-risky-dark

badge-caution-dark

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 20, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 20, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

[operator: iamwhatever] Disposition — GPT 5.6 Review on 3403049aff. All three findings upheld and fixed in 3e46831f23.

No rebuttals this round. Each one named something real, and two of them named something I had written down as a guarantee.


1. tool_risk.py:354 — outcome logging blocks the gateway event loop. Anchor: no-blocking-call-on-event-loop · upheld, fixed.

Correct, and the module disagreed with itself about it. skills.select appends synchronously because it runs on the executor thread that assembles the prompt; this point is an async def awaited by _run_chat, so the same call is a lock wait plus a filesystem write on the loop. _record_turn_cap, two functions below in the same file, already offloaded — so the evidence that this was an oversight rather than a design choice was sitting next to it.

Fixed as the gate does it for the same write on the same loop, rather than with a bare to_thread:

written = await asyncio.wait_for(asyncio.to_thread(_log.append, row), LOG_BUDGET_SECS)

LOG_BUDGET_SECS is 0.05, the value and the name gate._LOG_BUDGET_SECS carries. A write that outlives it refuses the badge, not just the log line: the caller stopped waiting for the row a verdict would be filed against, and a badge whose turn_id names no row is a control that lies about being one — the same rule the append return value already enforced.


2. docs/feature-map/README.md:88 — the map promises ordering and outcomes the implementation does not provide. Anchor: feature-map-correctness · upheld, fixed.

Both clauses are right, and this is the finding I am most glad to have.

"The call is neither delayed" — false. The harness sends the tool_call frame before it asks for permission, so awaiting the point delays when the turn's next event is read, by up to the wait budget. I had reasoned about that ordering carefully enough to justify the hook's placement, and then wrote the opposite into the row.

"A flagged call still runs" — false. A host gate, a PreToolUse hook or a batch cascade can refuse a call that already carries a note. My own spec paragraph on the policy field says exactly this; the feature-map row contradicted it.

Corrected in five places, not one: the point's module docstring, _tool_risk_meta's docstring, spec § 9, the feature-map row and the product doc. Each now states what is unchanged — the decision: same inputs, same branches, same answer — and names both costs plainly.

And the corrected sentence is now checkable rather than merely rewritten. test_a_badged_call_can_still_be_refused drives a blocking PreToolUse hook through a real _run_chat turn and asserts the card keeps its note and reject_tool was called with approve_tool never called. A prose fix nobody can fail is how the same sentence comes back.


3. test_settingref_schema_fixture.py:158 — an exact ratchet was relaxed to membership. Anchor: a-ratchet-may-only-tighten · upheld, fixed, and your form taken verbatim.

Right on the mechanism: with membership plus inequality, a third point keeps both assertions true and the registry grows with nobody asked. I had read the test by its name and docstring ("is a point the backend ships") and missed that its shape was doing a second job — guarding the list that decides what may send conversation text off the machine.

Now DECISION_POINT_NAMES == (point, ANNOTATION_POINT), which is what you proposed. It keeps both claims at once: the whole registry, and which of its two points the card is about. test_decisions_gate.py pins the same tuple independently, so a point now has to be added in three places on purpose.


Still open, and named in the PR body rather than fixed here: the consent card's decisions_egress sentence lists messages and skill descriptions but not tool arguments, which this point also sends. It is a real disclosure gap under the spec's own "consent is recorded against the text the owner reviewed" rule. It is one changed value across 13 locales, each re-entering the per-locale style gates that cost a round earlier today, so it is held for a decision rather than bundled into a red-clearing push.

Not mine, unchanged: Backend Tests (Windows) (1) — four test_acp_runtime.py failures. That file and src/kiro_crew/acp/runtime.py were both last touched by this PR's own base commit (#12005, 01:17 UTC); the Windows shard's last green run on main predates it; PRs #12251 and #12252 fail the same four tests with unrelated diffs. This PR touches no acp/ or runtime file.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 20, 2026
@iamwhatever
iamwhatever force-pushed the feat/decisions-tool-risk branch from 3e46831 to aa0e60c Compare September 20, 2026 10:02
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@iamwhatever marked the ux AI finding as false positive, not applicable, or explicitly accepted for fed1e4375cc0d0d9afe45e23eeb4344fafe2c819.

developer preview behind two owner consent switches; the badge is annotation-only and the UX items (label wording, governed-state captures) are answered in dispositions and tracked in #12298.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 20, 2026
…badge claiming the call ran

Settles the two blockers the review lanes upheld.

1. TOOL-ARGUMENT CONSENT. `skills.select` sends a message excerpt and candidate
   descriptions; `tool.risk` adds the tool's name and its arguments. An owner who
   consented before this point existed consented to the former, so reading their
   keystone as permission for the latter widens egress with no new choice -- the
   argument that already gave `history_budget_chars` a keystone ceiling instead of
   a config value. It now takes a SECOND consent, built on that same pattern:

   - `consent.STATE_KEY_TOOL_ARGS` / `consented_tool_args`, where only a literal
     `true` consents and ABSENT reads as not consented, so every record written
     before the key existed keeps meaning what its owner agreed to.
   - `save_enabled(tool_args=...)` writes it on enable and clears it on disable;
     `KEEP_TOOL_ARGS` preserves a recorded scope and is resolved inside the same
     lock the ceiling uses, so an enabling PUT cannot restore a scope a concurrent
     revoking PUT already cleared.
   - `gate._tool_args_scoped` refuses any point in `POINTS_NEEDING_TOOL_ARGS`,
     checked inside `_consented_for` -- the chokepoint every `decide` and
     `is_enabled` path funnels its one keystone read through -- so the scope costs
     no second read and is not enforceable in the preflight alone. Warned once per
     point, because an owner whose feature does nothing must be able to tell that
     from a broken build.
   - `PUT /api/decisions/consent` takes `tool_args`, absent PRESERVING the recorded
     value and a non-boolean refused with 400 rather than coerced; the GET reports
     it. No new endpoint.
   - The card grows a second switch under the main one, visible only while it is
     on. The main switch deliberately sends no `tool_args`, so flipping it cannot
     grant or erase a scope the owner did not touch.

   The consequence is the point of it: an already-consented install is INERT for
   `tool.risk` until its owner opts in.

2. THE TOOLTIP no longer claims the call ran. A `PreToolUse` hook or a host gate
   can refuse a call that already carries a note, so "It still ran" was false in
   the case the badge is most likely to appear in -- and the feature-map row cited
   that tooltip as carrying the correction, which made the pair worse than the
   plain overclaim. It now says flagging changed nothing about whether the call was
   allowed and that the call may still have been refused.

Tests: `test_decisions_tool_args_scope.py` covers the reader's default, the
writer's round trip (preserve, revoke, clear on disable, non-boolean refused), the
gate refusing the point while leaving `skills.select` untouched, `decide` sending
nothing, the once-per-point warning, and the route's preserve/revoke/sentinel
behaviour. The scope check is revert-verified: neutering it fails three of them.
The end-to-end now writes a REAL keystone instead of stubbing `_consented_for`, so
it covers the scope rather than asserting around it, and a sibling drives the
revoked state through `_run_chat` to show nothing is sent and no row is written.
@iamwhatever
iamwhatever force-pushed the feat/decisions-tool-risk branch from fed1e43 to a8fe2f0 Compare September 20, 2026 17:44
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Sep 20, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

[operator: iamwhatever] Disposition for the GPT 5.6 finding on the rebased head a8fe2f053b — one finding, no code from this round.

This head is a pure rebase of fed1e4375c onto e65faf1afb (single squashed commit, same diff). The only conflicts were the 13 i18n catalogs, resolved as a union: main's #12245 strip rows (sent_*, latency_*) sit beside this PR's keys, and DecisionStrip.tsx keeps both main's new rows and this PR's DecisionVerdictThumbs extraction.

  1. FeaturePreviewsSection.tsx:222 — a failed tool-argument save is silent (errors-use-error-notice) → upheld as accurate. mut.isError renders an ErrorNotice with askAgent; scopeMut, which this PR adds, renders nothing, so a rejected scope PUT leaves the switch snapping back with no sentence. The notice is the right shape here (the write is owner-initiated and retryable, same class as decisions_save_failed), and the hand-off decision is the same askAgent its sibling already carries. Left to the round that owns code on this PR rather than patched inside a rebase, so the rebase stays reviewable as a rebase.

  2. FeaturePreviewsSection.tsx:224 — a late scope PUT can re-enable consent → already answered, and the code already carries the guard. The tool-argument row is gated on mut.isPending and the main row on scopeMut.isPending, so the two switches cannot be in flight together; the residual two-tab race is the one dispositioned on fed1e4375c as a narrow owner-versus-owner interleave that _SAVE_LOCK bounds. The rebase changed nothing on this route.

Local verification on this head: 297 backend decisions/consent/gate tests, 130 frontend decision tests, tsc, eslint, isort/flake8/mypy, i18n:check (exit 0), lint:i18n, keyReference, docs-lint, feature-map, and the 15-gate fast-gate battery all pass. gen:settings and i18n:pseudo produce no drift. The one non-AI red, Build Windows Installer (x64), failed on Silent uninstall left a KiroCrew registration behind — runner registry state, nothing in this diff touches packaging — and has been re-run.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 20, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt a8fe2f0: rebase of the already-overridden head fed1e43 onto main; CI fully green; permission behaviour byte-identical with the point on/off, tool arguments behind a separate owner consent switch; remaining owner-only race and v1 design limits tracked in #12298.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@iamwhatever marked the gpt AI finding as false positive, not applicable, or explicitly accepted for a8fe2f053beccc44590c4a276eb67abbaac3064d.

rebase of the already-overridden head fed1e43 onto main; CI fully green; permission behaviour byte-identical with the point on/off, tool arguments behind a separate owner consent switch; remaining owner-only race and v1 design limits tracked in #12298.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 20, 2026
@bolichen97
bolichen97 merged commit 78cf37a into main Sep 20, 2026
97 of 99 checks passed
@bolichen97
bolichen97 deleted the feat/decisions-tool-risk branch September 20, 2026 20:53
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 20, 2026

Copy link
Copy Markdown
Contributor

Maintainer readiness-sweep record (agent-assisted, on behalf of @bolichen97), head a8fe2f0: verified readiness: passed label + PR Readiness status success on this exact head, no failing or pending required checks, no outstanding CHANGES_REQUESTED, no unresolved blocking review thread, and no textual conflict with current main. The intended APPROVE review on this head failed to post before the squash-merge call, so the merge went through on repository-admin standing rather than a recorded approval. Recording the approval rationale here for the audit trail.

amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
…badge claiming the call ran (kirodotdev#12253)

Settles the two blockers the review lanes upheld.

1. TOOL-ARGUMENT CONSENT. `skills.select` sends a message excerpt and candidate
   descriptions; `tool.risk` adds the tool's name and its arguments. An owner who
   consented before this point existed consented to the former, so reading their
   keystone as permission for the latter widens egress with no new choice -- the
   argument that already gave `history_budget_chars` a keystone ceiling instead of
   a config value. It now takes a SECOND consent, built on that same pattern:

   - `consent.STATE_KEY_TOOL_ARGS` / `consented_tool_args`, where only a literal
     `true` consents and ABSENT reads as not consented, so every record written
     before the key existed keeps meaning what its owner agreed to.
   - `save_enabled(tool_args=...)` writes it on enable and clears it on disable;
     `KEEP_TOOL_ARGS` preserves a recorded scope and is resolved inside the same
     lock the ceiling uses, so an enabling PUT cannot restore a scope a concurrent
     revoking PUT already cleared.
   - `gate._tool_args_scoped` refuses any point in `POINTS_NEEDING_TOOL_ARGS`,
     checked inside `_consented_for` -- the chokepoint every `decide` and
     `is_enabled` path funnels its one keystone read through -- so the scope costs
     no second read and is not enforceable in the preflight alone. Warned once per
     point, because an owner whose feature does nothing must be able to tell that
     from a broken build.
   - `PUT /api/decisions/consent` takes `tool_args`, absent PRESERVING the recorded
     value and a non-boolean refused with 400 rather than coerced; the GET reports
     it. No new endpoint.
   - The card grows a second switch under the main one, visible only while it is
     on. The main switch deliberately sends no `tool_args`, so flipping it cannot
     grant or erase a scope the owner did not touch.

   The consequence is the point of it: an already-consented install is INERT for
   `tool.risk` until its owner opts in.

2. THE TOOLTIP no longer claims the call ran. A `PreToolUse` hook or a host gate
   can refuse a call that already carries a note, so "It still ran" was false in
   the case the badge is most likely to appear in -- and the feature-map row cited
   that tooltip as carrying the correction, which made the pair worse than the
   plain overclaim. It now says flagging changed nothing about whether the call was
   allowed and that the call may still have been refused.

Tests: `test_decisions_tool_args_scope.py` covers the reader's default, the
writer's round trip (preserve, revoke, clear on disable, non-boolean refused), the
gate refusing the point while leaving `skills.select` untouched, `decide` sending
nothing, the once-per-point warning, and the route's preserve/revoke/sentinel
behaviour. The scope check is revert-verified: neutering it fails three of them.
The end-to-end now writes a REAL keystone instead of stubbing `_consented_for`, so
it covers the scope rather than asserting around it, and a sibling drives the
revoked state through `_run_chat` to show nothing is sent and no row is written.

Co-authored-by: Joe Guo <zejiangg@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants