akm-cli 0.10.261016-beta → 0.10.261017-beta

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 (104) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/README.md +8 -10
  3. package/SECURITY.md +7 -99
  4. package/STABILITY.md +57 -98
  5. package/dist/assets/stash-skeleton/facts/conventions/backlinks.md +2 -2
  6. package/dist/assets/stash-skeleton/facts/conventions/organization.md +11 -17
  7. package/dist/cli.js +32 -41
  8. package/dist/commands/feedback-cli.js +5 -4
  9. package/dist/commands/health.js +15 -16
  10. package/dist/commands/proposal/proposal-cli.js +1 -1
  11. package/dist/commands/read/registry-search.js +4 -1
  12. package/dist/commands/read/search.js +6 -6
  13. package/dist/commands/sources/self-update.js +9 -5
  14. package/dist/commands/tasks/tasks.js +12 -13
  15. package/dist/core/adapter/adapters/agent-skills-adapter.js +7 -7
  16. package/dist/core/adapter/adapters/akm-task-adapter.js +1 -1
  17. package/dist/core/adapter/adapters/akm-workflow-adapter.js +1 -1
  18. package/dist/core/adapter/adapters/claude-adapter.js +1 -1
  19. package/dist/core/adapter/adapters/dotenv-adapter.js +1 -1
  20. package/dist/core/adapter/adapters/generic-files-adapter.js +1 -1
  21. package/dist/core/adapter/adapters/llm-wiki-adapter.js +1 -1
  22. package/dist/core/adapter/adapters/opencode-adapter.js +1 -1
  23. package/dist/core/adapter/adapters/website-snapshot-adapter.js +1 -1
  24. package/dist/core/bundle-rename.js +17 -7
  25. package/dist/indexer/bundle-identity-guard.js +6 -6
  26. package/dist/indexer/index-written-assets.js +3 -3
  27. package/dist/indexer/indexer.js +12 -8
  28. package/dist/indexer/materialize-embeddings.js +12 -2
  29. package/dist/indexer/passes/metadata.js +103 -46
  30. package/dist/indexer/search/ranking.js +7 -3
  31. package/dist/indexer/search/search-fields.js +1 -1
  32. package/dist/indexer/usage/usage-events.js +30 -8
  33. package/dist/indexer/walk/walker.js +1 -1
  34. package/dist/output/shapes/helpers.js +3 -3
  35. package/dist/output/text/command-format.js +5 -6
  36. package/dist/scripts/akm-migrate-node.js +31 -3
  37. package/dist/scripts/akm-migrate.js +31 -3
  38. package/dist/sources/providers/git-provider.js +2 -4
  39. package/dist/sources/providers/provider-utils.js +8 -13
  40. package/dist/sources/snapshot-fetchers/website-ingest.js +6 -7
  41. package/dist/storage/repositories/events-repository.js +15 -0
  42. package/dist/storage/repositories/improve-ledger-repository.js +13 -0
  43. package/dist/storage/repositories/index-entries-repository.js +43 -5
  44. package/dist/storage/repositories/outcome-repository.js +12 -0
  45. package/dist/storage/repositories/proposals-repository.js +5 -5
  46. package/dist/storage/repositories/salience-repository.js +13 -0
  47. package/dist/storage/repositories/task-history-repository.js +8 -7
  48. package/dist/storage/repositories/workflow-runs-repository.js +10 -8
  49. package/docs/README.md +24 -60
  50. package/docs/agents/README.md +3 -8
  51. package/docs/architecture/README.md +18 -20
  52. package/docs/architecture/adapters.md +40 -43
  53. package/docs/architecture/architecture.md +171 -151
  54. package/docs/architecture/improvement.md +95 -91
  55. package/docs/architecture/internals/classification.md +101 -119
  56. package/docs/architecture/internals/fresh-host-rebuild-runbook.md +33 -35
  57. package/docs/architecture/internals/health-advisories.md +59 -46
  58. package/docs/architecture/internals/improve-workflow.md +166 -693
  59. package/docs/architecture/internals/indexing.md +65 -465
  60. package/docs/architecture/internals/storage-locations.md +301 -848
  61. package/docs/architecture/persisted-data-compat.md +6 -6
  62. package/docs/architecture/specs/okf-support.md +67 -95
  63. package/docs/architecture/specs/ref.md +67 -125
  64. package/docs/architecture/testing/testing-workflow.md +107 -167
  65. package/docs/architecture/workflow-engine.md +34 -33
  66. package/docs/guides/README.md +5 -5
  67. package/docs/guides/author-bundles.md +72 -98
  68. package/docs/guides/author-workflows.md +11 -18
  69. package/docs/guides/bundles.md +91 -123
  70. package/docs/guides/capture-knowledge.md +10 -9
  71. package/docs/guides/concepts.md +45 -30
  72. package/docs/guides/discover-and-load.md +39 -32
  73. package/docs/guides/getting-started.md +24 -24
  74. package/docs/guides/improve-the-library.md +98 -80
  75. package/docs/guides/recipes/headless-install.md +4 -4
  76. package/docs/guides/recipes/website-source.md +9 -5
  77. package/docs/guides/run-workflows.md +10 -11
  78. package/docs/guides/scheduling.md +11 -17
  79. package/docs/guides/use-with-any-agent.md +15 -14
  80. package/docs/guides/wikis.md +6 -9
  81. package/docs/integration/bundling-akm.md +21 -26
  82. package/docs/maintainers/README.md +2 -2
  83. package/docs/maintainers/local-development.md +3 -16
  84. package/docs/migration/README.md +2 -1
  85. package/docs/migration/release-notes/0.10.0.md +167 -22
  86. package/docs/migration/release-notes/README.md +2 -2
  87. package/docs/migration/v0.9-to-v0.10.md +47 -7
  88. package/docs/product-surface.md +10 -8
  89. package/docs/reference/README.md +26 -15
  90. package/docs/reference/asset-types.md +11 -12
  91. package/docs/reference/bundle-types.md +6 -5
  92. package/docs/reference/cli.md +52 -28
  93. package/docs/reference/configuration.md +46 -60
  94. package/docs/reference/data-and-telemetry.md +204 -421
  95. package/docs/reference/env-and-secrets.md +80 -83
  96. package/docs/reference/memory.md +1 -1
  97. package/docs/reference/refs.md +23 -36
  98. package/docs/reference/registry.md +138 -348
  99. package/docs/reference/supported-formats.md +8 -8
  100. package/docs/reference/tasks.md +13 -19
  101. package/docs/reference/website-sources.md +23 -15
  102. package/docs/reference/workflow-schema.md +28 -47
  103. package/docs/reference/workflows.md +33 -37
  104. package/package.json +1 -1
