akm-cli 0.10.261008-beta → 0.10.261009-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.
- package/CHANGELOG.md +61 -0
- package/STABILITY.md +10 -4
- package/dist/api.d.ts +6 -0
- package/dist/api.js +12 -1
- package/dist/assets/prompts/consolidate-pair-check.md +2 -0
- package/dist/assets/prompts/consolidate-pair-same-age.md +1 -0
- package/dist/assets/prompts/consolidate-pair-terms.md +6 -0
- package/dist/assets/prompts/consolidate-pair.md +4 -12
- package/dist/commands/health.js +1 -2
- package/dist/commands/improve/consolidate/pair-pass.js +59 -31
- package/dist/commands/improve/extract.js +18 -12
- package/dist/commands/improve/memory/memory-belief.js +2 -2
- package/dist/commands/proposal/repository.js +44 -13
- package/dist/commands/read/curate.js +77 -18
- package/dist/commands/read/search-cli.js +25 -11
- package/dist/commands/read/search.js +3 -3
- package/dist/commands/read/show.js +47 -1
- package/dist/core/adapter/adapters/akm-adapter.js +1 -0
- package/dist/core/adapter/adapters/llm-wiki-adapter.js +3 -5
- package/dist/core/adapter/adapters/okf-adapter.js +3 -16
- package/dist/core/asset/markdown-link-targets.js +43 -0
- package/dist/indexer/passes/metadata.js +17 -0
- package/dist/indexer/scan/doc-to-entry.js +1 -0
- package/dist/indexer/search/db-search.js +16 -7
- package/dist/indexer/search/search-hit-enrichers.js +3 -3
- package/dist/output/shapes/curate.js +3 -1
- package/dist/output/shapes/helpers.js +6 -0
- package/dist/output/text/show-format.js +7 -0
- package/dist/scripts/akm-migrate-node.js +1802 -319
- package/dist/scripts/akm-migrate.js +1802 -319
- package/dist/storage/repositories/index-entries-repository.js +16 -0
- package/dist/storage/repositories/index-fts-repository.js +28 -6
- package/dist/storage/repositories/index-vec-repository.js +19 -3
- package/docs/architecture/0.10-process-rules.md +4 -4
- package/docs/architecture/architecture.md +4 -0
- package/docs/architecture/persisted-data-compat.md +1 -1
- package/docs/reference/api.md +19 -1
- package/docs/reference/cli.md +51 -2
- package/docs/reference/memory.md +7 -6
- package/package.json +2 -1
|
@@ -17,7 +17,7 @@ export async function enrichSearchHit(hit, ctx) {
|
|
|
17
17
|
renderer?.enrichSearchHit?.(hit, ctx.stashDir);
|
|
18
18
|
}
|
|
19
19
|
if (ctx.type === "memory" && ctx.db)
|
|
20
|
-
surfaceDerivedMemory(hit, ctx.db, ctx.bundleId);
|
|
20
|
+
surfaceDerivedMemory(hit, ctx.db, ctx.bundleId, ctx.eligible);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Phase 5A / Advantage D5 — when a parent memory has a `.derived` child
|
|
@@ -28,7 +28,7 @@ export async function enrichSearchHit(hit, ctx) {
|
|
|
28
28
|
* The parent ref is preserved on the hit — only the surface text is
|
|
29
29
|
* swapped, so links and provenance still point at the canonical parent.
|
|
30
30
|
*/
|
|
31
|
-
function surfaceDerivedMemory(hit, db, bundleId) {
|
|
31
|
+
function surfaceDerivedMemory(hit, db, bundleId, eligible) {
|
|
32
32
|
// Never recurse: a `.derived` hit is itself the child surface; leaving
|
|
33
33
|
// it untouched also avoids `<parent>.derived.derived` chains.
|
|
34
34
|
if (hit.name.toLowerCase().endsWith(".derived"))
|
|
@@ -38,7 +38,7 @@ function surfaceDerivedMemory(hit, db, bundleId) {
|
|
|
38
38
|
// carries. INTERNAL lookup key into `getDerivedForParent`: the `derived_from`
|
|
39
39
|
// column stores this same conceptId grammar.
|
|
40
40
|
const derived = getDerivedForParent(db, `memories/${hit.name}`, bundleId);
|
|
41
|
-
if (!derived)
|
|
41
|
+
if (!derived || (eligible && !eligible(derived)))
|
|
42
42
|
return;
|
|
43
43
|
// Swap description / tags from the derived child (SourceSearchHit carries no
|
|
44
44
|
// `searchHints`).
|
|
@@ -5,7 +5,7 @@ import { capDescription, NORMAL_DESCRIPTION_LIMIT, pickFields } from "./helpers.
|
|
|
5
5
|
// Curation is a small, high-signal top-N. Even at `brief` we keep `followUp`
|
|
6
6
|
// (the actionable `akm show <ref>` command) and `reason` (why this asset was
|
|
7
7
|
// selected) — these are the point of curate, unlike a bulk search listing.
|
|
8
|
-
const BRIEF_FIELDS = ["source", "type", "name", "ref", "id", "supportRefs", "followUp", "reason"];
|
|
8
|
+
const BRIEF_FIELDS = ["source", "type", "name", "ref", "id", "supportRefs", "beliefState", "followUp", "reason"];
|
|
9
9
|
const NORMAL_FIELDS = [
|
|
10
10
|
"source",
|
|
11
11
|
"type",
|
|
@@ -21,6 +21,7 @@ const NORMAL_FIELDS = [
|
|
|
21
21
|
"parameters",
|
|
22
22
|
"run",
|
|
23
23
|
"supportRefs",
|
|
24
|
+
"beliefState",
|
|
24
25
|
"followUp",
|
|
25
26
|
"reason",
|
|
26
27
|
"score",
|
|
@@ -37,6 +38,7 @@ const AGENT_FIELDS = [
|
|
|
37
38
|
"id",
|
|
38
39
|
"description",
|
|
39
40
|
"supportRefs",
|
|
41
|
+
"beliefState",
|
|
40
42
|
"followUp",
|
|
41
43
|
"reason",
|
|
42
44
|
"score",
|
|
@@ -386,6 +386,9 @@ export function shapeShowOutput(result, detail, shape = "human") {
|
|
|
386
386
|
"steps",
|
|
387
387
|
"keys",
|
|
388
388
|
"links",
|
|
389
|
+
"evidence",
|
|
390
|
+
"evidenceSources",
|
|
391
|
+
"provenance",
|
|
389
392
|
...FRAGMENT_PROVENANCE_FIELDS,
|
|
390
393
|
...FRAGMENT_CONTEXT_FIELDS,
|
|
391
394
|
]);
|
|
@@ -418,6 +421,9 @@ export function shapeShowOutput(result, detail, shape = "human") {
|
|
|
418
421
|
"activeRun",
|
|
419
422
|
"keys",
|
|
420
423
|
"links",
|
|
424
|
+
"evidence",
|
|
425
|
+
"evidenceSources",
|
|
426
|
+
"provenance",
|
|
421
427
|
...FRAGMENT_PROVENANCE_FIELDS,
|
|
422
428
|
...FRAGMENT_CONTEXT_FIELDS,
|
|
423
429
|
// ref, path, and editable are always projected — at every --detail level,
|
|
@@ -20,6 +20,13 @@ export function formatShowPlain(r, detail) {
|
|
|
20
20
|
}
|
|
21
21
|
if (r.description)
|
|
22
22
|
lines.push(`description: ${String(r.description)}`);
|
|
23
|
+
// Evidence is captured text: keep it on one line so it cannot forge other fields.
|
|
24
|
+
if (r.evidence)
|
|
25
|
+
lines.push(`evidence: ${String(r.evidence).replace(/\s+/g, " ")}`);
|
|
26
|
+
if (Array.isArray(r.evidenceSources))
|
|
27
|
+
lines.push(`evidenceSources: ${r.evidenceSources.join(", ")}`);
|
|
28
|
+
if (r.evidence && r.provenance)
|
|
29
|
+
lines.push(`provenance: ${JSON.stringify(r.provenance)}`);
|
|
23
30
|
if (r.workflowTitle)
|
|
24
31
|
lines.push(`workflowTitle: ${String(r.workflowTitle)}`);
|
|
25
32
|
if (r.agent)
|