mossbear 0.1.0-alpha.29 → 0.1.0-alpha.31

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 (170) hide show
  1. package/README.md +28 -8
  2. package/dist/commands/doctor.d.ts.map +1 -1
  3. package/dist/commands/doctor.js +38 -62
  4. package/dist/commands/doctor.js.map +1 -1
  5. package/dist/commands/guides/history.d.ts +72 -0
  6. package/dist/commands/guides/history.d.ts.map +1 -0
  7. package/dist/commands/guides/history.js +217 -0
  8. package/dist/commands/guides/history.js.map +1 -0
  9. package/dist/commands/guides/index.d.ts.map +1 -1
  10. package/dist/commands/guides/index.js +4 -0
  11. package/dist/commands/guides/index.js.map +1 -1
  12. package/dist/commands/init.d.ts.map +1 -1
  13. package/dist/commands/init.js +71 -4
  14. package/dist/commands/init.js.map +1 -1
  15. package/dist/commands/mcp.d.ts.map +1 -1
  16. package/dist/commands/mcp.js +6 -4
  17. package/dist/commands/mcp.js.map +1 -1
  18. package/dist/commands/pull.d.ts +22 -0
  19. package/dist/commands/pull.d.ts.map +1 -1
  20. package/dist/commands/pull.js +150 -75
  21. package/dist/commands/pull.js.map +1 -1
  22. package/dist/commands/session-start.d.ts +2 -0
  23. package/dist/commands/session-start.d.ts.map +1 -0
  24. package/dist/commands/session-start.js +178 -0
  25. package/dist/commands/session-start.js.map +1 -0
  26. package/dist/commands/status.d.ts.map +1 -1
  27. package/dist/commands/status.js +39 -25
  28. package/dist/commands/status.js.map +1 -1
  29. package/dist/commands/sync.d.ts.map +1 -1
  30. package/dist/commands/sync.js +59 -2
  31. package/dist/commands/sync.js.map +1 -1
  32. package/dist/commit-anchor.d.ts +25 -0
  33. package/dist/commit-anchor.d.ts.map +1 -0
  34. package/dist/commit-anchor.js +93 -0
  35. package/dist/commit-anchor.js.map +1 -0
  36. package/dist/config.d.ts +13 -0
  37. package/dist/config.d.ts.map +1 -1
  38. package/dist/config.js +19 -36
  39. package/dist/config.js.map +1 -1
  40. package/dist/context/materialize.d.ts +200 -0
  41. package/dist/context/materialize.d.ts.map +1 -0
  42. package/dist/context/materialize.js +145 -0
  43. package/dist/context/materialize.js.map +1 -0
  44. package/dist/context/pull.d.ts +38 -54
  45. package/dist/context/pull.d.ts.map +1 -1
  46. package/dist/context/pull.js +34 -288
  47. package/dist/context/pull.js.map +1 -1
  48. package/dist/docs/guide-projection.d.ts +32 -0
  49. package/dist/docs/guide-projection.d.ts.map +1 -1
  50. package/dist/docs/guide-projection.js +55 -27
  51. package/dist/docs/guide-projection.js.map +1 -1
  52. package/dist/docs/relink-mapping.d.ts.map +1 -1
  53. package/dist/docs/relink-mapping.js +2 -3
  54. package/dist/docs/relink-mapping.js.map +1 -1
  55. package/dist/docs/repo-config.d.ts +0 -6
  56. package/dist/docs/repo-config.d.ts.map +1 -1
  57. package/dist/docs/repo-config.js +7 -37
  58. package/dist/docs/repo-config.js.map +1 -1
  59. package/dist/docs/sidecar.d.ts.map +1 -1
  60. package/dist/docs/sidecar.js +11 -3
  61. package/dist/docs/sidecar.js.map +1 -1
  62. package/dist/docs/status.d.ts +130 -14
  63. package/dist/docs/status.d.ts.map +1 -1
  64. package/dist/docs/status.js +160 -18
  65. package/dist/docs/status.js.map +1 -1
  66. package/dist/docs/subscribe.d.ts +14 -17
  67. package/dist/docs/subscribe.d.ts.map +1 -1
  68. package/dist/docs/subscribe.js +15 -46
  69. package/dist/docs/subscribe.js.map +1 -1
  70. package/dist/docs/sync-docs.d.ts +72 -3
  71. package/dist/docs/sync-docs.d.ts.map +1 -1
  72. package/dist/docs/sync-docs.js +491 -917
  73. package/dist/docs/sync-docs.js.map +1 -1
  74. package/dist/docs/sync-plan.d.ts +517 -0
  75. package/dist/docs/sync-plan.d.ts.map +1 -0
  76. package/dist/docs/sync-plan.js +872 -0
  77. package/dist/docs/sync-plan.js.map +1 -0
  78. package/dist/env-flag.d.ts +15 -0
  79. package/dist/env-flag.d.ts.map +1 -0
  80. package/dist/env-flag.js +21 -0
  81. package/dist/env-flag.js.map +1 -0
  82. package/dist/hooks-settings.d.ts +129 -40
  83. package/dist/hooks-settings.d.ts.map +1 -1
  84. package/dist/hooks-settings.js +159 -56
  85. package/dist/hooks-settings.js.map +1 -1
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +1 -0
  88. package/dist/index.js.map +1 -1
  89. package/dist/mcp/client.d.ts +28 -0
  90. package/dist/mcp/client.d.ts.map +1 -1
  91. package/dist/mcp/client.js +56 -13
  92. package/dist/mcp/client.js.map +1 -1
  93. package/dist/mcp/import-tool.d.ts +19 -7
  94. package/dist/mcp/import-tool.d.ts.map +1 -1
  95. package/dist/mcp/import-tool.js +5 -5
  96. package/dist/mcp/import-tool.js.map +1 -1
  97. package/dist/mcp/scope.d.ts +35 -2
  98. package/dist/mcp/scope.d.ts.map +1 -1
  99. package/dist/mcp/scope.js +34 -2
  100. package/dist/mcp/scope.js.map +1 -1
  101. package/dist/mcp/server.d.ts +29 -12
  102. package/dist/mcp/server.d.ts.map +1 -1
  103. package/dist/mcp/server.js +335 -73
  104. package/dist/mcp/server.js.map +1 -1
  105. package/dist/mcp/write-items.d.ts +73 -14
  106. package/dist/mcp/write-items.d.ts.map +1 -1
  107. package/dist/mcp/write-items.js +90 -22
  108. package/dist/mcp/write-items.js.map +1 -1
  109. package/dist/mossbear-paths.d.ts +10 -0
  110. package/dist/mossbear-paths.d.ts.map +1 -1
  111. package/dist/mossbear-paths.js +10 -0
  112. package/dist/mossbear-paths.js.map +1 -1
  113. package/dist/project-hooks.d.ts +60 -0
  114. package/dist/project-hooks.d.ts.map +1 -0
  115. package/dist/project-hooks.js +93 -0
  116. package/dist/project-hooks.js.map +1 -0
  117. package/dist/rules/guide-history-client.d.ts +70 -0
  118. package/dist/rules/guide-history-client.d.ts.map +1 -0
  119. package/dist/rules/guide-history-client.js +121 -0
  120. package/dist/rules/guide-history-client.js.map +1 -0
  121. package/dist/rules/import-paths.js +2 -2
  122. package/dist/rules/import-paths.js.map +1 -1
  123. package/dist/rules/repo-identity.d.ts +45 -0
  124. package/dist/rules/repo-identity.d.ts.map +1 -0
  125. package/dist/rules/repo-identity.js +59 -0
  126. package/dist/rules/repo-identity.js.map +1 -0
  127. package/dist/run-self-report.d.ts +68 -0
  128. package/dist/run-self-report.d.ts.map +1 -0
  129. package/dist/run-self-report.js +49 -0
  130. package/dist/run-self-report.js.map +1 -0
  131. package/dist/session-start/environment.d.ts +46 -0
  132. package/dist/session-start/environment.d.ts.map +1 -0
  133. package/dist/session-start/environment.js +82 -0
  134. package/dist/session-start/environment.js.map +1 -0
  135. package/dist/session-start/record.d.ts +47 -0
  136. package/dist/session-start/record.d.ts.map +1 -0
  137. package/dist/session-start/record.js +87 -0
  138. package/dist/session-start/record.js.map +1 -0
  139. package/dist/session-start/report.d.ts +62 -0
  140. package/dist/session-start/report.d.ts.map +1 -0
  141. package/dist/session-start/report.js +91 -0
  142. package/dist/session-start/report.js.map +1 -0
  143. package/dist/skill-template.d.ts +3 -3
  144. package/dist/skill-template.d.ts.map +1 -1
  145. package/dist/skill-template.js +63 -32
  146. package/dist/skill-template.js.map +1 -1
  147. package/dist/soft-json.d.ts +34 -0
  148. package/dist/soft-json.d.ts.map +1 -0
  149. package/dist/soft-json.js +44 -0
  150. package/dist/soft-json.js.map +1 -0
  151. package/dist/state/machine-cache.d.ts +34 -0
  152. package/dist/state/machine-cache.d.ts.map +1 -1
  153. package/dist/state/machine-cache.js +37 -0
  154. package/dist/state/machine-cache.js.map +1 -1
  155. package/dist/sync-batches.d.ts +22 -1
  156. package/dist/sync-batches.d.ts.map +1 -1
  157. package/dist/sync-batches.js +17 -0
  158. package/dist/sync-batches.js.map +1 -1
  159. package/dist/transcript/narration.d.ts +46 -0
  160. package/dist/transcript/narration.d.ts.map +1 -1
  161. package/dist/transcript/narration.js +69 -4
  162. package/dist/transcript/narration.js.map +1 -1
  163. package/dist/update/assets.d.ts.map +1 -1
  164. package/dist/update/assets.js +7 -57
  165. package/dist/update/assets.js.map +1 -1
  166. package/dist/update/notice.d.ts +40 -1
  167. package/dist/update/notice.d.ts.map +1 -1
  168. package/dist/update/notice.js +18 -20
  169. package/dist/update/notice.js.map +1 -1
  170. package/package.json +12 -14
