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
|
@@ -4,17 +4,23 @@ import type {
|
|
|
4
4
|
ExtractedEntity,
|
|
5
5
|
ExtractionResult,
|
|
6
6
|
} from "../../extractors/markdown.js";
|
|
7
|
-
import type { PrologProcess } from "../../prolog.js";
|
|
8
7
|
import {
|
|
9
8
|
parseEntityFromList,
|
|
10
9
|
parseListOfLists,
|
|
11
10
|
parseTriples,
|
|
12
11
|
} from "../../prolog/codec.js";
|
|
12
|
+
import {
|
|
13
|
+
runOperationJsonQuery,
|
|
14
|
+
toPrologAtom,
|
|
15
|
+
toPrologList,
|
|
16
|
+
} from "../operations/prolog-json.js";
|
|
17
|
+
import type { PrologPort } from "../operations/runtime-types.js";
|
|
13
18
|
import {
|
|
14
19
|
analyzeTelemetryAcceptance,
|
|
15
20
|
createTelemetryAcceptanceDiagnostics,
|
|
16
21
|
parseTelemetryUsageLog,
|
|
17
22
|
} from "../telemetry-acceptance.js";
|
|
23
|
+
import { VERIFICATION_RECEIPT_MAX_AGE_SECONDS } from "../verification-receipt.js";
|
|
18
24
|
import { createCoverageDepthQualityDiagnostics } from "./coverage-depth-quality.js";
|
|
19
25
|
import { createRequirementQualityDiagnostics } from "./requirement-quality.js";
|
|
20
26
|
import { createSymbolQualityDiagnostics } from "./symbol-quality.js";
|
|
@@ -40,13 +46,19 @@ const RELATIONSHIP_TYPES = [
|
|
|
40
46
|
] as const;
|
|
41
47
|
|
|
42
48
|
type FullKbQualityDiagnosticsOptions = {
|
|
43
|
-
readonly prolog: Pick<
|
|
49
|
+
readonly prolog: Pick<PrologPort, "query">;
|
|
44
50
|
readonly hardViolationEntityIds?: ReadonlySet<string>;
|
|
45
51
|
readonly maxDiagnostics?: number;
|
|
46
52
|
readonly workspaceRoot?: string;
|
|
47
53
|
readonly now?: Date;
|
|
54
|
+
readonly verificationSnapshot?: string;
|
|
55
|
+
readonly checkedAt?: string;
|
|
48
56
|
};
|
|
49
57
|
|
|
58
|
+
type CoveragePayload = Readonly<{
|
|
59
|
+
readonly rows?: readonly Readonly<Record<string, unknown>>[];
|
|
60
|
+
}>;
|
|
61
|
+
|
|
50
62
|
function stringField(entity: Record<string, unknown>, key: string): string {
|
|
51
63
|
const value = entity[key];
|
|
52
64
|
return typeof value === "string" ? value : "";
|
|
@@ -171,7 +183,7 @@ function sourceFileFor(entity: Record<string, unknown>): string | undefined {
|
|
|
171
183
|
}
|
|
172
184
|
|
|
173
185
|
async function loadKbExtractionResults(
|
|
174
|
-
prolog: Pick<
|
|
186
|
+
prolog: Pick<PrologPort, "query">,
|
|
175
187
|
): Promise<ExtractionResult[]> {
|
|
176
188
|
const entityResult = await prolog.query(
|
|
177
189
|
"findall([Id,Type,Props], kb_entity(Id, Type, Props), Results)",
|
|
@@ -208,6 +220,99 @@ async function loadKbExtractionResults(
|
|
|
208
220
|
});
|
|
209
221
|
}
|
|
210
222
|
|
|
223
|
+
function stringArrayField(value: unknown): readonly string[] | undefined {
|
|
224
|
+
return Array.isArray(value) ? value.map(String) : undefined;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function proofStage(
|
|
228
|
+
row: Readonly<Record<string, unknown>>,
|
|
229
|
+
): Readonly<Record<string, unknown>> | undefined {
|
|
230
|
+
const stages = row.proofStages;
|
|
231
|
+
if (!stages || typeof stages !== "object" || Array.isArray(stages)) {
|
|
232
|
+
return undefined;
|
|
233
|
+
}
|
|
234
|
+
const passingE2e = (stages as Record<string, unknown>).passingE2e;
|
|
235
|
+
return passingE2e &&
|
|
236
|
+
typeof passingE2e === "object" &&
|
|
237
|
+
!Array.isArray(passingE2e)
|
|
238
|
+
? (passingE2e as Readonly<Record<string, unknown>>)
|
|
239
|
+
: undefined;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
async function loadCoverageProofEvidence(
|
|
243
|
+
prolog: Pick<PrologPort, "query">,
|
|
244
|
+
requirementCount: number,
|
|
245
|
+
verificationSnapshot: string | undefined,
|
|
246
|
+
checkedAt: string | undefined,
|
|
247
|
+
): Promise<
|
|
248
|
+
ReadonlyMap<
|
|
249
|
+
string,
|
|
250
|
+
Readonly<{
|
|
251
|
+
readonly proofStatus?: string;
|
|
252
|
+
readonly passingE2eStatus?: string;
|
|
253
|
+
readonly passingE2eTests?: readonly string[];
|
|
254
|
+
readonly receiptGapCodes?: readonly string[];
|
|
255
|
+
}>
|
|
256
|
+
>
|
|
257
|
+
> {
|
|
258
|
+
if (
|
|
259
|
+
verificationSnapshot === undefined ||
|
|
260
|
+
checkedAt === undefined ||
|
|
261
|
+
requirementCount === 0
|
|
262
|
+
) {
|
|
263
|
+
return new Map();
|
|
264
|
+
}
|
|
265
|
+
let payload: CoveragePayload;
|
|
266
|
+
try {
|
|
267
|
+
payload = await runOperationJsonQuery<CoveragePayload>(
|
|
268
|
+
prolog as PrologPort,
|
|
269
|
+
"discovery.pl",
|
|
270
|
+
`discovery:coverage_report_json('req', ${toPrologList([])}, true, true, ${requirementCount}, 0, ${toPrologAtom(verificationSnapshot)}, ${toPrologAtom(checkedAt)}, ${VERIFICATION_RECEIPT_MAX_AGE_SECONDS}, JsonString)`,
|
|
271
|
+
"Quality diagnostic coverage evidence",
|
|
272
|
+
);
|
|
273
|
+
} catch {
|
|
274
|
+
// Quality diagnostics must fail closed when the optional proof readback is
|
|
275
|
+
// unavailable; a failed advisory query must not make kb_check fail.
|
|
276
|
+
return new Map();
|
|
277
|
+
}
|
|
278
|
+
const evidence = new Map<
|
|
279
|
+
string,
|
|
280
|
+
Readonly<{
|
|
281
|
+
readonly proofStatus?: string;
|
|
282
|
+
readonly passingE2eStatus?: string;
|
|
283
|
+
readonly passingE2eTests?: readonly string[];
|
|
284
|
+
readonly receiptGapCodes?: readonly string[];
|
|
285
|
+
}>
|
|
286
|
+
>();
|
|
287
|
+
for (const row of payload.rows ?? []) {
|
|
288
|
+
const id = typeof row.id === "string" ? row.id : undefined;
|
|
289
|
+
if (id === undefined) continue;
|
|
290
|
+
const passingE2e = proofStage(row);
|
|
291
|
+
const proofGaps = stringArrayField(row.proofGaps);
|
|
292
|
+
const passingE2eTests = stringArrayField(passingE2e?.tests);
|
|
293
|
+
evidence.set(id, {
|
|
294
|
+
...(typeof row.proofStatus === "string"
|
|
295
|
+
? { proofStatus: row.proofStatus }
|
|
296
|
+
: {}),
|
|
297
|
+
...(typeof passingE2e?.status === "string"
|
|
298
|
+
? { passingE2eStatus: passingE2e.status }
|
|
299
|
+
: {}),
|
|
300
|
+
...(passingE2eTests !== undefined ? { passingE2eTests } : {}),
|
|
301
|
+
...(proofGaps !== undefined
|
|
302
|
+
? {
|
|
303
|
+
receiptGapCodes: proofGaps.filter(
|
|
304
|
+
(gap) =>
|
|
305
|
+
gap.includes("verification_receipt") ||
|
|
306
|
+
gap.includes("verification_contract") ||
|
|
307
|
+
gap.includes("verification_snapshot"),
|
|
308
|
+
),
|
|
309
|
+
}
|
|
310
|
+
: {}),
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
return evidence;
|
|
314
|
+
}
|
|
315
|
+
|
|
211
316
|
function capDiagnostics(
|
|
212
317
|
diagnostics: readonly QualityDiagnostic[],
|
|
213
318
|
maxDiagnostics: number | undefined,
|
|
@@ -282,8 +387,16 @@ export async function collectFullKbQualityDiagnostics(
|
|
|
282
387
|
options.now ?? new Date(),
|
|
283
388
|
),
|
|
284
389
|
]);
|
|
285
|
-
const
|
|
286
|
-
|
|
390
|
+
const proofEvidence = await loadCoverageProofEvidence(
|
|
391
|
+
options.prolog,
|
|
392
|
+
manifestResults.filter((result) => result.entity.type === "req").length,
|
|
393
|
+
options.verificationSnapshot,
|
|
394
|
+
options.checkedAt,
|
|
395
|
+
);
|
|
396
|
+
const coverageDepthDiagnostics = createCoverageDepthQualityDiagnostics(
|
|
397
|
+
manifestResults,
|
|
398
|
+
proofEvidence,
|
|
399
|
+
);
|
|
287
400
|
const diagnostics = [
|
|
288
401
|
...telemetryDiagnostics,
|
|
289
402
|
...createRequirementQualityDiagnostics({
|
|
@@ -3,7 +3,7 @@ import * as path from "node:path";
|
|
|
3
3
|
import { extractFromManifest } from "../../extractors/manifest.js";
|
|
4
4
|
import type { ExtractionResult } from "../../extractors/markdown.js";
|
|
5
5
|
import type { ManifestLookup } from "../../traceability/symbol-extract.js";
|
|
6
|
-
import {
|
|
6
|
+
import { CANONICAL_ENTITY_PATHS } from "../../utils/kb-paths.js";
|
|
7
7
|
import { isTraceabilityRelationshipType } from "../symbol-granularity.js";
|
|
8
8
|
import { normalizeSourceFile } from "./source-changes.js";
|
|
9
9
|
import type { TraceabilityRelationship } from "./types.js";
|
|
@@ -19,9 +19,7 @@ function toTraceabilityRelationships(
|
|
|
19
19
|
export function readImpactManifestResults(
|
|
20
20
|
workspaceRoot: string,
|
|
21
21
|
): readonly ExtractionResult[] {
|
|
22
|
-
const
|
|
23
|
-
const symbolsPath = config.paths.symbols;
|
|
24
|
-
if (!symbolsPath) return [];
|
|
22
|
+
const symbolsPath = CANONICAL_ENTITY_PATHS.symbols;
|
|
25
23
|
|
|
26
24
|
const absolutePath = path.isAbsolute(symbolsPath)
|
|
27
25
|
? symbolsPath
|
|
@@ -2,5 +2,13 @@ export function isOperationalArtifactPath(pathLike: string): boolean {
|
|
|
2
2
|
// implements REQ-001
|
|
3
3
|
const normalized = pathLike.replaceAll("\\", "/");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// Recovery journals and pending-source receipts are runtime-owned
|
|
6
|
+
// operational state. They must remain visible to Kibi's recovery/status
|
|
7
|
+
// services, but they are not authored evidence and must not make a Git
|
|
8
|
+
// verification snapshot dirty or enter source compilation as arbitrary
|
|
9
|
+
// untracked files.
|
|
10
|
+
return (
|
|
11
|
+
/(^|\/)\.sisyphus\//.test(normalized) ||
|
|
12
|
+
/(^|\/)\.kb\/recovery(?:\/|$)/.test(normalized)
|
|
13
|
+
);
|
|
6
14
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
OPERATION_DATA_SCHEMAS,
|
|
3
|
+
type OperationJsonSchema,
|
|
4
|
+
declaredEffects,
|
|
5
|
+
} from "./contracts.js";
|
|
6
|
+
import { planBootstrapSpec } from "./specs/bootstrap.js";
|
|
2
7
|
import { checkSpec } from "./specs/check.js";
|
|
3
8
|
import { querySpec, searchSpec, statusSpec } from "./specs/discovery.js";
|
|
4
9
|
import {
|
|
@@ -10,6 +15,7 @@ import {
|
|
|
10
15
|
upsertSpec,
|
|
11
16
|
validateUpsertSpec,
|
|
12
17
|
} from "./specs/mutation.js";
|
|
18
|
+
import { applyPlanSpec, compileIntentSpec } from "./specs/planning.js";
|
|
13
19
|
import { coverageSpec, findGapsSpec, graphSpec } from "./specs/reporting.js";
|
|
14
20
|
import { semanticAdvisorSpec } from "./specs/semantic.js";
|
|
15
21
|
import {
|
|
@@ -18,7 +24,12 @@ import {
|
|
|
18
24
|
skillsReadSpec,
|
|
19
25
|
} from "./specs/skills.js";
|
|
20
26
|
import { sparqlRemoteSpec } from "./specs/sparql.js";
|
|
21
|
-
import
|
|
27
|
+
import { ingestVerificationSpec } from "./specs/verification.js";
|
|
28
|
+
import type {
|
|
29
|
+
OperationName,
|
|
30
|
+
OperationSpec,
|
|
31
|
+
ResolvedOperationSpec,
|
|
32
|
+
} from "./types.js";
|
|
22
33
|
|
|
23
34
|
export const OPERATION_CATALOG = [
|
|
24
35
|
skillsListSpec,
|
|
@@ -33,20 +44,146 @@ export const OPERATION_CATALOG = [
|
|
|
33
44
|
semanticAdvisorSpec,
|
|
34
45
|
modelRequirementSpec,
|
|
35
46
|
suggestPredicatesSpec,
|
|
36
|
-
|
|
47
|
+
planBootstrapSpec,
|
|
37
48
|
validateUpsertSpec,
|
|
38
49
|
upsertSpec,
|
|
39
50
|
deleteSpec,
|
|
40
51
|
checkSpec,
|
|
41
52
|
sparqlRemoteSpec,
|
|
53
|
+
compileIntentSpec,
|
|
54
|
+
applyPlanSpec,
|
|
55
|
+
ingestVerificationSpec,
|
|
42
56
|
] as const satisfies readonly OperationSpec[];
|
|
43
57
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
58
|
+
function envelopeSchema(
|
|
59
|
+
spec: OperationSpec,
|
|
60
|
+
resultVersion: string,
|
|
61
|
+
): OperationJsonSchema {
|
|
62
|
+
const data = OPERATION_DATA_SCHEMAS[spec.name];
|
|
63
|
+
if (!data) throw new Error(`Missing output contract for ${spec.name}`);
|
|
64
|
+
return {
|
|
65
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
66
|
+
type: "object",
|
|
67
|
+
additionalProperties: false,
|
|
68
|
+
required: [
|
|
69
|
+
"kibiProtocol",
|
|
70
|
+
"operation",
|
|
71
|
+
"resultVersion",
|
|
72
|
+
"status",
|
|
73
|
+
"data",
|
|
74
|
+
"effects",
|
|
75
|
+
"diagnostics",
|
|
76
|
+
"nextActions",
|
|
77
|
+
],
|
|
78
|
+
properties: {
|
|
79
|
+
kibiProtocol: { const: 1 },
|
|
80
|
+
operation: { const: spec.name },
|
|
81
|
+
resultVersion: { const: resultVersion },
|
|
82
|
+
status: { enum: ["success", "committed_with_repairs", "error"] },
|
|
83
|
+
data,
|
|
84
|
+
effects: {
|
|
85
|
+
type: "array",
|
|
86
|
+
minItems: spec.effects.length,
|
|
87
|
+
items: {
|
|
88
|
+
type: "object",
|
|
89
|
+
additionalProperties: false,
|
|
90
|
+
required: ["kind", "status"],
|
|
91
|
+
properties: {
|
|
92
|
+
kind: { type: "string" },
|
|
93
|
+
status: { enum: ["completed", "failed", "not_applicable"] },
|
|
94
|
+
detail: {},
|
|
95
|
+
errorCode: { type: "string" },
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
diagnostics: {
|
|
100
|
+
type: "array",
|
|
101
|
+
items: {
|
|
102
|
+
type: "object",
|
|
103
|
+
additionalProperties: false,
|
|
104
|
+
required: ["message"],
|
|
105
|
+
properties: {
|
|
106
|
+
code: { type: "string" },
|
|
107
|
+
severity: { enum: ["info", "warning", "error"] },
|
|
108
|
+
message: { type: "string" },
|
|
109
|
+
detail: {},
|
|
110
|
+
category: { type: "string" },
|
|
111
|
+
suggestion: { type: "string" },
|
|
112
|
+
file: { type: "string" },
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
nextActions: {
|
|
117
|
+
type: "array",
|
|
118
|
+
items: {
|
|
119
|
+
type: "object",
|
|
120
|
+
additionalProperties: false,
|
|
121
|
+
required: ["operation", "reason", "required"],
|
|
122
|
+
properties: {
|
|
123
|
+
operation: { type: "string" },
|
|
124
|
+
input: {},
|
|
125
|
+
reason: { type: "string" },
|
|
126
|
+
required: { type: "boolean" },
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
error: {
|
|
131
|
+
type: "object",
|
|
132
|
+
additionalProperties: false,
|
|
133
|
+
required: ["code", "message", "retryable"],
|
|
134
|
+
properties: {
|
|
135
|
+
code: { type: "string" },
|
|
136
|
+
message: { type: "string" },
|
|
137
|
+
retryable: { type: "boolean" },
|
|
138
|
+
details: {},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function withContractDefaults(
|
|
146
|
+
spec: OperationSpec,
|
|
147
|
+
): ResolvedOperationSpec {
|
|
148
|
+
const resultVersion = spec.resultVersion ?? `kibi.${spec.name}.v1`;
|
|
149
|
+
// Resolve the generated contract on the canonical spec object itself. The
|
|
150
|
+
// implementation loader and the public catalog must share one identity so
|
|
151
|
+
// adapters cannot accidentally execute an uncontracted compatibility copy.
|
|
152
|
+
const resolved = spec as ResolvedOperationSpec;
|
|
153
|
+
if (resolved.resultVersion === undefined) {
|
|
154
|
+
Object.defineProperty(resolved, "resultVersion", {
|
|
155
|
+
value: resultVersion,
|
|
156
|
+
enumerable: true,
|
|
157
|
+
configurable: false,
|
|
158
|
+
writable: false,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
if (resolved.outputSchema === undefined) {
|
|
162
|
+
Object.defineProperty(resolved, "outputSchema", {
|
|
163
|
+
value: envelopeSchema(spec, resultVersion),
|
|
164
|
+
enumerable: true,
|
|
165
|
+
configurable: false,
|
|
166
|
+
writable: false,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
if (resolved.declaredEffects === undefined) {
|
|
170
|
+
Object.defineProperty(resolved, "declaredEffects", {
|
|
171
|
+
value: declaredEffects(spec.name, spec.effects),
|
|
172
|
+
enumerable: true,
|
|
173
|
+
configurable: false,
|
|
174
|
+
writable: false,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
return resolved;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const SPECS_BY_NAME: ReadonlyMap<OperationName, ResolvedOperationSpec> =
|
|
181
|
+
new Map(
|
|
182
|
+
OPERATION_CATALOG.map((spec) => [spec.name, withContractDefaults(spec)]),
|
|
183
|
+
);
|
|
47
184
|
|
|
48
185
|
// implements REQ-kibi-operation-interface-parity
|
|
49
|
-
export function getSpec(name: OperationName):
|
|
186
|
+
export function getSpec(name: OperationName): ResolvedOperationSpec {
|
|
50
187
|
const spec = SPECS_BY_NAME.get(name);
|
|
51
188
|
if (!spec) {
|
|
52
189
|
throw new RangeError(`Unknown Kibi operation: ${name}`);
|
|
@@ -55,6 +192,6 @@ export function getSpec(name: OperationName): OperationSpec {
|
|
|
55
192
|
}
|
|
56
193
|
|
|
57
194
|
// implements REQ-kibi-operation-interface-parity
|
|
58
|
-
export function listSpecs(): readonly
|
|
59
|
-
return OPERATION_CATALOG;
|
|
195
|
+
export function listSpecs(): readonly ResolvedOperationSpec[] {
|
|
196
|
+
return OPERATION_CATALOG.map(withContractDefaults);
|
|
60
197
|
}
|
|
@@ -28,11 +28,20 @@ import {
|
|
|
28
28
|
analyzeKbCheckImpact,
|
|
29
29
|
collectQueryPlanSafetyViolations,
|
|
30
30
|
getEffectiveRules,
|
|
31
|
-
|
|
31
|
+
partitionCheckFindings,
|
|
32
32
|
qualityDiagnosticsFromImpact,
|
|
33
|
+
resolveCheckRules,
|
|
33
34
|
} from "./check-helpers.js";
|
|
35
|
+
import { executeStatus } from "./discovery-executors.js";
|
|
36
|
+
import {
|
|
37
|
+
buildActionsFromCheck,
|
|
38
|
+
buildMigrationPlan,
|
|
39
|
+
mergeMigrationPlans,
|
|
40
|
+
} from "./migration-plan.js";
|
|
34
41
|
import type { OperationContext, PrologPort } from "./runtime-types.js";
|
|
42
|
+
import { collectSourceRelationshipParityViolations } from "./source-relationship-parity.js";
|
|
35
43
|
import type { OperationResult } from "./types.js";
|
|
44
|
+
import { readWorkspaceSnapshot } from "./workspace-snapshot.js";
|
|
36
45
|
|
|
37
46
|
// implements REQ-kibi-operation-interface-parity, REQ-002
|
|
38
47
|
export type CheckInput = {
|
|
@@ -51,7 +60,7 @@ export {
|
|
|
51
60
|
buildStructuredContent,
|
|
52
61
|
buildSummary,
|
|
53
62
|
getEffectiveRules,
|
|
54
|
-
|
|
63
|
+
resolveCheckRules,
|
|
55
64
|
};
|
|
56
65
|
|
|
57
66
|
export type CheckExecutionOptions = {
|
|
@@ -69,6 +78,45 @@ function invalidatePrologCache(prolog: PrologPort): void {
|
|
|
69
78
|
prolog.invalidateCache?.();
|
|
70
79
|
}
|
|
71
80
|
|
|
81
|
+
async function migrationPlanForCheck(
|
|
82
|
+
context: OperationContext,
|
|
83
|
+
violations: readonly Violation[],
|
|
84
|
+
qualityDiagnostics: readonly Readonly<Record<string, unknown>>[],
|
|
85
|
+
statusPlan?: ReturnType<typeof buildMigrationPlan>,
|
|
86
|
+
) {
|
|
87
|
+
const checkPlan = buildMigrationPlan({
|
|
88
|
+
expected: {
|
|
89
|
+
branch: context.branchAttachment?.gitBranch ?? null,
|
|
90
|
+
kbBranch: context.branchAttachment?.kbBranch ?? null,
|
|
91
|
+
},
|
|
92
|
+
evaluatedDomains: ["quality"],
|
|
93
|
+
actions: buildActionsFromCheck({
|
|
94
|
+
violations: violations as unknown as readonly Readonly<
|
|
95
|
+
Record<string, unknown>
|
|
96
|
+
>[],
|
|
97
|
+
qualityDiagnostics,
|
|
98
|
+
}),
|
|
99
|
+
});
|
|
100
|
+
return statusPlan ? mergeMigrationPlans([statusPlan, checkPlan]) : checkPlan;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async function readStatusMigrationPlan(
|
|
104
|
+
context: OperationContext,
|
|
105
|
+
): Promise<ReturnType<typeof buildMigrationPlan> | undefined> {
|
|
106
|
+
try {
|
|
107
|
+
const statusResult = await executeStatus({}, context);
|
|
108
|
+
return statusResult.structuredContent?.migrationPlan;
|
|
109
|
+
} catch (error) {
|
|
110
|
+
// A check can still provide a complete quality-domain plan in a detached
|
|
111
|
+
// or synthetic workspace used by an agent/test harness. Status remains a
|
|
112
|
+
// separately actionable domain; preserve the check result rather than
|
|
113
|
+
// turning a missing Git attachment into a check failure.
|
|
114
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
115
|
+
if (message.includes("Failed to resolve active branch")) return undefined;
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
72
120
|
// implements REQ-kibi-operation-interface-parity, REQ-002
|
|
73
121
|
export async function executeCheck(
|
|
74
122
|
args: CheckInput,
|
|
@@ -78,13 +126,14 @@ export async function executeCheck(
|
|
|
78
126
|
try {
|
|
79
127
|
const workspaceRoot = args.workspaceRoot ?? context.workspaceRoot;
|
|
80
128
|
const prolog = requireProlog(context);
|
|
81
|
-
const
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
129
|
+
const snapshotEvidence = await readWorkspaceSnapshot(context);
|
|
130
|
+
const verificationSnapshot = snapshotEvidence.available
|
|
131
|
+
? snapshotEvidence.snapshot.hash
|
|
132
|
+
: undefined;
|
|
133
|
+
const checkedAt = context.clock().toISOString();
|
|
134
|
+
// Enforcement policy is Kibi-owned and deterministic from the installed
|
|
135
|
+
// version. `args.rules` is an invocation-time diagnostic selector only.
|
|
136
|
+
const rulesAllowlist = resolveCheckRules(args);
|
|
88
137
|
const hasExplicitRules = args.rules !== undefined;
|
|
89
138
|
const impactResult = analyzeKbCheckImpact(workspaceRoot, args);
|
|
90
139
|
const impactQualityDiagnostics = qualityDiagnosticsFromImpact(impactResult);
|
|
@@ -103,9 +152,22 @@ export async function executeCheck(
|
|
|
103
152
|
: await collectFullKbQualityDiagnostics({
|
|
104
153
|
prolog,
|
|
105
154
|
workspaceRoot,
|
|
155
|
+
...(verificationSnapshot !== undefined
|
|
156
|
+
? { verificationSnapshot }
|
|
157
|
+
: {}),
|
|
158
|
+
checkedAt,
|
|
106
159
|
now: context.clock(),
|
|
107
160
|
...maxDiagnosticsOption,
|
|
108
161
|
});
|
|
162
|
+
const statusPlan = await readStatusMigrationPlan(context);
|
|
163
|
+
const migrationPlan = await migrationPlanForCheck(
|
|
164
|
+
context,
|
|
165
|
+
[],
|
|
166
|
+
qualityDiagnostics as unknown as readonly Readonly<
|
|
167
|
+
Record<string, unknown>
|
|
168
|
+
>[],
|
|
169
|
+
statusPlan,
|
|
170
|
+
);
|
|
109
171
|
return {
|
|
110
172
|
content: [
|
|
111
173
|
{
|
|
@@ -122,24 +184,31 @@ export async function executeCheck(
|
|
|
122
184
|
diagnostics: [],
|
|
123
185
|
qualityDiagnostics,
|
|
124
186
|
impactResult,
|
|
187
|
+
migrationPlan,
|
|
125
188
|
}),
|
|
126
189
|
};
|
|
127
190
|
}
|
|
128
191
|
|
|
129
192
|
invalidatePrologCache(prolog);
|
|
130
193
|
|
|
131
|
-
const
|
|
194
|
+
const aggregatedFindings = await runAggregatedChecks(
|
|
132
195
|
prolog,
|
|
133
196
|
rulesAllowlist,
|
|
134
|
-
checksConfig.symbolTraceability.requireAdr,
|
|
135
197
|
);
|
|
136
198
|
const queryPlanViolations = rulesAllowlist.has("query-plan-safety")
|
|
137
199
|
? collectQueryPlanSafetyViolations()
|
|
138
200
|
: [];
|
|
139
|
-
const
|
|
140
|
-
|
|
201
|
+
const sourceRelationshipParityViolations = rulesAllowlist.has(
|
|
202
|
+
"source-relationship-parity",
|
|
203
|
+
)
|
|
204
|
+
? await collectSourceRelationshipParityViolations(workspaceRoot, prolog)
|
|
205
|
+
: [];
|
|
206
|
+
const partitioned = partitionCheckFindings([
|
|
207
|
+
...aggregatedFindings,
|
|
141
208
|
...queryPlanViolations,
|
|
142
|
-
|
|
209
|
+
...sourceRelationshipParityViolations,
|
|
210
|
+
]);
|
|
211
|
+
const violations: Violation[] = partitioned.violations;
|
|
143
212
|
|
|
144
213
|
const diagnostics: CheckDiagnostic[] = violations.map((v) => ({
|
|
145
214
|
category: "SYNC_ERROR",
|
|
@@ -152,7 +221,7 @@ export async function executeCheck(
|
|
|
152
221
|
const collectFullQualityDiagnostics =
|
|
153
222
|
!hasExplicitRules ||
|
|
154
223
|
options.collectFullQualityDiagnosticsForExplicitRules === true;
|
|
155
|
-
const
|
|
224
|
+
const extraQualityDiagnostics = !collectFullQualityDiagnostics
|
|
156
225
|
? impactQualityDiagnostics
|
|
157
226
|
: impactResult
|
|
158
227
|
? impactQualityDiagnostics
|
|
@@ -160,10 +229,27 @@ export async function executeCheck(
|
|
|
160
229
|
prolog,
|
|
161
230
|
hardViolationEntityIds: new Set(violations.map((v) => v.entityId)),
|
|
162
231
|
workspaceRoot,
|
|
232
|
+
...(verificationSnapshot !== undefined
|
|
233
|
+
? { verificationSnapshot }
|
|
234
|
+
: {}),
|
|
235
|
+
checkedAt,
|
|
163
236
|
now: context.clock(),
|
|
164
237
|
...maxDiagnosticsOption,
|
|
165
238
|
});
|
|
239
|
+
const qualityDiagnostics = [
|
|
240
|
+
...partitioned.qualityDiagnostics,
|
|
241
|
+
...extraQualityDiagnostics,
|
|
242
|
+
];
|
|
166
243
|
|
|
244
|
+
const statusPlan = await readStatusMigrationPlan(context);
|
|
245
|
+
const migrationPlan = await migrationPlanForCheck(
|
|
246
|
+
context,
|
|
247
|
+
violations,
|
|
248
|
+
qualityDiagnostics as unknown as readonly Readonly<
|
|
249
|
+
Record<string, unknown>
|
|
250
|
+
>[],
|
|
251
|
+
statusPlan,
|
|
252
|
+
);
|
|
167
253
|
return {
|
|
168
254
|
content: [
|
|
169
255
|
{
|
|
@@ -180,6 +266,7 @@ export async function executeCheck(
|
|
|
180
266
|
diagnostics,
|
|
181
267
|
qualityDiagnostics,
|
|
182
268
|
impactResult,
|
|
269
|
+
migrationPlan,
|
|
183
270
|
}),
|
|
184
271
|
};
|
|
185
272
|
} catch (error) {
|
|
@@ -18,6 +18,7 @@ import type { Violation } from "../check-types.js";
|
|
|
18
18
|
*/
|
|
19
19
|
import type { ChangedFileImpactResult } from "../impact-diagnostics.js";
|
|
20
20
|
import type { QualityDiagnostic } from "../impact-diagnostics.js";
|
|
21
|
+
import type { MigrationPlan } from "./migration-plan.js";
|
|
21
22
|
|
|
22
23
|
// implements REQ-mcp-tool-check
|
|
23
24
|
export interface CheckDiagnostic {
|
|
@@ -39,6 +40,7 @@ export interface CheckStructuredContent {
|
|
|
39
40
|
readonly extractedSymbols?: ChangedFileImpactResult["extractedSymbols"];
|
|
40
41
|
readonly linkedEntities?: ChangedFileImpactResult["linkedEntities"];
|
|
41
42
|
readonly nextActions?: ChangedFileImpactResult["nextActions"];
|
|
43
|
+
readonly migrationPlan?: MigrationPlan;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
function formatDiagnostics(diagnostics: readonly CheckDiagnostic[]) {
|
|
@@ -140,6 +142,7 @@ export function buildStructuredContent(input: {
|
|
|
140
142
|
diagnostics: readonly CheckDiagnostic[];
|
|
141
143
|
qualityDiagnostics?: readonly QualityDiagnostic[];
|
|
142
144
|
impactResult: ChangedFileImpactResult | undefined;
|
|
145
|
+
migrationPlan?: MigrationPlan;
|
|
143
146
|
}): CheckStructuredContent {
|
|
144
147
|
const qualityDiagnostics = input.qualityDiagnostics ?? [];
|
|
145
148
|
return {
|
|
@@ -158,6 +161,9 @@ export function buildStructuredContent(input: {
|
|
|
158
161
|
nextActions: input.impactResult.nextActions,
|
|
159
162
|
}
|
|
160
163
|
: {}),
|
|
164
|
+
...(input.migrationPlan !== undefined
|
|
165
|
+
? { migrationPlan: input.migrationPlan }
|
|
166
|
+
: {}),
|
|
161
167
|
};
|
|
162
168
|
}
|
|
163
169
|
|