diff --git a/docs/superpowers/plans/2026-11-05-giellie-stock-quantity-update.md b/docs/superpowers/plans/2026-11-05-giellie-stock-quantity-update.md index 64c7793..4793b64 100644 --- a/docs/superpowers/plans/2026-11-05-giellie-stock-quantity-update.md +++ b/docs/superpowers/plans/2026-11-05-giellie-stock-quantity-update.md @@ -1458,6 +1458,16 @@ describe("stock_items.set_quantities", () => { }).cls, ).toBe("read"); }); + + it("is a read when dry_run is the string true, matching the route", () => { + expect( + classifyToolCall("stock_items.set_quantities", { + mode: "set", + lines: [], + dry_run: "true", + }).cls, + ).toBe("read"); + }); }); ``` @@ -1487,11 +1497,13 @@ In `src/lib/server/giellie-tool-policy.ts`, inside `classifyToolCall`, add this ```ts // A dry run writes nothing, so it must not raise an approval card. - if ( - name === "stock_items.set_quantities" && - (input as { dry_run?: unknown } | null)?.dry_run === true - ) { - return { cls: "read" }; + // The route treats the string "true" as a dry run too, so the policy + // must agree with it — otherwise a dry run would still ask. + if (name === "stock_items.set_quantities") { + const dryRun = (input as { dry_run?: unknown } | null)?.dry_run; + if (dryRun === true || dryRun === "true") { + return { cls: "read" }; + } } ```