kibi-cli 2.1.0 → 2.3.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-operation-loader.d.ts.map +1 -1
- package/dist/cli-operation-loader.js +3 -0
- package/dist/cli-operation-metadata.d.ts +4 -0
- package/dist/cli-operation-metadata.d.ts.map +1 -1
- package/dist/cli-operation-metadata.js +5 -0
- package/dist/cli-protocol.d.ts.map +1 -1
- package/dist/cli-protocol.js +3 -2
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +4 -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-diff.d.ts +5 -0
- package/dist/commands/check-diff.d.ts.map +1 -0
- package/dist/commands/check-diff.js +62 -0
- package/dist/commands/check-generated.d.ts.map +1 -1
- package/dist/commands/check-generated.js +41 -18
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +231 -86
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +168 -53
- 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 +10 -3
- 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 +123 -23
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +110 -15
- package/dist/commands/prove.d.ts.map +1 -1
- package/dist/commands/prove.js +10 -18
- 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.map +1 -1
- package/dist/commands/sync/manifest.js +3 -1
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +8 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +11 -3
- package/dist/engine.d.ts +41 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +377 -80
- package/dist/extractors/manifest.d.ts.map +1 -1
- package/dist/extractors/manifest.js +66 -28
- package/dist/extractors/markdown.d.ts +2 -0
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +14 -3
- package/dist/extractors/relationships.d.ts.map +1 -1
- package/dist/extractors/relationships.js +1 -0
- package/dist/extractors/symbols-coordinator.d.ts +7 -0
- package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.js +75 -39
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +68 -29
- 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 +176 -10
- 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-inference-1.js +1 -1
- 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/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 +213 -52
- package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
- package/dist/operations/mutation/strict-fact.js +5 -0
- 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 +77 -11
- 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 +66 -26
- package/dist/operations/planning/compile-intent.d.ts.map +1 -1
- package/dist/operations/planning/compile-intent.js +3 -1
- 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/ingest-proof.d.ts +4 -2
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
- package/dist/operations/proof/ingest-proof.js +208 -74
- package/dist/operations/proof/migrate-legacy-receipts.d.ts.map +1 -1
- package/dist/operations/proof/migrate-legacy-receipts.js +7 -5
- package/dist/operations/proof/prune-receipts.d.ts.map +1 -1
- package/dist/operations/proof/prune-receipts.js +7 -5
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analysis-receipt.js +7 -1
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +26 -4
- package/dist/operations/semantic-advisor/clauses.d.ts +1 -0
- package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/clauses.js +7 -1
- package/dist/performance-trace.d.ts +17 -0
- package/dist/performance-trace.d.ts.map +1 -0
- package/dist/performance-trace.js +134 -0
- package/dist/plugins/approved-source-analyzers.d.ts +13 -0
- package/dist/plugins/approved-source-analyzers.d.ts.map +1 -0
- package/dist/plugins/approved-source-analyzers.generated.d.ts +71 -0
- package/dist/plugins/approved-source-analyzers.generated.d.ts.map +1 -0
- package/dist/plugins/approved-source-analyzers.generated.js +77 -0
- package/dist/plugins/approved-source-analyzers.js +3 -0
- package/dist/plugins/compose-semantic-classifier.d.ts +6 -1
- package/dist/plugins/compose-semantic-classifier.d.ts.map +1 -1
- package/dist/plugins/compose-semantic-classifier.js +8 -3
- 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 +7 -0
- package/dist/plugins/external-allowlist.d.ts.map +1 -1
- package/dist/plugins/external-allowlist.js +13 -0
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +4 -0
- package/dist/plugins/maintenance-source-analysis.d.ts +14 -0
- package/dist/plugins/maintenance-source-analysis.d.ts.map +1 -0
- package/dist/plugins/maintenance-source-analysis.js +191 -0
- package/dist/plugins/registry.d.ts +3 -1
- package/dist/plugins/registry.d.ts.map +1 -1
- package/dist/plugins/registry.js +27 -1
- package/dist/plugins/source-analysis-service.d.ts +36 -1
- package/dist/plugins/source-analysis-service.d.ts.map +1 -1
- package/dist/plugins/source-analysis-service.js +184 -27
- package/dist/plugins/source-change-analysis.d.ts +15 -0
- package/dist/plugins/source-change-analysis.d.ts.map +1 -0
- package/dist/plugins/source-change-analysis.js +54 -0
- package/dist/plugins/source-classification.d.ts +41 -0
- package/dist/plugins/source-classification.d.ts.map +1 -0
- package/dist/plugins/source-classification.js +490 -0
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +2 -0
- package/dist/prolog/swipl-resolver.d.ts +88 -0
- package/dist/prolog/swipl-resolver.d.ts.map +1 -0
- package/dist/prolog/swipl-resolver.js +446 -0
- package/dist/prolog.d.ts +51 -1
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +145 -15
- package/dist/public/diagnostic-usage.d.ts.map +1 -1
- package/dist/public/diagnostic-usage.js +7 -25
- package/dist/public/impact/analyzer.d.ts.map +1 -1
- package/dist/public/impact/analyzer.js +56 -5
- package/dist/public/impact/diagnostics.d.ts.map +1 -1
- package/dist/public/impact/diagnostics.js +3 -1
- 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/impact/manifest.d.ts.map +1 -1
- package/dist/public/impact/manifest.js +15 -1
- package/dist/public/impact/source-changes.d.ts.map +1 -1
- package/dist/public/impact/source-changes.js +35 -27
- package/dist/public/impact/types.d.ts +2 -0
- package/dist/public/impact/types.d.ts.map +1 -1
- package/dist/public/operations/catalog.d.ts +80 -7
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/catalog.js +2 -0
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +10 -2
- package/dist/public/operations/check-helpers.d.ts +6 -0
- package/dist/public/operations/check-helpers.d.ts.map +1 -1
- package/dist/public/operations/check-helpers.js +21 -1
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +325 -8
- package/dist/public/operations/discovery-entities.d.ts +42 -2
- package/dist/public/operations/discovery-entities.d.ts.map +1 -1
- package/dist/public/operations/discovery-entities.js +195 -22
- 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 +75 -46
- package/dist/public/operations/impact-review-preparation.d.ts +14 -0
- package/dist/public/operations/impact-review-preparation.d.ts.map +1 -0
- package/dist/public/operations/impact-review-preparation.js +379 -0
- package/dist/public/operations/index.d.ts +2 -0
- package/dist/public/operations/index.d.ts.map +1 -1
- package/dist/public/operations/index.js +2 -0
- 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/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +1 -35
- 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.map +1 -1
- package/dist/public/operations/prolog-json.js +9 -3
- package/dist/public/operations/proof-receipt-projection.d.ts +5 -0
- package/dist/public/operations/proof-receipt-projection.d.ts.map +1 -0
- package/dist/public/operations/proof-receipt-projection.js +36 -0
- 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 +1 -1
- 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 +8 -1
- package/dist/public/operations/specs/check.d.ts +1 -1
- package/dist/public/operations/specs/discovery.d.ts +7 -1
- package/dist/public/operations/specs/discovery.d.ts.map +1 -1
- package/dist/public/operations/specs/discovery.js +7 -1
- package/dist/public/operations/specs/impact-review-preparation.d.ts +47 -0
- package/dist/public/operations/specs/impact-review-preparation.d.ts.map +1 -0
- package/dist/public/operations/specs/impact-review-preparation.js +43 -0
- 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/reporting.d.ts +8 -0
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +46 -15
- 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 +8 -3
- package/dist/public/operations/types.d.ts +1 -1
- package/dist/public/operations/types.d.ts.map +1 -1
- 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 +7 -3
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +4 -0
- package/dist/public/skills/kibi-usage/resources/operation-access.md +1 -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/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/schemas/entity.schema.json +32 -0
- package/dist/traceability/analysis-gate.d.ts +39 -0
- package/dist/traceability/analysis-gate.d.ts.map +1 -0
- package/dist/traceability/analysis-gate.js +51 -0
- package/dist/traceability/git-change-snapshot.d.ts +27 -0
- package/dist/traceability/git-change-snapshot.d.ts.map +1 -0
- package/dist/traceability/git-change-snapshot.js +411 -0
- package/dist/traceability/git-staged.d.ts +5 -1
- package/dist/traceability/git-staged.d.ts.map +1 -1
- package/dist/traceability/git-staged.js +16 -11
- package/dist/traceability/impact-evaluator.d.ts +54 -0
- package/dist/traceability/impact-evaluator.d.ts.map +1 -0
- package/dist/traceability/impact-evaluator.js +270 -0
- package/dist/traceability/impact-git-tree.d.ts +12 -0
- package/dist/traceability/impact-git-tree.d.ts.map +1 -0
- package/dist/traceability/impact-git-tree.js +46 -0
- package/dist/traceability/impact-knowledge.d.ts +16 -0
- package/dist/traceability/impact-knowledge.d.ts.map +1 -0
- package/dist/traceability/impact-knowledge.js +165 -0
- package/dist/traceability/impact-policy.d.ts +15 -0
- package/dist/traceability/impact-policy.d.ts.map +1 -0
- package/dist/traceability/impact-policy.js +48 -0
- package/dist/traceability/impact-policy.v1.schema.json +48 -0
- package/dist/traceability/impact-pr-diff.d.ts +5 -0
- package/dist/traceability/impact-pr-diff.d.ts.map +1 -0
- package/dist/traceability/impact-pr-diff.js +83 -0
- package/dist/traceability/impact-record-validation.d.ts +9 -0
- package/dist/traceability/impact-record-validation.d.ts.map +1 -0
- package/dist/traceability/impact-record-validation.js +113 -0
- package/dist/traceability/impact-review.d.ts +148 -0
- package/dist/traceability/impact-review.d.ts.map +1 -0
- package/dist/traceability/impact-review.js +494 -0
- package/dist/traceability/impact-review.schema.json +365 -0
- package/dist/traceability/impact-side-evidence.d.ts +13 -0
- package/dist/traceability/impact-side-evidence.d.ts.map +1 -0
- package/dist/traceability/impact-side-evidence.js +240 -0
- package/dist/traceability/reviewed-coordinate-refresh.d.ts +10 -0
- package/dist/traceability/reviewed-coordinate-refresh.d.ts.map +1 -0
- package/dist/traceability/reviewed-coordinate-refresh.js +49 -0
- package/dist/traceability/snapshot-knowledge.d.ts +4 -0
- package/dist/traceability/snapshot-knowledge.d.ts.map +1 -0
- package/dist/traceability/snapshot-knowledge.js +98 -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/staged-file-coverage.d.ts +23 -0
- package/dist/traceability/staged-file-coverage.d.ts.map +1 -1
- package/dist/traceability/staged-impact-contract.d.ts.map +1 -1
- package/dist/traceability/staged-impact-contract.js +2 -16
- package/dist/traceability/staged-symbols-manifest.d.ts +4 -0
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +17 -6
- package/dist/traceability/symbol-extract.d.ts +3 -5
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +49 -34
- package/dist/traceability/temp-kb.d.ts +1 -1
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +57 -13
- package/dist/traceability/trusted-pr-event.d.ts +13 -0
- package/dist/traceability/trusted-pr-event.d.ts.map +1 -0
- package/dist/traceability/trusted-pr-event.js +105 -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/canonical-path.d.ts +3 -0
- package/dist/utils/canonical-path.d.ts.map +1 -0
- package/dist/utils/canonical-path.js +33 -0
- 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 +37 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +44 -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 -5
- 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/impact/analyzer.ts +88 -5
- package/src/public/impact/diagnostics.ts +7 -5
- package/src/public/impact/full-kb-quality.ts +4 -16
- package/src/public/impact/manifest.ts +14 -1
- package/src/public/impact/source-changes.ts +39 -34
- package/src/public/impact/types.ts +5 -0
- package/src/public/operations/catalog.ts +2 -0
- package/src/public/operations/check-executor.ts +12 -1
- package/src/public/operations/check-helpers.ts +27 -1
- package/src/public/operations/contracts.ts +404 -9
- package/src/public/operations/discovery-entities.ts +292 -23
- package/src/public/operations/discovery-executors.ts +91 -55
- package/src/public/operations/impact-review-preparation.ts +548 -0
- package/src/public/operations/index.ts +2 -0
- package/src/public/operations/migration-plan.ts +57 -0
- package/src/public/operations/node-ports.ts +1 -39
- package/src/public/operations/predicate-schema-conformance.ts +362 -0
- package/src/public/operations/prolog-json.ts +9 -3
- package/src/public/operations/proof-receipt-projection.ts +39 -0
- package/src/public/operations/result-envelope.ts +114 -2
- package/src/public/operations/runtime-types.ts +1 -1
- package/src/public/operations/specs/check-rules.generated.ts +8 -1
- package/src/public/operations/specs/discovery.ts +8 -1
- package/src/public/operations/specs/impact-review-preparation.ts +46 -0
- package/src/public/operations/specs/mutation-schemas.ts +23 -3
- package/src/public/operations/specs/reporting.ts +69 -22
- package/src/public/operations/specs/upsert.ts +1 -1
- package/src/public/operations/symbol-repair-plan.ts +13 -3
- package/src/public/operations/types.ts +1 -0
- package/src/public/schemas/entity.ts +22 -0
- package/src/public/schemas/relationship.ts +1 -0
- package/src/public/skills/kibi-usage/SKILL.md +7 -3
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +4 -0
- package/src/public/skills/kibi-usage/resources/operation-access.md +1 -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/telemetry-acceptance.ts +37 -6
- package/src/schemas/entity.schema.json +32 -0
- package/src/schemas/relationship.schema.json +1 -0
- package/src/traceability/impact-policy.v1.schema.json +48 -0
- package/src/traceability/impact-review.schema.json +365 -0
- package/templates/github/kibi-badge.yml +0 -4
- package/templates/github/kibi-report.yml +0 -4
package/dist/commands/check.js
CHANGED
|
@@ -15,20 +15,25 @@
|
|
|
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";
|
|
19
18
|
import * as path from "node:path";
|
|
20
19
|
import { EngineClient } from "../engine.js";
|
|
21
|
-
import {
|
|
22
|
-
import { extractFromManifest, extractFromManifestString, } from "../extractors/manifest.js";
|
|
20
|
+
import { extractFromManifestString } from "../extractors/manifest.js";
|
|
23
21
|
import { extractFromMarkdownString, } from "../extractors/markdown.js";
|
|
22
|
+
import { createMaintenanceSourceAnalysisService, fingerprintMaintenanceSourceSet, readSnapshotSourceConfig, } from "../plugins/maintenance-source-analysis.js";
|
|
23
|
+
import { analyzeSourceChanges, assertSourceAnalysisGate, } from "../plugins/source-change-analysis.js";
|
|
24
24
|
import { PrologProcess } from "../prolog.js";
|
|
25
25
|
import { escapeAtom, normalizeEntityId, parseTriples, parseViolationRows, } from "../prolog/codec.js";
|
|
26
26
|
import { createSemanticReviewDiagnostics, createSymbolGranularityDiagnostics, createSymbolQualityDiagnostics, hasBlockingImpactDiagnostics, } from "../public/impact-diagnostics.js";
|
|
27
27
|
import { executeCheck } from "../public/operations/check-executor.js";
|
|
28
28
|
import { KIBI_NO_IMPACT_DECLARATION, KIBI_SYMBOLS_MANIFEST_PATH, KIBI_SYMBOL_COORDINATES_PATH, } from "../traceability/evidence-model.js";
|
|
29
|
-
import {
|
|
29
|
+
import { captureStagedSnapshot } from "../traceability/git-change-snapshot.js";
|
|
30
|
+
import { supportedStagedFiles, } from "../traceability/git-staged.js";
|
|
31
|
+
import { evaluateImpactReview, fingerprintImpactEvaluator, hasValidBaseImpactPolicy, } from "../traceability/impact-evaluator.js";
|
|
32
|
+
import { IMPACT_REVIEW_PATH } from "../traceability/impact-review.js";
|
|
30
33
|
import { validateStagedMarkdown } from "../traceability/markdown-validate.js";
|
|
34
|
+
import { readSnapshotKnowledge } from "../traceability/snapshot-knowledge.js";
|
|
31
35
|
import { collectStagedKibiDiagnostics, } from "../traceability/staged-diagnostics.js";
|
|
36
|
+
import { createStagedEntityIdStyleDiagnostics } from "../traceability/staged-entity-id-style.js";
|
|
32
37
|
import { analyzeStagedFileCoverage, } from "../traceability/staged-file-coverage.js";
|
|
33
38
|
import { classifyKibiImpactEvidence, isBehaviorSourceEdit, parseKibiImpactOverride, } from "../traceability/staged-impact-contract.js";
|
|
34
39
|
import { assessStagedSymbolsManifest, collectStagedAuthoredSymbolsManifestEvidence, } from "../traceability/staged-symbols-manifest.js";
|
|
@@ -42,7 +47,7 @@ function getMatchGroup(match, index = 1) {
|
|
|
42
47
|
const value = match?.[index];
|
|
43
48
|
return typeof value === "string" ? value : null;
|
|
44
49
|
}
|
|
45
|
-
function buildManifestLookup(stagedFiles) {
|
|
50
|
+
function buildManifestLookup(stagedFiles, snapshotEntities) {
|
|
46
51
|
const manifestLookup = new Map();
|
|
47
52
|
const manifestResults = [];
|
|
48
53
|
const authoredSymbolResults = [];
|
|
@@ -68,40 +73,29 @@ function buildManifestLookup(stagedFiles) {
|
|
|
68
73
|
results[existingIndex] = result;
|
|
69
74
|
}
|
|
70
75
|
};
|
|
71
|
-
//
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
.filter((relationship) => relationship.type === "implements" ||
|
|
88
|
-
relationship.type === "covered_by" ||
|
|
89
|
-
relationship.type === "executable_for")
|
|
90
|
-
.map((relationship) => ({
|
|
91
|
-
type: relationship.type,
|
|
92
|
-
to: relationship.to,
|
|
93
|
-
})),
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
catch (e) {
|
|
98
|
-
// Ignore working-tree manifest parsing errors; staged-only fallback still applies
|
|
99
|
-
if (isCliTraceOrDebugEnabled()) {
|
|
100
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
101
|
-
console.debug(`[kibi] skipping working-tree manifest ${absSymbolsPath}: ${msg}`);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
76
|
+
// Authored ownership comes exclusively from the captured index tree.
|
|
77
|
+
// A sentinel prevents symbol extraction from consulting working-tree manifests.
|
|
78
|
+
manifestLookup.set(createManifestLookupSentinelKey(CANONICAL_ENTITY_PATHS.symbols), { id: CANONICAL_ENTITY_PATHS.symbols });
|
|
79
|
+
const ambiguousLocators = new Set();
|
|
80
|
+
for (const entry of snapshotEntities.filter((entry) => entry.entity.type === "symbol")) {
|
|
81
|
+
upsertResult(authoredSymbolResults, authoredSymbolIndexByKey, entry);
|
|
82
|
+
const sourceFile = entry.sourceFile || entry.entity.source;
|
|
83
|
+
if (!sourceFile)
|
|
84
|
+
continue;
|
|
85
|
+
const key = `${sourceFile}:${entry.entity.title}`;
|
|
86
|
+
if (ambiguousLocators.has(key))
|
|
87
|
+
continue;
|
|
88
|
+
if (manifestLookup.has(key)) {
|
|
89
|
+
manifestLookup.delete(key);
|
|
90
|
+
ambiguousLocators.add(key);
|
|
91
|
+
continue;
|
|
104
92
|
}
|
|
93
|
+
manifestLookup.set(key, {
|
|
94
|
+
id: entry.entity.id,
|
|
95
|
+
relationships: entry.relationships
|
|
96
|
+
.filter((r) => ["implements", "covered_by", "executable_for"].includes(r.type))
|
|
97
|
+
.map((r) => ({ type: r.type, to: r.to })),
|
|
98
|
+
});
|
|
105
99
|
}
|
|
106
100
|
const stagedManifestFiles = stagedFiles.filter((file) => file.content !== undefined &&
|
|
107
101
|
(file.path === CANONICAL_ENTITY_PATHS.symbols ||
|
|
@@ -131,19 +125,6 @@ function buildManifestLookup(stagedFiles) {
|
|
|
131
125
|
upsertResult(manifestResults, manifestResultIndexByKey, manifestResult, true);
|
|
132
126
|
upsertResult(authoredSymbolResults, authoredSymbolIndexByKey, authoredSymbolResult, true);
|
|
133
127
|
upsertResult(stagedAuthoredSymbolResults, stagedAuthoredSymbolIndexByKey, authoredSymbolResult);
|
|
134
|
-
const sourceFile = entry.sourceFile || entry.entity.source || manifestFile.path;
|
|
135
|
-
const key = `${sourceFile}:${entry.entity.title}`;
|
|
136
|
-
manifestLookup.set(key, {
|
|
137
|
-
id: entry.entity.id,
|
|
138
|
-
relationships: entry.relationships
|
|
139
|
-
.filter((relationship) => relationship.type === "implements" ||
|
|
140
|
-
relationship.type === "covered_by" ||
|
|
141
|
-
relationship.type === "executable_for")
|
|
142
|
-
.map((relationship) => ({
|
|
143
|
-
type: relationship.type,
|
|
144
|
-
to: relationship.to,
|
|
145
|
-
})),
|
|
146
|
-
});
|
|
147
128
|
}
|
|
148
129
|
}
|
|
149
130
|
catch {
|
|
@@ -303,6 +284,39 @@ function printStagedResult(input) {
|
|
|
303
284
|
if (input.operationalError)
|
|
304
285
|
console.error(input.operationalError);
|
|
305
286
|
}
|
|
287
|
+
function clearResolvedImpactReviewAdvisories(coverage) {
|
|
288
|
+
const transport = coverage.files.find((file) => file.path === IMPACT_REVIEW_PATH);
|
|
289
|
+
const plainTransportChange = transport !== undefined &&
|
|
290
|
+
(transport.status === "A" || transport.status === "M") &&
|
|
291
|
+
transport.oldPath === undefined;
|
|
292
|
+
const reviewedPaths = new Set(coverage.files
|
|
293
|
+
.filter((file) => file.path !== IMPACT_REVIEW_PATH)
|
|
294
|
+
.map((file) => file.path));
|
|
295
|
+
coverage.diagnostics = coverage.diagnostics.filter((diagnostic) => {
|
|
296
|
+
if (diagnostic.id === "staged_file_impact_review_needed" &&
|
|
297
|
+
reviewedPaths.has(diagnostic.path)) {
|
|
298
|
+
return false;
|
|
299
|
+
}
|
|
300
|
+
return !(diagnostic.id === "staged_file_ownership_missing" &&
|
|
301
|
+
diagnostic.path === IMPACT_REVIEW_PATH &&
|
|
302
|
+
plainTransportChange);
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
function noValidatedSymbolsMessage(sourceAnalysis) {
|
|
306
|
+
const partialFiles = [...sourceAnalysis.values()].flatMap((analysis) => {
|
|
307
|
+
const partialSide = [analysis.before, analysis.after].find((side) => side?.status === "partial");
|
|
308
|
+
if (!partialSide)
|
|
309
|
+
return [];
|
|
310
|
+
const provider = partialSide.providerId
|
|
311
|
+
? ` via ${partialSide.providerId}`
|
|
312
|
+
: "";
|
|
313
|
+
return [`${analysis.path}${provider}`];
|
|
314
|
+
});
|
|
315
|
+
if (partialFiles.length > 0) {
|
|
316
|
+
return `Partial source analysis was reviewed for ${partialFiles.join(", ")}; no fully analyzed exported symbols or staged entities were available for symbol validation.`;
|
|
317
|
+
}
|
|
318
|
+
return "No exported symbols or staged entities found in staged files.";
|
|
319
|
+
}
|
|
306
320
|
function uniqueSorted(values) {
|
|
307
321
|
return Array.from(new Set(values)).sort();
|
|
308
322
|
}
|
|
@@ -334,11 +348,14 @@ function buildStagedKibiImpactEvidence(options) {
|
|
|
334
348
|
const allSourcePaths = sourceChanges.map((change) => change.path);
|
|
335
349
|
const behaviorSourceFiles = sourceFiles.filter((file) => behaviorSourcePaths.includes(file.path));
|
|
336
350
|
const stagedSymbolsManifest = assessStagedSymbolsManifest({
|
|
351
|
+
...(options.analyzeSource ? { analyzeSource: options.analyzeSource } : {}),
|
|
352
|
+
...(options.readBaseFile ? { readBaseFile: options.readBaseFile } : {}),
|
|
337
353
|
symbolsManifestPath,
|
|
338
354
|
stagedFiles,
|
|
339
355
|
sourceFiles: behaviorSourceFiles,
|
|
340
356
|
});
|
|
341
357
|
const stagedAuthoredSymbolsEvidence = collectStagedAuthoredSymbolsManifestEvidence({
|
|
358
|
+
...(options.readBaseFile ? { readBaseFile: options.readBaseFile } : {}),
|
|
342
359
|
stagedFiles,
|
|
343
360
|
sourceFiles: behaviorSourceFiles,
|
|
344
361
|
});
|
|
@@ -435,19 +452,77 @@ export async function checkCommand(options) {
|
|
|
435
452
|
let stagedCoverage = null;
|
|
436
453
|
let tempCtx = null;
|
|
437
454
|
try {
|
|
438
|
-
const
|
|
439
|
-
|
|
455
|
+
const snapshot = captureStagedSnapshot(process.cwd());
|
|
456
|
+
const stagedInventory = snapshot.inventory;
|
|
457
|
+
const trustedSourceConfig = readSnapshotSourceConfig(snapshot, snapshot.baseTree);
|
|
458
|
+
const sourceService = createMaintenanceSourceAnalysisService(process.cwd(), trustedSourceConfig);
|
|
459
|
+
const sourceAnalysis = await analyzeSourceChanges(stagedInventory, sourceService);
|
|
460
|
+
for (const file of stagedInventory) {
|
|
461
|
+
const analysis = sourceAnalysis.get(file.path);
|
|
462
|
+
if (analysis?.after?.status === "ok") {
|
|
463
|
+
file.analysisDepth = "symbol";
|
|
464
|
+
file.disposition = "checked";
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
const printSnapshotResult = (input) => {
|
|
468
|
+
snapshot.assertUnchanged();
|
|
469
|
+
printStagedResult(input);
|
|
470
|
+
};
|
|
471
|
+
stagedCoverage = analyzeStagedFileCoverage(stagedInventory, snapshot.readGit);
|
|
472
|
+
stagedCoverage.snapshot = {
|
|
473
|
+
baseTree: snapshot.baseTree,
|
|
474
|
+
headTree: snapshot.headTree,
|
|
475
|
+
headCommit: snapshot.headCommit,
|
|
476
|
+
};
|
|
477
|
+
for (const record of stagedCoverage.files) {
|
|
478
|
+
const analysis = sourceAnalysis.get(record.path);
|
|
479
|
+
if (!analysis)
|
|
480
|
+
continue;
|
|
481
|
+
const describe = (side) => side
|
|
482
|
+
? {
|
|
483
|
+
status: side.status,
|
|
484
|
+
language: side.language,
|
|
485
|
+
symbolCount: side.symbols.length,
|
|
486
|
+
providerId: side.providerId,
|
|
487
|
+
inputFingerprint: side.inputFingerprint,
|
|
488
|
+
providerFingerprint: side.providerFingerprint,
|
|
489
|
+
}
|
|
490
|
+
: null;
|
|
491
|
+
record.sourceAnalysis = {
|
|
492
|
+
before: describe(analysis.before),
|
|
493
|
+
after: describe(analysis.after),
|
|
494
|
+
};
|
|
495
|
+
record.providerId =
|
|
496
|
+
analysis.after?.providerId ?? analysis.before?.providerId ?? null;
|
|
497
|
+
}
|
|
498
|
+
const impactPolicyEnabled = stagedInventory.length > 0 && hasValidBaseImpactPolicy(snapshot);
|
|
499
|
+
// One rule decides which analysis gaps block (see analysis-gate): the
|
|
500
|
+
// committed side never blocks, and an after-side local gap blocks only
|
|
501
|
+
// where it overlaps the staged lines. With a policy, the impact review
|
|
502
|
+
// evaluates the same obligations and accepts reviewed partial gaps.
|
|
503
|
+
if (!impactPolicyEnabled)
|
|
504
|
+
assertSourceAnalysisGate(stagedInventory, sourceAnalysis);
|
|
505
|
+
if (impactPolicyEnabled) {
|
|
506
|
+
const impactEvaluation = evaluateImpactReview(snapshot, {
|
|
507
|
+
providerSetFingerprint: fingerprintMaintenanceSourceSet(process.cwd(), trustedSourceConfig),
|
|
508
|
+
evaluatorFingerprint: fingerprintImpactEvaluator(),
|
|
509
|
+
analyses: sourceAnalysis,
|
|
510
|
+
});
|
|
511
|
+
if (!impactEvaluation.passed)
|
|
512
|
+
throw new Error(`Staged impact review failed:\n${impactEvaluation.diagnostics.map((item) => `${item.code}: ${item.message}`).join("\n")}`);
|
|
513
|
+
if (stagedCoverage) {
|
|
514
|
+
clearResolvedImpactReviewAdvisories(stagedCoverage);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
440
517
|
const stagedFiles = supportedStagedFiles(stagedInventory);
|
|
441
518
|
if (stagedInventory.length === 0) {
|
|
442
|
-
|
|
519
|
+
printSnapshotResult({
|
|
443
520
|
format: options.format,
|
|
444
521
|
coverage: stagedCoverage,
|
|
445
522
|
messages: ["No staged files found."],
|
|
446
523
|
});
|
|
447
524
|
return { exitCode: 0 };
|
|
448
525
|
}
|
|
449
|
-
const { manifestLookup, manifestResults, authoredSymbolResults, stagedAuthoredSymbolResults, } = buildManifestLookup(stagedFiles);
|
|
450
|
-
const symbolsManifestPath = KIBI_SYMBOLS_MANIFEST_PATH;
|
|
451
526
|
const symbolPaths = new Set(stagedInventory
|
|
452
527
|
.filter((file) => file.analysisDepth === "symbol")
|
|
453
528
|
.map((file) => file.path));
|
|
@@ -461,7 +536,7 @@ export async function checkCommand(options) {
|
|
|
461
536
|
}
|
|
462
537
|
}
|
|
463
538
|
if (markdownErrors.length > 0) {
|
|
464
|
-
|
|
539
|
+
printSnapshotResult({
|
|
465
540
|
format: options.format,
|
|
466
541
|
coverage: stagedCoverage,
|
|
467
542
|
violations: markdownErrors.map((message) => ({
|
|
@@ -478,6 +553,12 @@ export async function checkCommand(options) {
|
|
|
478
553
|
}
|
|
479
554
|
return { exitCode: 1 };
|
|
480
555
|
}
|
|
556
|
+
const snapshotEntities = readSnapshotKnowledge(snapshot.readGit, snapshot.headTree, snapshot.readBlobs);
|
|
557
|
+
const snapshotRequirementIds = new Set(snapshotEntities
|
|
558
|
+
.filter((row) => row.entity.type === "req")
|
|
559
|
+
.map((row) => row.entity.id));
|
|
560
|
+
const { manifestLookup, manifestResults, authoredSymbolResults, stagedAuthoredSymbolResults, } = buildManifestLookup(stagedFiles, snapshotEntities);
|
|
561
|
+
const symbolsManifestPath = KIBI_SYMBOLS_MANIFEST_PATH;
|
|
481
562
|
const allSymbols = [];
|
|
482
563
|
const symbolsByFile = new Map();
|
|
483
564
|
const sourceContentByFile = new Map();
|
|
@@ -486,8 +567,16 @@ export async function checkCommand(options) {
|
|
|
486
567
|
if (f.content !== undefined) {
|
|
487
568
|
sourceContentByFile.set(f.path, f.content);
|
|
488
569
|
}
|
|
489
|
-
// Maintenance
|
|
490
|
-
const symbols = await extractSymbolsFromStagedFileAsync(f, manifestLookup, {
|
|
570
|
+
// Maintenance uses only host-approved source analyzers over captured bytes.
|
|
571
|
+
const symbols = await extractSymbolsFromStagedFileAsync(f, manifestLookup, {
|
|
572
|
+
analyzeText: async () => sourceAnalysis.get(f.path)?.after ?? null,
|
|
573
|
+
});
|
|
574
|
+
for (const symbol of symbols) {
|
|
575
|
+
for (const requirement of symbol.reqLinks) {
|
|
576
|
+
if (!snapshotRequirementIds.has(requirement))
|
|
577
|
+
throw new Error(`Symbol ${symbol.name} references a requirement absent from the captured knowledge snapshot: ${requirement}`);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
491
580
|
symbolsByFile.set(f.path, symbols);
|
|
492
581
|
if (symbols?.length) {
|
|
493
582
|
allSymbols.push(...symbols);
|
|
@@ -495,8 +584,7 @@ export async function checkCommand(options) {
|
|
|
495
584
|
}
|
|
496
585
|
catch (e) {
|
|
497
586
|
const message = `Error extracting symbols from staged file ${f.path}: ${e instanceof Error ? e.message : String(e)}`;
|
|
498
|
-
|
|
499
|
-
console.error(message);
|
|
587
|
+
throw new Error(message);
|
|
500
588
|
}
|
|
501
589
|
}
|
|
502
590
|
const markdownResultsByPath = new Map();
|
|
@@ -514,6 +602,22 @@ export async function checkCommand(options) {
|
|
|
514
602
|
...markdownResultsByPath.values(),
|
|
515
603
|
];
|
|
516
604
|
const stagedKibiEvidence = buildStagedKibiImpactEvidence({
|
|
605
|
+
analyzeSource: (filePath) => {
|
|
606
|
+
const result = sourceAnalysis.get(filePath)?.after;
|
|
607
|
+
if (!result)
|
|
608
|
+
throw new Error(`Missing captured source analysis: ${filePath}`);
|
|
609
|
+
return result;
|
|
610
|
+
},
|
|
611
|
+
readBaseFile: (filePath) => {
|
|
612
|
+
try {
|
|
613
|
+
return snapshot
|
|
614
|
+
.readGit(["show", `${snapshot.baseTree}:${filePath}`])
|
|
615
|
+
.toString("utf8");
|
|
616
|
+
}
|
|
617
|
+
catch {
|
|
618
|
+
return null;
|
|
619
|
+
}
|
|
620
|
+
},
|
|
517
621
|
stagedFiles,
|
|
518
622
|
sourceFiles,
|
|
519
623
|
markdownFiles,
|
|
@@ -531,7 +635,45 @@ export async function checkCommand(options) {
|
|
|
531
635
|
const activeGranularityResults = authoredSymbolResults.filter((result) => activeStagedSymbolEntityIds.has(result.entity.id) ||
|
|
532
636
|
(result.sourceFile !== undefined &&
|
|
533
637
|
stagedSourcePaths.has(result.sourceFile)));
|
|
638
|
+
const snapshotSymbolsByFile = new Map();
|
|
639
|
+
for (const result of activeGranularityResults) {
|
|
640
|
+
const file = result.sourceFile;
|
|
641
|
+
if (!file || snapshotSymbolsByFile.has(file))
|
|
642
|
+
continue;
|
|
643
|
+
const existing = sourceAnalysis.get(file)?.after;
|
|
644
|
+
if (existing) {
|
|
645
|
+
snapshotSymbolsByFile.set(file, await extractSymbolsFromStagedFileAsync({
|
|
646
|
+
path: file,
|
|
647
|
+
status: "M",
|
|
648
|
+
content: "",
|
|
649
|
+
hunkRanges: [{ start: 1, end: Number.MAX_SAFE_INTEGER }],
|
|
650
|
+
}, manifestLookup, { analyzeText: async () => existing }));
|
|
651
|
+
continue;
|
|
652
|
+
}
|
|
653
|
+
const entry = snapshot
|
|
654
|
+
.readGit(["ls-tree", snapshot.headTree, "--", `:(literal)${file}`])
|
|
655
|
+
.toString("utf8");
|
|
656
|
+
if (!entry) {
|
|
657
|
+
snapshotSymbolsByFile.set(file, []);
|
|
658
|
+
continue;
|
|
659
|
+
}
|
|
660
|
+
if (!/^100(?:644|755) blob /.test(entry))
|
|
661
|
+
throw new Error(`Snapshot symbol source is not a regular file: ${file}`);
|
|
662
|
+
const content = snapshot
|
|
663
|
+
.readGit(["show", `${snapshot.headTree}:${file}`])
|
|
664
|
+
.toString("utf8");
|
|
665
|
+
sourceContentByFile.set(file, content);
|
|
666
|
+
snapshotSymbolsByFile.set(file, await extractSymbolsFromStagedFileAsync({
|
|
667
|
+
path: file,
|
|
668
|
+
status: "M",
|
|
669
|
+
content,
|
|
670
|
+
hunkRanges: [{ start: 1, end: Number.MAX_SAFE_INTEGER }],
|
|
671
|
+
}, manifestLookup, {
|
|
672
|
+
analyzeText: (name, text) => sourceService.analyzeTextV2(name, text),
|
|
673
|
+
}));
|
|
674
|
+
}
|
|
534
675
|
stagedKibiDiagnostics.push(...createSymbolGranularityDiagnostics({
|
|
676
|
+
sourceSymbolsByFile: snapshotSymbolsByFile,
|
|
535
677
|
manifestResults: activeGranularityResults,
|
|
536
678
|
...(activeStagedSymbolEntityIds.size > 0
|
|
537
679
|
? { activeEntityIds: activeStagedSymbolEntityIds }
|
|
@@ -544,51 +686,55 @@ export async function checkCommand(options) {
|
|
|
544
686
|
? { activeEntityIds: activeStagedSymbolEntityIds }
|
|
545
687
|
: {}),
|
|
546
688
|
symbolsByFile,
|
|
547
|
-
}), ...createSemanticReviewDiagnostics({ symbolsByFile }));
|
|
689
|
+
}), ...createSemanticReviewDiagnostics({ symbolsByFile }), ...createStagedEntityIdStyleDiagnostics(markdownFiles));
|
|
548
690
|
if (allSymbols.length === 0 && stagedEntityResults.length === 0) {
|
|
549
691
|
if (stagedKibiDiagnostics.length > 0) {
|
|
692
|
+
const blocking = hasBlockingImpactDiagnostics(stagedKibiDiagnostics);
|
|
550
693
|
printStagedResult({
|
|
551
694
|
format: options.format,
|
|
552
695
|
coverage: stagedCoverage,
|
|
553
696
|
qualityDiagnostics: stagedKibiDiagnostics,
|
|
554
|
-
messages: [
|
|
697
|
+
messages: [
|
|
698
|
+
formatStagedKibiDiagnostics(stagedKibiDiagnostics),
|
|
699
|
+
// Advisory-only findings still pass; say so explicitly.
|
|
700
|
+
...(!blocking
|
|
701
|
+
? ["✓ No violations found in staged files."]
|
|
702
|
+
: []),
|
|
703
|
+
],
|
|
555
704
|
});
|
|
556
705
|
if (options.dryRun) {
|
|
557
706
|
return { exitCode: 0 };
|
|
558
707
|
}
|
|
559
|
-
return {
|
|
560
|
-
exitCode: hasBlockingImpactDiagnostics(stagedKibiDiagnostics)
|
|
561
|
-
? 1
|
|
562
|
-
: 0,
|
|
563
|
-
};
|
|
708
|
+
return { exitCode: blocking ? 1 : 0 };
|
|
564
709
|
}
|
|
565
|
-
|
|
710
|
+
printSnapshotResult({
|
|
566
711
|
format: options.format,
|
|
567
712
|
coverage: stagedCoverage,
|
|
568
|
-
messages: [
|
|
569
|
-
"No exported symbols or staged entities found in staged files.",
|
|
570
|
-
],
|
|
713
|
+
messages: [noValidatedSymbolsMessage(sourceAnalysis)],
|
|
571
714
|
});
|
|
572
715
|
return { exitCode: 0 };
|
|
573
716
|
}
|
|
574
717
|
if (allSymbols.length === 0) {
|
|
575
718
|
if (stagedKibiDiagnostics.length > 0) {
|
|
719
|
+
const blocking = hasBlockingImpactDiagnostics(stagedKibiDiagnostics);
|
|
576
720
|
printStagedResult({
|
|
577
721
|
format: options.format,
|
|
578
722
|
coverage: stagedCoverage,
|
|
579
723
|
qualityDiagnostics: stagedKibiDiagnostics,
|
|
580
|
-
messages: [
|
|
724
|
+
messages: [
|
|
725
|
+
formatStagedKibiDiagnostics(stagedKibiDiagnostics),
|
|
726
|
+
// Advisory-only findings still pass; say so explicitly.
|
|
727
|
+
...(!blocking
|
|
728
|
+
? ["✓ No violations found in staged files."]
|
|
729
|
+
: []),
|
|
730
|
+
],
|
|
581
731
|
});
|
|
582
732
|
if (options.dryRun) {
|
|
583
733
|
return { exitCode: 0 };
|
|
584
734
|
}
|
|
585
|
-
return {
|
|
586
|
-
exitCode: hasBlockingImpactDiagnostics(stagedKibiDiagnostics)
|
|
587
|
-
? 1
|
|
588
|
-
: 0,
|
|
589
|
-
};
|
|
735
|
+
return { exitCode: blocking ? 1 : 0 };
|
|
590
736
|
}
|
|
591
|
-
|
|
737
|
+
printSnapshotResult({
|
|
592
738
|
format: options.format,
|
|
593
739
|
coverage: stagedCoverage,
|
|
594
740
|
messages: ["✓ No violations found in staged files."],
|
|
@@ -596,10 +742,8 @@ export async function checkCommand(options) {
|
|
|
596
742
|
return { exitCode: 0 };
|
|
597
743
|
}
|
|
598
744
|
// Create temp KB
|
|
599
|
-
tempCtx = await createTempKb(
|
|
600
|
-
|
|
601
|
-
await projectStagedEntities(tempCtx.prolog, stagedEntityResults);
|
|
602
|
-
}
|
|
745
|
+
tempCtx = await createTempKb();
|
|
746
|
+
await projectStagedEntities(tempCtx.prolog, snapshotEntities);
|
|
603
747
|
const overlayFacts = createOverlayFacts(allSymbols);
|
|
604
748
|
const fs = await import("node:fs/promises");
|
|
605
749
|
await fs.writeFile(tempCtx.overlayPath, overlayFacts, "utf8");
|
|
@@ -611,7 +755,7 @@ export async function checkCommand(options) {
|
|
|
611
755
|
});
|
|
612
756
|
const violationsFormatted = formatStagedViolations(violationsRaw);
|
|
613
757
|
if (violationsRaw && violationsRaw.length > 0) {
|
|
614
|
-
|
|
758
|
+
printSnapshotResult({
|
|
615
759
|
format: options.format,
|
|
616
760
|
coverage: stagedCoverage,
|
|
617
761
|
violations: violationsRaw,
|
|
@@ -632,7 +776,7 @@ export async function checkCommand(options) {
|
|
|
632
776
|
if (stagedKibiDiagnostics.length > 0) {
|
|
633
777
|
await cleanupTempKb(tempCtx.tempDir);
|
|
634
778
|
const blocking = hasBlockingImpactDiagnostics(stagedKibiDiagnostics);
|
|
635
|
-
|
|
779
|
+
printSnapshotResult({
|
|
636
780
|
format: options.format,
|
|
637
781
|
coverage: stagedCoverage,
|
|
638
782
|
qualityDiagnostics: stagedKibiDiagnostics,
|
|
@@ -653,7 +797,7 @@ export async function checkCommand(options) {
|
|
|
653
797
|
exitCode: 1,
|
|
654
798
|
};
|
|
655
799
|
}
|
|
656
|
-
|
|
800
|
+
printSnapshotResult({
|
|
657
801
|
format: options.format,
|
|
658
802
|
coverage: stagedCoverage,
|
|
659
803
|
messages: ["✓ No violations found in staged symbols."],
|
|
@@ -850,6 +994,7 @@ export async function checkNoDanglingRefs(prolog) {
|
|
|
850
994
|
"constrains",
|
|
851
995
|
"requires_property",
|
|
852
996
|
"supersedes",
|
|
997
|
+
"restates",
|
|
853
998
|
"relates_to",
|
|
854
999
|
];
|
|
855
1000
|
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":"AA+EA,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"}
|