@@ -1,41 +1,39 @@
1
1
  # Fresh-Host Rebuild Runbook
2
2
 
3
- Rebuild a working akm install on a new machine. Assumes your bundle lives in a
4
- git remote and that a versioned `config.json` copy is committed to the bundle
5
- git (the 08-F1 recovery pattern — see step 3).
3
+ Rebuild a working akm install on a new machine. It assumes your bundle lives in
4
+ a git remote and that you kept a copy of `config.json` somewhere you can
5
+ restore it from.
6
6
 
7
7
  1. **Install the CLI.** Prebuilt binary (no runtime needed):
8
8
  `curl -fsSL https://github.com/itlackey/akm/releases/latest/download/install.sh | bash`
9
- — or npm package (Node.js >= 22 required): `npm install -g akm-cli`.
10
- If a working Bun >= 1.0 is also on `PATH`, the package prefers it after Node
11
- bootstrap; old, unusable, or absent Bun installations fall back to Node.js.
12
- The standalone binary is runtime-free.
13
- (Windows: `irm https://github.com/itlackey/akm/releases/latest/download/install.ps1 | iex`.)
9
+ (Windows: `irm https://github.com/itlackey/akm/releases/latest/download/install.ps1 | iex`).
10
+ Or the npm package, which needs Node.js 22 or later: `npm install -g akm-cli`.
11
+ A working Bun 1.0 or later on `PATH` is optional and preferred over Node.
14
12
  2. **Confirm the binary resolves:** `akm --version`.
15
- 3. **Restore `config.json`.** akm reads a single user config at
16
- `~/.config/akm/config.json` (`%APPDATA%\akm\config.json` on Windows;
17
- override with `AKM_CONFIG_DIR`). This file is gitignored on the host, so the
18
- recovery source is the ONE versioned copy committed to the bundle git
19
- (08-F1 pattern). Copy that file into place; it carries the `connections`,
20
- `harnesses`, and cron-load-bearing improve
21
- strategies that are otherwise unrecoverable.
22
- 4. **Provide secrets/env.** `config.json` references API keys via `$VAR`
23
- placeholders; export those environment variables (or restore
24
- `credentials.json` from your own backup; it is never part of `config.json`)
25
- so the connections and the embedding endpoint resolve. Never commit the
26
- resolved values.
27
- 5. **Restore the working bundle.** Clone your bundle git remote to the path
28
- named by your working bundle's entry under `bundles` in the restored
29
- config (`defaultBundle` selects which one; default path `~/akm`). There is
30
- no top-level `stashDir` config key in 0.9 — it is retired and rejected at
31
- load. If starting clean instead, run `akm setup --yes` to scaffold it.
32
- 6. **Re-add non-git sources.** For each managed source not carried in the bundle
33
- git (websites, npm packages, GitHub repos), run `akm bundle add <ref>`. Verify the
34
- full set with `akm bundle list`.
35
- 7. **Rebuild the index:** `akm index --full` (forces a complete reindex rather
36
- than an incremental update).
37
- 8. **Verify health:** `akm health` (checks runtime, artifacts, and improve
38
- metrics — exits non-zero if `state.db` is missing) and `akm info` for index
39
- stats and effective config.
40
- 9. **Smoke-test discovery:** `akm search <term>` returns results, confirming the
41
- index and bundle are wired correctly.
13
+ 3. **Restore `config.json`.** akm reads one user config at
14
+ `~/.config/akm/config.json` (`%APPDATA%\akm\config.json` on Windows; set
15
+ `AKM_CONFIG_DIR` to move it). It holds your `connections`, `harnesses`, and
16
+ your improve strategies.
17
+ 4. **Provide secrets.** `config.json` refers to API keys as `$VAR` or
18
+ `${VAR}`. Export those environment variables, or restore `credentials.json`
19
+ from your own backup (it is never part of `config.json`), so the
20
+ connections and the embedding endpoint resolve.
21
+ 5. **Restore the working bundle.** Clone your bundle's git remote to the path
22
+ of the working bundle's entry under `bundles` in the restored config
23
+ (`defaultBundle` selects which one; the default path is `~/akm`). To start
24
+ clean instead, run `akm setup --yes`, which scaffolds the bundle.
25
+ 6. **Check the other bundles.** `akm bundle list` shows the bundles the
26
+ restored config defines. Re-add any that are missing with
27
+ `akm bundle add <ref>`.
28
+ 7. **Rebuild the index:** `akm index --full`. `index.db` is derived from your
29
+ bundles and is rebuilt from scratch.
30
+ 8. **Verify health:** `akm health`, then `akm info` for index stats and the
31
+ effective config. `akm health` creates `state.db` if it is missing and
32
+ applies its migrations. It exits 0 when every check passes, 4 on warnings,
33
+ and 1 when a hard check fails. See [Health Checks](health-advisories.md) for
34
+ what each check means.
35
+ 9. **Smoke-test discovery:** `akm search <term>` returns results.
36
+
37
+ `$DATA/state.db` holds proposals, events, and task history, and is not rebuilt
38
+ from your bundles. Copy it from the old host before step 8 if you want that
39
+ history.
@@ -1,43 +1,70 @@
1
- # `akm health` advisory → action map
1
+ # `akm health` checks
2
2
 
3
- Run `akm health` (JSON by default; `--format text` for the table view). The authoritative result
4
- combines hard failures with deterministic warnings across both output
5
- channels:
3
+ `akm health` prints JSON by default (`--format text` for the table view) and
4
+ emits the checks below. Each result has a `name`, and lands in `hardChecks` (the
5
+ state.db, `task-history-read`, `active-runs`, connection and harness, and
6
+ semantic-search checks) or `advisories` (the rest). The list comes from
7
+ `HEALTH_CHECKS` in `src/commands/health/checks.ts`, `akmHealth` in
8
+ `src/commands/health.ts`, and the collectors in `src/commands/health/`. The
9
+ checks from `index-state-generation` down to `opencode-plugin-version` appear
10
+ only when they have something to report, and `state-db-readable` only in place
11
+ of every other check; the others are always present.
6
12
 
7
- - Deterministic hard-check and advisory warnings set the overall status to `warn` and exit code 4.
8
- - A hard check `fail` sets the overall status to `fail` and exit code 1.
9
- - A heuristic (non-deterministic) advisory `warn` does not change or gate the overall status.
10
- - A heuristic (non-deterministic) advisory `warn` does not change or gate the exit code.
13
+ ## Status and exit code
11
14
 
12
- This table is the interpretive key for a second operator: what each named
13
- advisory measures and whether to act. Some `warn`s below are *adjudicated,
14
- expected* states — treat them as "no action" until the referenced condition
15
- changes.
15
+ Each check is `pass`, `warn`, `fail`, or `unknown`, and `deterministic` or
16
+ `heuristic`.
16
17
 
17
- | Advisory (name in output) | What it means | Action |
18
+ - Any `fail` in `hardChecks` makes the overall status `fail` and the exit code 1.
19
+ - Otherwise, any `warn` from a `deterministic` check (hard or advisory) makes it `warn` and the exit code 4.
20
+ - `heuristic` warns (`session-extraction`, `auto-accept-validation`) and `unknown` results do not change the overall status.
21
+
22
+ `--since` sets the window the task and improve checks read. The default is 24 hours.
23
+
24
+ ## Network and processes
25
+
26
+ Probing is on by default; `--no-probe` turns it off. With probing on, health sends a
27
+ `GET` to `<endpoint>/models` of each configured connection (3 second timeout; any HTTP
28
+ response counts as reachable, so a cold local server is never asked to load a model; one
29
+ request per distinct endpoint per invocation, with no cross-run cache), runs each configured
30
+ harness's `--version`, looks up the latest akm release on GitHub for `cli-version`
31
+ (5 second timeout, no retries), and runs the akm binary recorded by the scheduler with
32
+ `--version` for `scheduler-binary`. `plugin-version` runs `git ls-remote --symref origin`
33
+ (it lists refs and fetches nothing) against the Claude plugin marketplace clone whenever a
34
+ Claude plugin is installed. With
35
+ `--no-probe` none of these runs: the connection rows carry no `reachable` field and the
36
+ message says reachability was not probed, and `plugin-version` reports `unknown` (its
37
+ `AKM_VERSION_RANGE` check is local and still runs). The `plugin-version` and `cli-version`
38
+ lookups are best-effort and silent on failure; see `src/commands/health/plugin-staleness.ts`
39
+ and `src/commands/health/version-drift.ts`.
40
+
41
+ ## Checks
42
+
43
+ | Check | Fires when | Remedy |
18
44
  |---|---|---|
19
- | `state-db-schema` | state.db is missing required tables. | Re-run `akm bundle create`; a fresh/older DB was opened. |
20
- | `state-db-round-trip` | Append/read probe against state.db failed. | Check disk/permissions on the state.db path; the store is unwritable. |
21
- | `state-db-integrity` | state.db failed `PRAGMA integrity_check` (which, unlike `quick_check`, also compares every index with its table), or more than half its pages are free (reclaimable by VACUUM). | Back up state.db, then run `sqlite3 -readonly state.db ".dump" \| sqlite3 state.new.db`, verify `state.new.db` passes `integrity_check`, and swap it in; the freelist warning clears on its own on the next `akm improve` retention purge, which VACUUMs state.db above the same 50% threshold. |
22
- | `state-db-readable` | `state.db` is missing or cannot be read, or is behind on migrations that a read-only run must not apply. Every other check is skipped, because none of them can read it. | Check the owner and mode of the data directory (or point `AKM_DATA_DIR` / `XDG_DATA_HOME` at one you own); run any akm command that records state, such as `akm health`, to create it. |
23
- | `state-db-migrations` | Reports what `akm health`'s own open of `state.db` applied (`evidence.applied`, and the copy it made first in `evidence.backupPath`); `fail` only when a pending migration could not be applied. | Run `akm migrate apply` when it names a pending migration. |
24
- | `task-history-read` | How many `task_history` rows were read for the window (informational; it passes). | None. |
25
- | `active-runs` | A task run has exceeded the stale threshold (>15 min). | Inspect with `akm task history`; a lane is likely wedged — kill/re-run it. |
45
+ | `state-db-schema` | `fail`: state.db is missing one of `events`, `proposals`, `schema_migrations`, `task_history`. | The message lists the missing tables. |
46
+ | `state-db-round-trip` | `fail`: appending and reading back a probe event failed. The probe row is deleted again. | The message gives the error. |
47
+ | `state-db-integrity` | `fail`: `PRAGMA integrity_check` failed, or reading the freelist failed. `warn`: more than 50% of the pages are free. | For a failed check, follow the repair in the message: back up state.db, run `sqlite3 -readonly state.db ".recover" \| sqlite3 state.new.db`, confirm `state.new.db` passes `integrity_check`, stop every akm process, delete `state.db-wal` and `state.db-shm`, then swap `state.new.db` in as state.db. The free-page warning clears when `akm improve`'s retention purge VACUUMs state.db. |
48
+ | `state-db-migrations` | Always `pass` in a normal run; the message lists the migrations this open applied and the pre-migration copy (`evidence.applied`, `evidence.backupPath`). `fail` when the open could not apply a pending migration, or a read-only run (the `akm ui` health view) finds one pending, which it must not apply; this row is then the whole report. | Run `akm migrate apply`. |
49
+ | `task-history-read` | Always `pass`; reports the number of `task_history` rows read in the window. | None. |
50
+ | `active-runs` | `warn`: a task run has been active for more than 15 minutes. The message names the tasks and their age. | Inspect with `akm task history`. |
26
51
  | `connections-and-harnesses` | One table of every configured connection (endpoint, whether its key is held — a `$VAR` set in this shell, a `credentials.json` entry, or none — and whether the endpoint answers) and harness (platform, whether its binary is on `PATH`, and with a probe its `--version`), then the work that runs on them: improve, judges, agents, extract, enrich, index, embedding and curate rerank, each naming the connection or harness and the model it resolves to through the same resolver the calls use (`evidence.rows`, typed `connection`, `harness` or `process`). `warn` when a key variable is unset, an endpoint does not answer, a harness is not installed, several connections (or harnesses) are configured and none is called `default` (said once, with the fix: name one `default`), or a work row cannot resolve because of the config; `unknown` when neither a connection nor a harness is configured; otherwise `pass`. Endpoint reachability is one bounded `GET /models` and the version is the harness's own `--version`; with `--no-probe` neither runs and the message says so. | Correct the named connection, key or harness; run `akm setup` when nothing is configured. A work row whose parts run somewhere other than the row's own target lists them in `overrides`, each with the kind (connection or harness), name and model it runs on: that is a per-process pin, working as set. |
27
- | `task-fail-rate` | ≥5% of scheduled task runs failed in the window (exit 143/70 recurring), or a single task_id fails at/above the same threshold. (#943) For `command`-kind (agent/LLM dispatch) failures specifically, `evidence.agentFailureReasonCounts` always carries a `detail.reason` breakdown (`timeout`, `non_zero_exit`, `spawn_failed`, …), and the warn message names the dominant reason — e.g. `(timeout-dominant: 9/12 command-task failures)` — when one reason is at least half of the counted command-task failures. | Triage as a bug: `akm task doctor`, inspect failing lane logs. For a native shell/script task, exit-143 = killed/timeout, exit-70 = internal error. For a `command`-kind (agent/LLM) task, read `detail.reason` from `akm task history` instead of the exit code — `timeout` means the dispatch's own deadline (not an outer process kill) expired; `non_zero_exit`/`spawn_failed`/`aborted`/etc. name the other failure shapes. |
28
- | `data-dir-usage` | The data directory is more than 3× the live databases (`state.db` + `index.db` + `logs.db`), or one top-level subdirectory holds more than half of it; the message names that subdirectory with its size and share. | Look at the named subdirectory. `backups/tasks/` holds one snapshot per `akm migrate apply` run that rewrote a task file; everything under `backups/` is yours to prune. |
29
52
  | `semantic-search` | What the last `akm index` recorded about semantic search, with the index's entry and vector counts read now; no model load, no request. `pass` when every entry has a vector (local: on `onnxruntime-node`) or `semanticSearchMode` is `off`; `warn` when vectors lag entries, local embeddings ran on another runtime, or akm offers no local embeddings on this platform (`unavailable: platform`, where keyword search or an endpoint is the default); `fail` when the last index found it `blocked` (endpoint or model download failed) or `unavailable: load` (the runtime could not be downloaded or did not load, for example from a `noexec` cache directory), with the reason; `unknown` before the first index. A hard check, so a `fail` fails `akm health`. | `fail`: fix the reason named, then run `akm index`; the check reads the next index's record. `warn` for the platform: `akm setup --embedding off` for keyword search, or `akm setup --embedding <model> --embedding-endpoint <url>` for a remote endpoint. |
30
- | `stash-git-exposure` | `env/` or `secrets/` assets are git-tracked **and** a remote is set — `git push` can leak keys. | `git rm --cached` the files, add `env/`+`secrets/` to `.gitignore` (a rule alone does not untrack). |
31
- | `session-extraction` | (#914) Derived from the `extract_sessions_seen` ledger for the last 7 days — not `improve_runs`, which the hook-driven `akm proposal extract --session-id ...` never writes. `unknown` when nothing was recorded; `warn` when every session in the window was skipped for an infrastructure reason (`llm_unavailable`, `read_failed`, `exception`, `locked_concurrent`), naming the reason and engine; otherwise `pass` with per-outcome counts. | An `unknown` machine may be deliberately not configured for extraction, or may have stopped harvesting — check for recent sessions. A `warn` names the broken engine/reason directly. |
32
- | `auto-accept-validation` | Proposals passed the confidence gate but failed validation (bad frontmatter, truncation). | Review the affected pending proposals via `akm proposal list`; they were held, not lost. |
53
+ | `task-fail-rate` | `warn`: at least 5% of task runs in the window failed, or one task with at least 5 runs fails at that rate. The message names the dominant `detail.reason` (`timeout`, `non_zero_exit`, `spawn_failed`, ...) when one reason is at least half of the command-task failures. | Inspect failed runs with `akm task history` and `akm task doctor`. `evidence.agentFailureReasonCounts` breaks command-task failures down by reason. |
54
+ | `session-extraction` | `heuristic`. Reads the last 7 days of the extract ledger. `unknown`: nothing recorded. `warn`: every session was skipped or failed for an infrastructure reason (`llm_unavailable`, `read_failed`, `exception`, `locked_concurrent`); the message names the reason and the connection or harness that ran extraction. | Fix the named connection or harness. `unknown` is normal on a machine that does not extract sessions. |
55
+ | `auto-accept-validation` | `heuristic`. Reads `triage.promoted` and `gateAutoAcceptFailedCount` (only rows an older release wrote carry it) from the improve runs in the window. `warn`: proposals passed the confidence gate but failed validation (truncated description, invalid frontmatter); they stay pending. | Review them with `akm proposal list`. |
56
+ | `cli-version` | `warn`: a newer akm release exists on GitHub. `unknown`: `--no-probe`, or the release lookup failed. | Run `akm upgrade`. |
57
+ | `scheduler-binary` | `warn`: the akm binary recorded in the scheduler reports a different version than the running CLI. `unknown`: `--no-probe`, no scheduled task installed, or the recorded binary cannot be run. | Run `akm task sync` to rebind the schedule. |
58
+ | `index-state-generation` | `warn`: usage links in state.db point at index entries that no longer match (an index and state.db from different generations). | Stop concurrent writers and run `akm index --full`. |
59
+ | `stash-git-exposure` | `warn`: `env/` or `secrets/` files are tracked by git in the working bundle and the bundle has a remote. Skipped when the bundle has no `.git`. | Run `git rm --cached` on the listed files and add `env/` and `secrets/` to `.gitignore`. A `.gitignore` rule alone does not untrack files. |
60
+ | `binary-config-skew` | `warn`: `config.json` has a `configVersion` newer than this binary knows. | Upgrade this install. |
33
61
  | `egress-endpoints` | Every remote destination in the effective config, as one informational entry: enabled registries, git and website bundles, each connection's endpoint and the embedding endpoint (credentials in a URL are masked). Silent when nothing remote is configured. | Eyeball it against what you expect; a destination you did not configure came from an `extends` base or a shared bundle. |
34
- | `binary-config-skew` | `config.json` carries a `configVersion` newer than this binary knows. A newer akm wrote the shared config, so this install is stale. | Upgrade this install; do not keep a stale binary against the shared config and databases. |
35
- | `memory-cleanup-archive` | Size of a bundle's memory-cleanup archive. `pass` for a bundle with no git history (the purge sweep never touches it); `warn` when part of a git-backed bundle's archive cannot be purged (untracked, modified or unverifiable in git). Silent when nothing needs saying. | Commit the named files so the purge sweep can remove them once they age out. |
36
- | `type-directory-disagreement` | An indexed asset's resolved type disagrees with the type its directory declares. Always `warn`, never a gate; each row names the `winner` signal and marks the known-good overrides (a `knowledge/` file that is a command, an `agents/` file with an `agent:` key). | Check the unexplained rows; a deliberate override reads as such. |
37
- | `index-state-generation` | Durable usage links in `state.db` disagree with the current searchable index generation, which an interrupted cross-database update leaves behind. | Stop concurrent writers, then run `akm index --full` to relink state to the current index. |
38
- | `cli-version` | (#950) Compares the installed akm-cli version against the latest GitHub release (the same source `akm upgrade` trusts). `--probe`-gated: `unknown` "not probed" with `--no-probe`; offline/rate-limited also degrades to `unknown`, never a false `warn`. | Run `akm upgrade` when a newer release is reported. An `unknown` result carries no staleness claim either way — check manually if it matters. |
39
- | `scheduler-binary` | (#953) Reads the scheduler's recorded akm invocation for the installed tasks (the same binding `task sync`/`task doctor` already read — no crontab/launchd/schtasks text parsing) and runs it with `--version`, compared against the running CLI's version. `--probe`-gated: `unknown` "not probed" with `--no-probe`. `unknown` when no scheduled task is installed or the recorded binary cannot be executed. | A `warn` names both versions — upgrading akm through a different installer than the one active at the last `task sync` left the schedule pointed at the old binary; run `akm task sync` to rebind it. |
40
- | `plugin-version` / `opencode-plugin-version` | (itlackey/akm#832,) `plugin-version` reports each installed Claude Code harness plugin's version and its declared `AKM_VERSION_RANGE` admission of the running CLI. `opencode-plugin-version` does the same for the OpenCode plugin's own bundled `akm-cli` (read from its `package.json`, never executed) — it runs in-process and shares the host's databases, so its lag matters the same way. OpenCode 1 caches each spec in its own folder, so `opencode-plugin-version` reads the one folder of the spec the global OpenCode config names under `plugin` (`akm-opencode`, read as `akm-opencode@latest`, or `akm-opencode@next`), and for `akm-opencode@<version>` reports the plugin as pinned with no staleness verdict; with no entry, or no folder for it, it reads `packages/akm-opencode`, and it never scans the other cached specs. The newest version is read on the channel the marketplace clone follows: on the remote's default branch the newest stable tag, on any other branch (such as `next`) the release tag on that branch's head, and on a clone pinned to a tag that tag. `plugin-version`'s newest-tag lookup is `--probe`-gated: with `--no-probe` its row is `unknown` ("not probed") and only the local range check still runs. `opencode-plugin-version` reads local files only and is never gated. | A `warn` names the stale/out-of-range plugin and the update command (`claude plugin update <ref>` for the Claude plugin; update the OpenCode plugin for the bundled copy). |
62
+ | `type-directory-disagreement` | `warn`: an indexed asset's resolved type differs from the type its directory declares. Each line gives the file, both types, and the classifier signal that won (`winner`). | Review the listed files. Intended overrides (for example a `knowledge/` file containing `$ARGUMENTS`) are marked `known-good override`. |
63
+ | `memory-cleanup-archive` | `pass` with size and file count when the working bundle has `.akm/memory-cleanup/archive` content and no git history (the purge does not run there). `warn` when a git-backed bundle has archived files the purge cannot remove (untracked, modified, or unverifiable in git). | Commit the archived files so the purge can remove them once they age out. |
64
+ | `data-dir-usage` | `warn`: the data directory is over 1 GB and either more than 3 times the size of `state.db`, `index.db`, and `logs.db` (with their WAL and SHM files), or one top-level subdirectory holds more than half of it. The message names that subdirectory and its size. | Inspect the named subdirectory. `backups/tasks/` holds task-file snapshots written by `akm migrate apply`. |
65
+ | `plugin-version` | One row per installed Claude Code harness plugin: its version and whether its declared `AKM_VERSION_RANGE` admits the running CLI. The newest version is read on the channel the marketplace clone follows: on the remote's default branch the newest stable tag, on any other branch (such as `next`) the release tag on that branch's head, and on a clone pinned to a tag that tag. The newest-tag lookup is `--probe`-gated: with `--no-probe` the row is `unknown` ("not probed") and only the local range check still runs. `warn`: the plugin is stale, or its range does not admit the running CLI. | Run the `claude plugin update <ref>` command in the message. |
66
+ | `opencode-plugin-version` | The same check for the OpenCode plugin's own bundled `akm-cli` (read from its `package.json`, never executed): it runs in-process and shares the host's databases, so its lag matters the same way. OpenCode 1 caches each spec in its own folder, so it reads the one folder of the spec the global OpenCode config names under `plugin` (`akm-opencode`, read as `akm-opencode@latest`, or `akm-opencode@next`), and for `akm-opencode@<version>` reports the plugin as pinned with no staleness verdict; with no entry, or no folder for it, it reads `packages/akm-opencode`, and it never scans the other cached specs. It reads local files only and is never `--probe`-gated. `warn`: the bundled version differs from the running CLI. Omitted when the OpenCode plugin is not installed. | Update the OpenCode plugin. |
67
+ | `state-db-readable` | `fail`: `state.db` cannot be read, or is missing in a read-only run (which does not create it). Every other check is skipped, because none of them can read it. | Check the owner and mode of the data directory (or point `AKM_DATA_DIR` / `XDG_DATA_HOME` at one you own); run any akm command that records state, such as `akm health`, to create it. |
41
68
 
42
69
  ## Connections, harnesses and the work on them
43
70
 
@@ -52,20 +79,6 @@ The work rows are resolved by the resolvers the calls themselves use, so the
52
79
  table never disagrees with a call. An unreachable endpoint is a `warn` like
53
80
  every other finding here, never a `fail`.
54
81
 
55
- Reachability is a real, bounded (3 s) probe (#914) — one `GET` against the
56
- endpoint's `/models` route; any HTTP response counts, so a cold local server is
57
- never asked to load a model — made once per distinct endpoint per invocation
58
- (no cross-run cache, so a stale "reachable" verdict never lingers). Pass
59
- `--no-probe` to skip it (offline or air-gapped hosts): the rows then carry no
60
- `reachable` field and the message notes that reachability was not probed.
61
-
62
82
  The table's evidence names endpoints so an operator can tell which connection
63
83
  was checked; it never includes credential values or the names of the variables
64
84
  that hold them, and an endpoint's embedded credentials are masked.
65
-
66
- `akm health` makes at most two network calls besides the endpoint probe, both
67
- best-effort and silent on failure and both gated behind `--probe`/`--no-probe`,
68
- the same flag as endpoint reachability: `plugin-version`'s `git ls-remote` and `cli-version`'s
69
- GitHub-release lookup. See
70
- `src/commands/health/plugin-staleness.ts` and
71
- `src/commands/health/version-drift.ts` for the discipline each follows.