package/README.md CHANGED
@@ -1,8 +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 the guides you write (`AGENTS.md`, `CLAUDE.md`, `.cursorrules`, …) and shows you which instructions work.
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.
4
4
 
5
- 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 **only action metadata** to your dashboard, which grades the run against your guides. Raw hook data, file contents, and conversation transcripts never leave your machine.
5
+ 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
6
 
7
7
  ## Install
8
8
 
@@ -39,6 +39,10 @@ export MOSSBEAR_NO_UPDATE_CHECK=1 # or NO_UPDATE_NOTIFIER=1
39
39
 
40
40
  …or set `"updateCheck": false` in `~/.mossbear/config.json`. The check reads npm's public registry for the published version number only; it sends nothing about you or your machine.
41
41
 
42
+ **Where the machine is rebuilt between sessions** — a cloud agent container, a Codespace, a devcontainer — the SessionStart hook `mossbear init` writes runs `mossbear session-start`, which *installs* the newer release rather than printing a notice: a snapshot frozen on the release that was current on build day would otherwise stay there while releases keep shipping. It never does this on a machine that persists. The opt-outs above apply to it unchanged — with `MOSSBEAR_NO_UPDATE_CHECK=1` or `"updateCheck": false`, nothing is checked and nothing is installed. To leave the hook out entirely, run `mossbear init --no-session-start-hook`.
43
+
44
+ The environment is detected from the host's own variables (`CLAUDE_CODE_REMOTE`, `CODESPACES`, `DEVCONTAINER`, `REMOTE_CONTAINERS`). `MOSSBEAR_EPHEMERAL` overrides that in both directions — set it truthy on a host not in that list, or to `0`/`false` on one that is. `mossbear doctor` reports which of them decided, and what the last session start did.
45
+
42
46
  ## Quick start
43
47
 
44
48
  ```bash
@@ -69,10 +73,7 @@ mossbear sync --token <token> # remembered after the first successful sync
69
73
  | `mossbear pull <bundle>` | Pull a context bundle's canonical items into a local directory as Markdown (default `.mossbear/context/<bundle>/`) |
70
74
  | `mossbear mcp` | Run the Mossbear MCP server, exposing your context layer (bundles + inbox) to any agent |
71
75
  | `mossbear link` | Adopt this repo's existing guide files (`AGENTS.md`, `.agents/`, `CLAUDE.md`, `.claude/rules/`, `.cursorrules`, `.cursor/rules/*.mdc`) into your dashboard — pick from a list, never type a path |
72
- <<<<<<< HEAD
73
76
  | `mossbear unlink <file>` | Stop delivering a file you linked — it stays on disk, and `mossbear link` puts it back |
74
- =======
75
- >>>>>>> origin/main
76
77
  | `mossbear guides active` / `search` | List or search your synced guides |
77
78
  | `mossbear suggest` | Review pending guide suggestions |
78
79
  | `mossbear status` | Show pending actions + config status |
@@ -102,9 +103,28 @@ It reads the dashboard URL from `~/.mossbear/config.json`, so a `--dashboard-url
102
103
 
103
104
  ## Privacy
104
105
 
105
- - The CLI runs no LLM calls and holds no provider credentials. Grading happens on the dashboard, over the action metadata and guide text you synced — never file contents.
106
- - Only action metadata and guide file content you explicitly import are synced. Shell command text is secret-redacted and length-capped before it is recorded at all.
107
- - No telemetry.
106
+ The CLI runs no LLM calls and holds no provider credentials, and produces no verdict of its own — grading happens on the dashboard, over what you synced. There is no telemetry.
107
+
108
+ **Stays on your machine, always:** your file contents, your diffs, raw hook payloads, and full conversation transcripts.
109
+
110
+ **Sent to your dashboard.** Five classes, and nothing else:
111
+
112
+ 1. **Action metadata** — tool-call types, one-line summaries, and file *paths* (never contents). Shell command text is secret-redacted and length-capped before it is recorded at all.
113
+ 2. **Guide-file manifests** — the paths, formats and SHA-256 hashes of the instruction files that were in your agent's context, so a verdict can name which version of a guide it graded against.
114
+ 3. **Token usage**, read out of the transcript locally.
115
+ 4. **Content you explicitly push** — guide files you `mossbear link`, and context you capture or push through the MCP server.
116
+ 5. **Two kinds of derived prose**: drafted guide suggestions (their text and the reasoning behind them), and a short narration of what you and the agent said, which the dashboard shows as evidence beside a verdict. Both are extracted from the transcript **on your machine**, have code blocks stripped structurally before upload, and are length-capped on the wire.
117
+
118
+ That fifth class is the one worth deciding about, because it is prose rather than metadata. Narration is per-repo and you can turn it off:
119
+
120
+ ```bash
121
+ mossbear narration # show the current setting for this repo
122
+ mossbear narration off # stop sending transcript excerpts from here
123
+ ```
124
+
125
+ Guide suggestions have no equivalent switch yet — if you do not want drafted suggestions leaving the machine, do not run `mossbear sync` in that repo.
126
+
127
+ We enumerate these rather than summarising them as "metadata" on purpose: this is a promise you can check by watching your own network traffic, and one you can check is worth more than one you cannot.
108
128
 
109
129
  ## Links
110
130
 
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AA2GA,eAAO,MAAM,aAAa;;;;;;;;;;;EAyPxB,CAAA"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAmDA,eAAO,MAAM,aAAa;;;;;;;;;;;EAwRxB,CAAA"}
@@ -1,70 +1,22 @@
1
- import { readFile } from 'node:fs/promises';
2
- import { join } from 'node:path';
3
1
  import { defineCommand } from 'citty';
4
2
  import { MOSSBEAR_TOKEN_ENV, readEnvToken, resolveDashboardUrl, resolveToken, } from '../config.js';
5
3
  import { describeDashboardHealth } from '../dashboard-health.js';
6
4
  import { describeGuideDelivery } from '../docs/delivery-check.js';
7
5
  import { repoBundleIds } from '../docs/delivery.js';
8
6
  import { collidesWithHomeConfig, readRepoDocsConfig } from '../docs/repo-config.js';
9
- import { MOSSBEAR_HOOK_COMMAND, MOSSBEAR_SYNC_COMMAND, isMossbearLoggerCommand, stopHookUploadsActions, } from '../hooks-settings.js';
7
+ import { MOSSBEAR_HOOK_COMMAND, MOSSBEAR_SYNC_COMMAND, sessionStartHookAlreadyPulls, sessionStartHookUpdatesCli, sessionStartHookBootstraps, stopHookUploadsActions, } from '../hooks-settings.js';
10
8
  import { createContextClient } from '../mcp/client.js';
11
9
  import { resolveOnPath } from '../path-resolve.js';
10
+ import { detectLoggerHook, readProjectHooks } from '../project-hooks.js';
12
11
  import { resolveRepoRoot } from '../repo-root.js';
13
12
  import { discoverGuideFiles } from '../rules/discover.js';
13
+ import { readSessionStartRecord } from '../session-start/record.js';
14
+ import { describeSessionStart } from '../session-start/report.js';
14
15
  import { verifyDashboardToken } from '../token-verify.js';
15
16
  import { detectBundledSkillDrift } from '../update/assets.js';
16
17
  import { checkForUpdate, formatUpdateNotice } from '../update/notice.js';
17
18
  import { formatUpdateSuccess, performUpdate, syncGeneratedAssets, } from '../update/perform.js';
18
19
  import { CLI_VERSION } from '../version.js';
19
- /** The project's parsed `.claude/settings.json`, or null when absent/malformed. */
20
- async function readProjectSettings() {
21
- const settingsPath = join(process.cwd(), '.claude', 'settings.json');
22
- try {
23
- const raw = await readFile(settingsPath, 'utf8');
24
- return JSON.parse(raw);
25
- }
26
- catch {
27
- return null;
28
- }
29
- }
30
- /**
31
- * Which form of the logger hook this project's settings configure for one
32
- * event, if any. Shared by `PostToolUse` (the success logger) and
33
- * `PostToolUseFailure` (`hook-failure-event-registration`) — same command,
34
- * same recognizer, only the settings.json key differs.
35
- */
36
- function detectConfiguredHookFor(settings, event) {
37
- try {
38
- if (!settings)
39
- return { form: 'none' };
40
- const hooks = settings['hooks'];
41
- const groups = hooks?.[event];
42
- if (!Array.isArray(groups))
43
- return { form: 'none' };
44
- // Shares the recognizer with the merge so the two cannot disagree about
45
- // what counts as configured — the substring match this replaced would miss
46
- // the portable command and call a correctly wired repo unconfigured.
47
- for (const group of groups) {
48
- const groupHooks = group['hooks'];
49
- if (!Array.isArray(groupHooks))
50
- continue;
51
- for (const hook of groupHooks) {
52
- if (typeof hook === 'object' && hook !== null) {
53
- if (isMossbearLoggerCommand(hook['command'])) {
54
- return { form: 'portable' };
55
- }
56
- }
57
- }
58
- }
59
- return { form: 'none' };
60
- }
61
- catch {
62
- return { form: 'none' };
63
- }
64
- }
65
- function detectConfiguredHook(settings) {
66
- return detectConfiguredHookFor(settings, 'PostToolUse');
67
- }
68
20
  /**
69
21
  * True when this project's Stop hooks upload the session (`mossbear sync`).
70
22
  *
@@ -75,10 +27,7 @@ function detectConfiguredHook(settings) {
75
27
  * is destroyed at session end the entire record is lost with it. Doctor
76
28
  * reporting all-clear in that state is what let it go unnoticed here.
77
29
  */
78
- function detectUploadHook(settings) {
79
- if (!settings)
80
- return false;
81
- const hooks = settings['hooks'];
30
+ function detectUploadHook(hooks) {
82
31
  return stopHookUploadsActions(hooks?.['Stop']);
83
32
  }
84
33
  export const doctorCommand = defineCommand({
@@ -99,12 +48,24 @@ export const doctorCommand = defineCommand({
99
48
  },
100
49
  },
101
50
  async run({ args }) {
102
- const settings = await readProjectSettings();
103
- const hook = detectConfiguredHook(settings);
104
- const hooksConfigured = hook.form !== 'none';
105
- const failureHook = detectConfiguredHookFor(settings, 'PostToolUseFailure');
106
- const failureHookConfigured = failureHook.form !== 'none';
107
- const uploadConfigured = detectUploadHook(settings);
51
+ const projectHooks = await readProjectHooks(process.cwd());
52
+ const hooksConfigured = detectLoggerHook(projectHooks, 'PostToolUse') !== null;
53
+ const failureHookConfigured = detectLoggerHook(projectHooks, 'PostToolUseFailure') !== null;
54
+ const uploadConfigured = detectUploadHook(projectHooks);
55
+ // Reported rather than checked — see `describeSessionStart`. This hook is
56
+ // the one `mossbear init` lets a user decline, and its absence is
57
+ // indistinguishable from having declined it.
58
+ const sessionStartConfigured = sessionStartHookBootstraps(projectHooks?.['SessionStart']);
59
+ // Broader than the bootstrap: a repo whose SessionStart hook is a
60
+ // `mossbear sync` the user wrote pulls its bundles perfectly well, and
61
+ // `init` deliberately leaves it alone. Telling that repo it opens with
62
+ // whatever it last pulled would be false.
63
+ const sessionStartPulls = sessionStartHookAlreadyPulls(projectHooks?.['SessionStart']);
64
+ // The `mossbear update --yes` conditional the cloud recipe told users to
65
+ // paste, which nothing migrates — this repo's own settings file still
66
+ // carries it. Without it the report tells those repos the CLI is never
67
+ // updated for them, while that hook updates it on every cloud session.
68
+ const sessionStartUpdates = sessionStartHookUpdatesCli(projectHooks?.['SessionStart']);
108
69
  const hookBinPath = resolveOnPath(MOSSBEAR_HOOK_COMMAND);
109
70
  // The Stop hooks invoke `mossbear`, which ships as a separate bin from
110
71
  // `mossbear-hook` and can be missing while the other resolves.
@@ -268,6 +229,21 @@ export const doctorCommand = defineCommand({
268
229
  verification = await verifyDashboardToken(dashboardUrl, token);
269
230
  console.log(` i ${describeDashboardHealth(verification, dashboardUrl)}`);
270
231
  }
232
+ // What the session-start hook is and what it last did. Informational, and
233
+ // above the skill-drift note for the same reason the token source is: this
234
+ // is the answer to "what has been installing things on my machine", and
235
+ // Charter Commitment 2 is only discharged if a user can find it without
236
+ // reading their `.claude/settings.json`
237
+ // (`docs/plans/onboarding-magic-plan.md` §2.4).
238
+ for (const line of describeSessionStart({
239
+ hookInstalled: sessionStartConfigured,
240
+ alreadyPulls: sessionStartPulls,
241
+ legacyFreshness: sessionStartUpdates,
242
+ cliOnPath: mossbearBinPath !== null,
243
+ record: await readSessionStartRecord(),
244
+ })) {
245
+ console.log(` i ${line}`);
246
+ }
271
247
  // Repo-local skills are user-editable, so they are only reported (see
272
248
  // update/assets.ts). The former machine-owned hook-script refresh is gone —
273
249
  // agents invoke `mossbear-hook`, which always runs the installed package.
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAA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AC3D,OAAO,CAAC,IAAI,CACV,oBAAoB,MAAM,CAAC,MAAM,wBAAwB,MAAM,CAAC,OAAO,EAAE,CAC1E,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,72 @@
1
+ import type { GuideHistoryChange } from '@mossbear/protocol';
2
+ /**
3
+ * `mossbear guides history <guide>` — what grading found about one guide.
4
+ *
5
+ * The shell twin of the `guide_history` MCP tool, over the same endpoint and
6
+ * the same client (`rules/guide-history-client.ts`). Both exist because an
7
+ * improvement session's wiring is not knowable in advance: an MCP-wired agent
8
+ * calls the tool, and any other agent — or the user, at a prompt — runs this
9
+ * (spec → Resolved, 2026-08-22).
10
+ *
11
+ * **This one reaches the network**, unlike `guides active` and `guides search`,
12
+ * which read the local cache. Verdicts are the server's and the CLI holds none
13
+ * of them by design, so there is nothing local to read here.
14
+ *
15
+ * `--json` is not a convenience flag: an agent invoking this through a shell
16
+ * wants the payload the MCP tool returns, delimiters included, rather than
17
+ * prose it has to parse back.
18
+ */
19
+ export declare const guidesHistoryCommand: import("citty").CommandDef<{
20
+ guide: {
21
+ type: "positional";
22
+ description: string;
23
+ required: true;
24
+ };
25
+ root: {
26
+ type: "string";
27
+ description: string;
28
+ default: string;
29
+ };
30
+ 'guide-id': {
31
+ type: "string";
32
+ description: string;
33
+ default: string;
34
+ };
35
+ json: {
36
+ type: "boolean";
37
+ description: string;
38
+ default: false;
39
+ };
40
+ token: {
41
+ type: "string";
42
+ description: string;
43
+ default: string;
44
+ };
45
+ 'dashboard-url': {
46
+ type: "string";
47
+ description: string;
48
+ default: string;
49
+ };
50
+ }>;
51
+ /**
52
+ * The last edit's two windows, as sentences.
53
+ *
54
+ * **A window and its denominators, and then it stops.** "Since" is the
55
+ * strongest word the evidence supports — the model changed, the task mix
56
+ * changed and the codebase changed too — so nothing here says the edit caused
57
+ * what followed it, and the date is a boundary rather than an attribution.
58
+ *
59
+ * **A suppressed pair is a sentence, not a silence**, and so is a guide with no
60
+ * earlier wording. Printing nothing in either case would leave a reader unable
61
+ * to tell "too few runs to say" from "this edit changed nothing", which are
62
+ * opposite statements — the same reason the payload carries `change: null`
63
+ * rather than omitting the key.
64
+ *
65
+ * **A regression reads exactly like an improvement**: same place, same words,
66
+ * different verb. It is the more useful of the two, because it says the
67
+ * guidance is not the lever.
68
+ *
69
+ * Exported for its unit test, and pure so that test needs no network.
70
+ */
71
+ export declare function guideChangeLines(change: GuideHistoryChange | null): string[];
72
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/commands/guides/history.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,kBAAkB,EAEnB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoF/B,CAAA;AA2EF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,GAAG,MAAM,EAAE,CAuC5E"}
@@ -0,0 +1,217 @@
1
+ import { defineCommand } from 'citty';
2
+ import { resolveDashboardUrl, resolveToken } from '../../config.js';
3
+ import { errText } from '../../err-text.js';
4
+ import { fetchGuideHistory } from '../../rules/guide-history-client.js';
5
+ import { resolveRepoIdentity } from '../../rules/repo-identity.js';
6
+ /**
7
+ * `mossbear guides history <guide>` — what grading found about one guide.
8
+ *
9
+ * The shell twin of the `guide_history` MCP tool, over the same endpoint and
10
+ * the same client (`rules/guide-history-client.ts`). Both exist because an
11
+ * improvement session's wiring is not knowable in advance: an MCP-wired agent
12
+ * calls the tool, and any other agent — or the user, at a prompt — runs this
13
+ * (spec → Resolved, 2026-08-22).
14
+ *
15
+ * **This one reaches the network**, unlike `guides active` and `guides search`,
16
+ * which read the local cache. Verdicts are the server's and the CLI holds none
17
+ * of them by design, so there is nothing local to read here.
18
+ *
19
+ * `--json` is not a convenience flag: an agent invoking this through a shell
20
+ * wants the payload the MCP tool returns, delimiters included, rather than
21
+ * prose it has to parse back.
22
+ */
23
+ export const guidesHistoryCommand = defineCommand({
24
+ meta: {
25
+ name: 'history',
26
+ description: 'Show what grading found about one guide or skill (reads the dashboard)',
27
+ },
28
+ args: {
29
+ guide: {
30
+ type: 'positional',
31
+ description: "The guide file's path (.claude/skills/reviewer/SKILL.md, AGENTS.md) or a bare skill name (reviewer)",
32
+ required: true,
33
+ },
34
+ root: {
35
+ type: 'string',
36
+ description: 'project or global — which discovery root, when a name reaches both',
37
+ default: '',
38
+ },
39
+ 'guide-id': {
40
+ type: 'string',
41
+ description: 'The exact guide, when a name reached several and the refusal listed them',
42
+ default: '',
43
+ },
44
+ json: {
45
+ type: 'boolean',
46
+ description: 'Print the raw payload instead of a summary',
47
+ default: false,
48
+ },
49
+ token: {
50
+ type: 'string',
51
+ description: 'Mossbear API token — overrides the stored one for this call',
52
+ default: '',
53
+ },
54
+ 'dashboard-url': {
55
+ type: 'string',
56
+ description: 'Override the dashboard base URL',
57
+ default: '',
58
+ },
59
+ },
60
+ async run({ args }) {
61
+ const root = args.root.trim();
62
+ if (root !== '' && root !== 'project' && root !== 'global') {
63
+ console.error(` root must be "project" or "global" — got "${root}".`);
64
+ process.exitCode = 1;
65
+ return;
66
+ }
67
+ const token = await resolveToken(args.token);
68
+ if (!token) {
69
+ console.error('No Mossbear token configured. Get one from the dashboard (Settings → Developer → CLI Token), then run `mossbear init --token <token>` or pass `mossbear guides history <guide> --token <token>`.');
70
+ process.exitCode = 1;
71
+ return;
72
+ }
73
+ const dashboardUrl = await resolveDashboardUrl(args['dashboard-url']);
74
+ let history;
75
+ try {
76
+ history = await fetchGuideHistory({
77
+ dashboardUrl,
78
+ token,
79
+ guide: args.guide,
80
+ root: root === '' ? undefined : root,
81
+ guideId: args['guide-id'] === '' ? undefined : args['guide-id'],
82
+ // A thunk: nothing about this repo is read unless the server says the
83
+ // identifier is ambiguous. Narrowing every query to this repo would
84
+ // stop answering about a guide adopted from another one.
85
+ disambiguateWith: () => resolveRepoIdentity(process.cwd()),
86
+ });
87
+ }
88
+ catch (err) {
89
+ console.error(` ${errText(err)}`);
90
+ process.exitCode = 1;
91
+ return;
92
+ }
93
+ if (args.json) {
94
+ console.log(JSON.stringify(history, null, 2));
95
+ return;
96
+ }
97
+ printHistory(history);
98
+ },
99
+ });
100
+ /**
101
+ * The summary a person reads.
102
+ *
103
+ * Every branch below is a *different* sentence for a different state, which is
104
+ * the whole point: "no runs have engaged this guide", "no run has used this
105
+ * wording yet" and "never graded" are three facts, and one sentence covering
106
+ * all three would state something the record does not say.
107
+ */
108
+ function printHistory(history) {
109
+ const { guide, window: figures } = history;
110
+ const where = guide.path === null ? '(no declared path)' : guide.path;
111
+ const rootLabel = guide.root === null ? '' : ` [${guide.root}]`;
112
+ console.log(`${guide.title} — ${where}${rootLabel}`);
113
+ if (history.state === 'unevaluated') {
114
+ console.log('\n Not yet graded. No run has produced a verdict for this guide.');
115
+ return;
116
+ }
117
+ if (history.state === 'awaiting_current_revision') {
118
+ // The normal state right after an edit: a real record, none of it about the
119
+ // wording on disk now. Reporting it as "not graded" would be a claim the
120
+ // user can contradict from their own dashboard.
121
+ const count = figures.olderRevisionRows;
122
+ const hedge = figures.isWindowed ? 'at least ' : '';
123
+ console.log(`\n No runs on this wording yet. ${hedge}${count} earlier verdict(s) judged wording it no longer has.`);
124
+ }
125
+ else if (figures.alignmentRate === null) {
126
+ console.log(`\n Graded in ${figures.total} run(s), none of which engaged this guide.`);
127
+ }
128
+ else if (figures.isLowConfidence) {
129
+ // Below the threshold the counts are the honest report and a percentage is
130
+ // not — one applicable run does not make a rate.
131
+ console.log(`\n Aligned in ${figures.aligned} of ${figures.applicable} run(s) that engaged this guide — too few runs to read as a rate.`);
132
+ }
133
+ else {
134
+ console.log(`\n ${Math.round(figures.alignmentRate * 100)}% aligned — ${figures.aligned} of ${figures.applicable} run(s) that engaged this guide.`);
135
+ }
136
+ if (history.state === 'evaluated') {
137
+ const scope = figures.isWindowed
138
+ ? `a sample of the last ${figures.windowSize} graded runs`
139
+ : `every graded run so far`;
140
+ console.log(` Counted over ${scope}; ${figures.notApplicable} never engaged it.`);
141
+ }
142
+ // Already indented to match the block above; the leading blank line separates
143
+ // the pair from the rate it qualifies.
144
+ for (const line of guideChangeLines(history.change))
145
+ console.log(line);
146
+ if (history.findings.length === 0) {
147
+ console.log('\n No recorded findings.');
148
+ return;
149
+ }
150
+ const more = history.findingsOmitted > 0 ? ` (${history.findingsOmitted} more not shown)` : '';
151
+ console.log(`\n Recent findings${more}:`);
152
+ for (const finding of history.findings) {
153
+ const age = finding.isCurrentRevision ? '' : ' — about earlier wording';
154
+ console.log(`\n · ${finding.occurredAt}${age}`);
155
+ // Printed with its markers intact. They are what says "this is transcript-
156
+ // derived text, not instructions", and an agent reading this through a
157
+ // shell needs that as much as one reading the MCP tool's JSON.
158
+ console.log(indent(finding.reasoning));
159
+ }
160
+ }
161
+ /**
162
+ * The last edit's two windows, as sentences.
163
+ *
164
+ * **A window and its denominators, and then it stops.** "Since" is the
165
+ * strongest word the evidence supports — the model changed, the task mix
166
+ * changed and the codebase changed too — so nothing here says the edit caused
167
+ * what followed it, and the date is a boundary rather than an attribution.
168
+ *
169
+ * **A suppressed pair is a sentence, not a silence**, and so is a guide with no
170
+ * earlier wording. Printing nothing in either case would leave a reader unable
171
+ * to tell "too few runs to say" from "this edit changed nothing", which are
172
+ * opposite statements — the same reason the payload carries `change: null`
173
+ * rather than omitting the key.
174
+ *
175
+ * **A regression reads exactly like an improvement**: same place, same words,
176
+ * different verb. It is the more useful of the two, because it says the
177
+ * guidance is not the lever.
178
+ *
179
+ * Exported for its unit test, and pure so that test needs no network.
180
+ */
181
+ export function guideChangeLines(change) {
182
+ if (change === null) {
183
+ return ['', ' No before/after: this guide has no earlier wording with graded runs.'];
184
+ }
185
+ const when = change.changedAt === null ? '' : ` (recorded ${change.changedAt})`;
186
+ const { since, before } = change;
187
+ const lines = ['', ` Since the last edit${when}:`];
188
+ if (change.suppressedBy !== null) {
189
+ // Below the sample floor a percentage is a lie with a decimal point in it,
190
+ // so the counts are the whole report and the sentence names which side is
191
+ // thin: too few runs *since* is the ordinary state right after an edit,
192
+ // while too few *before* means there was never a baseline to compare with.
193
+ lines.push(change.suppressedBy === 'since'
194
+ ? ` Not enough runs since this change to compare — ${since.applicable} run(s) have engaged this wording, against ${before.applicable} on the wording before it.`
195
+ : change.suppressedBy === 'before'
196
+ ? ` Not enough runs before this change to compare — ${before.applicable} run(s) engaged the previous wording.`
197
+ : ` Not enough runs either side of this change to compare — ${since.applicable} since, ${before.applicable} before.`);
198
+ return lines;
199
+ }
200
+ const verb = change.direction === 'improved'
201
+ ? 'more often'
202
+ : change.direction === 'regressed'
203
+ ? 'less often'
204
+ : 'about as often';
205
+ lines.push(` Aligned ${verb} since this change: ${since.aligned} of ${since.applicable} run(s) that engaged this wording, against ${before.aligned} of ${before.applicable} before it.`);
206
+ if (change.isWindowed) {
207
+ lines.push(` Each side is a bounded sample of its own wording — up to ${change.windowSize} runs — not a lifetime total.`);
208
+ }
209
+ return lines;
210
+ }
211
+ function indent(block) {
212
+ return block
213
+ .split('\n')
214
+ .map((line) => ` ${line}`)
215
+ .join('\n');
216
+ }
217
+ //# sourceMappingURL=history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/commands/guides/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAQlE;;;;;;;;;;;;;;;;GAgBG;AACH,MAA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AM,CAAC,UAAU,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CACR,gEAAgE,MAAM,CAAC,UAAU,+BAA+B,CACjH,CAAA;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,KAAK;SACT,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC;SAC5B,IAAI,CAAC,IAAI,CAAC,CAAA;AACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/guides/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,qDAoBxB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/guides/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,qDAwBxB,CAAA"}
@@ -18,6 +18,10 @@ export const guidesCommand = defineCommand({
18
18
  project: () => import('./project.js').then((m) => m.guidesProjectCommand),
19
19
  active: () => import('./active.js').then((m) => m.guidesActiveCommand),
20
20
  search: () => import('./search.js').then((m) => m.guidesSearchCommand),
21
+ // The one verb here that reaches the network. `active` and `search` read the
22
+ // synced cache; verdicts are the server's and the CLI holds none of them by
23
+ // design, so there is nothing local for this to read.
24
+ history: () => import('./history.js').then((m) => m.guidesHistoryCommand),
21
25
  },
22
26
  });
23
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/guides/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;IACzC,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,oCAAoC;KAClD;IACD,WAAW,EAAE;QACX,6EAA6E;QAC7E,uEAAuE;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M,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC;QACtE,6EAA6E;QAC7E,4EAA4E;QAC5E,sDAAsD;QACtD,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC;KAC1E;CACF,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAkHA,eAAO,MAAM,kBAAkB,+JAM9B,CAAA;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAg9BtB,CAAA"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAoHA,eAAO,MAAM,kBAAkB,+JAM9B,CAAA;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwhCtB,CAAA"}