From 450cd0169772ac097456c70212d19c28b6ba9c05 Mon Sep 17 00:00:00 2001 From: Samvit Ramadurgam Date: Fri, 4 Dec 2026 17:06:36 -0800 Subject: [PATCH 1/5] fix(cli): cast update refreshes the decide and state guidance Both sections were missing from refreshEnabledSnippets, so an install kept the text it first wrote until someone ran cast setup: Samvit's agents were still reading the August decision guidance. A wiring test now fails when any catalog snippet is left out of the refresh. Codecast-Session: https://codecast.sh/conversation/jx72m9j4xx2483y0qbb8n36f998ke1m8 --- packages/cli/src/index.ts | 2 ++ packages/cli/src/snippets.wiring.test.ts | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 07291dda0d..7eb48b8565 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -2459,6 +2459,8 @@ async function refreshEnabledSnippets(config: Record): Promise { expect(indexSource).toContain("config.browser_enabled && config.browser_version"); expect(indexSource).toContain("if (config.browser_enabled) installBrowserSnippet(true)"); }); + + test("every enabled snippet is refreshed when the binary updates", () => { + // `cast update` and the daemon's automatic update both run + // refreshEnabledSnippets(); setup's stale check runs only on `cast setup`. + // A snippet missing from the refresh keeps the text it was first installed + // with: decide and state sat on their August bodies for months this way. + const start = indexSource.indexOf("async function refreshEnabledSnippets("); + const refresh = indexSource.slice(start, indexSource.indexOf("\n}\n", start)); + const sectionTable = indexSource.slice(indexSource.indexOf("const SECTION_SNIPPET_VERSIONS"), indexSource.indexOf("};", indexSource.indexOf("const SECTION_SNIPPET_VERSIONS"))); + const missing = SNIPPET_CATALOG.filter( + (s) => !refresh.includes(`config.${s.enabledKey}`) && !sectionTable.includes(` ${s.slug}:`), + ).map((s) => s.slug); + expect(missing).toEqual([]); + }); }); From 4533c2ac65420932e5798172f0271d87905d1c03 Mon Sep 17 00:00:00 2001 From: Samvit Ramadurgam Date: Fri, 4 Dec 2026 17:06:36 -0800 Subject: [PATCH 2/5] feat: decision cards a busy reader answers cold, and stale cards that clear - Guidance, --help and a read-back on every ask: the question is one plain sentence in the product's terms; the context runs what happened, why it needs you, the choice. - A run paused on its card whose pull request is merged on GitHub withdraws the card and records the merge (sd-5438); healOutsideMerges status paused repairs the ones already stuck. - cast decide cancel sd-N --note: any session of the same person withdraws a card, and the asking session is told. cast decide show names the asker. Codecast-Session: https://codecast.sh/conversation/jx72m9j4xx2483y0qbb8n36f998ke1m8 --- .../install-golden/existing/decide.md | 10 +++-- .../install-golden/fresh/decide.md | 10 +++-- packages/cli/src/decideCommand.ts | 17 ++++++--- packages/convex/convex/deployCarries.ts | 27 ++++++++++--- packages/convex/convex/deployRunsLive.test.ts | 38 +++++++++++++++++++ packages/convex/convex/http.ts | 2 +- .../convex/convex/sessionDecisions.test.ts | 36 ++++++++++++++++++ packages/convex/convex/sessionDecisions.ts | 37 +++++++++++++++--- packages/evals/fixtures/fakes/cli-tree.json | 4 +- packages/evals/src/fakes/cast/verbs.ts | 3 +- packages/shared/contracts/snippetsWorkflow.ts | 12 ++++-- 11 files changed, 165 insertions(+), 31 deletions(-) diff --git a/packages/cli/src/__fixtures__/install-golden/existing/decide.md b/packages/cli/src/__fixtures__/install-golden/existing/decide.md index 05a39d684f..2213ef6e67 100644 --- a/packages/cli/src/__fixtures__/install-golden/existing/decide.md +++ b/packages/cli/src/__fixtures__/install-golden/existing/decide.md @@ -33,16 +33,20 @@ block by "everything to end of file" destroys this paragraph. Never re-ask what an earlier card (`cast decide ls`), ruling or project instruction answered. When the answer deploys, spends, changes access or messages outside the team, pass `--category production|billing|data|access|external|product|limit`: the card is then a person's alone, else (outside a run) `review`, open to a granted role. ```bash -cast decide "" \ +cast decide "" \ -o "First option :: what happens if chosen" \ -o "Second option :: what happens instead" \ --impact "<1-5> :: what waits on the answer" \ --context - <<'EOF' -What you would pick and why, then what the choice turns on. +**What happened.** The real case: who, what they said or got. +**Why it needs you.** What the answer changes, and what waits on it. +**The choice.** The trade-off in plain words; what you would pick and why. EOF ``` -**The card is the whole message, written for someone who was not here.** The person answering knows the product and its people but did not follow this session: they read the card once, in their queue or on their phone, with nothing else open, and answer without opening the session. Name things the way they would. The names this work coined, its shorthand, and ids or references only the session explains (a task, a trigger, a script, "the rule from earlier") mean nothing to them, and neither does a pointer back to something said earlier in the session, their own words included: say what the thing is instead. The question is the choice as they would put it to themselves. Each option says what happens to the product or the people it reaches, then `::` and the fact that sizes it. The context opens on what you would pick and why, then gives only what the choice turns on: the finding that forces it, what cuts against your pick, and what you do meanwhile. It reads in a minute, under 150 words; how you got there and the supporting detail go in `--report report.html`. Every number and claim on it is one the session established; an estimate says so. Before posting, read the card as that person: whatever they would have to ask you about, rewrite. After posting, don't repeat the options. +**The card is the whole message, written for someone who was not here.** The person answering knows the product and its people but did not follow this session: they read the card once, in their queue or on their phone, with nothing else open, and answer without opening the session. Name things the way they would. The names this work coined, its shorthand, and ids or references only the session explains (a task, a trigger, a script, "the rule from earlier") mean nothing to them, and neither does a pointer back to something said earlier in the session, their own words included: say what the thing is instead. + +**The question is read first and alone**, in a list of dozens, by someone busy: one plain sentence they can answer cold, saying what is being decided in terms of the product and the people it reaches. "When the broker can't book the time a contact asked for, what should its reply say?" is answerable cold; "Should the booking-refused test's good example be replaced?" is answerable only by someone inside the work. Each option says what happens to the product or the people it reaches, then `::` and the fact that sizes it. The context runs in three parts: **what happened** (the real case, its people and their words), **why it needs you** (what the answer changes and what waits on it), and **the choice** (the trade-off in plain words, with what you would pick and the one reason). It reads in about 30 seconds; how you got there and the supporting detail go in `--report report.html`. Every number and claim on it is one the session established; an estimate says so. Before posting, read the card as that person: whatever they would have to ask you about, rewrite. After posting, don't repeat the options. **A step only the person may take** (a grant, a spend, a pairing, an approval) is a permission ask, never a command to type: `cast decide "?" --run "cast …"` runs it as theirs on Yes (`--on laptop` from a cloud host). A refusal that posted an approval card has asked already: end your turn. diff --git a/packages/cli/src/__fixtures__/install-golden/fresh/decide.md b/packages/cli/src/__fixtures__/install-golden/fresh/decide.md index 240537ebf3..d2583f3b3e 100644 --- a/packages/cli/src/__fixtures__/install-golden/fresh/decide.md +++ b/packages/cli/src/__fixtures__/install-golden/fresh/decide.md @@ -6,16 +6,20 @@ Never re-ask what an earlier card (`cast decide ls`), ruling or project instruction answered. When the answer deploys, spends, changes access or messages outside the team, pass `--category production|billing|data|access|external|product|limit`: the card is then a person's alone, else (outside a run) `review`, open to a granted role. ```bash -cast decide "" \ +cast decide "" \ -o "First option :: what happens if chosen" \ -o "Second option :: what happens instead" \ --impact "<1-5> :: what waits on the answer" \ --context - <<'EOF' -What you would pick and why, then what the choice turns on. +**What happened.** The real case: who, what they said or got. +**Why it needs you.** What the answer changes, and what waits on it. +**The choice.** The trade-off in plain words; what you would pick and why. EOF ``` -**The card is the whole message, written for someone who was not here.** The person answering knows the product and its people but did not follow this session: they read the card once, in their queue or on their phone, with nothing else open, and answer without opening the session. Name things the way they would. The names this work coined, its shorthand, and ids or references only the session explains (a task, a trigger, a script, "the rule from earlier") mean nothing to them, and neither does a pointer back to something said earlier in the session, their own words included: say what the thing is instead. The question is the choice as they would put it to themselves. Each option says what happens to the product or the people it reaches, then `::` and the fact that sizes it. The context opens on what you would pick and why, then gives only what the choice turns on: the finding that forces it, what cuts against your pick, and what you do meanwhile. It reads in a minute, under 150 words; how you got there and the supporting detail go in `--report report.html`. Every number and claim on it is one the session established; an estimate says so. Before posting, read the card as that person: whatever they would have to ask you about, rewrite. After posting, don't repeat the options. +**The card is the whole message, written for someone who was not here.** The person answering knows the product and its people but did not follow this session: they read the card once, in their queue or on their phone, with nothing else open, and answer without opening the session. Name things the way they would. The names this work coined, its shorthand, and ids or references only the session explains (a task, a trigger, a script, "the rule from earlier") mean nothing to them, and neither does a pointer back to something said earlier in the session, their own words included: say what the thing is instead. + +**The question is read first and alone**, in a list of dozens, by someone busy: one plain sentence they can answer cold, saying what is being decided in terms of the product and the people it reaches. "When the broker can't book the time a contact asked for, what should its reply say?" is answerable cold; "Should the booking-refused test's good example be replaced?" is answerable only by someone inside the work. Each option says what happens to the product or the people it reaches, then `::` and the fact that sizes it. The context runs in three parts: **what happened** (the real case, its people and their words), **why it needs you** (what the answer changes and what waits on it), and **the choice** (the trade-off in plain words, with what you would pick and the one reason). It reads in about 30 seconds; how you got there and the supporting detail go in `--report report.html`. Every number and claim on it is one the session established; an estimate says so. Before posting, read the card as that person: whatever they would have to ask you about, rewrite. After posting, don't repeat the options. **A step only the person may take** (a grant, a spend, a pairing, an approval) is a permission ask, never a command to type: `cast decide "?" --run "cast …"` runs it as theirs on Yes (`--on laptop` from a cloud host). A refusal that posted an approval card has asked already: end your turn. diff --git a/packages/cli/src/decideCommand.ts b/packages/cli/src/decideCommand.ts index 8e5a743678..4f0261bcce 100644 --- a/packages/cli/src/decideCommand.ts +++ b/packages/cli/src/decideCommand.ts @@ -641,10 +641,13 @@ function printPreview(question: string, optionList: DecideOption[], defaultOptio const contextChars = (contextMd ?? "").trim().length; // A --run card's command is its substance, and its options are fixed. if (runCard) return; + // The question is the one line a person reads in a queue of dozens before + // deciding whether to open the card, so it is read back on every ask. + console.log(fmt.muted(`\n They see this line first, alone, among dozens: "${question}"\n Could someone busy who never saw this session answer it cold? If it names anything this work coined (a test, a check, a run, a file), rewrite it in terms of the product and its people: cast decide edit --question.`)); if (!reportSlug && contextChars < 200) { console.log( fmt.muted( - `\n Note: ${contextChars} characters of context. They will probably have to open the session to answer this.\n Open with what you would pick and why, in words someone who never saw this session follows, then the finding that forces the choice, or attach --report.` + `\n Note: ${contextChars} characters of context. They will probably have to open the session to answer this.\n Say what happened, why it needs them, and what you would pick and why, in words someone who never saw this session follows, or attach --report.` ) ); } @@ -693,7 +696,7 @@ export const DECIDE_VERB_HELP: Record = { ls: { usage: "cast decide ls [--mine | --stack | --answered-since