@catalyst-cloud/cli 0.15.5 → 0.15.6
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.
- package/CHANGELOG.md +4 -0
- package/dist/onboard-next.js +7 -1
- package/dist/onboard-readiness-fresh.js +32 -0
- package/dist/onboard-ready.js +3 -2
- package/dist/onboard-runtime.js +5 -1
- package/dist/onboard-ui.js +29 -10
- package/dist/onboard-values.js +131 -26
- package/dist/onboard.js +15 -1
- package/dist/ready-copy.js +2 -2
- package/dist/setup-onboard-copy.js +61 -40
- package/package.json +1 -1
- package/skills/catalyst-github/SKILL.md +1 -1
- package/skills/catalyst-linear/SKILL.md +1 -1
- package/skills/catalyst-onboard/SKILL.md +1 -1
- package/skills/run-this-project/SKILL.md +1 -1
- package/skills/unstick/SKILL.md +1 -1
- package/skills/what-needs-me/SKILL.md +1 -1
- package/skills/what-this-repo-needs/SKILL.md +1 -1
- package/skills/whats-happening/SKILL.md +1 -1
package/CHANGELOG.md
CHANGED
package/dist/onboard-next.js
CHANGED
|
@@ -147,7 +147,7 @@ const REASONS = {
|
|
|
147
147
|
linear_workspace_permissions_unverified: "The workspace's Linear connection works, but its granted scopes could not be checked. Run catalyst onboard to try again.",
|
|
148
148
|
linear_personal_scope_outdated: "Your personal Linear connection is missing scopes this version needs. Re-authorize it from Connected accounts, then run catalyst onboard.",
|
|
149
149
|
personal_permissions_unverified: "Your personal connection's granted scopes could not be checked. Run catalyst onboard to try again.",
|
|
150
|
-
required_values_unverified: "Catalyst
|
|
150
|
+
required_values_unverified: "Setup couldn't get a current readiness check for this team from Catalyst, so it can't tell whether the repositories' values are set. Run catalyst ready to check.",
|
|
151
151
|
first_ticket_team_unverified: "Setup could not confirm the selected Linear team. Run catalyst setup again.",
|
|
152
152
|
first_ticket_dispatch_unmapped: "Catalyst does not know which of the team's stages starts its work yet. Set up the team's Catalyst workflow, then run catalyst setup again.",
|
|
153
153
|
housekeeping_service_unverified: "The daily update needs a user service manager, launchd on macOS or systemd --user on Linux. Setup cannot schedule it on this computer. It is optional, and work does not depend on it.",
|
|
@@ -435,6 +435,12 @@ export function onboardReasonText(step, context = {}) {
|
|
|
435
435
|
}
|
|
436
436
|
if (reason === "runner_admission_operator")
|
|
437
437
|
return `The admission policy for team ${onboardTeamKey(context.journal) ?? "<TEAM KEY>"} needs a Catalyst operator to check it. Setup changes only restricted admission and preserves existing policy fields. Ask Catalyst support to confirm a compatible policy, then run the same setup command.`;
|
|
438
|
+
// CTC-4744: the cloud has not read the settings yet. Setup already waited a minute; this is
|
|
439
|
+
// the cloud's work, not the person's.
|
|
440
|
+
if (reason === "required_values_unread") {
|
|
441
|
+
const which = typeof step.evidence?.repositories === "string" ? step.evidence.repositories : "this team's repositories";
|
|
442
|
+
return `Catalyst hasn't finished reading the settings of ${which}, so it can't check the values yet. You don't need to do anything: Catalyst does this on its own, and catalyst ready shows when it's done.`;
|
|
443
|
+
}
|
|
438
444
|
if (reason === "required_values_missing") {
|
|
439
445
|
let facts;
|
|
440
446
|
try {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// CTC-4744: the team's readiness verdict in the contract lasts five minutes, and the contract never
|
|
2
|
+
// recomputes it. Only a readiness read does. Setup asks for that read before it judges a team, so
|
|
3
|
+
// the end of setup and `catalyst ready` read the same current verdict.
|
|
4
|
+
import { normalizeBaseUrl } from "./config.js";
|
|
5
|
+
import { loadContract } from "./contract.js";
|
|
6
|
+
const READ_THROUGH_TIMEOUT_MS = 30_000;
|
|
7
|
+
/** Ask the cloud to bring each team's verdict up to date, then read the contract past its cache.
|
|
8
|
+
* The read-through's own answer is not trusted: the contract it refreshes is the evidence. A cloud
|
|
9
|
+
* without the route, or any failure here, leaves the verdict as it was. */
|
|
10
|
+
export async function loadFreshTeamContract(ctx, cfg, teamIds, signal, timeoutMs = READ_THROUGH_TIMEOUT_MS) {
|
|
11
|
+
const expiry = cfg.auth ? Date.parse(cfg.auth.expiresAt) - ctx.now().getTime() : 0;
|
|
12
|
+
const bearer = cfg.key ||
|
|
13
|
+
(cfg.auth && Number.isFinite(expiry) && expiry > 30_000 ? cfg.auth.accessToken : undefined);
|
|
14
|
+
if (bearer)
|
|
15
|
+
for (const id of new Set(teamIds)) {
|
|
16
|
+
if (signal?.aborted)
|
|
17
|
+
break;
|
|
18
|
+
const deadline = AbortSignal.timeout(timeoutMs);
|
|
19
|
+
try {
|
|
20
|
+
const response = await ctx.fetch(`${normalizeBaseUrl(cfg.baseUrl)}/api/v1/agent/tenant/readiness?team=${encodeURIComponent(id)}`, {
|
|
21
|
+
redirect: "error",
|
|
22
|
+
signal: signal ? AbortSignal.any([signal, deadline]) : deadline,
|
|
23
|
+
headers: { authorization: `Bearer ${bearer}`, accept: "application/json" },
|
|
24
|
+
});
|
|
25
|
+
await response.body?.cancel().catch(() => { });
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
// Unreachable or refused: the contract read below decides.
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return loadContract(ctx, cfg, { refresh: true, signal });
|
|
32
|
+
}
|
package/dist/onboard-ready.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loadConfig } from "./config.js";
|
|
2
|
-
import {
|
|
2
|
+
import { loadFreshTeamContract } from "./onboard-readiness-fresh.js";
|
|
3
3
|
import { ONBOARD_DEFERRED_STEPS, onboardRequiredStepsWaiting, } from "./onboard.js";
|
|
4
4
|
const evidenceNames = new Set(["account", "membershipId", "project", "team", "repository", "count", "checkedAt", "expiresAt", "revision", "lag", "cursor", "heartbeatAgeMs", "supervised", "available", "validated", "phaseStarted", "linearComment", "fleetActivity"]);
|
|
5
5
|
const slug = (value) => value && /^[a-z][a-z0-9_]{1,63}$/.test(value) ? value : undefined;
|
|
@@ -98,7 +98,8 @@ export async function observeCloudOnboarding(ctx, scope = {}) {
|
|
|
98
98
|
const cfg = loadConfig(ctx.home);
|
|
99
99
|
if (!cfg?.user)
|
|
100
100
|
return { checks: [{ id: "signin", state: "fail", required: true, reason: "personal_login_required" }], work: { state: "unknown" } };
|
|
101
|
-
|
|
101
|
+
// CTC-4744: ask for each team's verdict fresh, the same read `catalyst setup`'s values step makes.
|
|
102
|
+
const { doc, source } = await loadFreshTeamContract(ctx, cfg, scope.teamIds ?? []);
|
|
102
103
|
if (source === "cache")
|
|
103
104
|
return { checks: [{ id: "cloud.setup", state: "unknown", required: true, reason: "cloud_observation_unavailable" }], work: { state: "unknown" } };
|
|
104
105
|
const checks = [];
|
package/dist/onboard-runtime.js
CHANGED
|
@@ -339,7 +339,11 @@ export function createOnboardRuntime(args, ctx, hooks) {
|
|
|
339
339
|
},
|
|
340
340
|
},
|
|
341
341
|
housekeeping: onboardHousekeepingAdapter(hooks.scheduler),
|
|
342
|
-
|
|
342
|
+
// CTC-4744: a settings read the cloud has not finished is waited on here, on one line.
|
|
343
|
+
values: onboardValuesAdapter({
|
|
344
|
+
message: (text) => hooks.ui?.note ? hooks.ui.note(text) : hooks.ui ? hooks.ui.message(text) : ctx.stderr(text),
|
|
345
|
+
sleep: hooks.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms))),
|
|
346
|
+
}),
|
|
343
347
|
// Only a person at a terminal picks a ticket; --yes, JSON and headless runs leave it waiting.
|
|
344
348
|
"first-ticket": onboardFirstTicketAdapter(interactiveWait && hooks.ui?.chooseFirstTicket
|
|
345
349
|
? {
|
package/dist/onboard-ui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { COMPUTER_CHECKS, standalonePlan, standalonePlanNotes, pendingContinuation, } from "./onboard-standalone-copy.js";
|
|
2
2
|
import { trackedPrompt } from "./setup-prompt-frame.js";
|
|
3
3
|
import { createOnboardInterrupts } from "./onboard-interrupts.js";
|
|
4
|
-
import { setupStepView, CONNECTION_REPAIR_REASONS, setupFinalScreen, setupBrowserInstruction, setupCommandWords as say, setupWaitsOnAdmin, TIMED_OUT_REASONS, setupPartHeading, setupPartProgress, setupTrackerRows, SETUP_PART_NUMBERS, SETUP_PART_OF, SETUP_PARTS, } from "./setup-onboard-copy.js";
|
|
4
|
+
import { CLOUD_WORK, setupStepView, CONNECTION_REPAIR_REASONS, setupFinalScreen, setupBrowserInstruction, setupCommandWords as say, setupWaitsOnAdmin, TIMED_OUT_REASONS, setupPartHeading, setupPartProgress, setupTrackerRows, SETUP_PART_NUMBERS, SETUP_PART_OF, SETUP_PARTS, } from "./setup-onboard-copy.js";
|
|
5
5
|
import { createOnboardProgress, } from "./onboard-progress.js";
|
|
6
6
|
import { CREATE_TEAM_CHOICE, suggestTeamKey, teamKeyProblem, teamNameProblem, } from "./onboard-team-create.js";
|
|
7
7
|
import { FIRST_TICKET_SAMPLE, FIRST_TICKET_SKIP, } from "./onboard-first-ticket.js";
|
|
@@ -260,8 +260,11 @@ export function createClackOnboardUi(prompts, streams, deps = {}) {
|
|
|
260
260
|
return `Open ${connectWaits.get(action.id)} and ${what}.`;
|
|
261
261
|
};
|
|
262
262
|
const live = screen.actions.filter((action) => step(action.id).reason !== "interrupted");
|
|
263
|
-
|
|
264
|
-
const
|
|
263
|
+
// CTC-4744: what only the cloud's own work holds up is neither the person's nor an admin's.
|
|
264
|
+
const working = live.filter((action) => CLOUD_WORK.has(step(action.id).reason ?? ""));
|
|
265
|
+
const theirs = live.filter((action) => !working.includes(action) &&
|
|
266
|
+
setupWaitsOnAdmin(step(action.id), journal));
|
|
267
|
+
const mine = live.filter((action) => !theirs.includes(action) && !working.includes(action));
|
|
265
268
|
// Steps only an owner or admin can do, less any already listed as their task above.
|
|
266
269
|
const skipped = journal.steps.filter((s) => s.reason === "member_scope" &&
|
|
267
270
|
setupWaitsOnAdmin(s, journal) &&
|
|
@@ -278,7 +281,7 @@ export function createClackOnboardUi(prompts, streams, deps = {}) {
|
|
|
278
281
|
: waiting
|
|
279
282
|
? "Next: run catalyst setup once they have."
|
|
280
283
|
: "Next: run catalyst setup to check again.";
|
|
281
|
-
return { screen, mine, theirs, skipped, waiting, next, text, live };
|
|
284
|
+
return { screen, mine, theirs, working, skipped, waiting, next, text, live };
|
|
282
285
|
};
|
|
283
286
|
const summary = (journal) => {
|
|
284
287
|
const sorted = sortActions(journal);
|
|
@@ -299,6 +302,11 @@ export function createClackOnboardUi(prompts, streams, deps = {}) {
|
|
|
299
302
|
if (screen.more)
|
|
300
303
|
renderer.line(`and ${screen.more} more after these`);
|
|
301
304
|
}
|
|
305
|
+
if (sorted.working.length) {
|
|
306
|
+
renderer.line("Still in progress, nothing for you to do:");
|
|
307
|
+
for (const action of sorted.working)
|
|
308
|
+
renderer.item("· ", sorted.text(action));
|
|
309
|
+
}
|
|
302
310
|
if (sorted.waiting) {
|
|
303
311
|
renderer.line("Waiting on an owner or admin of your Catalyst workspace:");
|
|
304
312
|
for (const action of theirs)
|
|
@@ -894,22 +902,33 @@ export function createClackOnboardUi(prompts, streams, deps = {}) {
|
|
|
894
902
|
}
|
|
895
903
|
},
|
|
896
904
|
async checkAgain(journal) {
|
|
905
|
+
const sorted = sortActions(journal);
|
|
897
906
|
if (!renderer ||
|
|
898
907
|
!interactive ||
|
|
899
908
|
abort.signal.aborted ||
|
|
900
|
-
!
|
|
909
|
+
(!sorted.mine.length && !sorted.working.length))
|
|
901
910
|
return false;
|
|
902
911
|
active = false;
|
|
903
912
|
summary(journal);
|
|
904
913
|
summaryShown = true;
|
|
914
|
+
// CTC-4744: one question, about one thing. When the person has something to do, checking
|
|
915
|
+
// again is for after they do it; when only the cloud is working, it is a wait.
|
|
916
|
+
const yours = sorted.mine.length > 0;
|
|
905
917
|
const answer = await select({
|
|
906
918
|
...options,
|
|
907
|
-
message:
|
|
919
|
+
message: yours
|
|
920
|
+
? `Check again once ${sorted.mine.length === 1 ? "that's" : "those are"} done?`
|
|
921
|
+
: "Catalyst is still reading the repositories' settings. Wait for it?",
|
|
908
922
|
initialValue: "again",
|
|
909
|
-
options:
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
923
|
+
options: yours
|
|
924
|
+
? [
|
|
925
|
+
{ value: "again", label: "Check again now" },
|
|
926
|
+
{ value: "stop", label: "Finish now; run catalyst setup later to check again" },
|
|
927
|
+
]
|
|
928
|
+
: [
|
|
929
|
+
{ value: "again", label: "Wait and check again (about 1 minute)" },
|
|
930
|
+
{ value: "stop", label: "Finish now; check later with catalyst ready" },
|
|
931
|
+
],
|
|
913
932
|
}, true);
|
|
914
933
|
if (prompts.isCancel(answer)) {
|
|
915
934
|
abort.abort();
|
package/dist/onboard-values.js
CHANGED
|
@@ -1,47 +1,152 @@
|
|
|
1
1
|
import { loadConfig } from "./config.js";
|
|
2
|
-
import { loadContract } from "./contract.js";
|
|
3
2
|
import { selectedOnboardTeam } from "./onboard-existing.js";
|
|
3
|
+
import { loadFreshTeamContract } from "./onboard-readiness-fresh.js";
|
|
4
4
|
import { valuesFacts } from "./ready-copy.js";
|
|
5
5
|
const waiting = (reason, evidence) => ({
|
|
6
6
|
state: "waiting",
|
|
7
7
|
reason,
|
|
8
8
|
...(evidence ? { evidence } : {}),
|
|
9
9
|
});
|
|
10
|
+
/** How long setup waits for the cloud to read a repository's settings, and how often it looks. */
|
|
11
|
+
export const VALUES_WAIT_MS = 60_000;
|
|
12
|
+
const VALUES_POLL_MS = 10_000;
|
|
13
|
+
/** While waiting, one slow read-through can't stretch "up to 1 minute". */
|
|
14
|
+
const WAIT_READ_TIMEOUT_MS = 10_000;
|
|
15
|
+
/** The repositories a team's verdict covers, by name, for the one waiting line. */
|
|
16
|
+
function teamRepositories(team, check) {
|
|
17
|
+
const fromCheck = check ? (valuesFacts(check).repos ?? []).map((row) => row.repo) : [];
|
|
18
|
+
if (fromCheck.length)
|
|
19
|
+
return fromCheck;
|
|
20
|
+
const registered = team?.repositories
|
|
21
|
+
?.registered;
|
|
22
|
+
return Array.isArray(registered)
|
|
23
|
+
? registered.filter((name) => typeof name === "string")
|
|
24
|
+
: [];
|
|
25
|
+
}
|
|
26
|
+
function named(repositories) {
|
|
27
|
+
if (!repositories.length)
|
|
28
|
+
return "this team's repositories";
|
|
29
|
+
if (repositories.length === 1)
|
|
30
|
+
return repositories[0];
|
|
31
|
+
return `${repositories[0]} and ${repositories.length - 1} more`;
|
|
32
|
+
}
|
|
10
33
|
/** The selected team's `required_values` readiness check decides this step. It passes when the
|
|
11
34
|
* selected repositories declare no required value, or every one has a value. Nothing here reads,
|
|
12
|
-
* imports or prints a value: a missing one is named, with the page where it is set.
|
|
13
|
-
*
|
|
14
|
-
|
|
35
|
+
* imports or prints a value: a missing one is named, with the page where it is set.
|
|
36
|
+
*
|
|
37
|
+
* CTC-4744: the verdict is asked for fresh first (it lasts five minutes and only a readiness read
|
|
38
|
+
* recomputes it). When the cloud has not read the settings yet, setup waits up to a minute on one
|
|
39
|
+
* line, instead of telling the person to run setup again. */
|
|
40
|
+
export function onboardValuesAdapter(deps = {}) {
|
|
15
41
|
return {
|
|
16
42
|
check: async (ctx, journal, signal) => {
|
|
17
43
|
const cfg = loadConfig(ctx.home);
|
|
18
44
|
const teamId = selectedOnboardTeam(journal);
|
|
19
45
|
if (!cfg || !teamId)
|
|
20
46
|
return waiting("required_values_unverified");
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
47
|
+
const read = async (timeoutMs, readSignal = signal) => {
|
|
48
|
+
let loaded;
|
|
49
|
+
try {
|
|
50
|
+
// The contract transport owns another timeout. Carry our caller's cancellation through
|
|
51
|
+
// its fetch too, including response-body reads and any credential refresh.
|
|
52
|
+
const readCtx = readSignal
|
|
53
|
+
? {
|
|
54
|
+
...ctx,
|
|
55
|
+
fetch: (input, init) => ctx.fetch(input, {
|
|
56
|
+
...init,
|
|
57
|
+
signal: init?.signal
|
|
58
|
+
? AbortSignal.any([readSignal, init.signal])
|
|
59
|
+
: readSignal,
|
|
60
|
+
}),
|
|
61
|
+
}
|
|
62
|
+
: ctx;
|
|
63
|
+
loaded = await loadFreshTeamContract(readCtx, cfg, [teamId], readSignal, timeoutMs);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return { kind: "unverified" };
|
|
67
|
+
}
|
|
68
|
+
if (loaded.source === "cache")
|
|
69
|
+
return { kind: "unverified" };
|
|
70
|
+
const team = loaded.doc.teams.find((row) => row.id === teamId);
|
|
71
|
+
const readiness = team?.readiness;
|
|
72
|
+
const fresh = readiness?.checkedAt != null &&
|
|
73
|
+
readiness.expiresAt != null &&
|
|
74
|
+
readiness.expiresAt > ctx.now().getTime();
|
|
75
|
+
// A verdict the cloud could not bring up to date says nothing either way.
|
|
76
|
+
if (!readiness || !fresh)
|
|
77
|
+
return { kind: "unverified" };
|
|
78
|
+
const check = readiness.checks.find((row) => row.id === "required_values");
|
|
79
|
+
// An older cloud may not send this check at all: that says nothing, it is not an unread.
|
|
80
|
+
if (!check)
|
|
81
|
+
return { kind: "unverified" };
|
|
82
|
+
if (check.state === "pass")
|
|
83
|
+
return { kind: "pass" };
|
|
84
|
+
if (check.state === "fail")
|
|
85
|
+
return { kind: "fail", check };
|
|
86
|
+
return { kind: "unread", repositories: teamRepositories(team, check) };
|
|
87
|
+
};
|
|
88
|
+
let reading = await read();
|
|
89
|
+
if (reading.kind === "unread" && deps.sleep) {
|
|
90
|
+
deps.message?.(`Waiting for Catalyst to read the settings of ${named(reading.repositories)} (up to 1 minute)…`);
|
|
91
|
+
// One deadline covers sleep, readiness refresh and contract/body reads. Attempts also
|
|
92
|
+
// bound an injected sleep whose clock stands still.
|
|
93
|
+
const deadline = Date.now() + VALUES_WAIT_MS;
|
|
94
|
+
const owned = new AbortController();
|
|
95
|
+
const waitSignal = signal ? AbortSignal.any([signal, owned.signal]) : owned.signal;
|
|
96
|
+
let stop = () => { };
|
|
97
|
+
const stopped = new Promise((resolve) => {
|
|
98
|
+
stop = () => {
|
|
99
|
+
owned.abort();
|
|
100
|
+
resolve(null);
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
const timer = setTimeout(stop, VALUES_WAIT_MS);
|
|
104
|
+
signal?.addEventListener("abort", stop, { once: true });
|
|
105
|
+
try {
|
|
106
|
+
if (signal?.aborted)
|
|
107
|
+
stop();
|
|
108
|
+
for (let attempt = 0; reading.kind === "unread" &&
|
|
109
|
+
attempt < VALUES_WAIT_MS / VALUES_POLL_MS &&
|
|
110
|
+
Date.now() < deadline &&
|
|
111
|
+
!waitSignal.aborted; attempt++) {
|
|
112
|
+
// Ctrl-C or expiry ends either stage at once, even if an injected promise stalls.
|
|
113
|
+
await Promise.race([
|
|
114
|
+
deps.sleep(Math.min(VALUES_POLL_MS, Math.max(0, deadline - Date.now()))),
|
|
115
|
+
stopped,
|
|
116
|
+
]);
|
|
117
|
+
if (waitSignal.aborted || Date.now() >= deadline)
|
|
118
|
+
break;
|
|
119
|
+
const next = await Promise.race([
|
|
120
|
+
read(Math.min(WAIT_READ_TIMEOUT_MS, deadline - Date.now()), waitSignal),
|
|
121
|
+
stopped,
|
|
122
|
+
]);
|
|
123
|
+
// A result after expiry says nothing about the last observed unread verdict.
|
|
124
|
+
if (waitSignal.aborted || Date.now() >= deadline || !next)
|
|
125
|
+
break;
|
|
126
|
+
reading = next;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
clearTimeout(timer);
|
|
131
|
+
signal?.removeEventListener("abort", stop);
|
|
132
|
+
owned.abort();
|
|
133
|
+
}
|
|
27
134
|
}
|
|
28
|
-
if (
|
|
29
|
-
return waiting("
|
|
30
|
-
|
|
31
|
-
const fresh = readiness?.checkedAt != null &&
|
|
32
|
-
readiness.expiresAt != null &&
|
|
33
|
-
readiness.expiresAt > ctx.now().getTime();
|
|
34
|
-
const check = fresh
|
|
35
|
-
? readiness.checks.find((row) => row.id === "required_values")
|
|
36
|
-
: undefined;
|
|
37
|
-
if (check?.state === "pass")
|
|
135
|
+
if (signal?.aborted)
|
|
136
|
+
return waiting("interrupted");
|
|
137
|
+
if (reading.kind === "pass")
|
|
38
138
|
return { state: "done", evidence: { team: teamId } };
|
|
39
|
-
if (
|
|
40
|
-
return waiting("
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
139
|
+
if (reading.kind === "fail")
|
|
140
|
+
return waiting("required_values_missing", {
|
|
141
|
+
team: teamId,
|
|
142
|
+
requiredValues: JSON.stringify(valuesFacts(reading.check)),
|
|
143
|
+
});
|
|
144
|
+
if (reading.kind === "unread")
|
|
145
|
+
return waiting("required_values_unread", {
|
|
146
|
+
team: teamId,
|
|
147
|
+
repositories: named(reading.repositories),
|
|
148
|
+
});
|
|
149
|
+
return waiting("required_values_unverified");
|
|
45
150
|
},
|
|
46
151
|
};
|
|
47
152
|
}
|
package/dist/onboard.js
CHANGED
|
@@ -135,6 +135,8 @@ export const ONBOARD_DEPENDENCIES = {
|
|
|
135
135
|
"linear.automations",
|
|
136
136
|
"accounts",
|
|
137
137
|
"capacity",
|
|
138
|
+
// CTC-4744: no work is offered while the cloud is still reading the settings (dependencySettled).
|
|
139
|
+
"values",
|
|
138
140
|
],
|
|
139
141
|
};
|
|
140
142
|
const ADMIN_STEPS = new Set([
|
|
@@ -652,6 +654,18 @@ function sanitizedResult(id, result, at) {
|
|
|
652
654
|
row.at = at;
|
|
653
655
|
return row;
|
|
654
656
|
}
|
|
657
|
+
/** CTC-4744: whether a step a later one depends on has settled. Only the cloud actively reading
|
|
658
|
+
* the settings (`required_values_unread`, after setup's own one-minute wait) holds a first
|
|
659
|
+
* ticket. A finished check that found missing values has settled: the first phase needs no
|
|
660
|
+
* values, and the missing ones are named. So has one that could not be checked at all (an older
|
|
661
|
+
* cloud, a cached contract): holding work on it would hold it for good. */
|
|
662
|
+
export function dependencySettled(step) {
|
|
663
|
+
return (stepSatisfied(step) ||
|
|
664
|
+
(step?.id === "values" &&
|
|
665
|
+
step.state === "waiting" &&
|
|
666
|
+
step.reason !== "required_values_unread" &&
|
|
667
|
+
step.reason !== "interrupted"));
|
|
668
|
+
}
|
|
655
669
|
export function stepSatisfied(step) {
|
|
656
670
|
return (step?.state === "done" ||
|
|
657
671
|
(step?.state === "skipped" &&
|
|
@@ -1315,7 +1329,7 @@ export async function cmdOnboard(args, ctx, deps = {}, cliVersion = "0.13.1") {
|
|
|
1315
1329
|
deps.ui?.stepEnd(journalStep(journal, id), journal);
|
|
1316
1330
|
continue;
|
|
1317
1331
|
}
|
|
1318
|
-
const missing = (ONBOARD_DEPENDENCIES[id] ?? []).find((parent) => !
|
|
1332
|
+
const missing = (ONBOARD_DEPENDENCIES[id] ?? []).find((parent) => !dependencySettled(journalStep(journal, parent)));
|
|
1319
1333
|
if (missing) {
|
|
1320
1334
|
recordStep({
|
|
1321
1335
|
id,
|
package/dist/ready-copy.js
CHANGED
|
@@ -299,8 +299,8 @@ export function teamCheckCopy(baseUrl, key, id, state, valuesFix) {
|
|
|
299
299
|
case "required_values":
|
|
300
300
|
return unknown
|
|
301
301
|
? {
|
|
302
|
-
line: team(`Catalyst hasn't
|
|
303
|
-
fix: "
|
|
302
|
+
line: team(`Catalyst hasn't finished reading the settings of ${key}'s repositories yet.`),
|
|
303
|
+
fix: "nothing to do; Catalyst reads them on its own. Run catalyst ready again in a minute to see the result",
|
|
304
304
|
}
|
|
305
305
|
: {
|
|
306
306
|
line: team(`A variable ${key}'s repository needs has no value, so Catalyst can't run its work.`),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ONBOARD_DEPENDENCIES, ONBOARD_STEPS, ONBOARD_TITLES, } from "./onboard.js";
|
|
1
|
+
import { dependencySettled, ONBOARD_DEPENDENCIES, ONBOARD_STEPS, ONBOARD_TITLES, } from "./onboard.js";
|
|
2
2
|
import { dispatchStageName, onboardReasonText } from "./onboard-next.js";
|
|
3
3
|
/** The step numbers `--json` reports. People read SETUP_PART_NUMBERS instead (CTC-4680). */
|
|
4
4
|
export const SETUP_NUMBERS = {
|
|
@@ -250,6 +250,8 @@ function unfinished(step) {
|
|
|
250
250
|
return step.state === "skipped" ? "not chosen" : "not done yet";
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
+
/** CTC-4744: reasons a step waits on the cloud's own work, never on the person or an admin. */
|
|
254
|
+
export const CLOUD_WORK = new Set(["required_values_unread"]);
|
|
253
255
|
export function setupStepView(step, journal, required = false) {
|
|
254
256
|
required ||= step.id === "runner" && step.evidence?.selected === true;
|
|
255
257
|
let mark = step.state === "done"
|
|
@@ -265,12 +267,16 @@ export function setupStepView(step, journal, required = false) {
|
|
|
265
267
|
? "skip"
|
|
266
268
|
: "act";
|
|
267
269
|
let outcome = step.state === "done" ? succeeded(step) : unfinished(step);
|
|
268
|
-
if (
|
|
270
|
+
if (step.state !== "done" && CLOUD_WORK.has(step.reason ?? "")) {
|
|
271
|
+
mark = "later";
|
|
272
|
+
outcome = "still in progress; Catalyst is reading the settings";
|
|
273
|
+
}
|
|
274
|
+
else if (mark === "later") {
|
|
269
275
|
const waitsOn = step.reason === "github_install_pending"
|
|
270
276
|
? ["github.install"]
|
|
271
277
|
: (ONBOARD_DEPENDENCIES[step.id] ?? []).filter((id) => {
|
|
272
278
|
const s = journal?.steps.find((s) => s.id === id);
|
|
273
|
-
return s?.state !== "
|
|
279
|
+
return s?.state !== "skipped" && !dependencySettled(s);
|
|
274
280
|
});
|
|
275
281
|
// Numbers restart in each part: this part's steps come bare, then each other part once.
|
|
276
282
|
const byPart = new Map();
|
|
@@ -361,7 +367,7 @@ export function setupPartProgress(journal, scope,
|
|
|
361
367
|
/** "run" before readiness is known: a member's admin skips count aside, neither done nor owed.
|
|
362
368
|
* At the end they count done only when readiness passed. */
|
|
363
369
|
moment = "end") {
|
|
364
|
-
const empty = () => ({ total: 0, done: 0, needs: 0, failed: 0, admin: 0, aside: 0 });
|
|
370
|
+
const empty = () => ({ total: 0, done: 0, needs: 0, working: 0, failed: 0, admin: 0, aside: 0 });
|
|
365
371
|
const progress = { 1: empty(), 2: empty(), 3: empty() };
|
|
366
372
|
const readinessPassed = journal.steps.find((s) => s.id === "ready")?.state === "done";
|
|
367
373
|
const rows = new Map();
|
|
@@ -379,6 +385,7 @@ moment = "end") {
|
|
|
379
385
|
{
|
|
380
386
|
// A member's own skip (no --team) is theirs to finish, so it is never counted done.
|
|
381
387
|
mark: memberOwnSkip(step) ? "act" : setupStepView(step, journal).mark,
|
|
388
|
+
working: step.state !== "done" && CLOUD_WORK.has(step.reason ?? ""),
|
|
382
389
|
kind: setupWaitsOnAdmin(step, journal)
|
|
383
390
|
? "admin"
|
|
384
391
|
: step.reason === "member_scope" &&
|
|
@@ -400,6 +407,8 @@ moment = "end") {
|
|
|
400
407
|
if (own.some((s) => s.mark === "fail"))
|
|
401
408
|
part.failed++;
|
|
402
409
|
}
|
|
410
|
+
else if (own.some((s) => s.working))
|
|
411
|
+
part.working++;
|
|
403
412
|
else if (steps.some((s) => s.kind === "admin"))
|
|
404
413
|
part.admin++;
|
|
405
414
|
else if (steps.some((s) => s.kind === "aside"))
|
|
@@ -445,6 +454,8 @@ export function setupTrackerRows(progress, moment) {
|
|
|
445
454
|
return row("done", "");
|
|
446
455
|
if (got.needs)
|
|
447
456
|
return row(needsMark, `${steps(got.needs)} ${got.needs === 1 ? "needs" : "need"} someone`);
|
|
457
|
+
if (got.working)
|
|
458
|
+
return row("later", `${steps(got.working)} still in progress`);
|
|
448
459
|
if (got.admin)
|
|
449
460
|
return row("act", waiting(got.admin));
|
|
450
461
|
if (got.aside)
|
|
@@ -532,10 +543,13 @@ export function setupFinalScreen(journal, base, paused = false, required = new S
|
|
|
532
543
|
const roots = journal.steps
|
|
533
544
|
.filter((step) => {
|
|
534
545
|
const m = setupStepView(step, journal, required.has(step.id)).mark;
|
|
535
|
-
return ((m === "act" ||
|
|
546
|
+
return ((m === "act" ||
|
|
547
|
+
m === "fail" ||
|
|
548
|
+
adminLeft.has(step.id) ||
|
|
549
|
+
(step.state !== "done" && CLOUD_WORK.has(step.reason ?? ""))) &&
|
|
536
550
|
(ONBOARD_DEPENDENCIES[step.id] ?? []).every((id) => {
|
|
537
551
|
const parent = journal.steps.find((s) => s.id === id);
|
|
538
|
-
return parent?.state === "
|
|
552
|
+
return parent?.state === "skipped" || dependencySettled(parent);
|
|
539
553
|
}));
|
|
540
554
|
})
|
|
541
555
|
.filter((step) => step.id !== "ready")
|
|
@@ -545,6 +559,8 @@ export function setupFinalScreen(journal, base, paused = false, required = new S
|
|
|
545
559
|
const actions = unique
|
|
546
560
|
.slice(0, 5)
|
|
547
561
|
.map((step) => ({ id: step.id, text: action(step, base, journal) }));
|
|
562
|
+
// CTC-4744: the Next line is about what the person does; the cloud's own work is listed apart.
|
|
563
|
+
const personal = actions.filter((row) => !CLOUD_WORK.has(journal.steps.find((s) => s.id === row.id)?.reason ?? ""));
|
|
548
564
|
const readiness = journal.steps.find((step) => step.id === "ready");
|
|
549
565
|
const readinessCause = !paused &&
|
|
550
566
|
!actions.length &&
|
|
@@ -578,19 +594,21 @@ export function setupFinalScreen(journal, base, paused = false, required = new S
|
|
|
578
594
|
? `Follow ${ticketUrl ?? key} in Linear; Catalyst comments there as each phase finishes.`
|
|
579
595
|
: heading === "Setup complete"
|
|
580
596
|
? `Next: move a ticket to ${dispatchStageName(firstTicket?.evidence?.stage)} in Linear.`
|
|
581
|
-
: journal.exit === 0 &&
|
|
582
|
-
? `Next: ${
|
|
583
|
-
:
|
|
597
|
+
: journal.exit === 0 && personal[0]
|
|
598
|
+
? `Next: ${personal[0].text[0].toLowerCase() + personal[0].text.slice(1)}`
|
|
599
|
+
: personal.length === 1
|
|
584
600
|
? "Next: run catalyst onboard after you finish 1."
|
|
585
|
-
:
|
|
601
|
+
: personal.length === 2
|
|
586
602
|
? "Next: run catalyst onboard after you finish 1 and 2."
|
|
587
|
-
:
|
|
603
|
+
: personal.length
|
|
588
604
|
? "Next: run catalyst onboard after you finish 1 to " +
|
|
589
|
-
|
|
605
|
+
personal.length +
|
|
590
606
|
"."
|
|
591
|
-
:
|
|
592
|
-
? "Next:
|
|
593
|
-
:
|
|
607
|
+
: actions.length
|
|
608
|
+
? "Next: nothing for you to do. catalyst ready shows when Catalyst has read the settings."
|
|
609
|
+
: readyStep?.reason === "member_team_required"
|
|
610
|
+
? "Next: run catalyst onboard --team <KEY> to check again."
|
|
611
|
+
: "Next: run catalyst onboard to check again.";
|
|
594
612
|
return {
|
|
595
613
|
heading,
|
|
596
614
|
readinessCause,
|
|
@@ -696,31 +714,34 @@ export function onboardJsonView(journal, base, paused = false, options = {}) {
|
|
|
696
714
|
number: SETUP_NUMBERS[action.id] ?? 0,
|
|
697
715
|
text: text.charAt(0).toUpperCase() + text.slice(1),
|
|
698
716
|
...(url ? { url } : {}),
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
"github
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
717
|
+
// CTC-4744: the cloud's own work is nobody's to do.
|
|
718
|
+
who: CLOUD_WORK.has(step.reason ?? "")
|
|
719
|
+
? "catalyst"
|
|
720
|
+
: admin
|
|
721
|
+
? "admin"
|
|
722
|
+
: action.id === "github.install"
|
|
723
|
+
? "github-org-admin"
|
|
724
|
+
: [
|
|
725
|
+
"linear.personal",
|
|
726
|
+
"github.personal",
|
|
727
|
+
"signin",
|
|
728
|
+
"linear.team",
|
|
729
|
+
"github.repos",
|
|
730
|
+
"projects",
|
|
731
|
+
"first-ticket",
|
|
732
|
+
"settings",
|
|
733
|
+
"values",
|
|
734
|
+
"accounts",
|
|
735
|
+
"runner",
|
|
736
|
+
"machine",
|
|
737
|
+
"cli",
|
|
738
|
+
"skills",
|
|
739
|
+
"legacy",
|
|
740
|
+
"daemon",
|
|
741
|
+
"housekeeping",
|
|
742
|
+
].includes(action.id)
|
|
743
|
+
? "you"
|
|
744
|
+
: "admin",
|
|
724
745
|
};
|
|
725
746
|
});
|
|
726
747
|
return {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ 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
5
|
allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
|
|
6
6
|
---
|
|
7
|
-
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.6 — written in this repository for customer accounts -->
|
|
8
8
|
|
|
9
9
|
# Catalyst's GitHub
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ description: >-
|
|
|
4
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 cloud API by default, with local replica reads available as an explicit opt-in, 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
5
|
allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
|
|
6
6
|
---
|
|
7
|
-
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.6 — written in this repository for customer accounts -->
|
|
8
8
|
|
|
9
9
|
# Catalyst Linear
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ description: >-
|
|
|
4
4
|
Set up Catalyst Cloud and say whether setup is working. Walks a person from nothing to their first ticket running, one step at a time: the coding account, the project, the integrations and connected accounts, each repository's settings file, then one real ticket moving. Also logs this machine in, reads the readiness verdict with who can fix each failure, and checks the optional local replica. Use when someone says "set me up", "onboard me", "I just signed up", "get me started", "what do I do first", "log me in", "which account is this machine on", "am I set up", "what is missing", "why does nothing happen" or "is the replica running", when a login expired, or when a skill script exits 2 saying this machine is not connected. Does every step a key can do through the catalyst CLI, hands over the exact page for the steps only a browser can do, and never claims a step it did not watch succeed.
|
|
5
5
|
allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
|
|
6
6
|
---
|
|
7
|
-
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.6 — written in this repository for customer accounts -->
|
|
8
8
|
|
|
9
9
|
# Onboard me
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ description: >-
|
|
|
4
4
|
Own one Catalyst Cloud project end to end until it closes. Use when the person says "run this project for me", "own this until it ships", "keep this moving", or hands you a project id or a set of tickets to drive. Subscribes to the account's event stream for the scope through the catalyst CLI, reacts to each change in the same turn, makes tickets ready and moves them to dispatch, parks what should stop, chases stalls, escalates inward, and keeps one status summary current. Writes to Linear as the app actor; never polls.
|
|
5
5
|
allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
|
|
6
6
|
---
|
|
7
|
-
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.6 — written in this repository for customer accounts -->
|
|
8
8
|
|
|
9
9
|
# Run this project
|
|
10
10
|
|
package/skills/unstick/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: >-
|
|
|
4
4
|
Get a stuck Catalyst Cloud ticket moving again. Use when the person asks "why is this parked and can you release it?", "unpark this", "get things flowing again", "the outage is over, retry what failed", or hands you a ticket that is not moving. Reads why nothing runs and what holds the ticket through the catalyst CLI, decides whether the recorded cause is fixed, previews the release, releases every governor holding the ticket the right way (or one failure class across a team), and raises an ask only for what a person has to do. Never releases a cause it cannot show changed without saying so.
|
|
5
5
|
allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
|
|
6
6
|
---
|
|
7
|
-
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.6 — written in this repository for customer accounts -->
|
|
8
8
|
|
|
9
9
|
# Unstick
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ description: >-
|
|
|
4
4
|
The human's decision inbox on Catalyst Cloud, and the one way an agent raises a decision on their behalf. Use when the person asks "what needs me?", "what am I blocking?", or when active work is gated on a choice only they can make. Lists open asks ranked by how much open work each one holds, files an ask through the cloud's ask route with the account's own template, and records the answer so the held work releases. Never answers as the human, never duplicates an open ask.
|
|
5
5
|
allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
|
|
6
6
|
---
|
|
7
|
-
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.6 — written in this repository for customer accounts -->
|
|
8
8
|
|
|
9
9
|
# What needs me
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ description: >-
|
|
|
4
4
|
What environment variable names does this repository need, and where does each one come from? Scans the repository offline (no login, no network) and lists the names in three groups (build/test, deploy-only, bindings), each with where it was found, what uses it, and where a local value would come from. Never reads a value or prints one. Also checks the environment variable table in `.catalyst/catalyst.toml` offline. Use when someone asks "what does catalyst.env.json mean", "what env vars does this repo need", "why does the container need this", or before reviewing or writing the declaration.
|
|
5
5
|
allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
|
|
6
6
|
---
|
|
7
|
-
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.6 — written in this repository for customer accounts -->
|
|
8
8
|
|
|
9
9
|
# What this repository needs
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ description: >-
|
|
|
4
4
|
Use for "what's happening?", "where are we?", "why is that stuck?", "what closed?", "what's next?", "how does this work?", "why did it do that?", "how does it prioritise?" and "what does this setting do, where is it set?" in Catalyst Cloud, or asks for something to be done rather than known. Reads the contract via catalyst CLI. Read-only: route work/decisions, never answer as the human.
|
|
5
5
|
allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
|
|
6
6
|
---
|
|
7
|
-
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.15.6 — written in this repository for customer accounts -->
|
|
8
8
|
|
|
9
9
|
# What's happening
|
|
10
10
|
|