mossbear 0.1.0-alpha.43 → 0.1.0-alpha.45

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 (61) hide show
  1. package/README.md +4 -2
  2. package/dist/commands/doctor.d.ts.map +1 -1
  3. package/dist/commands/doctor.js +28 -1
  4. package/dist/commands/doctor.js.map +1 -1
  5. package/dist/commands/init.d.ts +0 -1
  6. package/dist/commands/init.d.ts.map +1 -1
  7. package/dist/commands/init.js +111 -124
  8. package/dist/commands/init.js.map +1 -1
  9. package/dist/commands/link.d.ts +11 -7
  10. package/dist/commands/link.d.ts.map +1 -1
  11. package/dist/commands/link.js +50 -10
  12. package/dist/commands/link.js.map +1 -1
  13. package/dist/commands/sync.d.ts.map +1 -1
  14. package/dist/commands/sync.js +29 -3
  15. package/dist/commands/sync.js.map +1 -1
  16. package/dist/dashboard-error.d.ts +111 -0
  17. package/dist/dashboard-error.d.ts.map +1 -0
  18. package/dist/dashboard-error.js +128 -0
  19. package/dist/dashboard-error.js.map +1 -0
  20. package/dist/dashboard-health.d.ts +29 -10
  21. package/dist/dashboard-health.d.ts.map +1 -1
  22. package/dist/dashboard-health.js +90 -15
  23. package/dist/dashboard-health.js.map +1 -1
  24. package/dist/docs/guide-projection.d.ts.map +1 -1
  25. package/dist/docs/guide-projection.js +13 -1
  26. package/dist/docs/guide-projection.js.map +1 -1
  27. package/dist/docs/sync-docs.d.ts.map +1 -1
  28. package/dist/docs/sync-docs.js +2 -1
  29. package/dist/docs/sync-docs.js.map +1 -1
  30. package/dist/harness-writers.d.ts +1 -1
  31. package/dist/mcp/client.d.ts +0 -20
  32. package/dist/mcp/client.d.ts.map +1 -1
  33. package/dist/mcp/client.js +13 -36
  34. package/dist/mcp/client.js.map +1 -1
  35. package/dist/repo-id.d.ts.map +1 -1
  36. package/dist/repo-id.js +104 -11
  37. package/dist/repo-id.js.map +1 -1
  38. package/dist/rules/guide-history-client.d.ts.map +1 -1
  39. package/dist/rules/guide-history-client.js +23 -14
  40. package/dist/rules/guide-history-client.js.map +1 -1
  41. package/dist/rules/import-client.d.ts.map +1 -1
  42. package/dist/rules/import-client.js +7 -1
  43. package/dist/rules/import-client.js.map +1 -1
  44. package/dist/rules/init-import.d.ts +25 -3
  45. package/dist/rules/init-import.d.ts.map +1 -1
  46. package/dist/rules/init-import.js +48 -3
  47. package/dist/rules/init-import.js.map +1 -1
  48. package/dist/rules/pull-bundle.d.ts.map +1 -1
  49. package/dist/rules/pull-bundle.js +2 -1
  50. package/dist/rules/pull-bundle.js.map +1 -1
  51. package/dist/rules/unlink-client.d.ts.map +1 -1
  52. package/dist/rules/unlink-client.js +22 -5
  53. package/dist/rules/unlink-client.js.map +1 -1
  54. package/dist/session-start/report.d.ts +8 -0
  55. package/dist/session-start/report.d.ts.map +1 -1
  56. package/dist/session-start/report.js +15 -7
  57. package/dist/session-start/report.js.map +1 -1
  58. package/dist/update/perform.d.ts.map +1 -1
  59. package/dist/update/perform.js +2 -3
  60. package/dist/update/perform.js.map +1 -1
  61. package/package.json +5 -5
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # mossbear
2
2
 
