carrick 0.3.67 → 0.3.69

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/README.md CHANGED
@@ -115,6 +115,7 @@ types in a Node process.
115
115
  | `carrick login` | Authorise a Carrick workspace in the browser, or verify `CARRICK_TOKEN` |
116
116
  | `carrick logout` | Remove the saved local credential |
117
117
  | `carrick init [--project SLUG] [--repo OWNER/REPO]` | The repo list, the project, the service proposal in `.carrick/`, the agent hooks, the MCP connection, and the prompt that writes `carrick.json` |
118
+ | `carrick doctor` | Re-check that setup: the declared paths, the CI workflow against the current template, the hooks, the MCP connection and how far the index is behind |
118
119
  | `carrick remove [--keep-login]` | Undo all of that on this machine, and list the files the scaffold added to the repository |
119
120
  | `carrick index` | Derive the workspace, apply optional repo overrides and write `.carrick/`, with Carrick classifying what the deterministic passes could not |
120
121
  | `carrick refresh [--service X]` | Re-scan one repo, or all of them, and re-join the index. What the session-start hook runs |
@@ -194,6 +195,30 @@ Claude Code session opened in a workspace still waiting for one starts
194
195
  (`CARRICK_REFRESH_COOLDOWN_MS` states another gap), so the hosted rows arrive
195
196
  without a command to remember.
196
197
 
198
+ ## Checking the setup
199
+
200
+ ```
201
+ carrick doctor
202
+ ```
203
+
204
+ What Carrick answers depends on decisions made once, at setup: which
205
+ directories are services, which shared roots they include, which tsconfig
206
+ resolves their types. The index itself is rebuilt by CI on every push to the
207
+ default branch; the configuration is not rebuilt by anything. `carrick doctor`
208
+ re-reads it and exits non-zero when it finds something:
209
+
210
+ - every `directory`, `include` and `tsconfig` a `carrick.json` declares exists,
211
+ - `.github/workflows/carrick.yml` still holds the current template, printed as
212
+ a diff of the lines it is missing (comments are not compared, and steps of
213
+ your own are shown but are not a finding),
214
+ - the agent hook entries are the ones this version installs, and the command
215
+ they run still resolves to this package,
216
+ - each agent client on this machine has the Carrick MCP server,
217
+ - the hosted index answers for every service, with the local index's distance
218
+ from the working tree and from the default branch as notes.
219
+
220
+ It writes nothing, runs no scan and costs nothing.
221
+
197
222
  ## Removing Carrick
198
223
 
