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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/extractors/manifest.ts"],"names":[],"mappings":"AA6BA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb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AM,GACf,oBAAoB,EAAE,CAmBxB;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAKxE;AA4ED,wBAAgB,iCAAiC,CAC/C,YAAY,EAAE,MAAM,EACpB,eAAe,CAAC,EAAE,MAAM,GACvB,oBAAoB,EAAE,CAaxB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAqED,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,SAAS,MAAM,EAAE,GAC3B,qBAAqB,EAAE,CAkBzB"}
|
|
@@ -37,6 +37,7 @@ const VALID_RELATIONSHIP_TYPES = new Set([
|
|
|
37
37
|
"publishes",
|
|
38
38
|
"consumes",
|
|
39
39
|
"supersedes",
|
|
40
|
+
"restates",
|
|
40
41
|
"relates_to",
|
|
41
42
|
]);
|
|
42
43
|
const VALID_RELATIONSHIP_DIRECTIONS = [
|
|
@@ -60,6 +61,7 @@ const VALID_RELATIONSHIP_DIRECTIONS = [
|
|
|
60
61
|
{ type: "consumes", from: "symbol", to: "event" },
|
|
61
62
|
{ type: "supersedes", from: "adr", to: "adr" },
|
|
62
63
|
{ type: "supersedes", from: "req", to: "req" },
|
|
64
|
+
{ type: "restates", from: "req", to: "req" },
|
|
63
65
|
];
|
|
64
66
|
const RELATIONSHIP_TYPE_DISPLAY_LIST = Array.from(VALID_RELATIONSHIP_TYPES)
|
|
65
67
|
.sort()
|
|
@@ -325,46 +327,82 @@ export function readManifestWithCoordinateOverlay(manifestPath, coordinatesPath)
|
|
|
325
327
|
});
|
|
326
328
|
}
|
|
327
329
|
/**
|
|
328
|
-
* Resolve the code scope of a receipt binding: for each
|
|
329
|
-
* its
|
|
330
|
-
* editing
|
|
331
|
-
* (per-contract binding mode).
|
|
330
|
+
* Resolve the code scope of a receipt binding: for each scoped symbol, the
|
|
331
|
+
* content hash of its current source file. A receipt's binding covers these,
|
|
332
|
+
* so editing code a test depends on stales only that test's receipts
|
|
333
|
+
* (per-contract binding mode). Hashes come from the live file, not the
|
|
334
|
+
* coordinate artifact: an edit must stale the receipt whether or not
|
|
335
|
+
* coordinates were refreshed. A scoped symbol whose file is gone hashes as
|
|
336
|
+
* "missing", so deleting it stales the receipt too; symbols without a
|
|
337
|
+
* source file cannot be hashed and are left out.
|
|
332
338
|
*/
|
|
333
339
|
// implements REQ-kibi-verification-evidence-contract
|
|
334
|
-
//
|
|
335
|
-
//
|
|
336
|
-
// manifest state
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
|
|
340
|
+
// Scope reads run once per proof-bearing test and a campaign touches
|
|
341
|
+
// dozens-to-hundreds of tests, so the manifest's symbol -> source mapping is
|
|
342
|
+
// memoized per manifest state and file hashes per file state (mtime + size).
|
|
343
|
+
const scopeSourceFileCache = new Map();
|
|
344
|
+
const scopeFileHashCache = new Map();
|
|
345
|
+
function fileStamp(filePath) {
|
|
340
346
|
try {
|
|
341
|
-
const stats = statSync(
|
|
342
|
-
|
|
347
|
+
const stats = statSync(filePath);
|
|
348
|
+
return `${stats.mtimeMs}:${stats.size}`;
|
|
343
349
|
}
|
|
344
350
|
catch {
|
|
345
|
-
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
function scopeSourceFiles(manifestPath) {
|
|
355
|
+
const stamp = fileStamp(manifestPath) ?? "missing";
|
|
356
|
+
const hit = scopeSourceFileCache.get(manifestPath);
|
|
357
|
+
if (hit && hit.stamp === stamp)
|
|
358
|
+
return hit.sourceFiles;
|
|
359
|
+
const sourceFiles = new Map();
|
|
360
|
+
if (stamp !== "missing") {
|
|
361
|
+
const records = extractManifestSymbolRecordsString(readFileSync(manifestPath, "utf8"), manifestPath);
|
|
362
|
+
for (const record of records) {
|
|
363
|
+
const sourceFile = typeof record.sourceFile === "string" && record.sourceFile !== ""
|
|
364
|
+
? record.sourceFile
|
|
365
|
+
: typeof record.source === "string" && record.source !== ""
|
|
366
|
+
? record.source
|
|
367
|
+
: undefined;
|
|
368
|
+
if (typeof record.id === "string" && sourceFile !== undefined) {
|
|
369
|
+
sourceFiles.set(record.id, sourceFile);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
346
372
|
}
|
|
347
|
-
|
|
373
|
+
scopeSourceFileCache.set(manifestPath, { stamp, sourceFiles });
|
|
374
|
+
return sourceFiles;
|
|
375
|
+
}
|
|
376
|
+
function scopeFileHash(absolutePath) {
|
|
377
|
+
const stamp = fileStamp(absolutePath);
|
|
378
|
+
if (stamp === null)
|
|
379
|
+
return "missing";
|
|
380
|
+
const hit = scopeFileHashCache.get(absolutePath);
|
|
348
381
|
if (hit && hit.stamp === stamp)
|
|
349
|
-
return hit.
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
|
|
382
|
+
return hit.hash;
|
|
383
|
+
const hash = createHash("sha256")
|
|
384
|
+
.update(readFileSync(absolutePath))
|
|
385
|
+
.digest("hex");
|
|
386
|
+
scopeFileHashCache.set(absolutePath, { stamp, hash });
|
|
387
|
+
return hash;
|
|
353
388
|
}
|
|
354
389
|
export function resolveBoundSymbolScope(manifestPath, symbolIds) {
|
|
355
|
-
const wanted = new Set(symbolIds);
|
|
356
|
-
if (wanted.
|
|
390
|
+
const wanted = [...new Set(symbolIds)];
|
|
391
|
+
if (wanted.length === 0)
|
|
357
392
|
return [];
|
|
358
|
-
const
|
|
393
|
+
const sourceFiles = scopeSourceFiles(manifestPath);
|
|
394
|
+
// The manifest lives at <workspace>/.kb/symbols.yaml; source files are
|
|
395
|
+
// workspace-relative.
|
|
396
|
+
const workspaceRoot = path.dirname(path.dirname(path.resolve(manifestPath)));
|
|
359
397
|
const scope = [];
|
|
360
|
-
for (const
|
|
361
|
-
const
|
|
362
|
-
if (
|
|
398
|
+
for (const symbolId of wanted) {
|
|
399
|
+
const sourceFile = sourceFiles.get(symbolId);
|
|
400
|
+
if (sourceFile === undefined)
|
|
363
401
|
continue;
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
}
|
|
402
|
+
const absolute = path.isAbsolute(sourceFile)
|
|
403
|
+
? sourceFile
|
|
404
|
+
: path.resolve(workspaceRoot, sourceFile);
|
|
405
|
+
scope.push({ symbolId, sourceHash: scopeFileHash(absolute) });
|
|
368
406
|
}
|
|
369
407
|
scope.sort((left, right) => left.symbolId.localeCompare(right.symbolId));
|
|
370
408
|
return scope;
|
|
@@ -61,6 +61,8 @@ export interface ExtractedEntity {
|
|
|
61
61
|
examples?: string[];
|
|
62
62
|
predicate_args?: string[];
|
|
63
63
|
rule_ir?: Record<string, unknown>;
|
|
64
|
+
argument_constants?: Record<string, string[]>;
|
|
65
|
+
argument_aliases?: Record<string, Record<string, string>>;
|
|
64
66
|
rule_hash?: string;
|
|
65
67
|
rule_schema_id?: string;
|
|
66
68
|
rule_name?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/extractors/markdown.ts"],"names":[],"mappings":"AAuBA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,YAAY,EAElB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/extractors/markdown.ts"],"names":[],"mappings":"AAuBA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,YAAY,EAElB,MAAM,4BAA4B,CAAC;AAsEpC,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CA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yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,gBAAgB,CAElB;AAGD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAatE;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASjE;AASD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAQpE"}
|
|
@@ -42,6 +42,8 @@ const FACT_STRING_FIELDS = [
|
|
|
42
42
|
"predicate_name",
|
|
43
43
|
"predicate_namespace",
|
|
44
44
|
"rule_ir",
|
|
45
|
+
"argument_constants",
|
|
46
|
+
"argument_aliases",
|
|
45
47
|
"rule_hash",
|
|
46
48
|
"rule_schema_id",
|
|
47
49
|
"rule_name",
|
|
@@ -77,7 +79,13 @@ const TEST_ENUM_FIELDS = [
|
|
|
77
79
|
"proof_receipts",
|
|
78
80
|
];
|
|
79
81
|
const ajv = new Ajv({ strict: false, allErrors: true });
|
|
80
|
-
|
|
82
|
+
// Compiled on first extraction: every CLI command imports this module, and
|
|
83
|
+
// most never extract Markdown entities.
|
|
84
|
+
let extractedEntityValidator;
|
|
85
|
+
function validateExtractedEntity() {
|
|
86
|
+
extractedEntityValidator ??= ajv.compile(entitySchema);
|
|
87
|
+
return extractedEntityValidator;
|
|
88
|
+
}
|
|
81
89
|
const DEFAULT_STATUS_BY_TYPE = {
|
|
82
90
|
req: "open",
|
|
83
91
|
scenario: "draft",
|
|
@@ -105,6 +113,7 @@ const VALID_RELATIONSHIP_TYPES = new Set([
|
|
|
105
113
|
"publishes",
|
|
106
114
|
"consumes",
|
|
107
115
|
"supersedes",
|
|
116
|
+
"restates",
|
|
108
117
|
"relates_to",
|
|
109
118
|
]);
|
|
110
119
|
const VALID_RELATIONSHIP_DIRECTIONS = [
|
|
@@ -129,6 +138,7 @@ const VALID_RELATIONSHIP_DIRECTIONS = [
|
|
|
129
138
|
{ type: "consumes", from: "symbol", to: "event" },
|
|
130
139
|
{ type: "supersedes", from: "adr", to: "adr" },
|
|
131
140
|
{ type: "supersedes", from: "req", to: "req" },
|
|
141
|
+
{ type: "restates", from: "req", to: "req" },
|
|
132
142
|
];
|
|
133
143
|
const RELATIONSHIP_TYPE_DISPLAY_LIST = Array.from(VALID_RELATIONSHIP_TYPES)
|
|
134
144
|
.sort()
|
|
@@ -577,8 +587,9 @@ function extractFromMarkdownContent(content, filePath) {
|
|
|
577
587
|
if (type === "req" && Array.isArray(data.semantic_inventory)) {
|
|
578
588
|
entity.semantic_inventory = data.semantic_inventory.filter((value) => isObjectRecord(value));
|
|
579
589
|
}
|
|
580
|
-
|
|
581
|
-
|
|
590
|
+
const validateEntity = validateExtractedEntity();
|
|
591
|
+
if (!validateEntity(entity)) {
|
|
592
|
+
const messages = (validateEntity.errors || [])
|
|
582
593
|
.map((e) => `${e.instancePath || "root"}: ${e.message}`)
|
|
583
594
|
.join("; ");
|
|
584
595
|
throw new FrontmatterError(`Entity validation failed: ${messages}`, filePath, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../src/extractors/relationships.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,kBAAkB,EAAa,MAAM,4BAA4B,CAAC;AAEhF,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE;QACT,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,qBAAqB,EAAE,CAAC;CACxC;
|
|
1
|
+
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../src/extractors/relationships.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,kBAAkB,EAAa,MAAM,4BAA4B,CAAC;AAEhF,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE;QACT,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,qBAAqB,EAAE,CAAC;CACxC;AA0BD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,MAAM,GACvB,qBAAqB,EAAE,CAmBzB;AAED,gFAAgF;AAChF,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,GAChB,qBAAqB,CAiBvB;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,kBAAkB,GACzB,qBAAqB,GAAG,IAAI,CAyC9B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,qBAAqB,EAAE,GAC/B,qBAAqB,EAAE,CAEzB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,qBAAqB,EAAE,EACtC,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,GAC1B,KAAK,CAAC;IACP,YAAY,EAAE,qBAAqB,CAAC;IACpC,KAAK,EAAE,cAAc,GAAG,YAAY,CAAC;CACtC,CAAC,CAgBD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CapabilityRegistry } from "../plugins/registry.js";
|
|
2
|
+
import type { SourceAnalysisService } from "../plugins/source-analysis-service.js";
|
|
2
3
|
import { type ManifestSymbolEntry, enrichSymbolCoordinatesWithTsMorph } from "./symbols-ts.js";
|
|
3
4
|
export type { ManifestSymbolEntry };
|
|
4
5
|
export type SourceAnalysisMode = "parser" | "fallback";
|
|
@@ -36,7 +37,13 @@ export interface AnalyzeSourceTextOptions {
|
|
|
36
37
|
registry?: CapabilityRegistry;
|
|
37
38
|
}
|
|
38
39
|
interface EnrichSymbolCoordinatesDeps {
|
|
40
|
+
sourceAnalysisService: SourceAnalysisService;
|
|
39
41
|
enrichTsCoordinates: typeof enrichSymbolCoordinatesWithTsMorph;
|
|
42
|
+
/** Coordinate-only sync may locate explicit declarations in decorated Python.
|
|
43
|
+
* Completeness-sensitive callers must also verify the captured policy/review. */
|
|
44
|
+
allowPythonDecoratorCoordinates?: boolean;
|
|
45
|
+
/** Additional snapshot/policy authorization for completeness-sensitive gates. */
|
|
46
|
+
verifyPythonDecoratorCoordinates?: (logicalPath: string, analysis: Awaited<ReturnType<SourceAnalysisService["analyzeTextV2"]>>) => Promise<void>;
|
|
40
47
|
}
|
|
41
48
|
export declare function analyzeSourceText(entries: ManifestSymbolEntry[], workspaceRoot: string, deps?: Partial<EnrichSymbolCoordinatesDeps>): Promise<ManifestSymbolEntry[]>;
|
|
42
49
|
export declare function analyzeSourceText(filePath: string, content: string, options?: AnalyzeSourceTextOptions): SourceAnalysisResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbols-coordinator.d.ts","sourceRoot":"","sources":["../../src/extractors/symbols-coordinator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"symbols-coordinator.d.ts","sourceRoot":"","sources":["../../src/extractors/symbols-coordinator.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,K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B,EAAE,CAAC;IACrC,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED,UAAU,2BAA2B;IACnC,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,mBAAmB,EAAE,OAAO,kCAAkC,CAAC;IAC/D;qFACiF;IACjF,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAC1C,iFAAiF;IACjF,gCAAgC,CAAC,EAAE,CACjC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC,CAAC,KAClE,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAMD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,mBAAmB,EAAE,EAC9B,aAAa,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,GAC1C,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;AAClC,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,wBAAwB,GACjC,oBAAoB,CAAC;AA8DxB;;;GAGG;AAEH,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,kBAAkB,GAC3B,OAAO,CAAC,oBAAoB,CAAC,CAO/B;AA+CD,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,mBAAmB,EAAE,EAC9B,aAAa,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,GAC1C,OAAO,CAAC,mBAAmB,EAAE,CAAC,CA6FhC"}
|
|
@@ -17,42 +17,10 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import * as fs from "node:fs";
|
|
19
19
|
import * as path from "node:path";
|
|
20
|
+
import { createMaintenanceSourceAnalysisService } from "../plugins/maintenance-source-analysis.js";
|
|
20
21
|
import { createSourceAnalysisService, } from "../plugins/source-analysis-service.js";
|
|
22
|
+
import { extensionLanguage, isTsJsSourcePath, } from "../plugins/source-classification.js";
|
|
21
23
|
import { createTsMorphSourceAnalysisProvider, enrichSymbolCoordinatesWithTsMorph, } from "./symbols-ts.js";
|
|
22
|
-
const TS_JS_EXTENSIONS = new Set([
|
|
23
|
-
".ts",
|
|
24
|
-
".tsx",
|
|
25
|
-
".js",
|
|
26
|
-
".jsx",
|
|
27
|
-
".mts",
|
|
28
|
-
".cts",
|
|
29
|
-
".mjs",
|
|
30
|
-
".cjs",
|
|
31
|
-
]);
|
|
32
|
-
const SOURCE_LANGUAGE_EXTENSIONS = {
|
|
33
|
-
".c": "c",
|
|
34
|
-
".cc": "cpp",
|
|
35
|
-
".cjs": "javascript",
|
|
36
|
-
".cpp": "cpp",
|
|
37
|
-
".cs": "csharp",
|
|
38
|
-
".cts": "typescript",
|
|
39
|
-
".go": "go",
|
|
40
|
-
".h": "c",
|
|
41
|
-
".hpp": "cpp",
|
|
42
|
-
".java": "java",
|
|
43
|
-
".js": "javascript",
|
|
44
|
-
".jsx": "javascript",
|
|
45
|
-
".kt": "kotlin",
|
|
46
|
-
".mjs": "javascript",
|
|
47
|
-
".mts": "typescript",
|
|
48
|
-
".php": "php",
|
|
49
|
-
".py": "python",
|
|
50
|
-
".rb": "ruby",
|
|
51
|
-
".rs": "rust",
|
|
52
|
-
".swift": "swift",
|
|
53
|
-
".ts": "typescript",
|
|
54
|
-
".tsx": "typescript",
|
|
55
|
-
};
|
|
56
24
|
const DEFAULT_SOURCE_ANALYSIS_PROVIDERS = [
|
|
57
25
|
createTsMorphSourceAnalysisProvider(),
|
|
58
26
|
];
|
|
@@ -114,10 +82,40 @@ export async function analyzeSourceTextWithRegistry(filePath, content, registry)
|
|
|
114
82
|
return analyzeSourceText(filePath, content);
|
|
115
83
|
}
|
|
116
84
|
}
|
|
85
|
+
function isCoordinateOnlyDecoratorPartial(analysis) {
|
|
86
|
+
if (analysis.status !== "partial" ||
|
|
87
|
+
analysis.language !== "python" ||
|
|
88
|
+
analysis.module.analysisMode !== "parser" ||
|
|
89
|
+
analysis.providerId !== "kibi-plugin-treesitter.tree-sitter.v2" ||
|
|
90
|
+
analysis.stamp?.pluginId !== "kibi-plugin-treesitter" ||
|
|
91
|
+
analysis.diagnostics.length === 0 ||
|
|
92
|
+
analysis.uncoveredRanges.length !== analysis.diagnostics.length)
|
|
93
|
+
return false;
|
|
94
|
+
return (analysis.diagnostics.every((diagnostic) => {
|
|
95
|
+
if (diagnostic.code !== "TREESITTER_DECORATOR_EXPANSION_UNAVAILABLE" ||
|
|
96
|
+
diagnostic.range === undefined)
|
|
97
|
+
return false;
|
|
98
|
+
const range = diagnostic.range;
|
|
99
|
+
return analysis.uncoveredRanges.some((uncovered) => uncovered.reason === "decorator-may-alter-or-create-declarations" &&
|
|
100
|
+
uncovered.startLine === range.startLine &&
|
|
101
|
+
uncovered.startColumn === range.startColumn &&
|
|
102
|
+
uncovered.endLine === range.endLine &&
|
|
103
|
+
uncovered.endColumn === range.endColumn);
|
|
104
|
+
}) &&
|
|
105
|
+
analysis.uncoveredRanges.every((uncovered) => uncovered.reason === "decorator-may-alter-or-create-declarations" &&
|
|
106
|
+
analysis.diagnostics.some(({ range }) => range !== undefined &&
|
|
107
|
+
uncovered.startLine === range.startLine &&
|
|
108
|
+
uncovered.startColumn === range.startColumn &&
|
|
109
|
+
uncovered.endLine === range.endLine &&
|
|
110
|
+
uncovered.endColumn === range.endColumn)));
|
|
111
|
+
}
|
|
117
112
|
export async function enrichSymbolCoordinates(entries, workspaceRoot, deps) {
|
|
118
113
|
// implements REQ-vscode-traceability
|
|
119
114
|
const enrichTsCoordinates = deps?.enrichTsCoordinates ?? enrichSymbolCoordinatesWithTsMorph;
|
|
120
115
|
const output = entries.map((entry) => withoutGeneratedCoordinates(entry));
|
|
116
|
+
const service = deps?.sourceAnalysisService ??
|
|
117
|
+
createMaintenanceSourceAnalysisService(workspaceRoot);
|
|
118
|
+
const analyses = new Map();
|
|
121
119
|
const tsIndices = [];
|
|
122
120
|
const tsEntries = [];
|
|
123
121
|
for (let index = 0; index < output.length; index++) {
|
|
@@ -125,15 +123,54 @@ export async function enrichSymbolCoordinates(entries, workspaceRoot, deps) {
|
|
|
125
123
|
if (!entry)
|
|
126
124
|
continue;
|
|
127
125
|
const resolved = resolveSourcePath(entry.sourceFile, workspaceRoot);
|
|
128
|
-
if (!resolved)
|
|
126
|
+
if (!resolved || !fs.statSync(resolved.absolutePath).isFile())
|
|
129
127
|
continue;
|
|
130
128
|
const ext = path.extname(resolved.absolutePath).toLowerCase();
|
|
131
|
-
if (
|
|
129
|
+
if (isTsJsSourcePath(resolved.absolutePath)) {
|
|
132
130
|
tsIndices.push(index);
|
|
133
131
|
tsEntries.push(entry);
|
|
134
132
|
continue;
|
|
135
133
|
}
|
|
136
|
-
|
|
134
|
+
const logicalPath = path
|
|
135
|
+
.relative(workspaceRoot, resolved.absolutePath)
|
|
136
|
+
.replaceAll("\\", "/");
|
|
137
|
+
let analysis = analyses.get(logicalPath);
|
|
138
|
+
const firstAnalysis = analysis === undefined;
|
|
139
|
+
if (!analysis) {
|
|
140
|
+
analysis = await service.analyzeTextV2(logicalPath, fs.readFileSync(resolved.absolutePath, "utf8"));
|
|
141
|
+
analyses.set(logicalPath, analysis);
|
|
142
|
+
}
|
|
143
|
+
const coordinateOnlyPartial = deps?.allowPythonDecoratorCoordinates === true &&
|
|
144
|
+
isCoordinateOnlyDecoratorPartial(analysis);
|
|
145
|
+
if (analysis.status === "failed" ||
|
|
146
|
+
(analysis.status === "partial" && !coordinateOnlyPartial))
|
|
147
|
+
throw new Error(`Cannot refresh incomplete source analysis for ${logicalPath}: ${analysis.diagnostics.map((d) => d.message).join("; ")}`);
|
|
148
|
+
if (coordinateOnlyPartial && firstAnalysis) {
|
|
149
|
+
await deps?.verifyPythonDecoratorCoordinates?.(logicalPath, analysis);
|
|
150
|
+
console.warn(`[kibi] Coordinate-only refresh for ${logicalPath}; source analysis remains partial: ${analysis.diagnostics.map((diagnostic) => diagnostic.message).join("; ")}`);
|
|
151
|
+
}
|
|
152
|
+
if (analysis.status === "unsupported") {
|
|
153
|
+
// Preserve the legacy coarse heuristic until the file-level migration;
|
|
154
|
+
// it is never exposed as parser-backed symbol evidence.
|
|
155
|
+
output[index] = enrichWithRegexHeuristic(entry, resolved.absolutePath);
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
const exact = analysis.symbols.filter((symbol) => (symbol.qualifiedName ?? symbol.name) === entry.title);
|
|
159
|
+
const candidates = exact.length
|
|
160
|
+
? exact
|
|
161
|
+
: analysis.symbols.filter((symbol) => symbol.name === entry.title);
|
|
162
|
+
if (candidates.length !== 1)
|
|
163
|
+
continue;
|
|
164
|
+
const symbol = candidates[0];
|
|
165
|
+
if (!symbol)
|
|
166
|
+
continue;
|
|
167
|
+
output[index] = {
|
|
168
|
+
...entry,
|
|
169
|
+
sourceLine: symbol.startLine,
|
|
170
|
+
sourceColumn: symbol.startColumn,
|
|
171
|
+
sourceEndLine: symbol.endLine,
|
|
172
|
+
sourceEndColumn: symbol.endColumn,
|
|
173
|
+
};
|
|
137
174
|
}
|
|
138
175
|
if (tsEntries.length > 0) {
|
|
139
176
|
const enrichedTs = await enrichTsCoordinates(tsEntries, workspaceRoot);
|
|
@@ -218,8 +255,7 @@ function createFallbackAnalysis(filePath, fallbackReason) {
|
|
|
218
255
|
};
|
|
219
256
|
}
|
|
220
257
|
function detectSourceLanguage(filePath) {
|
|
221
|
-
return (
|
|
222
|
-
"unknown");
|
|
258
|
+
return extensionLanguage(filePath);
|
|
223
259
|
}
|
|
224
260
|
function inferModuleTitle(filePath) {
|
|
225
261
|
const extension = path.extname(filePath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent-search.d.ts","sourceRoot":"","sources":["../src/intent-search.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"intent-search.d.ts","sourceRoot":"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AK,EAAE,CAAC,GAAG,CAAC,GAAG,MAAM,CAO1E;AAkHD,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,UAAU,EAClB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,kBAAkB,CAAC,CAuC7B;AAGD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CA0C1E"}
|
package/dist/intent-search.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { escapeAtom, normalizeEntityId, parseTriples } from "./prolog/codec.js";
|
|
3
|
-
import { loadEntities, loadSearchCandidates, } from "./public/operations/discovery-entities.js";
|
|
3
|
+
import { SEARCH_CANDIDATE_PAGE_SIZE, listSearchCandidates, loadEntities, loadSearchCandidates, } from "./public/operations/discovery-entities.js";
|
|
4
4
|
import { loadMarkdownBody } from "./search-ranking.js";
|
|
5
5
|
const GRAPH_RELATIONSHIPS = [
|
|
6
6
|
"implements",
|
|
@@ -343,41 +343,80 @@ async function loadIntentCandidates(prolog, options) {
|
|
|
343
343
|
...facetValues(options.semanticFacets).map((facet) => facet.value),
|
|
344
344
|
].filter((term, index, all) => term.trim() && all.indexOf(term) === index);
|
|
345
345
|
const candidates = new Map();
|
|
346
|
-
|
|
347
|
-
(
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
...(options.type !== undefined ? { type: options.type } : {}),
|
|
353
|
-
maxCandidates: MAX_CANDIDATES,
|
|
354
|
-
});
|
|
355
|
-
for (const entity of page) {
|
|
356
|
-
candidates.set(`${String(entity.type ?? "")}::${String(entity.id ?? "")}`, { ...entity });
|
|
357
|
-
}
|
|
346
|
+
const addCandidates = (entities) => {
|
|
347
|
+
for (const entity of entities) {
|
|
348
|
+
const key = `${String(entity.type ?? "")}::${String(entity.id ?? "")}`;
|
|
349
|
+
if (!candidates.has(key) && candidates.size >= MAX_CANDIDATES)
|
|
350
|
+
break;
|
|
351
|
+
candidates.set(key, { ...entity });
|
|
358
352
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
353
|
+
};
|
|
354
|
+
const sourceLocations = options.sourceLocations ?? [];
|
|
355
|
+
if (sourceLocations.length > 0 && prolog.queryEntities) {
|
|
356
|
+
for (const location of sourceLocations) {
|
|
357
|
+
if (candidates.size >= MAX_CANDIDATES)
|
|
358
|
+
break;
|
|
359
|
+
let offset = 0;
|
|
360
|
+
let total = Number.POSITIVE_INFINITY;
|
|
361
|
+
while (offset < total && candidates.size < MAX_CANDIDATES) {
|
|
362
|
+
const limit = Math.min(SEARCH_CANDIDATE_PAGE_SIZE, MAX_CANDIDATES - candidates.size);
|
|
363
|
+
const page = await prolog.queryEntities({
|
|
364
|
+
...(options.type !== undefined ? { type: options.type } : {}),
|
|
365
|
+
sourceFile: location.path,
|
|
366
|
+
limit,
|
|
367
|
+
offset,
|
|
368
|
+
});
|
|
369
|
+
if (page.entities.length === 0)
|
|
370
|
+
break;
|
|
371
|
+
addCandidates(page.entities);
|
|
372
|
+
total = page.count;
|
|
373
|
+
offset += page.entities.length;
|
|
368
374
|
}
|
|
369
375
|
}
|
|
370
376
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
377
|
+
// Lexical candidates are projected rows (no receipt histories or other
|
|
378
|
+
// large structured properties); ports without the engine method run the
|
|
379
|
+
// same bounded Prolog search through `query`.
|
|
380
|
+
for (const term of terms) {
|
|
381
|
+
if (candidates.size >= MAX_CANDIDATES)
|
|
382
|
+
break;
|
|
383
|
+
const page = await loadSearchCandidates(prolog, {
|
|
384
|
+
query: term,
|
|
385
|
+
...(options.type !== undefined ? { type: options.type } : {}),
|
|
386
|
+
maxCandidates: MAX_CANDIDATES - candidates.size,
|
|
387
|
+
});
|
|
388
|
+
addCandidates(page);
|
|
389
|
+
}
|
|
390
|
+
if (!prolog.searchEntities && sourceLocations.length === 0) {
|
|
391
|
+
addCandidates(await listSearchCandidates(prolog, {
|
|
392
|
+
...(options.type !== undefined ? { type: options.type } : {}),
|
|
393
|
+
maxCandidates: MAX_CANDIDATES,
|
|
394
|
+
}));
|
|
395
|
+
}
|
|
396
|
+
else if (sourceLocations.length > 0 && !prolog.queryEntities) {
|
|
397
|
+
for (const location of sourceLocations) {
|
|
398
|
+
if (candidates.size >= MAX_CANDIDATES)
|
|
399
|
+
break;
|
|
400
|
+
addCandidates(await loadEntities(prolog, {
|
|
401
|
+
...(options.type !== undefined ? { type: options.type } : {}),
|
|
402
|
+
sourceFile: location.path,
|
|
403
|
+
}));
|
|
375
404
|
}
|
|
376
405
|
}
|
|
377
|
-
|
|
378
|
-
|
|
406
|
+
// An unfamiliar host-agent alias may not exist in the lexical index at all.
|
|
407
|
+
// For small facet-bearing corpora, scan the bounded entity set so a zero
|
|
408
|
+
// lexical hit does not turn a valid semantic query into a false abstention.
|
|
409
|
+
// Source-located searches stay on their source-indexed candidate set.
|
|
410
|
+
if (prolog.searchEntities &&
|
|
411
|
+
sourceLocations.length === 0 &&
|
|
412
|
+
facetValues(options.semanticFacets).length > 0 &&
|
|
413
|
+
candidates.size < 20) {
|
|
414
|
+
addCandidates(await listSearchCandidates(prolog, {
|
|
415
|
+
...(options.type !== undefined ? { type: options.type } : {}),
|
|
416
|
+
maxCandidates: MAX_CANDIDATES,
|
|
417
|
+
}));
|
|
379
418
|
}
|
|
380
|
-
return Array.from(candidates.values());
|
|
419
|
+
return Array.from(candidates.values()).slice(0, MAX_CANDIDATES);
|
|
381
420
|
}
|
|
382
421
|
// implements REQ-kibi-intent-aware-source-discovery
|
|
383
422
|
export async function executeIntentSearch(options, prolog, workspaceRoot) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/generate.ts"],"names":[],"mappings":"AAK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,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CACnE,CAiDA;AA+GD,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAyD9B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { loadEntityIds } from "../../public/operations/discovery-entities.js";
|
|
4
4
|
import { executeStatus } from "../../public/operations/discovery-executors.js";
|
|
5
5
|
import { readWorkspaceSnapshot } from "../../public/operations/workspace-snapshot.js";
|
|
6
6
|
import { buildBootstrapCandidates } from "./candidates.js";
|
|
@@ -81,8 +81,9 @@ async function existingEntityIds(context) {
|
|
|
81
81
|
if (!context.prolog)
|
|
82
82
|
return new Set();
|
|
83
83
|
try {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
// Ids only: materializing every entity (receipt histories included)
|
|
85
|
+
// just to build this set exceeds the bounded engine output.
|
|
86
|
+
return new Set((await loadEntityIds(context.prolog)).filter(Boolean));
|
|
86
87
|
}
|
|
87
88
|
catch {
|
|
88
89
|
return new Set();
|
|
@@ -10,6 +10,6 @@ export declare function annotateModelRequirementStep(step: Record<string, unknow
|
|
|
10
10
|
logicClaims: string[];
|
|
11
11
|
}): Record<string, unknown>;
|
|
12
12
|
export declare function getWorkspaceMigrationWarning(workspaceRoot: string): Promise<string | null>;
|
|
13
|
-
export declare function handleKbModelRequirement(_prolog: unknown, args: ModelRequirementArgs, workspaceRoot: string): Promise<ModelRequirementResult>;
|
|
13
|
+
export declare function handleKbModelRequirement(_prolog: unknown, args: ModelRequirementArgs, workspaceRoot: string, context?: OperationContext): Promise<ModelRequirementResult>;
|
|
14
14
|
export declare function executeModelRequirement(args: ModelRequirementArgs, context: OperationContext): Promise<ModelRequirementResult>;
|
|
15
15
|
//# sourceMappingURL=model-requirement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-requirement.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/model-requirement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"model-requirement.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/model-requirement.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAYjF,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAUhC,YAAY,EACV,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAkNhC,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,GACxB,CAAC;AAIF,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE;IACP,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,GACA,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgDzB;AAED,wBAAsB,4BAA4B,CAChD,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIxB;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,oBAAoB,EAC1B,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,sBAAsB,CAAC,CAoIjC;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,sBAAsB,CAAC,CAajC"}
|