kibi-cli 2.0.0 → 2.2.0
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-protocol.d.ts.map +1 -1
- package/dist/cli-protocol.js +3 -2
- package/dist/cli-register-proof.d.ts.map +1 -1
- package/dist/cli-register-proof.js +25 -1
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +6 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/commands/aggregated-checks.d.ts +7 -0
- package/dist/commands/aggregated-checks.d.ts.map +1 -1
- package/dist/commands/aggregated-checks.js +25 -1
- package/dist/commands/check-generated.d.ts +7 -0
- package/dist/commands/check-generated.d.ts.map +1 -0
- package/dist/commands/check-generated.js +192 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +24 -15
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +227 -25
- package/dist/commands/engine.d.ts.map +1 -1
- package/dist/commands/engine.js +3 -1
- package/dist/commands/github-init.d.ts +1 -1
- package/dist/commands/github-init.d.ts.map +1 -1
- package/dist/commands/github-init.js +1 -1
- package/dist/commands/init-helpers.d.ts +17 -2
- package/dist/commands/init-helpers.d.ts.map +1 -1
- package/dist/commands/init-helpers.js +136 -30
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +110 -15
- package/dist/commands/proof-explain.d.ts +10 -0
- package/dist/commands/proof-explain.d.ts.map +1 -0
- package/dist/commands/proof-explain.js +45 -0
- package/dist/commands/proof-impact.d.ts +7 -0
- package/dist/commands/proof-impact.d.ts.map +1 -0
- package/dist/commands/proof-impact.js +39 -0
- package/dist/commands/proof-migrate-legacy.js +1 -1
- package/dist/commands/proof-prune.js +1 -1
- package/dist/commands/prove.d.ts.map +1 -1
- package/dist/commands/prove.js +14 -22
- package/dist/commands/report.d.ts.map +1 -1
- package/dist/commands/report.js +17 -2
- package/dist/commands/sync/cache.d.ts +20 -1
- package/dist/commands/sync/cache.d.ts.map +1 -1
- package/dist/commands/sync/cache.js +51 -2
- package/dist/commands/sync/discovery.d.ts.map +1 -1
- package/dist/commands/sync/discovery.js +1 -1
- package/dist/commands/sync/manifest.d.ts +1 -0
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +18 -16
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +14 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +11 -3
- package/dist/engine.d.ts +29 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +259 -89
- package/dist/env/bootstrap.d.ts +84 -0
- package/dist/env/bootstrap.d.ts.map +1 -0
- package/dist/env/bootstrap.js +310 -0
- package/dist/extractors/manifest.d.ts.map +1 -1
- package/dist/extractors/manifest.js +67 -29
- package/dist/extractors/markdown.d.ts +4 -0
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +33 -3
- package/dist/extractors/relationships.d.ts.map +1 -1
- package/dist/extractors/relationships.js +1 -0
- package/dist/extractors/symbols-coordinator.d.ts +8 -0
- package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.js +40 -0
- package/dist/extractors/symbols-ts.d.ts +8 -19
- package/dist/extractors/symbols-ts.d.ts.map +1 -1
- package/dist/extractors/symbols-ts.js +33 -503
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +68 -30
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +4 -3
- package/dist/operations/modeling/model-requirement.d.ts +1 -1
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +179 -9
- package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applyplan.js +14 -2
- package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-loader.js +24 -0
- package/dist/operations/modeling/predicate-types.d.ts +4 -0
- package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-vocabulary.d.ts +54 -0
- package/dist/operations/modeling/predicate-vocabulary.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-vocabulary.js +169 -0
- package/dist/operations/modeling/requirement-types.d.ts +5 -0
- package/dist/operations/modeling/requirement-types.d.ts.map +1 -1
- 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 +30 -3
- package/dist/operations/modeling/vocabulary-alignment.d.ts +60 -0
- package/dist/operations/modeling/vocabulary-alignment.d.ts.map +1 -0
- package/dist/operations/modeling/vocabulary-alignment.js +178 -0
- package/dist/operations/mutation/contradictions.d.ts +3 -0
- package/dist/operations/mutation/contradictions.d.ts.map +1 -1
- package/dist/operations/mutation/contradictions.js +29 -0
- package/dist/operations/mutation/delete.d.ts.map +1 -1
- package/dist/operations/mutation/delete.js +33 -1
- package/dist/operations/mutation/predicate-vocabulary-guard.d.ts +8 -0
- package/dist/operations/mutation/predicate-vocabulary-guard.d.ts.map +1 -0
- package/dist/operations/mutation/predicate-vocabulary-guard.js +64 -0
- package/dist/operations/mutation/relationships.d.ts +1 -1
- package/dist/operations/mutation/relationships.d.ts.map +1 -1
- package/dist/operations/mutation/relationships.js +1 -0
- package/dist/operations/mutation/saga.d.ts +5 -0
- package/dist/operations/mutation/saga.d.ts.map +1 -1
- package/dist/operations/mutation/saga.js +10 -0
- package/dist/operations/mutation/serialization.d.ts.map +1 -1
- package/dist/operations/mutation/serialization.js +2 -0
- package/dist/operations/mutation/source-authoring.d.ts +6 -0
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +65 -26
- package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
- package/dist/operations/mutation/strict-fact.js +5 -0
- package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-granularity.js +9 -87
- package/dist/operations/mutation/types.d.ts +17 -0
- package/dist/operations/mutation/types.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.d.ts +6 -0
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +72 -4
- package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
- package/dist/operations/mutation/validate-upsert.js +24 -1
- package/dist/operations/mutation/validation.d.ts.map +1 -1
- package/dist/operations/mutation/validation.js +16 -3
- package/dist/operations/planning/apply-plan.d.ts.map +1 -1
- package/dist/operations/planning/apply-plan.js +61 -17
- package/dist/operations/planning/compile-intent.d.ts +49 -0
- package/dist/operations/planning/compile-intent.d.ts.map +1 -1
- package/dist/operations/planning/compile-intent.js +66 -4
- package/dist/operations/proof/baseline-diff.d.ts +41 -0
- package/dist/operations/proof/baseline-diff.d.ts.map +1 -0
- package/dist/operations/proof/baseline-diff.js +153 -0
- package/dist/operations/proof/code-scope.d.ts +17 -0
- package/dist/operations/proof/code-scope.d.ts.map +1 -0
- package/dist/operations/proof/code-scope.js +60 -0
- package/dist/operations/proof/explain.d.ts +75 -0
- package/dist/operations/proof/explain.d.ts.map +1 -0
- package/dist/operations/proof/explain.js +294 -0
- package/dist/operations/proof/impact.d.ts +45 -0
- package/dist/operations/proof/impact.d.ts.map +1 -0
- package/dist/operations/proof/impact.js +118 -0
- package/dist/operations/proof/ingest-proof.d.ts +4 -2
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
- package/dist/operations/proof/ingest-proof.js +251 -77
- package/dist/operations/proof/migrate-legacy-receipts.d.ts.map +1 -1
- package/dist/operations/proof/migrate-legacy-receipts.js +28 -22
- package/dist/operations/proof/prune-receipts.d.ts.map +1 -1
- package/dist/operations/proof/prune-receipts.js +8 -6
- package/dist/operations/proof/receipt-document.js +2 -2
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analysis-receipt.js +3 -9
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +18 -67
- package/dist/operations/semantic-advisor/plugin-orchestration.d.ts +63 -0
- package/dist/operations/semantic-advisor/plugin-orchestration.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/plugin-orchestration.js +489 -0
- package/dist/operations/semantic-advisor/predicate-rules-core.d.ts +15 -2
- package/dist/operations/semantic-advisor/predicate-rules-core.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-core.js +7 -140
- package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts +11 -12
- package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-launcher.js +6 -94
- package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts +16 -0
- package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-policy.js +7 -150
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts +9 -0
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.js +7 -102
- package/dist/operations/semantic-advisor/predicate-rules-product.d.ts +13 -0
- package/dist/operations/semantic-advisor/predicate-rules-product.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-product.js +7 -133
- package/dist/operations/semantic-advisor/types.d.ts +1 -0
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
- package/dist/plugins/compose-ontology-packs.d.ts +51 -0
- package/dist/plugins/compose-ontology-packs.d.ts.map +1 -0
- package/dist/plugins/compose-ontology-packs.js +257 -0
- package/dist/plugins/compose-semantic-classifier.d.ts +47 -0
- package/dist/plugins/compose-semantic-classifier.d.ts.map +1 -0
- package/dist/plugins/compose-semantic-classifier.js +216 -0
- package/dist/plugins/compose-vocabulary-alignment.d.ts +23 -0
- package/dist/plugins/compose-vocabulary-alignment.d.ts.map +1 -0
- package/dist/plugins/compose-vocabulary-alignment.js +141 -0
- package/dist/plugins/external-allowlist.d.ts +17 -0
- package/dist/plugins/external-allowlist.d.ts.map +1 -0
- package/dist/plugins/external-allowlist.js +29 -0
- package/dist/plugins/index.d.ts +11 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +37 -0
- package/dist/plugins/load-plugin.d.ts +19 -0
- package/dist/plugins/load-plugin.d.ts.map +1 -0
- package/dist/plugins/load-plugin.js +59 -0
- package/dist/plugins/project-config.d.ts +28 -0
- package/dist/plugins/project-config.d.ts.map +1 -0
- package/dist/plugins/project-config.js +90 -0
- package/dist/plugins/registry.d.ts +94 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +359 -0
- package/dist/plugins/resolve-package.d.ts +47 -0
- package/dist/plugins/resolve-package.d.ts.map +1 -0
- package/dist/plugins/resolve-package.js +262 -0
- package/dist/plugins/source-analysis-service.d.ts +44 -0
- package/dist/plugins/source-analysis-service.d.ts.map +1 -0
- package/dist/plugins/source-analysis-service.js +232 -0
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +2 -0
- package/dist/prolog/janitor.d.ts.map +1 -1
- package/dist/prolog/janitor.js +1 -1
- package/dist/prolog/store-lock.d.ts +1 -1
- package/dist/prolog/store-lock.d.ts.map +1 -1
- package/dist/prolog.d.ts +36 -0
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +78 -9
- package/dist/proof/inspect.js +1 -1
- package/dist/proof/producers/playwright-case-id.js +2 -2
- package/dist/proof/producers/playwright-reporter.js +4 -4
- package/dist/public/diagnostic-usage.d.ts.map +1 -1
- package/dist/public/diagnostic-usage.js +7 -25
- package/dist/public/extractors/symbols-coordinator.d.ts +1 -1
- package/dist/public/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/public/extractors/symbols-coordinator.js +1 -1
- package/dist/public/impact/analyzer.d.ts +1 -1
- package/dist/public/impact/analyzer.d.ts.map +1 -1
- package/dist/public/impact/analyzer.js +6 -4
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +4 -12
- package/dist/public/operations/catalog.d.ts +39 -7
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +11 -3
- package/dist/public/operations/check-helpers.d.ts +7 -1
- package/dist/public/operations/check-helpers.d.ts.map +1 -1
- package/dist/public/operations/check-helpers.js +22 -2
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +51 -12
- package/dist/public/operations/discovery-entities.d.ts +53 -1
- package/dist/public/operations/discovery-entities.d.ts.map +1 -1
- package/dist/public/operations/discovery-entities.js +219 -12
- package/dist/public/operations/discovery-executors.d.ts +1 -0
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +93 -59
- package/dist/public/operations/migration-plan.d.ts +2 -0
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +50 -0
- package/dist/public/operations/predicate-schema-conformance.d.ts +41 -0
- package/dist/public/operations/predicate-schema-conformance.d.ts.map +1 -0
- package/dist/public/operations/predicate-schema-conformance.js +242 -0
- package/dist/public/operations/prolog-json.d.ts +1 -1
- package/dist/public/operations/prolog-json.d.ts.map +1 -1
- package/dist/public/operations/prolog-json.js +16 -10
- package/dist/public/operations/result-envelope.d.ts +34 -1
- package/dist/public/operations/result-envelope.d.ts.map +1 -1
- package/dist/public/operations/result-envelope.js +78 -2
- package/dist/public/operations/runtime-types.d.ts +17 -2
- package/dist/public/operations/runtime-types.d.ts.map +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
- package/dist/public/operations/specs/check-rules.generated.js +9 -1
- package/dist/public/operations/specs/check.d.ts +1 -1
- package/dist/public/operations/specs/discovery.d.ts +10 -1
- package/dist/public/operations/specs/discovery.d.ts.map +1 -1
- package/dist/public/operations/specs/discovery.js +10 -1
- package/dist/public/operations/specs/mutation-schemas.d.ts +27 -4
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +21 -3
- package/dist/public/operations/specs/proof.js +1 -1
- package/dist/public/operations/specs/reporting.d.ts +9 -0
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +48 -17
- package/dist/public/operations/specs/semantic.d.ts +1 -1
- package/dist/public/operations/specs/semantic.d.ts.map +1 -1
- package/dist/public/operations/specs/semantic.js +54 -4
- package/dist/public/operations/specs/upsert.d.ts +28 -5
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/specs/upsert.js +1 -1
- package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -1
- package/dist/public/operations/symbol-repair-plan.js +11 -4
- package/dist/public/operations/types.d.ts +5 -0
- package/dist/public/operations/types.d.ts.map +1 -1
- package/dist/public/proof-protocol.js +4 -4
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +22 -0
- package/dist/public/schemas/relationship.d.ts.map +1 -1
- package/dist/public/schemas/relationship.js +1 -0
- package/dist/public/skills/kibi-usage/SKILL.md +10 -3
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +4 -0
- package/dist/public/skills/kibi-usage/resources/proof.md +45 -0
- package/dist/public/skills/kibi-usage/resources/relationship-directions.md +35 -17
- package/dist/public/skills/kibi-usage/resources/source-authoring.md +36 -0
- package/dist/public/skills/kibi-usage/resources/workflows.md +52 -1
- package/dist/public/symbol-granularity.d.ts +1 -1
- package/dist/public/symbol-granularity.d.ts.map +1 -1
- package/dist/public/symbol-granularity.generated.d.ts.map +1 -1
- package/dist/public/symbol-granularity.generated.js +38 -5
- package/dist/public/telemetry-acceptance.d.ts.map +1 -1
- package/dist/public/telemetry-acceptance.js +21 -5
- package/dist/relationships/shards.d.ts +6 -0
- package/dist/relationships/shards.d.ts.map +1 -1
- package/dist/relationships/shards.js +26 -19
- package/dist/report/html-report.css +1239 -281
- package/dist/runtime/cli-runtime.d.ts.map +1 -1
- package/dist/runtime/cli-runtime.js +18 -0
- package/dist/schemas/entity.schema.json +32 -0
- package/dist/traceability/staged-diagnostics.d.ts +1 -1
- package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
- package/dist/traceability/staged-entity-id-style.d.ts +12 -0
- package/dist/traceability/staged-entity-id-style.d.ts.map +1 -0
- package/dist/traceability/staged-entity-id-style.js +68 -0
- package/dist/traceability/symbol-extract.d.ts +24 -7
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +64 -208
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +8 -0
- package/dist/traceability/validate.js +1 -1
- package/dist/types/entities.d.ts +2 -0
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/types/relationships.d.ts +1 -1
- package/dist/types/relationships.d.ts.map +1 -1
- package/dist/utils/entity-id-style.d.ts +27 -0
- package/dist/utils/entity-id-style.d.ts.map +1 -0
- package/dist/utils/entity-id-style.js +81 -0
- package/dist/utils/git-repository-context.d.ts +50 -0
- package/dist/utils/git-repository-context.d.ts.map +1 -0
- package/dist/utils/git-repository-context.js +259 -0
- package/dist/utils/rule-registry.d.ts +5 -0
- package/dist/utils/rule-registry.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.d.ts +42 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +50 -0
- package/dist/utils/strict-modeling.d.ts +7 -0
- package/dist/utils/strict-modeling.d.ts.map +1 -1
- package/dist/utils/strict-modeling.js +11 -0
- package/package.json +14 -11
- package/schema/entities.pl +60 -1
- package/schema/relationships.pl +17 -4
- package/schema/validation.pl +118 -20
- package/src/public/diagnostic-usage.ts +16 -24
- package/src/public/extractors/symbols-coordinator.ts +1 -0
- package/src/public/impact/analyzer.ts +15 -12
- package/src/public/impact/full-kb-quality.ts +4 -16
- package/src/public/operations/check-executor.ts +13 -2
- package/src/public/operations/check-helpers.ts +29 -3
- package/src/public/operations/contracts.ts +59 -12
- package/src/public/operations/discovery-entities.ts +327 -12
- package/src/public/operations/discovery-executors.ts +110 -61
- package/src/public/operations/migration-plan.ts +57 -0
- package/src/public/operations/predicate-schema-conformance.ts +362 -0
- package/src/public/operations/prolog-json.ts +22 -8
- package/src/public/operations/result-envelope.ts +114 -2
- package/src/public/operations/runtime-types.ts +22 -3
- package/src/public/operations/specs/check-rules.generated.ts +9 -1
- package/src/public/operations/specs/discovery.ts +11 -1
- package/src/public/operations/specs/mutation-schemas.ts +23 -3
- package/src/public/operations/specs/proof.ts +1 -1
- package/src/public/operations/specs/reporting.ts +71 -24
- package/src/public/operations/specs/semantic.ts +79 -17
- package/src/public/operations/specs/upsert.ts +1 -1
- package/src/public/operations/symbol-repair-plan.ts +16 -7
- package/src/public/operations/types.ts +5 -0
- package/src/public/proof-fingerprint.ts +1 -1
- package/src/public/proof-protocol-types.d.ts +1 -1
- package/src/public/proof-protocol.ts +4 -4
- package/src/public/schemas/entity.ts +22 -0
- package/src/public/schemas/relationship.ts +1 -0
- package/src/public/skills/kibi-usage/SKILL.md +10 -3
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +4 -0
- package/src/public/skills/kibi-usage/resources/proof.md +45 -0
- package/src/public/skills/kibi-usage/resources/relationship-directions.md +35 -17
- package/src/public/skills/kibi-usage/resources/source-authoring.md +36 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +52 -1
- package/src/public/symbol-granularity.generated.ts +45 -12
- package/src/public/symbol-granularity.ts +3 -3
- package/src/public/telemetry-acceptance.ts +37 -6
- package/src/schemas/entity.schema.json +32 -0
- package/src/schemas/relationship.schema.json +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-protocol.d.ts","sourceRoot":"","sources":["../src/cli-protocol.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAO7E,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG;IAC1C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CACpD,CAAC;AAGF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-protocol.d.ts","sourceRoot":"","sources":["../src/cli-protocol.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAO7E,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG;IAC1C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CACpD,CAAC;AAGF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAiDF,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,iBAAiB,CAAC,CAyD5B"}
|
package/dist/cli-protocol.js
CHANGED
|
@@ -5,13 +5,14 @@ import { isOperationName } from "./cli-operation-metadata.js";
|
|
|
5
5
|
import { prepareOperationInput, } from "./cli-validate.js";
|
|
6
6
|
import { operationData, toKibiResult, } from "./public/operations/result-envelope.js";
|
|
7
7
|
const outputValidator = new Ajv2020({ strict: false, allErrors: true });
|
|
8
|
-
function errorResult(operation, error, spec) {
|
|
8
|
+
function errorResult(operation, error, spec, attempted = true) {
|
|
9
9
|
const envelope = toKibiResult(spec ?? {
|
|
10
10
|
name: operation,
|
|
11
11
|
effects: [],
|
|
12
12
|
resultVersion: `kibi.${operation}.v1`,
|
|
13
13
|
}, null, {
|
|
14
14
|
status: "error",
|
|
15
|
+
attempted,
|
|
15
16
|
error: {
|
|
16
17
|
code: error.code,
|
|
17
18
|
message: error.detail,
|
|
@@ -42,7 +43,7 @@ export async function executeOperation(catalogName, input, context) {
|
|
|
42
43
|
const spec = await loadOperationSpec(catalogName);
|
|
43
44
|
const prepared = prepareOperationInput(input, spec.businessInputSchema);
|
|
44
45
|
if (!prepared.valid) {
|
|
45
|
-
return errorResult(catalogName, new InputError("VALIDATION_FAILED", prepared.errors.join("; ")), spec);
|
|
46
|
+
return errorResult(catalogName, new InputError("VALIDATION_FAILED", prepared.errors.join("; ")), spec, false);
|
|
46
47
|
}
|
|
47
48
|
try {
|
|
48
49
|
const executionContext = prepared.telemetry
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-register-proof.d.ts","sourceRoot":"","sources":["../src/cli-register-proof.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"cli-register-proof.d.ts","sourceRoot":"","sources":["../src/cli-register-proof.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6J3D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { withExitCode } from "./cli-command.js";
|
|
2
|
-
// implements REQ-kibi-
|
|
2
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
3
3
|
export function registerProofCommand(program) {
|
|
4
4
|
program
|
|
5
5
|
.command("prove")
|
|
@@ -50,6 +50,30 @@ export function registerProofCommand(program) {
|
|
|
50
50
|
process.stdout.write(renderInspection(result));
|
|
51
51
|
return undefined;
|
|
52
52
|
}));
|
|
53
|
+
proof
|
|
54
|
+
.command("explain")
|
|
55
|
+
.description("Project one requirement or symbol proof, labeling required_proofs, executable_for, and covered_by separately")
|
|
56
|
+
.argument("[id]", "Requirement (REQ-*) or symbol (SYM-*) ID")
|
|
57
|
+
.option("--requirement <id>", "Explain a requirement ID")
|
|
58
|
+
.option("--symbol <id>", "Explain a symbol ID")
|
|
59
|
+
.option("--json", "Emit structured JSON", false)
|
|
60
|
+
.action(withExitCode(async (id, options) => {
|
|
61
|
+
return await (await import("./commands/proof-explain.js")).proofExplainCommand({
|
|
62
|
+
...(id === undefined ? {} : { id }),
|
|
63
|
+
...(options.requirement === undefined
|
|
64
|
+
? {}
|
|
65
|
+
: { requirement: options.requirement }),
|
|
66
|
+
...(options.symbol === undefined ? {} : { symbol: options.symbol }),
|
|
67
|
+
json: options.json === true,
|
|
68
|
+
});
|
|
69
|
+
}));
|
|
70
|
+
proof
|
|
71
|
+
.command("impact")
|
|
72
|
+
.description("Compare current proof state to HEAD:proof/baseline.json")
|
|
73
|
+
.option("--json", "Emit structured JSON", false)
|
|
74
|
+
.action(withExitCode(async (options) => {
|
|
75
|
+
return await (await import("./commands/proof-impact.js")).proofImpactCommand({ json: options.json === true });
|
|
76
|
+
}));
|
|
53
77
|
proof
|
|
54
78
|
.command("prune")
|
|
55
79
|
.description("Shrink each test's proof_receipts history to its newest entries (re-proving the same snapshot appends duplicates; prune removes the superseded ones)")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-register-reporting.d.ts","sourceRoot":"","sources":["../src/cli-register-reporting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"cli-register-reporting.d.ts","sourceRoot":"","sources":["../src/cli-register-reporting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2LhE"}
|
|
@@ -6,6 +6,12 @@ async function runJsonInvocation(invocation) {
|
|
|
6
6
|
}
|
|
7
7
|
// implements REQ-kibi-operation-interface-parity
|
|
8
8
|
export function registerReportingCommands(program) {
|
|
9
|
+
program
|
|
10
|
+
.command("check-generated")
|
|
11
|
+
.description("Compare generated symbol manifests with the staged Git snapshot")
|
|
12
|
+
.requiredOption("--staged", "Use the exact Git index bytes")
|
|
13
|
+
.option("--changed-only", "Skip regeneration when staged paths cannot affect symbols")
|
|
14
|
+
.action(withExitCode(async (options) => (await import("./commands/check-generated.js")).checkGeneratedManifests(options)));
|
|
9
15
|
program
|
|
10
16
|
.command("find-gaps [type]")
|
|
11
17
|
.alias("gaps")
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAUrD;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,GAChB,OAAO,CAIT;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAI7D;AAGD,wBAAgB,YAAY,IAAI,OAAO,CAiBtC;AAGD,wBAAsB,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAUrD;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,GAChB,OAAO,CAIT;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAI7D;AAGD,wBAAgB,YAAY,IAAI,OAAO,CAiBtC;AAGD,wBAAsB,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,CAe3C;AAED,wBAAsB,kBAAkB,CACtC,YAAY,UAAoD,EAChE,KAAK,cAAO,GACX,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
package/dist/cli.js
CHANGED
|
@@ -26,6 +26,7 @@ import { registerMaintenanceCommands } from "./cli-register-maintenance.js";
|
|
|
26
26
|
import { registerProofCommand } from "./cli-register-proof.js";
|
|
27
27
|
import { registerReportingCommands } from "./cli-register-reporting.js";
|
|
28
28
|
import { registerSkillsCommands } from "./cli-register-skills.js";
|
|
29
|
+
import { bootstrapKibiEnvironment } from "./env/bootstrap.js";
|
|
29
30
|
const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
30
31
|
export function packageVersion(value) {
|
|
31
32
|
if (value !== null &&
|
|
@@ -61,6 +62,7 @@ export function buildProgram() {
|
|
|
61
62
|
}
|
|
62
63
|
// implements REQ-kibi-operation-interface-parity
|
|
63
64
|
export async function main() {
|
|
65
|
+
bootstrapKibiEnvironment();
|
|
64
66
|
let exitCode = process.exitCode ?? 0;
|
|
65
67
|
try {
|
|
66
68
|
await buildProgram().parseAsync(process.argv);
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { type PrologProcess } from "../prolog.js";
|
|
2
2
|
import type { Violation } from "./check.js";
|
|
3
|
+
/**
|
|
4
|
+
* Forward the invoking process's ontology-quality thresholds. The engine
|
|
5
|
+
* daemon outlives the CLI/MCP call that started it, so its own environment
|
|
6
|
+
* would otherwise decide. Prolog validates the values and falls back to its
|
|
7
|
+
* defaults for anything out of range.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ontologyQualityOverridesGoal(env?: NodeJS.ProcessEnv): string;
|
|
3
10
|
/**
|
|
4
11
|
* Run all checks using the aggregated Prolog predicates.
|
|
5
12
|
* This makes a single Prolog call and parses JSON output, significantly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregated-checks.d.ts","sourceRoot":"","sources":["../../src/commands/aggregated-checks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAmB,MAAM,cAAc,CAAC;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"aggregated-checks.d.ts","sourceRoot":"","sources":["../../src/commands/aggregated-checks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAmB,MAAM,cAAc,CAAC;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAiB5C;;;;;GAKG;AAEH,wBAAgB,4BAA4B,CAC1C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,CAYR;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,EACpC,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,GACjC,OAAO,CAAC,SAAS,EAAE,CAAC,CA8DtB"}
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { resolveKbPlPath } from "../prolog.js";
|
|
3
3
|
import { escapeAtom, toPrologAtom } from "../prolog/codec.js";
|
|
4
|
+
function ontologyQualitySetting(raw) {
|
|
5
|
+
if (raw === undefined || raw.trim() === "")
|
|
6
|
+
return "default";
|
|
7
|
+
const value = Number(raw.trim());
|
|
8
|
+
return Number.isFinite(value) ? String(value) : "default";
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Forward the invoking process's ontology-quality thresholds. The engine
|
|
12
|
+
* daemon outlives the CLI/MCP call that started it, so its own environment
|
|
13
|
+
* would otherwise decide. Prolog validates the values and falls back to its
|
|
14
|
+
* defaults for anything out of range.
|
|
15
|
+
*/
|
|
16
|
+
// implements REQ-kibi-ontology-quality
|
|
17
|
+
export function ontologyQualityOverridesGoal(env = process.env) {
|
|
18
|
+
const ratio = ontologyQualitySetting(env.KIBI_ONTOLOGY_QUALITY_MAX_SINGLETON_RATIO);
|
|
19
|
+
const minFacts = ontologyQualitySetting(env.KIBI_ONTOLOGY_QUALITY_MIN_FACTS);
|
|
20
|
+
// call/1 defers resolution: a literal module-qualified goal is checked by
|
|
21
|
+
// the toplevel when the query is read, before use_module has loaded
|
|
22
|
+
// semantic_quality.pl (the same reason the check calls use call/1).
|
|
23
|
+
return `( predicate_property(semantic_quality:set_ontology_quality_overrides(_, _), defined)
|
|
24
|
+
-> call(semantic_quality:set_ontology_quality_overrides(${ratio}, ${minFacts}))
|
|
25
|
+
; true
|
|
26
|
+
)`;
|
|
27
|
+
}
|
|
4
28
|
/**
|
|
5
29
|
* Run all checks using the aggregated Prolog predicates.
|
|
6
30
|
* This makes a single Prolog call and parses JSON output, significantly
|
|
@@ -25,7 +49,7 @@ export async function runAggregatedChecks(prolog, rulesAllowlist) {
|
|
|
25
49
|
; ${fallbackQuery}
|
|
26
50
|
)`
|
|
27
51
|
: fallbackQuery;
|
|
28
|
-
const query = `(use_module('${checksPlPathEscaped}'), ${checksQuery})`;
|
|
52
|
+
const query = `(use_module('${checksPlPathEscaped}'), ${ontologyQualityOverridesGoal()}, ${checksQuery})`;
|
|
29
53
|
const result = await prolog.query(query);
|
|
30
54
|
if (!result.success) {
|
|
31
55
|
throw new Error(`Aggregated checks query failed: ${result.error || "Unknown error"}`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-generated.d.ts","sourceRoot":"","sources":["../../src/commands/check-generated.ts"],"names":[],"mappings":"AA2HA,2EAA2E;AAE3E,wBAAsB,uBAAuB,CAC3C,OAAO,GAAE;IACP,WAAW,CAAC,EAAE,OAAO,CAAC;CAClB,GACL,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAwH/B"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync, } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
import { load as parseYAML } from "js-yaml";
|
|
6
|
+
import { refreshManifestCoordinates } from "./sync/manifest.js";
|
|
7
|
+
const MANIFESTS = [".kb/symbols.yaml", ".kb/symbol-coordinates.yaml"];
|
|
8
|
+
const MAX_GIT_OUTPUT = 256 * 1024 * 1024;
|
|
9
|
+
function git(args, input) {
|
|
10
|
+
const result = spawnSync("git", args, {
|
|
11
|
+
input,
|
|
12
|
+
maxBuffer: MAX_GIT_OUTPUT,
|
|
13
|
+
encoding: "buffer",
|
|
14
|
+
});
|
|
15
|
+
if (result.error || result.status !== 0) {
|
|
16
|
+
throw new Error(`git ${args.join(" ")} failed: ${result.error?.message ?? result.stderr.toString("utf8").trim()}`);
|
|
17
|
+
}
|
|
18
|
+
return result.stdout;
|
|
19
|
+
}
|
|
20
|
+
function indexTree() {
|
|
21
|
+
return git(["write-tree"]).toString("utf8").trim();
|
|
22
|
+
}
|
|
23
|
+
function treeBlobs(tree) {
|
|
24
|
+
const entries = git(["ls-tree", "-r", "-z", "--full-tree", tree]);
|
|
25
|
+
const blobs = new Map();
|
|
26
|
+
const nonRegularPaths = new Set();
|
|
27
|
+
for (const record of entries.toString("utf8").split("\0")) {
|
|
28
|
+
if (!record)
|
|
29
|
+
continue;
|
|
30
|
+
const match = /^(\d{6}) (\w+) ([a-f0-9]+)\t(.+)$/.exec(record);
|
|
31
|
+
if (!match)
|
|
32
|
+
throw new Error("Could not parse staged Git tree");
|
|
33
|
+
const [, mode, type, oid, file] = match;
|
|
34
|
+
if (file === undefined || oid === undefined)
|
|
35
|
+
throw new Error("Could not parse staged Git tree");
|
|
36
|
+
if (mode === "100644" || mode === "100755") {
|
|
37
|
+
if (type !== "blob")
|
|
38
|
+
throw new Error(`Unexpected Git object for ${file}`);
|
|
39
|
+
blobs.set(file, oid);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
nonRegularPaths.add(file);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return { blobs, nonRegularPaths };
|
|
46
|
+
}
|
|
47
|
+
function readBlobs(oids) {
|
|
48
|
+
if (oids.length === 0)
|
|
49
|
+
return new Map();
|
|
50
|
+
const response = git(["cat-file", "--batch"], Buffer.from(`${oids.join("\n")}\n`));
|
|
51
|
+
const contents = new Map();
|
|
52
|
+
let offset = 0;
|
|
53
|
+
for (const oid of oids) {
|
|
54
|
+
const end = response.indexOf(10, offset);
|
|
55
|
+
if (end < 0)
|
|
56
|
+
throw new Error("Incomplete Git blob response");
|
|
57
|
+
const header = response.subarray(offset, end).toString("utf8");
|
|
58
|
+
const match = /^([a-f0-9]+) blob (\d+)$/.exec(header);
|
|
59
|
+
if (!match || match[1] !== oid)
|
|
60
|
+
throw new Error(`Invalid Git blob response for ${oid}`);
|
|
61
|
+
const size = Number(match[2]);
|
|
62
|
+
const start = end + 1;
|
|
63
|
+
const finish = start + size;
|
|
64
|
+
if (!Number.isSafeInteger(size) ||
|
|
65
|
+
finish >= response.length ||
|
|
66
|
+
response[finish] !== 10) {
|
|
67
|
+
throw new Error(`Incomplete Git blob ${oid}`);
|
|
68
|
+
}
|
|
69
|
+
contents.set(oid, response.subarray(start, finish));
|
|
70
|
+
offset = finish + 1;
|
|
71
|
+
}
|
|
72
|
+
return contents;
|
|
73
|
+
}
|
|
74
|
+
function sourcePaths(symbols) {
|
|
75
|
+
const parsed = parseYAML(symbols.toString("utf8"));
|
|
76
|
+
if (!parsed ||
|
|
77
|
+
typeof parsed !== "object" ||
|
|
78
|
+
!("symbols" in parsed) ||
|
|
79
|
+
!Array.isArray(parsed.symbols)) {
|
|
80
|
+
throw new Error("Staged .kb/symbols.yaml has no symbols array");
|
|
81
|
+
}
|
|
82
|
+
const sources = new Set();
|
|
83
|
+
for (const symbol of parsed.symbols) {
|
|
84
|
+
const source = symbol?.sourceFile;
|
|
85
|
+
if (typeof source !== "string")
|
|
86
|
+
continue;
|
|
87
|
+
const normalized = path.posix.normalize(source.replaceAll("\\", "/"));
|
|
88
|
+
if (normalized === "." ||
|
|
89
|
+
path.posix.isAbsolute(normalized) ||
|
|
90
|
+
/^[A-Za-z]:/.test(normalized) ||
|
|
91
|
+
normalized.split("/").includes("..")) {
|
|
92
|
+
throw new Error(`Symbol source must be a repository-relative path: ${source}`);
|
|
93
|
+
}
|
|
94
|
+
sources.add(normalized);
|
|
95
|
+
}
|
|
96
|
+
return { paths: [...sources], symbolCount: parsed.symbols.length };
|
|
97
|
+
}
|
|
98
|
+
/** Compare generated artifacts for exactly one captured Git index tree. */
|
|
99
|
+
// implements REQ-cli-check
|
|
100
|
+
export async function checkGeneratedManifests(options = {}) {
|
|
101
|
+
let snapshotDir;
|
|
102
|
+
try {
|
|
103
|
+
const tree = indexTree();
|
|
104
|
+
const { blobs, nonRegularPaths } = treeBlobs(tree);
|
|
105
|
+
const symbolsOid = blobs.get(MANIFESTS[0]);
|
|
106
|
+
if (!symbolsOid)
|
|
107
|
+
throw new Error("Staged .kb/symbols.yaml is missing or is not a regular file");
|
|
108
|
+
const initial = readBlobs([symbolsOid]);
|
|
109
|
+
const symbols = initial.get(symbolsOid);
|
|
110
|
+
if (!symbols)
|
|
111
|
+
throw new Error("Could not read staged .kb/symbols.yaml");
|
|
112
|
+
const { paths: sources, symbolCount } = sourcePaths(symbols);
|
|
113
|
+
// Plain sync does not publish coordinate artifacts for a freshly
|
|
114
|
+
// initialized, empty symbols manifest. The first commit must remain usable.
|
|
115
|
+
if (symbolCount === 0) {
|
|
116
|
+
if (indexTree() !== tree)
|
|
117
|
+
throw new Error("Git index changed during generated-manifest analysis; retry the commit");
|
|
118
|
+
console.log("kibi: staged symbols manifest is empty; no coordinates to refresh.");
|
|
119
|
+
return { exitCode: 0 };
|
|
120
|
+
}
|
|
121
|
+
const nonRegularEntries = [...nonRegularPaths];
|
|
122
|
+
const nonRegular = sources.find((source) => nonRegularEntries.some((entry) => source === entry || source.startsWith(`${entry}/`)));
|
|
123
|
+
if (nonRegular)
|
|
124
|
+
throw new Error(`Staged symbol source is not a regular file: ${nonRegular}`);
|
|
125
|
+
if (options.changedOnly) {
|
|
126
|
+
const changed = new Set(git(["diff", "--cached", "--name-only", "--no-renames", "-z"])
|
|
127
|
+
.toString("utf8")
|
|
128
|
+
.split("\0")
|
|
129
|
+
.filter(Boolean));
|
|
130
|
+
if (![...MANIFESTS, ...sources].some((file) => changed.has(file))) {
|
|
131
|
+
if (indexTree() !== tree)
|
|
132
|
+
throw new Error("Git index changed during generated-manifest analysis; retry the commit");
|
|
133
|
+
console.log("kibi: no staged symbol sources or generated manifests changed.");
|
|
134
|
+
return { exitCode: 0 };
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
const files = [...MANIFESTS, ...sources];
|
|
138
|
+
const objectIds = [
|
|
139
|
+
...new Set(files
|
|
140
|
+
.map((file) => blobs.get(file))
|
|
141
|
+
.filter((oid) => !!oid)),
|
|
142
|
+
];
|
|
143
|
+
const content = readBlobs(objectIds);
|
|
144
|
+
snapshotDir = mkdtempSync(path.join(tmpdir(), "kibi-generated-check-"));
|
|
145
|
+
for (const file of files) {
|
|
146
|
+
const oid = blobs.get(file);
|
|
147
|
+
if (!oid)
|
|
148
|
+
continue;
|
|
149
|
+
const target = path.join(snapshotDir, file);
|
|
150
|
+
mkdirSync(path.dirname(target), { recursive: true });
|
|
151
|
+
const bytes = content.get(oid);
|
|
152
|
+
if (!bytes)
|
|
153
|
+
throw new Error(`Could not read staged blob for ${file}`);
|
|
154
|
+
writeFileSync(target, bytes);
|
|
155
|
+
}
|
|
156
|
+
await refreshManifestCoordinates(path.join(snapshotDir, MANIFESTS[0]), snapshotDir, {
|
|
157
|
+
refreshSymbolCoordinates: true,
|
|
158
|
+
quiet: true,
|
|
159
|
+
});
|
|
160
|
+
const snapshot = snapshotDir;
|
|
161
|
+
const drift = MANIFESTS.filter((file) => {
|
|
162
|
+
const generatedPath = path.join(snapshot, file);
|
|
163
|
+
const expected = existsSync(generatedPath)
|
|
164
|
+
? readFileSync(generatedPath)
|
|
165
|
+
: undefined;
|
|
166
|
+
const oid = blobs.get(file);
|
|
167
|
+
const staged = oid ? content.get(oid) : undefined;
|
|
168
|
+
return expected === undefined
|
|
169
|
+
? staged !== undefined
|
|
170
|
+
: staged === undefined || !expected.equals(staged);
|
|
171
|
+
});
|
|
172
|
+
// An index mutation invalidates every comparison, even if the manifests
|
|
173
|
+
// themselves were untouched. Git will commit the later index state.
|
|
174
|
+
if (indexTree() !== tree)
|
|
175
|
+
throw new Error("Git index changed during generated-manifest analysis; retry the commit");
|
|
176
|
+
if (drift.length > 0) {
|
|
177
|
+
console.error(`kibi: generated manifest drift in staged snapshot: ${drift.join(", ")}`);
|
|
178
|
+
console.error("Run kibi sync --refresh-symbol-coordinates, review the diff, then stage only the intended hunks with git add -p (or git add <path> when the whole file is intended).");
|
|
179
|
+
return { exitCode: 1 };
|
|
180
|
+
}
|
|
181
|
+
console.log("kibi: staged generated manifests are current.");
|
|
182
|
+
return { exitCode: 0 };
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
console.error(`kibi: generated manifest check failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
186
|
+
return { exitCode: 1 };
|
|
187
|
+
}
|
|
188
|
+
finally {
|
|
189
|
+
if (snapshotDir)
|
|
190
|
+
rmSync(snapshotDir, { recursive: true, force: true });
|
|
191
|
+
}
|
|
192
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAiE7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAifD,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EACtC,MAAM,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAC5B,MAAM,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAC3B,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAMpB;AAGD,wBAAsB,YAAY,CAChC,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CA4b/B;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAoDtB;AAID,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBnB;AAED,wBAAsB,eAAe,CACnC,MAAM,EAAE,aAAa,EACrB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBnB;AACD,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAgEtB;AAID,wBAAsB,aAAa,CACjC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAmGtB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,EACrB,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,SAAS,EAAE,CAAC,CAyCtB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAgDtB;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CA0BtB;AAED,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAqBtB;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAqBtB;AAED,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAqBtB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CA+BtB"}
|
package/dist/commands/check.js
CHANGED
|
@@ -29,10 +29,11 @@ import { KIBI_NO_IMPACT_DECLARATION, KIBI_SYMBOLS_MANIFEST_PATH, KIBI_SYMBOL_COO
|
|
|
29
29
|
import { getStagedInventory, supportedStagedFiles, } from "../traceability/git-staged.js";
|
|
30
30
|
import { validateStagedMarkdown } from "../traceability/markdown-validate.js";
|
|
31
31
|
import { collectStagedKibiDiagnostics, } from "../traceability/staged-diagnostics.js";
|
|
32
|
+
import { createStagedEntityIdStyleDiagnostics } from "../traceability/staged-entity-id-style.js";
|
|
32
33
|
import { analyzeStagedFileCoverage, } from "../traceability/staged-file-coverage.js";
|
|
33
34
|
import { classifyKibiImpactEvidence, isBehaviorSourceEdit, parseKibiImpactOverride, } from "../traceability/staged-impact-contract.js";
|
|
34
35
|
import { assessStagedSymbolsManifest, collectStagedAuthoredSymbolsManifestEvidence, } from "../traceability/staged-symbols-manifest.js";
|
|
35
|
-
import { createManifestLookupSentinelKey,
|
|
36
|
+
import { createManifestLookupSentinelKey, extractSymbolsFromStagedFileAsync, } from "../traceability/symbol-extract.js";
|
|
36
37
|
import { cleanupTempKb, consultOverlay, createOverlayFacts, createTempKb, projectStagedEntities, } from "../traceability/temp-kb.js";
|
|
37
38
|
import { formatViolations as formatStagedViolations, validateStagedSymbols, } from "../traceability/validate.js";
|
|
38
39
|
import { resolveBranchAttachment } from "../utils/branch-resolver.js";
|
|
@@ -486,7 +487,8 @@ export async function checkCommand(options) {
|
|
|
486
487
|
if (f.content !== undefined) {
|
|
487
488
|
sourceContentByFile.set(f.path, f.content);
|
|
488
489
|
}
|
|
489
|
-
|
|
490
|
+
// Maintenance path: builtin-only (no CapabilityRegistry / workspaceRoot).
|
|
491
|
+
const symbols = await extractSymbolsFromStagedFileAsync(f, manifestLookup, {});
|
|
490
492
|
symbolsByFile.set(f.path, symbols);
|
|
491
493
|
if (symbols?.length) {
|
|
492
494
|
allSymbols.push(...symbols);
|
|
@@ -543,23 +545,26 @@ export async function checkCommand(options) {
|
|
|
543
545
|
? { activeEntityIds: activeStagedSymbolEntityIds }
|
|
544
546
|
: {}),
|
|
545
547
|
symbolsByFile,
|
|
546
|
-
}), ...createSemanticReviewDiagnostics({ symbolsByFile }));
|
|
548
|
+
}), ...createSemanticReviewDiagnostics({ symbolsByFile }), ...createStagedEntityIdStyleDiagnostics(markdownFiles));
|
|
547
549
|
if (allSymbols.length === 0 && stagedEntityResults.length === 0) {
|
|
548
550
|
if (stagedKibiDiagnostics.length > 0) {
|
|
551
|
+
const blocking = hasBlockingImpactDiagnostics(stagedKibiDiagnostics);
|
|
549
552
|
printStagedResult({
|
|
550
553
|
format: options.format,
|
|
551
554
|
coverage: stagedCoverage,
|
|
552
555
|
qualityDiagnostics: stagedKibiDiagnostics,
|
|
553
|
-
messages: [
|
|
556
|
+
messages: [
|
|
557
|
+
formatStagedKibiDiagnostics(stagedKibiDiagnostics),
|
|
558
|
+
// Advisory-only findings still pass; say so explicitly.
|
|
559
|
+
...(!blocking
|
|
560
|
+
? ["✓ No violations found in staged files."]
|
|
561
|
+
: []),
|
|
562
|
+
],
|
|
554
563
|
});
|
|
555
564
|
if (options.dryRun) {
|
|
556
565
|
return { exitCode: 0 };
|
|
557
566
|
}
|
|
558
|
-
return {
|
|
559
|
-
exitCode: hasBlockingImpactDiagnostics(stagedKibiDiagnostics)
|
|
560
|
-
? 1
|
|
561
|
-
: 0,
|
|
562
|
-
};
|
|
567
|
+
return { exitCode: blocking ? 1 : 0 };
|
|
563
568
|
}
|
|
564
569
|
printStagedResult({
|
|
565
570
|
format: options.format,
|
|
@@ -572,20 +577,23 @@ export async function checkCommand(options) {
|
|
|
572
577
|
}
|
|
573
578
|
if (allSymbols.length === 0) {
|
|
574
579
|
if (stagedKibiDiagnostics.length > 0) {
|
|
580
|
+
const blocking = hasBlockingImpactDiagnostics(stagedKibiDiagnostics);
|
|
575
581
|
printStagedResult({
|
|
576
582
|
format: options.format,
|
|
577
583
|
coverage: stagedCoverage,
|
|
578
584
|
qualityDiagnostics: stagedKibiDiagnostics,
|
|
579
|
-
messages: [
|
|
585
|
+
messages: [
|
|
586
|
+
formatStagedKibiDiagnostics(stagedKibiDiagnostics),
|
|
587
|
+
// Advisory-only findings still pass; say so explicitly.
|
|
588
|
+
...(!blocking
|
|
589
|
+
? ["✓ No violations found in staged files."]
|
|
590
|
+
: []),
|
|
591
|
+
],
|
|
580
592
|
});
|
|
581
593
|
if (options.dryRun) {
|
|
582
594
|
return { exitCode: 0 };
|
|
583
595
|
}
|
|
584
|
-
return {
|
|
585
|
-
exitCode: hasBlockingImpactDiagnostics(stagedKibiDiagnostics)
|
|
586
|
-
? 1
|
|
587
|
-
: 0,
|
|
588
|
-
};
|
|
596
|
+
return { exitCode: blocking ? 1 : 0 };
|
|
589
597
|
}
|
|
590
598
|
printStagedResult({
|
|
591
599
|
format: options.format,
|
|
@@ -849,6 +857,7 @@ export async function checkNoDanglingRefs(prolog) {
|
|
|
849
857
|
"constrains",
|
|
850
858
|
"requires_property",
|
|
851
859
|
"supersedes",
|
|
860
|
+
"restates",
|
|
852
861
|
"relates_to",
|
|
853
862
|
];
|
|
854
863
|
const allRels = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAkEA,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAGD,wBAAsB,aAAa,CACjC,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAgG/B;AAED,wBAAsB,4BAA4B,CAChD,IAAI,GAAE,MAAM,OAAO,CAAC;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAE,CACT,GACxC,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;;;;;;;;;;;;;;MAkE3C;AAkGD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGzE;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAepB"}
|