@catalyst-cloud/cli 0.13.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +26 -29
  3. package/dist/args.js +16 -0
  4. package/dist/ask.js +30 -18
  5. package/dist/capabilities.js +5 -0
  6. package/dist/cli.js +18 -5
  7. package/dist/environment.js +1 -1
  8. package/dist/legacy.js +224 -0
  9. package/dist/project.js +129 -0
  10. package/dist/release.js +1 -1
  11. package/dist/repo.js +297 -0
  12. package/dist/runtime-verb.js +1 -1
  13. package/dist/secret.js +1 -1
  14. package/dist/skill-shape.js +21 -13
  15. package/dist/skills.js +44 -4
  16. package/dist/transport.js +26 -1
  17. package/package.json +5 -4
  18. package/skills/catalyst-github/SKILL.md +7 -7
  19. package/skills/catalyst-github/references/is-it-mergeable.md +8 -2
  20. package/skills/catalyst-github/references/what-a-pr-accumulates.md +3 -3
  21. package/skills/catalyst-github/scripts/is-it-mergeable.mjs +3 -3
  22. package/skills/catalyst-github/scripts/lib/cli.mjs +9 -7
  23. package/skills/catalyst-github/scripts/lib/credential.mjs +2 -2
  24. package/skills/catalyst-github/scripts/read-pr.mjs +2 -2
  25. package/skills/catalyst-linear/SKILL.md +17 -19
  26. package/skills/catalyst-linear/agents/openai.yaml +1 -1
  27. package/skills/catalyst-linear/agents/portability.yaml +1 -1
  28. package/skills/catalyst-linear/references/reading-a-ticket.md +9 -26
  29. package/skills/catalyst-linear/references/what-a-ticket-accumulates.md +2 -2
  30. package/skills/catalyst-linear/references/writing-to-linear.md +7 -9
  31. package/skills/catalyst-linear/scripts/comment.mjs +1 -1
  32. package/skills/catalyst-linear/scripts/create-ticket.mjs +1 -1
  33. package/skills/catalyst-linear/scripts/label.mjs +1 -1
  34. package/skills/catalyst-linear/scripts/lib/cli.mjs +9 -7
  35. package/skills/catalyst-linear/scripts/lib/credential.mjs +2 -2
  36. package/skills/catalyst-linear/scripts/move.mjs +1 -1
  37. package/skills/catalyst-linear/scripts/read-ticket.mjs +1 -1
  38. package/skills/catalyst-linear/scripts/search.mjs +1 -1
  39. package/skills/catalyst-onboard/SKILL.md +37 -57
  40. package/skills/catalyst-onboard/agents/openai.yaml +2 -2
  41. package/skills/catalyst-onboard/agents/portability.yaml +1 -1
  42. package/skills/catalyst-onboard/references/connecting-this-machine.md +35 -0
  43. package/skills/catalyst-onboard/references/declaring-a-repository.md +7 -17
  44. package/skills/catalyst-onboard/references/local-sync.md +19 -7
  45. package/skills/catalyst-onboard/references/reading-ready.md +79 -0
  46. package/skills/catalyst-onboard/references/replacing-a-credential.md +8 -33
  47. package/skills/catalyst-onboard/references/repository-agent-setup.md +23 -0
  48. package/skills/catalyst-onboard/references/skill-sources.md +13 -19
  49. package/skills/catalyst-onboard/references/the-one-path.md +18 -74
  50. package/skills/catalyst-onboard/references/what-a-phase-needs.md +21 -28
  51. package/skills/catalyst-onboard/references/what-the-browser-owns.md +20 -37
  52. package/skills/{catalyst-setup → catalyst-onboard}/scripts/check.mjs +10 -9
  53. package/skills/catalyst-onboard/scripts/lib/cli.mjs +6 -4
  54. package/skills/catalyst-onboard/scripts/lib/credential.mjs +2 -2
  55. package/skills/catalyst-onboard/scripts/where-am-i.mjs +60 -4
  56. package/skills/run-this-project/SKILL.md +23 -25
  57. package/skills/run-this-project/agents/openai.yaml +1 -1
  58. package/skills/run-this-project/agents/portability.yaml +1 -1
  59. package/skills/run-this-project/references/making-work-ready.md +20 -37
  60. package/skills/run-this-project/references/reacting-to-events.md +25 -48
  61. package/skills/run-this-project/references/stalls-and-escalation.md +20 -42
  62. package/skills/run-this-project/scripts/lib/cli.mjs +7 -5
  63. package/skills/run-this-project/scripts/lib/credential.mjs +2 -2
  64. package/skills/run-this-project/scripts/scope-status.mjs +0 -0
  65. package/skills/run-this-project/scripts/watch-scope.mjs +1 -1
  66. package/skills/unstick/SKILL.md +12 -12
  67. package/skills/unstick/agents/openai.yaml +1 -1
  68. package/skills/unstick/agents/portability.yaml +1 -1
  69. package/skills/unstick/references/playbook.md +13 -13
  70. package/skills/unstick/scripts/lib/cli.mjs +6 -4
  71. package/skills/unstick/scripts/lib/credential.mjs +2 -2
  72. package/skills/unstick/scripts/unstick.mjs +1 -1
  73. package/skills/what-needs-me/SKILL.md +12 -14
  74. package/skills/what-needs-me/agents/openai.yaml +2 -2
  75. package/skills/what-needs-me/agents/portability.yaml +1 -1
  76. package/skills/what-needs-me/references/raising-a-decision.md +8 -16
  77. package/skills/what-needs-me/references/reading-the-inbox.md +6 -13
  78. package/skills/what-needs-me/references/settling-an-answer.md +6 -12
  79. package/skills/what-needs-me/scripts/inbox.mjs +14 -13
  80. package/skills/what-needs-me/scripts/lib/cli.mjs +6 -4
  81. package/skills/what-needs-me/scripts/lib/credential.mjs +2 -2
  82. package/skills/what-needs-me/scripts/raise.mjs +1 -1
  83. package/skills/what-needs-me/scripts/settle.mjs +1 -1
  84. package/skills/what-this-repo-needs/SKILL.md +10 -19
  85. package/skills/what-this-repo-needs/references/what-each-group-means.md +14 -44
  86. package/skills/what-this-repo-needs/scripts/check.mjs +2 -2
  87. package/skills/what-this-repo-needs/scripts/inventory.mjs +2 -2
  88. package/skills/what-this-repo-needs/scripts/lib/cli.mjs +11 -9
  89. package/skills/what-this-repo-needs/scripts/lib/credential.mjs +2 -2
  90. package/skills/whats-happening/SKILL.md +27 -21
  91. package/skills/whats-happening/agents/openai.yaml +1 -1
  92. package/skills/whats-happening/references/coding-accounts.md +24 -0
  93. package/skills/whats-happening/references/routing-work.md +11 -29
  94. package/skills/whats-happening/references/settings-and-where-they-live.md +20 -0
  95. package/skills/whats-happening/references/stages-and-mapping.md +25 -0
  96. package/skills/whats-happening/references/status-reply.md +21 -23
  97. package/skills/whats-happening/references/the-ladder.md +30 -0
  98. package/skills/whats-happening/references/what-runs-next.md +32 -0
  99. package/skills/whats-happening/references/when-a-phase-fails.md +27 -0
  100. package/skills/whats-happening/references/why-is-it-stuck.md +30 -44
  101. package/skills/whats-happening/scripts/explain.mjs +1 -1
  102. package/skills/whats-happening/scripts/lib/cli.mjs +7 -5
  103. package/skills/whats-happening/scripts/lib/credential.mjs +2 -2
  104. package/skills/{how-catalyst-works → whats-happening}/scripts/show-my-map.mjs +18 -32
  105. package/skills/whats-happening/scripts/snapshot.mjs +10 -6
  106. package/skills/catalyst-onboard/references/choosing-a-coding-account.md +0 -52
  107. package/skills/catalyst-onboard/references/who-fixes-what.md +0 -64
  108. package/skills/catalyst-setup/SKILL.md +0 -36
  109. package/skills/catalyst-setup/agents/openai.yaml +0 -6
  110. package/skills/catalyst-setup/agents/portability.yaml +0 -4
  111. package/skills/catalyst-setup/references/what-each-check-means.md +0 -88
  112. package/skills/catalyst-setup/scripts/lib/cli.mjs +0 -103
  113. package/skills/catalyst-setup/scripts/lib/credential.mjs +0 -29
  114. package/skills/catalyst-setup/scripts/replica-status.mjs +0 -46
  115. package/skills/connect-me/SKILL.md +0 -63
  116. package/skills/connect-me/agents/openai.yaml +0 -6
  117. package/skills/connect-me/agents/portability.yaml +0 -5
  118. package/skills/connect-me/references/keeping-the-replica-running.md +0 -88
  119. package/skills/connect-me/scripts/lib/cli.mjs +0 -185
  120. package/skills/connect-me/scripts/lib/credential.mjs +0 -29
  121. package/skills/connect-me/scripts/verify-connection.mjs +0 -68
  122. package/skills/how-catalyst-works/SKILL.md +0 -45
  123. package/skills/how-catalyst-works/agents/openai.yaml +0 -6
  124. package/skills/how-catalyst-works/agents/portability.yaml +0 -4
  125. package/skills/how-catalyst-works/references/coding-accounts.md +0 -51
  126. package/skills/how-catalyst-works/references/settings-and-where-they-live.md +0 -20
  127. package/skills/how-catalyst-works/references/stages-and-mapping.md +0 -56
  128. package/skills/how-catalyst-works/references/the-ladder.md +0 -41
  129. package/skills/how-catalyst-works/references/what-catalyst-is.md +0 -30
  130. package/skills/how-catalyst-works/references/what-runs-next.md +0 -95
  131. package/skills/how-catalyst-works/references/when-a-phase-fails.md +0 -57
  132. package/skills/how-catalyst-works/scripts/explain-ticket.mjs +0 -41
  133. package/skills/how-catalyst-works/scripts/lib/cli.mjs +0 -164
  134. package/skills/how-catalyst-works/scripts/lib/credential.mjs +0 -29
  135. package/skills/how-catalyst-works/scripts/whats-running.mjs +0 -65
  136. package/skills/whats-happening/references/reading-the-board.md +0 -43
  137. package/skills/whats-happening/references/reprioritising.md +0 -37
