kibi-cli 0.19.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-operation-loader.d.ts.map +1 -1
- package/dist/cli-operation-loader.js +53 -20
- package/dist/cli-operation-metadata.d.ts +20 -8
- package/dist/cli-operation-metadata.d.ts.map +1 -1
- package/dist/cli-operation-metadata.js +23 -8
- package/dist/cli-protocol.d.ts.map +1 -1
- package/dist/cli-protocol.js +38 -8
- package/dist/cli-register-foundation.d.ts.map +1 -1
- package/dist/cli-register-foundation.js +14 -2
- package/dist/cli-register-maintenance.d.ts.map +1 -1
- package/dist/cli-register-maintenance.js +26 -4
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +10 -0
- package/dist/cli-register-verification.d.ts +3 -0
- package/dist/cli-register-verification.d.ts.map +1 -0
- package/dist/cli-register-verification.js +16 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/commands/aggregated-checks.d.ts +1 -2
- package/dist/commands/aggregated-checks.d.ts.map +1 -1
- package/dist/commands/aggregated-checks.js +14 -9
- package/dist/commands/branch.d.ts +36 -0
- package/dist/commands/branch.d.ts.map +1 -1
- package/dist/commands/branch.js +371 -40
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +20 -67
- package/dist/commands/discovery-shared.d.ts.map +1 -1
- package/dist/commands/discovery-shared.js +10 -19
- package/dist/commands/doctor.d.ts +4 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +259 -24
- package/dist/commands/engine.d.ts.map +1 -1
- package/dist/commands/engine.js +10 -7
- package/dist/commands/gc.d.ts +5 -2
- package/dist/commands/gc.d.ts.map +1 -1
- package/dist/commands/gc.js +140 -71
- package/dist/commands/github-init.d.ts +56 -0
- package/dist/commands/github-init.d.ts.map +1 -0
- package/dist/commands/github-init.js +310 -0
- package/dist/commands/init-helpers.d.ts +1 -1
- package/dist/commands/init-helpers.d.ts.map +1 -1
- package/dist/commands/init-helpers.js +73 -25
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +79 -24
- package/dist/commands/legacy-storage-migration.d.ts +54 -0
- package/dist/commands/legacy-storage-migration.d.ts.map +1 -0
- package/dist/commands/legacy-storage-migration.js +277 -0
- package/dist/commands/migrate.d.ts +7 -0
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +244 -91
- package/dist/commands/report.d.ts +24 -0
- package/dist/commands/report.d.ts.map +1 -0
- package/dist/commands/report.js +191 -0
- package/dist/commands/sync/cache.d.ts +16 -3
- package/dist/commands/sync/cache.d.ts.map +1 -1
- package/dist/commands/sync/cache.js +111 -4
- package/dist/commands/sync/discovery.d.ts +23 -2
- package/dist/commands/sync/discovery.d.ts.map +1 -1
- package/dist/commands/sync/discovery.js +196 -15
- package/dist/commands/sync/extraction.d.ts +8 -1
- package/dist/commands/sync/extraction.d.ts.map +1 -1
- package/dist/commands/sync/extraction.js +38 -4
- package/dist/commands/sync/manifest.d.ts +8 -5
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +142 -39
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +3 -0
- package/dist/commands/sync.d.ts +6 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +304 -79
- package/dist/commands/verify.d.ts +10 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +126 -0
- package/dist/diagnostics.d.ts +1 -1
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/engine.d.ts +96 -3
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +392 -23
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +5 -6
- package/dist/extractors/manifest.d.ts +8 -1
- package/dist/extractors/manifest.d.ts.map +1 -1
- package/dist/extractors/manifest.js +51 -9
- package/dist/extractors/markdown.d.ts +2 -1
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +21 -3
- package/dist/extractors/playwright-cases.d.ts +24 -0
- package/dist/extractors/playwright-cases.d.ts.map +1 -0
- package/dist/extractors/playwright-cases.js +126 -0
- package/dist/extractors/relationships.d.ts.map +1 -1
- package/dist/extractors/relationships.js +1 -0
- package/dist/extractors/symbol-coordinates.d.ts +81 -3
- package/dist/extractors/symbol-coordinates.d.ts.map +1 -1
- package/dist/extractors/symbol-coordinates.js +389 -51
- package/dist/extractors/symbols-coordinator.js +11 -1
- package/dist/intent-search.d.ts +60 -0
- package/dist/intent-search.d.ts.map +1 -0
- package/dist/intent-search.js +433 -0
- package/dist/operations/bootstrap/activation.d.ts.map +1 -0
- package/dist/operations/{autopilot → bootstrap}/activation.js +48 -31
- package/dist/operations/{autopilot → bootstrap}/candidate-helpers.d.ts.map +1 -1
- package/dist/operations/bootstrap/candidates.d.ts +4 -0
- package/dist/operations/{autopilot → bootstrap}/candidates.d.ts.map +1 -1
- package/dist/operations/{autopilot → bootstrap}/candidates.js +22 -8
- package/dist/operations/{autopilot → bootstrap}/discovery-evidence.d.ts +2 -2
- package/dist/operations/{autopilot → bootstrap}/discovery-evidence.d.ts.map +1 -1
- package/dist/operations/{autopilot → bootstrap}/discovery-evidence.js +46 -6
- package/dist/operations/{autopilot → bootstrap}/discovery.d.ts +1 -1
- package/dist/operations/bootstrap/discovery.d.ts.map +1 -0
- package/dist/operations/{autopilot → bootstrap}/discovery.js +21 -14
- package/dist/operations/bootstrap/generate.d.ts +8 -0
- package/dist/operations/bootstrap/generate.d.ts.map +1 -0
- package/dist/operations/bootstrap/generate.js +204 -0
- package/dist/operations/{autopilot → bootstrap}/guidance-actions.d.ts +2 -2
- package/dist/operations/{autopilot → bootstrap}/guidance-actions.d.ts.map +1 -1
- package/dist/operations/{autopilot → bootstrap}/guidance-actions.js +4 -4
- package/dist/operations/{autopilot → bootstrap}/guidance.d.ts +2 -2
- package/dist/operations/{autopilot → bootstrap}/guidance.d.ts.map +1 -1
- package/dist/operations/{autopilot → bootstrap}/guidance.js +2 -0
- package/dist/operations/{autopilot → bootstrap}/markdown-candidates.d.ts +2 -2
- package/dist/operations/{autopilot → bootstrap}/markdown-candidates.d.ts.map +1 -1
- package/dist/operations/{autopilot → bootstrap}/markdown-candidates.js +4 -3
- package/dist/operations/bootstrap/presentation.d.ts +15 -0
- package/dist/operations/bootstrap/presentation.d.ts.map +1 -0
- package/dist/operations/bootstrap/presentation.js +177 -0
- package/dist/operations/{autopilot → bootstrap}/requirement-claims.d.ts.map +1 -1
- package/dist/operations/{autopilot → bootstrap}/types.d.ts +63 -21
- package/dist/operations/bootstrap/types.d.ts.map +1 -0
- package/dist/operations/bootstrap/types.js +25 -0
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +4 -17
- package/dist/operations/modeling/predicate-applicability.d.ts +16 -0
- package/dist/operations/modeling/predicate-applicability.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-applicability.js +276 -0
- package/dist/operations/modeling/predicate-applyplan.d.ts +13 -2
- package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applyplan.js +100 -3
- package/dist/operations/modeling/predicate-bindings.d.ts +6 -0
- package/dist/operations/modeling/predicate-bindings.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-bindings.js +122 -0
- package/dist/operations/modeling/predicate-catalog-4.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog-4.js +155 -0
- package/dist/operations/modeling/predicate-inference-1.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-inference-1.js +8 -0
- package/dist/operations/modeling/predicate-inference-launcher.d.ts +10 -0
- package/dist/operations/modeling/predicate-inference-launcher.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-inference-launcher.js +13 -0
- package/dist/operations/modeling/predicate-inference.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-inference.js +4 -0
- package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-loader.js +7 -0
- package/dist/operations/modeling/predicate-ranker.d.ts +8 -1
- package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-ranker.js +156 -24
- package/dist/operations/modeling/predicate-score-3.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-score-3.js +6 -0
- package/dist/operations/modeling/predicate-types.d.ts +34 -0
- package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-usage-hints-3.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-usage-hints-3.js +40 -0
- package/dist/operations/modeling/predicate-utils.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-utils.js +2 -0
- package/dist/operations/modeling/suggest-predicates.d.ts +1 -1
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.js +170 -32
- package/dist/operations/mutation/delete.d.ts.map +1 -1
- package/dist/operations/mutation/delete.js +415 -19
- package/dist/operations/mutation/entity-projection.d.ts +11 -0
- package/dist/operations/mutation/entity-projection.d.ts.map +1 -0
- package/dist/operations/mutation/entity-projection.js +14 -0
- package/dist/operations/mutation/relationships.d.ts +10 -0
- package/dist/operations/mutation/relationships.d.ts.map +1 -1
- package/dist/operations/mutation/relationships.js +71 -1
- package/dist/operations/mutation/serialization.d.ts.map +1 -1
- package/dist/operations/mutation/serialization.js +1 -0
- package/dist/operations/mutation/source-authoring.d.ts +61 -0
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -0
- package/dist/operations/mutation/source-authoring.js +543 -0
- package/dist/operations/mutation/symbol-compiler-lock.d.ts +51 -0
- package/dist/operations/mutation/symbol-compiler-lock.d.ts.map +1 -0
- package/dist/operations/mutation/symbol-compiler-lock.js +274 -0
- package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-granularity.js +34 -3
- package/dist/operations/mutation/symbol-refresh.d.ts +18 -1
- package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-refresh.js +225 -63
- package/dist/operations/mutation/types.d.ts +57 -1
- package/dist/operations/mutation/types.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +363 -24
- package/dist/operations/mutation/validation.d.ts.map +1 -1
- package/dist/operations/mutation/validation.js +1 -0
- package/dist/operations/planning/apply-plan.d.ts +117 -0
- package/dist/operations/planning/apply-plan.d.ts.map +1 -0
- package/dist/operations/planning/apply-plan.js +1437 -0
- package/dist/operations/planning/compile-intent.d.ts +106 -0
- package/dist/operations/planning/compile-intent.d.ts.map +1 -0
- package/dist/operations/planning/compile-intent.js +562 -0
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +6 -2
- package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/clauses.js +15 -2
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/ingestion-boundary.js +7 -3
- package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts +51 -0
- package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/predicate-rules-launcher.js +96 -0
- package/dist/operations/semantic-advisor/types.d.ts +13 -5
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
- package/dist/operations/verification/ingest-verification.d.ts +29 -0
- package/dist/operations/verification/ingest-verification.d.ts.map +1 -0
- package/dist/operations/verification/ingest-verification.js +192 -0
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +2 -1
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +27 -8
- package/dist/public/branch-resolver.d.ts +1 -0
- package/dist/public/branch-resolver.d.ts.map +1 -1
- package/dist/public/branch-resolver.js +1 -0
- package/dist/public/check-types.d.ts +2 -2
- package/dist/public/check-types.d.ts.map +1 -1
- package/dist/public/check-types.js +16 -16
- package/dist/public/diagnostic-usage.d.ts.map +1 -1
- package/dist/public/diagnostic-usage.js +69 -1
- package/dist/public/distribution-parity.d.ts +1 -1
- package/dist/public/distribution-parity.d.ts.map +1 -1
- package/dist/public/distribution-parity.js +1 -0
- package/dist/public/ignore-policy.d.ts.map +1 -1
- package/dist/public/ignore-policy.js +16 -4
- package/dist/public/impact/coverage-depth-quality.d.ts +6 -1
- package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
- package/dist/public/impact/coverage-depth-quality.js +21 -3
- package/dist/public/impact/full-kb-quality.d.ts +4 -2
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +61 -1
- package/dist/public/impact/manifest.d.ts.map +1 -1
- package/dist/public/impact/manifest.js +2 -5
- package/dist/public/operational-artifacts.d.ts.map +1 -1
- package/dist/public/operational-artifacts.js +7 -1
- package/dist/public/operations/catalog.d.ts +682 -67
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/catalog.js +126 -4
- package/dist/public/operations/check-executor.d.ts +2 -2
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +72 -13
- package/dist/public/operations/check-format-shared.d.ts +3 -0
- package/dist/public/operations/check-format-shared.d.ts.map +1 -1
- package/dist/public/operations/check-format-shared.js +3 -0
- package/dist/public/operations/check-helpers.d.ts +27 -2
- package/dist/public/operations/check-helpers.d.ts.map +1 -1
- package/dist/public/operations/check-helpers.js +62 -26
- package/dist/public/operations/contracts.d.ts +11 -0
- package/dist/public/operations/contracts.d.ts.map +1 -0
- package/dist/public/operations/contracts.js +325 -0
- package/dist/public/operations/discovery-executors.d.ts +37 -1
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +206 -6
- package/dist/public/operations/index.d.ts +9 -4
- package/dist/public/operations/index.d.ts.map +1 -1
- package/dist/public/operations/index.js +8 -3
- package/dist/public/operations/migration-plan.d.ts +101 -0
- package/dist/public/operations/migration-plan.d.ts.map +1 -0
- package/dist/public/operations/migration-plan.js +537 -0
- package/dist/public/operations/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +68 -8
- package/dist/public/operations/prolog-json.d.ts +14 -0
- package/dist/public/operations/prolog-json.d.ts.map +1 -1
- package/dist/public/operations/prolog-json.js +44 -5
- package/dist/public/operations/repair-plan.d.ts.map +1 -1
- package/dist/public/operations/repair-plan.js +1 -0
- package/dist/public/operations/result-envelope.d.ts +13 -0
- package/dist/public/operations/result-envelope.d.ts.map +1 -0
- package/dist/public/operations/result-envelope.js +104 -0
- package/dist/public/operations/runtime-types.d.ts +97 -7
- package/dist/public/operations/runtime-types.d.ts.map +1 -1
- package/dist/public/operations/source-relationship-parity.d.ts +13 -0
- package/dist/public/operations/source-relationship-parity.d.ts.map +1 -0
- package/dist/public/operations/source-relationship-parity.js +162 -0
- package/dist/public/operations/specs/{autopilot.d.ts → bootstrap.d.ts} +9 -9
- package/dist/public/operations/specs/bootstrap.d.ts.map +1 -0
- package/dist/public/operations/specs/{autopilot.js → bootstrap.js} +8 -7
- package/dist/public/operations/specs/check.d.ts +4 -4
- package/dist/public/operations/specs/check.d.ts.map +1 -1
- package/dist/public/operations/specs/check.js +4 -3
- package/dist/public/operations/specs/discovery.d.ts +87 -3
- package/dist/public/operations/specs/discovery.d.ts.map +1 -1
- package/dist/public/operations/specs/discovery.js +53 -3
- package/dist/public/operations/specs/modeling.d.ts +3 -3
- package/dist/public/operations/specs/modeling.js +3 -3
- package/dist/public/operations/specs/mutation-schemas.d.ts +190 -47
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +3 -1
- package/dist/public/operations/specs/mutation.d.ts +42 -2
- package/dist/public/operations/specs/mutation.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation.js +26 -2
- package/dist/public/operations/specs/planning.d.ts +270 -0
- package/dist/public/operations/specs/planning.d.ts.map +1 -0
- package/dist/public/operations/specs/planning.js +191 -0
- package/dist/public/operations/specs/reporting.d.ts +4 -1
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +46 -1
- package/dist/public/operations/specs/upsert.d.ts +204 -47
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/specs/upsert.js +9 -0
- package/dist/public/operations/specs/verification.d.ts +78 -0
- package/dist/public/operations/specs/verification.d.ts.map +1 -0
- package/dist/public/operations/specs/verification.js +62 -0
- package/dist/public/operations/symbol-repair-plan.d.ts +11 -0
- package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -0
- package/dist/public/operations/symbol-repair-plan.js +123 -0
- package/dist/public/operations/types.d.ts +52 -1
- package/dist/public/operations/types.d.ts.map +1 -1
- package/dist/public/playwright-case-id.d.ts +8 -0
- package/dist/public/playwright-case-id.d.ts.map +1 -0
- package/dist/public/playwright-case-id.js +25 -0
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +4 -2
- package/dist/public/skills/kibi-bootstrap/SKILL.md +58 -0
- package/dist/public/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
- package/dist/public/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
- package/dist/public/skills/kibi-bootstrap/resources/operation-access.md +5 -0
- package/dist/public/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
- package/dist/public/skills/kibi-freshness/SKILL.md +39 -9
- package/dist/public/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
- package/dist/public/skills/kibi-freshness/resources/operation-access.md +6 -0
- package/dist/public/skills/kibi-freshness/resources/source-authoring.md +7 -0
- package/dist/public/skills/kibi-traceability/SKILL.md +47 -47
- package/dist/public/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
- package/dist/public/skills/kibi-traceability/resources/operation-access.md +5 -0
- package/dist/public/skills/kibi-traceability/resources/source-authoring.md +6 -0
- package/dist/public/skills/kibi-traceability/resources/traceability.md +8 -0
- package/dist/public/skills/kibi-usage/SKILL.md +115 -239
- package/dist/public/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
- package/dist/public/skills/kibi-usage/resources/kb-improvement.md +38 -0
- package/dist/public/skills/kibi-usage/resources/operation-access.md +36 -38
- package/dist/public/skills/kibi-usage/resources/relationship-directions.md +3 -3
- package/dist/public/skills/kibi-usage/resources/source-authoring.md +31 -0
- package/dist/public/skills/kibi-usage/resources/workflows.md +56 -3
- package/dist/public/symbol-granularity.d.ts +1 -1
- package/dist/public/symbol-granularity.d.ts.map +1 -1
- package/dist/public/symbol-granularity.js +1 -0
- package/dist/public/telemetry-acceptance.d.ts +7 -0
- package/dist/public/telemetry-acceptance.d.ts.map +1 -1
- package/dist/public/telemetry-acceptance.js +8 -1
- package/dist/public/telemetry-remediation.js +1 -1
- package/dist/public/verification-receipt.d.ts +206 -39
- package/dist/public/verification-receipt.d.ts.map +1 -1
- package/dist/public/verification-receipt.js +171 -4
- package/dist/relationships/shards.d.ts +16 -0
- package/dist/relationships/shards.d.ts.map +1 -1
- package/dist/relationships/shards.js +87 -2
- package/dist/report/brand.d.ts +19 -0
- package/dist/report/brand.d.ts.map +1 -0
- package/dist/report/brand.js +112 -0
- package/dist/report/html-report.d.ts +19 -0
- package/dist/report/html-report.d.ts.map +1 -0
- package/dist/report/html-report.js +963 -0
- package/dist/report/relative-time.d.ts +4 -0
- package/dist/report/relative-time.d.ts.map +1 -0
- package/dist/report/relative-time.js +46 -0
- package/dist/report/report-view.d.ts +17 -0
- package/dist/report/report-view.d.ts.map +1 -0
- package/dist/report/report-view.js +33 -0
- package/dist/report/repository.d.ts +35 -0
- package/dist/report/repository.d.ts.map +1 -0
- package/dist/report/repository.js +151 -0
- package/dist/runtime/cli-runtime.d.ts.map +1 -1
- package/dist/runtime/cli-runtime.js +82 -22
- package/dist/schemas/entity.schema.json +1148 -273
- package/dist/traceability/evidence-model.d.ts +2 -2
- package/dist/traceability/evidence-model.d.ts.map +1 -1
- package/dist/traceability/evidence-model.js +2 -2
- package/dist/traceability/git-staged.d.ts.map +1 -1
- package/dist/traceability/git-staged.js +15 -40
- package/dist/traceability/markdown-validate.d.ts.map +1 -1
- package/dist/traceability/markdown-validate.js +12 -7
- package/dist/traceability/staged-impact-contract.d.ts +3 -3
- package/dist/traceability/staged-impact-contract.d.ts.map +1 -1
- package/dist/traceability/staged-impact-contract.js +10 -38
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +8 -3
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +3 -0
- package/dist/types/entities.d.ts +3 -0
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/utils/branch-resolver.d.ts +24 -10
- package/dist/utils/branch-resolver.d.ts.map +1 -1
- package/dist/utils/branch-resolver.js +121 -38
- package/dist/utils/branch-store-locator.d.ts +23 -0
- package/dist/utils/branch-store-locator.d.ts.map +1 -0
- package/dist/utils/branch-store-locator.js +90 -0
- package/dist/utils/branch-store.d.ts +15 -0
- package/dist/utils/branch-store.d.ts.map +1 -0
- package/dist/utils/branch-store.js +130 -0
- package/dist/utils/config.d.ts +39 -37
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +107 -119
- package/dist/utils/kb-manifest.d.ts +35 -0
- package/dist/utils/kb-manifest.d.ts.map +1 -0
- package/dist/utils/kb-manifest.js +154 -0
- package/dist/utils/kb-paths.d.ts +54 -0
- package/dist/utils/kb-paths.d.ts.map +1 -0
- package/dist/utils/kb-paths.js +125 -0
- package/dist/utils/manifest-paths.d.ts +4 -4
- package/dist/utils/manifest-paths.d.ts.map +1 -1
- package/dist/utils/manifest-paths.js +8 -56
- package/dist/utils/rule-registry.d.ts +48 -20
- package/dist/utils/rule-registry.d.ts.map +1 -1
- package/dist/utils/rule-registry.js +82 -77
- package/dist/utils/schema-version.d.ts +5 -5
- package/dist/utils/schema-version.d.ts.map +1 -1
- package/dist/utils/schema-version.js +26 -6
- package/dist/utils/strict-modeling.d.ts +0 -4
- package/dist/utils/strict-modeling.d.ts.map +1 -1
- package/dist/utils/strict-modeling.js +7 -8
- package/dist/verification/playwright-reporter.d.ts +21 -0
- package/dist/verification/playwright-reporter.d.ts.map +1 -0
- package/dist/verification/playwright-reporter.js +114 -0
- package/package.json +46 -7
- package/schema/config.json +2 -2
- package/schema/manifest.json +26 -0
- package/src/public/branch-resolver.ts +1 -0
- package/src/public/check-types.ts +22 -19
- package/src/public/diagnostic-usage.ts +79 -1
- package/src/public/distribution-parity.ts +1 -0
- package/src/public/ignore-policy.ts +16 -10
- package/src/public/impact/coverage-depth-quality.ts +36 -0
- package/src/public/impact/full-kb-quality.ts +118 -5
- package/src/public/impact/manifest.ts +2 -4
- package/src/public/operational-artifacts.ts +9 -1
- package/src/public/operations/catalog.ts +146 -9
- package/src/public/operations/check-executor.ts +102 -15
- package/src/public/operations/check-format-shared.ts +6 -0
- package/src/public/operations/check-helpers.ts +74 -35
- package/src/public/operations/contracts.ts +366 -0
- package/src/public/operations/discovery-executors.ts +299 -12
- package/src/public/operations/index.ts +9 -4
- package/src/public/operations/migration-plan.ts +740 -0
- package/src/public/operations/node-ports.ts +84 -10
- package/src/public/operations/prolog-json.ts +60 -5
- package/src/public/operations/repair-plan.ts +1 -0
- package/src/public/operations/result-envelope.ts +136 -0
- package/src/public/operations/runtime-types.ts +91 -5
- package/src/public/operations/source-relationship-parity.ts +226 -0
- package/src/public/operations/specs/{autopilot.ts → bootstrap.ts} +17 -16
- package/src/public/operations/specs/check.ts +4 -3
- package/src/public/operations/specs/discovery.ts +57 -3
- package/src/public/operations/specs/modeling.ts +3 -3
- package/src/public/operations/specs/mutation-schemas.ts +6 -1
- package/src/public/operations/specs/mutation.ts +27 -2
- package/src/public/operations/specs/planning.ts +234 -0
- package/src/public/operations/specs/reporting.ts +55 -1
- package/src/public/operations/specs/upsert.ts +10 -0
- package/src/public/operations/specs/verification.ts +78 -0
- package/src/public/operations/symbol-repair-plan.ts +164 -0
- package/src/public/operations/types.ts +62 -1
- package/src/public/playwright-case-id.ts +35 -0
- package/src/public/schemas/entity.ts +7 -2
- package/src/public/skills/kibi-bootstrap/SKILL.md +58 -0
- package/src/public/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
- package/src/public/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
- package/src/public/skills/kibi-bootstrap/resources/operation-access.md +5 -0
- package/src/public/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
- package/src/public/skills/kibi-freshness/SKILL.md +39 -9
- package/src/public/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
- package/src/public/skills/kibi-freshness/resources/operation-access.md +6 -0
- package/src/public/skills/kibi-freshness/resources/source-authoring.md +7 -0
- package/src/public/skills/kibi-traceability/SKILL.md +47 -47
- package/src/public/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
- package/src/public/skills/kibi-traceability/resources/operation-access.md +5 -0
- package/src/public/skills/kibi-traceability/resources/source-authoring.md +6 -0
- package/src/public/skills/kibi-traceability/resources/traceability.md +8 -0
- package/src/public/skills/kibi-usage/SKILL.md +115 -239
- package/src/public/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
- package/src/public/skills/kibi-usage/resources/kb-improvement.md +38 -0
- package/src/public/skills/kibi-usage/resources/operation-access.md +36 -38
- package/src/public/skills/kibi-usage/resources/relationship-directions.md +3 -3
- package/src/public/skills/kibi-usage/resources/source-authoring.md +31 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +56 -3
- package/src/public/symbol-granularity.ts +1 -0
- package/src/public/telemetry-acceptance.ts +16 -1
- package/src/public/telemetry-remediation.ts +1 -1
- package/src/public/verification-receipt.ts +248 -6
- package/src/schemas/entity.schema.json +1148 -273
- package/templates/github/kibi-badge.yml +86 -0
- package/templates/github/kibi-report.yml +84 -0
- package/dist/operations/autopilot/activation.d.ts.map +0 -1
- package/dist/operations/autopilot/candidates.d.ts +0 -4
- package/dist/operations/autopilot/discovery.d.ts.map +0 -1
- package/dist/operations/autopilot/generate.d.ts +0 -8
- package/dist/operations/autopilot/generate.d.ts.map +0 -1
- package/dist/operations/autopilot/generate.js +0 -112
- package/dist/operations/autopilot/presentation.d.ts +0 -13
- package/dist/operations/autopilot/presentation.d.ts.map +0 -1
- package/dist/operations/autopilot/presentation.js +0 -91
- package/dist/operations/autopilot/types.d.ts.map +0 -1
- package/dist/operations/autopilot/types.js +0 -8
- package/dist/public/operations/specs/autopilot.d.ts.map +0 -1
- package/dist/public/skills/init-kibi/SKILL.md +0 -62
- package/src/public/skills/init-kibi/SKILL.md +0 -62
- /package/dist/operations/{autopilot → bootstrap}/activation.d.ts +0 -0
- /package/dist/operations/{autopilot → bootstrap}/candidate-helpers.d.ts +0 -0
- /package/dist/operations/{autopilot → bootstrap}/candidate-helpers.js +0 -0
- /package/dist/operations/{autopilot → bootstrap}/requirement-claims.d.ts +0 -0
- /package/dist/operations/{autopilot → bootstrap}/requirement-claims.js +0 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ApplyPlanArgs,
|
|
3
|
+
type ApplyPlanResult,
|
|
4
|
+
executeApplyPlan,
|
|
5
|
+
} from "../../../operations/planning/apply-plan.js";
|
|
6
|
+
import {
|
|
7
|
+
type CompileIntentArgs,
|
|
8
|
+
type CompilePlanV1,
|
|
9
|
+
executeCompileIntent,
|
|
10
|
+
} from "../../../operations/planning/compile-intent.js";
|
|
11
|
+
import type { OperationSpec } from "../types.js";
|
|
12
|
+
|
|
13
|
+
export type {
|
|
14
|
+
CompileIntentArgs,
|
|
15
|
+
CompilePlanV1,
|
|
16
|
+
ContradictionWitness,
|
|
17
|
+
ProposalDecision,
|
|
18
|
+
ScenarioDraft,
|
|
19
|
+
TestDraft,
|
|
20
|
+
TraceabilityProposal,
|
|
21
|
+
} from "../../../operations/planning/compile-intent.js";
|
|
22
|
+
export type {
|
|
23
|
+
ApplyPlanArgs,
|
|
24
|
+
ApplyPlanResult,
|
|
25
|
+
} from "../../../operations/planning/apply-plan.js";
|
|
26
|
+
export type { MigrationPlan } from "../migration-plan.js";
|
|
27
|
+
export { executeApplyPlan } from "../../../operations/planning/apply-plan.js";
|
|
28
|
+
export { executeCompileIntent } from "../../../operations/planning/compile-intent.js";
|
|
29
|
+
|
|
30
|
+
// implements REQ-kibi-change-to-proof-plan-compiler
|
|
31
|
+
export const compileIntentSpec = {
|
|
32
|
+
name: "kb_compile_intent",
|
|
33
|
+
cliName: "compile-intent",
|
|
34
|
+
description:
|
|
35
|
+
"Compile complete change intent into a deterministic, snapshot-bound read-only plan. Reuses intent-aware discovery and semantic modeling, accounts for every proposition, reports contradiction witnesses, proposes traceability links, and emits dependency-ordered kb_upsert-style steps only for resolved typed claims. No mutation side effects.",
|
|
36
|
+
businessInputSchema: {
|
|
37
|
+
type: "object",
|
|
38
|
+
required: ["intent", "mode"],
|
|
39
|
+
properties: {
|
|
40
|
+
intent: {
|
|
41
|
+
type: "string",
|
|
42
|
+
minLength: 1,
|
|
43
|
+
maxLength: 10000,
|
|
44
|
+
description:
|
|
45
|
+
"Complete post-change normative intent. Send the desired behavior, not a patch fragment.",
|
|
46
|
+
},
|
|
47
|
+
mode: {
|
|
48
|
+
type: "string",
|
|
49
|
+
enum: ["create", "update"],
|
|
50
|
+
description:
|
|
51
|
+
"Create a new requirement or update an existing one. Update auto-selection is allowed only with a high-confidence, well-separated candidate.",
|
|
52
|
+
},
|
|
53
|
+
requirementId: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description:
|
|
56
|
+
"Optional exact requirement ID. Required for an update when automatic selection is below the confidence and margin gates.",
|
|
57
|
+
},
|
|
58
|
+
title: {
|
|
59
|
+
type: "string",
|
|
60
|
+
description:
|
|
61
|
+
"Optional requirement title; existing title is preserved for updates when omitted.",
|
|
62
|
+
},
|
|
63
|
+
clauses: {
|
|
64
|
+
type: "array",
|
|
65
|
+
items: { type: "string", minLength: 1 },
|
|
66
|
+
maxItems: 64,
|
|
67
|
+
description:
|
|
68
|
+
"Optional complete atomic clause decomposition. Each assertive clause receives independent proposition accounting.",
|
|
69
|
+
},
|
|
70
|
+
semanticFacets: {
|
|
71
|
+
type: "object",
|
|
72
|
+
additionalProperties: false,
|
|
73
|
+
properties: {
|
|
74
|
+
actors: { type: "array", items: { type: "string" }, maxItems: 20 },
|
|
75
|
+
actions: { type: "array", items: { type: "string" }, maxItems: 20 },
|
|
76
|
+
objects: { type: "array", items: { type: "string" }, maxItems: 20 },
|
|
77
|
+
constraints: {
|
|
78
|
+
type: "array",
|
|
79
|
+
items: { type: "string" },
|
|
80
|
+
maxItems: 20,
|
|
81
|
+
},
|
|
82
|
+
aliases: { type: "array", items: { type: "string" }, maxItems: 20 },
|
|
83
|
+
},
|
|
84
|
+
description:
|
|
85
|
+
"Host-agent facets forwarded to deterministic intent-v1 discovery.",
|
|
86
|
+
},
|
|
87
|
+
sourceLocations: {
|
|
88
|
+
type: "array",
|
|
89
|
+
maxItems: 20,
|
|
90
|
+
items: {
|
|
91
|
+
type: "object",
|
|
92
|
+
required: ["path"],
|
|
93
|
+
additionalProperties: false,
|
|
94
|
+
properties: {
|
|
95
|
+
path: { type: "string", minLength: 1 },
|
|
96
|
+
line: { type: "integer", minimum: 1 },
|
|
97
|
+
column: { type: "integer", minimum: 1 },
|
|
98
|
+
symbol: { type: "string", minLength: 1 },
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
description:
|
|
102
|
+
"Workspace-relative source coordinates used for discovery and before-hash binding.",
|
|
103
|
+
},
|
|
104
|
+
interpretations: {
|
|
105
|
+
type: "array",
|
|
106
|
+
maxItems: 3,
|
|
107
|
+
items: {
|
|
108
|
+
type: "object",
|
|
109
|
+
required: ["claim_key", "claim_text", "ir"],
|
|
110
|
+
properties: {
|
|
111
|
+
claim_key: { type: "string" },
|
|
112
|
+
claim_text: { type: "string" },
|
|
113
|
+
confidence: { type: "number", minimum: 0, maximum: 1 },
|
|
114
|
+
span: { type: "object" },
|
|
115
|
+
ir: { type: "object" },
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
description:
|
|
119
|
+
"Optional host-supplied typed kibi.logic.v1 interpretations; Kibi validates them before including rule steps.",
|
|
120
|
+
},
|
|
121
|
+
scenarioDrafts: {
|
|
122
|
+
type: "array",
|
|
123
|
+
maxItems: 20,
|
|
124
|
+
items: {
|
|
125
|
+
type: "object",
|
|
126
|
+
required: ["title", "body"],
|
|
127
|
+
properties: {
|
|
128
|
+
id: { type: "string" },
|
|
129
|
+
title: { type: "string", minLength: 1 },
|
|
130
|
+
body: { type: "string", minLength: 1 },
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
description:
|
|
134
|
+
"Optional scenario drafts. Each is linked requirement -> scenario with specified_by.",
|
|
135
|
+
},
|
|
136
|
+
testDrafts: {
|
|
137
|
+
type: "array",
|
|
138
|
+
maxItems: 20,
|
|
139
|
+
items: {
|
|
140
|
+
type: "object",
|
|
141
|
+
required: ["title", "body"],
|
|
142
|
+
properties: {
|
|
143
|
+
id: { type: "string" },
|
|
144
|
+
title: { type: "string", minLength: 1 },
|
|
145
|
+
body: { type: "string", minLength: 1 },
|
|
146
|
+
verificationScope: {
|
|
147
|
+
type: "string",
|
|
148
|
+
enum: ["unit", "integration", "end_to_end"],
|
|
149
|
+
},
|
|
150
|
+
verificationPerspective: {
|
|
151
|
+
type: "string",
|
|
152
|
+
enum: ["internal", "consumer"],
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
description:
|
|
157
|
+
"Optional test drafts. Tests are attached to scenarios with verified_by; direct req -> test proof links are not emitted.",
|
|
158
|
+
},
|
|
159
|
+
proposalDecisions: {
|
|
160
|
+
type: "array",
|
|
161
|
+
maxItems: 20,
|
|
162
|
+
items: {
|
|
163
|
+
type: "object",
|
|
164
|
+
required: ["proposalId", "decision"],
|
|
165
|
+
properties: {
|
|
166
|
+
proposalId: { type: "string", minLength: 1 },
|
|
167
|
+
decision: { type: "string", enum: ["accept", "reject"] },
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
description:
|
|
171
|
+
"Explicit decisions for deterministic traceability proposals. Pending proposals never enter steps.",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
requiresProlog: true,
|
|
176
|
+
effects: ["kb-read", "workspace-read"],
|
|
177
|
+
execute: executeCompileIntent,
|
|
178
|
+
} as const satisfies OperationSpec<CompileIntentArgs, CompilePlanV1>;
|
|
179
|
+
|
|
180
|
+
// implements REQ-kibi-change-to-proof-plan-compiler
|
|
181
|
+
export const applyPlanSpec = {
|
|
182
|
+
name: "kb_apply_plan",
|
|
183
|
+
cliName: "apply-plan",
|
|
184
|
+
description:
|
|
185
|
+
"Apply an explicitly approved kibi.bootstrap-plan.v1, kibi.compile-plan.v1, kibi.migration-plan.v2, or entity-deletion plan after revalidating its canonical hash and live snapshots. Bootstrap actions are dependency-ordered, sequential, source-first, and recoverable from a typed journal.",
|
|
186
|
+
businessInputSchema: {
|
|
187
|
+
type: "object",
|
|
188
|
+
oneOf: [
|
|
189
|
+
{
|
|
190
|
+
required: ["plan", "approvedPlanHash"],
|
|
191
|
+
not: { required: ["recoveryJournalId"] },
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
required: ["recoveryJournalId"],
|
|
195
|
+
not: {
|
|
196
|
+
anyOf: [{ required: ["plan"] }, { required: ["approvedPlanHash"] }],
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
properties: {
|
|
201
|
+
approvedPlanHash: {
|
|
202
|
+
type: "string",
|
|
203
|
+
pattern: "^[a-fA-F0-9]{64}$",
|
|
204
|
+
description:
|
|
205
|
+
"Exact SHA-256 planHash returned by kb_plan_bootstrap, kb_compile_intent, or another approved plan after human review.",
|
|
206
|
+
},
|
|
207
|
+
plan: {
|
|
208
|
+
type: "object",
|
|
209
|
+
required: ["version", "planHash"],
|
|
210
|
+
description:
|
|
211
|
+
"The complete kibi.bootstrap-plan.v1, kibi.compile-plan.v1, kibi.migration-plan.v2, or hash-bound kibi.entity-deletion-plan.v1 object. Migration plans require approvedActionIds and reject blocked/non-automatic actions.",
|
|
212
|
+
},
|
|
213
|
+
approvedActionIds: {
|
|
214
|
+
type: "array",
|
|
215
|
+
items: { type: "string", minLength: 1 },
|
|
216
|
+
description:
|
|
217
|
+
"Required for migration-plan.v2. Exact automatic action IDs explicitly approved for this application.",
|
|
218
|
+
},
|
|
219
|
+
recoveryJournalId: {
|
|
220
|
+
type: "string",
|
|
221
|
+
pattern: "^[A-Za-z0-9._-]+$",
|
|
222
|
+
description:
|
|
223
|
+
"Typed recovery journal identifier returned by a committed_with_repairs result. Recovery replays only the immutable journal and never the original plan request.",
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
// Applying an entity-deletion plan must also retract the compiled entity;
|
|
228
|
+
// acquire the branch engine up front so the source commit and compiled
|
|
229
|
+
// retraction run under one capability-scoped operation context. Recovery
|
|
230
|
+
// journals remain usable even when the engine is unavailable.
|
|
231
|
+
requiresProlog: true,
|
|
232
|
+
effects: ["kb-read", "kb-write", "workspace-read", "workspace-write"],
|
|
233
|
+
execute: executeApplyPlan,
|
|
234
|
+
} as const satisfies OperationSpec<ApplyPlanArgs, ApplyPlanResult>;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { VERIFICATION_RECEIPT_MAX_AGE_SECONDS } from "../../verification-receipt.js";
|
|
2
|
+
import { executeStatus } from "../discovery-executors.js";
|
|
2
3
|
import {
|
|
3
4
|
type LegacyMigrationPlan,
|
|
4
5
|
buildLegacyMigrationPlanFromContext,
|
|
5
6
|
} from "../legacy-migration-plan.js";
|
|
7
|
+
import {
|
|
8
|
+
type MigrationPlan,
|
|
9
|
+
buildActionsFromCoverage,
|
|
10
|
+
buildMigrationPlan,
|
|
11
|
+
mergeMigrationPlans,
|
|
12
|
+
} from "../migration-plan.js";
|
|
6
13
|
import {
|
|
7
14
|
runOperationJsonQuery,
|
|
8
15
|
toPrologAtom,
|
|
@@ -10,6 +17,7 @@ import {
|
|
|
10
17
|
} from "../prolog-json.js";
|
|
11
18
|
import { type RepairPlan, buildRepairPlan } from "../repair-plan.js";
|
|
12
19
|
import type { OperationContext } from "../runtime-types.js";
|
|
20
|
+
import { buildSymbolRepairPlan } from "../symbol-repair-plan.js";
|
|
13
21
|
import type { OperationResult, OperationSpec } from "../types.js";
|
|
14
22
|
import { readWorkspaceSnapshot } from "../workspace-snapshot.js";
|
|
15
23
|
|
|
@@ -60,6 +68,8 @@ export type CoveragePayload = {
|
|
|
60
68
|
readonly rows: readonly Readonly<Record<string, unknown>>[];
|
|
61
69
|
readonly repairPlan?: RepairPlan;
|
|
62
70
|
readonly legacyMigrationPlan?: LegacyMigrationPlan;
|
|
71
|
+
readonly symbolRepairPlan?: Readonly<Record<string, unknown>>;
|
|
72
|
+
readonly migrationPlan?: MigrationPlan;
|
|
63
73
|
readonly meta?: Readonly<Record<string, unknown>>;
|
|
64
74
|
};
|
|
65
75
|
|
|
@@ -168,6 +178,10 @@ export async function executeCoverage(
|
|
|
168
178
|
"Coverage execution",
|
|
169
179
|
);
|
|
170
180
|
const repairPlan = buildRepairPlan(payload, input, codeSnapshot);
|
|
181
|
+
const symbolRepairPlan =
|
|
182
|
+
input.by === "symbol"
|
|
183
|
+
? await buildSymbolRepairPlan(payload.rows, context)
|
|
184
|
+
: undefined;
|
|
171
185
|
const legacyMigrationPlan =
|
|
172
186
|
input.includeMigrationPreview === true && repairPlan !== undefined
|
|
173
187
|
? await buildLegacyMigrationPlanFromContext(
|
|
@@ -177,10 +191,50 @@ export async function executeCoverage(
|
|
|
177
191
|
context,
|
|
178
192
|
)
|
|
179
193
|
: undefined;
|
|
194
|
+
// Coverage can still report its complete Prolog-backed domain in a
|
|
195
|
+
// synthetic or non-Git workspace where branch status cannot be resolved.
|
|
196
|
+
// Preserve the coverage plan and let status expose its own branch action
|
|
197
|
+
// when an attachment is available.
|
|
198
|
+
let statusPlan: MigrationPlan | undefined;
|
|
199
|
+
try {
|
|
200
|
+
const statusResult = await executeStatus({}, context);
|
|
201
|
+
statusPlan = statusResult.structuredContent?.migrationPlan;
|
|
202
|
+
} catch (error) {
|
|
203
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
204
|
+
if (!message.includes("Failed to resolve active branch")) throw error;
|
|
205
|
+
}
|
|
206
|
+
const coveragePlan = buildMigrationPlan({
|
|
207
|
+
expected: {
|
|
208
|
+
branch: context.branchAttachment?.gitBranch ?? null,
|
|
209
|
+
kbBranch: context.branchAttachment?.kbBranch ?? null,
|
|
210
|
+
...(typeof payload.meta?.snapshotId === "string"
|
|
211
|
+
? { kbSnapshotId: payload.meta.snapshotId }
|
|
212
|
+
: {}),
|
|
213
|
+
workspaceSnapshot: codeSnapshot,
|
|
214
|
+
},
|
|
215
|
+
evaluatedDomains: ["semantic", "verification", "symbol"],
|
|
216
|
+
incompleteDomains:
|
|
217
|
+
payload.meta?.scopeComplete === false ? ["coverage"] : [],
|
|
218
|
+
actions: buildActionsFromCoverage({
|
|
219
|
+
...(repairPlan !== undefined
|
|
220
|
+
? {
|
|
221
|
+
repairPlan: repairPlan as unknown as Readonly<
|
|
222
|
+
Record<string, unknown>
|
|
223
|
+
>,
|
|
224
|
+
}
|
|
225
|
+
: {}),
|
|
226
|
+
...(symbolRepairPlan !== undefined ? { symbolRepairPlan } : {}),
|
|
227
|
+
}),
|
|
228
|
+
});
|
|
229
|
+
const migrationPlan = statusPlan
|
|
230
|
+
? mergeMigrationPlans([statusPlan, coveragePlan])
|
|
231
|
+
: coveragePlan;
|
|
180
232
|
const enrichedPayload = {
|
|
181
233
|
...payload,
|
|
182
234
|
...(repairPlan !== undefined ? { repairPlan } : {}),
|
|
183
235
|
...(legacyMigrationPlan !== undefined ? { legacyMigrationPlan } : {}),
|
|
236
|
+
...(symbolRepairPlan !== undefined ? { symbolRepairPlan } : {}),
|
|
237
|
+
migrationPlan,
|
|
184
238
|
meta: {
|
|
185
239
|
...(payload.meta ?? {}),
|
|
186
240
|
verificationReceiptMaxAgeSeconds: VERIFICATION_RECEIPT_MAX_AGE_SECONDS,
|
|
@@ -218,7 +272,7 @@ export const coverageSpec = {
|
|
|
218
272
|
name: "kb_coverage",
|
|
219
273
|
cliName: "coverage",
|
|
220
274
|
description:
|
|
221
|
-
"Generate curated structural coverage and conservative end-to-end requirement proof reports for requirements, symbols, or grouped types.
|
|
275
|
+
"Generate curated structural coverage and conservative end-to-end requirement proof reports for requirements, symbols, or grouped types. Reports include the compatible repair plan plus typed kibi.migration-plan.v2 actions; semantic and E2E actions remain review/execution work. Paginated plans identify incomplete scope and no mutation occurs.",
|
|
222
276
|
businessInputSchema: {
|
|
223
277
|
type: "object",
|
|
224
278
|
properties: {
|
|
@@ -32,6 +32,16 @@ export const upsertSpec = {
|
|
|
32
32
|
},
|
|
33
33
|
properties: ENTITY_PROPERTIES_SCHEMA,
|
|
34
34
|
relationships: RELATIONSHIPS_SCHEMA,
|
|
35
|
+
document: {
|
|
36
|
+
type: "object",
|
|
37
|
+
additionalProperties: false,
|
|
38
|
+
description:
|
|
39
|
+
"Optional source-first document write. Paths are workspace-relative; omit body when updating to preserve the existing body bytes.",
|
|
40
|
+
properties: {
|
|
41
|
+
path: { type: "string", minLength: 1 },
|
|
42
|
+
body: { type: "string" },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
35
45
|
},
|
|
36
46
|
},
|
|
37
47
|
requiresProlog: true,
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type IngestVerificationArgs,
|
|
3
|
+
type IngestVerificationResult,
|
|
4
|
+
executeIngestVerification,
|
|
5
|
+
} from "../../../operations/verification/ingest-verification.js";
|
|
6
|
+
import type { OperationSpec } from "../types.js";
|
|
7
|
+
|
|
8
|
+
export type {
|
|
9
|
+
IngestVerificationArgs,
|
|
10
|
+
IngestVerificationResult,
|
|
11
|
+
} from "../../../operations/verification/ingest-verification.js";
|
|
12
|
+
export { executeIngestVerification } from "../../../operations/verification/ingest-verification.js";
|
|
13
|
+
|
|
14
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
15
|
+
export const ingestVerificationSpec = {
|
|
16
|
+
name: "kb_ingest_verification",
|
|
17
|
+
cliName: "ingest-verification",
|
|
18
|
+
description:
|
|
19
|
+
"Ingest a reporter-produced kibi.playwright-run.v1 artifact for a contracted test. Revalidates the live workspace snapshot, runner/command contract, required case/project coverage, and append-only receipt history before deriving and appending a kibi.verification-receipt.v2. It never accepts a caller-authored receipt or trusted outcome.",
|
|
20
|
+
businessInputSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
required: ["testId", "snapshot", "artifact"],
|
|
23
|
+
properties: {
|
|
24
|
+
testId: {
|
|
25
|
+
type: "string",
|
|
26
|
+
minLength: 1,
|
|
27
|
+
description: "Existing test entity with verification_contract.v1.",
|
|
28
|
+
},
|
|
29
|
+
snapshot: {
|
|
30
|
+
type: "string",
|
|
31
|
+
pattern: "^[a-f0-9]{64}$",
|
|
32
|
+
description:
|
|
33
|
+
"Workspace verification snapshot captured immediately before the run.",
|
|
34
|
+
},
|
|
35
|
+
artifact: {
|
|
36
|
+
type: "object",
|
|
37
|
+
required: [
|
|
38
|
+
"version",
|
|
39
|
+
"runner",
|
|
40
|
+
"command_argv",
|
|
41
|
+
"code_snapshot",
|
|
42
|
+
"environment_hash",
|
|
43
|
+
"started_at",
|
|
44
|
+
"finished_at",
|
|
45
|
+
"process_exit_code",
|
|
46
|
+
"cases",
|
|
47
|
+
],
|
|
48
|
+
properties: {
|
|
49
|
+
version: { type: "string", const: "kibi.playwright-run.v1" },
|
|
50
|
+
runner: { type: "string", minLength: 1 },
|
|
51
|
+
command_argv: {
|
|
52
|
+
type: "array",
|
|
53
|
+
minItems: 1,
|
|
54
|
+
items: { type: "string", minLength: 1 },
|
|
55
|
+
},
|
|
56
|
+
code_snapshot: { type: "string", pattern: "^[a-f0-9]{64}$" },
|
|
57
|
+
environment_hash: { type: "string", pattern: "^[a-f0-9]{64}$" },
|
|
58
|
+
started_at: { type: "string", minLength: 1 },
|
|
59
|
+
finished_at: { type: "string", minLength: 1 },
|
|
60
|
+
process_exit_code: { type: "integer" },
|
|
61
|
+
cases: {
|
|
62
|
+
type: "array",
|
|
63
|
+
minItems: 1,
|
|
64
|
+
maxItems: 1000,
|
|
65
|
+
items: { type: "object" },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
additionalProperties: true,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
requiresProlog: true,
|
|
73
|
+
effects: ["kb-read", "kb-write", "workspace-read"],
|
|
74
|
+
execute: executeIngestVerification,
|
|
75
|
+
} as const satisfies OperationSpec<
|
|
76
|
+
IngestVerificationArgs,
|
|
77
|
+
IngestVerificationResult
|
|
78
|
+
>;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { analyzeSourceText } from "../../extractors/symbols-coordinator.js";
|
|
4
|
+
import { loadEntities } from "./discovery-entities.js";
|
|
5
|
+
import type { OperationContext } from "./runtime-types.js";
|
|
6
|
+
|
|
7
|
+
export const SYMBOL_REPAIR_PLAN_VERSION = "kibi.symbol-repair-plan.v1" as const;
|
|
8
|
+
|
|
9
|
+
export type SymbolRepairPlan = Readonly<{
|
|
10
|
+
version: typeof SYMBOL_REPAIR_PLAN_VERSION;
|
|
11
|
+
readOnly: true;
|
|
12
|
+
autoApplicable: false;
|
|
13
|
+
repairs: readonly Readonly<Record<string, unknown>>[];
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
function sourceFileOf(
|
|
17
|
+
entity: Readonly<Record<string, unknown>>,
|
|
18
|
+
): string | null {
|
|
19
|
+
const value = entity.sourceFile ?? entity.source;
|
|
20
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function coordinatesPresent(
|
|
24
|
+
entity: Readonly<Record<string, unknown>>,
|
|
25
|
+
): boolean {
|
|
26
|
+
return [
|
|
27
|
+
entity.sourceLine,
|
|
28
|
+
entity.sourceColumn,
|
|
29
|
+
entity.sourceEndLine,
|
|
30
|
+
entity.sourceEndColumn,
|
|
31
|
+
].every((value) => Number.isInteger(value) && Number(value) >= 0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function currentCandidates(
|
|
35
|
+
entity: Readonly<Record<string, unknown>>,
|
|
36
|
+
symbols: readonly Readonly<Record<string, unknown>>[],
|
|
37
|
+
extractedByPath: ReadonlyMap<
|
|
38
|
+
string,
|
|
39
|
+
readonly { name: string; kind: string }[]
|
|
40
|
+
>,
|
|
41
|
+
): Readonly<Record<string, unknown>>[] {
|
|
42
|
+
const title = typeof entity.title === "string" ? entity.title : "";
|
|
43
|
+
const kind = typeof entity.symbol_kind === "string" ? entity.symbol_kind : "";
|
|
44
|
+
const source = sourceFileOf(entity);
|
|
45
|
+
const extracted = source ? (extractedByPath.get(source) ?? []) : [];
|
|
46
|
+
const names = new Set(
|
|
47
|
+
extracted
|
|
48
|
+
.filter((candidate) => !kind || candidate.kind === kind)
|
|
49
|
+
.map((candidate) => candidate.name),
|
|
50
|
+
);
|
|
51
|
+
return symbols
|
|
52
|
+
.filter((candidate) => candidate.id !== entity.id)
|
|
53
|
+
.filter((candidate) => {
|
|
54
|
+
const candidateTitle =
|
|
55
|
+
typeof candidate.title === "string" ? candidate.title : "";
|
|
56
|
+
const candidateKind =
|
|
57
|
+
typeof candidate.symbol_kind === "string" ? candidate.symbol_kind : "";
|
|
58
|
+
return (
|
|
59
|
+
(title !== "" && candidateTitle === title) ||
|
|
60
|
+
(kind !== "" && candidateKind === kind && names.has(candidateTitle))
|
|
61
|
+
);
|
|
62
|
+
})
|
|
63
|
+
.map((candidate) => ({
|
|
64
|
+
symbolId: String(candidate.id),
|
|
65
|
+
title: candidate.title,
|
|
66
|
+
symbolKind: candidate.symbol_kind,
|
|
67
|
+
sourceFile: sourceFileOf(candidate),
|
|
68
|
+
evidence: "current extraction/title/kind match",
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Build review-only, evidence-backed symbol recovery suggestions. */
|
|
73
|
+
export async function buildSymbolRepairPlan(
|
|
74
|
+
rows: readonly Readonly<Record<string, unknown>>[],
|
|
75
|
+
context: OperationContext,
|
|
76
|
+
): Promise<SymbolRepairPlan | undefined> {
|
|
77
|
+
if (!context.prolog || rows.length === 0) return undefined;
|
|
78
|
+
const symbols = await loadEntities(context.prolog, { type: "symbol" });
|
|
79
|
+
const extractedByPath = new Map<
|
|
80
|
+
string,
|
|
81
|
+
readonly { name: string; kind: string }[]
|
|
82
|
+
>();
|
|
83
|
+
for (const symbol of symbols) {
|
|
84
|
+
const source = sourceFileOf(symbol);
|
|
85
|
+
if (!source || extractedByPath.has(source)) continue;
|
|
86
|
+
const absolute = path.isAbsolute(source)
|
|
87
|
+
? source
|
|
88
|
+
: path.resolve(context.workspaceRoot, source);
|
|
89
|
+
if (!existsSync(absolute)) continue;
|
|
90
|
+
try {
|
|
91
|
+
const analysis = analyzeSourceText(
|
|
92
|
+
absolute,
|
|
93
|
+
readFileSync(absolute, "utf8"),
|
|
94
|
+
);
|
|
95
|
+
extractedByPath.set(
|
|
96
|
+
source,
|
|
97
|
+
analysis.symbols.map((candidate) => ({
|
|
98
|
+
name: candidate.name,
|
|
99
|
+
kind: candidate.kind,
|
|
100
|
+
})),
|
|
101
|
+
);
|
|
102
|
+
} catch {
|
|
103
|
+
extractedByPath.set(source, []);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const repairs = rows.flatMap((row) => {
|
|
108
|
+
if (row.type !== "symbol") return [];
|
|
109
|
+
const entity = symbols.find((candidate) => candidate.id === row.id);
|
|
110
|
+
if (!entity) return [];
|
|
111
|
+
const source = sourceFileOf(entity);
|
|
112
|
+
const absolute = source
|
|
113
|
+
? path.isAbsolute(source)
|
|
114
|
+
? source
|
|
115
|
+
: path.resolve(context.workspaceRoot, source)
|
|
116
|
+
: null;
|
|
117
|
+
const exists = absolute !== null && existsSync(absolute);
|
|
118
|
+
const candidates = currentCandidates(entity, symbols, extractedByPath);
|
|
119
|
+
const extraction = source ? extractedByPath.get(source) : undefined;
|
|
120
|
+
const extractionProvesAbsent =
|
|
121
|
+
exists &&
|
|
122
|
+
extraction !== undefined &&
|
|
123
|
+
!extraction.some(
|
|
124
|
+
(candidate) =>
|
|
125
|
+
candidate.name === entity.title &&
|
|
126
|
+
(!entity.symbol_kind || candidate.kind === entity.symbol_kind),
|
|
127
|
+
);
|
|
128
|
+
const gaps = Array.isArray(row.gaps) ? row.gaps.map(String) : [];
|
|
129
|
+
const action = !exists
|
|
130
|
+
? entity.symbol_origin === "extracted"
|
|
131
|
+
? "delete_obsolete_symbol"
|
|
132
|
+
: "review"
|
|
133
|
+
: extractionProvesAbsent && entity.symbol_origin === "extracted"
|
|
134
|
+
? "delete_obsolete_symbol"
|
|
135
|
+
: !coordinatesPresent(entity)
|
|
136
|
+
? "refresh_coordinates"
|
|
137
|
+
: candidates.length > 0
|
|
138
|
+
? "remap"
|
|
139
|
+
: "review";
|
|
140
|
+
return [
|
|
141
|
+
{
|
|
142
|
+
symbolId: String(entity.id),
|
|
143
|
+
action,
|
|
144
|
+
candidates,
|
|
145
|
+
evidence: {
|
|
146
|
+
sourceFile: source,
|
|
147
|
+
sourceExists: exists,
|
|
148
|
+
extractionProvesAbsent,
|
|
149
|
+
gaps,
|
|
150
|
+
currentExtractionAvailable: source
|
|
151
|
+
? extractedByPath.has(source)
|
|
152
|
+
: false,
|
|
153
|
+
autoApply: false,
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
];
|
|
157
|
+
});
|
|
158
|
+
return {
|
|
159
|
+
version: SYMBOL_REPAIR_PLAN_VERSION,
|
|
160
|
+
readOnly: true,
|
|
161
|
+
autoApplicable: false,
|
|
162
|
+
repairs,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
@@ -18,7 +18,10 @@ export type OperationName =
|
|
|
18
18
|
| "kb_check"
|
|
19
19
|
| "kb_model_requirement"
|
|
20
20
|
| "kb_suggest_predicates"
|
|
21
|
-
| "
|
|
21
|
+
| "kb_plan_bootstrap"
|
|
22
|
+
| "kb_compile_intent"
|
|
23
|
+
| "kb_apply_plan"
|
|
24
|
+
| "kb_ingest_verification";
|
|
22
25
|
|
|
23
26
|
export type OperationEffect =
|
|
24
27
|
| "local-read"
|
|
@@ -28,6 +31,14 @@ export type OperationEffect =
|
|
|
28
31
|
| "kb-write"
|
|
29
32
|
| "workspace-write";
|
|
30
33
|
|
|
34
|
+
export type OperationEffectDeclaration = Readonly<{
|
|
35
|
+
kind: OperationEffect;
|
|
36
|
+
mutability: "read" | "write";
|
|
37
|
+
destructive: boolean;
|
|
38
|
+
retrySafety: "safe" | "unsafe";
|
|
39
|
+
openWorld: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
|
|
31
42
|
export interface OperationContent {
|
|
32
43
|
readonly type: string;
|
|
33
44
|
readonly text?: string;
|
|
@@ -38,6 +49,40 @@ export interface OperationResult<O = unknown> {
|
|
|
38
49
|
readonly structuredContent?: O;
|
|
39
50
|
}
|
|
40
51
|
|
|
52
|
+
export type KibiResultStatus = "success" | "committed_with_repairs" | "error";
|
|
53
|
+
|
|
54
|
+
export type KibiResult<T = unknown> = {
|
|
55
|
+
readonly kibiProtocol: 1;
|
|
56
|
+
readonly operation: OperationName | string;
|
|
57
|
+
readonly resultVersion: string;
|
|
58
|
+
readonly status: KibiResultStatus;
|
|
59
|
+
readonly data: T;
|
|
60
|
+
readonly effects: readonly {
|
|
61
|
+
readonly kind: string;
|
|
62
|
+
readonly status: "completed" | "failed" | "not_applicable";
|
|
63
|
+
readonly detail?: unknown;
|
|
64
|
+
readonly errorCode?: string;
|
|
65
|
+
}[];
|
|
66
|
+
readonly diagnostics: readonly {
|
|
67
|
+
readonly code?: string;
|
|
68
|
+
readonly severity?: "info" | "warning" | "error";
|
|
69
|
+
readonly message: string;
|
|
70
|
+
readonly detail?: unknown;
|
|
71
|
+
}[];
|
|
72
|
+
readonly nextActions: readonly {
|
|
73
|
+
readonly operation: OperationName | string;
|
|
74
|
+
readonly input?: unknown;
|
|
75
|
+
readonly reason: string;
|
|
76
|
+
readonly required: boolean;
|
|
77
|
+
}[];
|
|
78
|
+
readonly error?: {
|
|
79
|
+
readonly code: string;
|
|
80
|
+
readonly message: string;
|
|
81
|
+
readonly retryable: boolean;
|
|
82
|
+
readonly details?: unknown;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
41
86
|
export interface OperationSpec<
|
|
42
87
|
I = Readonly<Record<string, unknown>>,
|
|
43
88
|
O = unknown,
|
|
@@ -48,6 +93,12 @@ export interface OperationSpec<
|
|
|
48
93
|
readonly businessInputSchema: Readonly<Record<string, unknown>>;
|
|
49
94
|
readonly requiresProlog: boolean;
|
|
50
95
|
readonly effects: readonly OperationEffect[];
|
|
96
|
+
/** Generated effect metadata used by MCP annotations and telemetry. */
|
|
97
|
+
readonly declaredEffects?: readonly OperationEffectDeclaration[];
|
|
98
|
+
/** Version of the machine-readable result data for this operation. */
|
|
99
|
+
readonly resultVersion?: string;
|
|
100
|
+
/** JSON Schema for the machine-readable result data. */
|
|
101
|
+
readonly outputSchema?: Readonly<Record<string, unknown>>;
|
|
51
102
|
readonly execute: {
|
|
52
103
|
bivarianceHack(
|
|
53
104
|
input: I,
|
|
@@ -55,3 +106,13 @@ export interface OperationSpec<
|
|
|
55
106
|
): Promise<OperationResult<O>>;
|
|
56
107
|
}["bivarianceHack"];
|
|
57
108
|
}
|
|
109
|
+
|
|
110
|
+
/** A catalog spec after its generated machine contract has been attached. */
|
|
111
|
+
export type ResolvedOperationSpec<
|
|
112
|
+
I = Readonly<Record<string, unknown>>,
|
|
113
|
+
O = unknown,
|
|
114
|
+
> = OperationSpec<I, O> & {
|
|
115
|
+
readonly declaredEffects: readonly OperationEffectDeclaration[];
|
|
116
|
+
readonly resultVersion: string;
|
|
117
|
+
readonly outputSchema: Readonly<Record<string, unknown>>;
|
|
118
|
+
};
|