kibi-cli 0.18.1 → 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-json-command.d.ts +1 -2
- package/dist/cli-json-command.d.ts.map +1 -1
- package/dist/cli-json-command.js +2 -34
- package/dist/cli-operation-loader.d.ts +3 -0
- package/dist/cli-operation-loader.d.ts.map +1 -0
- package/dist/cli-operation-loader.js +91 -0
- package/dist/cli-operation-metadata.d.ts +94 -0
- package/dist/cli-operation-metadata.d.ts.map +1 -0
- package/dist/cli-operation-metadata.js +121 -0
- package/dist/cli-protocol.d.ts +1 -1
- package/dist/cli-protocol.d.ts.map +1 -1
- package/dist/cli-protocol.js +42 -11
- package/dist/cli-register-foundation.d.ts.map +1 -1
- package/dist/cli-register-foundation.js +28 -19
- package/dist/cli-register-json.d.ts +3 -0
- package/dist/cli-register-json.d.ts.map +1 -0
- package/dist/cli-register-json.js +35 -0
- package/dist/cli-register-maintenance.d.ts.map +1 -1
- package/dist/cli-register-maintenance.js +60 -13
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +23 -14
- package/dist/cli-register-skills.d.ts.map +1 -1
- package/dist/cli-register-skills.js +8 -6
- 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 +3 -1
- 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 +48 -77
- package/dist/commands/coverage.js +1 -1
- package/dist/commands/discovery-shared.d.ts +2 -1
- package/dist/commands/discovery-shared.d.ts.map +1 -1
- package/dist/commands/discovery-shared.js +38 -25
- 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 +8 -0
- package/dist/commands/engine.d.ts.map +1 -0
- package/dist/commands/engine.js +103 -0
- package/dist/commands/gaps.js +1 -1
- 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/graph.js +1 -1
- 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/query.d.ts.map +1 -1
- package/dist/commands/query.js +3 -1
- 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/search.d.ts.map +1 -1
- package/dist/commands/search.js +3 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +2 -1
- package/dist/commands/sync/cache.d.ts +26 -3
- package/dist/commands/sync/cache.d.ts.map +1 -1
- package/dist/commands/sync/cache.js +141 -5
- 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 +10 -1
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +223 -44
- package/dist/commands/sync/staging.d.ts +10 -1
- package/dist/commands/sync/staging.d.ts.map +1 -1
- package/dist/commands/sync/staging.js +84 -1
- package/dist/commands/sync.d.ts +6 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +710 -48
- 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-daemon.d.ts +3 -0
- package/dist/engine-daemon.d.ts.map +1 -0
- package/dist/engine-daemon.js +34 -0
- package/dist/engine.d.ts +156 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +1625 -0
- 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 +2 -0
- package/dist/extractors/relationships.d.ts.map +1 -1
- package/dist/extractors/relationships.js +16 -17
- 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 +8 -0
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +66 -16
- 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-entities.d.ts.map +1 -1
- package/dist/public/operations/discovery-entities.js +3 -2
- 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 +246 -9
- 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 +55 -6
- 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 +126 -5
- 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 +40 -10
- 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 +98 -42
- 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 +51 -8
- 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-entities.ts +3 -2
- package/src/public/operations/discovery-executors.ts +343 -15
- 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 +73 -6
- 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 +130 -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 +40 -10
- 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,433 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { escapeAtom, parseTriples } from "./prolog/codec.js";
|
|
3
|
+
import { loadEntities, } from "./public/operations/discovery-entities.js";
|
|
4
|
+
import { loadMarkdownBody } from "./search-ranking.js";
|
|
5
|
+
const GRAPH_RELATIONSHIPS = [
|
|
6
|
+
"implements",
|
|
7
|
+
"covered_by",
|
|
8
|
+
"executable_for",
|
|
9
|
+
"specified_by",
|
|
10
|
+
"verified_by",
|
|
11
|
+
"validates",
|
|
12
|
+
"constrains",
|
|
13
|
+
"requires_property",
|
|
14
|
+
"requires_predicate",
|
|
15
|
+
"requires_rule",
|
|
16
|
+
];
|
|
17
|
+
const FACET_NAMES = [
|
|
18
|
+
"actors",
|
|
19
|
+
"actions",
|
|
20
|
+
"objects",
|
|
21
|
+
"constraints",
|
|
22
|
+
"aliases",
|
|
23
|
+
];
|
|
24
|
+
const STOP_WORDS = new Set([
|
|
25
|
+
"a",
|
|
26
|
+
"an",
|
|
27
|
+
"and",
|
|
28
|
+
"are",
|
|
29
|
+
"be",
|
|
30
|
+
"by",
|
|
31
|
+
"for",
|
|
32
|
+
"in",
|
|
33
|
+
"is",
|
|
34
|
+
"of",
|
|
35
|
+
"on",
|
|
36
|
+
"or",
|
|
37
|
+
"the",
|
|
38
|
+
"to",
|
|
39
|
+
"with",
|
|
40
|
+
]);
|
|
41
|
+
const MAX_CANDIDATES = 10_000;
|
|
42
|
+
const MAX_GRAPH_SEEDS = 5;
|
|
43
|
+
const MAX_GRAPH_EDGES = 2_000;
|
|
44
|
+
function normalize(value) {
|
|
45
|
+
return value
|
|
46
|
+
.trim()
|
|
47
|
+
.toLowerCase()
|
|
48
|
+
.replace(/[-_]+/g, " ")
|
|
49
|
+
.replace(/[^a-z0-9\s]+/g, " ")
|
|
50
|
+
.split(/\s+/)
|
|
51
|
+
.filter(Boolean)
|
|
52
|
+
.map((token) => token.length > 4 && token.endsWith("s") && !token.endsWith("ss")
|
|
53
|
+
? token.slice(0, -1)
|
|
54
|
+
: token)
|
|
55
|
+
.join(" ");
|
|
56
|
+
}
|
|
57
|
+
function tokens(value) {
|
|
58
|
+
return Array.from(new Set(normalize(value)
|
|
59
|
+
.split(" ")
|
|
60
|
+
.filter((token) => token.length > 0 && !STOP_WORDS.has(token))));
|
|
61
|
+
}
|
|
62
|
+
function stringValues(value) {
|
|
63
|
+
if (typeof value === "string")
|
|
64
|
+
return value.trim() ? [value] : [];
|
|
65
|
+
if (!Array.isArray(value))
|
|
66
|
+
return [];
|
|
67
|
+
return value.filter((item) => typeof item === "string");
|
|
68
|
+
}
|
|
69
|
+
function entityText(entity) {
|
|
70
|
+
const fields = [
|
|
71
|
+
entity.title,
|
|
72
|
+
entity.id,
|
|
73
|
+
entity.type,
|
|
74
|
+
entity.source,
|
|
75
|
+
entity.sourceFile,
|
|
76
|
+
entity.semantic_text,
|
|
77
|
+
entity.text_ref,
|
|
78
|
+
...stringValues(entity.tags),
|
|
79
|
+
];
|
|
80
|
+
return fields
|
|
81
|
+
.filter((field) => typeof field === "string")
|
|
82
|
+
.join(" ");
|
|
83
|
+
}
|
|
84
|
+
function entitySourcePath(entity) {
|
|
85
|
+
const sourceFile = entity.sourceFile;
|
|
86
|
+
if (typeof sourceFile === "string" && sourceFile.trim()) {
|
|
87
|
+
return sourceFile.split("#", 1)[0]?.trim() ?? null;
|
|
88
|
+
}
|
|
89
|
+
const source = entity.source;
|
|
90
|
+
if (typeof source !== "string" || !source.trim())
|
|
91
|
+
return null;
|
|
92
|
+
return source.split("#", 1)[0]?.trim() ?? null;
|
|
93
|
+
}
|
|
94
|
+
function sourcePathMatches(entityPath, requestedPath) {
|
|
95
|
+
if (!entityPath)
|
|
96
|
+
return false;
|
|
97
|
+
const normalizePath = (value) => value.replaceAll("\\", "/").replace(/^\.\//, "");
|
|
98
|
+
const left = normalizePath(entityPath);
|
|
99
|
+
const right = normalizePath(requestedPath);
|
|
100
|
+
return (left === right || left.endsWith(`/${right}`) || right.endsWith(`/${left}`));
|
|
101
|
+
}
|
|
102
|
+
function numberField(entity, ...keys) {
|
|
103
|
+
for (const key of keys) {
|
|
104
|
+
const value = entity[key];
|
|
105
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
106
|
+
return value;
|
|
107
|
+
if (typeof value === "string" && /^\d+$/.test(value))
|
|
108
|
+
return Number(value);
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
function sourceMatches(entity, locations) {
|
|
113
|
+
if (locations.length === 0)
|
|
114
|
+
return [];
|
|
115
|
+
const entityPath = entitySourcePath(entity);
|
|
116
|
+
const title = typeof entity.title === "string" ? normalize(entity.title) : "";
|
|
117
|
+
const matches = [];
|
|
118
|
+
for (const location of locations) {
|
|
119
|
+
if (!sourcePathMatches(entityPath, location.path))
|
|
120
|
+
continue;
|
|
121
|
+
const requestedSymbol = location.symbol ? normalize(location.symbol) : "";
|
|
122
|
+
const symbolMatches = requestedSymbol.length === 0 ||
|
|
123
|
+
title === requestedSymbol ||
|
|
124
|
+
title.includes(requestedSymbol) ||
|
|
125
|
+
requestedSymbol.includes(title);
|
|
126
|
+
if (!symbolMatches)
|
|
127
|
+
continue;
|
|
128
|
+
const startLine = numberField(entity, "sourceLine", "source_line");
|
|
129
|
+
const endLine = numberField(entity, "sourceEndLine", "source_end_line") ?? startLine;
|
|
130
|
+
const lineMatches = location.line === undefined ||
|
|
131
|
+
(startLine !== null &&
|
|
132
|
+
endLine !== null &&
|
|
133
|
+
location.line >= startLine &&
|
|
134
|
+
location.line <= endLine);
|
|
135
|
+
if (!lineMatches)
|
|
136
|
+
continue;
|
|
137
|
+
const exactSymbol = requestedSymbol.length > 0 && title === requestedSymbol;
|
|
138
|
+
const coordinate = location.line !== undefined && startLine !== null;
|
|
139
|
+
matches.push({
|
|
140
|
+
path: location.path,
|
|
141
|
+
...(typeof entity.id === "string" ? { symbolId: entity.id } : {}),
|
|
142
|
+
...(exactSymbol
|
|
143
|
+
? { distance: 0 }
|
|
144
|
+
: coordinate
|
|
145
|
+
? { distance: 1 }
|
|
146
|
+
: { distance: 2 }),
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return matches;
|
|
150
|
+
}
|
|
151
|
+
function facetValues(facets) {
|
|
152
|
+
const result = [];
|
|
153
|
+
for (const name of FACET_NAMES) {
|
|
154
|
+
for (const value of stringValues(facets?.[name])) {
|
|
155
|
+
if (value.trim())
|
|
156
|
+
result.push({ name, value });
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return result;
|
|
160
|
+
}
|
|
161
|
+
function scoreEntity(entity, queryTokens, facets, sourceEvidence, graphEvidence, documentFrequency, documentCount, body) {
|
|
162
|
+
const title = normalize(String(entity.title ?? ""));
|
|
163
|
+
const metadata = normalize([
|
|
164
|
+
entity.id,
|
|
165
|
+
entity.type,
|
|
166
|
+
entity.source,
|
|
167
|
+
entity.sourceFile,
|
|
168
|
+
entity.semantic_text,
|
|
169
|
+
entity.text_ref,
|
|
170
|
+
...stringValues(entity.tags),
|
|
171
|
+
]
|
|
172
|
+
.filter((value) => typeof value === "string")
|
|
173
|
+
.join(" "));
|
|
174
|
+
const bodyText = normalize(body ?? "");
|
|
175
|
+
const titleTokens = new Set(tokens(title));
|
|
176
|
+
const metadataTokens = new Set(tokens(metadata));
|
|
177
|
+
const bodyTokens = new Set(tokens(bodyText));
|
|
178
|
+
const allSignalTokens = Array.from(new Set(queryTokens));
|
|
179
|
+
const lexical = allSignalTokens.reduce((sum, token) => {
|
|
180
|
+
const frequency = documentFrequency.get(token) ?? 0;
|
|
181
|
+
const idf = Math.log(1 + (documentCount + 1) / (frequency + 1));
|
|
182
|
+
const fieldWeight = titleTokens.has(token)
|
|
183
|
+
? 3
|
|
184
|
+
: metadataTokens.has(token)
|
|
185
|
+
? 1.5
|
|
186
|
+
: bodyTokens.has(token)
|
|
187
|
+
? 0.75
|
|
188
|
+
: 0;
|
|
189
|
+
return sum + idf * fieldWeight;
|
|
190
|
+
}, 0);
|
|
191
|
+
const lexicalMax = Math.max(1, allSignalTokens.length * 4);
|
|
192
|
+
const lexicalScore = Math.min(1, lexical / lexicalMax);
|
|
193
|
+
const matchedFacets = [];
|
|
194
|
+
let facetScore = 0;
|
|
195
|
+
for (const facet of facets) {
|
|
196
|
+
const facetTokens = tokens(facet.value);
|
|
197
|
+
if (facetTokens.length === 0)
|
|
198
|
+
continue;
|
|
199
|
+
const matches = facetTokens.filter((token) => titleTokens.has(token) ||
|
|
200
|
+
metadataTokens.has(token) ||
|
|
201
|
+
bodyTokens.has(token)).length;
|
|
202
|
+
if (matches > 0) {
|
|
203
|
+
matchedFacets.push(`${facet.name}:${facet.value}`);
|
|
204
|
+
facetScore += matches / facetTokens.length;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
facetScore = Math.min(1, facetScore / Math.max(1, facets.length));
|
|
208
|
+
const sourceScore = sourceEvidence.length > 0 ? 1 : 0;
|
|
209
|
+
const graphScore = graphEvidence.length > 0 ? Math.min(1, graphEvidence.length / 2) : 0;
|
|
210
|
+
const score = Math.min(1, lexicalScore * 0.58 +
|
|
211
|
+
facetScore * 0.17 +
|
|
212
|
+
sourceScore * 0.2 +
|
|
213
|
+
graphScore * 0.05);
|
|
214
|
+
const reasons = [];
|
|
215
|
+
if (lexicalScore > 0)
|
|
216
|
+
reasons.push("intent token match");
|
|
217
|
+
if (matchedFacets.length > 0)
|
|
218
|
+
reasons.push("semantic facet match");
|
|
219
|
+
if (sourceEvidence.length > 0)
|
|
220
|
+
reasons.push("source location match");
|
|
221
|
+
if (graphEvidence.length > 0)
|
|
222
|
+
reasons.push("traceability graph match");
|
|
223
|
+
if (body &&
|
|
224
|
+
bodyTokens.size > 0 &&
|
|
225
|
+
queryTokens.some((token) => bodyTokens.has(token))) {
|
|
226
|
+
reasons.push("markdown body match");
|
|
227
|
+
}
|
|
228
|
+
return { score, reasons, matchedFacets };
|
|
229
|
+
}
|
|
230
|
+
function buildDocumentFrequency(entities) {
|
|
231
|
+
const frequency = new Map();
|
|
232
|
+
for (const entity of entities) {
|
|
233
|
+
const seen = new Set(tokens(entityText(entity)));
|
|
234
|
+
for (const token of seen)
|
|
235
|
+
frequency.set(token, (frequency.get(token) ?? 0) + 1);
|
|
236
|
+
}
|
|
237
|
+
return frequency;
|
|
238
|
+
}
|
|
239
|
+
// implements REQ-kibi-intent-aware-source-discovery
|
|
240
|
+
export async function rankIntentEntities(entities, options, workspaceRoot, graphEdges = []) {
|
|
241
|
+
const queryTokens = tokens(options.query);
|
|
242
|
+
const facets = facetValues(options.semanticFacets);
|
|
243
|
+
const allTokens = Array.from(new Set([
|
|
244
|
+
...queryTokens,
|
|
245
|
+
...facets.flatMap((facet) => tokens(facet.value)),
|
|
246
|
+
]));
|
|
247
|
+
const documentFrequency = buildDocumentFrequency(entities);
|
|
248
|
+
const ranked = [];
|
|
249
|
+
const minScore = options.minScore ?? 0.18;
|
|
250
|
+
const graphByEntity = new Map();
|
|
251
|
+
for (const edge of graphEdges) {
|
|
252
|
+
const pathValue = {
|
|
253
|
+
from: edge.from,
|
|
254
|
+
relationships: [edge.relationship],
|
|
255
|
+
to: edge.to,
|
|
256
|
+
};
|
|
257
|
+
const fromPaths = graphByEntity.get(edge.from) ?? [];
|
|
258
|
+
fromPaths.push(pathValue);
|
|
259
|
+
graphByEntity.set(edge.from, fromPaths);
|
|
260
|
+
const toPaths = graphByEntity.get(edge.to) ?? [];
|
|
261
|
+
toPaths.push(pathValue);
|
|
262
|
+
graphByEntity.set(edge.to, toPaths);
|
|
263
|
+
}
|
|
264
|
+
for (const entity of entities) {
|
|
265
|
+
const sourceEvidence = sourceMatches(entity, options.sourceLocations ?? []);
|
|
266
|
+
const entityId = String(entity.id ?? "");
|
|
267
|
+
// Keep evidence useful for agents and bounded for transport. The score is
|
|
268
|
+
// already capped; unbounded parallel paths only add noise to receipts.
|
|
269
|
+
const graphEvidence = (graphByEntity.get(entityId) ?? []).slice(0, 8);
|
|
270
|
+
const body = await loadMarkdownBody(String(entity.source ?? ""), workspaceRoot);
|
|
271
|
+
const scored = scoreEntity(entity, allTokens, facets, sourceEvidence, graphEvidence, documentFrequency, entities.length, body);
|
|
272
|
+
if (scored.score < minScore)
|
|
273
|
+
continue;
|
|
274
|
+
const snippet = body
|
|
275
|
+
?.split(/\r?\n/)
|
|
276
|
+
.map((line) => line.trim())
|
|
277
|
+
.find(Boolean);
|
|
278
|
+
ranked.push({
|
|
279
|
+
entity,
|
|
280
|
+
score: scored.score,
|
|
281
|
+
reasons: Array.from(new Set(scored.reasons)),
|
|
282
|
+
...(snippet !== undefined ? { snippet } : {}),
|
|
283
|
+
evidence: {
|
|
284
|
+
normalizedScore: scored.score,
|
|
285
|
+
matchedFacets: scored.matchedFacets,
|
|
286
|
+
sourceMatches: sourceEvidence,
|
|
287
|
+
graphPaths: graphEvidence,
|
|
288
|
+
abstentionEligible: scored.score < minScore,
|
|
289
|
+
},
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
ranked.sort((left, right) => {
|
|
293
|
+
if (right.score !== left.score)
|
|
294
|
+
return right.score - left.score;
|
|
295
|
+
const typeOrder = String(left.entity.type ?? "").localeCompare(String(right.entity.type ?? ""));
|
|
296
|
+
if (typeOrder !== 0)
|
|
297
|
+
return typeOrder;
|
|
298
|
+
return String(left.entity.id ?? "").localeCompare(String(right.entity.id ?? ""));
|
|
299
|
+
});
|
|
300
|
+
const topScore = ranked[0]?.score ?? null;
|
|
301
|
+
const first = ranked[0];
|
|
302
|
+
const second = ranked[1];
|
|
303
|
+
const topTwoMargin = first !== undefined && second !== undefined
|
|
304
|
+
? first.score - second.score
|
|
305
|
+
: null;
|
|
306
|
+
return {
|
|
307
|
+
matches: ranked,
|
|
308
|
+
analysis: {
|
|
309
|
+
rankingMode: "intent-v1",
|
|
310
|
+
candidateCount: entities.length,
|
|
311
|
+
acceptedCount: ranked.length,
|
|
312
|
+
topScore,
|
|
313
|
+
topTwoMargin,
|
|
314
|
+
abstained: ranked.length === 0,
|
|
315
|
+
},
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
function graphGoal(seedIds, depth) {
|
|
319
|
+
const ids = seedIds.map((id) => `'${escapeAtom(id)}'`).join(",");
|
|
320
|
+
const relationships = GRAPH_RELATIONSHIPS.join(",");
|
|
321
|
+
if (depth === 1) {
|
|
322
|
+
return `findall([Rel,From,To], (member(Rel, [${relationships}]), kb_relationship(Rel, From, To), (member(From, [${ids}]); member(To, [${ids}]))), Edges)`;
|
|
323
|
+
}
|
|
324
|
+
return `findall([Rel,From,To], (member(Rel, [${relationships}]), kb_relationship(Rel, From, To), (member(From, [${ids}]); member(To, [${ids}]))), Edges)`;
|
|
325
|
+
}
|
|
326
|
+
async function queryGraphEdges(prolog, seedIds) {
|
|
327
|
+
if (seedIds.length === 0)
|
|
328
|
+
return [];
|
|
329
|
+
const result = await prolog.query(graphGoal(seedIds, 1));
|
|
330
|
+
if (!result.success)
|
|
331
|
+
return [];
|
|
332
|
+
return parseTriples(result.bindings.Edges ?? "[]")
|
|
333
|
+
.slice(0, MAX_GRAPH_EDGES)
|
|
334
|
+
.map(([relationship, from, to]) => ({ relationship, from, to }));
|
|
335
|
+
}
|
|
336
|
+
async function loadIntentCandidates(prolog, options) {
|
|
337
|
+
const terms = [
|
|
338
|
+
options.query,
|
|
339
|
+
...facetValues(options.semanticFacets).map((facet) => facet.value),
|
|
340
|
+
].filter((term, index, all) => term.trim() && all.indexOf(term) === index);
|
|
341
|
+
const candidates = new Map();
|
|
342
|
+
if (prolog.searchEntities &&
|
|
343
|
+
(options.sourceLocations === undefined ||
|
|
344
|
+
options.sourceLocations.length === 0)) {
|
|
345
|
+
for (const term of terms) {
|
|
346
|
+
const page = await prolog.searchEntities({
|
|
347
|
+
query: term,
|
|
348
|
+
...(options.type !== undefined ? { type: options.type } : {}),
|
|
349
|
+
limit: MAX_CANDIDATES,
|
|
350
|
+
offset: 0,
|
|
351
|
+
});
|
|
352
|
+
for (const entity of page.entities) {
|
|
353
|
+
candidates.set(`${String(entity.type ?? "")}::${String(entity.id ?? "")}`, { ...entity });
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
// An unfamiliar host-agent alias may not exist in the lexical index at
|
|
357
|
+
// all. For small facet-bearing corpora, scan the bounded entity set so a
|
|
358
|
+
// zero lexical hit does not turn a valid semantic query into a false
|
|
359
|
+
// abstention. Large repositories remain index-bounded.
|
|
360
|
+
if (facetValues(options.semanticFacets).length > 0 &&
|
|
361
|
+
candidates.size < 20) {
|
|
362
|
+
const all = await loadEntities(prolog, options.type ? { type: options.type } : {});
|
|
363
|
+
for (const entity of all.slice(0, MAX_CANDIDATES)) {
|
|
364
|
+
candidates.set(`${String(entity.type ?? "")}::${String(entity.id ?? "")}`, entity);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
const all = await loadEntities(prolog, options.type ? { type: options.type } : {});
|
|
370
|
+
for (const entity of all) {
|
|
371
|
+
candidates.set(`${String(entity.type ?? "")}::${String(entity.id ?? "")}`, entity);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if (candidates.size > MAX_CANDIDATES) {
|
|
375
|
+
return Array.from(candidates.values()).slice(0, MAX_CANDIDATES);
|
|
376
|
+
}
|
|
377
|
+
return Array.from(candidates.values());
|
|
378
|
+
}
|
|
379
|
+
// implements REQ-kibi-intent-aware-source-discovery
|
|
380
|
+
export async function executeIntentSearch(options, prolog, workspaceRoot) {
|
|
381
|
+
const candidates = await loadIntentCandidates(prolog, options);
|
|
382
|
+
const firstPass = await rankIntentEntities(candidates, options, workspaceRoot);
|
|
383
|
+
const sourceSeeds = firstPass.matches
|
|
384
|
+
.filter((match) => match.evidence.sourceMatches.length > 0)
|
|
385
|
+
.map((match) => String(match.entity.id ?? ""));
|
|
386
|
+
const seeds = Array.from(new Set([
|
|
387
|
+
...(sourceSeeds.length > 0
|
|
388
|
+
? sourceSeeds
|
|
389
|
+
: firstPass.matches
|
|
390
|
+
.map((match) => String(match.entity.id ?? ""))
|
|
391
|
+
.slice(0, MAX_GRAPH_SEEDS)),
|
|
392
|
+
])).slice(0, MAX_GRAPH_SEEDS);
|
|
393
|
+
const graphEdges = await queryGraphEdges(prolog, seeds);
|
|
394
|
+
const knownIds = new Set(candidates.map((entity) => `${String(entity.type ?? "")}::${String(entity.id ?? "")}`));
|
|
395
|
+
const relatedIds = Array.from(new Set(graphEdges.flatMap((edge) => [edge.from, edge.to]))).filter((id) => !seeds.includes(id));
|
|
396
|
+
for (const id of relatedIds.slice(0, MAX_GRAPH_SEEDS * 4)) {
|
|
397
|
+
const related = await loadEntities(prolog, { id });
|
|
398
|
+
for (const entity of related) {
|
|
399
|
+
const key = `${String(entity.type ?? "")}::${String(entity.id ?? "")}`;
|
|
400
|
+
if (!knownIds.has(key)) {
|
|
401
|
+
knownIds.add(key);
|
|
402
|
+
candidates.push(entity);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
return rankIntentEntities(candidates, options, workspaceRoot, graphEdges);
|
|
407
|
+
}
|
|
408
|
+
// implements REQ-kibi-intent-aware-source-discovery
|
|
409
|
+
export function validateIntentSearchInput(input) {
|
|
410
|
+
if (!input.query.trim())
|
|
411
|
+
throw new Error("Search execution failed: query must be a non-empty string");
|
|
412
|
+
if (input.minScore !== undefined &&
|
|
413
|
+
(!Number.isFinite(input.minScore) ||
|
|
414
|
+
input.minScore < 0 ||
|
|
415
|
+
input.minScore > 1)) {
|
|
416
|
+
throw new Error("Search execution failed: minScore must be between 0 and 1");
|
|
417
|
+
}
|
|
418
|
+
for (const location of input.sourceLocations ?? []) {
|
|
419
|
+
if (!location.path.trim() ||
|
|
420
|
+
path.isAbsolute(location.path) ||
|
|
421
|
+
location.path.split("/").includes("..")) {
|
|
422
|
+
throw new Error("Search execution failed: sourceLocations.path must be workspace-relative");
|
|
423
|
+
}
|
|
424
|
+
if (location.line !== undefined &&
|
|
425
|
+
(!Number.isInteger(location.line) || location.line < 1)) {
|
|
426
|
+
throw new Error("Search execution failed: sourceLocations.line must be a positive integer");
|
|
427
|
+
}
|
|
428
|
+
if (location.column !== undefined &&
|
|
429
|
+
(!Number.isInteger(location.column) || location.column < 1)) {
|
|
430
|
+
throw new Error("Search execution failed: sourceLocations.column must be a positive integer");
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activation.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/activation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAGjF,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,YAAY,CAAC;AAmHpE,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,gBAAgB,CAAC,CAwE3B"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { readKbManifestStatus } from "../../utils/kb-manifest.js";
|
|
3
|
+
import { KB_PATHS } from "../../utils/kb-paths.js";
|
|
2
4
|
function activationFor(state) {
|
|
3
5
|
switch (state) {
|
|
4
6
|
case "root_uninitialized":
|
|
5
7
|
return {
|
|
6
8
|
activationState: state,
|
|
7
9
|
activationMode: "cold_start_bootstrap",
|
|
8
|
-
applyBlocked:
|
|
10
|
+
applyBlocked: true,
|
|
11
|
+
// Discovery remains useful for explaining the next step, but the
|
|
12
|
+
// resulting plan is blocked until `kibi init` establishes the root.
|
|
9
13
|
allowCandidateGeneration: true,
|
|
10
|
-
reason: "Workspace has no attached root KB yet; run
|
|
14
|
+
reason: "Workspace has no attached root KB yet; run `kibi init` before planning bootstrap knowledge.",
|
|
15
|
+
handoffMessage: "Kibi infrastructure is not initialized. Run `kibi init`, then ask the agent to bootstrap this repository.",
|
|
11
16
|
};
|
|
12
17
|
case "root_partial":
|
|
13
18
|
return {
|
|
@@ -29,11 +34,10 @@ function activationFor(state) {
|
|
|
29
34
|
case "root_active_thin":
|
|
30
35
|
return {
|
|
31
36
|
activationState: state,
|
|
32
|
-
activationMode: "
|
|
33
|
-
applyBlocked:
|
|
34
|
-
allowCandidateGeneration:
|
|
35
|
-
reason: "Workspace
|
|
36
|
-
handoffMessage: "Attached thin KB detected. Review sparse KB coverage and continue with a handoff.",
|
|
37
|
+
activationMode: "attached_thin_bootstrap",
|
|
38
|
+
applyBlocked: false,
|
|
39
|
+
allowCandidateGeneration: true,
|
|
40
|
+
reason: "Workspace has an attached but unseeded KB; deterministic bootstrap planning is eligible.",
|
|
37
41
|
};
|
|
38
42
|
case "root_active_seeded":
|
|
39
43
|
return {
|
|
@@ -74,38 +78,51 @@ function coverageState(rows) {
|
|
|
74
78
|
? "root_active_seeded"
|
|
75
79
|
: "root_active_thin";
|
|
76
80
|
}
|
|
81
|
+
function sourceCoverageState(files) {
|
|
82
|
+
const counts = {
|
|
83
|
+
req: files.filter((file) => /^\.kb\/requirements\/.*\.md$/i.test(file))
|
|
84
|
+
.length,
|
|
85
|
+
scenario: files.filter((file) => /^\.kb\/scenarios\/.*\.md$/i.test(file))
|
|
86
|
+
.length,
|
|
87
|
+
test: files.filter((file) => /^\.kb\/tests\/.*\.md$/i.test(file)).length,
|
|
88
|
+
adr: files.filter((file) => /^\.kb\/adrs?\/.*\.md$/i.test(file)).length,
|
|
89
|
+
flag: files.filter((file) => /^\.kb\/flags\/.*\.md$/i.test(file)).length,
|
|
90
|
+
event: files.filter((file) => /^\.kb\/events\/.*\.md$/i.test(file)).length,
|
|
91
|
+
fact: files.filter((file) => /^\.kb\/facts\/.*\.md$/i.test(file)).length,
|
|
92
|
+
};
|
|
93
|
+
return coverageState(Object.entries(counts).map(([type, count]) => ({ type, count })));
|
|
94
|
+
}
|
|
95
|
+
// implements REQ-KIBI-BOOTSTRAP-PLAN
|
|
77
96
|
export async function classifyActivation(context, files) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
97
|
+
// Discovery callers do not all use the same path base. The CLI globber
|
|
98
|
+
// returns workspace-relative paths, while host adapters may pass absolute
|
|
99
|
+
// paths. Normalize before source-lane classification so a seeded source
|
|
100
|
+
// KB has the same posture on every peer surface.
|
|
101
|
+
const normalizedFiles = files.map((file) => {
|
|
102
|
+
const relative = path.isAbsolute(file)
|
|
103
|
+
? path.relative(context.workspaceRoot, file)
|
|
104
|
+
: file;
|
|
105
|
+
return relative.replaceAll("\\", "/");
|
|
106
|
+
});
|
|
107
|
+
const manifestStatus = readKbManifestStatus(context.workspaceRoot);
|
|
108
|
+
if (manifestStatus.state === "missing") {
|
|
109
|
+
const vendored = normalizedFiles.some((file) => file.startsWith("kibi/"));
|
|
110
|
+
const projectSignalFromFiles = normalizedFiles.some((file) => !file.startsWith("kibi/") &&
|
|
82
111
|
/^(README\.md|package\.json|src\/|app\/|packages\/|tests\/)/.test(file));
|
|
112
|
+
const projectSignalFromDirectories = await Promise.all(["README.md", "package.json", "src", "app", "packages", "tests"].map((target) => exists(context, path.resolve(context.workspaceRoot, target))));
|
|
113
|
+
const projectSignal = projectSignalFromFiles || projectSignalFromDirectories.some(Boolean);
|
|
83
114
|
return activationFor(vendored && !projectSignal ? "vendored_only" : "root_uninitialized");
|
|
84
115
|
}
|
|
85
|
-
|
|
86
|
-
try {
|
|
87
|
-
config = JSON.parse((await context.fs?.readFile(configPath)) ?? "{}") ?? {};
|
|
88
|
-
}
|
|
89
|
-
catch {
|
|
116
|
+
if (manifestStatus.state !== "ok")
|
|
90
117
|
return activationFor("root_partial");
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
"documentation/requirements",
|
|
94
|
-
"documentation/scenarios",
|
|
95
|
-
"documentation/tests",
|
|
96
|
-
"documentation/adr",
|
|
97
|
-
"documentation/flags",
|
|
98
|
-
"documentation/events",
|
|
99
|
-
"documentation/facts",
|
|
100
|
-
"documentation/symbols.yaml",
|
|
101
|
-
];
|
|
102
|
-
const configured = Object.values(config.paths ?? {});
|
|
103
|
-
const targets = configured.length >= 8 ? configured : defaults;
|
|
104
|
-
const resolved = await Promise.all(targets.map((target) => exists(context, path.resolve(context.workspaceRoot, target.replace(/[*?\[].*$/, "").replace(/\/$/, "")))));
|
|
118
|
+
const targets = [...Object.values(KB_PATHS.lanes), KB_PATHS.symbolsManifest];
|
|
119
|
+
const resolved = await Promise.all(targets.map((target) => exists(context, path.resolve(context.workspaceRoot, target))));
|
|
105
120
|
if (resolved.some((value) => !value))
|
|
106
121
|
return activationFor("root_partial");
|
|
107
122
|
if (!context.prolog)
|
|
108
|
-
return activationFor("
|
|
123
|
+
return activationFor(normalizedFiles.some((file) => file.startsWith(".kb/"))
|
|
124
|
+
? sourceCoverageState(normalizedFiles)
|
|
125
|
+
: "root_active_thin");
|
|
109
126
|
try {
|
|
110
127
|
const result = await context.prolog.query("discovery:coverage_report_json(type, [], true, false, 100, 0, JsonString)");
|
|
111
128
|
const parsed = JSON.parse(result.bindings.JsonString ?? '{"rows":[]}');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate-helpers.d.ts","sourceRoot":"","sources":["../../../src/operations/
|
|
1
|
+
{"version":3,"file":"candidate-helpers.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/candidate-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,MAAM,CAMtD;AAED,wBAAgB,MAAM,CACpB,CAAC,SAAS;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAE,EAE5D,MAAM,EAAE,CAAC,EACT,aAAa,GAAE,SAAS;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,EAAO,GACP,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAQnC;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,cAAc,GACvB,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAmC9C"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type CandidateBuildResult } from "./markdown-candidates.js";
|
|
2
|
+
import type { BootstrapEvidence } from "./types.js";
|
|
3
|
+
export declare function buildBootstrapCandidates(evidence: readonly BootstrapEvidence[], existingIds: ReadonlySet<string>, minConfidence: number, includeGenericMarkdown: boolean): CandidateBuildResult;
|
|
4
|
+
//# sourceMappingURL=candidates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidates.d.ts","sourceRoot":"","sources":["../../../src/operations/
|
|
1
|
+
{"version":3,"file":"candidates.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/candidates.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,YAAY,CAAC;AAmHpB,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EACtC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EAChC,aAAa,EAAE,MAAM,EACrB,sBAAsB,EAAE,OAAO,GAC9B,oBAAoB,CAsCtB"}
|
|
@@ -57,10 +57,9 @@ function providerCandidate(item, existingIds, minConfidence) {
|
|
|
57
57
|
const symbolTitle = item.kind === "source_symbols" && /\.(?:[cm]?[jt]sx?)$/i.test(relativePath)
|
|
58
58
|
? `Source symbols: ${path.basename(relativePath, path.extname(relativePath))}`
|
|
59
59
|
: undefined;
|
|
60
|
-
const title =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
: `Autopilot evidence from ${relativePath}`);
|
|
60
|
+
const title = (typeof item.data.title === "string" ? item.data.title : undefined) ??
|
|
61
|
+
symbolTitle ??
|
|
62
|
+
`Bootstrap evidence from ${relativePath}`;
|
|
64
63
|
const entity = {
|
|
65
64
|
type: "fact",
|
|
66
65
|
id,
|
|
@@ -71,12 +70,12 @@ function providerCandidate(item, existingIds, minConfidence) {
|
|
|
71
70
|
: item.kind === "repo_metadata"
|
|
72
71
|
? "meta"
|
|
73
72
|
: "observation",
|
|
74
|
-
source: `
|
|
73
|
+
source: `bootstrap:${item.provider}:${relativePath}`,
|
|
75
74
|
text_ref: relativePath,
|
|
76
75
|
};
|
|
77
76
|
const evidence = Array.isArray(item.data.evidence)
|
|
78
77
|
? item.data.evidence.filter((value) => typeof value === "string")
|
|
79
|
-
: [`provider:${item.provider}`];
|
|
78
|
+
: [`provider:${item.provider}`, `${item.provider}:${relativePath}`];
|
|
80
79
|
return [
|
|
81
80
|
{
|
|
82
81
|
candidateId: `prov:${item.kind}:${slug(relativePath, 96) || "evidence"}`,
|
|
@@ -92,8 +91,9 @@ function providerCandidate(item, existingIds, minConfidence) {
|
|
|
92
91
|
},
|
|
93
92
|
];
|
|
94
93
|
}
|
|
95
|
-
// implements REQ-mcp-
|
|
96
|
-
|
|
94
|
+
// implements REQ-mcp-kibi-bootstrap-bootstrap-v1, REQ-kibi-operation-interface-parity
|
|
95
|
+
// implements REQ-KIBI-BOOTSTRAP-PLAN
|
|
96
|
+
export function buildBootstrapCandidates(evidence, existingIds, minConfidence, includeGenericMarkdown) {
|
|
97
97
|
const candidates = [];
|
|
98
98
|
const sourceOnlySignals = [];
|
|
99
99
|
for (const item of evidence) {
|
|
@@ -104,6 +104,20 @@ export function buildAutopilotCandidates(evidence, existingIds, minConfidence, i
|
|
|
104
104
|
candidates.push(...built.candidates);
|
|
105
105
|
sourceOnlySignals.push(...built.sourceOnlySignals);
|
|
106
106
|
}
|
|
107
|
+
if (item.kind === "test_topology") {
|
|
108
|
+
const confidence = typeof item.data.confidence === "number" ? item.data.confidence : 0.8;
|
|
109
|
+
if (confidence >= minConfidence) {
|
|
110
|
+
sourceOnlySignals.push({
|
|
111
|
+
kind: "test",
|
|
112
|
+
title: `Author TEST coverage for ${item.label}`,
|
|
113
|
+
sourcePath: item.absolutePath ?? item.relativePath ?? item.label,
|
|
114
|
+
confidence,
|
|
115
|
+
evidence: Array.isArray(item.data.evidence)
|
|
116
|
+
? item.data.evidence.filter((value) => typeof value === "string")
|
|
117
|
+
: [`test_topology:${item.relativePath ?? item.label}`],
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
107
121
|
candidates.push(...providerCandidate(item, existingIds, minConfidence));
|
|
108
122
|
}
|
|
109
123
|
return {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { OperationContext } from "../../public/operations/runtime-types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BootstrapEvidence } from "./types.js";
|
|
3
3
|
export type EvidenceScan = {
|
|
4
4
|
readonly files: readonly string[];
|
|
5
5
|
readonly ignoredSources: readonly string[];
|
|
6
|
-
readonly evidence: readonly
|
|
6
|
+
readonly evidence: readonly BootstrapEvidence[];
|
|
7
7
|
readonly warnings: readonly string[];
|
|
8
8
|
};
|
|
9
9
|
export declare function scanEvidence(context: OperationContext): Promise<EvidenceScan>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-evidence.d.ts","sourceRoot":"","sources":["../../../src/operations/
|
|
1
|
+
{"version":3,"file":"discovery-evidence.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/discovery-evidence.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,gBAAgB,EACjB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,YAAY,CAAC;AA0BpB,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,CAAC;AAoKF,wBAAsB,YAAY,CAChC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,YAAY,CAAC,CA4DvB"}
|