3
- Local-first CLI for [Mossbear](https://app.mossbear.io) — a feedback layer for AI coding agents. Mossbear grades what your agents actually did against your guides — the rules, skills and documents you wrote (`AGENTS.md`, `CLAUDE.md`, `.cursorrules`, …) — and shows you which ones work.
3
+ **One set of rules for every coding agent and every repo — graded against what your Claude Code runs actually did, with changes drafted for you to approve.**
4
+
5
+ Local-first CLI for [Mossbear](https://app.mossbear.io). The rules you already wrote (`AGENTS.md`, `CLAUDE.md`, `.cursorrules`, …) stay one copy across every repo and every agent, and every session the CLI hooks into is held against them.
4
6
 
5
7
  The CLI is the on-device half of the product: it hooks into your agent's lifecycle, records what each tool call did, and syncs that record to your dashboard, which grades the run against your rules and skills. Your file contents, your diffs and your raw conversation transcripts never leave your machine — [Privacy](#privacy) lists exactly what does.
6
8
 
@@ -53,7 +55,7 @@ mossbear init # no token or account needed
53
55
  mossbear doctor # verify hooks + config
54
56
  ```
55
57
 
56
- `mossbear init` detects Claude Code, registers a PostToolUse action-logging hook plus Stop and SessionEnd hooks that run `mossbear sync`, scaffolds `AGENTS.md` if missing, and installs a user-invocable Claude Code skill. Hooks, logging, and the local guide cache work without an account; grading needs one, because it runs on the dashboard.
58
+ `mossbear init` detects Claude Code, registers a PostToolUse action-logging hook plus Stop and SessionEnd hooks that run `mossbear sync`, and installs a user-invocable Claude Code skill. It writes no guide file of its own — `AGENTS.md` is yours to create, or arrives from a bundle you subscribe to. Hooks, logging, and the local guide cache work without an account; grading needs one, because it runs on the dashboard.
57
59
 
58
60
  The PostToolUse hook is written as the bare command `mossbear-hook`, a second binary this package installs alongside `mossbear`. It is a separate bin rather than an `mossbear hook` subcommand for two reasons: it runs once per tool call, where booting the full command tree would cost roughly 50ms every time; and a bare command resolved through `PATH` carries nothing machine-specific, so `.claude/settings.json` is identical on every machine and can be committed without churning.
59
61
 
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AA6DA,eAAO,MAAM,aAAa;;;;;;;;;;;;EAyaxB,CAAA"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAsEA,eAAO,MAAM,aAAa;;;;;;;;;;;;EAgcxB,CAAA"}
@@ -13,11 +13,19 @@ import { resolveRepoRoot } from '../repo-root.js';
13
13
  import { discoverGuideFiles } from '../rules/discover.js';
14
14
  import { readSessionStartRecord } from '../session-start/record.js';
15
15
  import { describeSessionStart } from '../session-start/report.js';
16
+ import { terminalWidth, wrapText } from '../terminal.js';
16
17
  import { verifyDashboardToken } from '../token-verify.js';
17
18
  import { detectBundledSkillDrift } from '../update/assets.js';
18
19
  import { checkForUpdate, formatUpdateNotice } from '../update/notice.js';
19
20
  import { formatUpdateSuccess, performUpdate, syncGeneratedAssets, } from '../update/perform.js';
20
21
  import { CLI_VERSION } from '../version.js';
22
+ /**
23
+ * Where an `i` line's text starts: two spaces of indent, the glyph, two more.
24
+ *
25
+ * A continuation hangs here rather than at column 0, so a wrapped note stays
26
+ * visibly part of the line it belongs to.
27
+ */
28
+ const INFO_TEXT_COLUMN = 5;
21
29
  /**
22
30
  * True when this project's Stop hooks upload the session (`mossbear sync`).
23
31
  *
@@ -365,7 +373,26 @@ export const doctorCommand = defineCommand({
365
373
  cliOnPath: mossbearBinPath !== null,
366
374
  record: await readSessionStartRecord(),
367
375
  })) {
368
- console.log(` i ${line}`);
376
+ // Wrapped here rather than in the report, and hanging to its own column
377
+ // rather than to zero.
378
+ //
379
+ // `describeSessionStart` returns one sentence per line and knows nothing
380
+ // about this command's ` i ` gutter; this is the only place that does,
381
+ // which is why the CLI output standard puts wrapping at the printer. A
382
+ // continuation flush left would dissolve the common region the indent
383
+ // creates, so every line after the first is padded to the same column the
384
+ // text starts in.
385
+ for (const [index, wrapped] of wrapText(line,
386
+ // Cannot go non-positive: `terminalWidth` floors at 40 and
387
+ // `INFO_TEXT_COLUMN` is 5, so this always leaves 35 columns to wrap
388
+ // into. Said the way the sibling helpers say it (`init.ts`'s `note`
389
+ // and `warnWrapped`), rather than by a second floor of this file's
390
+ // own: a `Math.max(…, 20)` stood here and could never take its right
391
+ // arm, so it read as a guard while the guard it described lived in
392
+ // `terminal.ts` (Codex, PR 1288).
393
+ terminalWidth() - INFO_TEXT_COLUMN).entries()) {
394
+ console.log(index === 0 ? ` i ${wrapped}` : `${' '.repeat(INFO_TEXT_COLUMN)}${wrapped}`);
395
+ }
369
396
  }
370
397
  // Repo-local skills are user-editable, so they are only reported (see
371
398
  // update/assets.ts). The former machine-owned hook-script refresh is gone —
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,OAAO,EACL,kBAAkB,EA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\n\n<!-- Add rules below. Adopt them with `mossbear link` and the dashboard\n grades each session's actions against them. -->\n";
2
1
  export declare const initCommand: import("citty").CommandDef<{
3
2
  force: {
4
3
  type: "boolean";
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAqUA,eAAO,MAAM,kBAAkB,+JAM9B,CAAA;AAyFD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6hDtB,CAAA"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAsaA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6gDtB,CAAA"}
@@ -26,7 +26,7 @@ import { ensureRepoIdKey, repoIdFromRoot } from '../repo-id.js';
26
26
  import { resolveRepoRoot } from '../repo-root.js';
27
27
  import { discoverGuideFiles, summarizeDiscoveryLocations } from '../rules/discover.js';
28
28
  import { adoptable, managedRefusalSummary, resolveImportCandidates, } from '../rules/import-candidates.js';
29
- import { formatImportSummary, importDiscoveredGuides } from '../rules/init-import.js';
29
+ import { formatImportFailure, formatImportSummary, importDiscoveredGuides, } from '../rules/init-import.js';
30
30
  import { BUNDLED_SKILLS } from '../skill-template.js';
31
31
  import { cyan, dim, displayWidth, green, terminalWidth, wrapText } from '../terminal.js';
32
32
  import { verifyDashboardToken } from '../token-verify.js';
@@ -197,8 +197,7 @@ async function writeBundledSkills(cwd, overwrite, noOps) {
197
197
  }
198
198
  if (overwritten.length > 0) {
199
199
  // Say what actually happened: this is an unprompted, unrecoverable
200
- // overwrite, and "updated" reads as a merge. `AGENTS.md` below already
201
- // says "overwrote" for the same operation.
200
+ // overwrite, and "updated" reads as a merge.
202
201
  console.log(did('overwrote', `.claude/skills/ — ${overwritten.join(', ')}`));
203
202
  console.log(note('any local edits to those files are gone'));
204
203
  }
@@ -220,21 +219,21 @@ async function writeBundledSkills(cwd, overwrite, noOps) {
220
219
  /**
221
220
  * The adoption verb, as it is spelled for users.
222
221
  *
223
- * Interpolated into anything Mossbear writes to a user's disk rather than typed
224
- * inline. `AGENTS_MD_TEMPLATE` below is committed into the user's own repo, so a
225
- * hardcoded command name survives every later rename **in a file we can never
226
- * reach again** — which is exactly what happened to `mossbear import` before the
227
- * 2026-08-21 rename. A future call site must not have to remember this
228
- * (Planning Principle 14).
222
+ * One spelling across every line `init` prints, so a later rename is one edit
223
+ * rather than a hunt — `mossbear import` was missed in exactly that way before
224
+ * the 2026-08-21 rename.
225
+ *
226
+ * It used to carry a second, heavier job: it was interpolated into
227
+ * `AGENTS_MD_TEMPLATE`, the starter AGENTS.md `init` wrote into the user's own
228
+ * repo. That is why the constant exists at all. Committing a command name into
229
+ * someone else's repo means a rename leaves stale instructions in a file
230
+ * Mossbear can never reach again, and interpolation did not fix that — it only
231
+ * fixed copies written from then on. `init` no longer writes that file (step 4
232
+ * below says why), so nothing Mossbear generates carries this verb onto a
233
+ * user's disk any more, and the exposure is bounded to repos initialized before
234
+ * that change (`commands/link.ts` → `ADOPT_ALIAS_REMOVAL_CONDITION`).
229
235
  */
230
236
  const ADOPT_VERB = 'mossbear link';
231
- export const AGENTS_MD_TEMPLATE = `# AGENTS.md
232
-
233
- ## Rules
234
-
235
- <!-- Add rules below. Adopt them with \`${ADOPT_VERB}\` and the dashboard
236
- grades each session's actions against them. -->
237
- `;
238
237
  /**
239
238
  * Ask which workspace this repo's guidance belongs to, and commit the answer.
240
239
  *
@@ -308,12 +307,12 @@ async function offerWorkspaceDeclaration(client, cwd, dashboardUrl) {
308
307
  export const initCommand = defineCommand({
309
308
  meta: {
310
309
  name: 'init',
311
- description: 'Set up mossbear: install action logging hook and create AGENTS.md',
310
+ description: 'Set up mossbear: install the action logging hook and wire this repo',
312
311
  },
313
312
  args: {
314
313
  force: {
315
314
  type: 'boolean',
316
- description: 'Overwrite existing ~/.mossbear/config.json, AGENTS.md, and .claude/skills/; ensure .agents/ exists',
315
+ description: 'Overwrite existing ~/.mossbear/config.json and .claude/skills/; ensure .agents/ exists',
317
316
  default: false,
318
317
  },
319
318
  // Declared positively with `default: true` so `--no-skill` works. citty
@@ -328,7 +327,7 @@ export const initCommand = defineCommand({
328
327
  },
329
328
  'skills-only': {
330
329
  type: 'boolean',
331
- description: 'Rewrite only the bundled skills in .claude/skills/, touching nothing else — the safe way to clear skill drift after a CLI upgrade (`--force` would also reset ~/.mossbear/config.json and AGENTS.md)',
330
+ description: 'Rewrite only the bundled skills in .claude/skills/, touching nothing else — the safe way to clear skill drift after a CLI upgrade (`--force` would also reset ~/.mossbear/config.json)',
332
331
  default: false,
333
332
  },
334
333
  'sync-hook': {
@@ -399,9 +398,9 @@ export const initCommand = defineCommand({
399
398
  const noOps = [];
400
399
  // `--skills-only` exists so a user clearing skill drift after an upgrade
401
400
  // has a non-destructive path. The obvious alternative, `--force`, also
402
- // rewrites ~/.mossbear/config.json from defaults — discarding the stored API
403
- // token and every other setting — and replaces AGENTS.md. Refreshing two
404
- // generated skill files should not cost anyone their credentials.
401
+ // rewrites ~/.mossbear/config.json from defaults, discarding the stored API
402
+ // token and every other setting. Refreshing two generated skill files
403
+ // should not cost anyone their credentials.
405
404
  if (args['skills-only']) {
406
405
  await writeBundledSkills(cwd, true, noOps);
407
406
  reportNoOps(noOps);
@@ -412,11 +411,19 @@ export const initCommand = defineCommand({
412
411
  const interactive = args.prompt && process.stdin.isTTY === true;
413
412
  /** `--pull-guides`: restore without prompting, TTY or not. */
414
413
  const forcedPull = args['pull-guides'] === true;
415
- // 0. Scan for guide files the user already has, BEFORE any of the writes
416
- // below. Steps 4 and 6 create an AGENTS.md stub and the bundled skills;
417
- // scanning afterwards would offer to import init's own scaffolding as
418
- // if the user had written it. (Bundled skills are excluded from
419
- // discovery outright — the AGENTS.md stub is not, hence the ordering.)
414
+ // 0. Scan for guide files the user already has, BEFORE step 3 materializes
415
+ // anything. A guide the subscription writes to disk is already in the
416
+ // dashboard, so offering to import it back would be offering the user
417
+ // their own guide as if it were new.
418
+ //
419
+ // This used to guard against a second hazard, and no longer needs to:
420
+ // step 4 wrote an AGENTS.md stub, and a scan afterwards offered init's
421
+ // own scaffolding as if the user had written it. Scanning first only
422
+ // ever fixed the *first* run — by run 2 the stub was on disk and the
423
+ // offer came back (`cli-second-init-imports-its-own-template`). The stub
424
+ // is gone rather than excluded, so there is nothing left to order
425
+ // around. The bundled skills below were never the problem: discovery
426
+ // drops them by reserved directory name, whenever it runs.
420
427
  //
421
428
  // The global roots (`~/.claude/skills`, `~/.cursor/rules`) are walked
422
429
  // recursively and their contents read, so they are scanned only when the
@@ -1144,35 +1151,26 @@ export const initCommand = defineCommand({
1144
1151
  // of its own nor shadows a valid token already in the config.
1145
1152
  const token = await resolveToken(tokenFlagRejected ? '' : args.token).catch(() => '');
1146
1153
  const hasToken = Boolean(token);
1147
- /**
1148
- * Repo-relative POSIX paths this run materialized from the subscription.
1149
- *
1150
- * Read off the reconciler's own report rather than re-derived here:
1151
- * `DocsSyncBundleResult.wroteOutsideDir` is exactly "paths this pass wrote
1152
- * outside the bundle directory", already spelled repo-relative
1153
- * (`packages/cli/src/docs/sync-docs.ts:255`). A guide projected to
1154
- * `AGENTS.md` lands there. Deriving the projection convention a second time
1155
- * inside `init` is how the two would drift.
1156
- *
1157
- * Consumed by step 4, which must not write its template over a file the
1158
- * user's own subscription just put there.
1159
- */
1160
- const materializedPaths = new Set();
1161
1154
  // 3. Offer subscription, and then materialize what was chosen.
1162
1155
  //
1163
- // **This runs before the `AGENTS.md` and `.agents/` steps, and that
1164
- // ordering is the whole of `init-materialize-before-stub`.** Written
1165
- // after them, the stub is on disk before materialization can run — token
1166
- // resolution above is what everything dashboard-facing waits on — so the
1167
- // reconciler meets a local file it did not write, correctly declines it
1168
- // as a both-changed conflict, and the repo ends holding Mossbear's template
1169
- // instead of the user's guidance. That was `unified-item-sync` slice 5's
1170
- // goal criterion 9, deferred by #593 and closed here.
1156
+ // **This ran before the `AGENTS.md` and `.agents/` steps, and that
1157
+ // ordering was the whole of `init-materialize-before-stub`.** Written
1158
+ // after them, the stub was on disk before materialization could run —
1159
+ // token resolution above is what everything dashboard-facing waits on —
1160
+ // so the reconciler met a local file it did not write, correctly
1161
+ // declined it as a both-changed conflict, and the repo ended holding
1162
+ // Mossbear's template instead of the user's guidance. That was
1163
+ // `unified-item-sync` slice 5's goal criterion 9, deferred by #593.
1164
+ //
1165
+ // **The stub it was ordered around no longer exists** (step 4 below says
1166
+ // why), so this is now the only writer of `AGENTS.md` in the command and
1167
+ // the ordering costs nothing to keep. What still depends on running here
1168
+ // is step 0: the scan has to see the repo before materialization adds to
1169
+ // it, or init offers the user their own subscribed guide back.
1171
1170
  //
1172
1171
  // A file the *user* wrote still wins its conflict report — that case is
1173
1172
  // unchanged and deliberately so (`init-materialize-before-stub-plan.md` →
1174
- // Approach). All that changed is that Mossbear's own stub is no longer
1175
- // written first and then treated as the user's work.
1173
+ // Approach).
1176
1174
  //
1177
1175
  // This used to be two steps: a one-shot restore through `mossbear guides
1178
1176
  // export`'s engine, followed by the subscription offer. Slice 5 deleted
@@ -1297,9 +1295,6 @@ export const initCommand = defineCommand({
1297
1295
  { prune: false });
1298
1296
  for (const bundleResult of docsResult.results) {
1299
1297
  console.log(formatDocsSyncLine(bundleResult));
1300
- for (const path of bundleResult.wroteOutsideDir) {
1301
- materializedPaths.add(path);
1302
- }
1303
1298
  }
1304
1299
  }
1305
1300
  }
@@ -1321,39 +1316,19 @@ export const initCommand = defineCommand({
1321
1316
  warnWrapped(describeRequestFailure(err, 'list your bundles', dashboardUrl, 'mossbear init'));
1322
1317
  }
1323
1318
  }
1324
- // 4. AGENTS.md
1319
+ // 4. .agents/
1325
1320
  //
1326
- // `--force` replaces an existing AGENTS.md with the template, which makes
1327
- // step 0's snapshot of it stale. Record that so the import below sends only
1328
- // what is actually on disk — a guide whose content and hash no longer match
1329
- // the file it claims to come from would show as drift on the next watch or
1330
- // export round-trip.
1331
- const clobberedGuidePaths = new Set();
1332
- const agentsMdPath = join(cwd, 'AGENTS.md');
1333
- const agentsMdExists = await access(agentsMdPath)
1334
- .then(() => true)
1335
- .catch(() => false);
1336
- if (materializedPaths.has('AGENTS.md')) {
1337
- // **`--force` does not reach this branch, and that is the point.** Its
1338
- // contract is "replace an existing AGENTS.md with the template"
1339
- // (`:99-103`), which is about a file that was already here when init
1340
- // started — not about a guide the user's own subscription materialized
1341
- // seconds ago in step 3. Without this clause the reorder would fix the
1342
- // default path and leave `mossbear init --force --pull-guides` writing the
1343
- // template over the real guide: the same bug reached through a flag.
1344
- // `agentsMdExists` cannot express it, because it is true either way.
1345
- console.log(' AGENTS.md materialized from your subscription — template not written');
1346
- }
1347
- else if (agentsMdExists && !args.force) {
1348
- noOps.push({ subject: 'AGENTS.md', reason: 'force-overwrites' });
1349
- }
1350
- else {
1351
- await writeFile(agentsMdPath, AGENTS_MD_TEMPLATE);
1352
- if (agentsMdExists)
1353
- clobberedGuidePaths.add('AGENTS.md');
1354
- console.log(did(agentsMdExists ? 'overwrote' : 'created', 'AGENTS.md'));
1355
- }
1356
- // 5. .agents/
1321
+ // No AGENTS.md is written here, deliberately. `init` used to scaffold one
1322
+ // from a template, and every defect that followed came from the file being
1323
+ // Mossbear's rather than the user's: the second `init` offered to import it
1324
+ // as if the user had written it, a container restore refused to overwrite
1325
+ // it and started from the stub instead of the real guide, and the adopt
1326
+ // command it named was committed into a repo Mossbear can never reach
1327
+ // again, so a rename left stale instructions behind. It carried no rules,
1328
+ // so nothing downstream ever read it. The step that told a first user where
1329
+ // guidance goes is the "Next steps" block below, which always names
1330
+ // `mossbear link` — and unlike a file in someone's repo, that line can be
1331
+ // corrected in a release.
1357
1332
  const agentsDirPath = join(cwd, '.agents');
1358
1333
  const agentsDirExists = await access(agentsDirPath)
1359
1334
  .then(() => true)
@@ -1370,41 +1345,33 @@ export const initCommand = defineCommand({
1370
1345
  await writeFile(join(agentsDirPath, '.gitkeep'), '');
1371
1346
  console.log(did('created', '.agents/'));
1372
1347
  }
1373
- // 6. Claude Code skills (mossbear + context-layer round-trip skills)
1348
+ // 5. Claude Code skills (mossbear + context-layer round-trip skills)
1374
1349
  //
1375
- // **Deliberately not given step 4's `materializedPaths` guard**, even
1376
- // though the reorder moved materialization ahead of this too, so under
1377
- // `--force` this can overwrite a file step 3 just materialized.
1350
+ // **Under `--force` this overwrites a file step 3 may have just
1351
+ // materialized, deliberately.** Step 3 runs first, so the window is real.
1378
1352
  //
1379
- // The window is much narrower than it looks, and an earlier version of this
1380
- // comment overstated it (corrected on review of #610): it claimed
1381
- // `mossbear import` would have filed Mossbear's own bundled skills as
1382
- // guides, since `.claude/skills` is a discovery root. It does not —
1383
- // `discoverGuideFiles` drops them by reserved directory name
1384
- // (`isBundledSkillPath`, `rules/bundled-skills.ts:30`, applied at
1385
- // `rules/discover.ts:367`) precisely so the CLI's tooling is never imported
1386
- // as user guidance. A guide reaches one of these paths only by being given
1387
- // one deliberately in the dashboard, or by an import predating that
1388
- // exclusion.
1353
+ // It is much narrower than it looks, and an earlier version of this comment
1354
+ // overstated it (corrected on review of #610): it claimed `mossbear import`
1355
+ // would have filed Mossbear's own bundled skills as guides, since
1356
+ // `.claude/skills` is a discovery root. It does not — `discoverGuideFiles`
1357
+ // drops them by reserved directory name (`isBundledSkillPath`,
1358
+ // `rules/bundled-skills.ts:35`, applied at `rules/discover.ts:393`)
1359
+ // precisely so the CLI's tooling is never imported as user guidance. A
1360
+ // guide reaches one of these paths only by being given one deliberately in
1361
+ // the dashboard, or by an import predating that exclusion.
1389
1362
  //
1390
- // Same shape as the `AGENTS.md` hazard, and resolved the opposite way on
1391
- // purpose:
1363
+ // A bundled skill is *Mossbear's own artifact* and is expected to track the
1364
+ // installed CLI — the version-drift notice tells users to rewrite it
1365
+ // (`mossbear init --skills-only`), and `--force` documents `.claude/skills/`
1366
+ // as something it overwrites. Preserving a materialized copy here would pin
1367
+ // a stale skill and make the documented refresh path a no-op.
1392
1368
  //
1393
- // - `AGENTS.md` holds the *user's* guidance, and `--force`'s intent there is
1394
- // "replace the template-or-stale file that was already here", not "discard
1395
- // what my subscription just delivered".
1396
- // - A bundled skill is *Mossbear's own artifact* and is expected to track the
1397
- // installed CLI — the version-drift notice tells users to rewrite it
1398
- // (`mossbear init --skills-only`), and `--force` documents `.claude/skills/`
1399
- // as something it overwrites (`:102`). Preserving a materialized copy here
1400
- // would pin a stale skill and make the documented refresh path a no-op.
1401
- //
1402
- // Named rather than left implicit, because "why does one path guard and the
1403
- // other not" is the question a reader arrives with.
1369
+ // Named rather than left implicit, because "why does this overwrite what
1370
+ // step 3 delivered" is the question a reader arrives with.
1404
1371
  if (args.skill) {
1405
1372
  await writeBundledSkills(cwd, args.force, noOps);
1406
1373
  }
1407
- // 7. Optional: ask whether to enable global rule discovery
1374
+ // 6. Optional: ask whether to enable global rule discovery
1408
1375
  if (interactive) {
1409
1376
  const alreadyEnabled = await readConfigDiscoverGlobal().catch(() => false);
1410
1377
  if (alreadyEnabled) {
@@ -1518,7 +1485,7 @@ export const initCommand = defineCommand({
1518
1485
  }
1519
1486
  }
1520
1487
  }
1521
- // 8. Optional: import the guide files this repo already had (step 0's scan)
1488
+ // 7. Optional: import the guide files this repo already had (step 0's scan)
1522
1489
  // into the dashboard. Most repos arrive with an AGENTS.md or CLAUDE.md
1523
1490
  // already written, and without this the only way to get them in was to
1524
1491
  // know `mossbear import` exists. Runs before the pull below so
@@ -1529,7 +1496,7 @@ export const initCommand = defineCommand({
1529
1496
  // projected guide the placement record claims) is canonical in the
1530
1497
  // dashboard, and re-importing it from disk would create a second guide row.
1531
1498
  const importRoot = resolveRepoRoot(process.cwd());
1532
- const initCandidates = await resolveImportCandidates(repoGuideFiles.filter((f) => !clobberedGuidePaths.has(f.payloadPath)), importRoot);
1499
+ const initCandidates = await resolveImportCandidates(repoGuideFiles, importRoot);
1533
1500
  const importableGuideFiles = adoptable(initCandidates).map((candidate) => candidate.file);
1534
1501
  // Grouped by bundle, not one sentence per file: run against a copy of this
1535
1502
  // repo on 2026-09-03 that was 24 sentences, each wrapping to two lines, for
@@ -1547,11 +1514,6 @@ export const initCommand = defineCommand({
1547
1514
  console.log(wrapped.map((text, i) => (i === 0 ? ` ${text}` : pad + text)).join('\n'));
1548
1515
  console.log(note(group.note));
1549
1516
  }
1550
- for (const file of repoGuideFiles) {
1551
- if (clobberedGuidePaths.has(file.payloadPath)) {
1552
- console.log(` ${file.displayPath} was replaced by --force — its previous contents are not imported.`);
1553
- }
1554
- }
1555
1517
  if (hasToken && importableGuideFiles.length > 0 && args['import-guides'] !== false) {
1556
1518
  let shouldImport = args['import-guides'] === true;
1557
1519
  if (!shouldImport && interactive) {
@@ -1595,8 +1557,21 @@ export const initCommand = defineCommand({
1595
1557
  console.log(line);
1596
1558
  }
1597
1559
  catch (err) {
1598
- console.warn(` warning: could not import guide files — ${errText(err)}`);
1599
- console.warn(` Retry any time with \`${ADOPT_VERB}\`.`);
1560
+ // Fourth site of the leak `describeRequestFailure` exists to close,
1561
+ // and the one that reaches an answer *about the request*: the import
1562
+ // route refuses a declared workspace this account cannot reach, and
1563
+ // refuses an import with two places to land, in sentences written for
1564
+ // whoever ran `mossbear init`. `errText` wrapped both in an HTTP
1565
+ // status and a JSON body. The retry it used to name on its own line is
1566
+ // now inside the sentence, or omitted where the server's own remedy
1567
+ // has to happen first.
1568
+ for (const line of formatImportFailure(err, {
1569
+ subject: 'import your guide files',
1570
+ dashboardUrl,
1571
+ retry: ADOPT_VERB,
1572
+ })) {
1573
+ console.warn(line);
1574
+ }
1600
1575
  }
1601
1576
  }
1602
1577
  }
@@ -1687,7 +1662,19 @@ export const initCommand = defineCommand({
1687
1662
  else {
1688
1663
  console.log('\nDone. Next steps:');
1689
1664
  }
1690
- console.log(' Edit AGENTS.md to add your rules');
1665
+ // Read from disk rather than assumed either way. `init` no longer writes an
1666
+ // AGENTS.md, so "edit AGENTS.md" points at nothing in a fresh repo — but
1667
+ // step 3 may have just materialized one from the subscription, and an
1668
+ // unconditional "create it" then tells the user to start a second guide
1669
+ // file two lines above an offer to adopt the ones they already have
1670
+ // (caught in the shipped terminal capture, which is a repo with guide
1671
+ // files). One `access` is what keeps the sentence true in both.
1672
+ const rulesFileExists = await access(join(cwd, 'AGENTS.md'))
1673
+ .then(() => true)
1674
+ .catch(() => false);
1675
+ console.log(rulesFileExists
1676
+ ? ' Edit AGENTS.md to add your rules'
1677
+ : ' Create AGENTS.md and write your rules in it');
1691
1678
  for (const step of nextSteps) {
1692
1679
  // Padded before colouring, never after: escape codes count toward
1693
1680
  // `String.length` and occupy no columns, so padding a coloured string pads