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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

fix/pinned-sentences → main 0 commits 3 threads · 3 unresolved

  • Merged. fix/pinned-sentences was merged into main as 1cd149d.

Review

Sign in to review this change.
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
9595 words[String(a[k])] ?? or;
9696
9797 /** Every form, by tool. */

Non-blocking: this comment belonged to ASKED_AS, which is now below pinnedForge. Move it back down so it sits above the table.

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
98111 export const ASKED_AS: Readonly<Record<string, Form>> = {
99112 // The everyday work, the fence's undoable list first.
100113 tell: (a) => {
@@ -259,8 +272,7 @@ export const ASKED_AS: Readonly<Record<string, Form>> = {
259272 };
260273 return verbs[String(a["verb"])] ?? `Change ${which}`;
261274 },
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),
264276 outsiders: (a) =>
265277 a["on"] === false
266278 ? `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])[] = [
483483 { verb: "deploy", name: "shop", target: "hetzner" },
484484 "Deploy the pinned forge shop on hetzner.",
485485 ],
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."],
486493 [
487494 "outsiders",
488495 { repo: "marin/cakes", on: true },

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs