akm-cli 0.9.26-alpha.1 → 0.9.26

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.
@@ -1587,12 +1587,27 @@ preserves it byte-for-byte.
1587
1587
 
1588
1588
  ### feedback
1589
1589
 
1590
- Record positive or negative feedback for any indexed bundle asset.
1590
+ Record positive or negative feedback for any indexed bundle asset. Record
1591
+ `--negative` only when the asset's content is wrong or stale, and say what is
1592
+ wrong and what it should say; a note that simply did not fit your task is not
1593
+ negative feedback, so record nothing for it.
1591
1594
  `akm feedback <ref> --negative --reason "<what is wrong and what should change>"`
1592
- flags the asset for review: the next improve run proposes a fix based on your
1593
- reason, so be specific. `--positive` records that an asset helped (it raises
1594
- its ranking) and does not trigger a rewrite. Both signals update the asset's
1595
- utility score right away, so highly-rated assets rank higher in search results.
1595
+ flags the asset: it ranks lower right away, and the next improve run may repair
1596
+ its description, title or `when_to_use` from your reason. Improve does not
1597
+ rewrite an asset's text. Once you have verified the correct fact, attach the
1598
+ exact fix with `--replace`, `--with` and `--source`: akm checks that each
1599
+ `--replace` text appears exactly once and that the frontmatter still parses,
1600
+ records nothing if either check fails, and queues the edit as a `feedback`
1601
+ proposal for review.
1602
+ To mark the asset's history, with or without a text fix, add `--superseded-by
1603
+ <ref>` (another asset replaces it) or `--outdated` (it describes a past state
1604
+ and no single asset replaces it), with `--reason` and `--source`. The same single
1605
+ proposal sets the asset's `beliefState` (`superseded`, or `deprecated`) and, for
1606
+ `--superseded-by`, adds the successor's ref to its `supersededBy` list, by
1607
+ editing only those lines of the frontmatter. `--positive` records that an asset
1608
+ helped (it raises its ranking) and does not trigger a rewrite. Both signals
1609
+ update the asset's utility score right away, so highly-rated assets rank higher
1610
+ in search results.
1596
1611
 
1597
1612
  ```sh
1598
1613
  akm feedback scripts/deploy.sh --positive
@@ -1600,16 +1615,23 @@ akm feedback agents/reviewer --negative
1600
1615
  akm feedback memories/deployment-notes --positive
1601
1616
  akm feedback env/prod --positive
1602
1617
  akm feedback skills/code-review --positive --reason "Worked perfectly for PR reviews"
1603
- akm feedback skills/code-review --negative --failure-mode outdated --reason "references a removed flag"
1618
+ akm feedback skills/code-review --negative --reason "references a removed flag"
1604
1619
  akm feedback skills/code-review --negative --reason "flaky" --tag slice:train --tag team:platform
1620
+ akm feedback knowledge/opencode-server --negative --reason "the default port is 4096, not 8000" --replace "port 8000" --with "port 4096" --source "https://opencode.ai/docs/server/"
1621
+ akm feedback knowledge/setup-v1 --negative --reason "the v2 guide replaces it" --superseded-by knowledge/setup-v2 --source "knowledge/setup-v2"
1622
+ akm feedback knowledge/api-v1 --negative --reason "describes the retired v1 API" --outdated --source "https://example.com/changelog"
1605
1623
  ```
1606
1624
 
1607
1625
  | Flag | Description |
1608
1626
  | --- | --- |
1609
1627
  | `--positive` | Record that an asset helped: it raises its ranking and does not trigger a rewrite |
1610
- | `--negative` | Flag the asset for review: the next improve run proposes a fix based on `--reason`, so be specific |
1611
- | `--reason` | What is wrong with the asset's content and what should change; not for `akm` command errors. Attached to the feedback event and read by the next improve run's fix proposal (required for negative feedback by default) |
1612
- | `--failure-mode` | Structured failure-mode taxonomy for negative feedback: `incorrect`, `outdated`, `dangerous`, `incomplete`, `redundant`. Stored alongside `--reason` in event metadata for the distill pipeline. |
1628
+ | `--negative` | Flag the asset: it ranks lower right away, and the next improve run may repair its frontmatter from `--reason` |
1629
+ | `--reason` | What is wrong with the asset's content and what should change; not for `akm` command errors. Attached to the feedback event (required for negative feedback by default, and always with a fix: `--replace`, `--superseded-by` or `--outdated`) |
1630
+ | `--replace <text>` | Exact text to correct, copied verbatim from the asset file; it must appear exactly once. Repeatable, each paired in order with a `--with`. Negative feedback only |
1631
+ | `--with <text>` | The corrected text for the matching `--replace`. Use `--with=<text>` for a value that starts with `-` |
1632
+ | `--source <where>` | The URL, command or file that shows the correct fact. Required with `--replace`, `--superseded-by` and `--outdated`; shown to the reviewer with the proposal |
1633
+ | `--superseded-by <ref>` | The ref of the asset that replaces this one. The proposal sets `beliefState: superseded` and adds the ref, as its `bundle//conceptId`, to `supersededBy`; `contradicted` and `archived` stay, a ref already listed is not added again, and a scalar `supersededBy` becomes a list. The ref must be indexed and must not be the asset itself, or nothing is recorded; nor is anything when the asset already says all this (the fix changes nothing). Negative feedback only; may be combined with `--replace`/`--with`, not with `--outdated`; markdown assets only |
1634
+ | `--outdated` | The asset describes a past state and no single asset replaces it. The proposal sets `beliefState: deprecated`, unless the asset already says `superseded`, `contradicted` or `archived`. Negative feedback only; may be combined with `--replace`/`--with`, not with `--superseded-by`; markdown assets only |
1613
1635
  | `--tag` | Tag to attach to the feedback (repeatable, e.g. `--tag slice:train --tag team:platform`) |