199
224
  ```
package/bin/carrick.mjs CHANGED
@@ -125,8 +125,9 @@ function extraHelp() {
125
125
  " --version the version of this package",
126
126
  "",
127
127
  "`carrick init [--project SLUG]` sets this folder up; `carrick init --help`",
128
- "prints its own arguments. `carrick remove` undoes what init wrote on this",
129
- "machine and lists the files the scaffold added to the repository.",
128
+ "prints its own arguments. `carrick doctor` re-checks that setup and exits",
129
+ "non-zero on anything it finds. `carrick remove` undoes what init wrote on",
130
+ "this machine and lists the files the scaffold added to the repository.",
130
131
  "",
131
132
  ].join("\n");
132
133
  }
@@ -169,6 +170,13 @@ switch (command) {
169
170
  const { remove } = await import("../dist/init/remove.js");
170
171
  process.exit(await remove(rest));
171
172
  }
173
+ // Also this package's own: the hook, MCP and workflow halves of the check
174
+ // are things this package wrote, and the binary answers for the rest of it
175
+ // through `carrick status`.
176
+ case "doctor": {
177
+ const { doctor } = await import("../dist/init/doctor.js");
178
+ process.exit(await doctor(rest));
179
+ }
172
180
  case "templates": {
173
181
  const { templates } = await import("../dist/init/run.js");
174
182
  process.exit(templates(rest));
@@ -174,7 +174,7 @@ export type StatusService = {
174
174
  * `no_index_yet` is a connected repo whose first CI scan has not landed —
175
175
  * the one state a session start can do something about (carrick#955).
176
176
  */
177
- hosted_state?: "enriched" | "no_index_yet" | "not_connected" | "not_signed_in" | "version_mismatch" | "commit_missing" | "read_failed";
177
+ hosted_state?: "enriched" | "no_index_yet" | "not_connected" | "remote_unnamed" | "not_signed_in" | "version_mismatch" | "commit_missing" | "read_failed";
178
178
  };
179
179
  /**
180
180
  * One repo of the workspace, for what moved in it that belongs to no service:
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,yDAAyD;AACzD,+EAA+E;AAC/E,4DAA4D;AAC5D,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;A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,UAAU,cAAc,CAAC,MAAmB;IAChD,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACrF,CAAC"}
@@ -0,0 +1,143 @@
1
+ import { type McpInspection } from "./mcp.ts";
2
+ import { type InitOutput } from "./output.ts";
3
+ import type { StatusResult } from "../contract.ts";
4
+ export type DoctorOptions = {
5
+ workspace: string;
6
+ };
7
+ export declare function parseArgs(argv: string[], cwd?: string): DoctorOptions | string;
8
+ /** One line of the report. `warn` and `refuse` are findings; the rest are not. */
9
+ export type Line = {
10
+ level: "done" | "warn" | "refuse" | "say";
11
+ text: string;
12
+ };
13
+ export declare function findingCount(lines: Line[]): number;
14
+ /** A repo of the workspace, with the configuration it declares. */
15
+ export type ConfiguredRepo = {
16
+ /** Absolute. */
17
+ root: string;
18
+ /** Workspace-relative, or the basename when the workspace IS the repo. */
19
+ label: string;
20
+ /** Parsed `carrick.json`, null when there is none. */
21
+ config: Record<string, unknown> | null;
22
+ /** Why there is no config, when the file exists and could not be read. */
23
+ problem: string | null;
24
+ };
25
+ export declare function configuredRepos(workspace: string): ConfiguredRepo[];
26
+ /** One service entry of a `carrick.json`, as this command reads it. */
27
+ type DeclaredService = {
28
+ name: string;
29
+ directory?: string;
30
+ tsconfig?: string;
31
+ include: string[];
32
+ };
33
+ /**
34
+ * The services a config declares: the `services` array, or the file itself.
35
+ *
36
+ * The same resolution as `Config::load_services` in src/config.rs, for the
37
+ * three fields that name a path. When `services` is present its sibling flat
38
+ * fields are ignored, which is the rule the scanner applies too.
39
+ */
40
+ export declare function declaredServices(config: Record<string, unknown>): DeclaredService[];
41
+ /**
42
+ * Every path a `carrick.json` declares, and whether it is there.
43
+ *
44
+ * The bases are the scanner's, read off the code that joins them rather than
45
+ * off the field names: `directory` and every `include` are relative to the
46
+ * repository root, which is where `carrick.json` sits (`find_service_files`),
47
+ * and `tsconfig` is relative to the SERVICE directory, because that is the
48
+ * root the type sidecar is initialised at (`scope_sidecar_to_service`). A
49
+ * doctor that resolved `tsconfig` from the repo root would report a missing
50
+ * file on every monorepo that has one.
51
+ */
52
+ export declare function checkDeclaredPaths(repos: ConfiguredRepo[]): Line[];
53
+ /** The lines of a file that state behaviour: no comments, no blank lines. */
54
+ export declare function functionalLines(body: string): string[];
55
+ export type Drift = {
56
+ /** Template lines this file does not have. The finding. */
57
+ missing: string[];
58
+ /** Lines this file has that the template does not. Context, never a finding. */
59
+ added: string[];
60
+ /** Both, interleaved in file order, as `-`/`+` lines. */
61
+ diff: string[];
62
+ };
63
+ /**
64
+ * What one file differs from a rendered template by, comment-insensitively.
65
+ *
66
+ * Comments and blank lines are dropped from both sides first. The template is
67
+ * two fifths comment, so comparing them would report a finding for every line
68
+ * a reader trimmed and for every rewording of an explanation — neither of
69
+ * which changes what CI runs.
70
+ *
71
+ * Only `missing` is a finding. A workflow with steps of its own is the case
72
+ * the template itself invites ("If you add deploy steps to this file..."), so
73
+ * added lines are printed as context and fail nothing.
74
+ */
75
+ export declare function templateDrift(actual: string, expected: string): Drift;
76
+ /**
77
+ * The variables a workflow on disk states, so the comparison is about drift
78
+ * rather than about the two values the template exists to parameterise.
79
+ *
80
+ * A repo pinned to an older action ref, or building on a branch that is not
81
+ * `main`, is not drift: it is the template with its variables filled in. Both
82
+ * are read back out of the file, and where one cannot be read the default is
83
+ * used and the caller says so.
84
+ */
85
+ export declare function workflowVariables(body: string): {
86
+ variables: Record<string, string>;
87
+ unread: string[];
88
+ };
89
+ /**
90
+ * The CI workflow of every configured repo, against the template this package
91
+ * renders.
92
+ *
93
+ * Only repos with a `carrick.json` are asked for one: a sibling clone that
94
+ * Carrick does not index owes CI nothing.
95
+ */
96
+ export declare function checkWorkflow(repos: ConfiguredRepo[]): Line[];
97
+ /** What the hook check needs to know about this machine. */
98
+ export type HookMachine = {
99
+ /** The absolute path `command` resolves to on PATH, through symlinks. */
100
+ resolveOnPath: (command: string) => string | null;
101
+ /** The real path of a file, or null when it is not on this machine. */
102
+ realpath: (target: string) => string | null;
103
+ /** This package's own entry point, the one a settings file would name. */
104
+ entryPoint: string;
105
+ };
106
+ export declare function realMachine(): HookMachine;
107
+ /**
108
+ * The hook entries in this workspace's `.claude` settings.
109
+ *
110
+ * Three separate questions, and a hook fails silently on all three, because
111
+ * the hook is built never to fail an edit (carrick#837): are the entries
112
+ * there, are they the ones this version writes, and does the command they name
113
+ * still run on this machine?
114
+ *
115
+ * The last one is where an install rots. An entry written as a bare `carrick`
116
+ * needs `carrick` on PATH at every edit; an entry written under `npx` resolves
117
+ * for the length of that one command and never again; an entry naming an
118
+ * absolute path is stale the moment that install is replaced.
119
+ */
120
+ export declare function checkHooks(workspace: string, machine: HookMachine): Line[];
121
+ /** The MCP server entry in each agent client this machine has. */
122
+ export declare function checkMcp(inspections: McpInspection[]): Line[];
123
+ /** Read-only git, for how far a commit is behind the branch CI indexes. */
124
+ export type GitReader = {
125
+ /** `origin/<default>`, or null when this clone does not say. */
126
+ defaultRemoteBranch: (repo: string) => string | null;
127
+ /** Commits in `<from>..<to>`, or null when either end is unknown here. */
128
+ commitsBetween: (repo: string, from: string, to: string) => number | null;
129
+ };
130
+ export declare function realGit(): GitReader;
131
+ /**
132
+ * How far the index is behind, and whether the hosted half arrived at all.
133
+ *
134
+ * Two different questions, and only one of them is a finding. A hosted state
135
+ * that is not `enriched` is plumbing: not connected, not signed in, no index
136
+ * yet, a cache version this build cannot replay. Files changed since the index
137
+ * are not: that is what a repository looks like while someone is working in
138
+ * it, and CI re-indexes the default branch on every push. So the first is a
139
+ * finding and the second is a note with the numbers in it.
140
+ */
141
+ export declare function checkIndex(result: StatusResult | null, failure: string | null, git: GitReader): Line[];
142
+ export declare function doctor(argv: string[], out?: InitOutput): Promise<number>;
143
+ export {};