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":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAmGA,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAoDD,wBAAsB,WAAW,CAC/B,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAwI/B"}
|
package/dist/commands/init.js
CHANGED
|
@@ -15,17 +15,74 @@
|
|
|
15
15
|
You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import { existsSync } from "node:fs";
|
|
18
|
+
import { existsSync, lstatSync, realpathSync } from "node:fs";
|
|
19
19
|
import * as path from "node:path";
|
|
20
20
|
import { fileURLToPath } from "node:url";
|
|
21
21
|
import { classifyActivation } from "../operations/bootstrap/activation.js";
|
|
22
22
|
import { nodeFilesystem } from "../public/operations/node-ports.js";
|
|
23
23
|
import { resolveBranchAttachment } from "../utils/branch-resolver.js";
|
|
24
|
+
import { resolveGitRepository, } from "../utils/git-repository-context.js";
|
|
24
25
|
import { scaffoldGitHubIntegration } from "./github-init.js";
|
|
25
26
|
import { copySchemaFiles, createKbDirectoryStructure, createManifestFile, ensureSymbolsManifestFile, installGitHooks, updateGitIgnore, } from "./init-helpers.js";
|
|
26
27
|
const __filename = fileURLToPath(import.meta.url);
|
|
27
28
|
const __dirname = path.dirname(__filename);
|
|
28
|
-
|
|
29
|
+
/**
|
|
30
|
+
* A hooks directory may be auto-managed only when Git resolves it inside this
|
|
31
|
+
* repository: under the common Git directory (the default hooks location) or
|
|
32
|
+
* under the current worktree root (repository-local relative core.hooksPath).
|
|
33
|
+
* Anything else — global configs, other repositories, external directories —
|
|
34
|
+
* must never receive auto-installed hooks.
|
|
35
|
+
* implements REQ-git-hook-effective-install
|
|
36
|
+
*/
|
|
37
|
+
function isRepositoryManagedHooksDir(context) {
|
|
38
|
+
const realpathAllowMissingTail = (candidate) => {
|
|
39
|
+
let current = path.resolve(candidate);
|
|
40
|
+
const missingSegments = [];
|
|
41
|
+
while (true) {
|
|
42
|
+
try {
|
|
43
|
+
return path.resolve(realpathSync.native(current), ...missingSegments);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
const code = error.code;
|
|
47
|
+
if (code !== "ENOENT" && code !== "ENOTDIR")
|
|
48
|
+
return null;
|
|
49
|
+
// A dangling symlink cannot be canonicalized. Do not treat it as an
|
|
50
|
+
// ordinary missing suffix: mkdir could follow it into an external
|
|
51
|
+
// directory when Git's hooks path is created.
|
|
52
|
+
try {
|
|
53
|
+
if (lstatSync(current).isSymbolicLink())
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
catch (statError) {
|
|
57
|
+
const statCode = statError.code;
|
|
58
|
+
if (statCode !== "ENOENT" && statCode !== "ENOTDIR")
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const parent = path.dirname(current);
|
|
62
|
+
if (parent === current)
|
|
63
|
+
return null;
|
|
64
|
+
missingSegments.unshift(path.basename(current));
|
|
65
|
+
current = parent;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const isWithin = (candidate, root) => {
|
|
70
|
+
const relative = path.relative(root, candidate);
|
|
71
|
+
return (relative === "" ||
|
|
72
|
+
(relative !== ".." &&
|
|
73
|
+
!relative.startsWith(`..${path.sep}`) &&
|
|
74
|
+
!path.isAbsolute(relative)));
|
|
75
|
+
};
|
|
76
|
+
const hooksDir = realpathAllowMissingTail(context.effectiveHooksDir);
|
|
77
|
+
const commonGitDir = realpathAllowMissingTail(context.commonGitDir);
|
|
78
|
+
const worktreeRoot = realpathAllowMissingTail(context.worktreeRoot);
|
|
79
|
+
if (!hooksDir || !commonGitDir || !worktreeRoot)
|
|
80
|
+
return false;
|
|
81
|
+
// The default hooks dir in a linked worktree is shared under the common Git
|
|
82
|
+
// directory, which can sit outside the current worktree root.
|
|
83
|
+
return isWithin(hooksDir, commonGitDir) || isWithin(hooksDir, worktreeRoot);
|
|
84
|
+
}
|
|
85
|
+
async function initNextAction(projectRoot) {
|
|
29
86
|
const sourceFiles = await nodeFilesystem.glob([
|
|
30
87
|
".kb/requirements/**/*.md",
|
|
31
88
|
".kb/scenarios/**/*.md",
|
|
@@ -35,9 +92,9 @@ async function initNextAction() {
|
|
|
35
92
|
".kb/flags/**/*.md",
|
|
36
93
|
".kb/events/**/*.md",
|
|
37
94
|
".kb/facts/**/*.md",
|
|
38
|
-
], { cwd:
|
|
95
|
+
], { cwd: projectRoot });
|
|
39
96
|
const activation = await classifyActivation({
|
|
40
|
-
workspaceRoot:
|
|
97
|
+
workspaceRoot: projectRoot,
|
|
41
98
|
signal: new AbortController().signal,
|
|
42
99
|
clock: () => new Date(),
|
|
43
100
|
fs: nodeFilesystem,
|
|
@@ -67,12 +124,35 @@ export async function initCommand(options) {
|
|
|
67
124
|
console.error("Error: --badge-only requires --github. The recommended integration is `kibi init --github` (badge + full report).");
|
|
68
125
|
return { exitCode: 1 };
|
|
69
126
|
}
|
|
70
|
-
|
|
127
|
+
// Resolve the repository once and derive every project path from Git's own
|
|
128
|
+
// answer, so init works from linked worktrees (.git is a file there) and
|
|
129
|
+
// from subdirectories (cwd has no .kb or .git at all). Bare repositories,
|
|
130
|
+
// unreadable contexts, and operational Git refusals are rejected before any
|
|
131
|
+
// workspace write — even when KIBI_BRANCH makes a standalone fallback
|
|
132
|
+
// available for genuinely non-repository directories.
|
|
133
|
+
// implements REQ-git-hook-effective-install
|
|
134
|
+
const resolution = resolveGitRepository(process.cwd());
|
|
135
|
+
if (resolution.status === "git-refused") {
|
|
136
|
+
console.error(`Error: ${resolution.reason}`);
|
|
137
|
+
console.error("Kibi cannot verify this directory's Git context; refusing to create workspace state.");
|
|
138
|
+
return { exitCode: 1 };
|
|
139
|
+
}
|
|
140
|
+
if (resolution.status === "unsupported") {
|
|
141
|
+
console.error(`Error: ${resolution.reason}`);
|
|
142
|
+
console.error("Kibi requires a working-tree checkout; refusing to create workspace state.");
|
|
143
|
+
return { exitCode: 1 };
|
|
144
|
+
}
|
|
145
|
+
const repoContext = resolution.status === "ok" ? resolution.context : null;
|
|
146
|
+
const projectRoot = repoContext?.worktreeRoot ?? process.cwd();
|
|
147
|
+
const kbDir = path.join(projectRoot, ".kb");
|
|
71
148
|
const kbExists = existsSync(kbDir);
|
|
72
|
-
// Resolve the exact active Git branch
|
|
73
|
-
//
|
|
149
|
+
// Resolve the exact active Git branch against the project root (not cwd):
|
|
150
|
+
// recovery journals, legacy stores, and identity manifests are read from
|
|
151
|
+
// the same .kb tree init is about to write.
|
|
152
|
+
// Standalone use must be explicit via KIBI_BRANCH; there is no implicit
|
|
153
|
+
// default branch.
|
|
74
154
|
let currentBranch;
|
|
75
|
-
const result = resolveBranchAttachment();
|
|
155
|
+
const result = resolveBranchAttachment(projectRoot);
|
|
76
156
|
if ("error" in result) {
|
|
77
157
|
const isNonGitError = result.code === "NOT_A_GIT_REPO" || result.code === "GIT_NOT_AVAILABLE";
|
|
78
158
|
console.error("Error: Failed to resolve the active git branch.");
|
|
@@ -90,7 +170,7 @@ export async function initCommand(options) {
|
|
|
90
170
|
if (!kbExists) {
|
|
91
171
|
createKbDirectoryStructure(kbDir, currentBranch);
|
|
92
172
|
createManifestFile(kbDir);
|
|
93
|
-
updateGitIgnore(
|
|
173
|
+
updateGitIgnore(projectRoot);
|
|
94
174
|
const schemaSourceDir = path.resolve(__dirname, "..", "..", "schema");
|
|
95
175
|
await copySchemaFiles(kbDir, schemaSourceDir);
|
|
96
176
|
}
|
|
@@ -104,14 +184,29 @@ export async function initCommand(options) {
|
|
|
104
184
|
createManifestFile(kbDir);
|
|
105
185
|
}
|
|
106
186
|
}
|
|
107
|
-
ensureSymbolsManifestFile(
|
|
187
|
+
ensureSymbolsManifestFile(projectRoot);
|
|
108
188
|
if (options.hooks) {
|
|
109
|
-
|
|
110
|
-
if (!existsSync(gitDir)) {
|
|
189
|
+
if (!repoContext) {
|
|
111
190
|
console.error("Warning: No git repository found, skipping hooks");
|
|
112
191
|
}
|
|
192
|
+
else if (!isRepositoryManagedHooksDir(repoContext)) {
|
|
193
|
+
// core.hooksPath is only the culprit when it is configured; the
|
|
194
|
+
// default hooks directory can also escape the repository through a
|
|
195
|
+
// symlink, and blaming a setting the operator never made misleads.
|
|
196
|
+
const cause = repoContext.hooksPathConfig
|
|
197
|
+
? "core.hooksPath points outside this repository"
|
|
198
|
+
: "The Git hooks directory resolves outside this repository (for example through a symlink)";
|
|
199
|
+
console.error(`Warning: ${cause} (${repoContext.effectiveHooksDir}); refusing to install hooks into unrelated directories. Kibi enforcement stays OFF for this repository until the hooks path is repository-managed.`);
|
|
200
|
+
}
|
|
113
201
|
else {
|
|
114
|
-
installGitHooks(
|
|
202
|
+
installGitHooks(repoContext.effectiveHooksDir, {
|
|
203
|
+
hooksPathOrigin: repoContext.hooksPathOrigin,
|
|
204
|
+
});
|
|
205
|
+
if (repoContext.isLinkedWorktree && !repoContext.hooksPathConfig) {
|
|
206
|
+
// Only the default common hooks directory is shared by Git across
|
|
207
|
+
// worktrees; a configured hooksPath resolves per checkout.
|
|
208
|
+
console.log(`✓ Repository-common hooks directory shared with all worktrees (${repoContext.effectiveHooksDir})`);
|
|
209
|
+
}
|
|
115
210
|
}
|
|
116
211
|
}
|
|
117
212
|
console.log("\n✓ Kibi initialized. Kibi infrastructure is ready for this repository.");
|
|
@@ -119,11 +214,11 @@ export async function initCommand(options) {
|
|
|
119
214
|
if (kbExists) {
|
|
120
215
|
console.log(" Existing Kibi source knowledge was preserved.");
|
|
121
216
|
}
|
|
122
|
-
console.log((await initNextAction()).message);
|
|
217
|
+
console.log((await initNextAction(projectRoot)).message);
|
|
123
218
|
console.log(" Optional diagnostic: run 'kibi doctor' if setup appears degraded.");
|
|
124
219
|
if (options.github === true) {
|
|
125
220
|
scaffoldGitHubIntegration({
|
|
126
|
-
cwd:
|
|
221
|
+
cwd: projectRoot,
|
|
127
222
|
badgeOnly: options.badgeOnly === true,
|
|
128
223
|
});
|
|
129
224
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ProofExplainOptions = Readonly<{
|
|
2
|
+
id?: string;
|
|
3
|
+
requirement?: string;
|
|
4
|
+
symbol?: string;
|
|
5
|
+
json?: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function proofExplainCommand(options: ProofExplainOptions): Promise<{
|
|
8
|
+
exitCode: number;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=proof-explain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proof-explain.d.ts","sourceRoot":"","sources":["../../src/commands/proof-explain.ts"],"names":[],"mappings":"AAkBA,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC,CAAC;AAGH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAuC/B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Kibi — repo-local, per-branch, queryable long-term memory for software projects
|
|
3
|
+
Copyright (C) 2026 Piotr Franczyk
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify
|
|
6
|
+
it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
(at your option) any later version.
|
|
9
|
+
*/
|
|
10
|
+
import { classifyExplainTarget, executeProofExplain, renderProofExplain, } from "../operations/proof/explain.js";
|
|
11
|
+
import { createCliRuntime } from "../runtime/cli-runtime.js";
|
|
12
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
13
|
+
export async function proofExplainCommand(options) {
|
|
14
|
+
const target = classifyExplainTarget(options.id, {
|
|
15
|
+
...(options.requirement === undefined
|
|
16
|
+
? {}
|
|
17
|
+
: { requirement: options.requirement }),
|
|
18
|
+
...(options.symbol === undefined ? {} : { symbol: options.symbol }),
|
|
19
|
+
});
|
|
20
|
+
const runtime = createCliRuntime();
|
|
21
|
+
const context = await runtime.open({
|
|
22
|
+
name: "kibi_proof_explain",
|
|
23
|
+
effects: [],
|
|
24
|
+
requiresProlog: true,
|
|
25
|
+
execute: async () => undefined,
|
|
26
|
+
}, {});
|
|
27
|
+
let completed = false;
|
|
28
|
+
try {
|
|
29
|
+
const { view } = await executeProofExplain(target, context);
|
|
30
|
+
if (options.json) {
|
|
31
|
+
process.stdout.write(`${JSON.stringify(view, null, 2)}\n`);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
process.stdout.write(renderProofExplain(view));
|
|
35
|
+
}
|
|
36
|
+
completed = true;
|
|
37
|
+
await runtime.afterSuccess({ name: "kibi_proof_explain" }, context);
|
|
38
|
+
return { exitCode: 0 };
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
await runtime.close(context, completed
|
|
42
|
+
? { status: "success", result: 0 }
|
|
43
|
+
: { status: "error", error: 1 });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proof-impact.d.ts","sourceRoot":"","sources":["../../src/commands/proof-impact.ts"],"names":[],"mappings":"AAiBA,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC,CAAC;AAGH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CA8B/B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Kibi — repo-local, per-branch, queryable long-term memory for software projects
|
|
3
|
+
Copyright (C) 2026 Piotr Franczyk
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify
|
|
6
|
+
it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
(at your option) any later version.
|
|
9
|
+
*/
|
|
10
|
+
import { executeProofImpact, proofImpactExitCode, } from "../operations/proof/impact.js";
|
|
11
|
+
import { createCliRuntime } from "../runtime/cli-runtime.js";
|
|
12
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
13
|
+
export async function proofImpactCommand(options) {
|
|
14
|
+
const runtime = createCliRuntime();
|
|
15
|
+
const context = await runtime.open({
|
|
16
|
+
name: "kibi_proof_impact",
|
|
17
|
+
effects: [],
|
|
18
|
+
requiresProlog: true,
|
|
19
|
+
execute: async () => undefined,
|
|
20
|
+
}, {});
|
|
21
|
+
let completed = false;
|
|
22
|
+
try {
|
|
23
|
+
const { result, text } = await executeProofImpact(context);
|
|
24
|
+
if (options.json) {
|
|
25
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
process.stdout.write(text);
|
|
29
|
+
}
|
|
30
|
+
completed = true;
|
|
31
|
+
await runtime.afterSuccess({ name: "kibi_proof_impact" }, context);
|
|
32
|
+
return { exitCode: proofImpactExitCode(result) };
|
|
33
|
+
}
|
|
34
|
+
finally {
|
|
35
|
+
await runtime.close(context, completed
|
|
36
|
+
? { status: "success", result: 0 }
|
|
37
|
+
: { status: "error", error: 1 });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { executeMigrateLegacyReceipts } from "../operations/proof/migrate-legacy-receipts.js";
|
|
19
19
|
import { createCliRuntime } from "../runtime/cli-runtime.js";
|
|
20
|
-
// implements REQ-kibi-
|
|
20
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
21
21
|
export async function proofMigrateLegacyCommand(options) {
|
|
22
22
|
const runtime = createCliRuntime();
|
|
23
23
|
const context = await runtime.open({
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { executePruneReceipts } from "../operations/proof/prune-receipts.js";
|
|
19
19
|
import { createCliRuntime } from "../runtime/cli-runtime.js";
|
|
20
|
-
// implements REQ-kibi-
|
|
20
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
21
21
|
export async function proofPruneCommand(options) {
|
|
22
22
|
const keepRaw = options.keep ?? "1";
|
|
23
23
|
const keep = Number.parseInt(keepRaw, 10);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prove.d.ts","sourceRoot":"","sources":["../../src/commands/prove.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AASjE,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAYnF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC,CAAC;AAGH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC9C,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,kBAAkB,CAAC;CACzC,CAAC,CAAC;AAEH,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5C;;;;;GAKG;AAEH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,GAC1D,MAAM,CAiBR;AAED;;;;GAIG;AAEH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,QAAQ,EAAE,MAAM,GACf,GAAG,CAAC,MAAM,CAAC,CAUb;AAQD,wBAAgB,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAEjD;AAkCD,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,gBAAgB,EAC7B,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,UAAU,CAWnB;
|
|
1
|
+
{"version":3,"file":"prove.d.ts","sourceRoot":"","sources":["../../src/commands/prove.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AASjE,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAYnF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC,CAAC;AAGH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC9C,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,kBAAkB,CAAC;CACzC,CAAC,CAAC;AAEH,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5C;;;;;GAKG;AAEH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,GAC1D,MAAM,CAiBR;AAED;;;;GAIG;AAEH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,QAAQ,EAAE,MAAM,GACf,GAAG,CAAC,MAAM,CAAC,CAUb;AAQD,wBAAgB,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAEjD;AAkCD,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,gBAAgB,EAC7B,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,UAAU,CAWnB;AAsKD,wBAAsB,YAAY,CAChC,OAAO,EAAE,mBAAmB,EAC5B,IAAI,GAAE,wBAA6B,GAClC,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAgL/B"}
|
package/dist/commands/prove.js
CHANGED
|
@@ -16,7 +16,7 @@ import { createCliRuntime } from "../runtime/cli-runtime.js";
|
|
|
16
16
|
* Snapshot-relevant changes come first (receipt-only and ignored edits do
|
|
17
17
|
* not affect the hash), and the list is capped to keep the error readable.
|
|
18
18
|
*/
|
|
19
|
-
// implements REQ-kibi-
|
|
19
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
20
20
|
export function describeWorkspaceDrift(snapshot) {
|
|
21
21
|
if (!snapshot.available)
|
|
22
22
|
return " (workspace snapshot unavailable)";
|
|
@@ -40,7 +40,7 @@ export function describeWorkspaceDrift(snapshot) {
|
|
|
40
40
|
* trimmed, non-empty ids. Empty selectors yield an empty set; blank items
|
|
41
41
|
* fail fast instead of silently narrowing the selection.
|
|
42
42
|
*/
|
|
43
|
-
// implements REQ-kibi-
|
|
43
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
44
44
|
export function parseIntegrationSelector(value, flagName) {
|
|
45
45
|
if (value === undefined || value.trim() === "")
|
|
46
46
|
return new Set();
|
|
@@ -84,7 +84,7 @@ async function runChild(commandArgv, cwd, env) {
|
|
|
84
84
|
child.once("close", (code) => resolve(code ?? 1));
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
-
// implements REQ-kibi-
|
|
87
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
88
88
|
export function commandEnvironment(integration, commandArgv, snapshot, workspaceRoot, testIds, outputPath) {
|
|
89
89
|
return {
|
|
90
90
|
...process.env,
|
|
@@ -151,33 +151,25 @@ function markAggregateFailure(results) {
|
|
|
151
151
|
return results.map((result) => ({ ...result, outcome: "failed" }));
|
|
152
152
|
}
|
|
153
153
|
async function selectTests(context, options) {
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
type: "test",
|
|
162
|
-
limit: pageSize,
|
|
163
|
-
offset,
|
|
164
|
-
});
|
|
165
|
-
all.push(...page);
|
|
166
|
-
if (page.length < pageSize)
|
|
167
|
-
return all;
|
|
168
|
-
}
|
|
169
|
-
};
|
|
154
|
+
// Contract plus bindings only. Receipt histories are loaded again at ingest
|
|
155
|
+
// and blow the Prolog output buffer when selected up front. JUnit and TAP
|
|
156
|
+
// conversion needs the bindings before that reload.
|
|
157
|
+
const loadAll = async () => loadEntities(context.prolog, {
|
|
158
|
+
type: "test",
|
|
159
|
+
projection: "proof_contract",
|
|
160
|
+
});
|
|
170
161
|
let candidates = [];
|
|
171
162
|
if (options.testId) {
|
|
172
163
|
const found = await loadEntities(context.prolog, {
|
|
173
164
|
id: options.testId,
|
|
174
165
|
type: "test",
|
|
166
|
+
projection: "proof_contract",
|
|
175
167
|
});
|
|
176
168
|
candidates = found.map(withId);
|
|
177
169
|
}
|
|
178
170
|
else if (options.requirement) {
|
|
179
171
|
const requirementId = options.requirement;
|
|
180
|
-
const scenarioResult = await context.prolog?.query(`findall([S,T], (kb_relationship(specified_by, '${requirementId}', S), (kb_relationship(verified_by, S, T) ; kb_relationship(validates, T, S))
|
|
172
|
+
const scenarioResult = await context.prolog?.query(`findall([S,T], (kb_relationship(specified_by, '${requirementId}', S), (kb_relationship(verified_by, S, T) ; kb_relationship(validates, T, S))), Rows)`);
|
|
181
173
|
const rowsRaw = scenarioResult?.success
|
|
182
174
|
? scenarioResult.bindings.Rows
|
|
183
175
|
: undefined;
|
|
@@ -189,7 +181,7 @@ async function selectTests(context, options) {
|
|
|
189
181
|
ids.add(test.trim());
|
|
190
182
|
}
|
|
191
183
|
}
|
|
192
|
-
const directResult = await context.prolog?.query(`findall(T,
|
|
184
|
+
const directResult = await context.prolog?.query(`findall(T, kb_relationship(validates, T, '${requirementId}'), Rows)`);
|
|
193
185
|
const directRaw = directResult?.success
|
|
194
186
|
? directResult.bindings.Rows
|
|
195
187
|
: undefined;
|
|
@@ -240,7 +232,7 @@ function summarize(result) {
|
|
|
240
232
|
parts.push(`unchanged ${result.unchanged}`);
|
|
241
233
|
return parts.join(", ");
|
|
242
234
|
}
|
|
243
|
-
// implements REQ-kibi-
|
|
235
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
244
236
|
export async function proveCommand(options, deps = {}) {
|
|
245
237
|
const workspaceRoot = options.workspaceRoot ?? process.cwd();
|
|
246
238
|
const ingestProof = deps.ingestProof ?? executeIngestProof;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,KAAK,cAAc,GAAG,QAAQ,CAAC;IAC7B,YAAY,EAAE,kBAAkB,CAAC;IACjC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,YAAY,CAAC,EAAE,CACb,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,KAAK,EAAE,MAAM,KACV,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7B,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,CAAC,CAAC;AA+HH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgChE;AAeD,wBAAsB,aAAa,CACjC,OAAO,EAAE,aAAa,EACtB,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAyEjB"}
|
package/dist/commands/report.js
CHANGED
|
@@ -7,7 +7,6 @@ import { coverageSpec } from "../public/operations/specs/reporting.js";
|
|
|
7
7
|
import { KIBI_BRAND, renderKibiBadge } from "../report/brand.js";
|
|
8
8
|
import { renderHtmlReport, } from "../report/html-report.js";
|
|
9
9
|
import { resolveReportRepository, } from "../report/repository.js";
|
|
10
|
-
import { createCliRuntime } from "../runtime/cli-runtime.js";
|
|
11
10
|
import { listGitRemotes } from "./github-init.js";
|
|
12
11
|
function gitCommitSha(cwd) {
|
|
13
12
|
try {
|
|
@@ -79,6 +78,9 @@ async function executeCoverageInContext(context, tags, limit) {
|
|
|
79
78
|
};
|
|
80
79
|
}
|
|
81
80
|
async function loadCoverage(tags, limit) {
|
|
81
|
+
// Lazy-load the CLI runtime so coverage suites that inject loadCoverage do
|
|
82
|
+
// not pull the engine/plugin graph into every reportCommand import.
|
|
83
|
+
const { createCliRuntime } = await import("../runtime/cli-runtime.js");
|
|
82
84
|
const runtime = createCliRuntime();
|
|
83
85
|
const runtimeSpec = coverageSpec;
|
|
84
86
|
const context = await runtime.open(runtimeSpec);
|
|
@@ -118,8 +120,21 @@ export async function openReport(filePath) {
|
|
|
118
120
|
detached: true,
|
|
119
121
|
stdio: "ignore",
|
|
120
122
|
});
|
|
121
|
-
|
|
123
|
+
const timer = setTimeout(() => {
|
|
124
|
+
try {
|
|
125
|
+
child.unref();
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
// Best-effort unref if the child never spawned.
|
|
129
|
+
}
|
|
130
|
+
reject(new Error(`Timed out opening report via ${command}`));
|
|
131
|
+
}, 5_000);
|
|
132
|
+
child.once("error", (error) => {
|
|
133
|
+
clearTimeout(timer);
|
|
134
|
+
reject(error);
|
|
135
|
+
});
|
|
122
136
|
child.once("spawn", () => {
|
|
137
|
+
clearTimeout(timer);
|
|
123
138
|
child.unref();
|
|
124
139
|
resolve();
|
|
125
140
|
});
|
|
@@ -21,6 +21,8 @@ export type SyncCache = {
|
|
|
21
21
|
seenAt: Record<string, string>;
|
|
22
22
|
semanticHashes: Record<string, string>;
|
|
23
23
|
semanticContracts: Record<string, boolean>;
|
|
24
|
+
/** Compiler contract that produced the cached compilation; see below. */
|
|
25
|
+
compilerFingerprint?: string;
|
|
24
26
|
};
|
|
25
27
|
/**
|
|
26
28
|
* v2: cache identities are workspace-root relative instead of process-cwd
|
|
@@ -30,6 +32,20 @@ export type SyncCache = {
|
|
|
30
32
|
*/
|
|
31
33
|
export declare const SYNC_CACHE_VERSION = 2;
|
|
32
34
|
export declare const SYNC_CACHE_TTL_MS: number;
|
|
35
|
+
/**
|
|
36
|
+
* Identity of the entity property contract this CLI compiles against. Sync
|
|
37
|
+
* skips unchanged sources by content hash, so a store compiled by a CLI with a
|
|
38
|
+
* different contract (an older build that drops properties it does not know)
|
|
39
|
+
* would otherwise keep that lossy compilation forever. A cache stamped with a
|
|
40
|
+
* different fingerprint is discarded, which re-imports every source once.
|
|
41
|
+
*/
|
|
42
|
+
export declare const SYNC_COMPILER_FINGERPRINT: string;
|
|
43
|
+
/**
|
|
44
|
+
* Stale reason for a branch store whose last compilation used a different
|
|
45
|
+
* compiler contract than the running CLI. Status reports it so a lossy store is
|
|
46
|
+
* visible before the next sync repairs it.
|
|
47
|
+
*/
|
|
48
|
+
export declare function compilerFingerprintReason(storePath: string, deps?: Partial<SyncCacheDeps>): Record<string, unknown> | null;
|
|
33
49
|
export declare function toCacheKey(workspaceRoot: string, filePath: string): string;
|
|
34
50
|
export declare function hashFile(workspaceRoot: string, filePath: string, deps?: Partial<SyncCacheDeps>): string;
|
|
35
51
|
/** Deterministically hash a JSON-compatible compiler payload. */
|
|
@@ -41,7 +57,10 @@ export declare function hashNormalized(value: unknown): string;
|
|
|
41
57
|
* source hash even though the authored YAML bytes stay identical.
|
|
42
58
|
*/
|
|
43
59
|
export declare function hashManifestWithCoordinates(workspaceRoot: string, manifestPath: string, coordinatesPath: string | null, deps?: Partial<SyncCacheDeps>): string;
|
|
44
|
-
export declare function readSyncCache(cachePath: string, deps?: Partial<SyncCacheDeps
|
|
60
|
+
export declare function readSyncCache(cachePath: string, deps?: Partial<SyncCacheDeps>, options?: {
|
|
61
|
+
/** Discard a cache produced under a different compiler contract. */
|
|
62
|
+
readonly compilerFingerprint?: string;
|
|
63
|
+
}): SyncCache;
|
|
45
64
|
export declare function writeSyncCache(cachePath: string, cache: SyncCache, deps?: Partial<SyncCacheDeps>): void;
|
|
46
65
|
export declare function copySyncCache(livePath: string, stagingPath: string, deps?: Partial<SyncCacheDeps>): void;
|
|
47
66
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/cache.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/cache.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7E,UAAU,aAAa;IACrB,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,aAAa,EAAE,OAAO,aAAa,CAAC;CACrC;AAaD,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,sEAAsE;IACtE,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,iEAAiE;IACjE,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3C,kEAAkE;IAClE,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,yEAAyE;IACzE,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,iBAAiB,QAA2B,CAAC;AAE1D;;;;;;GAMG;AAEH,eAAO,MAAM,yBAAyB,QAEtB,CAAC;AAEjB;;;;GAIG;AAEH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAyBhC;AAED,wBAAgB,UAAU,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM1E;AAED,wBAAgB,QAAQ,CAEtB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC5B,MAAM,CAIR;AAED,iEAAiE;AACjE,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAerD;AAED;;;;;GAKG;AAEH,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,GAAG,IAAI,EAC9B,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC5B,MAAM,CA4FR;AAED,wBAAgB,aAAa,CAE3B,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,EAC7B,OAAO,GAAE;IACP,oEAAoE;IACpE,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAClC,GACL,SAAS,CA8DX;AAED,wBAAgB,cAAc,CAE5B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,SAAS,EAChB,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC5B,IAAI,CAaN;AAED,wBAAgB,aAAa,CAE3B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC5B,IAAI,CASN"}
|
|
@@ -19,6 +19,9 @@ import { createHash } from "node:crypto";
|
|
|
19
19
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
20
20
|
import * as path from "node:path";
|
|
21
21
|
import { load as parseYAML } from "js-yaml";
|
|
22
|
+
import entitySchema from "../../schemas/entity.schema.json" with {
|
|
23
|
+
type: "json"
|
|
24
|
+
};
|
|
22
25
|
function resolveDeps(overrides) {
|
|
23
26
|
return {
|
|
24
27
|
createHash,
|
|
@@ -37,6 +40,47 @@ function resolveDeps(overrides) {
|
|
|
37
40
|
*/
|
|
38
41
|
export const SYNC_CACHE_VERSION = 2;
|
|
39
42
|
export const SYNC_CACHE_TTL_MS = 30 * 24 * 60 * 60 * 1000;
|
|
43
|
+
/**
|
|
44
|
+
* Identity of the entity property contract this CLI compiles against. Sync
|
|
45
|
+
* skips unchanged sources by content hash, so a store compiled by a CLI with a
|
|
46
|
+
* different contract (an older build that drops properties it does not know)
|
|
47
|
+
* would otherwise keep that lossy compilation forever. A cache stamped with a
|
|
48
|
+
* different fingerprint is discarded, which re-imports every source once.
|
|
49
|
+
*/
|
|
50
|
+
// implements REQ-cli-canonical-runtime
|
|
51
|
+
export const SYNC_COMPILER_FINGERPRINT = createHash("sha256")
|
|
52
|
+
.update(JSON.stringify(entitySchema))
|
|
53
|
+
.digest("hex");
|
|
54
|
+
/**
|
|
55
|
+
* Stale reason for a branch store whose last compilation used a different
|
|
56
|
+
* compiler contract than the running CLI. Status reports it so a lossy store is
|
|
57
|
+
* visible before the next sync repairs it.
|
|
58
|
+
*/
|
|
59
|
+
// implements REQ-cli-canonical-runtime
|
|
60
|
+
export function compilerFingerprintReason(storePath, deps) {
|
|
61
|
+
const resolved = resolveDeps(deps);
|
|
62
|
+
const cachePath = path.join(storePath, "sync-cache.json");
|
|
63
|
+
if (!resolved.existsSync(cachePath))
|
|
64
|
+
return null;
|
|
65
|
+
let recorded;
|
|
66
|
+
try {
|
|
67
|
+
recorded = JSON.parse(resolved.readFileSync(cachePath, "utf8")).compilerFingerprint;
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
if (recorded === SYNC_COMPILER_FINGERPRINT)
|
|
73
|
+
return null;
|
|
74
|
+
return {
|
|
75
|
+
code: "compiler_changed",
|
|
76
|
+
path: cachePath,
|
|
77
|
+
entityIds: [],
|
|
78
|
+
detail: typeof recorded === "string"
|
|
79
|
+
? "The branch KB was compiled by a Kibi CLI with a different entity property contract, so unchanged sources may lack properties this CLI keeps. The next kibi sync re-imports every source."
|
|
80
|
+
: "The branch KB was compiled by a Kibi CLI that did not record its entity property contract, so unchanged sources may lack properties this CLI keeps. The next kibi sync re-imports every source.",
|
|
81
|
+
remediation: { command_argv: ["kibi", "sync"], applyRequired: false },
|
|
82
|
+
};
|
|
83
|
+
}
|
|
40
84
|
export function toCacheKey(workspaceRoot, filePath) {
|
|
41
85
|
const root = path.resolve(workspaceRoot);
|
|
42
86
|
const target = path.isAbsolute(filePath)
|
|
@@ -165,7 +209,7 @@ export function hashManifestWithCoordinates(workspaceRoot, manifestPath, coordin
|
|
|
165
209
|
}
|
|
166
210
|
export function readSyncCache(
|
|
167
211
|
// implements REQ-003
|
|
168
|
-
cachePath, deps) {
|
|
212
|
+
cachePath, deps, options = {}) {
|
|
169
213
|
const resolved = resolveDeps(deps);
|
|
170
214
|
if (!resolved.existsSync(cachePath)) {
|
|
171
215
|
return {
|
|
@@ -178,7 +222,9 @@ cachePath, deps) {
|
|
|
178
222
|
}
|
|
179
223
|
try {
|
|
180
224
|
const parsed = JSON.parse(resolved.readFileSync(cachePath, "utf8"));
|
|
181
|
-
if (parsed.version !== SYNC_CACHE_VERSION
|
|
225
|
+
if (parsed.version !== SYNC_CACHE_VERSION ||
|
|
226
|
+
(options.compilerFingerprint !== undefined &&
|
|
227
|
+
parsed.compilerFingerprint !== options.compilerFingerprint)) {
|
|
182
228
|
return {
|
|
183
229
|
version: SYNC_CACHE_VERSION,
|
|
184
230
|
hashes: {},
|
|
@@ -206,6 +252,9 @@ cachePath, deps) {
|
|
|
206
252
|
if (parsed.shardRelationships !== undefined) {
|
|
207
253
|
cache.shardRelationships = parsed.shardRelationships;
|
|
208
254
|
}
|
|
255
|
+
if (parsed.compilerFingerprint !== undefined) {
|
|
256
|
+
cache.compilerFingerprint = parsed.compilerFingerprint;
|
|
257
|
+
}
|
|
209
258
|
return cache;
|
|
210
259
|
}
|
|
211
260
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/discovery.ts"],"names":[],"mappings":"AAkCA,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,+EAA+E;IAC/E,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAAC;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/discovery.ts"],"names":[],"mappings":"AAkCA,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,+EAA+E;IAC/E,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAAC;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AA2FH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOlD;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAShE;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAUxD;AAED,wBAAgB,mCAAmC,CACjD,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,SAAS,4BAA4B,EAAE,GAChD,IAAI,CA6CN;AAsBD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,MAAM,GAAG,IAAI,CAIf;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC;IACT,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,4BAA4B,EAAE,4BAA4B,EAAE,CAAC;CAC9D,CAAC,CA+FD"}
|
|
@@ -67,7 +67,7 @@ function pendingSourcePaths(cwd, recoverMissing) {
|
|
|
67
67
|
});
|
|
68
68
|
continue;
|
|
69
69
|
}
|
|
70
|
-
throw new Error(`Pending source is missing: ${relative}
|
|
70
|
+
throw new Error(`Pending source is missing: ${relative}. If the file was deleted on purpose, run 'kibi branch recover --apply' to rebuild the branch KB from the sources that remain.`);
|
|
71
71
|
}
|
|
72
72
|
const actual = createHash("sha256")
|
|
73
73
|
.update(readFileSync(absolute))
|
|
@@ -31,6 +31,7 @@ export { COARSE_GRANULARITY_REASONS };
|
|
|
31
31
|
export declare function isCoarseGranularityAnchor(entry: ManifestSymbolEntry): boolean;
|
|
32
32
|
export declare function refreshManifestCoordinates(manifestPath: string, workspaceRoot: string, deps?: Partial<ManifestDeps> & {
|
|
33
33
|
refreshSymbolCoordinates?: boolean;
|
|
34
|
+
quiet?: boolean;
|
|
34
35
|
}): Promise<void>;
|
|
35
36
|
export declare function hasAllGeneratedCoordinates(entry: ManifestSymbolEntry): boolean;
|
|
36
37
|
export declare function isEligibleForCoordinateRefresh(sourceFile: string | undefined, workspaceRoot: string, deps?: Partial<ManifestDeps>): boolean;
|