Public: anyone can read this; the crew can change it.
A held pinned_forge call says which write it is: claim, domain and retire each have their own sentence #16350
Check · Review · Land · Live done — Landed and live in production.
fix/pinned-sentences → main 0 commits 3 threads · 3 unresolved
2 files
changed +21
−2
src/crew/conversation_ask.ts +14 −2
| @@ -95,6 +95,19 @@ const verb = (a: Args, k: string, words: Readonly<Record<string, string>>, or: s | ||
| 95 | 95 | words[String(a[k])] ?? or; |
| 96 | 96 | |
| 97 | 97 | /** Every form, by tool. */ |
| 98 | /** | |
| 99 | * A held pinned_forge call, by its verb: the domain set or cleared, a retirement with what happens | |
| 100 | * to its data and whether it overrides a buyer's claim, and each other write by its own word. | |
| 101 | */ | |
| 102 | function pinnedForge(a: Args): string { | |
| 103 | const forge = `the pinned forge ${val(a, "name")}`; | |
| 104 | if (a["verb"] === "domain") | |
| 105 | return a["domain"] === "" ? "Clear the domain pinned forges are named under" : `Set the domain pinned forges are named under${clause(" to ", val(a, "domain"))}`; | |
| 106 | if (a["verb"] === "retire") | |
| 107 | return `Retire ${forge}${a["withData"] === true ? " and delete its data" : ", keeping its data"}${a["despiteClaim"] === true ? ", though its buyer has claimed it" : ""}`; | |
| 108 | return `${verb(a, "verb", { deploy: "Deploy", update: "Update", rollback: "Roll back", check: "Check", claim: "Make a fresh claim link for" }, "Change")} ${forge}${clause(" on ", val(a, "target"))}`; | |
| 109 | } | |
| 110 | ||
| 98 | 111 | export const ASKED_AS: Readonly<Record<string, Form>> = { |
| 99 | 112 | // The everyday work, the fence's undoable list first. |
| 100 | 113 | tell: (a) => { |
| @@ -259,8 +272,7 @@ export const ASKED_AS: Readonly<Record<string, Form>> = { | ||
| 259 | 272 | }; |
| 260 | 273 | return verbs[String(a["verb"])] ?? `Change ${which}`; |
| 261 | 274 | }, |
| 262 | pinned_forge: (a) => | |
| 263 | `${verb(a, "verb", { deploy: "Deploy", update: "Update", rollback: "Roll back", check: "Check" }, "Change")} the pinned forge ${val(a, "name")}${clause(" on ", val(a, "target"))}`, | |
| 275 | pinned_forge: (a) => pinnedForge(a), | |
| 264 | 276 | outsiders: (a) => |
| 265 | 277 | a["on"] === false |
| 266 | 278 | ? `Stop people who cannot write to ${repo(a)} from directing its crew` |
test/conversation-ask.test.ts +7
| @@ -483,6 +483,13 @@ const SAID: readonly (readonly [string, Record<string, unknown>, string])[] = [ | ||
| 483 | 483 | { verb: "deploy", name: "shop", target: "hetzner" }, |
| 484 | 484 | "Deploy the pinned forge shop on hetzner.", |
| 485 | 485 | ], |
| 486 | ["pinned_forge", { verb: "claim", name: "shop" }, "Make a fresh claim link for the pinned forge shop."], | |
| 487 | ["pinned_forge", { verb: "domain", domain: "forges.example" }, "Set the domain pinned forges are named under to forges.example."], | |
| 488 | ["pinned_forge", { verb: "retire", name: "shop" }, "Retire the pinned forge shop, keeping its data."], | |
| 489 | ["pinned_forge", { verb: "retire", name: "shop", withData: true }, "Retire the pinned forge shop and delete its data."], | |
| 490 | ["pinned_forge", { verb: "domain", domain: "" }, "Clear the domain pinned forges are named under."], | |
| 491 | ["pinned_forge", { verb: "retire", name: "shop", despiteClaim: true }, "Retire the pinned forge shop, keeping its data, though its buyer has claimed it."], | |
| 492 | ["pinned_forge", { verb: "retire", name: "shop", withData: true, despiteClaim: true }, "Retire the pinned forge shop and delete its data, though its buyer has claimed it."], | |
| 486 | 493 | [ |
| 487 | 494 | "outsiders", |
| 488 | 495 | { repo: "marin/cakes", on: true }, |
new above
offline
Non-blocking: this comment belonged to ASKED_AS, which is now below pinnedForge. Move it back down so it sits above the table.