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
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { analyzeSourceChanges } from "../plugins/source-change-analysis.js";
|
|
2
|
+
import { evaluateImpactReview, loadBaseImpactPolicy, } from "./impact-evaluator.js";
|
|
3
|
+
/** Authorize lexical coordinate migration only from a captured local staged review.
|
|
4
|
+
* Protected PR hosts must use their target-base evaluator, not this HEAD policy. */
|
|
5
|
+
export function createReviewedDecoratorCoordinateVerifier(snapshot, service, bindings) {
|
|
6
|
+
if (process.env.CI)
|
|
7
|
+
throw new Error("Reviewed partial coordinate migration is unavailable in CI without a protected target-base snapshot");
|
|
8
|
+
const policy = loadBaseImpactPolicy(snapshot);
|
|
9
|
+
let reviewValidation;
|
|
10
|
+
return async (path, analysis) => {
|
|
11
|
+
snapshot.assertUnchanged();
|
|
12
|
+
if (analysis.status !== "partial" ||
|
|
13
|
+
analysis.language !== "python" ||
|
|
14
|
+
analysis.sourceFile !== path ||
|
|
15
|
+
analysis.module.analysisMode !== "parser" ||
|
|
16
|
+
analysis.stamp?.pluginId !== "kibi-plugin-treesitter" ||
|
|
17
|
+
analysis.uncoveredRanges.length === 0 ||
|
|
18
|
+
analysis.providerId !== "kibi-plugin-treesitter.tree-sitter.v2" ||
|
|
19
|
+
analysis.diagnostics.length === 0 ||
|
|
20
|
+
analysis.providerFingerprint === null ||
|
|
21
|
+
!analysis.diagnostics.every((diagnostic) => diagnostic.code === "TREESITTER_DECORATOR_EXPANSION_UNAVAILABLE" &&
|
|
22
|
+
policy.allowedPartial.some((allowed) => allowed.providerId === analysis.providerId &&
|
|
23
|
+
allowed.providerFingerprint ===
|
|
24
|
+
`sha256:${analysis.providerFingerprint}` &&
|
|
25
|
+
allowed.diagnosticCode === diagnostic.code &&
|
|
26
|
+
allowed.limitationClass === "python-decorator-expansion")))
|
|
27
|
+
throw new Error(`Decorator coordinates for ${path} are not allowed by the captured base policy`);
|
|
28
|
+
reviewValidation ??= (async () => {
|
|
29
|
+
const analyses = await analyzeSourceChanges(snapshot.inventory, service);
|
|
30
|
+
// Use the same host normalization as staged check, without changing the
|
|
31
|
+
// original captured inventory used by the generated-byte comparison.
|
|
32
|
+
const evaluatedSnapshot = {
|
|
33
|
+
...snapshot,
|
|
34
|
+
inventory: snapshot.inventory.map((file) => analyses.get(file.path)?.after?.status === "ok"
|
|
35
|
+
? { ...file, analysisDepth: "symbol", disposition: "checked" }
|
|
36
|
+
: { ...file }),
|
|
37
|
+
};
|
|
38
|
+
const result = evaluateImpactReview(evaluatedSnapshot, {
|
|
39
|
+
...bindings,
|
|
40
|
+
analyses,
|
|
41
|
+
});
|
|
42
|
+
if (!result.passed)
|
|
43
|
+
throw new Error(`Reviewed coordinate migration failed: ${result.diagnostics.map((diagnostic) => diagnostic.message).join("; ")}`);
|
|
44
|
+
snapshot.assertUnchanged();
|
|
45
|
+
})();
|
|
46
|
+
await reviewValidation;
|
|
47
|
+
snapshot.assertUnchanged();
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ExtractionResult } from "../extractors/markdown.js";
|
|
2
|
+
/** Compile authored knowledge from regular blobs of one immutable Git tree. */
|
|
3
|
+
export declare function readSnapshotKnowledge(readGit: (args: readonly string[]) => Buffer, tree: string, readBlobs?: (oids: readonly string[]) => ReadonlyMap<string, Buffer>): ExtractionResult[];
|
|
4
|
+
//# sourceMappingURL=snapshot-knowledge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-knowledge.d.ts","sourceRoot":"","sources":["../../src/traceability/snapshot-knowledge.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,2BAA2B,CAAC;AAKnC,+EAA+E;AAE/E,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,MAAM,EAC5C,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACnE,gBAAgB,EAAE,CAyGpB"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { load as parseYaml } from "js-yaml";
|
|
2
|
+
import { extractFromManifestString } from "../extractors/manifest.js";
|
|
3
|
+
import { extractFromMarkdownString, } from "../extractors/markdown.js";
|
|
4
|
+
import { convertRecordToRelationship } from "../extractors/relationships.js";
|
|
5
|
+
import { isEntityLanePath } from "../utils/kb-paths.js";
|
|
6
|
+
/** Compile authored knowledge from regular blobs of one immutable Git tree. */
|
|
7
|
+
// implements REQ-014
|
|
8
|
+
export function readSnapshotKnowledge(readGit, tree, readBlobs) {
|
|
9
|
+
const entries = readGit(["ls-tree", "-r", "-z", tree, "--", ".kb"])
|
|
10
|
+
.toString("utf8")
|
|
11
|
+
.split("\0")
|
|
12
|
+
.filter(Boolean);
|
|
13
|
+
const authored = entries.filter((entry) => {
|
|
14
|
+
const file = entry.slice(entry.indexOf("\t") + 1);
|
|
15
|
+
return (file === ".kb/symbols.yaml" ||
|
|
16
|
+
file === ".kb/symbols.yml" ||
|
|
17
|
+
(isEntityLanePath(file) && file.endsWith(".md")) ||
|
|
18
|
+
(file.startsWith(".kb/relationships/") && /\.ya?ml$/.test(file)));
|
|
19
|
+
});
|
|
20
|
+
const blobs = readBlobs?.(authored.map((entry) => entry.slice(0, entry.indexOf("\t")).split(" ")[2] ?? ""));
|
|
21
|
+
const results = [];
|
|
22
|
+
const relationships = [];
|
|
23
|
+
for (const entry of authored) {
|
|
24
|
+
const tab = entry.indexOf("\t");
|
|
25
|
+
const metadata = entry.slice(0, tab).split(" ");
|
|
26
|
+
const file = entry.slice(tab + 1);
|
|
27
|
+
const isManifest = file === ".kb/symbols.yaml" || file === ".kb/symbols.yml";
|
|
28
|
+
const isEntity = isEntityLanePath(file) && file.endsWith(".md");
|
|
29
|
+
const isShard = file.startsWith(".kb/relationships/") && /\.ya?ml$/.test(file);
|
|
30
|
+
if (!isManifest && !isEntity && !isShard)
|
|
31
|
+
continue;
|
|
32
|
+
if (metadata[1] !== "blob" ||
|
|
33
|
+
!["100644", "100755"].includes(metadata[0] ?? ""))
|
|
34
|
+
throw new Error(`Snapshot knowledge must be a regular file: ${file}`);
|
|
35
|
+
const oid = metadata[2];
|
|
36
|
+
if (!oid)
|
|
37
|
+
throw new Error(`Missing snapshot object ID: ${file}`);
|
|
38
|
+
const content = new TextDecoder("utf-8", { fatal: true }).decode(blobs?.get(oid) ?? readGit(["cat-file", "blob", oid]));
|
|
39
|
+
if (isManifest)
|
|
40
|
+
results.push(...extractFromManifestString(content, file));
|
|
41
|
+
else if (isEntity) {
|
|
42
|
+
if (/^---\r?\n/.test(content))
|
|
43
|
+
results.push(extractFromMarkdownString(content, file));
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const parsed = parseYaml(content);
|
|
47
|
+
if (!parsed || !Array.isArray(parsed.relationships))
|
|
48
|
+
throw new Error(`Invalid snapshot relationship shard: ${file}`);
|
|
49
|
+
for (const row of parsed.relationships) {
|
|
50
|
+
if (!row ||
|
|
51
|
+
typeof row !== "object" ||
|
|
52
|
+
typeof row.type !== "string" ||
|
|
53
|
+
typeof row.from !== "string" ||
|
|
54
|
+
typeof row.to !== "string")
|
|
55
|
+
throw new Error(`Invalid snapshot relationship in ${file}`);
|
|
56
|
+
relationships.push(row);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const byId = new Map();
|
|
61
|
+
const duplicates = new Map();
|
|
62
|
+
for (const result of results) {
|
|
63
|
+
const previous = byId.get(result.entity.id);
|
|
64
|
+
if (previous) {
|
|
65
|
+
const declarations = duplicates.get(result.entity.id) ?? [previous];
|
|
66
|
+
declarations.push(result);
|
|
67
|
+
duplicates.set(result.entity.id, declarations);
|
|
68
|
+
}
|
|
69
|
+
else
|
|
70
|
+
byId.set(result.entity.id, result);
|
|
71
|
+
}
|
|
72
|
+
if (duplicates.size > 0)
|
|
73
|
+
throw new Error(`Duplicate snapshot entities: ${JSON.stringify([...duplicates].map(([id, declarations]) => ({
|
|
74
|
+
id,
|
|
75
|
+
declarations: declarations.map((row) => ({
|
|
76
|
+
title: row.entity.title,
|
|
77
|
+
status: row.entity.status,
|
|
78
|
+
source: row.entity.source,
|
|
79
|
+
sourceFile: row.sourceFile,
|
|
80
|
+
})),
|
|
81
|
+
})))}`);
|
|
82
|
+
for (const row of relationships) {
|
|
83
|
+
const relation = convertRecordToRelationship(row);
|
|
84
|
+
if (!relation)
|
|
85
|
+
continue;
|
|
86
|
+
const owner = byId.get(relation.from);
|
|
87
|
+
if (!owner || !byId.has(relation.to))
|
|
88
|
+
throw new Error(`Snapshot relationship has a missing endpoint: ${relation.from} -> ${relation.to}`);
|
|
89
|
+
owner.relationships.push(relation);
|
|
90
|
+
}
|
|
91
|
+
for (const result of results) {
|
|
92
|
+
for (const relation of result.relationships) {
|
|
93
|
+
if (!byId.has(relation.from) || !byId.has(relation.to))
|
|
94
|
+
throw new Error(`Snapshot relationship has a missing endpoint: ${relation.from} -> ${relation.to}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return results;
|
|
98
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { QualityDiagnostic } from "../public/impact/types.js";
|
|
2
2
|
import { type KibiImpactEvidence } from "./evidence-model.js";
|
|
3
|
-
export type KibiImpactDiagnosticId = "kibi_impact_evidence_missing" | "symbols_manifest_stale" | "symbol_granularity_violation" | "symbol_semantic_review_needed" | "multi_requirement_symbol_review" | "duplicate_symbol_coordinate_review" | "component_mixed_purpose_review" | "broad_requirement_review" | "requirement_status_review" | "strict_fact_modeling_review" | "logical_coverage_review" | "kibi_impact_override_missing_rationale";
|
|
3
|
+
export type KibiImpactDiagnosticId = "kibi_impact_evidence_missing" | "symbols_manifest_stale" | "symbol_granularity_violation" | "symbol_semantic_review_needed" | "multi_requirement_symbol_review" | "duplicate_symbol_coordinate_review" | "component_mixed_purpose_review" | "broad_requirement_review" | "requirement_status_review" | "strict_fact_modeling_review" | "logical_coverage_review" | "kibi_impact_override_missing_rationale" | "entity_id_style_review";
|
|
4
4
|
export interface KibiImpactDiagnostic extends QualityDiagnostic {
|
|
5
5
|
/** Stable staged-enforcement diagnostic identifier. */
|
|
6
6
|
id: KibiImpactDiagnosticId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staged-diagnostics.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-diagnostics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAGL,KAAK,kBAAkB,EAKxB,MAAM,qBAAqB,CAAC;AAQ7B,MAAM,MAAM,sBAAsB,GAC9B,8BAA8B,GAC9B,wBAAwB,GACxB,8BAA8B,GAC9B,+BAA+B,GAC/B,iCAAiC,GACjC,oCAAoC,GACpC,gCAAgC,GAChC,0BAA0B,GAC1B,2BAA2B,GAC3B,6BAA6B,GAC7B,yBAAyB,GACzB,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"staged-diagnostics.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-diagnostics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAGL,KAAK,kBAAkB,EAKxB,MAAM,qBAAqB,CAAC;AAQ7B,MAAM,MAAM,sBAAsB,GAC9B,8BAA8B,GAC9B,wBAAwB,GACxB,8BAA8B,GAC9B,+BAA+B,GAC/B,iCAAiC,GACjC,oCAAoC,GACpC,gCAAgC,GAChC,0BAA0B,GAC1B,2BAA2B,GAC3B,6BAA6B,GAC7B,yBAAyB,GACzB,wCAAwC,GACxC,wBAAwB,CAAC;AAE7B,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,uDAAuD;IACvD,EAAE,EAAE,sBAAsB,CAAC;IAC3B,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACxC,iEAAiE;IACjE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,gDAAgD;IAChD,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B;AAwID,wBAAgB,wCAAwC,CACtD,QAAQ,EAAE,kBAAkB,GAC3B,oBAAoB,CAoBtB;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,kBAAkB,EAC5B,mBAAmB,GAAE,MAAmC,GACvD,oBAAoB,EAAE,CAiDxB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StagedFile } from "./git-staged.js";
|
|
2
|
+
import type { KibiImpactDiagnostic } from "./staged-diagnostics.js";
|
|
3
|
+
/**
|
|
4
|
+
* Naming-style review for entity Markdown that this commit introduces.
|
|
5
|
+
*
|
|
6
|
+
* Only added or renamed files are evaluated: a staged edit to a committed
|
|
7
|
+
* legacy entity such as `REQ-003.md` is never reported, so the legacy numbered
|
|
8
|
+
* lanes stay grandfathered without a cutoff date or history lookup. The
|
|
9
|
+
* diagnostics are advisory and never block a commit.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createStagedEntityIdStyleDiagnostics(stagedFiles: readonly StagedFile[]): KibiImpactDiagnostic[];
|
|
12
|
+
//# sourceMappingURL=staged-entity-id-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staged-entity-id-style.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-entity-id-style.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE;;;;;;;GAOG;AAEH,wBAAgB,oCAAoC,CAClD,WAAW,EAAE,SAAS,UAAU,EAAE,GACjC,oBAAoB,EAAE,CAuBxB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Kibi — repo-local, per-branch, queryable long-term memory for software projects
|
|
3
|
+
Copyright (C) 2026 Piotr Franczyk
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify
|
|
6
|
+
it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
(at your option) any later version.
|
|
9
|
+
|
|
10
|
+
This program is distributed in the hope that it will be useful,
|
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
GNU Affero General Public License for more details.
|
|
14
|
+
|
|
15
|
+
You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { extractFromMarkdownString } from "../extractors/markdown.js";
|
|
19
|
+
import { entityIdStyleIssues } from "../utils/entity-id-style.js";
|
|
20
|
+
import { isEntityLanePath } from "../utils/kb-paths.js";
|
|
21
|
+
/**
|
|
22
|
+
* Naming-style review for entity Markdown that this commit introduces.
|
|
23
|
+
*
|
|
24
|
+
* Only added or renamed files are evaluated: a staged edit to a committed
|
|
25
|
+
* legacy entity such as `REQ-003.md` is never reported, so the legacy numbered
|
|
26
|
+
* lanes stay grandfathered without a cutoff date or history lookup. The
|
|
27
|
+
* diagnostics are advisory and never block a commit.
|
|
28
|
+
*/
|
|
29
|
+
// implements REQ-kibi-entity-id-style
|
|
30
|
+
export function createStagedEntityIdStyleDiagnostics(stagedFiles) {
|
|
31
|
+
const diagnostics = [];
|
|
32
|
+
for (const file of stagedFiles) {
|
|
33
|
+
if (file.status !== "A" && file.status !== "R")
|
|
34
|
+
continue;
|
|
35
|
+
if (!file.path.endsWith(".md") || !isEntityLanePath(file.path))
|
|
36
|
+
continue;
|
|
37
|
+
const id = readEntityId(file);
|
|
38
|
+
if (id === undefined)
|
|
39
|
+
continue;
|
|
40
|
+
for (const issue of entityIdStyleIssues({ id, sourcePath: file.path })) {
|
|
41
|
+
diagnostics.push({
|
|
42
|
+
id: "entity_id_style_review",
|
|
43
|
+
severity: "warning",
|
|
44
|
+
blocking: false,
|
|
45
|
+
category: "naming",
|
|
46
|
+
entityId: id,
|
|
47
|
+
source: file.path,
|
|
48
|
+
files: [file.path],
|
|
49
|
+
docs: ["docs/entity-schema.md"],
|
|
50
|
+
message: issue.message,
|
|
51
|
+
suggestion: issue.suggestion,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return diagnostics;
|
|
56
|
+
}
|
|
57
|
+
function readEntityId(file) {
|
|
58
|
+
if (file.content === undefined)
|
|
59
|
+
return undefined;
|
|
60
|
+
try {
|
|
61
|
+
const id = extractFromMarkdownString(file.content, file.path).entity.id;
|
|
62
|
+
return typeof id === "string" && id.trim() !== "" ? id.trim() : undefined;
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// Frontmatter errors are reported by staged Markdown validation.
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -10,6 +10,24 @@ export interface StagedFileCoverageRecord {
|
|
|
10
10
|
requirementIds: string[];
|
|
11
11
|
evidencePaths: string[];
|
|
12
12
|
providerId: string | null;
|
|
13
|
+
sourceAnalysis?: {
|
|
14
|
+
before: {
|
|
15
|
+
status: string;
|
|
16
|
+
language: string;
|
|
17
|
+
symbolCount: number;
|
|
18
|
+
providerId: string | null;
|
|
19
|
+
inputFingerprint: string;
|
|
20
|
+
providerFingerprint: string | null;
|
|
21
|
+
} | null;
|
|
22
|
+
after: {
|
|
23
|
+
status: string;
|
|
24
|
+
language: string;
|
|
25
|
+
symbolCount: number;
|
|
26
|
+
providerId: string | null;
|
|
27
|
+
inputFingerprint: string;
|
|
28
|
+
providerFingerprint: string | null;
|
|
29
|
+
} | null;
|
|
30
|
+
};
|
|
13
31
|
}
|
|
14
32
|
export interface StagedFileCoverageDiagnostic {
|
|
15
33
|
id: "staged_file_ownership_missing" | "staged_file_impact_review_needed";
|
|
@@ -23,6 +41,11 @@ export interface StagedFileCoverageDiagnostic {
|
|
|
23
41
|
}
|
|
24
42
|
export interface StagedFileCoverageResult {
|
|
25
43
|
version: typeof STAGED_FILE_COVERAGE_RESULT_VERSION;
|
|
44
|
+
snapshot?: {
|
|
45
|
+
baseTree: string;
|
|
46
|
+
headTree: string;
|
|
47
|
+
headCommit: string | null;
|
|
48
|
+
};
|
|
26
49
|
files: StagedFileCoverageRecord[];
|
|
27
50
|
diagnostics: StagedFileCoverageDiagnostic[];
|
|
28
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staged-file-coverage.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-file-coverage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,eAAO,MAAM,mCAAmC,EAC9C,8BAAuC,CAAC;AAE1C,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC7B,aAAa,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;IAC3C,WAAW,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAClC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"staged-file-coverage.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-file-coverage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,eAAO,MAAM,mCAAmC,EAC9C,8BAAuC,CAAC;AAE1C,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC7B,aAAa,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;IAC3C,WAAW,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAClC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,CAAC,EAAE;QACf,MAAM,EAAE;YACN,MAAM,EAAE,MAAM,CAAC;YACf,QAAQ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B,GACnC,wBAAwB,CA0G1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staged-impact-contract.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-impact-contract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"staged-impact-contract.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-impact-contract.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,0BAA0B,+GAI7B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9C,MAAM,MAAM,sBAAsB,GAC9B,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,CAAC;AAExB,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,sBAAsB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,+BAA+B,EAAE,OAAO,CAAC;IACzC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,4BAA4B;IAC3C,kBAAkB,EAAE,OAAO,CAAC;IAC5B,QAAQ,EAAE,wBAAwB,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,sBAAsB,EACtB,4BAA4B,CA6B7B,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,uBAAuB,GAC7B,sBAAsB,GAAG,IAAI,CAsB/B;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,GACX,wBAAwB,CAS1B;AAED,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,4BAA4B,GAClC,OAAO,CAMT;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CA8B5E;AAED,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvE"}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
+
import { isTsJsSourcePath } from "../plugins/source-classification.js";
|
|
1
2
|
import { isEntityLanePath, isSymbolsManifestPath } from "../utils/kb-paths.js";
|
|
2
|
-
const SUPPORTED_BEHAVIOR_SOURCE_EXTENSIONS = new Set([
|
|
3
|
-
".ts",
|
|
4
|
-
".tsx",
|
|
5
|
-
".js",
|
|
6
|
-
".jsx",
|
|
7
|
-
".mts",
|
|
8
|
-
".cts",
|
|
9
|
-
".mjs",
|
|
10
|
-
".cjs",
|
|
11
|
-
]);
|
|
12
3
|
export const KIBI_IMPACT_DIAGNOSTIC_IDS = [
|
|
13
4
|
"kibi_impact_evidence_missing",
|
|
14
5
|
"symbols_manifest_stale",
|
|
@@ -118,12 +109,7 @@ export function isBehaviorSourceEdit(input) {
|
|
|
118
109
|
return true;
|
|
119
110
|
}
|
|
120
111
|
export function isSupportedBehaviorSourcePath(filePath) {
|
|
121
|
-
|
|
122
|
-
if (filePath.endsWith(extension)) {
|
|
123
|
-
return true;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return false;
|
|
112
|
+
return isTsJsSourcePath(filePath);
|
|
127
113
|
}
|
|
128
114
|
function isEntityEvidenceMarkdown(filePath) {
|
|
129
115
|
if (!filePath.endsWith(".md")) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SourceAnalysisResult } from "kibi-plugin-sdk";
|
|
1
2
|
import { type ParsedCoordinateArtifact } from "../extractors/symbol-coordinates.js";
|
|
2
3
|
import type { KibiImpactSymbolsManifestFileDetail } from "./evidence-model.js";
|
|
3
4
|
import type { StagedFile } from "./git-staged.js";
|
|
@@ -29,9 +30,12 @@ export declare function assessStagedSymbolsManifest(options: {
|
|
|
29
30
|
symbolsManifestPath: string;
|
|
30
31
|
sourceFiles: StagedFile[];
|
|
31
32
|
stagedFiles: StagedFile[];
|
|
33
|
+
readBaseFile?: (filePath: string) => string | null;
|
|
34
|
+
analyzeSource?: (filePath: string, content: string) => SourceAnalysisResult;
|
|
32
35
|
}): StagedSymbolsManifestAssessment;
|
|
33
36
|
export declare function collectStagedAuthoredSymbolsManifestEvidence(options: {
|
|
34
37
|
sourceFiles: StagedFile[];
|
|
35
38
|
stagedFiles: StagedFile[];
|
|
39
|
+
readBaseFile?: (filePath: string) => string | null;
|
|
36
40
|
}): StagedAuthoredSymbolsManifestEvidence;
|
|
37
41
|
//# sourceMappingURL=staged-symbols-manifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staged-symbols-manifest.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-symbols-manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"staged-symbols-manifest.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-symbols-manifest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EACL,KAAK,wBAAwB,EAG9B,MAAM,qCAAqC,CAAC;AAI7C,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA0ClD,MAAM,WAAW,+BAA+B;IA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
@@ -215,11 +215,18 @@ function getChangedAuthoredEntityIds(headSymbols, stagedSymbols) {
|
|
|
215
215
|
});
|
|
216
216
|
return uniqueSorted(changedIds);
|
|
217
217
|
}
|
|
218
|
-
function normalizeExpectedSymbolsForStagedFile(stagedFile) {
|
|
219
|
-
const analysis = analyzeSourceText(stagedFile.path, stagedFile.content ?? "");
|
|
218
|
+
function normalizeExpectedSymbolsForStagedFile(stagedFile, analyze, authoredTitles = new Set()) {
|
|
219
|
+
const analysis = (analyze ?? analyzeSourceText)(stagedFile.path, stagedFile.content ?? "");
|
|
220
220
|
return analysis.symbols
|
|
221
221
|
.map((symbol) => ({
|
|
222
|
-
title:
|
|
222
|
+
title: (() => {
|
|
223
|
+
const qualified = symbol.qualifiedName;
|
|
224
|
+
if (!qualified ||
|
|
225
|
+
(authoredTitles.has(symbol.name) &&
|
|
226
|
+
analysis.symbols.filter((candidate) => candidate.name === symbol.name).length === 1))
|
|
227
|
+
return symbol.name;
|
|
228
|
+
return qualified;
|
|
229
|
+
})(),
|
|
223
230
|
sourceFile: stagedFile.path,
|
|
224
231
|
sourceLine: symbol.startLine,
|
|
225
232
|
sourceColumn: symbol.startColumn,
|
|
@@ -290,7 +297,9 @@ export function assessStagedSymbolsManifest(options) {
|
|
|
290
297
|
// assess several commits in the same checkout; a process-global cache would
|
|
291
298
|
// otherwise reuse content from the previous HEAD.
|
|
292
299
|
const headFileContentCache = new Map();
|
|
293
|
-
const readAssessmentHeadFileContent = (filePath) =>
|
|
300
|
+
const readAssessmentHeadFileContent = (filePath) => options.readBaseFile
|
|
301
|
+
? options.readBaseFile(filePath)
|
|
302
|
+
: readHeadFileContent(filePath, headFileContentCache);
|
|
294
303
|
const headManifestRecords = parseManifestRecords(readAssessmentHeadFileContent(paths.symbolsPath), paths.symbolsPath);
|
|
295
304
|
const headCoordinateArtifact = parseCoordinateArtifact(readAssessmentHeadFileContent(paths.coordinatesPath));
|
|
296
305
|
const { stagedCoordinatesFile, stagedCoordinateArtifact, stagedManifestRecords, } = getEffectiveManifestRecords({
|
|
@@ -342,7 +351,7 @@ export function assessStagedSymbolsManifest(options) {
|
|
|
342
351
|
const coarseTitles = new Set([...recordsByTitle.entries()]
|
|
343
352
|
.filter(([, records]) => records.every(isDocumentedCoarseRecord))
|
|
344
353
|
.map(([title]) => title));
|
|
345
|
-
const expectedSymbols = normalizeExpectedSymbolsForStagedFile(sourceFile).filter((symbol) => !coarseTitles.has(symbol.title));
|
|
354
|
+
const expectedSymbols = normalizeExpectedSymbolsForStagedFile(sourceFile, options.analyzeSource, new Set(recordsByTitle.keys())).filter((symbol) => !coarseTitles.has(symbol.title));
|
|
346
355
|
const baselineSymbols = normalizeManifestSymbolsForSourceFile(baselineMergedRecords, sourceFile.path);
|
|
347
356
|
if (signaturesEqual(expectedSymbols, baselineSymbols)) {
|
|
348
357
|
continue;
|
|
@@ -406,7 +415,9 @@ export function collectStagedAuthoredSymbolsManifestEvidence(options) {
|
|
|
406
415
|
if (!stagedManifestFile) {
|
|
407
416
|
return { path: paths.symbolsPath, entries: [], changedEntityIds: [] };
|
|
408
417
|
}
|
|
409
|
-
const headManifestRecords = parseManifestRecords(
|
|
418
|
+
const headManifestRecords = parseManifestRecords(options.readBaseFile
|
|
419
|
+
? options.readBaseFile(paths.symbolsPath)
|
|
420
|
+
: readHeadFileContent(paths.symbolsPath), paths.symbolsPath) ?? [];
|
|
410
421
|
const stagedManifestRecords = parseManifestRecords(stagedManifestFile.content, paths.symbolsPath);
|
|
411
422
|
if (stagedManifestRecords === null) {
|
|
412
423
|
return { path: paths.symbolsPath, entries: [], changedEntityIds: [] };
|
|
@@ -4,6 +4,7 @@ import { type SymbolKind, type SymbolRole } from "../public/symbol-granularity.j
|
|
|
4
4
|
import type { HunkRange, StagedFile } from "./git-staged.js";
|
|
5
5
|
type SourceAnalysisResult = SdkSourceAnalysisResult & {
|
|
6
6
|
providerId?: string | null;
|
|
7
|
+
status?: "ok" | "partial" | "unsupported" | "failed";
|
|
7
8
|
};
|
|
8
9
|
type TraceabilityRelationship = {
|
|
9
10
|
type: string;
|
|
@@ -38,11 +39,8 @@ export type ExtractSymbolsOptions = Readonly<{
|
|
|
38
39
|
}>;
|
|
39
40
|
export declare function extractSymbolsFromStagedFile(stagedFile: StagedFile, manifestLookup?: ManifestLookup, options?: ExtractSymbolsOptions): ExtractedSymbol[];
|
|
40
41
|
/**
|
|
41
|
-
* Async
|
|
42
|
-
*
|
|
43
|
-
* replace/augment/shadow (e.g. symbol repair). Maintenance paths (`check`,
|
|
44
|
-
* impact, sync, status, proof) must omit `registry` so external extractors
|
|
45
|
-
* never participate.
|
|
42
|
+
* Async extraction from supplied snapshot bytes. Maintenance callers inject the
|
|
43
|
+
* shared, host-approved v2 analysis; legacy direct callers retain v1 behavior.
|
|
46
44
|
*/
|
|
47
45
|
export declare function extractSymbolsFromStagedFileAsync(stagedFile: StagedFile, manifestLookup: ManifestLookup | undefined, options: ExtractSymbolsOptions & Readonly<{
|
|
48
46
|
registry?: import("../plugins/registry.js").CapabilityRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-extract.d.ts","sourceRoot":"","sources":["../../src/traceability/symbol-extract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,IAAI,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAEvF,OAAO,EAEL,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EAEhB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7D,KAAK,oBAAoB,GAAG,uBAAuB,GAAG;IACpD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"symbol-extract.d.ts","sourceRoot":"","sources":["../../src/traceability/symbol-extract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB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,CACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,KACZ,oBAAoB,GAAG,IAAI,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;CACzE,CAAC,CAAC;AAWH,wBAAgB,4BAA4B,CAE1C,UAAU,EAAE,UAAU,EACtB,cAAc,CAAC,EAAE,cAAc,EAC/B,OAAO,CAAC,EAAE,qBAAqB,GAC9B,eAAe,EAAE,CAkCnB;AAED;;;GAGG;AAEH,wBAAsB,iCAAiC,CACrD,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,GAAG,SAAS,EAC1C,OAAO,EAAE,qBAAqB,GAC5B,QAAQ,CAAC;IACP,QAAQ,CAAC,EAAE,OAAO,wBAAwB,EAAE,kBAAkB,CAAC;CAChE,CAAC,GACH,OAAO,CAAC,eAAe,EAAE,CAAC,CAuB5B;AA0DD,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -51,7 +51,8 @@ function resolveSymbolTraceability(filePath, name, manifestLookup) {
|
|
|
51
51
|
}
|
|
52
52
|
const candidateManifestPaths = getCandidateManifestPaths(filePath);
|
|
53
53
|
if (manifestLookup &&
|
|
54
|
-
|
|
54
|
+
(manifestLookup.has(createManifestLookupSentinelKey(".kb/symbols.yaml")) ||
|
|
55
|
+
candidateManifestPaths.some((manifestPath) => manifestLookup.has(createManifestLookupSentinelKey(manifestPath))))) {
|
|
55
56
|
return { id: createHashFallbackId(filePath, name) };
|
|
56
57
|
}
|
|
57
58
|
for (const manifestPath of candidateManifestPaths) {
|
|
@@ -193,52 +194,52 @@ stagedFile, manifestLookup, options) {
|
|
|
193
194
|
return symbolsFromAnalysis(stagedFile, cached.result, manifestLookup);
|
|
194
195
|
}
|
|
195
196
|
/**
|
|
196
|
-
* Async
|
|
197
|
-
*
|
|
198
|
-
* replace/augment/shadow (e.g. symbol repair). Maintenance paths (`check`,
|
|
199
|
-
* impact, sync, status, proof) must omit `registry` so external extractors
|
|
200
|
-
* never participate.
|
|
197
|
+
* Async extraction from supplied snapshot bytes. Maintenance callers inject the
|
|
198
|
+
* shared, host-approved v2 analysis; legacy direct callers retain v1 behavior.
|
|
201
199
|
*/
|
|
202
200
|
// implements REQ-capability-plugin-activation-disclosure-v1
|
|
203
201
|
export async function extractSymbolsFromStagedFileAsync(stagedFile, manifestLookup, options) {
|
|
204
202
|
const content = stagedFile.content ?? "";
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
let
|
|
208
|
-
if (
|
|
209
|
-
|
|
210
|
-
let analysis = null;
|
|
211
|
-
if (options.analyzeText) {
|
|
212
|
-
analysis = await options.analyzeText(stagedFile.path, content);
|
|
213
|
-
}
|
|
214
|
-
else if (options.registry) {
|
|
215
|
-
const { createSourceAnalysisService } = await import("../plugins/source-analysis-service.js");
|
|
216
|
-
analysis = await createSourceAnalysisService({
|
|
217
|
-
registry: options.registry,
|
|
218
|
-
}).analyzeText(stagedFile.path, content);
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
analysis = analyzeWithBuiltinFallback(stagedFile.path, content);
|
|
222
|
-
}
|
|
223
|
-
cached = { result: analysis, ts: now };
|
|
224
|
-
analysisCache.set(sha, cached);
|
|
225
|
-
}
|
|
226
|
-
catch {
|
|
227
|
-
cached = { result: null, ts: now };
|
|
228
|
-
analysisCache.set(sha, cached);
|
|
229
|
-
}
|
|
203
|
+
// Do not cache by a generic "custom" provider key: provider/query versions
|
|
204
|
+
// and snapshot contexts differ. The host owns any structural-analysis cache.
|
|
205
|
+
let analysis;
|
|
206
|
+
if (options.analyzeText) {
|
|
207
|
+
analysis = await options.analyzeText(stagedFile.path, content);
|
|
230
208
|
}
|
|
231
|
-
|
|
209
|
+
else if (options.registry) {
|
|
210
|
+
const { createSourceAnalysisService } = await import("../plugins/source-analysis-service.js");
|
|
211
|
+
analysis = await createSourceAnalysisService({
|
|
212
|
+
registry: options.registry,
|
|
213
|
+
}).analyzeText(stagedFile.path, content);
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
analysis = analyzeWithBuiltinFallback(stagedFile.path, content);
|
|
217
|
+
}
|
|
218
|
+
if (analysis?.status === "failed" || analysis?.status === "partial") {
|
|
219
|
+
throw new Error(`Source analysis ${analysis.status} for ${stagedFile.path}; complete symbol validation is unavailable`);
|
|
220
|
+
}
|
|
221
|
+
return symbolsFromAnalysis(stagedFile, analysis, manifestLookup);
|
|
232
222
|
}
|
|
233
223
|
function symbolsFromAnalysis(stagedFile, analysis, manifestLookup) {
|
|
234
224
|
if (!analysis)
|
|
235
225
|
return [];
|
|
226
|
+
if (analysis.status !== undefined) {
|
|
227
|
+
const locators = new Set();
|
|
228
|
+
for (const symbol of analysis.symbols) {
|
|
229
|
+
const locator = symbol.qualifiedName ?? symbol.name;
|
|
230
|
+
if (locators.has(locator))
|
|
231
|
+
throw new Error(`Ambiguous declaration locator '${locator}' in ${stagedFile.path}; authored identity cannot be assigned`);
|
|
232
|
+
locators.add(locator);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
236
235
|
const results = [];
|
|
237
236
|
for (const symbol of analysis.symbols) {
|
|
238
237
|
try {
|
|
239
|
-
results.push(buildSymbolResult(stagedFile, symbol.
|
|
238
|
+
results.push(buildSymbolResult(stagedFile, sourceSymbolLocator(symbol, analysis.symbols, stagedFile.path, manifestLookup), symbol.kind, { startLine: symbol.startLine, endLine: symbol.endLine }, parseReqDirectives(symbol.directiveText ?? ""), manifestLookup));
|
|
240
239
|
}
|
|
241
|
-
catch {
|
|
240
|
+
catch (error) {
|
|
241
|
+
if (analysis.status !== undefined)
|
|
242
|
+
throw error;
|
|
242
243
|
void stagedFile.path;
|
|
243
244
|
}
|
|
244
245
|
}
|
|
@@ -259,3 +260,17 @@ function intersectingHunks(startLine, endLine, hunks) {
|
|
|
259
260
|
}
|
|
260
261
|
return out;
|
|
261
262
|
}
|
|
263
|
+
// implements REQ-008
|
|
264
|
+
function sourceSymbolLocator(symbol, symbols, filePath, lookup) {
|
|
265
|
+
const qualified = symbol.qualifiedName;
|
|
266
|
+
if (!qualified || qualified === symbol.name)
|
|
267
|
+
return symbol.name;
|
|
268
|
+
if (lookup?.has(`${filePath}:${qualified}`))
|
|
269
|
+
return qualified;
|
|
270
|
+
// Preserve an authored legacy unqualified locator only when unambiguous.
|
|
271
|
+
if (symbols.filter((candidate) => candidate.name === symbol.name).length ===
|
|
272
|
+
1 &&
|
|
273
|
+
lookup?.has(`${filePath}:${symbol.name}`))
|
|
274
|
+
return symbol.name;
|
|
275
|
+
return qualified;
|
|
276
|
+
}
|
|
@@ -24,7 +24,7 @@ export declare function _setPrologFactory(factory: (opts: {
|
|
|
24
24
|
declare function consultOverlay(ctx: TempKbContext): Promise<void>;
|
|
25
25
|
export { consultOverlay };
|
|
26
26
|
export declare function projectStagedEntities(prolog: PrologProcess, results: ExtractionResult[]): Promise<void>;
|
|
27
|
-
export declare function createTempKb(baseKbPath
|
|
27
|
+
export declare function createTempKb(baseKbPath?: string): Promise<TempKbContext>;
|
|
28
28
|
export declare function createOverlayFacts(symbols: ExtractedSymbol[]): string;
|
|
29
29
|
export declare function cleanupTempKb(tempDir: string): Promise<void>;
|
|
30
30
|
//# sourceMappingURL=temp-kb.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temp-kb.d.ts","sourceRoot":"","sources":["../../src/traceability/temp-kb.ts"],"names":[],"mappings":"AAMA,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,OAAO,CAET;AACD,OAAO,KAAK,EAGV,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MA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