1614
1636
  | `--applied-to <ref>` | Credit a `lessons/<name>` lesson that helped resolve this task. When combined with `--positive`, appends this feedback ref to the target lesson's `lessonStrength[]` frontmatter array (dedup, idempotent). A non-lesson target, or a missing `--positive`, produces a warning rather than silently doing nothing. |
1615
1637
 
@@ -2513,8 +2535,12 @@ feedback in the last 30 days newer than the stage's last ledger attempt, or for
2513
2535
  an explicit ref scope. A positive or note-only signal never plans one, so
2514
2536
  improve does not rewrite an asset from a positive signal. Distill keeps its own
2515
2537
  trigger: a memory with feedback of any kind (a signal or a note) in that window,
2516
- newer than distill's last attempt. Two fallback lanes pick refs with no such
2517
- feedback: high salience (content-scored refs at or above
2538
+ newer than distill's last attempt. It skips a memory flagged wrong and not
2539
+ edited since (a negative feedback in that window judged the body it still has,
2540
+ or, recorded without that body's hash, is newer than the file's last write),
2541
+ and a memory whose only feedback in that window is positive with no reason or
2542
+ note, unless the ref is explicit. Two fallback lanes pick refs
2543
+ with no such feedback: high salience (content-scored refs at or above
2518
2544
  `improve.salience.salienceThreshold`, default `0.75`, that were never reflected,
2519
2545
  capped at 10% of the limit, at least one ref) and, in a strategy that enables
2520
2546
  `proactiveMaintenance`, refs due for a revisit. They only select and score refs
@@ -3072,9 +3098,10 @@ passed on its current content is accepted (unless its target changed since it
3072
3098
  was minted — that one is auto-rejected as `stale-target`); an empty diff is
3073
3099
  rejected; a proposal that reflect or distill deferred for review is left for a
3074
3100
  person; everything else goes to the judgment tier when one is enabled, and
3075
- is otherwise left for review. A reflect revision that changes the body is
3076
- deferred for review even when its judge passes it. Default mode stages
3077
- decisions (queue mode); pass `--promote` to actually accept.
3101
+ is otherwise left for review. A reflect revision that changes the body, and
3102
+ every distill lesson or knowledge promotion, is deferred for review even when
3103
+ its judge passes it. Default mode stages decisions (queue mode); pass
3104
+ `--promote` to actually accept.
3078
3105
 
3079
3106
  ```sh
3080
3107
  akm proposal drain --dry-run # Preview without writing
@@ -3097,8 +3124,8 @@ akm proposal drain --strategy default --promote -y # Read the triage block from
3097
3124
 
3098
3125
  `akm feedback` accepts an optional `--reason <text>` flag whose value is
3099
3126
  forwarded into feedback metadata and consumed by improve/distill proposal
3100
- prompts. Negative feedback requires a reason by default: the next improve run
3101
- proposes a fix from it, so say what is wrong and what should change.
3127
+ prompts. Negative feedback requires a reason by default: say what is wrong and
3128
+ what should change.
3102
3129
 
3103
3130
  Write the reason about the asset's content. Reflect treats it as an unverified
3104
3131
  report to investigate, not a fact to insert, and is told to leave the section
@@ -467,7 +467,11 @@ guidance. When enabled, engine selection is judgment → triage → strategy →
467
467
 
468
468
  `processes.reflect.qualityGate` and `processes.distill.qualityGate` control
469
469
  each process's LLM-as-judge quality gate. Each is on unless it sets
470
- `enabled: false`, and each follows only its own switch. The judge is the
470
+ `enabled: false`, and each follows only its own switch. A reflect revision the
471
+ judge passes is staged for the triage drain to accept; a distill lesson it
472
+ passes is deferred for a person (reason `distill-review`), which the drain and
473
+ its judgment tier leave alone. With the distill gate off nothing is judged, and
474
+ the drain decides. The judge is the
471
475
  process's own engine when that is an LLM engine, or the `defaults.llmEngine`
472
476
  engine when an agent generates. `engine`, `model`, `timeoutMs` and `llm` give the gate a judge of its own,
473
477
  resolved over the process's settings the way `triage.judgment` resolves over
@@ -745,12 +749,11 @@ or malformed response keeps the fused order.
745
749
 
746
750
  ## Feedback
747
751
 
748
- `feedback` shapes the `akm feedback` taxonomy:
752
+ `feedback` configures `akm feedback`:
749
753
 
750
754
  | Key | Purpose |
751
755
  | --- | --- |
752
- | `feedback.requireReason` | Whether `akm feedback --negative` without `--reason`/`--failure-mode` is a hard error. **Defaults to `true`** when unset — set `false` to downgrade the check to a warning instead |
753
- | `feedback.allowedFailureModes` | Restrict `--failure-mode` values accepted by `akm feedback`. Curated set (also the default when unset): `incorrect`, `outdated`, `dangerous`, `incomplete`, `redundant` |
756
+ | `feedback.requireReason` | Whether `akm feedback --negative` without `--reason` is a hard error. **Defaults to `true`** when unset — set `false` to downgrade the check to a warning instead |
754
757
 
755
758
  ## Bundles and write target
756
759
 
@@ -159,7 +159,7 @@ the set of types the code actually emits at HEAD (verified against every
159
159
  | `curate` | `akm curate <prompt>` | `query`, `itemCount`, `itemRefs` |
160
160
  | `show` | `akm show <ref>` | `ref`, `type`, `name` |
161
161
  | `select` | `akm show` after a search returning the same ref | `ref`, `query`, `searchTs`, `rankPosition` |
162
- | `feedback` | `akm feedback <ref>` | `signal` (positive/negative), `reason`, `failureMode`, `tags` |
162
+ | `feedback` | `akm feedback <ref>` | `signal` (positive/negative), `reason`, `tags`, `fix` (`source`, the number of replacements and, for `--superseded-by` or `--outdated`, the `beliefState` the proposal leaves and the `supersededBy` ref, when a fix was attached), `contentHash` (sha256 of the asset's body, without its frontmatter, as it stood when the feedback was given: it lets reflect mark feedback given on an earlier version of the text, and the loop's distill pass tell that a memory flagged wrong still has it; left out for an env or secret file and when the file cannot be read) |
163
163
  | `sync` | `akm sync` | `name`, `message`, `ok` |
164
164
  | `index_db_vacuumed` | `akm index` VACUUMed index.db, after an index layout migration or because more than half its pages were free | `pagesBefore`, `pagesAfter`, `freelistRatioBefore` |
165
165
  | `stash_synced` | `akm improve`'s internal auto-sync pass (the `sync.push` feature), **distinct from** the `akm sync` command above | `committed`, `pushed`, `skipped`, `reason`, `attributed` (paths the run wrote and staged), `unattributed` (in-scope paths that went dirty during the run without the run writing them — left for their author) |
@@ -188,14 +188,14 @@ the set of types the code actually emits at HEAD (verified against every
188
188
  | `improve_invoked` | Start of an `akm improve` run | `ref` (scope); `strategy`, `scope`, `dryRun`, `eligibleCount` |
189
189
  | `improve_completed` | `akm improve` run finished | run stats |
190
190
  | `improve_failed` | `akm improve` run errored | error |
191
- | `improve_skipped` | `akm improve` left a ref, a lane, or a group of refs out | `reason` (`no_new_signal`, `not_retrieved`, `distill_no_new_signal`, `budget_exhausted`, `budget_exhausted_batch`, `asset_missing_on_disk`, `strategy_filtered_all_passes`, `autonomy_gated`, `engine_unavailable`, `pool_below_min_size`, `consolidation_no_memory_updates`, `below_min_new_sessions`, `derived_memory_reflect_skipped`, `memory_distill_requires_feedback`); `count`, `remaining`, `strategy`, `lane` or `configKey` where they apply |
191
+ | `improve_skipped` | `akm improve` left a ref, a lane, or a group of refs out | `reason` (`no_new_signal`, `not_retrieved`, `distill_no_new_signal`, `budget_exhausted`, `budget_exhausted_batch`, `asset_missing_on_disk`, `strategy_filtered_all_passes`, `autonomy_gated`, `engine_unavailable`, `pool_below_min_size`, `consolidation_no_memory_updates`, `below_min_new_sessions`, `derived_memory_reflect_skipped`, `memory_distill_requires_feedback`, `distill_flagged_wrong`, `distill_positive_without_reason`); `count`, `remaining`, `strategy`, `lane` or `configKey` where they apply |
192
192
  | `improve_lock_recovered` | Stale improve lock cleared at startup | |
193
193
  | `improve_review_needed` | `akm feedback` pushed a high-utility asset's utility below the review threshold — a review-needed escalation is recorded (not a proposal, so it can't accidentally overwrite the asset) | `ref`, `previousUtility`, `nextUtility` |
194
194
  | `reflect_invoked` | Start of reflect phase in `akm improve` | `ref`, engine |
195
195
  | `reflect_completed` | Reflect phase produced a proposal | `ref` |
196
196
  | `improve_reflect_outcome` | Per-asset reflect result | `ref`, `ok`, `durationMs`, `reason` |
197
197
  | `propose_invoked` | `akm proposal new` | `ref` |
198
- | `distill_invoked` | Distill phase inside the `akm improve`/`akm proposal new` pipeline. **`akm distill` is not a CLI command** — there is no standalone verb by that name | `ref`, outcome |
198
+ | `distill_invoked` | Distill phase inside the `akm improve`/`akm proposal new` pipeline. **`akm distill` is not a CLI command** — there is no standalone verb by that name | `ref`, outcome (`queued`, `skipped` with a `skipReason` such as `lesson_exists` or `conflict_noop`, `llm_failed`, `validation_failed`, `quality_rejected`, `review_needed`) |
199
199
  | `extract_invoked` | `akm proposal extract --type <harness>` / `--auto`, or improve-stage session extraction | `outcome`, `sessionId`, `harness` |
200
200
  | `extract_triaged` | The pre-LLM extract triage gate evaluated at least one session | `evaluated`, `passed`, `triagedOut`, `sourceRun` (aggregated) |
201
201
  | `schema_repair_invoked` | The schema-repair pass inside `akm improve` (`runSchemaRepairPass`) attempts to patch missing frontmatter on an asset that failed schema validation. **There is no `akm lint --repair` flag** — `lint` has `--fix`/`--auto-fix`, unrelated to this event | `ref`, outcome |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akm-cli",
3
- "version": "0.9.26-alpha.1",
3
+ "version": "0.9.26",
4
4
  "type": "module",
5
5
  "description": "akm (Agent Knowledge Manager) — a portable, local-first capability library for AI agents. Discover, load, share, and improve reusable skills, scripts, workflows, and knowledge across any shell-capable coding agent, including Claude Code, OpenCode, and Cursor.",
6
6
  "keywords": [
@@ -595,13 +595,6 @@
595
595
  "properties": {
596
596
  "requireReason": {
597
597
  "type": "boolean"
598
- },
599
- "allowedFailureModes": {
600
- "type": "array",
601
- "items": {
602
- "type": "string",
603
- "minLength": 1
604
- }
605
598
  }
606
599
  },
607
600
  "additionalProperties": true
@@ -2274,13 +2267,6 @@
2274
2267
  "properties": {
2275
2268
  "requireReason": {
2276
2269
  "type": "boolean"
2277
- },
2278
- "allowedFailureModes": {
2279
- "type": "array",
2280
- "items": {
2281
- "type": "string",
2282
- "minLength": 1
2283
- }
2284
2270
  }
2285
2271
  },
2286
2272
  "additionalProperties": true