kibi-cli 0.19.0 → 1.0.1
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/dist/cli-operation-loader.d.ts.map +1 -1
- package/dist/cli-operation-loader.js +53 -20
- package/dist/cli-operation-metadata.d.ts +20 -8
- package/dist/cli-operation-metadata.d.ts.map +1 -1
- package/dist/cli-operation-metadata.js +23 -8
- package/dist/cli-protocol.d.ts.map +1 -1
- package/dist/cli-protocol.js +38 -8
- package/dist/cli-register-foundation.d.ts.map +1 -1
- package/dist/cli-register-foundation.js +14 -2
- package/dist/cli-register-maintenance.d.ts.map +1 -1
- package/dist/cli-register-maintenance.js +26 -4
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +10 -0
- package/dist/cli-register-verification.d.ts +3 -0
- package/dist/cli-register-verification.d.ts.map +1 -0
- package/dist/cli-register-verification.js +16 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/commands/aggregated-checks.d.ts +1 -2
- package/dist/commands/aggregated-checks.d.ts.map +1 -1
- package/dist/commands/aggregated-checks.js +14 -9
- package/dist/commands/branch.d.ts +36 -0
- package/dist/commands/branch.d.ts.map +1 -1
- package/dist/commands/branch.js +371 -40
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +20 -67
- package/dist/commands/discovery-shared.d.ts.map +1 -1
- package/dist/commands/discovery-shared.js +10 -19
- package/dist/commands/doctor.d.ts +4 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +259 -24
- package/dist/commands/engine.d.ts.map +1 -1
- package/dist/commands/engine.js +10 -7
- package/dist/commands/gc.d.ts +5 -2
- package/dist/commands/gc.d.ts.map +1 -1
- package/dist/commands/gc.js +140 -71
- package/dist/commands/github-init.d.ts +56 -0
- package/dist/commands/github-init.d.ts.map +1 -0
- package/dist/commands/github-init.js +310 -0
- package/dist/commands/init-helpers.d.ts +1 -1
- package/dist/commands/init-helpers.d.ts.map +1 -1
- package/dist/commands/init-helpers.js +73 -25
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +79 -24
- package/dist/commands/legacy-storage-migration.d.ts +54 -0
- package/dist/commands/legacy-storage-migration.d.ts.map +1 -0
- package/dist/commands/legacy-storage-migration.js +277 -0
- package/dist/commands/migrate.d.ts +7 -0
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +244 -91
- package/dist/commands/report.d.ts +24 -0
- package/dist/commands/report.d.ts.map +1 -0
- package/dist/commands/report.js +191 -0
- package/dist/commands/sync/cache.d.ts +16 -3
- package/dist/commands/sync/cache.d.ts.map +1 -1
- package/dist/commands/sync/cache.js +111 -4
- package/dist/commands/sync/discovery.d.ts +23 -2
- package/dist/commands/sync/discovery.d.ts.map +1 -1
- package/dist/commands/sync/discovery.js +196 -15
- package/dist/commands/sync/extraction.d.ts +8 -1
- package/dist/commands/sync/extraction.d.ts.map +1 -1
- package/dist/commands/sync/extraction.js +38 -4
- package/dist/commands/sync/manifest.d.ts +8 -5
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +142 -39
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +3 -0
- package/dist/commands/sync.d.ts +6 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +304 -79
- package/dist/commands/verify.d.ts +10 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +126 -0
- package/dist/diagnostics.d.ts +1 -1
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/engine.d.ts +96 -3
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +392 -23
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +5 -6
- package/dist/extractors/manifest.d.ts +8 -1
- package/dist/extractors/manifest.d.ts.map +1 -1
- package/dist/extractors/manifest.js +51 -9
- package/dist/extractors/markdown.d.ts +2 -1
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +21 -3
- package/dist/extractors/playwright-cases.d.ts +24 -0
- package/dist/extractors/playwright-cases.d.ts.map +1 -0
- package/dist/extractors/playwright-cases.js +126 -0
- package/dist/extractors/relationships.d.ts.map +1 -1
- package/dist/extractors/relationships.js +1 -0
- package/dist/extractors/symbol-coordinates.d.ts +81 -3
- package/dist/extractors/symbol-coordinates.d.ts.map +1 -1
- package/dist/extractors/symbol-coordinates.js +389 -51
- package/dist/extractors/symbols-coordinator.js +11 -1
- package/dist/intent-search.d.ts +60 -0
- package/dist/intent-search.d.ts.map +1 -0
- package/dist/intent-search.js +433 -0
- package/dist/operations/bootstrap/activation.d.ts.map +1 -0
- package/dist/operations/{autopilot → bootstrap}/activation.js +48 -31
- package/dist/operations/{autopilot → bootstrap}/candidate-helpers.d.ts.map +1 -1
- package/dist/operations/bootstrap/candidates.d.ts +4 -0
- package/dist/operations/{autopilot → bootstrap}/candidates.d.ts.map +1 -1
- package/dist/operations/{autopilot → bootstrap}/candidates.js +22 -8
- package/dist/operations/{autopilot → bootstrap}/discovery-evidence.d.ts +2 -2
- package/dist/operations/{autopilot → bootstrap}/discovery-evidence.d.ts.map +1 -1
- package/dist/operations/{autopilot → bootstrap}/discovery-evidence.js +46 -6
- package/dist/operations/{autopilot → bootstrap}/discovery.d.ts +1 -1
- package/dist/operations/bootstrap/discovery.d.ts.map +1 -0
- package/dist/operations/{autopilot → bootstrap}/discovery.js +21 -14
- package/dist/operations/bootstrap/generate.d.ts +8 -0
- package/dist/operations/bootstrap/generate.d.ts.map +1 -0
- package/dist/operations/bootstrap/generate.js +204 -0
- package/dist/operations/{autopilot → bootstrap}/guidance-actions.d.ts +2 -2
- package/dist/operations/{autopilot → bootstrap}/guidance-actions.d.ts.map +1 -1
- package/dist/operations/{autopilot → bootstrap}/guidance-actions.js +4 -4
- package/dist/operations/{autopilot → bootstrap}/guidance.d.ts +2 -2
- package/dist/operations/{autopilot → bootstrap}/guidance.d.ts.map +1 -1
- package/dist/operations/{autopilot → bootstrap}/guidance.js +2 -0
- package/dist/operations/{autopilot → bootstrap}/markdown-candidates.d.ts +2 -2
- package/dist/operations/{autopilot → bootstrap}/markdown-candidates.d.ts.map +1 -1
- package/dist/operations/{autopilot → bootstrap}/markdown-candidates.js +4 -3
- package/dist/operations/bootstrap/presentation.d.ts +15 -0
- package/dist/operations/bootstrap/presentation.d.ts.map +1 -0
- package/dist/operations/bootstrap/presentation.js +177 -0
- package/dist/operations/{autopilot → bootstrap}/requirement-claims.d.ts.map +1 -1
- package/dist/operations/{autopilot → bootstrap}/types.d.ts +63 -21
- package/dist/operations/bootstrap/types.d.ts.map +1 -0
- package/dist/operations/bootstrap/types.js +25 -0
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +4 -17
- package/dist/operations/modeling/predicate-applicability.d.ts +16 -0
- package/dist/operations/modeling/predicate-applicability.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-applicability.js +276 -0
- package/dist/operations/modeling/predicate-applyplan.d.ts +13 -2
- package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applyplan.js +100 -3
- package/dist/operations/modeling/predicate-bindings.d.ts +6 -0
- package/dist/operations/modeling/predicate-bindings.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-bindings.js +122 -0
- package/dist/operations/modeling/predicate-catalog-4.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog-4.js +155 -0
- package/dist/operations/modeling/predicate-inference-1.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-inference-1.js +8 -0
- package/dist/operations/modeling/predicate-inference-launcher.d.ts +10 -0
- package/dist/operations/modeling/predicate-inference-launcher.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-inference-launcher.js +13 -0
- package/dist/operations/modeling/predicate-inference.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-inference.js +4 -0
- package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-loader.js +7 -0
- package/dist/operations/modeling/predicate-ranker.d.ts +8 -1
- package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-ranker.js +156 -24
- package/dist/operations/modeling/predicate-score-3.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-score-3.js +6 -0
- package/dist/operations/modeling/predicate-types.d.ts +34 -0
- package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-usage-hints-3.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-usage-hints-3.js +40 -0
- package/dist/operations/modeling/predicate-utils.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-utils.js +2 -0
- package/dist/operations/modeling/suggest-predicates.d.ts +1 -1
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.js +170 -32
- package/dist/operations/mutation/delete.d.ts.map +1 -1
- package/dist/operations/mutation/delete.js +415 -19
- package/dist/operations/mutation/entity-projection.d.ts +11 -0
- package/dist/operations/mutation/entity-projection.d.ts.map +1 -0
- package/dist/operations/mutation/entity-projection.js +14 -0
- package/dist/operations/mutation/relationships.d.ts +10 -0
- package/dist/operations/mutation/relationships.d.ts.map +1 -1
- package/dist/operations/mutation/relationships.js +71 -1
- package/dist/operations/mutation/serialization.d.ts.map +1 -1
- package/dist/operations/mutation/serialization.js +1 -0
- package/dist/operations/mutation/source-authoring.d.ts +61 -0
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -0
- package/dist/operations/mutation/source-authoring.js +543 -0
- package/dist/operations/mutation/symbol-compiler-lock.d.ts +51 -0
- package/dist/operations/mutation/symbol-compiler-lock.d.ts.map +1 -0
- package/dist/operations/mutation/symbol-compiler-lock.js +274 -0
- package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-granularity.js +34 -3
- package/dist/operations/mutation/symbol-refresh.d.ts +18 -1
- package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-refresh.js +225 -63
- package/dist/operations/mutation/types.d.ts +57 -1
- package/dist/operations/mutation/types.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +363 -24
- package/dist/operations/mutation/validation.d.ts.map +1 -1
- package/dist/operations/mutation/validation.js +1 -0
- package/dist/operations/planning/apply-plan.d.ts +117 -0
- package/dist/operations/planning/apply-plan.d.ts.map +1 -0
- package/dist/operations/planning/apply-plan.js +1437 -0
- package/dist/operations/planning/compile-intent.d.ts +106 -0
- package/dist/operations/planning/compile-intent.d.ts.map +1 -0
- package/dist/operations/planning/compile-intent.js +562 -0
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +6 -2
- package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/clauses.js +15 -2
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/ingestion-boundary.js +7 -3
- package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts +51 -0
- package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/predicate-rules-launcher.js +96 -0
- package/dist/operations/semantic-advisor/types.d.ts +13 -5
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
- package/dist/operations/verification/ingest-verification.d.ts +29 -0
- package/dist/operations/verification/ingest-verification.d.ts.map +1 -0
- package/dist/operations/verification/ingest-verification.js +192 -0
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +2 -1
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +27 -8
- package/dist/public/branch-resolver.d.ts +1 -0
- package/dist/public/branch-resolver.d.ts.map +1 -1
- package/dist/public/branch-resolver.js +1 -0
- package/dist/public/check-types.d.ts +2 -2
- package/dist/public/check-types.d.ts.map +1 -1
- package/dist/public/check-types.js +16 -16
- package/dist/public/diagnostic-usage.d.ts.map +1 -1
- package/dist/public/diagnostic-usage.js +69 -1
- package/dist/public/distribution-parity.d.ts +1 -1
- package/dist/public/distribution-parity.d.ts.map +1 -1
- package/dist/public/distribution-parity.js +1 -0
- package/dist/public/ignore-policy.d.ts.map +1 -1
- package/dist/public/ignore-policy.js +16 -4
- package/dist/public/impact/coverage-depth-quality.d.ts +6 -1
- package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
- package/dist/public/impact/coverage-depth-quality.js +21 -3
- package/dist/public/impact/full-kb-quality.d.ts +4 -2
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +61 -1
- package/dist/public/impact/manifest.d.ts.map +1 -1
- package/dist/public/impact/manifest.js +2 -5
- package/dist/public/operational-artifacts.d.ts.map +1 -1
- package/dist/public/operational-artifacts.js +7 -1
- package/dist/public/operations/catalog.d.ts +682 -67
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/catalog.js +126 -4
- package/dist/public/operations/check-executor.d.ts +2 -2
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +72 -13
- package/dist/public/operations/check-format-shared.d.ts +3 -0
- package/dist/public/operations/check-format-shared.d.ts.map +1 -1
- package/dist/public/operations/check-format-shared.js +3 -0
- package/dist/public/operations/check-helpers.d.ts +27 -2
- package/dist/public/operations/check-helpers.d.ts.map +1 -1
- package/dist/public/operations/check-helpers.js +62 -26
- package/dist/public/operations/contracts.d.ts +11 -0
- package/dist/public/operations/contracts.d.ts.map +1 -0
- package/dist/public/operations/contracts.js +325 -0
- package/dist/public/operations/discovery-executors.d.ts +37 -1
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +206 -6
- package/dist/public/operations/index.d.ts +9 -4
- package/dist/public/operations/index.d.ts.map +1 -1
- package/dist/public/operations/index.js +8 -3
- package/dist/public/operations/migration-plan.d.ts +101 -0
- package/dist/public/operations/migration-plan.d.ts.map +1 -0
- package/dist/public/operations/migration-plan.js +537 -0
- package/dist/public/operations/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +68 -8
- package/dist/public/operations/prolog-json.d.ts +14 -0
- package/dist/public/operations/prolog-json.d.ts.map +1 -1
- package/dist/public/operations/prolog-json.js +44 -5
- package/dist/public/operations/repair-plan.d.ts.map +1 -1
- package/dist/public/operations/repair-plan.js +1 -0
- package/dist/public/operations/result-envelope.d.ts +13 -0
- package/dist/public/operations/result-envelope.d.ts.map +1 -0
- package/dist/public/operations/result-envelope.js +104 -0
- package/dist/public/operations/runtime-types.d.ts +97 -7
- package/dist/public/operations/runtime-types.d.ts.map +1 -1
- package/dist/public/operations/source-relationship-parity.d.ts +13 -0
- package/dist/public/operations/source-relationship-parity.d.ts.map +1 -0
- package/dist/public/operations/source-relationship-parity.js +162 -0
- package/dist/public/operations/specs/{autopilot.d.ts → bootstrap.d.ts} +9 -9
- package/dist/public/operations/specs/bootstrap.d.ts.map +1 -0
- package/dist/public/operations/specs/{autopilot.js → bootstrap.js} +8 -7
- package/dist/public/operations/specs/check.d.ts +4 -4
- package/dist/public/operations/specs/check.d.ts.map +1 -1
- package/dist/public/operations/specs/check.js +4 -3
- package/dist/public/operations/specs/discovery.d.ts +87 -3
- package/dist/public/operations/specs/discovery.d.ts.map +1 -1
- package/dist/public/operations/specs/discovery.js +53 -3
- package/dist/public/operations/specs/modeling.d.ts +3 -3
- package/dist/public/operations/specs/modeling.js +3 -3
- package/dist/public/operations/specs/mutation-schemas.d.ts +190 -47
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +3 -1
- package/dist/public/operations/specs/mutation.d.ts +42 -2
- package/dist/public/operations/specs/mutation.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation.js +26 -2
- package/dist/public/operations/specs/planning.d.ts +270 -0
- package/dist/public/operations/specs/planning.d.ts.map +1 -0
- package/dist/public/operations/specs/planning.js +191 -0
- package/dist/public/operations/specs/reporting.d.ts +4 -1
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +46 -1
- package/dist/public/operations/specs/upsert.d.ts +204 -47
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/specs/upsert.js +9 -0
- package/dist/public/operations/specs/verification.d.ts +78 -0
- package/dist/public/operations/specs/verification.d.ts.map +1 -0
- package/dist/public/operations/specs/verification.js +62 -0
- package/dist/public/operations/symbol-repair-plan.d.ts +11 -0
- package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -0
- package/dist/public/operations/symbol-repair-plan.js +123 -0
- package/dist/public/operations/types.d.ts +52 -1
- package/dist/public/operations/types.d.ts.map +1 -1
- package/dist/public/playwright-case-id.d.ts +8 -0
- package/dist/public/playwright-case-id.d.ts.map +1 -0
- package/dist/public/playwright-case-id.js +25 -0
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +4 -2
- package/dist/public/skills/kibi-bootstrap/SKILL.md +58 -0
- package/dist/public/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
- package/dist/public/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
- package/dist/public/skills/kibi-bootstrap/resources/operation-access.md +5 -0
- package/dist/public/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
- package/dist/public/skills/kibi-freshness/SKILL.md +39 -9
- package/dist/public/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
- package/dist/public/skills/kibi-freshness/resources/operation-access.md +6 -0
- package/dist/public/skills/kibi-freshness/resources/source-authoring.md +7 -0
- package/dist/public/skills/kibi-traceability/SKILL.md +47 -47
- package/dist/public/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
- package/dist/public/skills/kibi-traceability/resources/operation-access.md +5 -0
- package/dist/public/skills/kibi-traceability/resources/source-authoring.md +6 -0
- package/dist/public/skills/kibi-traceability/resources/traceability.md +8 -0
- package/dist/public/skills/kibi-usage/SKILL.md +115 -239
- package/dist/public/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
- package/dist/public/skills/kibi-usage/resources/kb-improvement.md +38 -0
- package/dist/public/skills/kibi-usage/resources/operation-access.md +36 -38
- package/dist/public/skills/kibi-usage/resources/relationship-directions.md +3 -3
- package/dist/public/skills/kibi-usage/resources/source-authoring.md +31 -0
- package/dist/public/skills/kibi-usage/resources/workflows.md +56 -3
- package/dist/public/symbol-granularity.d.ts +1 -1
- package/dist/public/symbol-granularity.d.ts.map +1 -1
- package/dist/public/symbol-granularity.js +1 -0
- package/dist/public/telemetry-acceptance.d.ts +7 -0
- package/dist/public/telemetry-acceptance.d.ts.map +1 -1
- package/dist/public/telemetry-acceptance.js +8 -1
- package/dist/public/telemetry-remediation.js +1 -1
- package/dist/public/verification-receipt.d.ts +206 -39
- package/dist/public/verification-receipt.d.ts.map +1 -1
- package/dist/public/verification-receipt.js +171 -4
- package/dist/relationships/shards.d.ts +16 -0
- package/dist/relationships/shards.d.ts.map +1 -1
- package/dist/relationships/shards.js +87 -2
- package/dist/report/brand.d.ts +19 -0
- package/dist/report/brand.d.ts.map +1 -0
- package/dist/report/brand.js +112 -0
- package/dist/report/html-report.d.ts +19 -0
- package/dist/report/html-report.d.ts.map +1 -0
- package/dist/report/html-report.js +963 -0
- package/dist/report/relative-time.d.ts +4 -0
- package/dist/report/relative-time.d.ts.map +1 -0
- package/dist/report/relative-time.js +46 -0
- package/dist/report/report-view.d.ts +17 -0
- package/dist/report/report-view.d.ts.map +1 -0
- package/dist/report/report-view.js +33 -0
- package/dist/report/repository.d.ts +35 -0
- package/dist/report/repository.d.ts.map +1 -0
- package/dist/report/repository.js +151 -0
- package/dist/runtime/cli-runtime.d.ts.map +1 -1
- package/dist/runtime/cli-runtime.js +82 -22
- package/dist/schemas/entity.schema.json +1148 -273
- package/dist/traceability/evidence-model.d.ts +2 -2
- package/dist/traceability/evidence-model.d.ts.map +1 -1
- package/dist/traceability/evidence-model.js +2 -2
- package/dist/traceability/git-staged.d.ts.map +1 -1
- package/dist/traceability/git-staged.js +15 -40
- package/dist/traceability/markdown-validate.d.ts.map +1 -1
- package/dist/traceability/markdown-validate.js +12 -7
- package/dist/traceability/staged-impact-contract.d.ts +3 -3
- package/dist/traceability/staged-impact-contract.d.ts.map +1 -1
- package/dist/traceability/staged-impact-contract.js +10 -38
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +8 -3
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +3 -0
- package/dist/types/entities.d.ts +3 -0
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/utils/branch-resolver.d.ts +24 -10
- package/dist/utils/branch-resolver.d.ts.map +1 -1
- package/dist/utils/branch-resolver.js +121 -38
- package/dist/utils/branch-store-locator.d.ts +23 -0
- package/dist/utils/branch-store-locator.d.ts.map +1 -0
- package/dist/utils/branch-store-locator.js +90 -0
- package/dist/utils/branch-store.d.ts +15 -0
- package/dist/utils/branch-store.d.ts.map +1 -0
- package/dist/utils/branch-store.js +130 -0
- package/dist/utils/config.d.ts +39 -37
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +107 -119
- package/dist/utils/kb-manifest.d.ts +35 -0
- package/dist/utils/kb-manifest.d.ts.map +1 -0
- package/dist/utils/kb-manifest.js +154 -0
- package/dist/utils/kb-paths.d.ts +54 -0
- package/dist/utils/kb-paths.d.ts.map +1 -0
- package/dist/utils/kb-paths.js +125 -0
- package/dist/utils/manifest-paths.d.ts +4 -4
- package/dist/utils/manifest-paths.d.ts.map +1 -1
- package/dist/utils/manifest-paths.js +8 -56
- package/dist/utils/rule-registry.d.ts +48 -20
- package/dist/utils/rule-registry.d.ts.map +1 -1
- package/dist/utils/rule-registry.js +82 -77
- package/dist/utils/schema-version.d.ts +5 -5
- package/dist/utils/schema-version.d.ts.map +1 -1
- package/dist/utils/schema-version.js +26 -6
- package/dist/utils/strict-modeling.d.ts +0 -4
- package/dist/utils/strict-modeling.d.ts.map +1 -1
- package/dist/utils/strict-modeling.js +7 -8
- package/dist/verification/playwright-reporter.d.ts +21 -0
- package/dist/verification/playwright-reporter.d.ts.map +1 -0
- package/dist/verification/playwright-reporter.js +114 -0
- package/package.json +46 -7
- package/schema/config.json +2 -2
- package/schema/manifest.json +26 -0
- package/src/public/branch-resolver.ts +1 -0
- package/src/public/check-types.ts +22 -19
- package/src/public/diagnostic-usage.ts +79 -1
- package/src/public/distribution-parity.ts +1 -0
- package/src/public/ignore-policy.ts +16 -10
- package/src/public/impact/coverage-depth-quality.ts +36 -0
- package/src/public/impact/full-kb-quality.ts +118 -5
- package/src/public/impact/manifest.ts +2 -4
- package/src/public/operational-artifacts.ts +9 -1
- package/src/public/operations/catalog.ts +146 -9
- package/src/public/operations/check-executor.ts +102 -15
- package/src/public/operations/check-format-shared.ts +6 -0
- package/src/public/operations/check-helpers.ts +74 -35
- package/src/public/operations/contracts.ts +366 -0
- package/src/public/operations/discovery-executors.ts +299 -12
- package/src/public/operations/index.ts +9 -4
- package/src/public/operations/migration-plan.ts +740 -0
- package/src/public/operations/node-ports.ts +84 -10
- package/src/public/operations/prolog-json.ts +60 -5
- package/src/public/operations/repair-plan.ts +1 -0
- package/src/public/operations/result-envelope.ts +136 -0
- package/src/public/operations/runtime-types.ts +91 -5
- package/src/public/operations/source-relationship-parity.ts +226 -0
- package/src/public/operations/specs/{autopilot.ts → bootstrap.ts} +17 -16
- package/src/public/operations/specs/check.ts +4 -3
- package/src/public/operations/specs/discovery.ts +57 -3
- package/src/public/operations/specs/modeling.ts +3 -3
- package/src/public/operations/specs/mutation-schemas.ts +6 -1
- package/src/public/operations/specs/mutation.ts +27 -2
- package/src/public/operations/specs/planning.ts +234 -0
- package/src/public/operations/specs/reporting.ts +55 -1
- package/src/public/operations/specs/upsert.ts +10 -0
- package/src/public/operations/specs/verification.ts +78 -0
- package/src/public/operations/symbol-repair-plan.ts +164 -0
- package/src/public/operations/types.ts +62 -1
- package/src/public/playwright-case-id.ts +35 -0
- package/src/public/schemas/entity.ts +7 -2
- package/src/public/skills/kibi-bootstrap/SKILL.md +58 -0
- package/src/public/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
- package/src/public/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
- package/src/public/skills/kibi-bootstrap/resources/operation-access.md +5 -0
- package/src/public/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
- package/src/public/skills/kibi-freshness/SKILL.md +39 -9
- package/src/public/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
- package/src/public/skills/kibi-freshness/resources/operation-access.md +6 -0
- package/src/public/skills/kibi-freshness/resources/source-authoring.md +7 -0
- package/src/public/skills/kibi-traceability/SKILL.md +47 -47
- package/src/public/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
- package/src/public/skills/kibi-traceability/resources/operation-access.md +5 -0
- package/src/public/skills/kibi-traceability/resources/source-authoring.md +6 -0
- package/src/public/skills/kibi-traceability/resources/traceability.md +8 -0
- package/src/public/skills/kibi-usage/SKILL.md +115 -239
- package/src/public/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
- package/src/public/skills/kibi-usage/resources/kb-improvement.md +38 -0
- package/src/public/skills/kibi-usage/resources/operation-access.md +36 -38
- package/src/public/skills/kibi-usage/resources/relationship-directions.md +3 -3
- package/src/public/skills/kibi-usage/resources/source-authoring.md +31 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +56 -3
- package/src/public/symbol-granularity.ts +1 -0
- package/src/public/telemetry-acceptance.ts +16 -1
- package/src/public/telemetry-remediation.ts +1 -1
- package/src/public/verification-receipt.ts +248 -6
- package/src/schemas/entity.schema.json +1148 -273
- package/templates/github/kibi-badge.yml +86 -0
- package/templates/github/kibi-report.yml +84 -0
- package/dist/operations/autopilot/activation.d.ts.map +0 -1
- package/dist/operations/autopilot/candidates.d.ts +0 -4
- package/dist/operations/autopilot/discovery.d.ts.map +0 -1
- package/dist/operations/autopilot/generate.d.ts +0 -8
- package/dist/operations/autopilot/generate.d.ts.map +0 -1
- package/dist/operations/autopilot/generate.js +0 -112
- package/dist/operations/autopilot/presentation.d.ts +0 -13
- package/dist/operations/autopilot/presentation.d.ts.map +0 -1
- package/dist/operations/autopilot/presentation.js +0 -91
- package/dist/operations/autopilot/types.d.ts.map +0 -1
- package/dist/operations/autopilot/types.js +0 -8
- package/dist/public/operations/specs/autopilot.d.ts.map +0 -1
- package/dist/public/skills/init-kibi/SKILL.md +0 -62
- package/src/public/skills/init-kibi/SKILL.md +0 -62
- /package/dist/operations/{autopilot → bootstrap}/activation.d.ts +0 -0
- /package/dist/operations/{autopilot → bootstrap}/candidate-helpers.d.ts +0 -0
- /package/dist/operations/{autopilot → bootstrap}/candidate-helpers.js +0 -0
- /package/dist/operations/{autopilot → bootstrap}/requirement-claims.d.ts +0 -0
- /package/dist/operations/{autopilot → bootstrap}/requirement-claims.js +0 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
const anyValue = {};
|
|
2
|
+
const recordValue = {
|
|
3
|
+
type: "object",
|
|
4
|
+
additionalProperties: true,
|
|
5
|
+
};
|
|
6
|
+
const recordArray = {
|
|
7
|
+
type: "array",
|
|
8
|
+
items: recordValue,
|
|
9
|
+
};
|
|
10
|
+
const valueArray = {
|
|
11
|
+
type: "array",
|
|
12
|
+
items: anyValue,
|
|
13
|
+
};
|
|
14
|
+
function objectData(properties, required = []) {
|
|
15
|
+
return {
|
|
16
|
+
type: "object",
|
|
17
|
+
additionalProperties: false,
|
|
18
|
+
...(required.length > 0 ? { required } : {}),
|
|
19
|
+
properties,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const stringValue = { type: "string" };
|
|
23
|
+
const integerValue = { type: "integer" };
|
|
24
|
+
const numberValue = { type: "number" };
|
|
25
|
+
const booleanValue = { type: "boolean" };
|
|
26
|
+
const stringArray = {
|
|
27
|
+
type: "array",
|
|
28
|
+
items: stringValue,
|
|
29
|
+
};
|
|
30
|
+
/** Preserve JSON Schema's nullable scalar/object representation in every
|
|
31
|
+
* generated consumer contract. Using a `type` union keeps the catalog
|
|
32
|
+
* readable and lets the MCP bridge round-trip the same wire schema. */
|
|
33
|
+
function nullable(schema) {
|
|
34
|
+
const type = schema.type;
|
|
35
|
+
if (typeof type === "string") {
|
|
36
|
+
return { ...schema, type: [type, "null"] };
|
|
37
|
+
}
|
|
38
|
+
return { anyOf: [schema, { type: "null" }] };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The data contract is deliberately maintained separately from the operation
|
|
42
|
+
* implementations. Every catalog entry therefore has a concrete payload
|
|
43
|
+
* shape, while nested domain records can still evolve independently.
|
|
44
|
+
*/
|
|
45
|
+
export const OPERATION_DATA_SCHEMAS = {
|
|
46
|
+
kb_skills_list: objectData({ skills: valueArray }, ["skills"]),
|
|
47
|
+
kb_skills_load: objectData({
|
|
48
|
+
metadata: recordValue,
|
|
49
|
+
body: stringValue,
|
|
50
|
+
resources: valueArray,
|
|
51
|
+
contentHash: stringValue,
|
|
52
|
+
sourceType: stringValue,
|
|
53
|
+
}),
|
|
54
|
+
kb_skills_read: objectData({ content: stringValue }, ["content"]),
|
|
55
|
+
kb_query: objectData({ entities: recordArray, count: integerValue }, [
|
|
56
|
+
"entities",
|
|
57
|
+
"count",
|
|
58
|
+
]),
|
|
59
|
+
kb_search: objectData({ results: valueArray, count: integerValue, queryAnalysis: recordValue }, ["results", "count"]),
|
|
60
|
+
kb_status: objectData({
|
|
61
|
+
branch: stringValue,
|
|
62
|
+
snapshotId: stringValue,
|
|
63
|
+
syncedAt: { type: ["string", "null"] },
|
|
64
|
+
dirty: booleanValue,
|
|
65
|
+
syncState: stringValue,
|
|
66
|
+
kbPath: stringValue,
|
|
67
|
+
lastSyncSource: stringValue,
|
|
68
|
+
verificationSnapshot: stringValue,
|
|
69
|
+
verificationSnapshotAvailable: booleanValue,
|
|
70
|
+
verificationSnapshotDirty: booleanValue,
|
|
71
|
+
verificationSnapshotFileCount: integerValue,
|
|
72
|
+
verificationSnapshotVersion: stringValue,
|
|
73
|
+
verificationSnapshotError: stringValue,
|
|
74
|
+
staleReasons: recordArray,
|
|
75
|
+
staleReasonCount: integerValue,
|
|
76
|
+
staleReasonsTruncated: booleanValue,
|
|
77
|
+
branchAttachment: recordValue,
|
|
78
|
+
verificationSnapshotChanges: recordArray,
|
|
79
|
+
verificationSnapshotChangeCount: integerValue,
|
|
80
|
+
verificationSnapshotChangesTruncated: booleanValue,
|
|
81
|
+
branchStore: recordValue,
|
|
82
|
+
engineStatus: recordValue,
|
|
83
|
+
schemaStatus: recordValue,
|
|
84
|
+
migrationPlan: recordValue,
|
|
85
|
+
bootstrap: recordValue,
|
|
86
|
+
}),
|
|
87
|
+
kb_find_gaps: objectData({
|
|
88
|
+
rows: recordArray,
|
|
89
|
+
count: integerValue,
|
|
90
|
+
meta: recordValue,
|
|
91
|
+
}),
|
|
92
|
+
kb_coverage: objectData({
|
|
93
|
+
summary: recordValue,
|
|
94
|
+
rows: recordArray,
|
|
95
|
+
repairPlan: recordValue,
|
|
96
|
+
legacyMigrationPlan: recordValue,
|
|
97
|
+
symbolRepairPlan: recordValue,
|
|
98
|
+
migrationPlan: recordValue,
|
|
99
|
+
meta: recordValue,
|
|
100
|
+
}),
|
|
101
|
+
kb_graph: objectData({
|
|
102
|
+
nodes: recordArray,
|
|
103
|
+
edges: recordArray,
|
|
104
|
+
truncated: booleanValue,
|
|
105
|
+
meta: recordValue,
|
|
106
|
+
}),
|
|
107
|
+
kb_sparql_remote: objectData({ rows: valueArray }, ["rows"]),
|
|
108
|
+
kb_semantic_advisor: objectData({
|
|
109
|
+
receipt: recordValue,
|
|
110
|
+
warnings: stringArray,
|
|
111
|
+
}),
|
|
112
|
+
kb_model_requirement: objectData({
|
|
113
|
+
statement: stringValue,
|
|
114
|
+
claimKey: stringValue,
|
|
115
|
+
logicClaims: stringArray,
|
|
116
|
+
source: stringValue,
|
|
117
|
+
sourceFiles: stringArray,
|
|
118
|
+
claim: recordValue,
|
|
119
|
+
writeSet: recordValue,
|
|
120
|
+
applyPlan: recordArray,
|
|
121
|
+
isStrict: booleanValue,
|
|
122
|
+
confidence: numberValue,
|
|
123
|
+
extractionMode: stringValue,
|
|
124
|
+
extractionWarnings: stringArray,
|
|
125
|
+
warnings: recordArray,
|
|
126
|
+
migrationWarning: { type: ["string", "null"] },
|
|
127
|
+
logic: recordValue,
|
|
128
|
+
}),
|
|
129
|
+
kb_suggest_predicates: objectData({
|
|
130
|
+
text: stringValue,
|
|
131
|
+
claimKey: stringValue,
|
|
132
|
+
logicClaims: stringArray,
|
|
133
|
+
source: { type: ["string", "null"] },
|
|
134
|
+
requirementId: { type: ["string", "null"] },
|
|
135
|
+
subject: stringValue,
|
|
136
|
+
candidates: recordArray,
|
|
137
|
+
recommendedAction: {
|
|
138
|
+
type: "string",
|
|
139
|
+
enum: [
|
|
140
|
+
"apply_requires_predicate",
|
|
141
|
+
"provide_argument_bindings",
|
|
142
|
+
"resolve_schema_reference",
|
|
143
|
+
"record_ontology_gap",
|
|
144
|
+
],
|
|
145
|
+
},
|
|
146
|
+
recommendedPredicateSchema: { type: ["object", "null"] },
|
|
147
|
+
applyPlan: recordArray,
|
|
148
|
+
relationshipPlan: { type: ["object", "null"] },
|
|
149
|
+
warnings: stringArray,
|
|
150
|
+
}),
|
|
151
|
+
kb_plan_bootstrap: objectData({
|
|
152
|
+
plan: recordValue,
|
|
153
|
+
version: stringValue,
|
|
154
|
+
planHash: stringValue,
|
|
155
|
+
status: stringValue,
|
|
156
|
+
expected: recordValue,
|
|
157
|
+
activation: recordValue,
|
|
158
|
+
contextQuestions: stringArray,
|
|
159
|
+
activationState: stringValue,
|
|
160
|
+
activationMode: stringValue,
|
|
161
|
+
bootstrapMode: stringValue,
|
|
162
|
+
activationReason: stringValue,
|
|
163
|
+
applyBlocked: booleanValue,
|
|
164
|
+
migrationWarning: { type: ["string", "null"] },
|
|
165
|
+
handoffMessage: stringValue,
|
|
166
|
+
confidence: recordValue,
|
|
167
|
+
tldr: stringValue,
|
|
168
|
+
promptBlock: stringValue,
|
|
169
|
+
recommendedActions: recordArray,
|
|
170
|
+
declaredContext: recordValue,
|
|
171
|
+
discoverySummary: recordValue,
|
|
172
|
+
candidates: recordArray,
|
|
173
|
+
actions: recordArray,
|
|
174
|
+
sourceWrites: recordArray,
|
|
175
|
+
suppressedCandidates: recordArray,
|
|
176
|
+
payoffSummary: recordValue,
|
|
177
|
+
diagnostics: stringArray,
|
|
178
|
+
}, ["plan", "diagnostics"]),
|
|
179
|
+
kb_validate_upsert: objectData({
|
|
180
|
+
valid: booleanValue,
|
|
181
|
+
errors: valueArray,
|
|
182
|
+
warnings: valueArray,
|
|
183
|
+
semanticAdvisor: nullable(recordValue),
|
|
184
|
+
normalizedPreview: nullable(recordValue),
|
|
185
|
+
}),
|
|
186
|
+
kb_upsert: objectData({
|
|
187
|
+
created: integerValue,
|
|
188
|
+
updated: integerValue,
|
|
189
|
+
relationships_created: integerValue,
|
|
190
|
+
warnings: valueArray,
|
|
191
|
+
semanticAdvisor: recordValue,
|
|
192
|
+
status: stringValue,
|
|
193
|
+
effectFailures: recordArray,
|
|
194
|
+
nextActions: recordArray,
|
|
195
|
+
sourceWrites: recordArray,
|
|
196
|
+
contradictionCheck: recordValue,
|
|
197
|
+
}),
|
|
198
|
+
kb_delete: objectData({
|
|
199
|
+
deleted: integerValue,
|
|
200
|
+
relationships_deleted: integerValue,
|
|
201
|
+
skipped: integerValue,
|
|
202
|
+
errors: valueArray,
|
|
203
|
+
error_codes: valueArray,
|
|
204
|
+
relationship_results: recordArray,
|
|
205
|
+
sync_required: booleanValue,
|
|
206
|
+
sourceWrites: recordArray,
|
|
207
|
+
deletionPlan: recordValue,
|
|
208
|
+
supersessionPlan: recordValue,
|
|
209
|
+
status: stringValue,
|
|
210
|
+
effectFailures: recordArray,
|
|
211
|
+
nextActions: recordArray,
|
|
212
|
+
}),
|
|
213
|
+
kb_check: objectData({
|
|
214
|
+
violations: valueArray,
|
|
215
|
+
count: integerValue,
|
|
216
|
+
diagnostics: recordArray,
|
|
217
|
+
qualityDiagnostics: recordArray,
|
|
218
|
+
impactDiagnostics: recordArray,
|
|
219
|
+
sourceFiles: stringArray,
|
|
220
|
+
extractedSymbols: recordArray,
|
|
221
|
+
linkedEntities: recordArray,
|
|
222
|
+
nextActions: valueArray,
|
|
223
|
+
migrationPlan: recordValue,
|
|
224
|
+
}),
|
|
225
|
+
kb_compile_intent: objectData({
|
|
226
|
+
version: stringValue,
|
|
227
|
+
planHash: stringValue,
|
|
228
|
+
status: stringValue,
|
|
229
|
+
expected: recordValue,
|
|
230
|
+
target: recordValue,
|
|
231
|
+
discovery: recordValue,
|
|
232
|
+
propositions: valueArray,
|
|
233
|
+
contradictionAnalysis: recordValue,
|
|
234
|
+
proposals: valueArray,
|
|
235
|
+
steps: valueArray,
|
|
236
|
+
sourceWrites: recordArray,
|
|
237
|
+
diagnostics: stringArray,
|
|
238
|
+
}),
|
|
239
|
+
kb_apply_plan: objectData({
|
|
240
|
+
version: stringValue,
|
|
241
|
+
outcome: stringValue,
|
|
242
|
+
planHash: stringValue,
|
|
243
|
+
changedEntities: integerValue,
|
|
244
|
+
changedRelationships: integerValue,
|
|
245
|
+
changedPaths: stringArray,
|
|
246
|
+
finalSnapshots: recordValue,
|
|
247
|
+
validationSummary: recordValue,
|
|
248
|
+
recoveryJournalId: { type: ["string", "null"] },
|
|
249
|
+
deleted: integerValue,
|
|
250
|
+
sourcePaths: stringArray,
|
|
251
|
+
actionResults: recordArray,
|
|
252
|
+
notes: stringArray,
|
|
253
|
+
remainingPlan: recordValue,
|
|
254
|
+
closeout: recordValue,
|
|
255
|
+
status: stringValue,
|
|
256
|
+
effectFailures: recordArray,
|
|
257
|
+
nextActions: recordArray,
|
|
258
|
+
}),
|
|
259
|
+
kb_ingest_verification: objectData({
|
|
260
|
+
receipt: recordValue,
|
|
261
|
+
testId: stringValue,
|
|
262
|
+
proofOutcome: stringValue,
|
|
263
|
+
receiptCount: integerValue,
|
|
264
|
+
upsert: recordValue,
|
|
265
|
+
status: stringValue,
|
|
266
|
+
effectFailures: recordArray,
|
|
267
|
+
nextActions: recordArray,
|
|
268
|
+
}),
|
|
269
|
+
};
|
|
270
|
+
const EFFECT_OVERRIDES = {
|
|
271
|
+
kb_skills_list: {},
|
|
272
|
+
kb_skills_load: {},
|
|
273
|
+
kb_skills_read: {},
|
|
274
|
+
kb_query: {},
|
|
275
|
+
kb_search: {},
|
|
276
|
+
kb_status: {},
|
|
277
|
+
kb_find_gaps: {},
|
|
278
|
+
kb_coverage: {},
|
|
279
|
+
kb_graph: {},
|
|
280
|
+
kb_sparql_remote: { "network-read": { openWorld: true } },
|
|
281
|
+
kb_semantic_advisor: {},
|
|
282
|
+
kb_model_requirement: {},
|
|
283
|
+
kb_suggest_predicates: {},
|
|
284
|
+
kb_plan_bootstrap: {},
|
|
285
|
+
kb_validate_upsert: {},
|
|
286
|
+
kb_upsert: {
|
|
287
|
+
"kb-write": { destructive: true, retrySafety: "unsafe" },
|
|
288
|
+
"workspace-write": { destructive: true, retrySafety: "unsafe" },
|
|
289
|
+
},
|
|
290
|
+
kb_delete: {
|
|
291
|
+
"kb-write": { destructive: true, retrySafety: "unsafe" },
|
|
292
|
+
"workspace-write": { destructive: true, retrySafety: "unsafe" },
|
|
293
|
+
},
|
|
294
|
+
kb_check: {},
|
|
295
|
+
kb_compile_intent: {},
|
|
296
|
+
kb_apply_plan: {
|
|
297
|
+
"kb-write": { destructive: true, retrySafety: "unsafe" },
|
|
298
|
+
"workspace-write": { destructive: true, retrySafety: "unsafe" },
|
|
299
|
+
},
|
|
300
|
+
kb_ingest_verification: {
|
|
301
|
+
"kb-write": { destructive: true, retrySafety: "unsafe" },
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
export function declaredEffects(operation, effects) {
|
|
305
|
+
const overrides = EFFECT_OVERRIDES[operation];
|
|
306
|
+
if (!overrides)
|
|
307
|
+
throw new Error(`Missing effect contract for ${operation}`);
|
|
308
|
+
const expected = new Set(effects);
|
|
309
|
+
const declarations = effects.map((kind) => {
|
|
310
|
+
const override = overrides[kind] ?? {};
|
|
311
|
+
return {
|
|
312
|
+
kind,
|
|
313
|
+
mutability: kind === "kb-write" || kind === "workspace-write"
|
|
314
|
+
? "write"
|
|
315
|
+
: "read",
|
|
316
|
+
destructive: override.destructive === true,
|
|
317
|
+
retrySafety: override.retrySafety ?? (override.destructive ? "unsafe" : "safe"),
|
|
318
|
+
openWorld: override.openWorld === true,
|
|
319
|
+
};
|
|
320
|
+
});
|
|
321
|
+
if (new Set(declarations.map(({ kind }) => kind)).size !== expected.size) {
|
|
322
|
+
throw new Error(`Duplicate effect contract for ${operation}`);
|
|
323
|
+
}
|
|
324
|
+
return declarations;
|
|
325
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { type IntentSearchAnalysis, type IntentSearchFacets, type IntentSearchMatch, type SourceLocation } from "../../intent-search.js";
|
|
1
2
|
import type { SearchMatch } from "../../search-ranking.js";
|
|
3
|
+
import { type BranchStoreInspection } from "../../utils/branch-store.js";
|
|
4
|
+
import { type MigrationConfigStatus, type MigrationPlan } from "./migration-plan.js";
|
|
2
5
|
import type { OperationContext } from "./runtime-types.js";
|
|
3
6
|
import type { OperationResult } from "./types.js";
|
|
4
7
|
export type QueryInput = {
|
|
@@ -18,10 +21,15 @@ export type SearchInput = {
|
|
|
18
21
|
readonly type?: string;
|
|
19
22
|
readonly limit?: number;
|
|
20
23
|
readonly offset?: number;
|
|
24
|
+
readonly rankingMode?: "legacy" | "intent-v1";
|
|
25
|
+
readonly semanticFacets?: IntentSearchFacets;
|
|
26
|
+
readonly sourceLocations?: readonly SourceLocation[];
|
|
27
|
+
readonly minScore?: number;
|
|
21
28
|
};
|
|
22
29
|
export type SearchPayload = {
|
|
23
|
-
readonly results: readonly SearchMatch[];
|
|
30
|
+
readonly results: readonly (SearchMatch | IntentSearchMatch)[];
|
|
24
31
|
readonly count: number;
|
|
32
|
+
readonly queryAnalysis?: IntentSearchAnalysis;
|
|
25
33
|
};
|
|
26
34
|
export type StatusInput = Readonly<Record<string, never>>;
|
|
27
35
|
export type StatusPayload = {
|
|
@@ -38,6 +46,34 @@ export type StatusPayload = {
|
|
|
38
46
|
readonly verificationSnapshotFileCount?: number;
|
|
39
47
|
readonly verificationSnapshotVersion?: string;
|
|
40
48
|
readonly verificationSnapshotError?: string;
|
|
49
|
+
readonly staleReasons?: readonly Record<string, unknown>[];
|
|
50
|
+
readonly staleReasonCount?: number;
|
|
51
|
+
readonly staleReasonsTruncated?: boolean;
|
|
52
|
+
readonly branchAttachment?: {
|
|
53
|
+
readonly gitBranch: string;
|
|
54
|
+
readonly kbBranch: string;
|
|
55
|
+
readonly kind: "exact" | "explicit_override" | "legacy_compat";
|
|
56
|
+
readonly migrationRequired: boolean;
|
|
57
|
+
};
|
|
58
|
+
readonly verificationSnapshotChanges?: readonly Record<string, unknown>[];
|
|
59
|
+
readonly verificationSnapshotChangeCount?: number;
|
|
60
|
+
readonly verificationSnapshotChangesTruncated?: boolean;
|
|
61
|
+
readonly branchStore?: BranchStoreInspection;
|
|
62
|
+
readonly engineStatus?: {
|
|
63
|
+
readonly state: "healthy" | "unavailable";
|
|
64
|
+
readonly errorCode?: string;
|
|
65
|
+
readonly detail?: string;
|
|
66
|
+
readonly recoveryRequired: boolean;
|
|
67
|
+
};
|
|
68
|
+
readonly schemaStatus?: MigrationConfigStatus;
|
|
69
|
+
readonly migrationPlan?: MigrationPlan;
|
|
70
|
+
readonly bootstrap?: {
|
|
71
|
+
readonly activationState: string;
|
|
72
|
+
readonly activationMode: string;
|
|
73
|
+
readonly planEligible: boolean;
|
|
74
|
+
readonly reason: string;
|
|
75
|
+
readonly nextAction?: Readonly<Record<string, unknown>>;
|
|
76
|
+
};
|
|
41
77
|
};
|
|
42
78
|
export declare function executeQuery(input: QueryInput, context: OperationContext): Promise<OperationResult<QueryPayload>>;
|
|
43
79
|
export declare function executeSearch(input: SearchInput, context: OperationContext): Promise<OperationResult<SearchPayload>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-executors.d.ts","sourceRoot":"","sources":["../../../src/public/operations/discovery-executors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"discovery-executors.d.ts","sourceRoot":"","sources":["../../../src/public/operations/discovery-executors.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { EngineClient } from "../../engine.js";
|
|
2
|
+
import { executeIntentSearch, validateIntentSearchInput, } from "../../intent-search.js";
|
|
3
|
+
import { classifyActivation } from "../../operations/bootstrap/activation.js";
|
|
1
4
|
import { rankEntities } from "../../search-ranking.js";
|
|
5
|
+
import { resolveBranchAttachment } from "../../utils/branch-resolver.js";
|
|
6
|
+
import { branchStoreReason, inspectBranchStore, } from "../../utils/branch-store.js";
|
|
2
7
|
import { loadEntities, paginateResults, validateEntityType, } from "./discovery-entities.js";
|
|
3
|
-
import {
|
|
8
|
+
import { buildActionsFromStatus, readMigrationConfigStatus, } from "./migration-plan.js";
|
|
9
|
+
import { OperationJsonDecodeError, runOperationJsonQuery, } from "./prolog-json.js";
|
|
4
10
|
import { readWorkspaceSnapshot } from "./workspace-snapshot.js";
|
|
5
11
|
function requireProlog(context) {
|
|
6
12
|
if (!context.prolog) {
|
|
@@ -75,7 +81,7 @@ export async function executeQuery(input, context) {
|
|
|
75
81
|
}
|
|
76
82
|
export async function executeSearch(input, context) {
|
|
77
83
|
// implements REQ-kibi-operation-interface-parity, REQ-mcp-search-discovery
|
|
78
|
-
const { query, type, limit = 20, offset = 0 } = input;
|
|
84
|
+
const { query, type, limit = 20, offset = 0, rankingMode = "legacy", semanticFacets, sourceLocations, minScore, } = input;
|
|
79
85
|
const trimmedQuery = query.trim();
|
|
80
86
|
if (!trimmedQuery) {
|
|
81
87
|
throw new Error("Search execution failed: query must be a non-empty string");
|
|
@@ -83,6 +89,34 @@ export async function executeSearch(input, context) {
|
|
|
83
89
|
validateEntityType(type);
|
|
84
90
|
try {
|
|
85
91
|
const prolog = requireProlog(context);
|
|
92
|
+
const intentMode = rankingMode === "intent-v1" ||
|
|
93
|
+
semanticFacets !== undefined ||
|
|
94
|
+
sourceLocations !== undefined;
|
|
95
|
+
if (intentMode) {
|
|
96
|
+
const intentInput = {
|
|
97
|
+
query: trimmedQuery,
|
|
98
|
+
...(type !== undefined ? { type } : {}),
|
|
99
|
+
...(semanticFacets !== undefined ? { semanticFacets } : {}),
|
|
100
|
+
...(sourceLocations !== undefined ? { sourceLocations } : {}),
|
|
101
|
+
...(minScore !== undefined ? { minScore } : {}),
|
|
102
|
+
};
|
|
103
|
+
validateIntentSearchInput(intentInput);
|
|
104
|
+
const intentResult = await executeIntentSearch(intentInput, prolog, context.workspaceRoot);
|
|
105
|
+
const paginated = paginateResults(intentResult.matches, limit, offset);
|
|
106
|
+
const text = intentResult.matches.length === 0
|
|
107
|
+
? `No intent search results for '${trimmedQuery}' (abstained).`
|
|
108
|
+
: `Found ${intentResult.matches.length} intent search results for '${trimmedQuery}'. Showing ${paginated.length} (offset ${offset}, limit ${limit}): ${paginated
|
|
109
|
+
.map((match) => `${String(match.entity.id ?? "")} [${match.reasons.join(", ")}]`)
|
|
110
|
+
.join(", ")}`;
|
|
111
|
+
return {
|
|
112
|
+
content: [{ type: "text", text }],
|
|
113
|
+
structuredContent: {
|
|
114
|
+
results: paginated,
|
|
115
|
+
count: intentResult.matches.length,
|
|
116
|
+
queryAnalysis: intentResult.analysis,
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
86
120
|
const indexedCandidates = prolog.searchEntities
|
|
87
121
|
? await prolog.searchEntities({
|
|
88
122
|
query: trimmedQuery,
|
|
@@ -118,13 +152,106 @@ export async function executeSearch(input, context) {
|
|
|
118
152
|
export async function executeStatus(_input, context) {
|
|
119
153
|
// implements REQ-kibi-operation-interface-parity, REQ-cli-status-pre-first-sync
|
|
120
154
|
try {
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
155
|
+
const attachment = context.branchAttachment ??
|
|
156
|
+
resolveBranchAttachment(context.workspaceRoot);
|
|
157
|
+
if ("error" in attachment) {
|
|
158
|
+
throw new Error(`Failed to resolve active branch: ${attachment.error}`);
|
|
124
159
|
}
|
|
160
|
+
let payload;
|
|
161
|
+
const store = inspectBranchStore(context.workspaceRoot, attachment.kbBranch);
|
|
162
|
+
let engineStatus;
|
|
163
|
+
let ownedEngine;
|
|
164
|
+
if (store.state !== "healthy") {
|
|
165
|
+
// Status is deliberately safe before first sync and during recovery. Starting
|
|
166
|
+
// EngineClient would initialise (or attempt to repair) the store, which turns
|
|
167
|
+
// a diagnostic read into an accidental mutation.
|
|
168
|
+
payload = {
|
|
169
|
+
branch: attachment.kbBranch,
|
|
170
|
+
snapshotId: store.state === "missing" ? "missing" : "unavailable",
|
|
171
|
+
syncedAt: null,
|
|
172
|
+
dirty: true,
|
|
173
|
+
syncState: "unknown",
|
|
174
|
+
kbPath: store.path,
|
|
175
|
+
lastSyncSource: "unavailable",
|
|
176
|
+
staleReasons: [],
|
|
177
|
+
staleReasonCount: 0,
|
|
178
|
+
staleReasonsTruncated: false,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
else
|
|
182
|
+
try {
|
|
183
|
+
const prolog = context.prolog ??
|
|
184
|
+
(() => {
|
|
185
|
+
ownedEngine = new EngineClient({
|
|
186
|
+
workspaceRoot: context.workspaceRoot,
|
|
187
|
+
branch: attachment.kbBranch,
|
|
188
|
+
timeout: 15_000,
|
|
189
|
+
});
|
|
190
|
+
return ownedEngine;
|
|
191
|
+
})();
|
|
192
|
+
payload = await runOperationJsonQuery(prolog, "status.pl", "status:kb_status_json(JsonString)", "Status execution");
|
|
193
|
+
if (!isStatusPayload(payload)) {
|
|
194
|
+
throw new Error("Status execution query returned an invalid payload");
|
|
195
|
+
}
|
|
196
|
+
// The Prolog status module sees the compiled directory key. The public
|
|
197
|
+
// contract exposes the exact Git branch identity instead.
|
|
198
|
+
payload = { ...payload, branch: attachment.kbBranch };
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
202
|
+
engineStatus = {
|
|
203
|
+
state: "unavailable",
|
|
204
|
+
errorCode: error instanceof OperationJsonDecodeError
|
|
205
|
+
? error.code
|
|
206
|
+
: "engine_status_unavailable",
|
|
207
|
+
detail: message,
|
|
208
|
+
recoveryRequired: false,
|
|
209
|
+
};
|
|
210
|
+
payload = {
|
|
211
|
+
branch: attachment.kbBranch,
|
|
212
|
+
snapshotId: "unavailable",
|
|
213
|
+
syncedAt: null,
|
|
214
|
+
dirty: true,
|
|
215
|
+
syncState: "unknown",
|
|
216
|
+
kbPath: store.path,
|
|
217
|
+
lastSyncSource: "unavailable",
|
|
218
|
+
staleReasons: [],
|
|
219
|
+
staleReasonCount: 0,
|
|
220
|
+
staleReasonsTruncated: false,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
finally {
|
|
224
|
+
await ownedEngine?.terminate();
|
|
225
|
+
}
|
|
125
226
|
const snapshotEvidence = await readWorkspaceSnapshot(context);
|
|
227
|
+
const existingReasons = payload.staleReasons ?? [];
|
|
228
|
+
const storeReason = branchStoreReason(store);
|
|
229
|
+
const engineReason = engineStatus
|
|
230
|
+
? {
|
|
231
|
+
code: engineStatus.errorCode ?? "engine_status_unavailable",
|
|
232
|
+
path: store.path,
|
|
233
|
+
entityIds: [],
|
|
234
|
+
detail: engineStatus.detail ??
|
|
235
|
+
"The branch store is structurally readable but the engine status response is unavailable.",
|
|
236
|
+
remediation: {
|
|
237
|
+
command_argv: ["kibi", "engine", "stop"],
|
|
238
|
+
applyRequired: false,
|
|
239
|
+
},
|
|
240
|
+
}
|
|
241
|
+
: null;
|
|
242
|
+
const staleReasons = [
|
|
243
|
+
...existingReasons,
|
|
244
|
+
...(storeReason ? [storeReason] : []),
|
|
245
|
+
...(engineReason ? [engineReason] : []),
|
|
246
|
+
].sort((left, right) => String(left.path ?? "").localeCompare(String(right.path ?? "")));
|
|
126
247
|
const enrichedPayload = {
|
|
127
248
|
...payload,
|
|
249
|
+
branchAttachment: attachment,
|
|
250
|
+
branchStore: store,
|
|
251
|
+
...(engineStatus ? { engineStatus } : {}),
|
|
252
|
+
staleReasons,
|
|
253
|
+
staleReasonCount: staleReasons.length,
|
|
254
|
+
staleReasonsTruncated: false,
|
|
128
255
|
verificationSnapshot: snapshotEvidence.available
|
|
129
256
|
? snapshotEvidence.snapshot.hash
|
|
130
257
|
: "unknown",
|
|
@@ -134,9 +261,82 @@ export async function executeStatus(_input, context) {
|
|
|
134
261
|
verificationSnapshotDirty: snapshotEvidence.snapshot.dirty,
|
|
135
262
|
verificationSnapshotFileCount: snapshotEvidence.snapshot.fileCount,
|
|
136
263
|
verificationSnapshotVersion: snapshotEvidence.snapshot.version,
|
|
264
|
+
verificationSnapshotChanges: snapshotEvidence.snapshot.changes ?? [],
|
|
265
|
+
verificationSnapshotChangeCount: snapshotEvidence.snapshot.changeCount ?? 0,
|
|
266
|
+
verificationSnapshotChangesTruncated: snapshotEvidence.snapshot.changesTruncated ?? false,
|
|
137
267
|
}
|
|
138
268
|
: { verificationSnapshotError: snapshotEvidence.error }),
|
|
139
269
|
};
|
|
270
|
+
const schemaStatus = readMigrationConfigStatus(context.workspaceRoot);
|
|
271
|
+
const migrationPlan = buildActionsFromStatus({
|
|
272
|
+
workspaceRoot: context.workspaceRoot,
|
|
273
|
+
branchAttachment: attachment,
|
|
274
|
+
branchStore: store,
|
|
275
|
+
staleReasons,
|
|
276
|
+
verificationSnapshotAvailable: snapshotEvidence.available,
|
|
277
|
+
...(snapshotEvidence.available
|
|
278
|
+
? { verificationSnapshotDirty: snapshotEvidence.snapshot.dirty }
|
|
279
|
+
: {}),
|
|
280
|
+
kbSnapshotId: payload.snapshotId,
|
|
281
|
+
workspaceSnapshot: snapshotEvidence.available
|
|
282
|
+
? snapshotEvidence.snapshot.hash
|
|
283
|
+
: null,
|
|
284
|
+
configStatus: schemaStatus,
|
|
285
|
+
});
|
|
286
|
+
const bootstrapSourceFiles = context.fs?.glob
|
|
287
|
+
? await context.fs.glob([
|
|
288
|
+
".kb/requirements/**/*.md",
|
|
289
|
+
".kb/scenarios/**/*.md",
|
|
290
|
+
".kb/tests/**/*.md",
|
|
291
|
+
".kb/adrs/**/*.md",
|
|
292
|
+
".kb/adr/**/*.md",
|
|
293
|
+
".kb/flags/**/*.md",
|
|
294
|
+
".kb/events/**/*.md",
|
|
295
|
+
".kb/facts/**/*.md",
|
|
296
|
+
], { cwd: context.workspaceRoot })
|
|
297
|
+
: [];
|
|
298
|
+
const bootstrapActivation = await classifyActivation(context, bootstrapSourceFiles);
|
|
299
|
+
const statusWithPlan = {
|
|
300
|
+
...enrichedPayload,
|
|
301
|
+
schemaStatus,
|
|
302
|
+
migrationPlan,
|
|
303
|
+
bootstrap: {
|
|
304
|
+
activationState: bootstrapActivation.activationState,
|
|
305
|
+
activationMode: bootstrapActivation.activationMode,
|
|
306
|
+
planEligible: bootstrapActivation.activationState === "root_active_thin" &&
|
|
307
|
+
!bootstrapActivation.applyBlocked,
|
|
308
|
+
reason: bootstrapActivation.reason,
|
|
309
|
+
nextAction: bootstrapActivation.activationState === "root_uninitialized"
|
|
310
|
+
? {
|
|
311
|
+
operation: "kibi init",
|
|
312
|
+
reason: bootstrapActivation.reason,
|
|
313
|
+
required: true,
|
|
314
|
+
}
|
|
315
|
+
: bootstrapActivation.activationState === "root_partial"
|
|
316
|
+
? {
|
|
317
|
+
operation: "kibi doctor",
|
|
318
|
+
reason: bootstrapActivation.reason,
|
|
319
|
+
required: true,
|
|
320
|
+
}
|
|
321
|
+
: bootstrapActivation.activationState === "vendored_only"
|
|
322
|
+
? {
|
|
323
|
+
operation: "move-to-project-root",
|
|
324
|
+
reason: bootstrapActivation.reason,
|
|
325
|
+
required: true,
|
|
326
|
+
}
|
|
327
|
+
: bootstrapActivation.activationState === "root_active_thin"
|
|
328
|
+
? {
|
|
329
|
+
operation: "kb_plan_bootstrap",
|
|
330
|
+
reason: bootstrapActivation.reason,
|
|
331
|
+
required: true,
|
|
332
|
+
}
|
|
333
|
+
: {
|
|
334
|
+
operation: "continue-kibi-workflow",
|
|
335
|
+
reason: bootstrapActivation.reason,
|
|
336
|
+
required: false,
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
};
|
|
140
340
|
return {
|
|
141
341
|
content: [
|
|
142
342
|
{
|
|
@@ -144,7 +344,7 @@ export async function executeStatus(_input, context) {
|
|
|
144
344
|
text: `Branch ${payload.branch} is ${payload.syncState} (snapshot ${payload.snapshotId}, dirty=${payload.dirty}, verificationSnapshot=${enrichedPayload.verificationSnapshot})`,
|
|
145
345
|
},
|
|
146
346
|
],
|
|
147
|
-
structuredContent:
|
|
347
|
+
structuredContent: statusWithPlan,
|
|
148
348
|
};
|
|
149
349
|
}
|
|
150
350
|
catch (error) {
|