@isaacriehm/cairn 0.3.8 → 0.4.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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli/attention.js +35 -2
- package/dist/cli/attention.js.map +1 -1
- package/dist/cli/baseline.d.ts +16 -0
- package/dist/cli/baseline.js +122 -0
- package/dist/cli/baseline.js.map +1 -0
- package/dist/cli/fix.d.ts +32 -0
- package/dist/cli/fix.js +467 -0
- package/dist/cli/fix.js.map +1 -0
- package/dist/cli/index.js +8 -1
- package/dist/cli/index.js.map +1 -1
- package/package.json +3 -2
package/dist/cli/fix.js
ADDED
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cairn fix` — retroactive repair subcommands for projects adopted
|
|
3
|
+
* before a feature landed.
|
|
4
|
+
*
|
|
5
|
+
* Subcommands:
|
|
6
|
+
*
|
|
7
|
+
* - `cairn fix brand` — re-run the Phase 5 Haiku brand derivation
|
|
8
|
+
* against the mapper output already on disk and rewrite the 4
|
|
9
|
+
* brand files (overview, voice, positioning, personas). Useful
|
|
10
|
+
* for projects adopted under v0.3.8 or earlier when the
|
|
11
|
+
* brand-derive Haiku call was timing out and the mapper picked
|
|
12
|
+
* mechanical defaults instead.
|
|
13
|
+
*
|
|
14
|
+
* - `cairn fix dec-strip` — replay source-comment strip-replace for
|
|
15
|
+
* accepted DECs whose original essay block is still in source.
|
|
16
|
+
* For projects adopted under v0.4.0 builds before the dirty-file
|
|
17
|
+
* overwrite fix landed: their accepted DECs sit in
|
|
18
|
+
* `.cairn/ground/decisions/<id>.md` but the originating source
|
|
19
|
+
* file still carries the prose instead of `// §DEC-NNNN`.
|
|
20
|
+
*
|
|
21
|
+
* - `cairn fix confidence` — pointer to `cairn attention bulk-accept
|
|
22
|
+
* --threshold high --dry-run`, which already scores + stamps
|
|
23
|
+
* `capture_confidence` on every draft + invariant. Documented
|
|
24
|
+
* here so operators don't hunt for it; this subcommand defers
|
|
25
|
+
* to the existing tool.
|
|
26
|
+
*
|
|
27
|
+
* - `cairn fix duration_ms` — pointer-only. Phase durations are
|
|
28
|
+
* recorded going forward; pre-v0.4.0 init runs cannot be
|
|
29
|
+
* retroactively backfilled because the trace doesn't carry
|
|
30
|
+
* phase boundaries.
|
|
31
|
+
*/
|
|
32
|
+
import { execFileSync } from "node:child_process";
|
|
33
|
+
import { existsSync, readFileSync, readdirSync, rmSync, writeFileSync, } from "node:fs";
|
|
34
|
+
import { dirname, join, resolve } from "node:path";
|
|
35
|
+
import { fileURLToPath } from "node:url";
|
|
36
|
+
import { parse as parseYaml } from "yaml";
|
|
37
|
+
import { applyBrandAnswers, deriveBrandFromProject, derivedToBrandAnswers, parseDraftMeta, readMapperOutputFile, runDecSourceStrip, } from "@isaacriehm/cairn-core";
|
|
38
|
+
import { fixCli as doctorFixCli } from "./doctor.js";
|
|
39
|
+
function parseRepoFlag(argv) {
|
|
40
|
+
const idx = argv.indexOf("--repo");
|
|
41
|
+
if (idx === -1)
|
|
42
|
+
return process.cwd();
|
|
43
|
+
const candidate = argv[idx + 1];
|
|
44
|
+
if (candidate === undefined || candidate.startsWith("--")) {
|
|
45
|
+
console.error("--repo requires a path argument");
|
|
46
|
+
process.exit(2);
|
|
47
|
+
}
|
|
48
|
+
return resolve(candidate);
|
|
49
|
+
}
|
|
50
|
+
function ensureAdopted(repoRoot) {
|
|
51
|
+
if (!existsSync(repoRoot)) {
|
|
52
|
+
console.error(`cairn fix: repo root does not exist: ${repoRoot}`);
|
|
53
|
+
process.exit(2);
|
|
54
|
+
}
|
|
55
|
+
if (!existsSync(join(repoRoot, ".cairn"))) {
|
|
56
|
+
console.error(`cairn fix: ${repoRoot} is not cairn-adopted (no .cairn/). Run \`cairn init\` first.`);
|
|
57
|
+
process.exit(2);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function readProjectSlug(repoRoot) {
|
|
61
|
+
const cfgPath = join(repoRoot, ".cairn", "config.yaml");
|
|
62
|
+
if (!existsSync(cfgPath))
|
|
63
|
+
return "this-project";
|
|
64
|
+
try {
|
|
65
|
+
const parsed = parseYaml(readFileSync(cfgPath, "utf8"));
|
|
66
|
+
if (parsed === null || typeof parsed !== "object")
|
|
67
|
+
return "this-project";
|
|
68
|
+
const slug = parsed["project_slug"];
|
|
69
|
+
return typeof slug === "string" && slug.length > 0 ? slug : "this-project";
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return "this-project";
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async function fixBrand(repoRoot, dryRun) {
|
|
76
|
+
const mapper = readMapperOutputFile(repoRoot);
|
|
77
|
+
if (mapper === null) {
|
|
78
|
+
console.error(`cairn fix brand: no mapper output at .cairn/init/mapper-output.json. ` +
|
|
79
|
+
`Re-run \`cairn init\` first so the mapper can produce a domain summary.`);
|
|
80
|
+
process.exit(2);
|
|
81
|
+
}
|
|
82
|
+
const domainSummary = mapper.output.domain_summary;
|
|
83
|
+
const projectSlug = readProjectSlug(repoRoot);
|
|
84
|
+
process.stdout.write(` ⬡ cairn fix brand — ${repoRoot}\n` +
|
|
85
|
+
` project_slug: ${projectSlug}\n` +
|
|
86
|
+
` domain_summary: ${domainSummary.slice(0, 80)}${domainSummary.length > 80 ? "…" : ""}\n` +
|
|
87
|
+
`\n Calling Haiku for brand-derive (60s timeout, 2-attempt retry)…\n`);
|
|
88
|
+
const derived = await deriveBrandFromProject({
|
|
89
|
+
repoRoot,
|
|
90
|
+
projectSlug,
|
|
91
|
+
domainSummary,
|
|
92
|
+
});
|
|
93
|
+
if (derived === null) {
|
|
94
|
+
console.error(`cairn fix brand: Haiku call returned no usable brand. ` +
|
|
95
|
+
`Check the trace for the underlying error and retry.`);
|
|
96
|
+
process.exit(2);
|
|
97
|
+
}
|
|
98
|
+
const answers = derivedToBrandAnswers(derived);
|
|
99
|
+
if (dryRun) {
|
|
100
|
+
process.stdout.write(" [dry-run] would rewrite 4 brand files:\n");
|
|
101
|
+
process.stdout.write(` overview: ${answers.whatItDoes.slice(0, 60)}…\n`);
|
|
102
|
+
process.stdout.write(` voice: ${answers.voice.slice(0, 60)}…\n`);
|
|
103
|
+
process.stdout.write(` avoid: ${answers.avoid.slice(0, 60)}…\n`);
|
|
104
|
+
process.stdout.write(` personas: ${answers.mainUsers.slice(0, 60)}…\n`);
|
|
105
|
+
process.exit(0);
|
|
106
|
+
}
|
|
107
|
+
const result = applyBrandAnswers(repoRoot, answers);
|
|
108
|
+
process.stdout.write(` Updated ${result.updated.length} file(s):\n`);
|
|
109
|
+
for (const f of result.updated) {
|
|
110
|
+
process.stdout.write(` • ${f}\n`);
|
|
111
|
+
}
|
|
112
|
+
if (result.warnings.length > 0) {
|
|
113
|
+
process.stdout.write(" Warnings:\n");
|
|
114
|
+
for (const w of result.warnings) {
|
|
115
|
+
process.stdout.write(` ! ${w}\n`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
process.exit(0);
|
|
119
|
+
}
|
|
120
|
+
async function fixDecStrip(repoRoot, dryRun) {
|
|
121
|
+
const decisionsDir = join(repoRoot, ".cairn", "ground", "decisions");
|
|
122
|
+
if (!existsSync(decisionsDir)) {
|
|
123
|
+
console.error(`cairn fix dec-strip: no decisions dir at ${decisionsDir}. Run \`cairn init\` first.`);
|
|
124
|
+
process.exit(2);
|
|
125
|
+
}
|
|
126
|
+
let entries;
|
|
127
|
+
try {
|
|
128
|
+
entries = readdirSync(decisionsDir, { encoding: "utf8" });
|
|
129
|
+
}
|
|
130
|
+
catch (err) {
|
|
131
|
+
console.error(`cairn fix dec-strip: cannot read decisions dir: ${err instanceof Error ? err.message : String(err)}`);
|
|
132
|
+
process.exit(2);
|
|
133
|
+
}
|
|
134
|
+
const decFiles = entries.filter((n) => /^DEC-\d{4,}\.md$/.test(n) && !n.endsWith(".draft.md"));
|
|
135
|
+
process.stdout.write(` ⬡ cairn fix dec-strip${dryRun ? " --dry-run" : ""} — ${repoRoot}\n` +
|
|
136
|
+
` Scanning ${decFiles.length} accepted DEC(s) under .cairn/ground/decisions/\n\n`);
|
|
137
|
+
let scanned = 0;
|
|
138
|
+
let candidates = 0;
|
|
139
|
+
let attempted = 0;
|
|
140
|
+
let applied = 0;
|
|
141
|
+
let alreadyStripped = 0;
|
|
142
|
+
let skipped = 0;
|
|
143
|
+
const skipReasons = [];
|
|
144
|
+
for (const name of decFiles) {
|
|
145
|
+
scanned += 1;
|
|
146
|
+
const abs = join(decisionsDir, name);
|
|
147
|
+
let body;
|
|
148
|
+
try {
|
|
149
|
+
body = readFileSync(abs, "utf8");
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const meta = parseDraftMeta(body);
|
|
155
|
+
if (meta === null ||
|
|
156
|
+
meta.captureSource !== "init-source-comments" ||
|
|
157
|
+
meta.blockId === null) {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
candidates += 1;
|
|
161
|
+
const decId = name.replace(/\.md$/, "");
|
|
162
|
+
if (dryRun) {
|
|
163
|
+
process.stdout.write(` [dry-run] ${decId} — would strip block ${meta.blockId} in ${meta.sourceFile ?? "?"}\n`);
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
const outcome = runDecSourceStrip({ repoRoot, decId, meta });
|
|
167
|
+
attempted += outcome.attempted ? 1 : 0;
|
|
168
|
+
applied += outcome.items_applied;
|
|
169
|
+
if (outcome.reason === "already-stripped") {
|
|
170
|
+
alreadyStripped += 1;
|
|
171
|
+
process.stdout.write(` · ${decId} — already stripped (no-op)\n`);
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
if (outcome.items_applied === 0) {
|
|
175
|
+
skipped += 1;
|
|
176
|
+
skipReasons.push({ id: decId, reason: outcome.reason ?? "unknown" });
|
|
177
|
+
process.stdout.write(` ✗ ${decId} — skipped (${outcome.reason ?? "unknown"})\n`);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
process.stdout.write(` ✓ ${decId} — replaced ${outcome.items_applied} block(s) in ${outcome.files_modified} file(s)\n`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
process.stdout.write(`\n Scanned ${scanned}, candidates ${candidates}, attempted ${attempted}, applied ${applied}, already-stripped ${alreadyStripped}, skipped ${skipped}\n`);
|
|
184
|
+
if (!dryRun && skipReasons.length > 0) {
|
|
185
|
+
process.stdout.write("\n Skip reason breakdown:\n");
|
|
186
|
+
const counts = new Map();
|
|
187
|
+
for (const r of skipReasons) {
|
|
188
|
+
counts.set(r.reason, (counts.get(r.reason) ?? 0) + 1);
|
|
189
|
+
}
|
|
190
|
+
for (const [reason, n] of counts) {
|
|
191
|
+
process.stdout.write(` ${reason}: ${n}\n`);
|
|
192
|
+
}
|
|
193
|
+
process.stdout.write(`\n Common reasons:\n` +
|
|
194
|
+
` no-audit-found — Phase 7b audit YAML missing (re-run \`cairn init\` or restore baseline)\n` +
|
|
195
|
+
` block-not-found — block id not in audit (DEC was edited or audit predates block)\n` +
|
|
196
|
+
` range-mismatch — audit offset + content-search both stale; source file edited post-init\n` +
|
|
197
|
+
` raw-not-in-file — original essay text not in current source (file edited post-init)\n` +
|
|
198
|
+
` strip-failed — source file moved or content drifted\n`);
|
|
199
|
+
}
|
|
200
|
+
process.exit(0);
|
|
201
|
+
}
|
|
202
|
+
async function fixClaudeRules(repoRoot, dryRun) {
|
|
203
|
+
const targetRel = ".claude/rules/cairn.md";
|
|
204
|
+
const targetAbs = join(repoRoot, targetRel);
|
|
205
|
+
// Locate the bundled template alongside the gitignore template.
|
|
206
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
207
|
+
const candidates = [
|
|
208
|
+
join(here, "..", "..", "..", "cairn-core", "templates", ".claude", "rules", "cairn.md"),
|
|
209
|
+
join(here, "..", "..", "..", "..", "cairn-core", "templates", ".claude", "rules", "cairn.md"),
|
|
210
|
+
join(here, "..", "..", "templates", ".claude", "rules", "cairn.md"),
|
|
211
|
+
join(here, "..", "templates", ".claude", "rules", "cairn.md"),
|
|
212
|
+
];
|
|
213
|
+
const templatePath = candidates.find((p) => existsSync(p));
|
|
214
|
+
if (templatePath === undefined) {
|
|
215
|
+
console.error(`cairn fix claude-rules: cannot locate bundled .claude/rules/cairn.md template (looked in ${candidates.join(", ")})`);
|
|
216
|
+
process.exit(2);
|
|
217
|
+
}
|
|
218
|
+
const templateContent = readFileSync(templatePath, "utf8");
|
|
219
|
+
process.stdout.write(` ⬡ cairn fix claude-rules${dryRun ? " --dry-run" : ""} — ${repoRoot}\n` +
|
|
220
|
+
` template: ${templatePath}\n target: ${targetRel}\n\n`);
|
|
221
|
+
if (existsSync(targetAbs)) {
|
|
222
|
+
const current = readFileSync(targetAbs, "utf8");
|
|
223
|
+
if (current === templateContent) {
|
|
224
|
+
process.stdout.write(" · already matches template (no-op)\n");
|
|
225
|
+
process.exit(0);
|
|
226
|
+
}
|
|
227
|
+
process.stdout.write(" ! existing file differs from template\n");
|
|
228
|
+
if (dryRun) {
|
|
229
|
+
process.stdout.write(` [dry-run] would overwrite ${targetRel}\n`);
|
|
230
|
+
process.exit(0);
|
|
231
|
+
}
|
|
232
|
+
writeFileSync(targetAbs, templateContent, "utf8");
|
|
233
|
+
process.stdout.write(` ✓ ${targetRel} overwritten with current template\n`);
|
|
234
|
+
process.exit(0);
|
|
235
|
+
}
|
|
236
|
+
if (dryRun) {
|
|
237
|
+
process.stdout.write(` [dry-run] would write ${targetRel}\n`);
|
|
238
|
+
process.exit(0);
|
|
239
|
+
}
|
|
240
|
+
// mkdir -p .claude/rules/
|
|
241
|
+
const targetDir = dirname(targetAbs);
|
|
242
|
+
if (!existsSync(targetDir)) {
|
|
243
|
+
const { mkdirSync } = await import("node:fs");
|
|
244
|
+
mkdirSync(targetDir, { recursive: true });
|
|
245
|
+
}
|
|
246
|
+
writeFileSync(targetAbs, templateContent, "utf8");
|
|
247
|
+
process.stdout.write(` ✓ ${targetRel} written\n` +
|
|
248
|
+
`\n Teammates without the Cairn plugin will now see install\n` +
|
|
249
|
+
` instructions on session start. Commit the file:\n` +
|
|
250
|
+
` git add ${targetRel}\n` +
|
|
251
|
+
` git commit -m "cairn: add .claude/rules/cairn.md for plugin-absent onboarding"\n`);
|
|
252
|
+
process.exit(0);
|
|
253
|
+
}
|
|
254
|
+
async function fixScrubCache(repoRoot, dryRun) {
|
|
255
|
+
const cacheDir = join(repoRoot, ".cairn", "cache", "haiku");
|
|
256
|
+
if (!existsSync(cacheDir)) {
|
|
257
|
+
process.stdout.write(` ⬡ cairn fix scrub-cache — ${repoRoot}\n` +
|
|
258
|
+
` · no cache at ${cacheDir} (nothing to scrub)\n`);
|
|
259
|
+
process.exit(0);
|
|
260
|
+
}
|
|
261
|
+
let entries;
|
|
262
|
+
try {
|
|
263
|
+
entries = readdirSync(cacheDir, { encoding: "utf8" });
|
|
264
|
+
}
|
|
265
|
+
catch (err) {
|
|
266
|
+
console.error(`cairn fix scrub-cache: cannot read cache dir: ${err instanceof Error ? err.message : String(err)}`);
|
|
267
|
+
process.exit(2);
|
|
268
|
+
}
|
|
269
|
+
const cacheFiles = entries.filter((n) => n.endsWith(".json"));
|
|
270
|
+
process.stdout.write(` ⬡ cairn fix scrub-cache${dryRun ? " --dry-run" : ""} — ${repoRoot}\n` +
|
|
271
|
+
` Found ${cacheFiles.length} cache entr(y/ies) at ${cacheDir}\n\n`);
|
|
272
|
+
if (cacheFiles.length === 0) {
|
|
273
|
+
process.stdout.write(" · cache dir is empty (nothing to scrub)\n");
|
|
274
|
+
process.exit(0);
|
|
275
|
+
}
|
|
276
|
+
if (dryRun) {
|
|
277
|
+
process.stdout.write(` [dry-run] would delete ${cacheFiles.length} entr(y/ies)\n`);
|
|
278
|
+
process.exit(0);
|
|
279
|
+
}
|
|
280
|
+
let removed = 0;
|
|
281
|
+
for (const name of cacheFiles) {
|
|
282
|
+
try {
|
|
283
|
+
rmSync(join(cacheDir, name), { force: true });
|
|
284
|
+
removed += 1;
|
|
285
|
+
}
|
|
286
|
+
catch {
|
|
287
|
+
/* best-effort */
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
process.stdout.write(` ✓ Scrubbed ${removed} entr(y/ies). Next Haiku call will re-populate.\n` +
|
|
291
|
+
`\n Recommended next step: re-run \`cairn fix brand\` to regenerate the\n` +
|
|
292
|
+
` brand text from a clean run (use this if the prior brand text picked\n` +
|
|
293
|
+
` up content from your user-global ~/.claude/CLAUDE.md or other ambient\n` +
|
|
294
|
+
` context — v0.4.0 added isolation that prevents this going forward).\n`);
|
|
295
|
+
process.exit(0);
|
|
296
|
+
}
|
|
297
|
+
async function fixGitignore(repoRoot, dryRun) {
|
|
298
|
+
const cairnGitignorePath = join(repoRoot, ".cairn", ".gitignore");
|
|
299
|
+
if (!existsSync(cairnGitignorePath)) {
|
|
300
|
+
console.error(`cairn fix gitignore: missing ${cairnGitignorePath}. Re-run \`cairn init\`.`);
|
|
301
|
+
process.exit(2);
|
|
302
|
+
}
|
|
303
|
+
// Resolve the bundled template via the cli's own location. In the
|
|
304
|
+
// npm-published layout dist/cli/index.js sits next to the cairn-core
|
|
305
|
+
// package; the templates live under cairn-core/templates/. In the
|
|
306
|
+
// Claude Code plugin bundle layout, the template is shipped under
|
|
307
|
+
// dist/templates/. Try both — fail loudly if neither exists.
|
|
308
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
309
|
+
const candidates = [
|
|
310
|
+
join(here, "..", "..", "..", "cairn-core", "templates", ".cairn", ".gitignore"),
|
|
311
|
+
join(here, "..", "..", "..", "..", "cairn-core", "templates", ".cairn", ".gitignore"),
|
|
312
|
+
join(here, "..", "..", "templates", ".cairn", ".gitignore"),
|
|
313
|
+
join(here, "..", "templates", ".cairn", ".gitignore"),
|
|
314
|
+
];
|
|
315
|
+
const templatePath = candidates.find((p) => existsSync(p));
|
|
316
|
+
if (templatePath === undefined) {
|
|
317
|
+
console.error(`cairn fix gitignore: cannot locate bundled .cairn/.gitignore template (looked in ${candidates.join(", ")})`);
|
|
318
|
+
process.exit(2);
|
|
319
|
+
}
|
|
320
|
+
const templateContent = readFileSync(templatePath, "utf8");
|
|
321
|
+
const currentContent = readFileSync(cairnGitignorePath, "utf8");
|
|
322
|
+
process.stdout.write(` ⬡ cairn fix gitignore${dryRun ? " --dry-run" : ""} — ${repoRoot}\n` +
|
|
323
|
+
` template: ${templatePath}\n\n`);
|
|
324
|
+
if (templateContent === currentContent) {
|
|
325
|
+
process.stdout.write(" ✓ .cairn/.gitignore already matches template — no changes needed\n");
|
|
326
|
+
process.exit(0);
|
|
327
|
+
}
|
|
328
|
+
// Compute newly-ignored top-level entries by diffing entry lines (any
|
|
329
|
+
// non-comment, non-blank line). Only entries the OLD file lacked but
|
|
330
|
+
// the NEW one adds get the `git rm --cached` treatment — entries the
|
|
331
|
+
// operator added themselves stay alone.
|
|
332
|
+
const lineEntries = (text) => new Set(text
|
|
333
|
+
.split("\n")
|
|
334
|
+
.map((l) => l.trim())
|
|
335
|
+
.filter((l) => l.length > 0 && !l.startsWith("#")));
|
|
336
|
+
const before = lineEntries(currentContent);
|
|
337
|
+
const after = lineEntries(templateContent);
|
|
338
|
+
const newlyIgnored = [...after].filter((e) => !before.has(e));
|
|
339
|
+
process.stdout.write(` Newly-ignored entries (${newlyIgnored.length}):\n`);
|
|
340
|
+
for (const e of newlyIgnored) {
|
|
341
|
+
process.stdout.write(` + ${e}\n`);
|
|
342
|
+
}
|
|
343
|
+
if (dryRun) {
|
|
344
|
+
process.stdout.write(`\n [dry-run] would rewrite .cairn/.gitignore from template\n`);
|
|
345
|
+
if (newlyIgnored.length > 0) {
|
|
346
|
+
process.stdout.write(` [dry-run] would run \`git rm --cached -r --ignore-unmatch\` against newly-ignored entries\n`);
|
|
347
|
+
}
|
|
348
|
+
process.exit(0);
|
|
349
|
+
}
|
|
350
|
+
writeFileSync(cairnGitignorePath, templateContent, "utf8");
|
|
351
|
+
process.stdout.write("\n ✓ .cairn/.gitignore rewritten from template\n");
|
|
352
|
+
if (newlyIgnored.length === 0) {
|
|
353
|
+
process.exit(0);
|
|
354
|
+
}
|
|
355
|
+
// Untrack newly-ignored paths so they actually drop out of the index.
|
|
356
|
+
// Paths in .cairn/.gitignore are relative to .cairn/, so prefix.
|
|
357
|
+
const targets = newlyIgnored.map((e) => join(".cairn", e));
|
|
358
|
+
process.stdout.write(`\n Running \`git rm --cached -r --ignore-unmatch\` for ${targets.length} path(s)…\n`);
|
|
359
|
+
try {
|
|
360
|
+
const out = execFileSync("git", ["rm", "--cached", "-r", "--ignore-unmatch", "--", ...targets], { cwd: repoRoot, encoding: "utf8" });
|
|
361
|
+
if (out.trim().length > 0) {
|
|
362
|
+
for (const line of out.trim().split("\n")) {
|
|
363
|
+
process.stdout.write(` ${line}\n`);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
process.stdout.write(" (nothing to untrack — paths weren't committed)\n");
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
catch (err) {
|
|
371
|
+
console.error(`cairn fix gitignore: git rm --cached failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
372
|
+
process.exit(2);
|
|
373
|
+
}
|
|
374
|
+
process.stdout.write("\n Untracked. Commit the .gitignore + index changes when you're ready:\n" +
|
|
375
|
+
" git status\n" +
|
|
376
|
+
" git add .cairn/.gitignore\n" +
|
|
377
|
+
' git commit -m "cairn: tighten .cairn/.gitignore (untrack transient state)"\n');
|
|
378
|
+
process.exit(0);
|
|
379
|
+
}
|
|
380
|
+
const RETROACTIVE_SUBCOMMANDS = new Set([
|
|
381
|
+
"brand",
|
|
382
|
+
"dec-strip",
|
|
383
|
+
"gitignore",
|
|
384
|
+
"scrub-cache",
|
|
385
|
+
"claude-rules",
|
|
386
|
+
"confidence",
|
|
387
|
+
"duration_ms",
|
|
388
|
+
]);
|
|
389
|
+
export async function fixCli(argv) {
|
|
390
|
+
if (argv[0] === "--help" || argv[0] === "-h") {
|
|
391
|
+
process.stdout.write("Usage: cairn fix [<subcommand>] [--repo <path>] [--dry-run]\n" +
|
|
392
|
+
" No subcommand: runs the doctor auto-fix pass (rebuild ledgers,\n" +
|
|
393
|
+
" scope-index, etc.).\n" +
|
|
394
|
+
" Subcommands (retroactive — for projects adopted on older versions):\n" +
|
|
395
|
+
" brand re-run the Haiku brand-derive call against the\n" +
|
|
396
|
+
" mapper output already on disk; rewrite the 4 brand\n" +
|
|
397
|
+
" files. For projects adopted under v0.3.8 or earlier\n" +
|
|
398
|
+
" where the Haiku timeout caused mechanical defaults.\n" +
|
|
399
|
+
" dec-strip replay source-comment strip-replace for accepted\n" +
|
|
400
|
+
" DECs whose original essay block is still in source.\n" +
|
|
401
|
+
" For projects adopted under v0.4.0 builds before the\n" +
|
|
402
|
+
" dirty-file overwrite fix landed.\n" +
|
|
403
|
+
" gitignore rewrite .cairn/.gitignore from the bundled template\n" +
|
|
404
|
+
" and `git rm --cached` newly-ignored paths. For\n" +
|
|
405
|
+
" projects adopted before the v0.4.0 gitignore additions\n" +
|
|
406
|
+
" (init-state.json, init/, staleness/, backups/, cache/).\n" +
|
|
407
|
+
" scrub-cache wipe .cairn/cache/haiku/ entries. For projects adopted\n" +
|
|
408
|
+
" before v0.4.0 ambient-context isolation; cached Haiku\n" +
|
|
409
|
+
" responses captured user-global CLAUDE.md content and\n" +
|
|
410
|
+
" should be re-issued under the new isolated transport.\n" +
|
|
411
|
+
" claude-rules write .claude/rules/cairn.md so teammates whose Claude\n" +
|
|
412
|
+
" Code lacks the Cairn plugin still see install\n" +
|
|
413
|
+
" instructions on session start. Auto-loaded by Claude\n" +
|
|
414
|
+
" Code regardless of plugin install state.\n" +
|
|
415
|
+
" confidence alias for `cairn attention bulk-accept --threshold high`\n" +
|
|
416
|
+
" which scores + stamps capture_confidence on every\n" +
|
|
417
|
+
" draft + invariant. Run with --dry-run first.\n" +
|
|
418
|
+
" duration_ms not implemented — phase durations are recorded\n" +
|
|
419
|
+
" going forward (v0.4.0+); the trace doesn't carry\n" +
|
|
420
|
+
" pre-existing phase boundaries.\n");
|
|
421
|
+
process.exit(0);
|
|
422
|
+
}
|
|
423
|
+
const sub = argv[0];
|
|
424
|
+
if (sub === undefined || !RETROACTIVE_SUBCOMMANDS.has(sub)) {
|
|
425
|
+
// No subcommand or unrecognized first arg — fall through to the
|
|
426
|
+
// doctor auto-fix flow with the original argv (so `--repo <path>`
|
|
427
|
+
// etc. still routes correctly).
|
|
428
|
+
await doctorFixCli(argv);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
const rest = argv.slice(1);
|
|
432
|
+
const repoRoot = parseRepoFlag(rest);
|
|
433
|
+
ensureAdopted(repoRoot);
|
|
434
|
+
const dryRun = rest.includes("--dry-run");
|
|
435
|
+
switch (sub) {
|
|
436
|
+
case "brand":
|
|
437
|
+
await fixBrand(repoRoot, dryRun);
|
|
438
|
+
return;
|
|
439
|
+
case "dec-strip":
|
|
440
|
+
await fixDecStrip(repoRoot, dryRun);
|
|
441
|
+
return;
|
|
442
|
+
case "gitignore":
|
|
443
|
+
await fixGitignore(repoRoot, dryRun);
|
|
444
|
+
return;
|
|
445
|
+
case "scrub-cache":
|
|
446
|
+
await fixScrubCache(repoRoot, dryRun);
|
|
447
|
+
return;
|
|
448
|
+
case "claude-rules":
|
|
449
|
+
await fixClaudeRules(repoRoot, dryRun);
|
|
450
|
+
return;
|
|
451
|
+
case "confidence":
|
|
452
|
+
process.stdout.write(" cairn fix confidence is an alias for `cairn attention bulk-accept`.\n" +
|
|
453
|
+
" Run: cairn attention bulk-accept --threshold high --dry-run\n" +
|
|
454
|
+
" to score + stamp capture_confidence without auto-accepting,\n" +
|
|
455
|
+
" then re-run without --dry-run when ready.\n");
|
|
456
|
+
process.exit(0);
|
|
457
|
+
return;
|
|
458
|
+
case "duration_ms":
|
|
459
|
+
process.stdout.write(" cairn fix duration_ms is not implemented.\n" +
|
|
460
|
+
" Phase durations are recorded going forward (v0.4.0+);\n" +
|
|
461
|
+
" pre-existing phase boundaries are not in the trace and cannot\n" +
|
|
462
|
+
" be retroactively backfilled.\n");
|
|
463
|
+
process.exit(0);
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
//# sourceMappingURL=fix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix.js","sourceRoot":"","sources":["../../src/cli/fix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,UAAU,EACV,YAAY,EACZ,WAAW,EACX,MAAM,EACN,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,iBAAiB,GAElB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AAErD,SAAS,aAAa,CAAC,IAAc;IACnC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,GAAG,KAAK,CAAC,CAAC;QAAE,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;IACrC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAChC,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1D,OAAO,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,OAAO,C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
1
|
#!/usr/bin/env node
|
|
2
2
|
import { readStatusForCLI, VERSION } from "../index.js";
|
|
3
3
|
import { attentionCli } from "./attention.js";
|
|
4
|
-
import {
|
|
4
|
+
import { baselineCli } from "./baseline.js";
|
|
5
|
+
import { doctorCli } from "./doctor.js";
|
|
6
|
+
import { fixCli } from "./fix.js";
|
|
5
7
|
import { gcCli } from "./gc.js";
|
|
6
8
|
import { hookCli } from "./hook.js";
|
|
7
9
|
import { initCli } from "./init.js";
|
|
@@ -80,6 +82,9 @@ switch (subcommand) {
|
|
|
80
82
|
case "attention":
|
|
81
83
|
await attentionCli(rest);
|
|
82
84
|
break;
|
|
85
|
+
case "baseline":
|
|
86
|
+
await baselineCli(rest);
|
|
87
|
+
break;
|
|
83
88
|
case "hook":
|
|
84
89
|
await hookCli(rest);
|
|
85
90
|
break;
|
|
@@ -142,6 +147,8 @@ switch (subcommand) {
|
|
|
142
147
|
" (--repo <path>?)\n" +
|
|
143
148
|
" attention list pending DEC drafts + baseline sensor findings\n" +
|
|
144
149
|
" (--repo <path>?)\n" +
|
|
150
|
+
" baseline re-run the synthetic-diff sensor sweep post-adoption\n" +
|
|
151
|
+
" (--force? --repo <path>?)\n" +
|
|
145
152
|
" hook Claude Code hook runner (stdin = hook payload JSON)\n" +
|
|
146
153
|
" (subcommands: session-start | read-enrich | write-guard)\n" +
|
|
147
154
|
" sensor-run git-hook sensor sweep (--staged | --commit-msg <path>)\n" +
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAsB,gBAAgB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EA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
|
"name": "@isaacriehm/cairn",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Cairn — state + context-loading layer for AI coding agents.",
|
|
5
5
|
"author": "Isaac Riehm",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"simple-git": "^3.36.0",
|
|
39
39
|
"yaml": "^2.8.4",
|
|
40
|
-
"@isaacriehm/cairn-core": "0.
|
|
40
|
+
"@isaacriehm/cairn-core": "0.4.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^25.6.0",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"smoke:init-phases-state": "tsx scripts/smoke-init-phases-state.ts",
|
|
76
76
|
"smoke:init-phases-all": "tsx scripts/smoke-init-phases-all.ts",
|
|
77
77
|
"smoke:init-mcp-tools": "tsx scripts/smoke-init-mcp-tools.ts",
|
|
78
|
+
"smoke:init-progress-heartbeat": "tsx scripts/smoke-init-progress-heartbeat.ts",
|
|
78
79
|
"smoke:stop-debounce": "tsx scripts/smoke-stop-debounce.ts"
|
|
79
80
|
}
|
|
80
81
|
}
|