kibi-cli 2.3.0 → 2.5.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-json-command.d.ts +6 -0
- package/dist/cli-json-command.d.ts.map +1 -1
- package/dist/cli-json-command.js +39 -11
- package/dist/cli-operation-loader.d.ts.map +1 -1
- package/dist/cli-operation-loader.js +7 -0
- package/dist/cli-operation-metadata.d.ts +13 -5
- package/dist/cli-operation-metadata.d.ts.map +1 -1
- package/dist/cli-operation-metadata.js +15 -5
- package/dist/cli-protocol.d.ts +14 -0
- package/dist/cli-protocol.d.ts.map +1 -1
- package/dist/cli-protocol.js +31 -2
- package/dist/cli-register-maintenance.d.ts.map +1 -1
- package/dist/cli-register-maintenance.js +7 -0
- package/dist/cli-register-proof.d.ts.map +1 -1
- package/dist/cli-register-proof.js +13 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +11 -2
- package/dist/commands/discovery-shared.d.ts.map +1 -1
- package/dist/commands/discovery-shared.js +8 -2
- package/dist/commands/engine.d.ts.map +1 -1
- package/dist/commands/engine.js +4 -2
- package/dist/commands/gc.d.ts.map +1 -1
- package/dist/commands/gc.js +7 -0
- package/dist/commands/init-helpers.d.ts.map +1 -1
- package/dist/commands/init-helpers.js +0 -1
- package/dist/commands/merge-driver.d.ts +31 -0
- package/dist/commands/merge-driver.d.ts.map +1 -0
- package/dist/commands/merge-driver.js +268 -0
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +281 -14
- package/dist/commands/proof-compact.d.ts +9 -0
- package/dist/commands/proof-compact.d.ts.map +1 -0
- package/dist/commands/proof-compact.js +58 -0
- package/dist/commands/prove.d.ts +38 -0
- package/dist/commands/prove.d.ts.map +1 -1
- package/dist/commands/prove.js +222 -47
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +61 -16
- package/dist/commands/sync.d.ts +8 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +42 -16
- package/dist/diagnostics.js +1 -1
- package/dist/engine-limits.d.ts +74 -0
- package/dist/engine-limits.d.ts.map +1 -0
- package/dist/engine-limits.js +201 -0
- package/dist/engine.d.ts +10 -0
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +57 -9
- package/dist/extractors/manifest.d.ts +8 -0
- package/dist/extractors/manifest.d.ts.map +1 -1
- package/dist/extractors/manifest.js +34 -5
- package/dist/extractors/markdown.d.ts +8 -0
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +57 -0
- package/dist/extractors/relationships.d.ts.map +1 -1
- package/dist/extractors/relationships.js +2 -0
- package/dist/intent-search.d.ts +4 -1
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +186 -33
- package/dist/operations/bootstrap/candidate-helpers.d.ts.map +1 -1
- package/dist/operations/bootstrap/candidate-helpers.js +8 -1
- package/dist/operations/bootstrap/candidates.d.ts.map +1 -1
- package/dist/operations/bootstrap/candidates.js +55 -39
- package/dist/operations/bootstrap/discovery.js +1 -1
- package/dist/operations/bootstrap/generate.d.ts +2 -0
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +107 -37
- package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance-actions.js +3 -0
- package/dist/operations/bootstrap/guidance.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance.js +7 -1
- package/dist/operations/bootstrap/intent-claims.d.ts +17 -0
- package/dist/operations/bootstrap/intent-claims.d.ts.map +1 -0
- package/dist/operations/bootstrap/intent-claims.js +103 -0
- package/dist/operations/bootstrap/markdown-candidates.d.ts +2 -0
- package/dist/operations/bootstrap/markdown-candidates.d.ts.map +1 -1
- package/dist/operations/bootstrap/markdown-candidates.js +32 -10
- package/dist/operations/bootstrap/presentation.d.ts +2 -0
- package/dist/operations/bootstrap/presentation.d.ts.map +1 -1
- package/dist/operations/bootstrap/presentation.js +66 -3
- package/dist/operations/bootstrap/requirement-claims.d.ts +1 -0
- package/dist/operations/bootstrap/requirement-claims.d.ts.map +1 -1
- package/dist/operations/bootstrap/requirement-claims.js +13 -1
- package/dist/operations/bootstrap/types.d.ts +28 -0
- package/dist/operations/bootstrap/types.d.ts.map +1 -1
- package/dist/operations/bootstrap/types.js +16 -0
- package/dist/operations/bootstrap/validation.d.ts +4 -0
- package/dist/operations/bootstrap/validation.d.ts.map +1 -0
- package/dist/operations/bootstrap/validation.js +20 -0
- package/dist/operations/migration/inventory-rederive.d.ts +81 -0
- package/dist/operations/migration/inventory-rederive.d.ts.map +1 -0
- package/dist/operations/migration/inventory-rederive.js +484 -0
- package/dist/operations/migration/kb-sources.d.ts +53 -0
- package/dist/operations/migration/kb-sources.d.ts.map +1 -0
- package/dist/operations/migration/kb-sources.js +233 -0
- package/dist/operations/migration/origin-backfill.d.ts +39 -0
- package/dist/operations/migration/origin-backfill.d.ts.map +1 -0
- package/dist/operations/migration/origin-backfill.js +164 -0
- package/dist/operations/migration/polarity-values.d.ts +10 -0
- package/dist/operations/migration/polarity-values.d.ts.map +1 -0
- package/dist/operations/migration/polarity-values.js +60 -0
- package/dist/operations/migration/schema6.d.ts +59 -0
- package/dist/operations/migration/schema6.d.ts.map +1 -0
- package/dist/operations/migration/schema6.js +379 -0
- package/dist/operations/migration/source-paths.d.ts +131 -0
- package/dist/operations/migration/source-paths.d.ts.map +1 -0
- package/dist/operations/migration/source-paths.js +308 -0
- package/dist/operations/migration/superseded-closure.d.ts +54 -0
- package/dist/operations/migration/superseded-closure.d.ts.map +1 -0
- package/dist/operations/migration/superseded-closure.js +187 -0
- package/dist/operations/modeling/logic-modeling.d.ts.map +1 -1
- package/dist/operations/modeling/logic-modeling.js +3 -5
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +225 -67
- package/dist/operations/mutation/contradictions.d.ts +16 -0
- package/dist/operations/mutation/contradictions.d.ts.map +1 -1
- package/dist/operations/mutation/contradictions.js +32 -0
- package/dist/operations/mutation/delete.d.ts.map +1 -1
- package/dist/operations/mutation/delete.js +15 -7
- package/dist/operations/mutation/origin.d.ts +21 -0
- package/dist/operations/mutation/origin.d.ts.map +1 -0
- package/dist/operations/mutation/origin.js +78 -0
- package/dist/operations/mutation/plan-apply-journal.d.ts +182 -0
- package/dist/operations/mutation/plan-apply-journal.d.ts.map +1 -0
- package/dist/operations/mutation/plan-apply-journal.js +613 -0
- package/dist/operations/mutation/predicate-vocabulary-guard.d.ts +3 -1
- package/dist/operations/mutation/predicate-vocabulary-guard.d.ts.map +1 -1
- package/dist/operations/mutation/predicate-vocabulary-guard.js +13 -2
- package/dist/operations/mutation/relationships.d.ts +5 -5
- package/dist/operations/mutation/relationships.d.ts.map +1 -1
- package/dist/operations/mutation/relationships.js +31 -11
- package/dist/operations/mutation/serialization.d.ts.map +1 -1
- package/dist/operations/mutation/serialization.js +3 -1
- 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 +7 -1
- package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-refresh.js +4 -1
- package/dist/operations/mutation/types.d.ts +14 -0
- package/dist/operations/mutation/types.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.d.ts +30 -3
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +105 -35
- package/dist/operations/mutation/validate-upsert.d.ts +6 -0
- package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
- package/dist/operations/mutation/validate-upsert.js +34 -30
- package/dist/operations/planning/apply-plan.d.ts.map +1 -1
- package/dist/operations/planning/apply-plan.js +751 -144
- package/dist/operations/planning/compile-intent.d.ts +34 -1
- package/dist/operations/planning/compile-intent.d.ts.map +1 -1
- package/dist/operations/planning/compile-intent.js +314 -98
- package/dist/operations/proof/code-scope.d.ts +28 -0
- package/dist/operations/proof/code-scope.d.ts.map +1 -1
- package/dist/operations/proof/code-scope.js +72 -0
- package/dist/operations/proof/compact-receipts.d.ts +49 -0
- package/dist/operations/proof/compact-receipts.d.ts.map +1 -0
- package/dist/operations/proof/compact-receipts.js +160 -0
- package/dist/operations/proof/ingest-proof.d.ts +2 -0
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
- package/dist/operations/proof/ingest-proof.js +44 -23
- package/dist/operations/proof/prune-receipts.d.ts.map +1 -1
- package/dist/operations/proof/prune-receipts.js +5 -9
- package/dist/operations/proof/receipt-compaction.d.ts +48 -0
- package/dist/operations/proof/receipt-compaction.d.ts.map +1 -0
- package/dist/operations/proof/receipt-compaction.js +121 -0
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analysis-receipt.js +12 -1
- package/dist/operations/semantic-advisor/analyze-prose.d.ts +2 -1
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +51 -5
- 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 +11 -1
- package/dist/operations/semantic-advisor/conditional-rules.d.ts +33 -0
- package/dist/operations/semantic-advisor/conditional-rules.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/conditional-rules.js +262 -0
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts +3 -1
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/ingestion-boundary.js +14 -6
- package/dist/operations/semantic-advisor/plugin-orchestration.js +1 -1
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +2 -1
- package/dist/prolog.d.ts +9 -0
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +56 -10
- package/dist/proof/command-test-report.d.ts +74 -0
- package/dist/proof/command-test-report.d.ts.map +1 -0
- package/dist/proof/command-test-report.js +206 -0
- package/dist/public/branch-resolver.d.ts +1 -0
- package/dist/public/branch-resolver.d.ts.map +1 -1
- package/dist/public/branch-resolver.js +1 -0
- package/dist/public/diagnostic-usage.d.ts +14 -0
- package/dist/public/diagnostic-usage.d.ts.map +1 -1
- package/dist/public/diagnostic-usage.js +55 -1
- package/dist/public/entity-origin.d.ts +69 -0
- package/dist/public/entity-origin.d.ts.map +1 -0
- package/dist/public/entity-origin.js +142 -0
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +1 -0
- package/dist/public/impact/requirement-quality.js +1 -1
- package/dist/public/operations/catalog.d.ts +203 -20
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/catalog.js +3 -0
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +8 -0
- package/dist/public/operations/contracts.d.ts +0 -5
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +63 -14
- package/dist/public/operations/discovery-entities.d.ts +15 -0
- package/dist/public/operations/discovery-entities.d.ts.map +1 -1
- package/dist/public/operations/discovery-entities.js +59 -0
- package/dist/public/operations/discovery-executors.d.ts +6 -1
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +65 -6
- package/dist/public/operations/index.d.ts +1 -0
- package/dist/public/operations/index.d.ts.map +1 -1
- package/dist/public/operations/index.js +1 -0
- package/dist/public/operations/migration-plan.d.ts +5 -0
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +26 -1
- package/dist/public/operations/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +24 -3
- package/dist/public/operations/origin-review.d.ts +51 -0
- package/dist/public/operations/origin-review.d.ts.map +1 -0
- package/dist/public/operations/origin-review.js +307 -0
- package/dist/public/operations/predicate-schema-conformance.js +1 -1
- package/dist/public/operations/repair-plan.d.ts.map +1 -1
- package/dist/public/operations/repair-plan.js +4 -0
- package/dist/public/operations/result-envelope.d.ts.map +1 -1
- package/dist/public/operations/result-envelope.js +17 -5
- package/dist/public/operations/runtime-types.d.ts +9 -0
- package/dist/public/operations/runtime-types.d.ts.map +1 -1
- package/dist/public/operations/schema6-check-actions.d.ts +127 -0
- package/dist/public/operations/schema6-check-actions.d.ts.map +1 -0
- package/dist/public/operations/schema6-check-actions.js +575 -0
- package/dist/public/operations/source-path-dangling.d.ts +17 -0
- package/dist/public/operations/source-path-dangling.d.ts.map +1 -0
- package/dist/public/operations/source-path-dangling.js +66 -0
- package/dist/public/operations/specs/bootstrap.d.ts +73 -1
- package/dist/public/operations/specs/bootstrap.d.ts.map +1 -1
- package/dist/public/operations/specs/bootstrap.js +66 -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 +15 -1
- package/dist/public/operations/specs/check.d.ts +2 -2
- package/dist/public/operations/specs/check.js +1 -1
- package/dist/public/operations/specs/composite.d.ts +351 -0
- package/dist/public/operations/specs/composite.d.ts.map +1 -0
- package/dist/public/operations/specs/composite.js +96 -0
- package/dist/public/operations/specs/discovery.d.ts +8 -3
- package/dist/public/operations/specs/discovery.d.ts.map +1 -1
- package/dist/public/operations/specs/discovery.js +8 -3
- package/dist/public/operations/specs/modeling.d.ts +2 -2
- package/dist/public/operations/specs/modeling.js +2 -2
- package/dist/public/operations/specs/mutation-schemas.d.ts +73 -8
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +43 -7
- package/dist/public/operations/specs/mutation.d.ts +1 -1
- package/dist/public/operations/specs/mutation.js +1 -1
- package/dist/public/operations/specs/planning.d.ts +2 -2
- package/dist/public/operations/specs/planning.js +4 -4
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +13 -26
- package/dist/public/operations/specs/upsert.d.ts +79 -9
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/specs/upsert.js +6 -1
- package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -1
- package/dist/public/operations/symbol-repair-plan.js +3 -1
- package/dist/public/operations/types.d.ts +1 -1
- package/dist/public/operations/types.d.ts.map +1 -1
- package/dist/public/proof-receipt.d.ts +1 -0
- package/dist/public/proof-receipt.d.ts.map +1 -1
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +52 -0
- package/dist/public/schemas/relationship.d.ts.map +1 -1
- package/dist/public/schemas/relationship.js +2 -0
- package/dist/public/skills/kibi-bootstrap/SKILL.md +52 -11
- package/dist/public/skills/kibi-bootstrap/resources/bootstrap.md +12 -1
- package/dist/public/skills/kibi-usage/SKILL.md +82 -18
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +5 -5
- package/dist/public/skills/kibi-usage/resources/kb-improvement.md +1 -1
- package/dist/public/skills/kibi-usage/resources/logic-ir.md +2 -2
- package/dist/public/skills/kibi-usage/resources/operation-access.md +29 -1
- package/dist/public/skills/kibi-usage/resources/ui-requirements.md +4 -4
- package/dist/public/skills/kibi-usage/resources/workflows.md +42 -25
- package/dist/public/telemetry-acceptance.d.ts +64 -0
- package/dist/public/telemetry-acceptance.d.ts.map +1 -1
- package/dist/public/telemetry-acceptance.js +143 -7
- package/dist/public/telemetry-remediation.d.ts.map +1 -1
- package/dist/public/telemetry-remediation.js +26 -10
- package/dist/relationships/shards.d.ts +13 -0
- package/dist/relationships/shards.d.ts.map +1 -1
- package/dist/relationships/shards.js +54 -28
- package/dist/runtime/cli-runtime.d.ts.map +1 -1
- package/dist/runtime/cli-runtime.js +44 -3
- package/dist/runtime/detached-snapshot.d.ts +38 -0
- package/dist/runtime/detached-snapshot.d.ts.map +1 -0
- package/dist/runtime/detached-snapshot.js +92 -0
- package/dist/schemas/entity.schema.json +122 -0
- package/dist/search-answer.d.ts +157 -0
- package/dist/search-answer.d.ts.map +1 -0
- package/dist/search-answer.js +846 -0
- package/dist/traceability/impact-knowledge.d.ts.map +1 -1
- package/dist/traceability/impact-knowledge.js +7 -0
- package/dist/traceability/symbol-extract.js +3 -3
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +12 -0
- package/dist/types/entities.d.ts +13 -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/branch-resolver.d.ts +37 -1
- package/dist/utils/branch-resolver.d.ts.map +1 -1
- package/dist/utils/branch-resolver.js +130 -3
- package/dist/utils/repo-relative-path.d.ts +18 -0
- package/dist/utils/repo-relative-path.d.ts.map +1 -0
- package/dist/utils/repo-relative-path.js +58 -0
- package/dist/utils/rule-registry.generated.d.ts +75 -3
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +89 -3
- package/dist/utils/schema-version.d.ts +1 -1
- package/dist/utils/schema-version.d.ts.map +1 -1
- package/dist/utils/schema-version.js +4 -3
- package/dist/utils/strict-modeling.d.ts +1 -1
- package/dist/utils/strict-modeling.d.ts.map +1 -1
- package/dist/utils/strict-modeling.js +23 -3
- package/package.json +3 -3
- package/schema/entities.pl +22 -0
- package/schema/relationships.pl +14 -0
- package/schema/validation.pl +45 -1
- package/src/public/branch-resolver.ts +1 -0
- package/src/public/diagnostic-usage.ts +59 -1
- package/src/public/entity-origin.ts +175 -0
- package/src/public/impact/full-kb-quality.ts +1 -0
- package/src/public/impact/requirement-quality.ts +1 -1
- package/src/public/operations/catalog.ts +3 -0
- package/src/public/operations/check-executor.ts +15 -0
- package/src/public/operations/contracts.ts +75 -15
- package/src/public/operations/discovery-entities.ts +74 -0
- package/src/public/operations/discovery-executors.ts +88 -10
- package/src/public/operations/index.ts +1 -0
- package/src/public/operations/migration-plan.ts +30 -1
- package/src/public/operations/node-ports.ts +24 -3
- package/src/public/operations/origin-review.ts +375 -0
- package/src/public/operations/predicate-schema-conformance.ts +1 -1
- package/src/public/operations/repair-plan.ts +4 -0
- package/src/public/operations/result-envelope.ts +18 -6
- package/src/public/operations/runtime-types.ts +9 -0
- package/src/public/operations/schema6-check-actions.ts +699 -0
- package/src/public/operations/source-path-dangling.ts +81 -0
- package/src/public/operations/specs/bootstrap.ts +78 -4
- package/src/public/operations/specs/check-rules.generated.ts +15 -1
- package/src/public/operations/specs/check.ts +1 -1
- package/src/public/operations/specs/composite.ts +141 -0
- package/src/public/operations/specs/discovery.ts +9 -3
- package/src/public/operations/specs/modeling.ts +2 -2
- package/src/public/operations/specs/mutation-schemas.ts +49 -7
- package/src/public/operations/specs/mutation.ts +1 -1
- package/src/public/operations/specs/planning.ts +4 -4
- package/src/public/operations/specs/reporting.ts +13 -38
- package/src/public/operations/specs/upsert.ts +7 -1
- package/src/public/operations/symbol-repair-plan.ts +3 -1
- package/src/public/operations/types.ts +2 -0
- package/src/public/proof-receipt.ts +1 -0
- package/src/public/schemas/entity.ts +57 -0
- package/src/public/schemas/relationship.ts +2 -0
- package/src/public/skills/kibi-bootstrap/SKILL.md +52 -11
- package/src/public/skills/kibi-bootstrap/resources/bootstrap.md +12 -1
- package/src/public/skills/kibi-usage/SKILL.md +82 -18
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +5 -5
- package/src/public/skills/kibi-usage/resources/kb-improvement.md +1 -1
- package/src/public/skills/kibi-usage/resources/logic-ir.md +2 -2
- package/src/public/skills/kibi-usage/resources/operation-access.md +29 -1
- package/src/public/skills/kibi-usage/resources/ui-requirements.md +4 -4
- package/src/public/skills/kibi-usage/resources/workflows.md +42 -25
- package/src/public/telemetry-acceptance-types.d.ts +4 -1
- package/src/public/telemetry-acceptance.ts +210 -7
- package/src/public/telemetry-remediation.ts +39 -10
- package/src/schemas/entity.schema.json +122 -0
- package/src/schemas/relationship.schema.json +2 -0
|
@@ -4,42 +4,37 @@ import { extractFromMarkdownString } from "../../extractors/markdown.js";
|
|
|
4
4
|
import { confidenceBand, slug, upsert } from "./candidate-helpers.js";
|
|
5
5
|
import { markdownCandidates, } from "./markdown-candidates.js";
|
|
6
6
|
function typedCandidates(item, existingIds) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
return [];
|
|
42
|
-
}
|
|
7
|
+
const results = item.kind === "symbol_manifest"
|
|
8
|
+
? extractFromManifestString(item.content ?? "", item.relativePath ?? item.label)
|
|
9
|
+
: [
|
|
10
|
+
extractFromMarkdownString(item.content ?? "", item.relativePath ?? item.label),
|
|
11
|
+
];
|
|
12
|
+
return results.flatMap(({ entity, relationships }) => {
|
|
13
|
+
if (existingIds.has(entity.id))
|
|
14
|
+
return [];
|
|
15
|
+
const sourceKind = item.kind === "symbol_manifest" ? "symbol_manifest" : "typed_markdown";
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
candidateId: `${sourceKind === "symbol_manifest" ? "mf" : "md"}:${item.relativePath}:${entity.id}`,
|
|
19
|
+
entityType: entity.type,
|
|
20
|
+
title: entity.title,
|
|
21
|
+
sourceKind,
|
|
22
|
+
sourcePath: item.absolutePath ?? item.label,
|
|
23
|
+
confidence: sourceKind === "symbol_manifest" ? 0.98 : 1,
|
|
24
|
+
confidenceBand: "high",
|
|
25
|
+
evidence: [
|
|
26
|
+
`extracted_from_${sourceKind}:${item.relativePath}`,
|
|
27
|
+
`entity_id:${entity.id}`,
|
|
28
|
+
],
|
|
29
|
+
relationships: relationships.map(({ type, from, to }) => ({
|
|
30
|
+
type,
|
|
31
|
+
from,
|
|
32
|
+
to,
|
|
33
|
+
})),
|
|
34
|
+
applyPlan: [upsert(entity, relationships)],
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
});
|
|
43
38
|
}
|
|
44
39
|
function providerCandidate(item, existingIds, minConfidence) {
|
|
45
40
|
if (!new Set([
|
|
@@ -91,18 +86,37 @@ function providerCandidate(item, existingIds, minConfidence) {
|
|
|
91
86
|
},
|
|
92
87
|
];
|
|
93
88
|
}
|
|
94
|
-
// implements REQ-
|
|
89
|
+
// implements REQ-KIBI-BOOTSTRAP-PLAN, REQ-kibi-operation-interface-parity
|
|
95
90
|
// implements REQ-KIBI-BOOTSTRAP-PLAN
|
|
96
91
|
export function buildBootstrapCandidates(evidence, existingIds, minConfidence, includeGenericMarkdown) {
|
|
97
92
|
const candidates = [];
|
|
98
93
|
const sourceOnlySignals = [];
|
|
94
|
+
const diagnostics = [];
|
|
95
|
+
const suppressed = [];
|
|
99
96
|
for (const item of evidence) {
|
|
100
|
-
if (item.kind === "typed_markdown" || item.kind === "symbol_manifest")
|
|
101
|
-
|
|
97
|
+
if (item.kind === "typed_markdown" || item.kind === "symbol_manifest") {
|
|
98
|
+
try {
|
|
99
|
+
candidates.push(...typedCandidates(item, existingIds));
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
103
|
+
const sourcePath = item.relativePath ?? item.label;
|
|
104
|
+
diagnostics.push(`Bootstrap extraction failed at ${sourcePath}: ${message}`);
|
|
105
|
+
suppressed.push({
|
|
106
|
+
candidateId: "",
|
|
107
|
+
sourcePath,
|
|
108
|
+
entityType: "",
|
|
109
|
+
reason: "extraction_failed",
|
|
110
|
+
message,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
102
114
|
if (item.kind === "generic_markdown" && includeGenericMarkdown) {
|
|
103
115
|
const built = markdownCandidates(item, existingIds, minConfidence);
|
|
104
116
|
candidates.push(...built.candidates);
|
|
105
117
|
sourceOnlySignals.push(...built.sourceOnlySignals);
|
|
118
|
+
diagnostics.push(...built.diagnostics);
|
|
119
|
+
suppressed.push(...built.suppressed);
|
|
106
120
|
}
|
|
107
121
|
if (item.kind === "test_topology") {
|
|
108
122
|
const confidence = typeof item.data.confidence === "number" ? item.data.confidence : 0.8;
|
|
@@ -122,6 +136,8 @@ export function buildBootstrapCandidates(evidence, existingIds, minConfidence, i
|
|
|
122
136
|
}
|
|
123
137
|
return {
|
|
124
138
|
candidates,
|
|
139
|
+
diagnostics,
|
|
140
|
+
suppressed,
|
|
125
141
|
sourceOnlySignals: sourceOnlySignals.sort((left, right) => right.confidence - left.confidence ||
|
|
126
142
|
left.sourcePath.localeCompare(right.sourcePath)),
|
|
127
143
|
};
|
|
@@ -63,7 +63,7 @@ function frameworks(evidence) {
|
|
|
63
63
|
: [])),
|
|
64
64
|
].sort();
|
|
65
65
|
}
|
|
66
|
-
// implements REQ-
|
|
66
|
+
// implements REQ-KIBI-BOOTSTRAP-PLAN, REQ-kibi-operation-interface-parity
|
|
67
67
|
// implements REQ-KIBI-BOOTSTRAP-PLAN
|
|
68
68
|
export async function discoverBootstrap(context) {
|
|
69
69
|
const scan = await scanEvidence(context);
|
|
@@ -4,6 +4,8 @@ export declare function filterSourceOnlySignals(signals: readonly SourceOnlySign
|
|
|
4
4
|
export declare function selectBootstrapCandidates(input: readonly Candidate[], existingIds: ReadonlySet<string>, entityTypes: readonly string[] | undefined, maximum: number): {
|
|
5
5
|
readonly candidates: readonly Candidate[];
|
|
6
6
|
readonly suppressed: readonly Readonly<Record<string, unknown>>[];
|
|
7
|
+
readonly sourceOnlySignals: readonly SourceOnlySignal[];
|
|
8
|
+
readonly diagnostics: readonly string[];
|
|
7
9
|
};
|
|
8
10
|
export declare function executePlanBootstrap(args: PlanBootstrapArgs, context: OperationContext): Promise<PlanBootstrapResult>;
|
|
9
11
|
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/generate.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/generate.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAOjF,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GACzC,SAAS,gBAAgB,EAAE,CAI7B;AA8BD,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EAChC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAC1C,OAAO,EAAE,MAAM,GACd;IACD,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IAClE,QAAQ,CAAC,iBAAiB,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC,CAsFA;AAiHD,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CA6F9B"}
|
|
@@ -5,7 +5,9 @@ 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";
|
|
7
7
|
import { discoverBootstrap } from "./discovery.js";
|
|
8
|
-
import {
|
|
8
|
+
import { buildIntentClaimCandidates } from "./intent-claims.js";
|
|
9
|
+
import { normalizeBootstrapContext, presentBootstrap } from "./presentation.js";
|
|
10
|
+
import { validateBootstrapPayload } from "./validation.js";
|
|
9
11
|
export function filterSourceOnlySignals(signals, entityTypes) {
|
|
10
12
|
return entityTypes && entityTypes.length > 0
|
|
11
13
|
? signals.filter((signal) => entityTypes.includes(signal.kind))
|
|
@@ -19,7 +21,7 @@ function titleKey(candidate) {
|
|
|
19
21
|
return `${candidate.entityType}::${candidate.title.trim().toLowerCase().replace(/\s+/g, " ")}`;
|
|
20
22
|
}
|
|
21
23
|
function firstUpsertId(candidate) {
|
|
22
|
-
const first = candidate.applyPlan[0];
|
|
24
|
+
const first = candidate.applyPlan.find((payload) => payload.type === candidate.entityType) ?? candidate.applyPlan[0];
|
|
23
25
|
if (typeof first?.id === "string")
|
|
24
26
|
return first.id;
|
|
25
27
|
const properties = first?.properties;
|
|
@@ -34,48 +36,84 @@ function sha256(value) {
|
|
|
34
36
|
return createHash("sha256").update(value).digest("hex");
|
|
35
37
|
}
|
|
36
38
|
export function selectBootstrapCandidates(input, existingIds, entityTypes, maximum) {
|
|
37
|
-
const allowed = entityTypes
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const selected = new Map();
|
|
39
|
+
const allowed = entityTypes?.length ? new Set(entityTypes) : null;
|
|
40
|
+
const lane = (candidate) => {
|
|
41
|
+
if (candidate.sourceKind === "intent_claim")
|
|
42
|
+
return 0;
|
|
43
|
+
if (candidate.entityType === "req" &&
|
|
44
|
+
["typed_markdown", "generic_markdown"].includes(candidate.sourceKind))
|
|
45
|
+
return 1;
|
|
46
|
+
return 2;
|
|
47
|
+
};
|
|
47
48
|
const suppressed = [];
|
|
48
|
-
const
|
|
49
|
+
const sourceOnlySignals = [];
|
|
50
|
+
const diagnostics = [];
|
|
51
|
+
const suppress = (candidate, reason, message) => {
|
|
49
52
|
suppressed.push({
|
|
50
53
|
candidateId: candidate.candidateId,
|
|
51
54
|
reason,
|
|
52
55
|
sourcePath: candidate.sourcePath,
|
|
53
56
|
entityType: candidate.entityType,
|
|
57
|
+
...(message ? { message } : {}),
|
|
54
58
|
});
|
|
55
59
|
};
|
|
56
|
-
|
|
60
|
+
const writable = input
|
|
61
|
+
.filter((candidate) => {
|
|
62
|
+
if (allowed && !allowed.has(candidate.entityType))
|
|
63
|
+
return false;
|
|
57
64
|
if (existingIds.has(firstUpsertId(candidate))) {
|
|
58
65
|
suppress(candidate, "entity_exists");
|
|
59
|
-
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
if (candidate.applyPlan.length === 0)
|
|
70
|
+
throw new Error("Candidate has no write actions");
|
|
71
|
+
for (const payload of candidate.applyPlan)
|
|
72
|
+
validateBootstrapPayload(payload, new Date());
|
|
73
|
+
return true;
|
|
60
74
|
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
77
|
+
suppress(candidate, "invalid_write", message);
|
|
78
|
+
diagnostics.push(`Invalid bootstrap candidate at ${candidate.sourcePath}: ${message}`);
|
|
79
|
+
sourceOnlySignals.push({
|
|
80
|
+
kind: "req",
|
|
81
|
+
title: `Author requirement: ${candidate.title}`,
|
|
82
|
+
sourcePath: candidate.sourcePath,
|
|
83
|
+
confidence: candidate.confidence,
|
|
84
|
+
evidence: candidate.evidence,
|
|
85
|
+
});
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
.sort((left, right) => lane(left) - lane(right) ||
|
|
90
|
+
right.confidence - left.confidence ||
|
|
91
|
+
left.sourcePath.localeCompare(right.sourcePath) ||
|
|
92
|
+
left.candidateId.localeCompare(right.candidateId));
|
|
93
|
+
const typedTitles = new Set(writable
|
|
94
|
+
.filter((candidate) => candidate.sourceKind === "typed_markdown")
|
|
95
|
+
.map(titleKey));
|
|
96
|
+
const selected = new Map();
|
|
97
|
+
for (const candidate of writable) {
|
|
61
98
|
const key = titleKey(candidate);
|
|
62
99
|
if (candidate.sourceKind === "generic_markdown" && typedTitles.has(key)) {
|
|
63
100
|
suppress(candidate, "shadowed_by_typed_source");
|
|
64
|
-
continue;
|
|
65
101
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
selected.set(key, candidate);
|
|
69
|
-
continue;
|
|
102
|
+
else if (selected.has(key)) {
|
|
103
|
+
suppress(candidate, "duplicate_title");
|
|
70
104
|
}
|
|
71
|
-
|
|
72
|
-
(candidate.confidence === previous.confidence &&
|
|
73
|
-
candidate.sourcePath < previous.sourcePath);
|
|
74
|
-
suppress(keepCandidate ? previous : candidate, "duplicate_title");
|
|
75
|
-
if (keepCandidate)
|
|
105
|
+
else
|
|
76
106
|
selected.set(key, candidate);
|
|
77
107
|
}
|
|
78
|
-
|
|
108
|
+
const unique = [...selected.values()];
|
|
109
|
+
for (const candidate of unique.slice(maximum))
|
|
110
|
+
suppress(candidate, "over_limit");
|
|
111
|
+
return {
|
|
112
|
+
candidates: unique.slice(0, maximum),
|
|
113
|
+
suppressed,
|
|
114
|
+
sourceOnlySignals,
|
|
115
|
+
diagnostics,
|
|
116
|
+
};
|
|
79
117
|
}
|
|
80
118
|
async function existingEntityIds(context) {
|
|
81
119
|
if (!context.prolog)
|
|
@@ -85,8 +123,8 @@ async function existingEntityIds(context) {
|
|
|
85
123
|
// just to build this set exceeds the bounded engine output.
|
|
86
124
|
return new Set((await loadEntityIds(context.prolog)).filter(Boolean));
|
|
87
125
|
}
|
|
88
|
-
catch {
|
|
89
|
-
|
|
126
|
+
catch (error) {
|
|
127
|
+
throw new Error(`Bootstrap binding could not read existing entity IDs: ${error instanceof Error ? error.message : String(error)}`);
|
|
90
128
|
}
|
|
91
129
|
}
|
|
92
130
|
async function expectedSnapshots(context, evidencePaths) {
|
|
@@ -164,15 +202,19 @@ async function expectedSnapshots(context, evidencePaths) {
|
|
|
164
202
|
};
|
|
165
203
|
}
|
|
166
204
|
}
|
|
167
|
-
// implements REQ-
|
|
205
|
+
// implements REQ-KIBI-BOOTSTRAP-PLAN, REQ-kibi-operation-interface-parity
|
|
168
206
|
// implements REQ-KIBI-BOOTSTRAP-PLAN
|
|
169
207
|
export async function executePlanBootstrap(args, context) {
|
|
170
208
|
const includeGenericMarkdown = args.includeGenericMarkdown ?? true;
|
|
171
209
|
const minConfidence = clamp(args.minConfidence ?? 0.8, 0.6, 0.95);
|
|
172
210
|
const maxCandidates = clamp(Math.trunc(args.maxCandidates ?? 50), 1, 200);
|
|
211
|
+
const entityBindingDiagnostics = [];
|
|
173
212
|
const [discovery, existingIds] = await Promise.all([
|
|
174
213
|
discoverBootstrap(context),
|
|
175
|
-
existingEntityIds(context)
|
|
214
|
+
existingEntityIds(context).catch((error) => {
|
|
215
|
+
entityBindingDiagnostics.push(error.message);
|
|
216
|
+
return new Set();
|
|
217
|
+
}),
|
|
176
218
|
]);
|
|
177
219
|
// Discovery runs before planning so its evidence paths can be bound into
|
|
178
220
|
// the exact plan rather than leaving the reviewer to reconstruct them.
|
|
@@ -180,10 +222,25 @@ export async function executePlanBootstrap(args, context) {
|
|
|
180
222
|
.map((evidence) => evidence.relativePath)
|
|
181
223
|
.filter((value) => Boolean(value)));
|
|
182
224
|
const built = discovery.activation.allowCandidateGeneration
|
|
183
|
-
? buildBootstrapCandidates(discovery.evidence,
|
|
184
|
-
: {
|
|
185
|
-
|
|
186
|
-
|
|
225
|
+
? buildBootstrapCandidates(discovery.evidence, new Set(), minConfidence, includeGenericMarkdown)
|
|
226
|
+
: {
|
|
227
|
+
candidates: [],
|
|
228
|
+
sourceOnlySignals: [],
|
|
229
|
+
suppressed: [],
|
|
230
|
+
diagnostics: [],
|
|
231
|
+
};
|
|
232
|
+
// Intent harvested from declared knowledge sources joins the repository
|
|
233
|
+
// evidence under the same activation policy, filters, and selection.
|
|
234
|
+
const claimed = discovery.activation.allowCandidateGeneration
|
|
235
|
+
? buildIntentClaimCandidates(normalizeBootstrapContext(args.bootstrapContext), existingIds, minConfidence)
|
|
236
|
+
: {
|
|
237
|
+
candidates: [],
|
|
238
|
+
sourceOnlySignals: [],
|
|
239
|
+
suppressed: [],
|
|
240
|
+
diagnostics: [],
|
|
241
|
+
};
|
|
242
|
+
const filteredSignals = filterSourceOnlySignals([...built.sourceOnlySignals, ...claimed.sourceOnlySignals], args.entityTypes);
|
|
243
|
+
const selected = selectBootstrapCandidates([...built.candidates, ...claimed.candidates].filter((candidate) => candidate.confidence >= minConfidence), existingIds, args.entityTypes, maxCandidates);
|
|
187
244
|
const ignored = discovery.ignoredSources.map((sourcePath) => ({
|
|
188
245
|
candidateId: "",
|
|
189
246
|
reason: "ignored_source",
|
|
@@ -200,9 +257,22 @@ export async function executePlanBootstrap(args, context) {
|
|
|
200
257
|
? { bootstrapContext: args.bootstrapContext }
|
|
201
258
|
: {}),
|
|
202
259
|
candidates: selected.candidates,
|
|
203
|
-
sourceOnlySignals:
|
|
204
|
-
|
|
260
|
+
sourceOnlySignals: [
|
|
261
|
+
...filteredSignals,
|
|
262
|
+
...filterSourceOnlySignals(selected.sourceOnlySignals, args.entityTypes),
|
|
263
|
+
],
|
|
264
|
+
suppressedCandidates: [
|
|
265
|
+
...selected.suppressed,
|
|
266
|
+
...claimed.suppressed,
|
|
267
|
+
...built.suppressed,
|
|
268
|
+
...ignored,
|
|
269
|
+
],
|
|
205
270
|
expected,
|
|
206
|
-
bindingDiagnostics,
|
|
271
|
+
bindingDiagnostics: [...bindingDiagnostics, ...entityBindingDiagnostics],
|
|
272
|
+
contextDiagnostics: [
|
|
273
|
+
...claimed.diagnostics,
|
|
274
|
+
...built.diagnostics,
|
|
275
|
+
...selected.diagnostics,
|
|
276
|
+
],
|
|
207
277
|
});
|
|
208
278
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guidance-actions.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/guidance-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"guidance-actions.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/guidance-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,wBAAwB,EAClC,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,OAAO,EAAE,SAAS,gBAAgB,EAAE,GACnC,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAuE9C"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
function relative(root, target) {
|
|
3
|
+
// Intent claims cite tickets and URLs, which are not workspace paths.
|
|
4
|
+
if (!path.isAbsolute(target))
|
|
5
|
+
return target;
|
|
3
6
|
const value = path.relative(root, target);
|
|
4
7
|
return value.startsWith("..") || path.isAbsolute(value)
|
|
5
8
|
? target.split(path.sep).join("/")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guidance.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/guidance.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"guidance.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/guidance.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAwFpB,wBAAgB,UAAU,CACxB,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,wBAAwB,EAClC,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,WAAW,EAAE,MAAM,GAClB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAiEnC;AAGD,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,GAAG;IACF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACvD,QAAQ,CAAC,OAAO,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAChE,CA0BA"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { buildActions } from "./guidance-actions.js";
|
|
3
3
|
function relative(root, target) {
|
|
4
|
+
// Intent claims cite tickets and URLs, which are not workspace paths.
|
|
5
|
+
if (!path.isAbsolute(target))
|
|
6
|
+
return target;
|
|
4
7
|
const value = path.relative(root, target);
|
|
5
8
|
return value.startsWith("..") || path.isAbsolute(value)
|
|
6
9
|
? target.split(path.sep).join("/")
|
|
@@ -28,6 +31,8 @@ function prompt(root, activation, declared, candidates, signals, warnings) {
|
|
|
28
31
|
bullets.push(`- Summary: ${declared.projectSummary}`);
|
|
29
32
|
if (declared.sourceOfTruthPaths.length > 0)
|
|
30
33
|
bullets.push(`- Source of truth: ${summary(declared.sourceOfTruthPaths)}.`);
|
|
34
|
+
if (declared.knowledgeSources)
|
|
35
|
+
bullets.push(`- Knowledge sources: ${summary(declared.knowledgeSources.map((source) => `${source.title} (${source.authority})`))}; ${declared.intentClaims?.length ?? 0} cited intent claim(s).`);
|
|
31
36
|
if (candidates.length > 0) {
|
|
32
37
|
const formatted = Object.entries(counts(candidates))
|
|
33
38
|
.sort(([left], [right]) => left.localeCompare(right))
|
|
@@ -81,7 +86,8 @@ export function confidence(activation, declared, candidates, signals, promptBloc
|
|
|
81
86
|
declared.sourceOfTruthPaths.length +
|
|
82
87
|
declared.sourceOfTruthNotes.length +
|
|
83
88
|
declared.priorityRoots.length +
|
|
84
|
-
declared.verificationAnchors.length
|
|
89
|
+
declared.verificationAnchors.length +
|
|
90
|
+
(declared.knowledgeSources?.length ?? 0) >
|
|
85
91
|
0) {
|
|
86
92
|
score += 0.08;
|
|
87
93
|
reasons.push("Declared bootstrap context grounds the output.");
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BootstrapDeclaredContext, Candidate, SourceOnlySignal } from "./types.js";
|
|
2
|
+
export type IntentClaimBuildResult = {
|
|
3
|
+
readonly candidates: readonly Candidate[];
|
|
4
|
+
readonly sourceOnlySignals: readonly SourceOnlySignal[];
|
|
5
|
+
readonly suppressed: readonly Readonly<Record<string, unknown>>[];
|
|
6
|
+
readonly diagnostics: readonly string[];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Turn intent the agent harvested from declared knowledge sources into cited
|
|
10
|
+
* bootstrap candidates. Kibi never contacts those sources: it only records
|
|
11
|
+
* what the agent read, binds it into the plan hash through the declared
|
|
12
|
+
* context, and keeps the citation on every candidate it produces. A claim the
|
|
13
|
+
* strict modeler cannot ground stays an explicit authoring follow-up instead
|
|
14
|
+
* of becoming unverifiable knowledge.
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildIntentClaimCandidates(declared: BootstrapDeclaredContext, existingIds: ReadonlySet<string>, minConfidence: number): IntentClaimBuildResult;
|
|
17
|
+
//# sourceMappingURL=intent-claims.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent-claims.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/intent-claims.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,wBAAwB,EAGxB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAQpB,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,iBAAiB,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACxD,QAAQ,CAAC,UAAU,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IAClE,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC,CAAC;AAcF;;;;;;;GAOG;AAEH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,wBAAwB,EAClC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EAChC,aAAa,EAAE,MAAM,GACpB,sBAAsB,CA2FxB"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { buildStrictWriteSet } from "../../utils/strict-modeling.js";
|
|
2
|
+
import { confidenceBand, strictPlan } from "./candidate-helpers.js";
|
|
3
|
+
import { claimFor } from "./requirement-claims.js";
|
|
4
|
+
/** How much a claim is trusted follows the authority the human assigned. */
|
|
5
|
+
const AUTHORITY_CONFIDENCE = {
|
|
6
|
+
authoritative: 0.9,
|
|
7
|
+
supporting: 0.82,
|
|
8
|
+
};
|
|
9
|
+
function citation(source, claim) {
|
|
10
|
+
return [
|
|
11
|
+
`intent_claim:${source.id}:${claim.reference}`,
|
|
12
|
+
`knowledge_source:${source.kind}:${source.locator}`,
|
|
13
|
+
`source_authority:${source.authority}`,
|
|
14
|
+
...(source.connector ? [`connector:${source.connector}`] : []),
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Turn intent the agent harvested from declared knowledge sources into cited
|
|
19
|
+
* bootstrap candidates. Kibi never contacts those sources: it only records
|
|
20
|
+
* what the agent read, binds it into the plan hash through the declared
|
|
21
|
+
* context, and keeps the citation on every candidate it produces. A claim the
|
|
22
|
+
* strict modeler cannot ground stays an explicit authoring follow-up instead
|
|
23
|
+
* of becoming unverifiable knowledge.
|
|
24
|
+
*/
|
|
25
|
+
// implements REQ-kibi-bootstrap-knowledge-sources
|
|
26
|
+
export function buildIntentClaimCandidates(declared, existingIds, minConfidence) {
|
|
27
|
+
const sources = new Map((declared.knowledgeSources ?? []).map((source) => [source.id, source]));
|
|
28
|
+
const candidates = [];
|
|
29
|
+
const sourceOnlySignals = [];
|
|
30
|
+
const suppressed = [];
|
|
31
|
+
const diagnostics = [];
|
|
32
|
+
for (const claim of declared.intentClaims ?? []) {
|
|
33
|
+
const source = sources.get(claim.sourceId);
|
|
34
|
+
if (!source) {
|
|
35
|
+
diagnostics.push(`Intent claim cites an undeclared knowledge source "${claim.sourceId}" (${claim.reference}); declare it in knowledgeSources or drop the claim.`);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (source.authority === "stale") {
|
|
39
|
+
suppressed.push({
|
|
40
|
+
candidateId: "",
|
|
41
|
+
reason: "stale_knowledge_source",
|
|
42
|
+
sourcePath: claim.reference,
|
|
43
|
+
entityType: "req",
|
|
44
|
+
statement: claim.statement,
|
|
45
|
+
sourceId: source.id,
|
|
46
|
+
});
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const confidence = AUTHORITY_CONFIDENCE[source.authority];
|
|
50
|
+
const evidence = citation(source, claim);
|
|
51
|
+
const provenance = `${source.id}:${claim.reference}`;
|
|
52
|
+
let writeSet = null;
|
|
53
|
+
try {
|
|
54
|
+
const modeled = claimFor(claim.statement, `knowledge-source:${source.id}`, confidence, provenance);
|
|
55
|
+
writeSet = modeled
|
|
56
|
+
? buildStrictWriteSet({ claim: modeled, statement: claim.statement })
|
|
57
|
+
: null;
|
|
58
|
+
if (!modeled)
|
|
59
|
+
diagnostics.push(`Intent claim needs authoring at ${source.id}:${claim.reference}: ${claim.statement}`);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
diagnostics.push(`Intent claim extraction failed at ${source.id}:${claim.reference}: ${error instanceof Error ? error.message : String(error)}`);
|
|
63
|
+
}
|
|
64
|
+
if (writeSet?.isStrict &&
|
|
65
|
+
confidence >= minConfidence &&
|
|
66
|
+
!existingIds.has(writeSet.req.id)) {
|
|
67
|
+
candidates.push({
|
|
68
|
+
candidateId: `claim:${source.id}:${writeSet.req.id.toLowerCase()}`,
|
|
69
|
+
entityType: "req",
|
|
70
|
+
title: claim.statement,
|
|
71
|
+
sourceKind: "intent_claim",
|
|
72
|
+
sourcePath: claim.reference,
|
|
73
|
+
confidence,
|
|
74
|
+
confidenceBand: confidenceBand(confidence),
|
|
75
|
+
evidence,
|
|
76
|
+
relationships: writeSet.relationships.map(({ type, from, to }) => ({
|
|
77
|
+
type,
|
|
78
|
+
from,
|
|
79
|
+
to,
|
|
80
|
+
})),
|
|
81
|
+
applyPlan: strictPlan(writeSet),
|
|
82
|
+
});
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (writeSet?.isStrict && existingIds.has(writeSet.req.id)) {
|
|
86
|
+
suppressed.push({
|
|
87
|
+
candidateId: `claim:${source.id}:${writeSet.req.id.toLowerCase()}`,
|
|
88
|
+
reason: "entity_exists",
|
|
89
|
+
sourcePath: claim.reference,
|
|
90
|
+
entityType: "req",
|
|
91
|
+
});
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
sourceOnlySignals.push({
|
|
95
|
+
kind: "req",
|
|
96
|
+
title: `Author requirement from ${source.title} ${claim.reference}: ${claim.statement}`,
|
|
97
|
+
sourcePath: claim.reference,
|
|
98
|
+
confidence,
|
|
99
|
+
evidence,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return { candidates, sourceOnlySignals, suppressed, diagnostics };
|
|
103
|
+
}
|
|
@@ -2,6 +2,8 @@ import type { BootstrapEvidence, Candidate, SourceOnlySignal } from "./types.js"
|
|
|
2
2
|
export type CandidateBuildResult = {
|
|
3
3
|
readonly candidates: readonly Candidate[];
|
|
4
4
|
readonly sourceOnlySignals: readonly SourceOnlySignal[];
|
|
5
|
+
readonly diagnostics: readonly string[];
|
|
6
|
+
readonly suppressed: readonly Readonly<Record<string, unknown>>[];
|
|
5
7
|
};
|
|
6
8
|
export declare function markdownCandidates(item: BootstrapEvidence, existingIds: ReadonlySet<string>, minConfidence: number): CandidateBuildResult;
|
|
7
9
|
//# sourceMappingURL=markdown-candidates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-candidates.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/markdown-candidates.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,iBAAiB,EAAE,SAAS,gBAAgB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"markdown-candidates.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/markdown-candidates.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,iBAAiB,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CACnE,CAAC;AA4HF,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,iBAAiB,EACvB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EAChC,aAAa,EAAE,MAAM,GACpB,oBAAoB,CAkFtB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { buildStrictWriteSet } from "../../utils/strict-modeling.js";
|
|
3
3
|
import { confidenceBand, slug, strictPlan, upsert, } from "./candidate-helpers.js";
|
|
4
|
-
import { claimFor } from "./requirement-claims.js";
|
|
4
|
+
import { claimFor, normalizeClaimStatement } from "./requirement-claims.js";
|
|
5
5
|
function headingSignals(heading, sourcePath, textRef, minConfidence) {
|
|
6
6
|
const result = [];
|
|
7
7
|
for (const [kind, pattern, confidence] of [
|
|
@@ -74,7 +74,7 @@ function requirementCandidate(item, statement, line, heading, headingLine, exist
|
|
|
74
74
|
if (!claim)
|
|
75
75
|
return null;
|
|
76
76
|
const writeSet = buildStrictWriteSet({ claim, statement });
|
|
77
|
-
if (!writeSet.isStrict
|
|
77
|
+
if (!writeSet.isStrict)
|
|
78
78
|
return null;
|
|
79
79
|
return {
|
|
80
80
|
candidateId: `norm:${writeSet.req.id.toLowerCase()}`,
|
|
@@ -100,6 +100,7 @@ function requirementCandidate(item, statement, line, heading, headingLine, exist
|
|
|
100
100
|
export function markdownCandidates(item, existingIds, minConfidence) {
|
|
101
101
|
const candidates = [];
|
|
102
102
|
const sourceOnlySignals = [];
|
|
103
|
+
const diagnostics = [];
|
|
103
104
|
const relativePath = item.relativePath ?? item.label;
|
|
104
105
|
let heading;
|
|
105
106
|
let headingLine = 0;
|
|
@@ -121,15 +122,36 @@ export function markdownCandidates(item, existingIds, minConfidence) {
|
|
|
121
122
|
sourceOnlySignals.push(...headingSignals(heading, item.absolutePath ?? relativePath, `${relativePath}#L${headingLine}`, minConfidence));
|
|
122
123
|
continue;
|
|
123
124
|
}
|
|
124
|
-
const statement = line
|
|
125
|
-
.replace(/^\s*[-*+]\s+/, "")
|
|
126
|
-
.replace(/^\s*\d+[.)]\s+/, "")
|
|
127
|
-
.trim();
|
|
125
|
+
const statement = normalizeClaimStatement(line);
|
|
128
126
|
if (!statement || !/\b(must|shall|should)\b/i.test(statement))
|
|
129
127
|
continue;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
try {
|
|
129
|
+
const candidate = requirementCandidate(item, statement, index + 1, heading, headingLine, existingIds, minConfidence);
|
|
130
|
+
if (candidate) {
|
|
131
|
+
if (!candidate.applyPlan.some((payload) => payload.type === "req" && existingIds.has(String(payload.id))))
|
|
132
|
+
candidates.push(candidate);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
diagnostics.push(`Requirement needs authoring at ${relativePath}#L${index + 1}: ${statement}`);
|
|
136
|
+
sourceOnlySignals.push({
|
|
137
|
+
kind: "req",
|
|
138
|
+
title: `Author requirement: ${statement}`,
|
|
139
|
+
sourcePath: `${relativePath}#L${index + 1}`,
|
|
140
|
+
confidence: 0.8,
|
|
141
|
+
evidence: [`normative_statement:${relativePath}#L${index + 1}`],
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
diagnostics.push(`Requirement extraction failed at ${relativePath}#L${index + 1}: ${error instanceof Error ? error.message : String(error)}`);
|
|
147
|
+
sourceOnlySignals.push({
|
|
148
|
+
kind: "req",
|
|
149
|
+
title: `Review requirement: ${statement}`,
|
|
150
|
+
sourcePath: `${relativePath}#L${index + 1}`,
|
|
151
|
+
confidence: 0.8,
|
|
152
|
+
evidence: [`normative_statement:${relativePath}#L${index + 1}`],
|
|
153
|
+
});
|
|
154
|
+
}
|
|
133
155
|
}
|
|
134
|
-
return { candidates, sourceOnlySignals };
|
|
156
|
+
return { candidates, sourceOnlySignals, diagnostics, suppressed: [] };
|
|
135
157
|
}
|
|
@@ -11,5 +11,7 @@ export declare function presentBootstrap(input: {
|
|
|
11
11
|
readonly suppressedCandidates: readonly Readonly<Record<string, unknown>>[];
|
|
12
12
|
readonly expected: BootstrapPlanV1["expected"];
|
|
13
13
|
readonly bindingDiagnostics?: readonly string[];
|
|
14
|
+
/** Advisory findings about declared context; they never block apply. */
|
|
15
|
+
readonly contextDiagnostics?: readonly string[];
|
|
14
16
|
}): PlanBootstrapResult;
|
|
15
17
|
//# sourceMappingURL=presentation.d.ts.map
|