@@ -1,4 +1,4 @@
1
- // runtime-verb.ts — CTC-2158, Tier 2. `catalyst-skills runtime status|install|path|uninstall`: the
1
+ // runtime-verb.ts — CTC-2158, Tier 2. `catalyst runtime status|install|path|uninstall`: the
2
2
  // verb every unsupported-runtime message points at. It downloads the pinned Node named by
3
3
  // package.json's `catalystCloud.pinnedNode`, verifies it, and unpacks it under this CLI's own
4
4
  // cache — it never touches the machine's default Node and needs no admin rights.
package/dist/secret.js CHANGED
@@ -1,4 +1,4 @@
1
- // secret.ts — `catalyst-skills secret set|import`: put a repository's secrets into the cloud from the
1
+ // secret.ts — `catalyst secret set|import`: put a repository's secrets into the cloud from the
2
2
  // terminal, as the person who is logged in (CTC-3549). The cloud gates both on an admin or owner seat,
3
3
  // encrypts the value, and records who wrote it and where it came from, never the value itself.
4
4
  //
@@ -85,7 +85,7 @@ export function validateSkillDir(dir) {
85
85
  if (lines.length > MAX_SKILL_LINES)
86
86
  problems.push(`${name}: SKILL.md is ${lines.length} lines (max ${MAX_SKILL_LINES})`);
87
87
  const fm = parseFrontmatter(lines);
88
- let mutatingFrontmatter = false;
88
+ let manualOnlyFrontmatter = false;
89
89
  if (!fm)
90
90
  problems.push(`${name}: SKILL.md must start with YAML frontmatter (---)`);
91
91
  else {
@@ -99,7 +99,7 @@ export function validateSkillDir(dir) {
99
99
  problems.push(`${name}: frontmatter is missing "description"`);
100
100
  else if (fm.fields.description.length > MAX_DESCRIPTION_CHARS)
101
101
  problems.push(`${name}: description is ${fm.fields.description.length} characters (max ${MAX_DESCRIPTION_CHARS})`);
102
- mutatingFrontmatter = fm.fields["disable-model-invocation"] === "true";
102
+ manualOnlyFrontmatter = fm.fields["disable-model-invocation"] === "true";
103
103
  if (fm.closeIndex !== -1) {
104
104
  const after = lines[fm.closeIndex + 1] ?? "";
105
105
  if (!(after.startsWith("<!--") && after.includes(PROVENANCE_MARKER))) {
@@ -142,10 +142,14 @@ export function validateSkillDir(dir) {
142
142
  }
143
143
  }
144
144
  }
145
+ // Invocation is one choice written in three places: SKILL.md's `disable-model-invocation`, the
146
+ // OpenAI sidecar's `allow_implicit_invocation`, and portability's `invocation`. They must agree.
147
+ // Whether a skill writes (`mutating`) is a separate fact: a skill that writes can still be picked
148
+ // by the model, and its own scoped controls (a write budget, a preview) govern the write.
145
149
  const portability = join(dir, "agents", "portability.yaml");
146
150
  const openai = join(dir, "agents", "openai.yaml");
147
- let mutating = false;
148
- let implicitFalse = false;
151
+ let explicitPortability = null;
152
+ let implicitFalse = null;
149
153
  if (!existsSync(portability))
150
154
  problems.push(`${name}: agents/portability.yaml is missing`);
151
155
  else {
@@ -154,7 +158,14 @@ export function validateSkillDir(dir) {
154
158
  problems.push(`${name}: agents/portability.yaml does not declare "effects"`);
155
159
  if (!/^exposure:\s*\[\s*"?catalog"?\s*\]\s*$/m.test(y))
156
160
  problems.push(`${name}: agents/portability.yaml must declare exposure: [catalog]`);
157
- mutating = /^mutating:\s*true\s*$/m.test(y);
161
+ const mutating = /^mutating:\s*true\s*$/m.test(y);
162
+ const effectsEmpty = /^effects:\s*\[\s*\]\s*$/m.test(y);
163
+ if (mutating && effectsEmpty)
164
+ problems.push(`${name}: agents/portability.yaml says mutating: true but lists no effects`);
165
+ if (!mutating && /^effects:\s*\[\s*[^\]\s]/m.test(y))
166
+ problems.push(`${name}: agents/portability.yaml lists effects but lacks mutating: true`);
167
+ const inv = /^invocation:\s*(\w+)\s*$/m.exec(y)?.[1];
168
+ explicitPortability = inv === undefined ? null : inv === "explicit";
158
169
  }
159
170
  if (!existsSync(openai))
160
171
  problems.push(`${name}: agents/openai.yaml is missing`);
@@ -164,15 +175,12 @@ export function validateSkillDir(dir) {
164
175
  problems.push(`${name}: agents/openai.yaml has no "policy:" block`);
165
176
  if (!/allow_implicit_invocation:\s*(true|false)/.test(y))
166
177
  problems.push(`${name}: agents/openai.yaml does not set policy.allow_implicit_invocation`);
167
- implicitFalse = /allow_implicit_invocation:\s*false/.test(y);
178
+ else
179
+ implicitFalse = /allow_implicit_invocation:\s*false/.test(y);
168
180
  }
169
- if (mutating || mutatingFrontmatter || implicitFalse) {
170
- if (!mutating)
171
- problems.push(`${name}: disable-model-invocation / allow_implicit_invocation: false are set but agents/portability.yaml lacks mutating: true`);
172
- if (!mutatingFrontmatter)
173
- problems.push(`${name}: is mutating but SKILL.md does not set disable-model-invocation: true`);
174
- if (!implicitFalse)
175
- problems.push(`${name}: is mutating but agents/openai.yaml does not set policy.allow_implicit_invocation: false`);
181
+ const manualFlags = [manualOnlyFrontmatter, implicitFalse, explicitPortability].filter((v) => v !== null);
182
+ if (new Set(manualFlags).size > 1) {
183
+ problems.push(`${name}: the invocation fields disagree about whether the model may pick this skill (SKILL.md disable-model-invocation: ${manualOnlyFrontmatter}, agents/openai.yaml allow_implicit_invocation: ${implicitFalse === null ? "unset" : !implicitFalse}, agents/portability.yaml invocation: ${explicitPortability === null ? "unset" : explicitPortability ? "explicit" : "implicit"})`);
176
184
  }
177
185
  for (const p of walk(dir)) {
178
186
  const rel = relative(dir, p);
package/dist/skills.js CHANGED
@@ -1,9 +1,9 @@
1
1
  // skills.ts — copying the bundled skills into the user's skills directory, and the one-line update
2
2
  // notice a new version prints on its next session.
3
- import { cpSync, existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, statSync } from "node:fs";
3
+ import { cpSync, existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync } from "node:fs";
4
4
  import { join } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
- import { defaultSkillsDirFor, upgradeCommand } from "./config.js";
6
+ import { defaultSkillsDirFor, readManifest, upgradeCommand } from "./config.js";
7
7
  import { semverOlder } from "./semver.js";
8
8
  import { PROVENANCE_MARKER, parseFrontmatter, parseProvenanceVersion } from "./skill-shape.js";
9
9
  export function skillsSourceDir() {
@@ -16,9 +16,14 @@ export function skillsSourceDir() {
16
16
  * `onlyExisting` is the update path: it refreshes copies this package already made and creates
17
17
  * none. That is what keeps the update notice from planting a second copy of every skill beside a
18
18
  * set the customer's agent installed as a plugin.
19
+ *
20
+ * Both paths then remove a retired skill: a folder in the target that carries this bundle's
21
+ * provenance stamp but whose name this bundle no longer ships. Left in place, it keeps routing
22
+ * requests to a skill that was merged away. A folder without the stamp (a person's own skill), a
23
+ * symlink, and a folder stamped by a NEWER bundle than this one are never removed.
19
24
  */
20
- export function installSkills(targetDir, opts, sourceDir = skillsSourceDir()) {
21
- const result = { installed: [], skipped: [] };
25
+ export function installSkills(targetDir, opts, sourceDir = skillsSourceDir(), bundleVersion = readManifest().version) {
26
+ const result = { installed: [], skipped: [], removed: [] };
22
27
  if (existsSync(targetDir) && !statSync(targetDir).isDirectory()) {
23
28
  throw new Error(`${targetDir} is not a directory`);
24
29
  }
@@ -49,8 +54,43 @@ export function installSkills(targetDir, opts, sourceDir = skillsSourceDir()) {
49
54
  cpSync(src, dst, { recursive: true });
50
55
  result.installed.push(name);
51
56
  }
57
+ result.removed = removeRetiredSkills(targetDir, new Set(names.filter((n) => existsSync(join(sourceDir, n, "SKILL.md")))), bundleVersion);
52
58
  return result;
53
59
  }
60
+ /** Remove every stamped folder in `targetDir` whose name `shipped` no longer carries. */
61
+ function removeRetiredSkills(targetDir, shipped, bundleVersion) {
62
+ if (!existsSync(targetDir))
63
+ return [];
64
+ const removed = [];
65
+ for (const e of readdirSync(targetDir, { withFileTypes: true })) {
66
+ if (shipped.has(e.name))
67
+ continue;
68
+ const dir = join(targetDir, e.name);
69
+ // lstat, not the dirent alone: a symlink belongs to whoever linked it and is never followed.
70
+ if (isSymlink(dir) || !e.isDirectory())
71
+ continue;
72
+ const skillMd = join(dir, "SKILL.md");
73
+ if (!existsSync(skillMd))
74
+ continue;
75
+ let text;
76
+ try {
77
+ text = readFileSync(skillMd, "utf8");
78
+ }
79
+ catch {
80
+ continue;
81
+ }
82
+ const line = provenanceLine(text);
83
+ if (line === undefined)
84
+ continue;
85
+ const stamp = parseProvenanceVersion(line);
86
+ // A newer bundle may ship a skill this one does not know yet; an older CLI must not delete it.
87
+ if (stamp !== null && semverOlder(bundleVersion, stamp))
88
+ continue;
89
+ rmSync(dir, { recursive: true, force: true });
90
+ removed.push(e.name);
91
+ }
92
+ return removed.sort();
93
+ }
54
94
  function isSymlink(path) {
55
95
  try {
56
96
  return lstatSync(path).isSymbolicLink();
package/dist/transport.js CHANGED
@@ -32,7 +32,16 @@ export class ApiClient {
32
32
  const url = this.url(path, opts.query);
33
33
  const res = await this.send(url, { method: "GET", headers });
34
34
  if (opts.accept?.includes(res.status)) {
35
- return { status: res.status, body: undefined, headers: res.headers };
35
+ let body = undefined;
36
+ if (opts.parseAccepted) {
37
+ try {
38
+ body = (await res.json());
39
+ }
40
+ catch {
41
+ body = undefined;
42
+ }
43
+ }
44
+ return { status: res.status, body, headers: res.headers };
36
45
  }
37
46
  await this.refuseIfNotOk(res, `GET ${path}`);
38
47
  return { status: res.status, body: await this.parseBody(res, `GET ${path}`), headers: res.headers };
@@ -87,6 +96,22 @@ export class ApiClient {
87
96
  await this.refuseIfNotOk(res, `POST ${path}`);
88
97
  return { status: res.status, body: await this.parseBody(res, `POST ${path}`), headers: res.headers };
89
98
  }
99
+ /** PUT a JSON body. Same contract as {@link postJson}: `accept` lists statuses returned as replies. */
100
+ async putJson(path, body, opts = {}) {
101
+ const url = this.url(path);
102
+ const res = await this.send(url, {
103
+ method: "PUT",
104
+ headers: {
105
+ authorization: `Bearer ${await this.credential()}`,
106
+ accept: "application/json",
107
+ "content-type": "application/json",
108
+ },
109
+ body: JSON.stringify(body),
110
+ });
111
+ if (!opts.accept?.includes(res.status))
112
+ await this.refuseIfNotOk(res, `PUT ${path}`);
113
+ return { status: res.status, body: await this.parseBody(res, `PUT ${path}`), headers: res.headers };
114
+ }
90
115
  async send(url, init) {
91
116
  try {
92
117
  return await this.fetchImpl(url, { ...init, signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS) });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@catalyst-cloud/cli",
3
- "version": "0.13.0",
4
- "description": "Customer skill bundle for Catalyst Cloud, named from the executive's seat — get set up, see what is happening, see what needs you, run a project, unstick what is stuck — plus the catalyst CLI that reads through the Catalyst Cloud SDK, writes through the agent proxy, and connects your machine to your tenant with one command. The skills directory is the roster; this line never counts it.",
3
+ "version": "0.13.1",
4
+ "description": "Customer skill bundle for Catalyst Cloud, named from the executive's seat — get set up, see what is happening, see what needs you, run a project, unstick what is stuck — plus the catalyst CLI that reads through the Catalyst Cloud SDK, writes through the agent proxy, and connects your machine to your cloud account with one command. The skills directory is the roster; this line never counts it.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "publishConfig": {
@@ -45,10 +45,11 @@
45
45
  "skill-lib:sync": "node scripts/sync-skill-lib.mjs",
46
46
  "skills:scan": "node scripts/scan-skills.mjs",
47
47
  "evals": "node scripts/run-evals.mjs",
48
- "paths:check": "node scripts/vendor-paths.mjs --check"
48
+ "paths:check": "node scripts/vendor-paths.mjs --check",
49
+ "prose:check": "node scripts/check-public-prose.mjs"
49
50
  },
50
51
  "dependencies": {
51
- "@catalyst-cloud/sdk": "^0.13.0",
52
+ "@catalyst-cloud/sdk": "^0.13.1",
52
53
  "yaml": "^2.9.0"
53
54
  },
54
55
  "devDependencies": {
@@ -2,20 +2,20 @@
2
2
  name: catalyst-github
3
3
  description: >-
4
4
  Catalyst's GitHub: show a ticket's pull request with its checks, reviews and review threads, say whether it is mergeable under this repository's policy, and explain what a PR accumulates as the ticket moves (the branch, the draft, the rewrite, the force-pushes, the labels, the queue). Use when someone asks "show me the PR", "what are the checks saying", "why hasn't it merged", "what does the queue need", "what does that label mean", or wants the branch and merge conventions Catalyst follows.
5
- allowed-tools: Bash(catalyst-skills:*) Bash(npx @catalyst-cloud/catalyst-skills:*)
5
+ allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
6
6
  ---
7
- <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.13.0 — written in this repository for customer tenants -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.13.1 — written in this repository for customer accounts -->
8
8
 
9
9
  # Catalyst's GitHub
10
10
 
11
- You answer for the pull requests Catalyst opens and moves. The person asking wants to see one PR, know what is red, and know whether it will merge. Everything tenant-specific (the reviewer's login, the merge policy per repository, the four PR label names, the required checks) comes from the contract at run time and is printed by the scripts; you never restate it from memory.
11
+ You answer for the pull requests Catalyst opens and moves. The person asking wants to see one PR, know what is red, and know whether it will merge. Everything account-specific (the reviewer's login, the merge policy per repository, the four PR label names, the required checks) comes from the contract at run time and is printed by the scripts; you never restate it from memory.
12
12
 
13
13
  ## Run first
14
14
 
15
- - `node scripts/read-pr.mjs --help` — a ticket's PR (or a PR by node id): state, branch, head, linked ticket, GitHub's mergeable state, every check, status and review. `--all` lists every PR for a ticket.
16
- - `node scripts/is-it-mergeable.mjs --help` — the three legs (checks, reviewer signal, unresolved threads) judged under the repository's policy, plus the prerequisites; exit 1 when a leg is red.
15
+ - `node scripts/read-pr.mjs --help`: a ticket's PR (or a PR by node id): state, branch, head, linked ticket, GitHub's mergeable state, every check, status and review. `--all` lists every PR for a ticket.
16
+ - `node scripts/is-it-mergeable.mjs --help`: the three legs (checks, reviewer signal, unresolved threads) judged under the repository's policy, plus the prerequisites; exit 1 when a leg is red.
17
17
 
18
- Both read through `catalyst-skills query`, `contract` and, when fresh, `replica`; the first stderr line names the source, and your answer repeats it.
18
+ Both read through `catalyst query`, `contract` and, when fresh, `replica`; the first stderr line names the source, and your answer repeats it.
19
19
 
20
20
  ## Load on demand
21
21
 
@@ -26,7 +26,7 @@ Both read through `catalyst-skills query`, `contract` and, when fresh, `replica`
26
26
 
27
27
  ## Rules
28
28
 
29
- - Never compose a URL or call the API yourself. Every read is a `catalyst-skills` verb behind a script; run the script, do not read it.
29
+ - Never compose a URL or call the API yourself. Every read is a `catalyst` verb behind a script; run the script, do not read it.
30
30
  - A queue-ready label is the cloud's attestation, never a lever you apply; "merged by the queue" is the terminal signal.
31
31
  - Hold labels are the human's lever. Describe them; do not apply or remove them.
32
32
  - Say what a key cannot see by name (PR labels, the reviewer's reaction, the queue's own state); never guess it.
@@ -1,6 +1,6 @@
1
1
  # Is it mergeable?
2
2
 
3
- The rule is invariant; the policy that applies to a repository is not. The policy names, the default, each repository's resolved policy and its source (repository setting, tenant setting, or the default), the reviewer login and the required check names all come from the contract's `merge` block at run time. `node scripts/is-it-mergeable.mjs <ticket>` reads them and prints one line per leg; the text below explains what those lines mean.
3
+ The rule is invariant; the policy that applies to a repository is not. The policy names, the default, each repository's resolved policy and its source (repository setting, account setting, or the default), the reviewer login and the required check names all come from the contract's `merge` block at run time. `node scripts/is-it-mergeable.mjs <ticket>` reads them and prints one line per leg; the text below explains what those lines mean.
4
4
 
5
5
  ## Prerequisites before any leg counts
6
6
 
@@ -28,7 +28,13 @@ Three policy names are served on `merge.policies`; the default is `merge.default
28
28
  | the strict variant | a clean pass at the current head, always. Findings on an earlier head keep blocking until the reviewer looks again. |
29
29
  | checks and threads only | the reviewer requirement is dropped entirely; the two unconditional legs decide. |
30
30
 
31
- A clean pass is a reaction: a thumbs-up from the reviewer login posted at or after the head commit's own timestamp. The comment-shaped clean pass ("no major issues" in place of threads) is honoured only if `cleanPassShapes[]` says so for that kind; the script does not judge it either way.
31
+ A clean pass is one of three signals from the reviewer login, most reliable first:
32
+
33
+ 1. **A GitHub review on the exact head commit.** A review names the commit it was submitted against, so it cannot be mistaken for an earlier head.
34
+ 2. **A 👍 reaction**, which counts only if it was given after the current head commit was made. The reaction carries no commit, so the cloud compares its time with the head commit's date, and that date is set by whoever made the commit. A push of a commit made before the 👍 (a force-push back to an older commit, a commit prepared earlier) can read as covered. A normal rebase or amend stamps a fresh date, so the everyday path works.
35
+ 3. **A clean-pass comment** ("no major issues" in place of threads), honoured only if `cleanPassShapes[]` says so for that kind, with the same timing rule as the 👍.
36
+
37
+ A new push needs a fresh signal at the new head. The script judges none of these three itself.
32
38
 
33
39
  ## What the script can and cannot see
34
40
 
@@ -1,6 +1,6 @@
1
1
  # What a pull request accumulates as Catalyst moves a ticket
2
2
 
3
- Most of this page restates invariants: how Catalyst names branches, opens and rewrites pull requests, and what it pushes when. The parts that vary per tenant are read live from the contract's `merge` block and never restated here: the reviewer's login (`merge.reviewerLogin`), which clean-pass shapes are honoured (`merge.cleanPassShapes[]`), the four PR label names (`merge.prLabels`), the checks the cloud waits on (`merge.cloudRemediateRequiredChecks`, on a 1.x contract only), and the policy per repository (`merge.repositories[]`, else `merge.defaultPolicy`). `catalyst-skills contract --path merge` prints them.
3
+ How Catalyst names branches, opens and rewrites pull requests, and what it pushes when, is the same for every account. The parts that vary are read live from the contract's `merge` block and never restated here: the reviewer's login (`merge.reviewerLogin`), which clean-pass shapes are honoured (`merge.cleanPassShapes[]`), the four PR label names (`merge.prLabels`), the checks the cloud waits on (`merge.cloudRemediateRequiredChecks`, on a 1.x contract only), and the policy per repository (`merge.repositories[]`, else `merge.defaultPolicy`). `catalyst contract --path merge` prints them.
4
4
 
5
5
  ## The branch
6
6
 
@@ -29,7 +29,7 @@ Three phases rewrite history on the ticket branch: implement pushes fresh with f
29
29
 
30
30
  ## The reviewer signal
31
31
 
32
- An automated reviewer (login from the contract) reviews every PR. Its signal is one of four: clean, findings at the current head, findings at an earlier head, no review. A clean pass is a reaction, not a review object: a thumbs-up from the reviewer posted at or after the head commit's own timestamp. A second shape, a terse "no major issues" comment in place of review threads, exists as a documented convention; whether it is honoured is served on `cleanPassShapes[].honoured` and must be read there, never assumed. What counts under each policy is on `references/is-it-mergeable.md`.
32
+ An automated reviewer (login from the contract) reviews every PR. Its signal is one of four: clean, findings at the current head, findings at an earlier head, no review. A clean pass is usually a 👍 reaction from the reviewer, which counts only if it was given after the current head commit was made; a GitHub review on that exact commit is the most reliable signal. A terse "no major issues" comment in place of review threads is a documented convention; whether it is honoured is served on `cleanPassShapes[].honoured` and must be read there, never assumed. What counts under each policy is on `references/is-it-mergeable.md`.
33
33
 
34
34
  ## Labels on the PR
35
35
 
@@ -42,7 +42,7 @@ Four labels matter, all named on `merge.prLabels`, all matched exactly (a queue'
42
42
  | `handStepsHold` | the cloud, automatically | the PR touches a path the queue configuration excludes (schema or migration paths, typically), so a person has to merge it by hand. |
43
43
  | `preview` | a human | "deploy me a preview and hold the merge until I have looked". Removing the label is the approval. |
44
44
 
45
- The mirror does not carry PR labels or reactions, so your key cannot read which holds a PR carries or whether the reviewer reacted; the scripts say so by name. GitHub's own page, or the tenant's settings, is where those live.
45
+ The mirror does not carry PR labels or reactions, so your key cannot read which holds a PR carries or whether the reviewer reacted; the scripts say so by name. GitHub's own page, or the account's settings, is where those live.
46
46
 
47
47
  ## The queue is optional and opt-out
48
48
 
@@ -2,7 +2,7 @@
2
2
  // is-it-mergeable.mjs — the three legs of merge evidence for one PR (checks, reviewer signal,
3
3
  // unresolved threads) judged under the policy the tenant contract resolves for its repository, plus
4
4
  // the prerequisites a queue applies before any leg counts (open, not a draft, no conflict). Every
5
- // input comes from `catalyst-skills query`, `contract` and, when fresh, `replica sql`.
5
+ // input comes from `catalyst query`, `contract` and, when fresh, `replica sql`.
6
6
  // Exit 0 no leg is red, 1 a leg or prerequisite is red, 2 this machine is not connected.
7
7
  import { parseJson, runCli, runCliOrExit } from "./lib/cli.mjs";
8
8
  import { resolvePull, truthy } from "./lib/pull.mjs";
@@ -34,7 +34,7 @@ if (!target) {
34
34
  const { ticket, detail } = resolvePull(target);
35
35
  const merge = parseJson(runCliOrExit(["contract", "--path", "merge", "--json"]).stdout);
36
36
  if (!merge || !Array.isArray(merge.policies)) {
37
- console.error("the contract's merge block did not parse; run: catalyst-skills contract --refresh");
37
+ console.error("the contract's merge block did not parse; run: catalyst contract --refresh");
38
38
  process.exit(1);
39
39
  }
40
40
 
@@ -103,7 +103,7 @@ if (replica && replica.verdict === "fresh") {
103
103
  else if (unknown > 0) add("threads", "inconclusive", `${unknown} thread(s) with no resolved flag mirrored`);
104
104
  else add("threads", "pass", `${count(1)} thread(s), all resolved (ancestry against force-pushes is judged by the cloud, not here)`);
105
105
  } else {
106
- add("threads", "inconclusive", `the PR detail carries no thread count and the replica is ${replica?.verdict ?? "unavailable"}; start it (catalyst-skills replica start --detach) for a local read`);
106
+ add("threads", "inconclusive", `the PR detail carries no thread count and the replica is ${replica?.verdict ?? "unavailable"}; start it (catalyst replica start --detach) for a local read`);
107
107
  }
108
108
 
109
109
  const failed = legs.filter((l) => l.state === "fail");
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  // lib/cli.mjs — the one way a skill script reaches the Catalyst Cloud SDK and API: by spawning the
3
- // catalyst-skills CLI this bundle installed. It reads customer.json to find that CLI and nothing
3
+ // catalyst CLI this bundle installed. It reads customer.json to find that CLI and nothing
4
4
  // else; it never holds the key itself. This file is a library — run a sibling script with
5
5
  // --help for usage. Identical in every skill of this bundle on purpose (skills install one directory
6
6
  // at a time, so nothing shared outside the skill would ever be installed).
@@ -10,7 +10,9 @@ import { join } from "node:path";
10
10
  import { fileURLToPath } from "node:url";
11
11
  import { CONNECT_COMMAND, hasCredential } from "./credential.mjs";
12
12
 
13
- export const PACKAGE = "@catalyst-cloud/catalyst-skills";
13
+ export const PACKAGE = "@catalyst-cloud/cli";
14
+ /** The package ships two commands, so npx needs the one to run named: `npx -p <package> catalyst`. */
15
+ export const NPX_ARGS = ["-p", PACKAGE, "catalyst"];
14
16
  export const CONNECT_HINT = `this machine is not connected to a tenant yet — run: ${CONNECT_COMMAND}`;
15
17
 
16
18
  /** ~/.config/catalyst-cloud/customer.json, honouring CATALYST_SKILLS_HOME before HOME. */
@@ -41,15 +43,15 @@ export function requireCustomerConfig() {
41
43
  }
42
44
 
43
45
  /**
44
- * Run one catalyst-skills verb and return {code, stdout, stderr}. Spawns the CLI whose path the
45
- * connect step recorded in customer.json; falls back to `npx @catalyst-cloud/catalyst-skills` when
46
+ * Run one catalyst verb and return {code, stdout, stderr}. Spawns the CLI whose path the
47
+ * connect step recorded in customer.json; falls back to `npx -p @catalyst-cloud/cli catalyst` when
46
48
  * no path is recorded or it no longer exists. Exits 2 when the machine is not connected.
47
49
  */
48
50
  export function runCli(args, opts = {}) {
49
51
  const cfg = requireCustomerConfig();
50
52
  const recorded = typeof cfg.cliPath === "string" && existsSync(cfg.cliPath);
51
53
  const command = recorded ? process.execPath : process.platform === "win32" ? "npx.cmd" : "npx";
52
- const argv = recorded ? [cfg.cliPath, ...args] : [PACKAGE, ...args];
54
+ const argv = recorded ? [cfg.cliPath, ...args] : [...NPX_ARGS, ...args];
53
55
  const res = spawnSync(command, argv, {
54
56
  encoding: "utf8",
55
57
  input: opts.stdin,
@@ -58,7 +60,7 @@ export function runCli(args, opts = {}) {
58
60
  shell: !recorded && process.platform === "win32",
59
61
  });
60
62
  if (res.error) {
61
- console.error(`could not run ${recorded ? cfg.cliPath : `npx ${PACKAGE}`}: ${res.error.message}`);
63
+ console.error(`could not run ${recorded ? cfg.cliPath : `npx -p ${PACKAGE} catalyst`}: ${res.error.message}`);
62
64
  process.exit(2);
63
65
  }
64
66
  return { code: res.status ?? 1, stdout: res.stdout ?? "", stderr: res.stderr ?? "" };
@@ -72,7 +74,7 @@ export function runCli(args, opts = {}) {
72
74
  export function runCliOrExit(args, opts = {}) {
73
75
  const res = runCli(args, opts);
74
76
  if (res.code === 0) return res;
75
- const why = res.stderr.trim() || res.stdout.trim() || `catalyst-skills ${args.join(" ")} exited ${res.code}`;
77
+ const why = res.stderr.trim() || res.stdout.trim() || `catalyst ${args.join(" ")} exited ${res.code}`;
76
78
  console.error(why);
77
79
  process.exit(res.code === 2 ? 2 : 1);
78
80
  }
@@ -6,12 +6,12 @@
6
6
  //
7
7
  // customer.json carries exactly one credential: a personal key (`key`), or the keyless login's
8
8
  // session (`auth`, the recommended rail). A script never reads either for its value: it spawns the
9
- // catalyst-skills CLI, which authenticates with whichever is present and refreshes a login's token
9
+ // catalyst CLI, which authenticates with whichever is present and refreshes a login's token
10
10
  // itself. A new credential kind lands here, once.
11
11
 
12
12
  /** The command that connects this machine, as every not-connected line names it. */
13
13
  export const CONNECT_COMMAND =
14
- "npx @catalyst-cloud/catalyst-skills login (or, with a personal key: CATALYST_CLOUD_TOKEN=<your personal key> npx @catalyst-cloud/catalyst-skills login)";
14
+ "npx -p @catalyst-cloud/cli catalyst login (or, with a personal key: CATALYST_CLOUD_TOKEN=<your personal key> npx -p @catalyst-cloud/cli catalyst login)";
15
15
 
16
16
  /** True when `cfg` (parsed customer.json) holds a usable credential of either kind. Never throws. */
17
17
  export function hasCredential(cfg) {
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  // read-pr.mjs — one ticket's pull request (or one PR by node id) as the mirror holds it: state,
3
3
  // branch, head, base, linked ticket and its stage, GitHub's own mergeable verdict, every check,
4
- // review and commit status. Reads through `catalyst-skills query`; composes no URL.
4
+ // review and commit status. Reads through `catalyst query`; composes no URL.
5
5
  import { linkedPulls, resolvePull, truthy } from "./lib/pull.mjs";
6
6
 
7
7
  const HELP = `Usage: node scripts/read-pr.mjs <ticket | pr-node-id> [--all] [--json]
8
8
 
9
9
  <ticket> a ticket identifier such as ABC-123: its open PR is shown (else the merged one, else the newest)
10
- <pr-node-id> a GitHub pull-request node id, as printed by "catalyst-skills query pulls"
10
+ <pr-node-id> a GitHub pull-request node id, as printed by "catalyst query pulls"
11
11
  --all for a ticket: list every PR that names it instead of one detail
12
12
  --json print the raw detail document instead of the summary
13
13
 
@@ -1,26 +1,25 @@
1
1
  ---
2
2
  name: catalyst-linear
3
3
  description: >-
4
- Catalyst's view of Linear on the customer's own tenant. Reads a ticket with its comments, relations, labels, linked pull requests and agent sessions inline, from the local replica when it is fresh and the origin-fresh API otherwise, always naming the source; searches tickets, PRs, projects and initiatives; writes comments, card moves, labels and new tickets through the tenant's agent proxy as the app actor, with every route, stage id, label id and marker read from the tenant contract. Knows what a ticket accumulates as Catalyst works it (phase-outcome comments, the document per phase, the agent session, the labels, the single blocks relation, the bookkeeping marker, the eyes acknowledgement). Use when a person says "show me the ticket", "what did Catalyst write on it", "comment on it", "move it", "label it" or "file a ticket". Not for raising a decision for a human (what-needs-me) and not for pull requests (catalyst-github).
5
- allowed-tools: Bash(catalyst-skills:*) Bash(npx @catalyst-cloud/catalyst-skills:*)
6
- disable-model-invocation: true
4
+ Catalyst's view of Linear on the customer's own cloud account. Reads a ticket with its comments, relations, labels, linked pull requests and agent sessions inline, from the local replica when it is fresh and the origin-fresh API otherwise, always naming the source; searches tickets, PRs, projects and initiatives; writes comments, card moves, labels and new tickets through the account's agent proxy as the app actor, with every route, stage id, label id and marker read from the account's contract. Knows what a ticket accumulates as Catalyst works it (phase-outcome comments, the document per phase, the agent session, the labels, the single blocks relation, the bookkeeping marker, the eyes acknowledgement). Use when a person says "show me the ticket", "what did Catalyst write on it", "comment on it", "move it", "label it" or "file a ticket". Not for raising a decision for a human (what-needs-me) and not for pull requests (catalyst-github).
5
+ allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
7
6
  ---
8
- <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.13.0 — written in this repository for customer tenants -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.13.1 — written in this repository for customer accounts -->
9
8
 
10
9
  # Catalyst Linear
11
10
 
12
- You read tickets and write to them on the customer's tenant, as Catalyst. Reads come from the replica when it is fresh, else from the API, and every read names its source. Writes go through the tenant's agent proxy as the app actor, with routes, stage ids, label ids and the bookkeeping marker resolved from the tenant contract by the `catalyst-skills` CLI. You never compose a URL, never name a stage by its display name, and never quote a label id or marker from memory.
11
+ You read tickets and write to them in the person's cloud account, as Catalyst. Reads come from the replica when it is fresh, else the API, and name their source. Writes go out as the app actor, with routes, stage ids, label ids and the bookkeeping marker resolved from the contract by the `catalyst` CLI.
13
12
 
14
13
  ## Run first
15
14
 
16
- Run each with `--help` first; scripts are executed, never read.
15
+ Scripts are run, never read; each prints `--help`.
17
16
 
18
- - `node scripts/read-ticket.mjs <ticket> [--comments]` — one ticket, everything inline, source line on stderr.
19
- - `node scripts/search.mjs <terms>` — tickets, PRs, projects, initiatives matching the terms.
20
- - `node scripts/comment.mjs <ticket> --body <text> [--parent <id>] [--bookkeeping]` — a comment as the app actor; a machine record takes `--bookkeeping`.
21
- - `node scripts/move.mjs <ticket> --slot <slot>` — a card move by slot (`--state-type backlog` parks).
22
- - `node scripts/label.mjs <ticket> --add <name> --remove <name>` — labels, resolved through the contract.
23
- - `node scripts/create-ticket.mjs --team <key> --title <text> [--description <text> | --stdin]` — a new ticket; cite its identifier only after it prints.
17
+ - `node scripts/read-ticket.mjs <ticket> [--comments]`: one ticket, everything inline, source line on stderr.
18
+ - `node scripts/search.mjs <terms>`: tickets, PRs, projects, initiatives matching the terms.
19
+ - `node scripts/comment.mjs <ticket> --body <text> [--parent <id>] [--bookkeeping]`: a comment as the app actor.
20
+ - `node scripts/move.mjs <ticket> --slot <slot>`: a card move by slot (`--state-type backlog` parks).
21
+ - `node scripts/label.mjs <ticket> --add <name> --remove <name>`: labels, resolved through the contract.
22
+ - `node scripts/create-ticket.mjs --team <key> --title <text> [--description <text> | --stdin]`: a new ticket; cite its identifier only after it prints.
24
23
 
25
24
  Exit codes: 0 done, 1 not found or a usage error, 2 this machine is not connected or the write was refused (budget spent, slot unmapped, label absent; the one line printed says which).
26
25
 
@@ -34,10 +33,9 @@ Exit codes: 0 done, 1 not found or a usage error, 2 this machine is not connecte
34
33
 
35
34
  ## Rules
36
35
 
37
- - **Read before acting.** Never summarise a ticket from its title; read the description and the thread. Cite identifiers and comment ids only after a script printed them.
38
- - **Name the source.** Quote the source line when freshness matters; a stale replica is never read silently, because the CLI falls back to the API and says so.
39
- - **Reply where it arrived, as Catalyst.** Thread under the comment you answer (`--parent`); never post as the human.
40
- - **Records carry the marker.** A merge note, a state-move log, a chain summary: `--bookkeeping`, so it never reads as a human turn. A real question is not bookkeeping.
41
- - **Move by slot, label by contract.** A stage name is display; the id is the authority, and the CLI resolves both. Moving to `dispatch` dispatches; the backlog-type state parks.
42
- - **A decision is an ask, not a ticket.** Raise it through `what-needs-me` with options, a default and what it blocks; a question filed as a ticket is held out of dispatch by shape.
43
- - **One write per need, no loops.** Writes spend a daily budget the contract names; batch, and report a refusal rather than retrying.
36
+ - **Read before acting.** Read the description and the thread, never just the title. Cite identifiers and comment ids only after a script printed them, and quote the source line when freshness matters.
37
+ - **Reply where it arrived, as Catalyst.** Thread under the comment you answer (`--parent`); the human speaks for themselves.
38
+ - **Records carry the marker.** A merge note, a state-move log, a chain summary: `--bookkeeping`. A real question is not bookkeeping.
39
+ - **Move by slot, label by contract.** Moving to `dispatch` dispatches; the backlog-type state parks.
40
+ - **A decision is an ask, not a ticket.** Raise it through `what-needs-me`; a question filed as a ticket is held out of dispatch by shape.
41
+ - **One write per need.** Every write is visible in the person's Linear and spends the contract's daily budget; batch, and report a refusal once. A move into dispatch starts paid work on a coding account.
@@ -3,4 +3,4 @@ interface:
3
3
  short_description: "Read a ticket and what Catalyst wrote on it; comment, move, label and file tickets as the app actor"
4
4
  default_prompt: "Use $catalyst-linear to show me the ticket, its history, and what Catalyst wrote on it."
5
5
  policy:
6
- allow_implicit_invocation: false
6
+ allow_implicit_invocation: true
@@ -1,5 +1,5 @@
1
1
  identity: { pack: catalyst-cloud-skills, skill: catalyst-linear }
2
2
  effects: [external-write]
3
3
  mutating: true
4
- invocation: explicit
4
+ invocation: implicit
5
5
  exposure: [catalog]
@@ -1,24 +1,20 @@
1
1
  # Reading a ticket: freshness first, then the row
2
2
 
3
- This reference restates invariants about how a read is made and reported. Nothing in it is a tenant value.
4
-
5
3
  ## Freshness first
6
4
 
7
5
  Every `query` verb, and therefore `node scripts/read-ticket.mjs` and `node scripts/search.mjs`, prints one stderr line before the answer:
8
6
 
9
- - `source: replica (cursor N)` — the local replica was fresh (its writer heartbeat is young and its cursor non-empty), so the answer is local and cheap. N is the position it had applied.
10
- - `source: api (replica stale)`, `source: api (replica absent)` or `source: api (replica not configured)` — the answer came from the tenant API, which is origin-fresh: it reflects the mirror's latest ingest, not a cached copy.
11
- - `source: api (<verb> is api-only)` — search, cycles, pull detail and change feeds are never served from the replica.
7
+ - `source: replica (cursor N)`: the local replica was fresh, so the answer is local and cheap.
8
+ - `source: api (replica stale|absent|not configured)`: the answer came from the origin-fresh cloud API; a stale replica always falls back.
9
+ - `source: api (<verb> is api-only)`: search, cycles, pull detail and change feeds never come from the replica.
12
10
 
13
- Read that line every time. A fresh replica is a preference; the API is the fallback and it is never wrong to read it. What is wrong is silently reading a stale replica, and the CLI does not let that happen: a stale replica falls back to the API and says so. Quote the source in your answer when the freshness of a fact matters ("as of the replica at cursor N" or "from the API just now").
11
+ Quote the source when a fact's freshness matters ("as of the replica at cursor N", "from the API just now").
14
12
 
15
13
  `--source replica` or `--source api` forces one. Forcing the replica when it is absent or stale is refused.
16
14
 
17
15
  ## Then the row
18
16
 
19
- One ticket read returns the whole record: the fields, the description, `labels[]`, `relations[]`, `linked_pulls[]`, `comments[]`, `activity[]` and `agent_sessions[]` inline, plus the project, cycle, team, delegate and parent fields. One call answers "what is this ticket, what happened on it, what is it waiting on, which PR is it". There is no second call to make for the comments.
20
-
21
- The summary the script prints puts the counts first and the description last; `--comments` prints every comment with its id, author, time and whether the author is a bot. A comment with a `reply-to` marker is threaded under another; reply under the same parent when you answer it.
17
+ One read returns the whole record inline: fields, description, `labels[]`, `relations[]`, `linked_pulls[]`, `comments[]`, `activity[]` and `agent_sessions[]`, plus project, cycle, team, delegate and parent. `--comments` prints every comment with its id, author, time and bot flag; a comment with a `reply-to` marker is threaded, so reply under the same parent.
22
18
 
23
19
  ## Reading Catalyst's own writes
24
20
 
@@ -28,25 +24,12 @@ The comment shapes in `references/what-a-ticket-accumulates.md` tell you which c
28
24
  2. Remediate-attempt comments give the failure class each round repaired.
29
25
  3. The projection-link comments name the documents; open the document (it is attached to the ticket) to read what a phase actually concluded. A fallback comment carries the body inline instead.
30
26
  4. `linked_pulls[]` names the PR; `catalyst-github` reads it.
31
- 5. For "what will it do next", leave this skill: `how-catalyst-works` explains the eligibility row.
32
-
33
- ## When to read a transcript
34
-
35
- A phase's transcript (the full session log) exists in the cloud per ticket, but this bundle has no verb for it yet. Read the artifact document first; it is the phase's own account of what it did. Reach for the transcript only when the document leaves the question open, and say that the bundle cannot fetch it so the human opens it from the ticket's attachments.
27
+ 5. For "what will it do next", leave this skill: `whats-happening` explains the eligibility row.
36
28
 
37
- ## What the ledger adds to the comments
29
+ The attempt ledger, the round count against the cap, and park state come from `catalyst explain --history <ticket>`; read the count there rather than reconstructing it from comments. A phase's full transcript has no verb in this bundle: read the artifact document first, and if it leaves the question open, say the human can open the transcript from the ticket.
38
30
 
39
- Per-ticket execution history beyond the comments (the attempt ledger, the remediation round count against the cap, park state and what releases it) is `catalyst-skills explain --history <ticket>`, read from the cloud's own relay ledger. Do not reconstruct a round count from comments and present it as the cap's count; read it.
40
-
41
- ## How to cite
42
-
43
- - Cite a ticket by its identifier (`KEY-123`), never by title alone, and only after you read it back from a script's output.
44
- - Cite a comment by its id when you refer to it or reply under it.
45
- - Cite a document by the title the projection comment gave it.
46
- - Never summarise a ticket from its title. Read the description and the thread.
31
+ Cite a ticket by its identifier (`KEY-123`), a comment by its id, and a document by the title its projection comment gave it.
47
32
 
48
33
  ## Searching and listing
49
34
 
50
- `node scripts/search.mjs <terms>` matches ticket identifiers and titles, PR titles, project and initiative names and returns a few of each. It is the only search; a list read with a filter is not a search and will hand back the ordinary first page, which reads as a false "not found". Lists (`catalyst-skills query issues --team <key>`, `query projects`, `query cycles`) are for a board view, not for finding one ticket.
51
-
52
- A list verb now says when the cloud cut it short: without `--all`, `query issues`/`query pulls` print `truncated at N of M` on stderr the moment a scope holds more than one page. `query issues --all` and `query pulls --all` follow the cloud's page cursor to the end of the scope instead of stopping at the first page — use `--all` when the count, not just a sample, has to be right.
35
+ `node scripts/search.mjs <terms>` matches identifiers, titles, PR titles, and project and initiative names. It is the only search: a filtered list hands back its first page, which reads as a false "not found". Lists (`catalyst query issues --team <key>`, `query projects`, `query cycles`) are board views. A list cut short prints `truncated at N of M` on stderr; `query issues --all` and `query pulls --all` follow the page cursor to the end, for when the count has to be right.
@@ -1,6 +1,6 @@
1
1
  # What a ticket accumulates as Catalyst works it
2
2
 
3
- This reference restates invariants: the shapes of what the cloud writes onto a ticket. The one live value it needs — the bookkeeping marker and the label names — is on the contract under `vocabulary` and `teams[].labels`; print them with `catalyst-skills contract --path vocabulary` and `catalyst-skills contract --path teams`. Never quote a marker or a label id from memory.
3
+ The shapes of what the cloud writes onto a ticket are the same for every account. The live values (the bookkeeping marker and the label names) are on the contract under `vocabulary` and `teams[].labels`; print them with `catalyst contract --path vocabulary` and `catalyst contract --path teams`. Never quote a marker or a label id from memory.
4
4
 
5
5
  ## Comments the cloud posts
6
6
 
@@ -18,7 +18,7 @@ Every one of these is posted by the app actor and is skipped by the comment-wake
18
18
 
19
19
  ## One document per phase, attached
20
20
 
21
- Each artifact-bearing phase (research, plan, implement, validate, pr, remediate) projects its artifact into Linear as a document at a deterministic id, titled `<TICKET> · <phase> · attempt <n> · <YYYY-MM-DD>`, attached to the ticket, and announced by the projection-link comment above. Research and plan documents on a ticket that belongs to a project are also linked from the project. The same body is committed into the tenant's thoughts repository when one is configured. Reading the document is how you read what a phase concluded; the phase-outcome comment only summarises it.
21
+ Each artifact-bearing phase (research, plan, implement, validate, pr, remediate) projects its artifact into Linear as a document at a deterministic id, titled `<TICKET> · <phase> · attempt <n> · <YYYY-MM-DD>`, attached to the ticket, and announced by the projection-link comment above. Research and plan documents on a ticket that belongs to a project are also linked from the project. The same body is committed into the account's thoughts repository when one is configured. Reading the document is how you read what a phase concluded; the phase-outcome comment only summarises it.
22
22
 
23
23
  ## The agent session
24
24