akm-cli 0.9.0-rc.4 → 0.9.0-rc.6
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 +122 -26
- package/README.md +7 -7
- package/SECURITY.md +11 -10
- package/dist/akm +2 -2
- package/dist/akm-migrate-storage +2 -2
- package/dist/assets/hints/cli-hints-full.md +60 -73
- package/dist/assets/hints/cli-hints-short.md +8 -12
- package/dist/assets/improve-strategies/default.json +5 -7
- package/dist/assets/improve-strategies/frequent.json +2 -2
- package/dist/assets/improve-strategies/proactive-maintenance.json +2 -2
- package/dist/assets/improve-strategies/quick.json +1 -1
- package/dist/assets/improve-strategies/reflect-distill.json +3 -3
- package/dist/assets/improve-strategies/thorough.json +1 -1
- package/dist/assets/prompts/consolidate-system.md +5 -5
- package/dist/assets/prompts/extract-session.md +2 -6
- package/dist/assets/prompts/reflect-llm-framed-contract.md +11 -0
- package/dist/assets/prompts/reflect-llm-schema-contract.md +3 -0
- package/dist/assets/prompts/reflect-output-repair.md +3 -0
- package/dist/assets/stash-skeleton/README.md +10 -11
- package/dist/assets/stash-skeleton/facts/conventions/assets/agent.md +1 -1
- package/dist/assets/stash-skeleton/facts/conventions/assets/fact.md +1 -1
- package/dist/assets/stash-skeleton/facts/conventions/assets/knowledge.md +1 -1
- package/dist/assets/stash-skeleton/facts/conventions/assets/lesson.md +2 -2
- package/dist/assets/stash-skeleton/facts/conventions/assets/memory.md +2 -2
- package/dist/assets/stash-skeleton/facts/conventions/assets/script.md +1 -1
- package/dist/assets/stash-skeleton/facts/conventions/assets/skill.md +2 -2
- package/dist/assets/stash-skeleton/facts/conventions/assets/workflow.md +1 -1
- package/dist/assets/stash-skeleton/facts/conventions/backlinks.md +18 -18
- package/dist/assets/stash-skeleton/facts/conventions/domains.md +8 -9
- package/dist/assets/stash-skeleton/facts/conventions/organization.md +13 -15
- package/dist/assets/tasks/core/extract.yml +2 -2
- package/dist/assets/tasks/core/improve.yml +1 -1
- package/dist/assets/templates/html/health.html +2 -3
- package/dist/cli/config-migrate.js +1328 -101
- package/dist/cli/invocation.js +255 -0
- package/dist/cli/parse-args.js +20 -83
- package/dist/cli/shared.js +15 -37
- package/dist/cli.js +18 -49
- package/dist/commands/agent/agent-dispatch.js +2 -2
- package/dist/commands/agent/contribute-cli.js +5 -4
- package/dist/commands/bundle/bundle-cli.js +68 -0
- package/dist/commands/bundle/bundle.js +219 -0
- package/dist/commands/completions.js +2 -2
- package/dist/commands/config-cli.js +6 -3
- package/dist/commands/env/env-binding.js +13 -9
- package/dist/commands/env/env-cli.js +49 -48
- package/dist/commands/env/secret-cli.js +24 -10
- package/dist/commands/events.js +2 -2
- package/dist/commands/feedback-cli.js +59 -33
- package/dist/commands/graph/graph.js +6 -4
- package/dist/commands/health/advisories.js +4 -4
- package/dist/commands/health/html-report.js +190 -593
- package/dist/commands/health/improve-metrics.js +240 -188
- package/dist/commands/health/metrics.js +9 -17
- package/dist/commands/health/report-view-model.js +509 -0
- package/dist/commands/health/surfaces.js +6 -3
- package/dist/commands/health/types-checks.js +4 -0
- package/dist/commands/health/types-improve.js +22 -0
- package/dist/commands/health/types-metrics.js +4 -0
- package/dist/commands/health/types-result.js +7 -0
- package/dist/commands/health/types-runs.js +4 -0
- package/dist/commands/health/types-session-log.js +4 -0
- package/dist/commands/health/types-windows.js +4 -0
- package/dist/commands/health/types.js +26 -21
- package/dist/commands/health/windows.js +1 -2
- package/dist/commands/health.js +219 -161
- package/dist/commands/improve/collapse-detector.js +25 -14
- package/dist/commands/improve/consolidate/chunking.js +7 -5
- package/dist/commands/improve/consolidate.js +640 -740
- package/dist/commands/improve/content-hash.js +39 -0
- package/dist/commands/improve/distill/content-repair.js +4 -10
- package/dist/commands/improve/distill/promote-memory.js +79 -49
- package/dist/commands/improve/distill/quality-gate.js +113 -35
- package/dist/commands/improve/distill-promotion-policy.js +24 -885
- package/dist/commands/improve/distill.js +565 -337
- package/dist/commands/improve/eligibility.js +75 -36
- package/dist/commands/improve/extract-cli.js +6 -6
- package/dist/commands/improve/extract-prompt.js +5 -34
- package/dist/commands/improve/extract.js +526 -357
- package/dist/commands/improve/feedback-valence.js +2 -12
- package/dist/commands/improve/improve-cli.js +11 -20
- package/dist/commands/improve/improve-result-file.js +7 -6
- package/dist/commands/improve/improve-run-types.js +4 -0
- package/dist/commands/improve/improve-strategies.js +3 -9
- package/dist/commands/improve/improve.js +822 -727
- package/dist/commands/improve/locks.js +27 -95
- package/dist/commands/improve/loop-stages.js +941 -963
- package/dist/commands/improve/memory/derived-ref.js +122 -0
- package/dist/commands/improve/memory/memory-contradiction-detect.js +35 -38
- package/dist/commands/improve/memory/memory-improve.js +24 -37
- package/dist/commands/improve/outcome-loop.js +13 -33
- package/dist/commands/improve/preparation.js +889 -691
- package/dist/commands/improve/proactive-maintenance.js +37 -9
- package/dist/commands/improve/proposal-envelope.js +31 -0
- package/dist/commands/improve/reflect.js +974 -588
- package/dist/commands/improve/run-context.js +119 -0
- package/dist/commands/improve/salience.js +8 -4
- package/dist/commands/improve/session-asset.js +7 -3
- package/dist/commands/improve/shared.js +14 -40
- package/dist/commands/improve/source-identity.js +39 -26
- package/dist/commands/improve/triage.js +20 -17
- package/dist/commands/lint/base-linter.js +288 -295
- package/dist/commands/lint/index.js +132 -19
- package/dist/commands/mv-cli.js +257 -234
- package/dist/commands/observability-cli.js +2 -1
- package/dist/commands/proposal/diff-format.js +50 -0
- package/dist/commands/proposal/drain-policies.js +0 -6
- package/dist/commands/proposal/drain.js +17 -16
- package/dist/commands/proposal/proposal-cli.js +40 -77
- package/dist/commands/proposal/proposal-types.js +56 -0
- package/dist/commands/proposal/proposal.js +39 -1
- package/dist/commands/proposal/propose.js +41 -19
- package/dist/commands/proposal/repository.js +566 -486
- package/dist/commands/proposal/validators/proposal-quality-validators.js +22 -6
- package/dist/commands/proposal/validators/proposal-validators.js +6 -5
- package/dist/commands/proposal/validators/proposals.js +5 -4
- package/dist/commands/read/curate.js +50 -28
- package/dist/commands/read/knowledge.js +25 -16
- package/dist/commands/read/remember-cli.js +12 -4
- package/dist/commands/read/search-cli.js +33 -33
- package/dist/commands/read/search.js +68 -55
- package/dist/commands/read/show.js +54 -135
- package/dist/commands/remember.js +7 -5
- package/dist/commands/sources/add-cli.js +10 -24
- package/dist/commands/sources/bundle-config-ops.js +58 -0
- package/dist/commands/sources/history.js +13 -8
- package/dist/commands/sources/info.js +10 -11
- package/dist/commands/sources/init.js +12 -21
- package/dist/commands/sources/installed-stashes.js +151 -138
- package/dist/commands/sources/schema-repair.js +5 -3
- package/dist/commands/sources/self-update.js +9 -7
- package/dist/commands/sources/source-add.js +116 -154
- package/dist/commands/sources/source-clone.js +33 -14
- package/dist/commands/sources/source-manage.js +43 -32
- package/dist/commands/sources/sources-cli.js +12 -7
- package/dist/commands/sources/stash-cli.js +12 -5
- package/dist/commands/sources/stash-skeleton.js +1 -1
- package/dist/commands/tasks/default-tasks.js +13 -13
- package/dist/commands/tasks/tasks-cli.js +3 -3
- package/dist/commands/tasks/tasks.js +71 -31
- package/dist/commands/workflow-cli.js +22 -26
- package/dist/core/action-contributors.js +1 -1
- package/dist/core/activation-policy.js +49 -0
- package/dist/core/adapter/adapters/agent-skills-adapter.js +181 -0
- package/dist/core/adapter/adapters/akm-adapter.js +509 -0
- package/dist/core/adapter/adapters/akm-lint.js +381 -0
- package/dist/core/adapter/adapters/akm-metadata.js +416 -0
- package/dist/core/adapter/adapters/akm-task-adapter.js +150 -0
- package/dist/core/adapter/adapters/akm-workflow-adapter.js +196 -0
- package/dist/core/adapter/adapters/claude-adapter.js +61 -0
- package/dist/core/adapter/adapters/dotenv-adapter.js +187 -0
- package/dist/core/adapter/adapters/generic-files-adapter.js +117 -0
- package/dist/core/adapter/adapters/index.js +80 -0
- package/dist/core/adapter/adapters/llm-wiki-adapter.js +413 -0
- package/dist/core/adapter/adapters/okf-adapter.js +223 -0
- package/dist/core/adapter/adapters/opencode-adapter.js +68 -0
- package/dist/core/adapter/adapters/shared.js +286 -0
- package/dist/core/adapter/adapters/tool-dir-shared.js +212 -0
- package/dist/core/adapter/adapters/website-snapshot-adapter.js +154 -0
- package/dist/core/adapter/bundle-adapter.js +4 -0
- package/dist/core/adapter/recognize-match.js +42 -0
- package/dist/core/adapter/registry.js +56 -0
- package/dist/core/adapter/types.js +4 -0
- package/dist/core/asset/asset-placement.js +229 -0
- package/dist/core/asset/asset-ref.js +107 -78
- package/dist/core/asset/asset-serialize.js +20 -0
- package/dist/core/asset/frontmatter.js +1 -1
- package/dist/core/asset/resolve-ref.js +223 -0
- package/dist/core/asset/stash-meta.js +1 -1
- package/dist/core/common.js +141 -49
- package/dist/core/config/config-io.js +0 -108
- package/dist/core/config/config-schema.js +94 -1039
- package/dist/core/config/config-sources.js +115 -36
- package/dist/core/config/config-types.js +16 -11
- package/dist/core/config/config-walker.js +4 -2
- package/dist/core/config/config.js +21 -26
- package/dist/core/config/engine-semantics.js +0 -4
- package/dist/core/config/schema/embedding.js +38 -0
- package/dist/core/config/schema/engines.js +116 -0
- package/dist/core/config/schema/feedback.js +31 -0
- package/dist/core/config/schema/improve-processes.js +395 -0
- package/dist/core/config/schema/improve.js +76 -0
- package/dist/core/config/schema/index-config.js +183 -0
- package/dist/core/config/schema/output.js +15 -0
- package/dist/core/config/schema/primitives.js +94 -0
- package/dist/core/config/schema/search.js +30 -0
- package/dist/core/config/schema/setup.js +27 -0
- package/dist/core/config/schema/sources-bundles.js +164 -0
- package/dist/core/config/schema/workflow.js +29 -0
- package/dist/core/env-secret-ref.js +113 -8
- package/dist/core/errors.js +1 -1
- package/dist/core/events-types.js +4 -0
- package/dist/core/extra-params.js +1 -0
- package/dist/core/file-change.js +16 -0
- package/dist/core/fs-txn.js +316 -0
- package/dist/core/git-message.js +59 -0
- package/dist/core/improve-result.js +9 -1
- package/dist/core/logs-db.js +1 -1
- package/dist/core/maintenance-barrier.js +16 -0
- package/dist/core/migration-backup.js +332 -160
- package/dist/core/paths.js +3 -6
- package/dist/core/platform.js +10 -0
- package/dist/core/recognition-util.js +130 -0
- package/dist/core/redaction.js +2 -2
- package/dist/core/standards/resolve-standards-context.js +47 -64
- package/dist/core/standards/resolve-type-conventions.js +3 -3
- package/dist/core/state/migrations.js +201 -8
- package/dist/core/state-db.js +38 -2
- package/dist/core/subprocess.js +303 -0
- package/dist/core/time.js +20 -0
- package/dist/core/type-presentation.js +130 -0
- package/dist/core/write-source.js +39 -67
- package/dist/indexer/bundle-identity-guard.js +91 -0
- package/dist/indexer/db/graph-db.js +1 -1
- package/dist/indexer/db/llm-cache.js +1 -1
- package/dist/indexer/ensure-index.js +29 -9
- package/dist/indexer/graph/graph-boost.js +28 -24
- package/dist/indexer/graph/graph-extraction.js +5 -6
- package/dist/indexer/graph/graph-types.js +4 -0
- package/dist/indexer/index-written-assets.js +44 -17
- package/dist/indexer/indexer.js +289 -153
- package/dist/indexer/init.js +18 -25
- package/dist/indexer/installations.js +224 -0
- package/dist/indexer/passes/dir-staleness.js +2 -1
- package/dist/indexer/passes/memory-inference.js +8 -4
- package/dist/indexer/passes/metadata.js +96 -243
- package/dist/indexer/scan/doc-to-entry.js +123 -0
- package/dist/indexer/scan/drain-dir.js +144 -0
- package/dist/indexer/search/db-search.js +171 -99
- package/dist/indexer/search/fts-query.js +1 -1
- package/dist/indexer/search/ranking-contributors.js +57 -7
- package/dist/indexer/search/ranking-types.js +4 -0
- package/dist/indexer/search/ranking.js +31 -6
- package/dist/indexer/search/search-attribution.js +67 -0
- package/dist/indexer/search/search-hit-enrichers.js +30 -40
- package/dist/indexer/search/search-source.js +109 -52
- package/dist/indexer/search/semantic-status.js +4 -1
- package/dist/indexer/usage/unmigrated-vaults-guard.js +2 -1
- package/dist/indexer/usage/usage-events.js +72 -9
- package/dist/indexer/walk/file-context.js +1 -44
- package/dist/indexer/walk/matchers.js +16 -32
- package/dist/indexer/walk/path-resolver.js +6 -5
- package/dist/indexer/walk/walker.js +4 -2
- package/dist/integrations/agent/engine-resolution.js +22 -0
- package/dist/integrations/agent/model-aliases.js +1 -1
- package/dist/integrations/agent/prompts.js +35 -11
- package/dist/integrations/agent/spawn.js +41 -270
- package/dist/integrations/harnesses/aider/agent-builder.js +2 -2
- package/dist/integrations/harnesses/aider/index.js +2 -11
- package/dist/integrations/harnesses/amazonq/agent-builder.js +1 -9
- package/dist/integrations/harnesses/amazonq/index.js +3 -16
- package/dist/integrations/harnesses/claude/config-import.js +1 -3
- package/dist/integrations/harnesses/claude/index.js +1 -12
- package/dist/integrations/harnesses/claude/session-log.js +27 -65
- package/dist/integrations/harnesses/codex/agent-builder.js +1 -2
- package/dist/integrations/harnesses/codex/index.js +2 -12
- package/dist/integrations/harnesses/copilot/agent-builder.js +2 -3
- package/dist/integrations/harnesses/copilot/index.js +1 -12
- package/dist/integrations/harnesses/gemini/agent-builder.js +1 -3
- package/dist/integrations/harnesses/gemini/index.js +1 -12
- package/dist/integrations/harnesses/ids.js +24 -0
- package/dist/integrations/harnesses/index.js +27 -2
- package/dist/integrations/harnesses/opencode/config-import.js +1 -3
- package/dist/integrations/harnesses/opencode/index.js +1 -12
- package/dist/integrations/harnesses/opencode/session-log.js +67 -110
- package/dist/integrations/harnesses/opencode-sdk/harness.js +2 -11
- package/dist/integrations/harnesses/openhands/agent-builder.js +3 -3
- package/dist/integrations/harnesses/openhands/index.js +2 -11
- package/dist/integrations/harnesses/pi/agent-builder.js +3 -11
- package/dist/integrations/harnesses/pi/index.js +3 -15
- package/dist/integrations/harnesses/shared.js +17 -0
- package/dist/integrations/harnesses/types.js +37 -2
- package/dist/integrations/lockfile.js +36 -0
- package/dist/integrations/session-logs/index.js +21 -12
- package/dist/integrations/session-logs/provider-base.js +113 -0
- package/dist/llm/client.js +7 -5
- package/dist/llm/embedders/deterministic.js +2 -2
- package/dist/llm/embedders/remote.js +8 -4
- package/dist/llm/graph-extract.js +7 -2
- package/dist/llm/metadata-enhance.js +43 -26
- package/dist/llm/structured-call.js +15 -7
- package/dist/migrate/legacy/config-source-migration.js +223 -0
- package/dist/migrate/legacy/content-migration.js +305 -0
- package/dist/migrate/legacy/legacy-layout.js +779 -0
- package/dist/migrate/legacy/legacy-paths.js +25 -0
- package/dist/migrate/legacy/legacy-stash-json.js +72 -0
- package/dist/migrate/legacy/proposal-fs-import.js +168 -0
- package/dist/migrate/legacy/task-target-ref-migration.js +272 -0
- package/dist/migrate/legacy/three-db-cutover.js +840 -0
- package/dist/migrate/legacy/workflow-migrations-bodies.js +52 -0
- package/dist/migrate/legacy/workflow-migrations-frozen.js +21 -0
- package/dist/migrate/legacy-ref-grammar.js +209 -0
- package/dist/output/command-registry.js +27 -0
- package/dist/output/html-render.js +11 -16
- package/dist/output/renderers.js +32 -276
- package/dist/output/shapes/passthrough.js +3 -9
- package/dist/output/shapes/registry.js +12 -6
- package/dist/output/text/command-format.js +547 -0
- package/dist/output/text/helpers.js +15 -1377
- package/dist/output/text/proposal-format.js +230 -0
- package/dist/output/text/registry.js +12 -6
- package/dist/output/text/show-directives.js +107 -0
- package/dist/output/text/show-format.js +103 -0
- package/dist/output/text/workflow-format.js +345 -0
- package/dist/output/text.js +1 -3
- package/dist/registry/build-index.js +13 -17
- package/dist/registry/providers/static-index.js +2 -2
- package/dist/registry/resolve.js +4 -90
- package/dist/registry/semver.js +93 -0
- package/dist/runtime.js +90 -0
- package/dist/schemas/akm-config.json +2956 -14890
- package/dist/schemas/akm-task.json +2 -2
- package/dist/schemas/akm-workflow.json +2 -2
- package/dist/scripts/migrate-storage.js +2312 -19642
- package/dist/setup/detect.js +5 -7
- package/dist/setup/engine-config.js +2 -1
- package/dist/setup/registry-stash-loader.js +1 -1
- package/dist/setup/semantic-assets.js +12 -9
- package/dist/setup/setup.js +109 -39
- package/dist/setup/steps/connection-shared.js +120 -0
- package/dist/setup/steps/connection.js +50 -274
- package/dist/setup/steps/platforms.js +1 -0
- package/dist/setup/steps/sources.js +13 -6
- package/dist/setup/steps/stashdir.js +5 -2
- package/dist/sources/freshness.js +39 -0
- package/dist/sources/providers/git-provider.js +29 -33
- package/dist/sources/providers/git-stash.js +10 -5
- package/dist/sources/providers/provider-utils.js +40 -18
- package/dist/sources/providers/website.js +1 -1
- package/dist/sources/resolve.js +5 -5
- package/dist/sources/snapshot-fetchers/types.js +4 -0
- package/dist/sources/{website-ingest.js → snapshot-fetchers/website-ingest.js} +105 -39
- package/dist/storage/database.js +47 -3
- package/dist/storage/engines/sqlite-migrations.js +34 -16
- package/dist/storage/locations.js +1 -2
- package/dist/storage/repositories/improve-runs-repository.js +0 -20
- package/dist/storage/repositories/index-connection.js +80 -0
- package/dist/storage/repositories/index-db.js +4 -3
- package/dist/storage/repositories/index-entries-repository.js +952 -0
- package/dist/{indexer/db/entry-mapper.js → storage/repositories/index-entry-mapper.js} +15 -2
- package/dist/storage/repositories/index-entry-types.js +4 -0
- package/dist/storage/repositories/index-fts-repository.js +164 -0
- package/dist/storage/repositories/index-llm-cache-repository.js +109 -0
- package/dist/storage/repositories/index-meta-repository.js +50 -0
- package/dist/{indexer/db/schema.js → storage/repositories/index-schema.js} +241 -100
- package/dist/storage/repositories/index-sql.js +12 -0
- package/dist/storage/repositories/index-utility-repository.js +369 -0
- package/dist/storage/repositories/index-vec-repository.js +245 -0
- package/dist/storage/repositories/proposals-repository.js +41 -50
- package/dist/storage/repositories/registry-cache.js +1 -1
- package/dist/storage/repositories/workflow-runs-repository.js +17 -11
- package/dist/tasks/backends/cron.js +5 -5
- package/dist/tasks/backends/exec-utils.js +21 -0
- package/dist/tasks/backends/index.js +6 -9
- package/dist/tasks/backends/launchd.js +16 -17
- package/dist/tasks/backends/schtasks.js +33 -41
- package/dist/tasks/backends/types.js +4 -0
- package/dist/tasks/parser.js +25 -5
- package/dist/tasks/runner.js +33 -39
- package/dist/tasks/validator.js +5 -6
- package/dist/workflows/authoring/authoring.js +8 -11
- package/dist/workflows/exec/brief.js +10 -7
- package/dist/workflows/exec/report.js +261 -156
- package/dist/workflows/exec/run-workflow.js +2 -1
- package/dist/workflows/exec/step-work.js +3 -9
- package/dist/workflows/program/parser.js +4 -60
- package/dist/workflows/renderer.js +11 -60
- package/dist/workflows/runtime/checkin.js +1 -1
- package/dist/workflows/runtime/plan-classifier.js +7 -4
- package/dist/workflows/runtime/runs.js +11 -10
- package/dist/workflows/runtime/unit-checkin.js +1 -1
- package/dist/workflows/runtime/unit-phases.js +20 -0
- package/dist/workflows/runtime/workflow-asset-loader.js +27 -16
- package/dist/workflows/validate-summary.js +2 -2
- package/dist/workflows/validator.js +18 -2
- package/docs/migration/release-notes/0.9.0.md +45 -3
- package/docs/migration/v0.8-to-v0.9.md +466 -262
- package/docs/{data-and-telemetry.md → reference/data-and-telemetry.md} +61 -17
- package/package.json +10 -9
- package/schemas/akm-config.json +2956 -14890
- package/schemas/akm-task.json +2 -2
- package/schemas/akm-workflow.json +2 -2
- package/dist/assets/help/help-accept.md +0 -12
- package/dist/assets/help/help-improve.md +0 -84
- package/dist/assets/help/help-proposals.md +0 -17
- package/dist/assets/help/help-propose.md +0 -17
- package/dist/assets/help/help-reject.md +0 -11
- package/dist/assets/improve-strategies/recombine-only.json +0 -23
- package/dist/assets/improve-strategies/synthesize.json +0 -17
- package/dist/assets/prompts/procedural-system.md +0 -44
- package/dist/assets/prompts/recombine-system.md +0 -40
- package/dist/assets/prompts/staleness-detect-system.md +0 -6
- package/dist/assets/templates/html/default.html +0 -78
- package/dist/assets/templates/html/vendor/echarts.min.js +0 -45
- package/dist/assets/wiki/index-template.md +0 -12
- package/dist/assets/wiki/ingest-workflow-template.md +0 -83
- package/dist/assets/wiki/log-template.md +0 -8
- package/dist/assets/wiki/schema-template.md +0 -61
- package/dist/commands/improve/calibration.js +0 -161
- package/dist/commands/improve/dedup.js +0 -482
- package/dist/commands/improve/hot-probation.js +0 -45
- package/dist/commands/improve/improve-auto-accept.js +0 -262
- package/dist/commands/improve/procedural.js +0 -403
- package/dist/commands/improve/recombine.js +0 -843
- package/dist/commands/improve/schema-similarity-gate.js +0 -168
- package/dist/commands/lint/agent-linter.js +0 -44
- package/dist/commands/lint/command-linter.js +0 -44
- package/dist/commands/lint/default-linter.js +0 -16
- package/dist/commands/lint/fact-linter.js +0 -39
- package/dist/commands/lint/knowledge-linter.js +0 -16
- package/dist/commands/lint/memory-linter.js +0 -61
- package/dist/commands/lint/registry.js +0 -41
- package/dist/commands/lint/skill-linter.js +0 -45
- package/dist/commands/lint/task-linter.js +0 -50
- package/dist/commands/lint/workflow-linter.js +0 -81
- package/dist/commands/proposal/legacy-import.js +0 -115
- package/dist/commands/wiki-cli.js +0 -291
- package/dist/core/asset/asset-registry.js +0 -76
- package/dist/core/asset/asset-spec.js +0 -316
- package/dist/core/eval/rank-metrics.js +0 -113
- package/dist/core/ripgrep/install.js +0 -163
- package/dist/core/ripgrep/resolve.js +0 -81
- package/dist/indexer/db/db.js +0 -1585
- package/dist/indexer/manifest.js +0 -170
- package/dist/indexer/passes/metadata-contributors.js +0 -31
- package/dist/integrations/harnesses/opencode-sdk/index.js +0 -25
- package/dist/output/text/wiki.js +0 -16
- package/dist/scripts/migrations/import-fs-improve-runs-to-db.js +0 -18228
- package/dist/scripts/migrations/v16-to-v17.js +0 -141
- package/dist/storage/repositories/consolidation-repository.js +0 -38
- package/dist/storage/repositories/recombine-repository.js +0 -213
- package/dist/wiki/wiki-templates.js +0 -15
- package/dist/wiki/wiki.js +0 -1013
- package/dist/workflows/db.js +0 -413
- package/docs/README.md +0 -103
- package/docs/migration/release-notes/0.9.0-beta.60.md +0 -19
- /package/dist/sources/{wiki-fetchers → snapshot-fetchers}/registry.js +0 -0
- /package/dist/sources/{wiki-fetchers → snapshot-fetchers}/youtube.js +0 -0
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
import { spawnSync } from "node:child_process";
|
|
19
19
|
import fs from "node:fs";
|
|
20
20
|
import path from "node:path";
|
|
21
|
+
import { getParsedInvocation } from "../../cli/invocation.js";
|
|
21
22
|
import { getStringArg } from "../../cli/parse-args.js";
|
|
22
23
|
import { defineGroupCommand, defineJsonCommand, output } from "../../cli/shared.js";
|
|
23
|
-
import { deriveCanonicalAssetName } from "../../core/asset/asset-
|
|
24
|
+
import { deriveCanonicalAssetName } from "../../core/asset/asset-placement.js";
|
|
24
25
|
import { loadConfig } from "../../core/config/config.js";
|
|
25
|
-
import { makeSecretRef, resolveSecretPath } from "../../core/env-secret-ref.js";
|
|
26
|
+
import { commitEnvSecretWrite, makeSecretRef, resolveSecretPath, resolveSecretWriteTarget, writeTargetDisplaySource, } from "../../core/env-secret-ref.js";
|
|
26
27
|
import { ConfigError, NotFoundError, UsageError } from "../../core/errors.js";
|
|
27
28
|
import { appendEvent } from "../../core/events.js";
|
|
28
29
|
import { resolveSourceEntries } from "../../indexer/search/search-source.js";
|
|
@@ -94,10 +95,17 @@ const secretSetCommand = defineJsonCommand({
|
|
|
94
95
|
},
|
|
95
96
|
"from-file": { type: "string", description: "Read the value from this file (stored byte-exact)" },
|
|
96
97
|
"from-env": { type: "string", description: "Read the value from the named environment variable" },
|
|
98
|
+
target: {
|
|
99
|
+
type: "string",
|
|
100
|
+
description: "Override the write destination. Accepts a source name from your config; falls back to defaultWriteTarget then the working stash.",
|
|
101
|
+
},
|
|
97
102
|
},
|
|
98
103
|
async run({ args }) {
|
|
99
104
|
const { setSecret } = await import("./secret.js");
|
|
100
|
-
const { name, absPath,
|
|
105
|
+
const { name, absPath, target } = resolveSecretWriteTarget(args.ref, args.target, {
|
|
106
|
+
subPath: getStringArg(args, "path"),
|
|
107
|
+
});
|
|
108
|
+
const displaySource = writeTargetDisplaySource(target);
|
|
101
109
|
const fromEnv = args["from-env"];
|
|
102
110
|
const fromFile = args["from-file"];
|
|
103
111
|
if (fromEnv !== undefined && fromFile !== undefined) {
|
|
@@ -132,7 +140,8 @@ const secretSetCommand = defineJsonCommand({
|
|
|
132
140
|
value = Buffer.from(stdinBuf.toString("utf8").replace(/\n$/, ""), "utf8");
|
|
133
141
|
}
|
|
134
142
|
setSecret(absPath, value);
|
|
135
|
-
|
|
143
|
+
commitEnvSecretWrite(target, { type: "secret", name }, "Update", [absPath]);
|
|
144
|
+
output("secret-set", { ref: makeSecretRef(name, displaySource) });
|
|
136
145
|
},
|
|
137
146
|
});
|
|
138
147
|
const secretPathCommand = defineJsonCommand({
|
|
@@ -181,11 +190,10 @@ const secretRunCommand = defineJsonCommand({
|
|
|
181
190
|
if (isDangerousEnvKey(varName)) {
|
|
182
191
|
throw new UsageError(`Refusing to inject a secret into "${varName}": it is a known process-hijacking variable (e.g. LD_PRELOAD, PATH).`, "INVALID_FLAG_VALUE");
|
|
183
192
|
}
|
|
184
|
-
const
|
|
185
|
-
if (
|
|
193
|
+
const command = getParsedInvocation().passthroughArgs();
|
|
194
|
+
if (command.length === 0) {
|
|
186
195
|
throw new UsageError("Missing command. Usage: akm secret run <ref> <VAR> -- <command>");
|
|
187
196
|
}
|
|
188
|
-
const command = process.argv.slice(dashIndex + 1);
|
|
189
197
|
const { name, absPath, source } = resolveSecretPath(args.ref);
|
|
190
198
|
if (!fs.existsSync(absPath)) {
|
|
191
199
|
throw new NotFoundError(`Secret not found: ${makeSecretRef(name, source)}`);
|
|
@@ -224,9 +232,14 @@ const secretRemoveCommand = defineJsonCommand({
|
|
|
224
232
|
args: {
|
|
225
233
|
ref: { type: "positional", description: "Secret ref", required: true },
|
|
226
234
|
yes: { type: "boolean", alias: "y", description: "Skip confirmation prompt", default: false },
|
|
235
|
+
target: {
|
|
236
|
+
type: "string",
|
|
237
|
+
description: "Override the write destination. Accepts a source name from your config; falls back to defaultWriteTarget then the working stash.",
|
|
238
|
+
},
|
|
227
239
|
},
|
|
228
240
|
async run({ args }) {
|
|
229
|
-
const { name, absPath,
|
|
241
|
+
const { name, absPath, target } = resolveSecretWriteTarget(args.ref, args.target);
|
|
242
|
+
const displaySource = writeTargetDisplaySource(target);
|
|
230
243
|
const { confirmDestructive } = await import("../../cli/confirm.js");
|
|
231
244
|
const confirmed = await confirmDestructive(`Remove secret "${args.ref}"? This cannot be undone.`, {
|
|
232
245
|
yes: args.yes === true,
|
|
@@ -237,10 +250,11 @@ const secretRemoveCommand = defineJsonCommand({
|
|
|
237
250
|
}
|
|
238
251
|
const { removeSecret } = await import("./secret.js");
|
|
239
252
|
if (!fs.existsSync(absPath)) {
|
|
240
|
-
throw new NotFoundError(`Secret not found: ${makeSecretRef(name,
|
|
253
|
+
throw new NotFoundError(`Secret not found: ${makeSecretRef(name, displaySource)}`);
|
|
241
254
|
}
|
|
242
255
|
const removed = removeSecret(absPath);
|
|
243
|
-
|
|
256
|
+
commitEnvSecretWrite(target, { type: "secret", name }, "Remove", [absPath, `${absPath}.sensitive`]);
|
|
257
|
+
output("secret-remove", { ref: makeSecretRef(name, displaySource), removed });
|
|
244
258
|
},
|
|
245
259
|
});
|
|
246
260
|
export const secretCommand = defineGroupCommand({
|
package/dist/commands/events.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* text-renderer pipeline as the rest of the CLI (no silent
|
|
11
11
|
* `JSON.stringify` fallback).
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import { parseRefInput } from "../core/asset/resolve-ref.js";
|
|
14
14
|
import { UsageError } from "../core/errors.js";
|
|
15
15
|
import { readEvents, tailEvents } from "../core/events.js";
|
|
16
16
|
import { parseSinceToIso } from "../core/time.js";
|
|
@@ -43,7 +43,7 @@ function validateRef(ref) {
|
|
|
43
43
|
if (!trimmed) {
|
|
44
44
|
throw new UsageError("--ref cannot be empty.", "INVALID_FLAG_VALUE");
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
parseRefInput(trimmed);
|
|
47
47
|
return trimmed;
|
|
48
48
|
}
|
|
49
49
|
export function akmEventsList(options = {}) {
|
|
@@ -3,18 +3,21 @@
|
|
|
3
3
|
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import { defineJsonCommand, output, parseAllFlagValues } from "../cli/shared.js";
|
|
6
|
-
import { parseAssetRef, refToString } from "../core/asset/asset-ref.js";
|
|
7
6
|
import { assembleAsset } from "../core/asset/asset-serialize.js";
|
|
8
7
|
import { parseFrontmatter, parseFrontmatterBlock } from "../core/asset/frontmatter.js";
|
|
8
|
+
import { conceptIdFromTypeName, displayRef, parseRefInput } from "../core/asset/resolve-ref.js";
|
|
9
9
|
import { writeFileAtomic } from "../core/common.js";
|
|
10
10
|
import { FEEDBACK_FAILURE_MODES, loadConfig } from "../core/config/config.js";
|
|
11
11
|
import { UsageError } from "../core/errors.js";
|
|
12
12
|
import { appendEvent } from "../core/events.js";
|
|
13
13
|
import { getDbPath } from "../core/paths.js";
|
|
14
|
+
import { withStateDb } from "../core/state-db.js";
|
|
14
15
|
import { warn } from "../core/warn.js";
|
|
15
|
-
import { applyFeedbackToUtilityScore, closeDatabase, findEntryIdByRef, getEntryById, getEntryFilePathById, openExistingDatabase, } from "../indexer/db/db.js";
|
|
16
16
|
import { resolveSourceEntries } from "../indexer/search/search-source.js";
|
|
17
|
-
import { countFeedbackSignals, insertUsageEvent } from "../indexer/usage/usage-events.js";
|
|
17
|
+
import { countFeedbackSignals, insertUsageEvent, resolveUsageEventSource } from "../indexer/usage/usage-events.js";
|
|
18
|
+
import { closeDatabase, openExistingDatabase } from "../storage/repositories/index-connection.js";
|
|
19
|
+
import { findEntryIdByRef, getEntryById, getEntryFilePathById, getItemRefById, } from "../storage/repositories/index-entries-repository.js";
|
|
20
|
+
import { applyFeedbackToUtilityScore } from "../storage/repositories/index-utility-repository.js";
|
|
18
21
|
// ── Tag validation ────────────────────────────────────────────────────────────
|
|
19
22
|
const TAG_KEY_RE = /^[a-z_][a-z0-9_]*$/;
|
|
20
23
|
const MAX_FEEDBACK_TAGS = 10;
|
|
@@ -54,7 +57,10 @@ function validateFeedbackTags(raw) {
|
|
|
54
57
|
* `inferenceProcessed`.
|
|
55
58
|
*/
|
|
56
59
|
function appendLessonStrength(type, name, feedbackRef) {
|
|
57
|
-
|
|
60
|
+
// Canonical 0.9.0 conceptId (`lessons/<name>`, D-R3) — `findEntryIdByRef`
|
|
61
|
+
// keys on the stored `item_ref` and parses its argument as the new grammar,
|
|
62
|
+
// so a `type:name` lookup here would never match.
|
|
63
|
+
const ref = conceptIdFromTypeName(type, name);
|
|
58
64
|
let filePath;
|
|
59
65
|
const db = openExistingDatabase();
|
|
60
66
|
try {
|
|
@@ -107,6 +113,39 @@ function appendLessonStrength(type, name, feedbackRef) {
|
|
|
107
113
|
}
|
|
108
114
|
return { strength: strengthList.length };
|
|
109
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Persist the feedback usage-event (state.db) and immediately fold it into the
|
|
118
|
+
* entry's MemRL utility score (index.db). Chunk-8 WI-8.3: usage_events lives in
|
|
119
|
+
* state.db; entries + utility_scores stay in `indexDb`. Positive signals raise
|
|
120
|
+
* search ranking on the next read without a full reindex; negatives are durable
|
|
121
|
+
* but take effect at the next `akm index`. Uses the bounded-step EMA policy
|
|
122
|
+
* (F-5 / #386, arXiv:2601.03192). Best-effort: a utility-update failure never
|
|
123
|
+
* fails the feedback record.
|
|
124
|
+
*/
|
|
125
|
+
function recordFeedbackUsage(indexDb, entryId, durableEntryRef, signal, metadataStr) {
|
|
126
|
+
let utilityResult;
|
|
127
|
+
const eventSource = resolveUsageEventSource();
|
|
128
|
+
withStateDb((stateDb) => {
|
|
129
|
+
insertUsageEvent(stateDb, {
|
|
130
|
+
event_type: "feedback",
|
|
131
|
+
entry_ref: durableEntryRef,
|
|
132
|
+
entry_id: entryId,
|
|
133
|
+
signal,
|
|
134
|
+
metadata: metadataStr,
|
|
135
|
+
source: eventSource,
|
|
136
|
+
});
|
|
137
|
+
if (eventSource !== "user")
|
|
138
|
+
return;
|
|
139
|
+
try {
|
|
140
|
+
const { pos, neg } = countFeedbackSignals(stateDb, entryId);
|
|
141
|
+
utilityResult = applyFeedbackToUtilityScore(indexDb, entryId, pos, neg);
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
// best-effort — feedback recording succeeds even if utility update fails
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
return utilityResult;
|
|
148
|
+
}
|
|
110
149
|
// ── Command definition ────────────────────────────────────────────────────────
|
|
111
150
|
export const feedbackCommand = defineJsonCommand({
|
|
112
151
|
meta: {
|
|
@@ -123,7 +162,7 @@ export const feedbackCommand = defineJsonCommand({
|
|
|
123
162
|
// Optional in citty so run() is invoked even when omitted; we re-validate
|
|
124
163
|
// and throw a structured UsageError below so exit code is 2 (USAGE) rather
|
|
125
164
|
// than citty's default 0 (help banner).
|
|
126
|
-
ref: { type: "positional", description: "Asset ref (
|
|
165
|
+
ref: { type: "positional", description: "Asset ref ([bundle//]conceptId, e.g. lessons/deploy)", required: false },
|
|
127
166
|
positive: { type: "boolean", description: "Record positive feedback (boosts ranking immediately)", default: false },
|
|
128
167
|
negative: {
|
|
129
168
|
type: "boolean",
|
|
@@ -147,7 +186,7 @@ export const feedbackCommand = defineJsonCommand({
|
|
|
147
186
|
},
|
|
148
187
|
"applied-to": {
|
|
149
188
|
type: "string",
|
|
150
|
-
description: "Credit a lesson that helped resolve this task. Accepts a `
|
|
189
|
+
description: "Credit a lesson that helped resolve this task. Accepts a `lessons/<name>` ref. " +
|
|
151
190
|
"When combined with --positive, appends this feedback ref to the target lesson's " +
|
|
152
191
|
"`lessonStrength[]` frontmatter array (dedup, idempotent). Ignored on non-lesson targets.",
|
|
153
192
|
},
|
|
@@ -155,9 +194,9 @@ export const feedbackCommand = defineJsonCommand({
|
|
|
155
194
|
async run({ args }) {
|
|
156
195
|
const ref = (args.ref ?? "").trim();
|
|
157
196
|
if (!ref) {
|
|
158
|
-
throw new UsageError("Asset ref is required. Usage: akm feedback <ref> --positive|--negative", "MISSING_REQUIRED_ARGUMENT", "Pass a ref like `
|
|
197
|
+
throw new UsageError("Asset ref is required. Usage: akm feedback <ref> --positive|--negative", "MISSING_REQUIRED_ARGUMENT", "Pass a ref like `skills/deploy` and either --positive or --negative.");
|
|
159
198
|
}
|
|
160
|
-
const parsedRef =
|
|
199
|
+
const parsedRef = parseRefInput(ref);
|
|
161
200
|
if (args.positive && args.negative) {
|
|
162
201
|
throw new UsageError("Specify either --positive or --negative, not both.");
|
|
163
202
|
}
|
|
@@ -241,29 +280,16 @@ export const feedbackCommand = defineJsonCommand({
|
|
|
241
280
|
// in search results until after reindexing.
|
|
242
281
|
const indexedEntry = getEntryById(db, entryId);
|
|
243
282
|
const source = sources.find((candidate) => candidate.path === indexedEntry?.stashDir);
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
});
|
|
255
|
-
// Apply feedback-derived utility score adjustment immediately so that
|
|
256
|
-
// positive/negative signals influence search ranking without requiring
|
|
257
|
-
// a full reindex. We query the total accumulated feedback counts from
|
|
258
|
-
// usage_events so the delta reflects the entire signal history.
|
|
259
|
-
// Uses MemRL bounded-step EMA (F-5 / #386, arXiv:2601.03192).
|
|
260
|
-
try {
|
|
261
|
-
const { pos, neg } = countFeedbackSignals(db, entryId);
|
|
262
|
-
utilityResult = applyFeedbackToUtilityScore(db, entryId, pos, neg);
|
|
263
|
-
}
|
|
264
|
-
catch {
|
|
265
|
-
// best-effort — feedback recording succeeds even if utility update fails
|
|
266
|
-
}
|
|
283
|
+
const durableOrigin = parsedRef.origin ?? source?.registryId ?? "stash";
|
|
284
|
+
// WI-8.5b: the `feedback` / `improve_review_needed` events key on the
|
|
285
|
+
// resolved entry's fully-qualified item_ref — the SAME durable key the
|
|
286
|
+
// usage_events row carries and the SAME spelling the signal-delta
|
|
287
|
+
// correlation reads (buildLatestFeedbackTsMap, collapsed to [item_ref]).
|
|
288
|
+
// The D-R5 display spelling is the fallback only for a NULL-provenance
|
|
289
|
+
// (pre-cutover) row that the one-time re-key has not yet finalized.
|
|
290
|
+
const itemRef = getItemRefById(db, entryId) ?? undefined;
|
|
291
|
+
durableRef = itemRef ?? displayRef({ type: parsedRef.type, name: parsedRef.name, bundleId: durableOrigin });
|
|
292
|
+
utilityResult = recordFeedbackUsage(db, entryId, itemRef, signal, metadataStr);
|
|
267
293
|
}
|
|
268
294
|
finally {
|
|
269
295
|
closeDatabase(db);
|
|
@@ -299,7 +325,7 @@ export const feedbackCommand = defineJsonCommand({
|
|
|
299
325
|
}
|
|
300
326
|
}
|
|
301
327
|
// Phase 7A / Advantage D4b: --applied-to credits a lesson. When the
|
|
302
|
-
// target is a `
|
|
328
|
+
// target is a `lessons/<name>` ref and the signal is positive, append
|
|
303
329
|
// the feedback ref to the target lesson's `lessonStrength[]`
|
|
304
330
|
// frontmatter array (dedup, idempotent). Non-lesson targets are
|
|
305
331
|
// ignored. Failures here are warnings — feedback recording is the
|
|
@@ -308,7 +334,7 @@ export const feedbackCommand = defineJsonCommand({
|
|
|
308
334
|
let appliedToResult = null;
|
|
309
335
|
if (appliedToRaw && signal === "positive") {
|
|
310
336
|
try {
|
|
311
|
-
const parsedApplied =
|
|
337
|
+
const parsedApplied = parseRefInput(appliedToRaw);
|
|
312
338
|
if (parsedApplied.type === "lesson") {
|
|
313
339
|
const updated = appendLessonStrength(parsedApplied.type, parsedApplied.name, ref);
|
|
314
340
|
if (updated) {
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
import {
|
|
6
|
+
import { displayRef, parseQualifiedRefInput } from "../../core/asset/resolve-ref.js";
|
|
7
7
|
import { loadConfig } from "../../core/config/config.js";
|
|
8
8
|
import { NotFoundError, UsageError } from "../../core/errors.js";
|
|
9
9
|
import { getDbPath } from "../../core/paths.js";
|
|
10
10
|
import { warn } from "../../core/warn.js";
|
|
11
|
-
import { closeDatabase, findEntryIdByRef, getEntryById, getEntryRefRowsForStashRoot, openExistingDatabase, openIndexDatabase, } from "../../indexer/db/db.js";
|
|
12
11
|
import { loadStoredGraphSnapshot } from "../../indexer/db/graph-db.js";
|
|
13
12
|
import { listRelatedPathsForFile } from "../../indexer/graph/graph-boost.js";
|
|
14
13
|
import { runGraphExtractionPass } from "../../indexer/graph/graph-extraction.js";
|
|
@@ -16,6 +15,8 @@ import { withIndexWriterLease } from "../../indexer/index-writer-lock.js";
|
|
|
16
15
|
import { lookup } from "../../indexer/indexer.js";
|
|
17
16
|
import { findSourceForPath, resolveSourceEntries } from "../../indexer/search/search-source.js";
|
|
18
17
|
import { resolveAssetPath } from "../../indexer/walk/path-resolver.js";
|
|
18
|
+
import { closeDatabase, openExistingDatabase, openIndexDatabase } from "../../storage/repositories/index-connection.js";
|
|
19
|
+
import { findEntryIdByRef, getEntryById, getEntryRefRowsForStashRoot, } from "../../storage/repositories/index-entries-repository.js";
|
|
19
20
|
function resolveGraphStashPath(source) {
|
|
20
21
|
const sources = resolveSourceEntries(undefined, loadConfig());
|
|
21
22
|
if (sources.length === 0) {
|
|
@@ -252,7 +253,8 @@ function buildRefByPath(stashRoot, db) {
|
|
|
252
253
|
try {
|
|
253
254
|
const entry = JSON.parse(row.entry_json);
|
|
254
255
|
if (typeof entry.type === "string" && typeof entry.name === "string") {
|
|
255
|
-
|
|
256
|
+
// F4b output-spelling flip: emit the 0.9.0 conceptId grammar.
|
|
257
|
+
map.set(row.file_path, { ref: displayRef({ type: entry.type, name: entry.name }), type: entry.type });
|
|
256
258
|
}
|
|
257
259
|
}
|
|
258
260
|
catch {
|
|
@@ -460,7 +462,7 @@ export async function akmGraphUpdate(options) {
|
|
|
460
462
|
});
|
|
461
463
|
}
|
|
462
464
|
async function resolveGraphTarget(ref, source) {
|
|
463
|
-
const parsedRef =
|
|
465
|
+
const parsedRef = parseQualifiedRefInput(ref);
|
|
464
466
|
const filePath = (await resolveAssetPath(parsedRef, {
|
|
465
467
|
mode: "index-first",
|
|
466
468
|
honorOrigin: true,
|
|
@@ -77,7 +77,7 @@ export function collectImproveAdvisories(db, stateDbPath, since, improveSummary)
|
|
|
77
77
|
confidence: "high",
|
|
78
78
|
message: `Enrichment lanes minted ${minting.minted} NEW asset(s) vs ${minting.updated} update(s) ` +
|
|
79
79
|
`(${Math.round(minting.share * 100)}% minted, threshold ${Math.round(ENRICHMENT_MINTED_WARN_SHARE * 100)}%). ` +
|
|
80
|
-
"Enrichment-classed lanes (proactive/high-salience/
|
|
80
|
+
"Enrichment-classed lanes (proactive/high-salience/signal-delta) are ratified to edit " +
|
|
81
81
|
"existing assets only — new-asset generation belongs to the signal-gated minting lanes.",
|
|
82
82
|
});
|
|
83
83
|
}
|
|
@@ -98,7 +98,7 @@ export function collectImproveAdvisories(db, stateDbPath, since, improveSummary)
|
|
|
98
98
|
// R5 collapse/churn detector: surface any collapse_detector_alert events
|
|
99
99
|
// in the health window, plus the latest cycle row's headline numbers so
|
|
100
100
|
// the operator can act without opening the DB. `unknown` when the detector
|
|
101
|
-
// has never produced a cycle row (no consolidate
|
|
101
|
+
// has never produced a cycle row (no consolidate work yet).
|
|
102
102
|
try {
|
|
103
103
|
// Reuse the already-open state.db handle (readEvents supports a
|
|
104
104
|
// borrowed connection) — no extra open/migrate/close per health call.
|
|
@@ -120,7 +120,7 @@ export function collectImproveAdvisories(db, stateDbPath, since, improveSummary)
|
|
|
120
120
|
// volume thresholds are still being tuned (design doc §7).
|
|
121
121
|
confidence: collapseKinds.length > 0 ? "high" : "medium",
|
|
122
122
|
message: `R5 detector fired ${collapseAlertEvents.length} alert(s) in window (kinds: ${kinds.join(", ")}). ` +
|
|
123
|
-
`${cycleSummary} See docs/
|
|
123
|
+
`${cycleSummary} See docs/architecture/specs/improve-collapse-churn-detector-design.md §6.3 runbook queries.`,
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
else if (latestCycle) {
|
|
@@ -139,7 +139,7 @@ export function collectImproveAdvisories(db, stateDbPath, since, improveSummary)
|
|
|
139
139
|
kind: "deterministic",
|
|
140
140
|
confidence: "high",
|
|
141
141
|
message: "No detector cycle rows yet — the collapse/churn detector runs only on improve cycles " +
|
|
142
|
-
"where consolidate
|
|
142
|
+
"where consolidate did work.",
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
145
|
}
|