kibi-cli 2.36.0 → 2.39.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.map +1 -1
- package/dist/cli-json-command.js +4 -0
- package/dist/cli-operation-metadata.d.ts +1 -1
- package/dist/cli-operation-metadata.js +1 -1
- package/dist/cli-register-foundation.d.ts.map +1 -1
- package/dist/cli-register-foundation.js +2 -1
- package/dist/cli-register-maintenance.d.ts.map +1 -1
- package/dist/cli-register-maintenance.js +5 -0
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +1 -0
- package/dist/cli-validate.d.ts.map +1 -1
- package/dist/cli-validate.js +21 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +19 -1
- package/dist/commands/aggregated-checks.d.ts.map +1 -1
- package/dist/commands/aggregated-checks.js +89 -16
- package/dist/commands/coverage.d.ts +1 -0
- package/dist/commands/coverage.d.ts.map +1 -1
- package/dist/commands/coverage.js +40 -0
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +70 -35
- package/dist/commands/github-init.d.ts.map +1 -1
- package/dist/commands/github-init.js +4 -2
- package/dist/commands/hook-managers.d.ts +43 -0
- package/dist/commands/hook-managers.d.ts.map +1 -0
- package/dist/commands/hook-managers.js +426 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +40 -5
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +9 -3
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +49 -1
- package/dist/commands/telemetry.d.ts +7 -0
- package/dist/commands/telemetry.d.ts.map +1 -0
- package/dist/commands/telemetry.js +23 -0
- package/dist/decision-firmness.d.ts.map +1 -1
- package/dist/decision-firmness.js +11 -14
- package/dist/engine-limits.d.ts.map +1 -1
- package/dist/engine-limits.js +8 -10
- package/dist/entity-body-context.d.ts.map +1 -1
- package/dist/entity-body-context.js +39 -36
- package/dist/extractors/markdown.d.ts +6 -0
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +21 -0
- package/dist/extractors/symbol-coordinates.d.ts.map +1 -1
- package/dist/extractors/symbol-coordinates.js +23 -4
- package/dist/firm-decision-edit.d.ts.map +1 -1
- package/dist/firm-decision-edit.js +1 -3
- package/dist/intent-search.d.ts +5 -1
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +118 -33
- package/dist/logic/ir.d.ts.map +1 -1
- package/dist/logic/ir.js +82 -108
- package/dist/operations/bootstrap/discovery-evidence.d.ts.map +1 -1
- package/dist/operations/bootstrap/discovery-evidence.js +44 -2
- package/dist/operations/bootstrap/discovery.d.ts.map +1 -1
- package/dist/operations/bootstrap/discovery.js +1 -0
- package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance-actions.js +2 -1
- package/dist/operations/bootstrap/plugin-offers.d.ts +11 -2
- package/dist/operations/bootstrap/plugin-offers.d.ts.map +1 -1
- package/dist/operations/bootstrap/plugin-offers.js +48 -9
- package/dist/operations/proof/claim-bindings.d.ts.map +1 -1
- package/dist/operations/proof/claim-bindings.js +1 -0
- package/dist/operations/proof/code-certificates.d.ts +2 -0
- package/dist/operations/proof/code-certificates.d.ts.map +1 -1
- package/dist/operations/proof/code-certificates.js +34 -14
- package/dist/operations/proof/code-models.d.ts.map +1 -1
- package/dist/operations/proof/code-models.js +19 -5
- package/dist/operations/proof/code-runner.d.ts +16 -0
- package/dist/operations/proof/code-runner.d.ts.map +1 -1
- package/dist/operations/proof/code-runner.js +42 -6
- package/dist/operations/proof/explain.d.ts +63 -0
- package/dist/operations/proof/explain.d.ts.map +1 -1
- package/dist/operations/proof/explain.js +162 -0
- package/dist/operations/semantic-advisor/analyze-prose.d.ts +9 -1
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +21 -0
- package/dist/operations/semantic-advisor/case-preview.d.ts +24 -0
- package/dist/operations/semantic-advisor/case-preview.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/case-preview.js +216 -0
- package/dist/operations/semantic-advisor/shared.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/shared.js +3 -0
- package/dist/operations/semantic-advisor/types.d.ts +23 -0
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
- package/dist/plugins/approved-source-analyzers.generated.d.ts +11 -8
- package/dist/plugins/approved-source-analyzers.generated.d.ts.map +1 -1
- package/dist/plugins/approved-source-analyzers.generated.js +11 -8
- package/dist/plugins/compose-search-hints.d.ts +29 -0
- package/dist/plugins/compose-search-hints.d.ts.map +1 -0
- package/dist/plugins/compose-search-hints.js +94 -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 +11 -0
- package/dist/plugins/registry.d.ts +8 -1
- package/dist/plugins/registry.d.ts.map +1 -1
- package/dist/plugins/registry.js +22 -3
- package/dist/plugins/source-classification.d.ts +2 -2
- package/dist/plugins/source-classification.d.ts.map +1 -1
- package/dist/plugins/source-classification.js +25 -1
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +10 -20
- package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
- package/dist/public/impact/coverage-depth-quality.js +32 -16
- package/dist/public/impact/full-kb-quality.d.ts +6 -0
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +8 -3
- package/dist/public/impact/requirement-quality.d.ts.map +1 -1
- package/dist/public/impact/requirement-quality.js +56 -29
- package/dist/public/operations/catalog.d.ts +44 -4
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/check-executor.d.ts +6 -0
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +34 -2
- package/dist/public/operations/discovery-executors.d.ts +5 -1
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +65 -4
- package/dist/public/operations/evidence-floor.d.ts +8 -1
- package/dist/public/operations/evidence-floor.d.ts.map +1 -1
- package/dist/public/operations/evidence-floor.js +3 -4
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +41 -10
- package/dist/public/operations/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +3 -1
- package/dist/public/operations/repair-plan.d.ts +46 -0
- package/dist/public/operations/repair-plan.d.ts.map +1 -1
- package/dist/public/operations/repair-plan.js +110 -1
- package/dist/public/operations/schema6-check-actions.js +1 -1
- package/dist/public/operations/source-analysis-cache.d.ts +22 -0
- package/dist/public/operations/source-analysis-cache.d.ts.map +1 -0
- package/dist/public/operations/source-analysis-cache.js +157 -0
- 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 +2 -1
- package/dist/public/operations/specs/check.d.ts +1 -1
- package/dist/public/operations/specs/discovery.d.ts +7 -2
- package/dist/public/operations/specs/discovery.d.ts.map +1 -1
- package/dist/public/operations/specs/discovery.js +7 -2
- package/dist/public/operations/specs/mutation-schemas.d.ts +36 -1
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +30 -0
- package/dist/public/operations/specs/upsert.d.ts +36 -1
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/symbol-granularity-check.d.ts +3 -1
- package/dist/public/operations/symbol-granularity-check.d.ts.map +1 -1
- package/dist/public/operations/symbol-granularity-check.js +21 -7
- package/dist/public/proof-protocol.d.ts +6 -1
- package/dist/public/proof-protocol.d.ts.map +1 -1
- package/dist/public/proof-protocol.js +12 -3
- package/dist/public/proof-sources.d.ts +2 -0
- package/dist/public/proof-sources.d.ts.map +1 -1
- package/dist/public/proof-sources.js +32 -6
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +59 -0
- package/dist/public/skills/kibi-bootstrap/SKILL.md +2 -2
- package/dist/public/skills/kibi-commit-review/SKILL.md +6 -2
- package/dist/public/skills/kibi-decisions/SKILL.md +7 -2
- package/dist/public/skills/kibi-decisions/resources/signoff-views.md +3 -1
- package/dist/public/skills/kibi-usage/SKILL.md +50 -3
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +34 -0
- package/dist/public/skills/kibi-usage/resources/proof.md +13 -5
- package/dist/public/skills/kibi-usage/resources/workflows.md +10 -0
- package/dist/relationships/shards.d.ts +2 -0
- package/dist/relationships/shards.d.ts.map +1 -1
- package/dist/relationships/shards.js +25 -1
- package/dist/schemas/entity.schema.json +98 -1
- package/dist/search-answer.d.ts +3 -2
- package/dist/search-answer.d.ts.map +1 -1
- package/dist/search-answer.js +57 -4
- package/dist/search-hints.d.ts +58 -0
- package/dist/search-hints.d.ts.map +1 -0
- package/dist/search-hints.js +187 -0
- package/dist/search-ranking.d.ts +7 -0
- package/dist/search-ranking.d.ts.map +1 -1
- package/dist/search-ranking.js +54 -56
- package/dist/search-token-cache.d.ts +30 -0
- package/dist/search-token-cache.d.ts.map +1 -0
- package/dist/search-token-cache.js +86 -0
- package/dist/traceability/impact-knowledge.d.ts.map +1 -1
- package/dist/traceability/impact-knowledge.js +2 -0
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +11 -1
- package/dist/types/entities.d.ts +12 -0
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/usage-telemetry.d.ts +20 -0
- package/dist/usage-telemetry.d.ts.map +1 -0
- package/dist/usage-telemetry.js +93 -0
- package/dist/utils/branch-resolver.d.ts.map +1 -1
- package/dist/utils/branch-resolver.js +1 -0
- package/dist/utils/rule-registry.generated.d.ts +5 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +6 -0
- package/package.json +5 -4
- package/schema/entities.pl +12 -0
- package/src/public/impact/coverage-depth-quality.ts +59 -21
- package/src/public/impact/full-kb-quality.ts +15 -1
- package/src/public/impact/requirement-quality.ts +95 -38
- package/src/public/operations/check-executor.ts +41 -1
- package/src/public/operations/discovery-executors.ts +92 -4
- package/src/public/operations/evidence-floor.ts +15 -3
- package/src/public/operations/migration-plan.ts +41 -9
- package/src/public/operations/node-ports.ts +3 -1
- package/src/public/operations/repair-plan.ts +152 -1
- package/src/public/operations/schema6-check-actions.ts +1 -1
- package/src/public/operations/source-analysis-cache.ts +196 -0
- package/src/public/operations/specs/check-rules.generated.ts +2 -1
- package/src/public/operations/specs/discovery.ts +8 -2
- package/src/public/operations/specs/mutation-schemas.ts +34 -0
- package/src/public/operations/symbol-granularity-check.ts +25 -5
- package/src/public/proof-protocol-types.d.ts +1 -1
- package/src/public/proof-protocol.ts +18 -4
- package/src/public/proof-sources.ts +37 -6
- package/src/public/schemas/entity.ts +65 -0
- package/src/public/skills/kibi-bootstrap/SKILL.md +2 -2
- package/src/public/skills/kibi-commit-review/SKILL.md +6 -2
- package/src/public/skills/kibi-decisions/SKILL.md +7 -2
- package/src/public/skills/kibi-decisions/resources/signoff-views.md +3 -1
- package/src/public/skills/kibi-usage/SKILL.md +50 -3
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +34 -0
- package/src/public/skills/kibi-usage/resources/proof.md +13 -5
- package/src/public/skills/kibi-usage/resources/workflows.md +10 -0
- package/src/schemas/entity.schema.json +98 -1
|
@@ -176,7 +176,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
176
176
|
}, {
|
|
177
177
|
readonly name: "kb_search";
|
|
178
178
|
readonly cliName: "search";
|
|
179
|
-
readonly description: "Ask the KB a question or search it. Default intent-v1 ranking accepts questions, host-agent semantic facets and changed-code source locations, returns evidence, abstains below its confidence threshold and adds an answer layer: the current requirements that govern the topic, what must stay true (linked facts), why (ADRs) and what verifies it (scenarios, tests). Use before changing behavior, then kb_query for exact follow-up. No mutation side effects.";
|
|
179
|
+
readonly description: "Ask the KB a question or search it. Default intent-v1 ranking accepts questions, host-agent semantic facets and changed-code source locations, returns evidence, abstains below its confidence threshold and adds an answer layer: the current requirements that govern the topic, what must stay true (linked facts), why (ADRs) and what verifies it (scenarios, tests). A weak answer may add queryAnalysis.hints from a search-hints plugin: requirements the question may mean, to re-ask with. Use before changing behavior, then kb_query for exact follow-up. No mutation side effects.";
|
|
180
180
|
readonly businessInputSchema: {
|
|
181
181
|
readonly type: "object";
|
|
182
182
|
readonly required: readonly ["query"];
|
|
@@ -215,6 +215,11 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
215
215
|
readonly default: true;
|
|
216
216
|
readonly description: "Intent-v1 only, first page only. When true (default) the result includes an answer layer: current governing requirements with their linked facts, scenarios, tests and ADRs, superseded requirements listed separately, and observation facts labelled as notes. Bounded in size; discovery, not proof.";
|
|
217
217
|
};
|
|
218
|
+
readonly hints: {
|
|
219
|
+
readonly type: "boolean";
|
|
220
|
+
readonly default: true;
|
|
221
|
+
readonly description: "Intent-v1 only, first page only. When true (default) and the project activates a kibi.search-hints.v1 plugin, a weak or abstained answer adds queryAnalysis.hints: requirements the question may mean, to re-ask with. Hints never change results or the answer layer.";
|
|
222
|
+
};
|
|
218
223
|
readonly semanticFacets: {
|
|
219
224
|
readonly type: "object";
|
|
220
225
|
readonly additionalProperties: false;
|
|
@@ -255,7 +260,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
255
260
|
readonly maxItems: 20;
|
|
256
261
|
};
|
|
257
262
|
};
|
|
258
|
-
readonly description: "Optional host-agent semantic interpretation. Kibi uses these strings as deterministic aliases/facets;
|
|
263
|
+
readonly description: "Optional host-agent semantic interpretation. Kibi uses these strings as deterministic aliases/facets; ranking never calls a model.";
|
|
259
264
|
};
|
|
260
265
|
readonly sourceLocations: {
|
|
261
266
|
readonly type: "array";
|
|
@@ -1155,6 +1160,16 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
1155
1160
|
readonly minLength: 1;
|
|
1156
1161
|
readonly description: "Requirement-only. Optional reference to the exception's approval decision record.";
|
|
1157
1162
|
};
|
|
1163
|
+
readonly failure_side_waiver: {
|
|
1164
|
+
readonly type: "string";
|
|
1165
|
+
readonly minLength: 1;
|
|
1166
|
+
readonly description: "Requirement-only. Why the requirement has no failure side to test (its claims state a capability or output shape). Waives happy_path_only once failure_side_waiver_approved_by is set.";
|
|
1167
|
+
};
|
|
1168
|
+
readonly failure_side_waiver_approved_by: {
|
|
1169
|
+
readonly type: "string";
|
|
1170
|
+
readonly minLength: 1;
|
|
1171
|
+
readonly description: "Requirement-only. The person who accepted failure_side_waiver.";
|
|
1172
|
+
};
|
|
1158
1173
|
readonly firmness: {
|
|
1159
1174
|
readonly type: "string";
|
|
1160
1175
|
readonly enum: readonly ["firm", "default", "exploratory"];
|
|
@@ -1277,6 +1292,11 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
1277
1292
|
readonly minLength: 1;
|
|
1278
1293
|
readonly description: "The name the domain is exported under in the symbol's source file, when the symbol's title is not that name.";
|
|
1279
1294
|
};
|
|
1295
|
+
readonly field: {
|
|
1296
|
+
readonly type: "string";
|
|
1297
|
+
readonly minLength: 1;
|
|
1298
|
+
readonly description: "exhaustive: when the export is a list of records, the field of each record that names a domain member (a catalog's name).";
|
|
1299
|
+
};
|
|
1280
1300
|
};
|
|
1281
1301
|
readonly additionalProperties: false;
|
|
1282
1302
|
};
|
|
@@ -1304,7 +1324,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
1304
1324
|
};
|
|
1305
1325
|
readonly value_source: {
|
|
1306
1326
|
readonly type: "array";
|
|
1307
|
-
readonly description: "arithmetic and smt: code constants the assumptions read. Kibi evaluates each export at ingest and requires the certificate to assume the variable equals that value, so the proof is about the code and not only the knowledge base. With measure count the value is the size of a list, set, map or object export, so a count claim reads the collection itself. An entry {source, measure: count} counts the members Kibi reads from a project source (routes, tables, environment variables).";
|
|
1327
|
+
readonly description: "arithmetic and smt: code constants the assumptions read. Kibi evaluates each export at ingest and requires the certificate to assume the variable equals that value, so the proof is about the code and not only the knowledge base. With measure count the value is the size of a list, set, map or object export, so a count claim reads the collection itself. A dotted export (POLICY.eventLimit) reads one field of an object export. An entry {source, measure: count} counts the members Kibi reads from a project source (routes, tables, environment variables).";
|
|
1308
1328
|
readonly minItems: 1;
|
|
1309
1329
|
readonly items: {
|
|
1310
1330
|
readonly type: "object";
|
|
@@ -1852,6 +1872,26 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
1852
1872
|
readonly type: "string";
|
|
1853
1873
|
readonly description: "Exact atomic requirement clause represented by this fact, retained for human audit. On a grounding fact Kibi derives claim_key from it; an observation or meta fact quotes the clause it is about without a key.";
|
|
1854
1874
|
};
|
|
1875
|
+
readonly dimension_waiver: {
|
|
1876
|
+
readonly type: "string";
|
|
1877
|
+
readonly minLength: 1;
|
|
1878
|
+
readonly description: "Fact-only. Why the quantifier word in claim_text ranges over nothing, so the claim needs no count, set or rule. Waives dimension_unrepresented once dimension_waiver_approved_by is set.";
|
|
1879
|
+
};
|
|
1880
|
+
readonly dimension_waiver_approved_by: {
|
|
1881
|
+
readonly type: "string";
|
|
1882
|
+
readonly minLength: 1;
|
|
1883
|
+
readonly description: "Fact-only. The person who accepted dimension_waiver.";
|
|
1884
|
+
};
|
|
1885
|
+
readonly case_waiver: {
|
|
1886
|
+
readonly type: "string";
|
|
1887
|
+
readonly minLength: 1;
|
|
1888
|
+
readonly description: "Fact-only. Why the edge cases derived from this fact are covered some other way or cannot occur. Waives uncovered_case once case_waiver_approved_by is set.";
|
|
1889
|
+
};
|
|
1890
|
+
readonly case_waiver_approved_by: {
|
|
1891
|
+
readonly type: "string";
|
|
1892
|
+
readonly minLength: 1;
|
|
1893
|
+
readonly description: "Fact-only. The person who accepted case_waiver.";
|
|
1894
|
+
};
|
|
1855
1895
|
readonly predicate_name: {
|
|
1856
1896
|
readonly type: "string";
|
|
1857
1897
|
readonly description: "Optional predicate name for ontology predicate facts. Prefer kb_model mode predicates before hand-writing predicate_name.";
|
|
@@ -2154,7 +2194,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
2154
2194
|
readonly type: "string";
|
|
2155
2195
|
readonly enum: readonly string[];
|
|
2156
2196
|
};
|
|
2157
|
-
readonly description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, symbol-granularity, no-dangling-refs, source-relationship-parity, branch-store-not-compiled, source-path-dangling, no-cycles, required-fields, deprecated-adr-no-successor, superseded-requirement-open, scenario-feasibility, scenario-feasibility-unknown, exception-claim-keys, numeric-string-value, rule-key-arguments-missing, domain-contradictions, logic-coverage, rule-safety, rule-verifiability, query-plan-safety, req-status-vocabulary, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, strict-readiness, semantic-completeness, related-requirement-unmodeled, proof-contract-symbols, entity-id-style, domain-redundancy, domain-implication, subject-key-identity, subject-key-shape, ontology-quality, exception-unapproved, exception-approval-self-attested, agent-requirement-unapproved, requirement-rationale-missing, symbol-owner-superseded, adr-unlinked, adr-proposed, predicate-schema-conformance, entity-context-missing, entity-context-acknowledged, decision-firm-unreferenced, decision-firm-superseded, decision-firm-edited, supersedes-reason-missing, supersedes-reason-acknowledged, policy-ownership, policy-markers, kb-consistency, kb-consistency-unresolved, evidence-floor, proof-contract-claims. If omitted, server runs canonical and advisory rules plus the full-KB qualityDiagnostics audit scan, including usage telemetry acceptance when evidence exists; migration rules run only when explicitly selected. Advisory and migration findings are non-blocking qualityDiagnostics. If supplied, server preserves scoped validation and skips the full-KB advisory scan.";
|
|
2197
|
+
readonly description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, symbol-granularity, no-dangling-refs, source-relationship-parity, branch-store-not-compiled, source-path-dangling, no-cycles, required-fields, deprecated-adr-no-successor, superseded-requirement-open, scenario-feasibility, scenario-feasibility-unknown, scenario-outcome-mismatch, exception-claim-keys, numeric-string-value, rule-key-arguments-missing, domain-contradictions, logic-coverage, rule-safety, rule-verifiability, query-plan-safety, req-status-vocabulary, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, strict-readiness, semantic-completeness, related-requirement-unmodeled, proof-contract-symbols, entity-id-style, domain-redundancy, domain-implication, subject-key-identity, subject-key-shape, ontology-quality, exception-unapproved, exception-approval-self-attested, agent-requirement-unapproved, requirement-rationale-missing, symbol-owner-superseded, adr-unlinked, adr-proposed, predicate-schema-conformance, entity-context-missing, entity-context-acknowledged, decision-firm-unreferenced, decision-firm-superseded, decision-firm-edited, supersedes-reason-missing, supersedes-reason-acknowledged, policy-ownership, policy-markers, kb-consistency, kb-consistency-unresolved, evidence-floor, proof-contract-claims. If omitted, server runs canonical and advisory rules plus the full-KB qualityDiagnostics audit scan, including usage telemetry acceptance when evidence exists; migration rules run only when explicitly selected. Advisory and migration findings are non-blocking qualityDiagnostics. If supplied, server preserves scoped validation and skips the full-KB advisory scan.";
|
|
2158
2198
|
};
|
|
2159
2199
|
readonly sourceFiles: {
|
|
2160
2200
|
readonly type: "array";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/public/operations/catalog.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/public/operations/catalog.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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37
|
export declare function uncompiledBranchStoreViolation(context: OperationContext, workspaceRoot: string): Violation | null;
|
|
38
|
+
/**
|
|
39
|
+
* The branch store this check reads, when the engine is known to read it, as
|
|
40
|
+
* the place to keep parsed source analyses. A read-only detached snapshot
|
|
41
|
+
* and an unknown store (an explicit --kb-path) get no cache.
|
|
42
|
+
*/
|
|
43
|
+
export declare function analysisCacheDir(context: OperationContext, workspaceRoot: string, options: CheckExecutionOptions): string | undefined;
|
|
38
44
|
export declare function executeCheck(args: CheckInput, context: OperationContext, options?: CheckExecutionOptions): Promise<OperationResult<CheckPayload>>;
|
|
39
45
|
//# sourceMappingURL=check-executor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-executor.d.ts","sourceRoot":"","sources":["../../../src/public/operations/check-executor.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,sBAAsB,EACtB,YAAY,EACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAIL,iBAAiB,EAGjB,iBAAiB,EAGlB,MAAM,oBAAoB,CAAC;AAc5B,OAAO,KAAK,EAAE,gBAAgB,EAAc,MAAM,oBAAoB,CAAC;AAOvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIlD,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAC1C,QAAQ,CAAC,wBAAwB,CAAC,EAAE,OAA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CAmRxC"}
|
|
@@ -120,6 +120,28 @@ export function uncompiledBranchStoreViolation(context, workspaceRoot) {
|
|
|
120
120
|
},
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* The branch store this check reads, when the engine is known to read it, as
|
|
125
|
+
* the place to keep parsed source analyses. A read-only detached snapshot
|
|
126
|
+
* and an unknown store (an explicit --kb-path) get no cache.
|
|
127
|
+
*/
|
|
128
|
+
// implements REQ-cli-check
|
|
129
|
+
export function analysisCacheDir(context, workspaceRoot, options) {
|
|
130
|
+
if (context.branchAttachment === undefined &&
|
|
131
|
+
options.branchStoreAttached !== true) {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
try {
|
|
135
|
+
const attachment = context.branchAttachment ?? resolveBranchAttachment(workspaceRoot);
|
|
136
|
+
if ("storePath" in attachment && attachment.readOnly === undefined) {
|
|
137
|
+
return attachment.storePath;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
// A branch that cannot be resolved gets no cache.
|
|
142
|
+
}
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|
|
123
145
|
// implements REQ-kibi-operation-interface-parity, REQ-002
|
|
124
146
|
export async function executeCheck(args, context, options = {}) {
|
|
125
147
|
try {
|
|
@@ -130,6 +152,10 @@ export async function executeCheck(args, context, options = {}) {
|
|
|
130
152
|
? snapshotEvidence.snapshot.hash
|
|
131
153
|
: undefined;
|
|
132
154
|
const checkedAt = context.clock().toISOString();
|
|
155
|
+
const proofTestBindings = async () => {
|
|
156
|
+
const { perContractTestBindings } = await import("./specs/reporting.js");
|
|
157
|
+
return perContractTestBindings({ ...context, prolog });
|
|
158
|
+
};
|
|
133
159
|
// Enforcement policy is Kibi-owned and deterministic from the installed
|
|
134
160
|
// version. `args.rules` is an invocation-time diagnostic selector only.
|
|
135
161
|
const rulesAllowlist = resolveCheckRules(args);
|
|
@@ -197,6 +223,7 @@ export async function executeCheck(args, context, options = {}) {
|
|
|
197
223
|
workspaceRoot,
|
|
198
224
|
...(proofSnapshot !== undefined ? { proofSnapshot } : {}),
|
|
199
225
|
checkedAt,
|
|
226
|
+
proofTestBindings,
|
|
200
227
|
now: context.clock(),
|
|
201
228
|
...maxDiagnosticsOption,
|
|
202
229
|
});
|
|
@@ -239,12 +266,16 @@ export async function executeCheck(args, context, options = {}) {
|
|
|
239
266
|
const sourcePathFindings = rulesAllowlist.has(SOURCE_PATH_DANGLING_RULE)
|
|
240
267
|
? collectSourcePathDanglingViolations(workspaceRoot)
|
|
241
268
|
: [];
|
|
242
|
-
const symbolGranularityFindings = await collectSymbolGranularityViolations(prolog, workspaceRoot, rulesAllowlist);
|
|
269
|
+
const symbolGranularityFindings = await collectSymbolGranularityViolations(prolog, workspaceRoot, rulesAllowlist, analysisCacheDir(context, workspaceRoot, options));
|
|
243
270
|
const originReviewFindings = await collectOriginReviewViolations(prolog, rulesAllowlist, workspaceRoot);
|
|
244
271
|
const entityContextFindings = collectEntityContextViolations(rulesAllowlist, workspaceRoot);
|
|
245
272
|
const decisionFirmnessFindings = collectDecisionFirmnessViolations(rulesAllowlist, workspaceRoot);
|
|
246
273
|
const checkPolicyFindings = await collectCheckPolicyViolations(prolog, rulesAllowlist, workspaceRoot);
|
|
247
|
-
const evidenceFloorFindings = await collectEvidenceFloorViolations(context, rulesAllowlist, {
|
|
274
|
+
const evidenceFloorFindings = await collectEvidenceFloorViolations(context, rulesAllowlist, {
|
|
275
|
+
freshEvidence: args.freshEvidence === true,
|
|
276
|
+
checkedAt,
|
|
277
|
+
snapshotEvidence,
|
|
278
|
+
});
|
|
248
279
|
const proofContractClaimFindings = await collectProofContractClaimViolations(context, rulesAllowlist);
|
|
249
280
|
const partitioned = partitionCheckFindings([
|
|
250
281
|
...aggregatedFindings,
|
|
@@ -281,6 +312,7 @@ export async function executeCheck(args, context, options = {}) {
|
|
|
281
312
|
workspaceRoot,
|
|
282
313
|
...(proofSnapshot !== undefined ? { proofSnapshot } : {}),
|
|
283
314
|
checkedAt,
|
|
315
|
+
proofTestBindings,
|
|
284
316
|
now: context.clock(),
|
|
285
317
|
...maxDiagnosticsOption,
|
|
286
318
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type IntentSearchAnalysis, type IntentSearchFacets, type IntentSearchMatch, type SourceLocation } from "../../intent-search.js";
|
|
2
2
|
import { type SearchAnswer } from "../../search-answer.js";
|
|
3
|
+
import { type SearchHintsAnalysis } from "../../search-hints.js";
|
|
3
4
|
import type { SearchMatch } from "../../search-ranking.js";
|
|
4
5
|
import { BRANCH_STORE_NOT_COMPILED, type BranchStoreInspection } from "../../utils/branch-store.js";
|
|
5
6
|
import { type MigrationConfigStatus, type MigrationPlan } from "./migration-plan.js";
|
|
@@ -84,6 +85,7 @@ export type SearchInput = {
|
|
|
84
85
|
readonly minScore?: number;
|
|
85
86
|
readonly fields?: "summary" | "full";
|
|
86
87
|
readonly answer?: boolean;
|
|
88
|
+
readonly hints?: boolean;
|
|
87
89
|
};
|
|
88
90
|
export type SearchPayload = {
|
|
89
91
|
readonly results: readonly (SearchMatch | IntentSearchMatch)[];
|
|
@@ -92,7 +94,9 @@ export type SearchPayload = {
|
|
|
92
94
|
/** Rows in `results`: the page this call returned. */
|
|
93
95
|
readonly returned: number;
|
|
94
96
|
readonly truncated?: boolean;
|
|
95
|
-
readonly queryAnalysis?: IntentSearchAnalysis
|
|
97
|
+
readonly queryAnalysis?: IntentSearchAnalysis & {
|
|
98
|
+
readonly hints?: SearchHintsAnalysis;
|
|
99
|
+
};
|
|
96
100
|
readonly answer?: SearchAnswer;
|
|
97
101
|
/** The Kibi branch whose store was searched, when the runtime attached one. */
|
|
98
102
|
readonly branch?: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-executors.d.ts","sourceRoot":"","sources":["../../../src/public/operations/discovery-executors.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,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AAC,aAAa,CAAC,CAAC,CAiKzC;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAuWzC"}
|
|
@@ -7,6 +7,7 @@ import { executeIntentSearch, questionPaths, validateIntentSearchInput, } from "
|
|
|
7
7
|
import { classifyActivation } from "../../operations/bootstrap/activation.js";
|
|
8
8
|
import { SwiplResolutionError } from "../../prolog/swipl-resolver.js";
|
|
9
9
|
import { buildSearchAnswer } from "../../search-answer.js";
|
|
10
|
+
import { buildSearchHints, searchHintsNote, searchHintsTrigger, } from "../../search-hints.js";
|
|
10
11
|
import { rankEntities } from "../../search-ranking.js";
|
|
11
12
|
import { resolveBranchAttachment } from "../../utils/branch-resolver.js";
|
|
12
13
|
import { BRANCH_STORE_NOT_COMPILED, branchStoreReason, inspectBranchStore, storeLockJournalReason, storeLockTakeoverReason, uncompiledBranchStoreReason, } from "../../utils/branch-store.js";
|
|
@@ -584,9 +585,49 @@ function questionPathHint(query, locations) {
|
|
|
584
585
|
? ` The question names ${list}; its words were left out of the topic. Pass it as sourceLocations to also see the requirements linked to that file.`
|
|
585
586
|
: ` The question names ${list}; their words were left out of the topic. Pass them as sourceLocations to also see the requirements linked to those files.`;
|
|
586
587
|
}
|
|
588
|
+
/**
|
|
589
|
+
* Hints from the workspace's kibi.search-hints.v1 provider. A host without a
|
|
590
|
+
* plugin runtime, or a registry that fails to load, gives no hints rather than
|
|
591
|
+
* failing the search.
|
|
592
|
+
*/
|
|
593
|
+
// implements REQ-kibi-search-hints-host
|
|
594
|
+
async function searchHintsFor(context, options) {
|
|
595
|
+
if (!context.ensurePlugins)
|
|
596
|
+
return undefined;
|
|
597
|
+
let resolution;
|
|
598
|
+
try {
|
|
599
|
+
resolution = await (await context.ensurePlugins()).resolveSearchHints();
|
|
600
|
+
}
|
|
601
|
+
catch (error) {
|
|
602
|
+
// A configured provider that cannot load is reported, not thrown: the
|
|
603
|
+
// lexical answer stands on its own.
|
|
604
|
+
const trigger = searchHintsTrigger(options.analysis);
|
|
605
|
+
return trigger === null
|
|
606
|
+
? undefined
|
|
607
|
+
: {
|
|
608
|
+
trigger,
|
|
609
|
+
provider: null,
|
|
610
|
+
items: [],
|
|
611
|
+
diagnostics: [
|
|
612
|
+
{
|
|
613
|
+
pluginId: "unresolved",
|
|
614
|
+
packageName: null,
|
|
615
|
+
mode: "replace",
|
|
616
|
+
code: "provider_unavailable",
|
|
617
|
+
message: error instanceof Error ? error.message : String(error),
|
|
618
|
+
},
|
|
619
|
+
],
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
return buildSearchHints({
|
|
623
|
+
...options,
|
|
624
|
+
resolution,
|
|
625
|
+
workspaceRoot: context.workspaceRoot,
|
|
626
|
+
});
|
|
627
|
+
}
|
|
587
628
|
export async function executeSearch(input, context) {
|
|
588
629
|
// implements REQ-kibi-operation-interface-parity, REQ-mcp-search-discovery
|
|
589
|
-
const { query, type, limit = 10, offset = 0, rankingMode = "intent-v1", semanticFacets, sourceLocations, minScore, fields = "summary", answer, } = input;
|
|
630
|
+
const { query, type, limit = 10, offset = 0, rankingMode = "intent-v1", semanticFacets, sourceLocations, minScore, fields = "summary", answer, hints: hintsWanted = true, } = input;
|
|
590
631
|
const trimmedQuery = query.trim();
|
|
591
632
|
if (!trimmedQuery) {
|
|
592
633
|
throw new Error("Search execution failed: query must be a non-empty string");
|
|
@@ -615,7 +656,10 @@ export async function executeSearch(input, context) {
|
|
|
615
656
|
...(minScore !== undefined ? { minScore } : {}),
|
|
616
657
|
};
|
|
617
658
|
validateIntentSearchInput(intentInput);
|
|
618
|
-
|
|
659
|
+
let corpus;
|
|
660
|
+
const intentResult = await executeIntentSearch(intentInput, prolog, context.workspaceRoot, (entities, bodies) => {
|
|
661
|
+
corpus = { entities, bodies };
|
|
662
|
+
});
|
|
619
663
|
const paginated = paginateResults(intentResult.matches, limit, offset);
|
|
620
664
|
// The answer layer summarizes the whole ranking, so it belongs to the
|
|
621
665
|
// first page only.
|
|
@@ -630,12 +674,27 @@ export async function executeSearch(input, context) {
|
|
|
630
674
|
// A top match no requirement owns is said in the digest too, so the
|
|
631
675
|
// governing list is never read as the top match's requirement.
|
|
632
676
|
const topUngoverned = answerLayer?.ungoverned.find((entry) => entry.rank === 1);
|
|
677
|
+
// Hints come after the lexical answer and never change it; a strong
|
|
678
|
+
// answer never reaches a provider.
|
|
679
|
+
const hints = hintsWanted &&
|
|
680
|
+
offset === 0 &&
|
|
681
|
+
corpus !== undefined &&
|
|
682
|
+
searchHintsTrigger(intentResult.analysis) !== null
|
|
683
|
+
? await searchHintsFor(context, {
|
|
684
|
+
query: trimmedQuery,
|
|
685
|
+
analysis: intentResult.analysis,
|
|
686
|
+
entities: corpus.entities,
|
|
687
|
+
bodies: corpus.bodies,
|
|
688
|
+
governingIds: (answerLayer?.governing ?? []).map((req) => req.id),
|
|
689
|
+
prolog,
|
|
690
|
+
})
|
|
691
|
+
: undefined;
|
|
633
692
|
const text = `${intentResult.matches.length === 0
|
|
634
693
|
? `No intent search results for '${trimmedQuery}' (abstained). No entity shares enough of the question's words: ask again in the words and language the KB is written in, or pass sourceLocations.`
|
|
635
694
|
: `Found ${intentResult.matches.length} intent search results for '${trimmedQuery}'${intentResult.analysis.ambiguous ? " (top matches are close; confirm before relying on one)" : ""}. Top: ${paginated
|
|
636
695
|
.slice(0, 5)
|
|
637
696
|
.map((match) => String(match.entity.id ?? ""))
|
|
638
|
-
.join(", ")}${answerLayer ? `. Governing: ${answerLayer.governing.map((req) => req.id).join(", ") || "none found"}` : ""}${topUngoverned ? ` (the top match ${topUngoverned.id} is linked to no requirement)` : ""}.`}${questionPathHint(trimmedQuery, sourceLocations)}${CONTRADICTION_QUESTION.test(trimmedQuery) ? CONTRADICTION_HINT : ""}${storeNote}`;
|
|
697
|
+
.join(", ")}${answerLayer ? `. Governing: ${answerLayer.governing.map((req) => req.id).join(", ") || "none found"}` : ""}${topUngoverned ? ` (the top match ${topUngoverned.id} is linked to no requirement)` : ""}.`}${searchHintsNote(hints)}${questionPathHint(trimmedQuery, sourceLocations)}${CONTRADICTION_QUESTION.test(trimmedQuery) ? CONTRADICTION_HINT : ""}${storeNote}`;
|
|
639
698
|
return {
|
|
640
699
|
content: [{ type: "text", text }],
|
|
641
700
|
structuredContent: {
|
|
@@ -643,7 +702,9 @@ export async function executeSearch(input, context) {
|
|
|
643
702
|
count: intentResult.matches.length,
|
|
644
703
|
returned: paginated.length,
|
|
645
704
|
truncated: offset + paginated.length < intentResult.matches.length,
|
|
646
|
-
queryAnalysis:
|
|
705
|
+
queryAnalysis: hints !== undefined
|
|
706
|
+
? { ...intentResult.analysis, hints }
|
|
707
|
+
: intentResult.analysis,
|
|
647
708
|
...(answerLayer ? { answer: answerLayer } : {}),
|
|
648
709
|
...branchFields,
|
|
649
710
|
},
|
|
@@ -27,6 +27,13 @@ export type EvidenceFloorOptions = Readonly<{
|
|
|
27
27
|
* `kibi prove --all`.
|
|
28
28
|
*/
|
|
29
29
|
freshEvidence?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The instant and workspace snapshot the whole check judges receipts at,
|
|
32
|
+
* so the floor reads the same requirement proofs the coverage evidence
|
|
33
|
+
* read instead of computing them again.
|
|
34
|
+
*/
|
|
35
|
+
checkedAt?: string;
|
|
36
|
+
snapshotEvidence?: Awaited<ReturnType<typeof readWorkspaceSnapshot>>;
|
|
30
37
|
}>;
|
|
31
38
|
/** The entities behind the gaps, for a person reading kibi check's text. */
|
|
32
39
|
export declare function gapDetailLines(row: EvidenceFloorRow): string[];
|
|
@@ -39,7 +46,7 @@ export declare function evidenceFloorViolations(rows: readonly EvidenceFloorRow[
|
|
|
39
46
|
* ignores the schema version, so a migration can read the floor the ladder
|
|
40
47
|
* will apply before it records the new schema.
|
|
41
48
|
*/
|
|
42
|
-
export declare function readEvidenceFloorRows(context: OperationContext, snapshotEvidence?: Awaited<ReturnType<typeof readWorkspaceSnapshot
|
|
49
|
+
export declare function readEvidenceFloorRows(context: OperationContext, snapshotEvidence?: Awaited<ReturnType<typeof readWorkspaceSnapshot>>, checkedAt?: string): Promise<readonly EvidenceFloorRow[]>;
|
|
43
50
|
/**
|
|
44
51
|
* Evaluate the evidence-floor rule against the attached store, with the same
|
|
45
52
|
* per-contract receipt binding kb_coverage uses.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evidence-floor.d.ts","sourceRoot":"","sources":["../../../src/public/operations/evidence-floor.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;GAIG;AAEH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,mEAAmE;AAEnE,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AAGpD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,MAAM,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,uEAAuE;IACvE,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;CAC1D,CAAC,CAAC;AAOH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"evidence-floor.d.ts","sourceRoot":"","sources":["../../../src/public/operations/evidence-floor.ts"],"names":[],"mappings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E,gBAAgB,EACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,EACpE,SAAS,GAAE,MAAsC,GAChD,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC,CAetC;AAED;;;GAGG;AAEH,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAC1B,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,SAAS,EAAE,CAAC,CAiCtB"}
|
|
@@ -98,7 +98,7 @@ export function evidenceFloorViolations(rows, options = {}) {
|
|
|
98
98
|
* will apply before it records the new schema.
|
|
99
99
|
*/
|
|
100
100
|
// implements REQ-kibi-evidence-floors
|
|
101
|
-
export async function readEvidenceFloorRows(context, snapshotEvidence) {
|
|
101
|
+
export async function readEvidenceFloorRows(context, snapshotEvidence, checkedAt = context.clock().toISOString()) {
|
|
102
102
|
const prolog = context.prolog ?? (await context.ensureProlog?.());
|
|
103
103
|
if (prolog === undefined)
|
|
104
104
|
return [];
|
|
@@ -106,7 +106,6 @@ export async function readEvidenceFloorRows(context, snapshotEvidence) {
|
|
|
106
106
|
const snapshot = evidence.available ? evidence.snapshot.hash : "unknown";
|
|
107
107
|
const { perContractTestBindings } = await import("./specs/reporting.js");
|
|
108
108
|
const bindings = await perContractTestBindings({ ...context, prolog });
|
|
109
|
-
const checkedAt = context.clock().toISOString();
|
|
110
109
|
const goal = `discovery:evidence_floor_json(${bindings === null ? "strict_snapshot, _{}" : `per_contract, ${bindings}`}, ${toPrologAtom(snapshot)}, ${toPrologAtom(checkedAt)}, ${PROOF_RECEIPT_MAX_AGE_SECONDS}, JsonString)`;
|
|
111
110
|
const payload = await runOperationJsonQuery(prolog, "discovery.pl", goal, "Evidence floor evaluation");
|
|
112
111
|
return payload.rows ?? [];
|
|
@@ -124,8 +123,8 @@ export async function collectEvidenceFloorViolations(context, rules, options = {
|
|
|
124
123
|
if (schemaVersion === undefined ||
|
|
125
124
|
schemaVersion < EVIDENCE_FLOOR_SCHEMA_VERSION)
|
|
126
125
|
return [];
|
|
127
|
-
const snapshotEvidence = await readWorkspaceSnapshot(context);
|
|
128
|
-
const rows = await readEvidenceFloorRows(context, snapshotEvidence);
|
|
126
|
+
const snapshotEvidence = options.snapshotEvidence ?? (await readWorkspaceSnapshot(context));
|
|
127
|
+
const rows = await readEvidenceFloorRows(context, snapshotEvidence, options.checkedAt);
|
|
129
128
|
const violations = evidenceFloorViolations(rows, options);
|
|
130
129
|
if (options.freshEvidence === true) {
|
|
131
130
|
const clean = snapshotEvidence.available && snapshotEvidence.snapshot.dirty === false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-plan.d.ts","sourceRoot":"","sources":["../../../src/public/operations/migration-plan.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,sBAAsB,EAAG,wBAAiC,CAAC;AAExE,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,SAAS,CAAC;AACvD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;AAErE,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,CAAC;IACP,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC1C,CAAC,GACF,QAAQ,CAAC;IACP,IAAI,EAAE,KAAK,CAAC;IACZ,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC,CAAC,GACF,QAAQ,CAAC;IACP,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AAEP,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,EAAE,EAA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,CAAC,CAAC,EAAE,CAAC;IAC5D,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,CACzB,oBAAoB,EAAE,MAAM,GAAG,IAAI,KAChC,0BAA0B,CAAC;CACjC,GAAG,aAAa,CA0VhB"}
|
|
@@ -54,30 +54,56 @@ function dependencyOrder(actions) {
|
|
|
54
54
|
action.id,
|
|
55
55
|
new Set(action.dependsOn.filter((dependency) => byId.has(dependency))),
|
|
56
56
|
]));
|
|
57
|
+
// Dependents of each action in action order, so an emitted action frees
|
|
58
|
+
// its dependents in the order a scan over every action would.
|
|
59
|
+
const dependents = new Map();
|
|
60
|
+
for (const action of actions) {
|
|
61
|
+
for (const dependency of remaining.get(action.id)) {
|
|
62
|
+
const list = dependents.get(dependency);
|
|
63
|
+
if (list === undefined)
|
|
64
|
+
dependents.set(dependency, [action.id]);
|
|
65
|
+
else
|
|
66
|
+
list.push(action.id);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
57
69
|
const ordered = [];
|
|
58
70
|
const ready = actions
|
|
59
71
|
.filter((action) => (remaining.get(action.id)?.size ?? 0) === 0)
|
|
60
72
|
.sort(actionSort)
|
|
61
73
|
.map((action) => action.id);
|
|
62
74
|
const queued = new Set(ready);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
75
|
+
const compareReady = (left, right) => compareReadyActionIds(left, right, byId);
|
|
76
|
+
// `ready` stays sorted; a freed action is inserted after its equals, where
|
|
77
|
+
// a stable sort of the pushed list would have put it.
|
|
78
|
+
const enqueue = (id, head) => {
|
|
79
|
+
let low = head;
|
|
80
|
+
let high = ready.length;
|
|
81
|
+
while (low < high) {
|
|
82
|
+
const middle = (low + high) >>> 1;
|
|
83
|
+
if (compareReady(ready[middle], id) <= 0)
|
|
84
|
+
low = middle + 1;
|
|
85
|
+
else
|
|
86
|
+
high = middle;
|
|
87
|
+
}
|
|
88
|
+
ready.splice(low, 0, id);
|
|
89
|
+
};
|
|
90
|
+
let head = 0;
|
|
91
|
+
while (head < ready.length) {
|
|
92
|
+
const id = ready[head];
|
|
93
|
+
head += 1;
|
|
67
94
|
queued.delete(id);
|
|
95
|
+
// Only ids of `actions` are ever queued or listed as dependents.
|
|
68
96
|
const action = byId.get(id);
|
|
69
|
-
if (action === undefined)
|
|
70
|
-
continue;
|
|
71
97
|
ordered.push(action);
|
|
72
|
-
for (const
|
|
98
|
+
for (const candidateId of dependents.get(id) ?? []) {
|
|
99
|
+
const dependencies = remaining.get(candidateId);
|
|
73
100
|
if (!dependencies.delete(id) ||
|
|
74
101
|
dependencies.size !== 0 ||
|
|
75
102
|
queued.has(candidateId)) {
|
|
76
103
|
continue;
|
|
77
104
|
}
|
|
78
|
-
ready.push(candidateId);
|
|
79
105
|
queued.add(candidateId);
|
|
80
|
-
|
|
106
|
+
enqueue(candidateId, head);
|
|
81
107
|
}
|
|
82
108
|
}
|
|
83
109
|
// Preserve cyclic/missing-dependency actions in canonical order; validation will block them.
|
|
@@ -103,7 +129,12 @@ function summarize(actions) {
|
|
|
103
129
|
}
|
|
104
130
|
// implements REQ-agent-guided-migration-orchestration
|
|
105
131
|
export function buildMigrationPlan(input = {}) {
|
|
106
|
-
|
|
132
|
+
// An id names one action, as in a merged plan: a later definition of the
|
|
133
|
+
// same id replaces the earlier one instead of being ordered twice.
|
|
134
|
+
const uniqueActions = [
|
|
135
|
+
...new Map((input.actions ?? []).map((action) => [action.id, action])).values(),
|
|
136
|
+
];
|
|
137
|
+
const actions = dependencyOrder(uniqueActions.sort(actionSort));
|
|
107
138
|
const evaluatedDomains = uniqueSorted(input.evaluatedDomains);
|
|
108
139
|
const incompleteDomains = uniqueSorted(input.incompleteDomains);
|
|
109
140
|
const expected = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-ports.d.ts","sourceRoot":"","sources":["../../../src/public/operations/node-ports.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE/E,KAAK,kBAAkB,GAAG,cAAc,GAAG;IACzC,QAAQ,CAAC,IAAI,EAAE,CACb,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,OAAO,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,KACjE,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACjC,CAAC;AAEF,KAAK,WAAW,GAAG,OAAO,GAAG;IAC3B,QAAQ,CAAC,YAAY,EAAE,CACrB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,SAAS,MAAM,EAAE,KACrB,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACjC,CAAC;
|
|
1
|
+
{"version":3,"file":"node-ports.d.ts","sourceRoot":"","sources":["../../../src/public/operations/node-ports.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE/E,KAAK,kBAAkB,GAAG,cAAc,GAAG;IACzC,QAAQ,CAAC,IAAI,EAAE,CACb,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,OAAO,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,KACjE,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACjC,CAAC;AAEF,KAAK,WAAW,GAAG,OAAO,GAAG;IAC3B,QAAQ,CAAC,YAAY,EAAE,CACrB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,SAAS,MAAM,EAAE,KACrB,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACjC,CAAC;AAsKF,eAAO,MAAM,cAAc,EAAE,kBAkC5B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAiBrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAEzB,CAAC"}
|
|
@@ -82,11 +82,13 @@ async function workspaceSnapshot(workspaceRoot) {
|
|
|
82
82
|
.sort((left, right) => left.key < right.key ? -1 : left.key > right.key ? 1 : 0);
|
|
83
83
|
const digest = createHash("sha256");
|
|
84
84
|
digest.update("kibi.workspace-snapshot.v2\0");
|
|
85
|
+
// Synchronous reads: one awaited read per file paid a file-handle round
|
|
86
|
+
// trip each, about eight times the time of reading the same files directly.
|
|
85
87
|
for (const { raw, key: relativePath } of paths) {
|
|
86
88
|
digest.update(relativePath);
|
|
87
89
|
digest.update("\0");
|
|
88
90
|
try {
|
|
89
|
-
const content =
|
|
91
|
+
const content = fsSync.readFileSync(path.join(workspaceRoot, raw));
|
|
90
92
|
digest.update(snapshotFileContent(relativePath, content));
|
|
91
93
|
}
|
|
92
94
|
catch (error) {
|