kibi-cli 2.14.0 → 2.16.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-register-proof.d.ts.map +1 -1
- package/dist/cli-register-proof.js +16 -2
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +5 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +83 -4
- package/dist/commands/prove.js +1 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +5 -2
- package/dist/operations/bootstrap/discovery.d.ts.map +1 -1
- package/dist/operations/bootstrap/discovery.js +6 -1
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +1 -0
- package/dist/operations/bootstrap/guidance-actions.d.ts +2 -1
- package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance-actions.js +10 -1
- package/dist/operations/bootstrap/guidance.d.ts +2 -0
- package/dist/operations/bootstrap/guidance.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance.js +1 -1
- package/dist/operations/bootstrap/plugin-offers.d.ts +16 -0
- package/dist/operations/bootstrap/plugin-offers.d.ts.map +1 -0
- package/dist/operations/bootstrap/plugin-offers.js +66 -0
- 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 +2 -0
- package/dist/operations/bootstrap/types.d.ts +2 -0
- package/dist/operations/bootstrap/types.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.d.ts +5 -0
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +17 -5
- package/dist/operations/modeling/predicate-applicability.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applicability.js +27 -1
- package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applyplan.js +16 -6
- package/dist/operations/modeling/predicate-binding-hints.d.ts +10 -0
- package/dist/operations/modeling/predicate-binding-hints.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-binding-hints.js +74 -0
- package/dist/operations/modeling/predicate-catalog-5.d.ts +2 -2
- package/dist/operations/modeling/predicate-catalog-5.js +2 -2
- package/dist/operations/modeling/predicate-catalog-6.d.ts +9 -0
- package/dist/operations/modeling/predicate-catalog-6.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-6.js +106 -0
- package/dist/operations/modeling/predicate-catalog.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog.js +2 -0
- package/dist/operations/modeling/predicate-usage-hints-4.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-usage-hints-4.js +32 -0
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.js +32 -11
- package/dist/operations/mutation/contradictions.d.ts +8 -0
- package/dist/operations/mutation/contradictions.d.ts.map +1 -1
- package/dist/operations/mutation/contradictions.js +13 -0
- package/dist/operations/mutation/source-authoring.d.ts +13 -0
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +70 -2
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +9 -3
- package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
- package/dist/operations/mutation/validate-upsert.js +30 -4
- package/dist/operations/planning/apply-plan.d.ts.map +1 -1
- package/dist/operations/planning/apply-plan.js +15 -0
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/ingestion-boundary.js +20 -1
- package/dist/plugins/approved-source-analyzers.generated.d.ts +5 -5
- package/dist/plugins/approved-source-analyzers.generated.js +5 -5
- package/dist/plugins/check-policies.d.ts +24 -0
- package/dist/plugins/check-policies.d.ts.map +1 -0
- package/dist/plugins/check-policies.js +73 -0
- package/dist/plugins/registry.d.ts.map +1 -1
- package/dist/plugins/registry.js +10 -1
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +8 -1
- package/dist/proof/inspect.d.ts +18 -1
- package/dist/proof/inspect.d.ts.map +1 -1
- package/dist/proof/inspect.js +17 -8
- package/dist/proof/integration-plan.d.ts +57 -0
- package/dist/proof/integration-plan.d.ts.map +1 -0
- package/dist/proof/integration-plan.js +331 -0
- package/dist/proof/integrations.js +1 -1
- package/dist/public/operations/catalog.d.ts +2 -2
- package/dist/public/operations/check-executor.d.ts +16 -0
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +83 -0
- package/dist/public/operations/check-policy-rules.d.ts +49 -0
- package/dist/public/operations/check-policy-rules.d.ts.map +1 -0
- package/dist/public/operations/check-policy-rules.js +305 -0
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +5 -0
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +13 -3
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +28 -0
- package/dist/public/operations/source-relationship-parity.d.ts.map +1 -1
- package/dist/public/operations/source-relationship-parity.js +16 -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 +4 -1
- package/dist/public/operations/specs/check.d.ts +1 -1
- package/dist/public/operations/specs/composite.d.ts +16 -3
- package/dist/public/operations/specs/composite.d.ts.map +1 -1
- package/dist/public/operations/specs/composite.js +79 -2
- package/dist/public/operations/specs/modeling.d.ts +1 -1
- package/dist/public/operations/specs/modeling.js +1 -1
- package/dist/public/operations/specs/reporting.d.ts +9 -0
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +6 -2
- package/dist/public/skills/kibi-bootstrap/SKILL.md +3 -2
- package/dist/public/skills/kibi-usage/SKILL.md +82 -3
- package/dist/public/skills/kibi-usage/resources/proof.md +15 -3
- package/dist/public/skills/kibi-usage/resources/ui-requirements.md +42 -3
- package/dist/report/html-report.d.ts.map +1 -1
- package/dist/report/html-report.js +13 -2
- package/dist/utils/branch-store.d.ts +32 -0
- package/dist/utils/branch-store.d.ts.map +1 -1
- package/dist/utils/branch-store.js +122 -1
- package/dist/utils/rule-registry.generated.d.ts +15 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +18 -0
- package/dist/utils/strict-modeling.d.ts +12 -0
- package/dist/utils/strict-modeling.d.ts.map +1 -1
- package/dist/utils/strict-modeling.js +12 -1
- package/package.json +4 -4
- package/src/public/operations/check-executor.ts +112 -0
- package/src/public/operations/check-policy-rules.ts +462 -0
- package/src/public/operations/contracts.ts +6 -0
- package/src/public/operations/discovery-executors.ts +19 -2
- package/src/public/operations/migration-plan.ts +35 -0
- package/src/public/operations/source-relationship-parity.ts +17 -2
- package/src/public/operations/specs/check-rules.generated.ts +4 -1
- package/src/public/operations/specs/composite.ts +110 -11
- package/src/public/operations/specs/modeling.ts +1 -1
- package/src/public/operations/specs/reporting.ts +13 -2
- package/src/public/skills/kibi-bootstrap/SKILL.md +3 -2
- package/src/public/skills/kibi-usage/SKILL.md +82 -3
- package/src/public/skills/kibi-usage/resources/proof.md +15 -3
- package/src/public/skills/kibi-usage/resources/ui-requirements.md +42 -3
package/dist/prolog.js
CHANGED
|
@@ -505,6 +505,9 @@ export class PrologProcess {
|
|
|
505
505
|
trimmed.startsWith("kb_storage_export") ||
|
|
506
506
|
trimmed.startsWith("status:") ||
|
|
507
507
|
trimmed.startsWith("kb_commit_upsert(") ||
|
|
508
|
+
// The preview stages a write in a rolled-back transaction: never
|
|
509
|
+
// answer it from the cache of an earlier payload.
|
|
510
|
+
trimmed.startsWith("kb_preview_upsert_contradiction(") ||
|
|
508
511
|
trimmed.startsWith("kb_assert_") ||
|
|
509
512
|
trimmed.startsWith("kb_delete_") ||
|
|
510
513
|
trimmed.startsWith("kb_retract_"));
|
|
@@ -790,7 +793,11 @@ export class PrologProcess {
|
|
|
790
793
|
return match?.[1] ?? "anonymous";
|
|
791
794
|
}
|
|
792
795
|
addDiagnosticStage(message, goal, diagnostics) {
|
|
793
|
-
|
|
796
|
+
// The dry-run contradiction preview reports the same stages as the
|
|
797
|
+
// commit it previews, so its refusal reads exactly like the commit's.
|
|
798
|
+
const label = this.goalLabel(goal);
|
|
799
|
+
if (label !== "kb_commit_upsert" &&
|
|
800
|
+
label !== "kb_preview_upsert_contradiction")
|
|
794
801
|
return message;
|
|
795
802
|
const stage = this.lastDiagnosticStage(diagnostics);
|
|
796
803
|
return stage === null ? message : `${message} (stage=${stage})`;
|
package/dist/proof/inspect.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { MigrationPlan } from "../public/operations/migration-plan.js";
|
|
2
|
+
import { type ProposedIntegration } from "./integration-plan.js";
|
|
1
3
|
export type ProofInspection = Readonly<{
|
|
2
4
|
languages: readonly string[];
|
|
3
5
|
buildSystems: readonly string[];
|
|
@@ -6,7 +8,22 @@ export type ProofInspection = Readonly<{
|
|
|
6
8
|
currentIntegration: string | null;
|
|
7
9
|
recommendation: string;
|
|
8
10
|
missing: readonly string[];
|
|
11
|
+
/** The integration Kibi proposes for the detected runner, if any. */
|
|
12
|
+
proposedIntegration: ProposedIntegration["integration"] | null;
|
|
13
|
+
/** What a proof-bearing test's proof_contract names for that integration. */
|
|
14
|
+
contractDefaults: ProposedIntegration["contractDefaults"] | null;
|
|
15
|
+
/**
|
|
16
|
+
* Hash-bound kibi.migration-plan.v2 that writes the integrations file;
|
|
17
|
+
* review it, then apply it with kb_apply_plan / `kibi apply-plan`.
|
|
18
|
+
*/
|
|
19
|
+
integrationPlan: MigrationPlan | null;
|
|
20
|
+
/** Why there is no plan, or what applying it does. */
|
|
21
|
+
integrationPlanReason: string;
|
|
22
|
+
}>;
|
|
23
|
+
export type ProofInspectionOptions = Readonly<{
|
|
24
|
+
/** Plan a replacement of this existing integration id. */
|
|
25
|
+
update?: string;
|
|
9
26
|
}>;
|
|
10
27
|
export declare function directoryEntriesMatch(directory: string, regex: RegExp): boolean;
|
|
11
|
-
export declare function inspectProofEnvironment(root: string): ProofInspection;
|
|
28
|
+
export declare function inspectProofEnvironment(root: string, options?: ProofInspectionOptions): ProofInspection;
|
|
12
29
|
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/proof/inspect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/proof/inspect.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,uBAAuB,CAAC;AAM/B,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,qEAAqE;IACrE,mBAAmB,EAAE,mBAAmB,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;IAC/D,6EAA6E;IAC7E,gBAAgB,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC;IACjE;;;OAGG;IACH,eAAe,EAAE,aAAa,GAAG,IAAI,CAAC;IACtC,sDAAsD;IACtD,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAwIH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACZ,OAAO,CAMT;AA2BD,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,sBAA2B,GACnC,eAAe,CAgGjB"}
|
package/dist/proof/inspect.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { buildProofIntegrationPlan, } from "./integration-plan.js";
|
|
4
|
+
import { PROOF_INTEGRATIONS_PATH, loadProofIntegrations, } from "./integrations.js";
|
|
4
5
|
/**
|
|
5
6
|
* Declarative detection manifests. Deterministic CLI logic consumes these;
|
|
6
7
|
* agents consume the inspection output and never reinvent runner discovery.
|
|
@@ -149,7 +150,7 @@ function directoryExists(root, relative) {
|
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
// implements REQ-kibi-verification-evidence-contract
|
|
152
|
-
export function inspectProofEnvironment(root) {
|
|
153
|
+
export function inspectProofEnvironment(root, options = {}) {
|
|
153
154
|
const languages = new Set();
|
|
154
155
|
const buildSystems = new Set();
|
|
155
156
|
const runners = [];
|
|
@@ -207,17 +208,21 @@ export function inspectProofEnvironment(root) {
|
|
|
207
208
|
const currentIntegration = integrations.available
|
|
208
209
|
? integrations.integrations.integrations.map((entry) => entry.id).join(", ")
|
|
209
210
|
: null;
|
|
211
|
+
const planned = buildProofIntegrationPlan(root, options);
|
|
212
|
+
const applyHint = "review integrationPlan, then apply it with kb_apply_plan (or `kibi apply-plan --input -`) passing plan, approvedPlanHash = plan.planHash and approvedActionIds";
|
|
210
213
|
let recommendation;
|
|
211
|
-
if (
|
|
212
|
-
|
|
214
|
+
if (planned.plan !== null && options.update !== undefined) {
|
|
215
|
+
recommendation = `To replace integration '${options.update}', ${applyHint}.`;
|
|
216
|
+
}
|
|
217
|
+
else if (!integrations.available) {
|
|
218
|
+
if (planned.plan === null) {
|
|
213
219
|
recommendation =
|
|
214
220
|
"No test harness detected. Proof integration is deferred until the first proof-bearing test introduces one; command proof can prove any command.";
|
|
215
|
-
missing.push(
|
|
221
|
+
missing.push(`${PROOF_INTEGRATIONS_PATH} (written by applying the plan from kibi proof inspect --json)`);
|
|
216
222
|
}
|
|
217
223
|
else {
|
|
218
|
-
recommendation =
|
|
219
|
-
|
|
220
|
-
missing.push(".kb/proof/integrations.json (created by bootstrap)");
|
|
224
|
+
recommendation = `Kibi proposes a command integration for the detected runner. To configure it, ${applyHint}. Proof-bearing tests then name it in proof_contract.integration and kibi prove runs it.`;
|
|
225
|
+
missing.push(`${PROOF_INTEGRATIONS_PATH} (written by applying integrationPlan)`);
|
|
221
226
|
}
|
|
222
227
|
}
|
|
223
228
|
else {
|
|
@@ -232,5 +237,9 @@ export function inspectProofEnvironment(root) {
|
|
|
232
237
|
currentIntegration,
|
|
233
238
|
recommendation,
|
|
234
239
|
missing,
|
|
240
|
+
proposedIntegration: planned.proposal?.integration ?? null,
|
|
241
|
+
contractDefaults: planned.proposal?.contractDefaults ?? null,
|
|
242
|
+
integrationPlan: planned.plan,
|
|
243
|
+
integrationPlanReason: planned.reason,
|
|
235
244
|
};
|
|
236
245
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type MigrationAction, type MigrationPlan } from "../public/operations/migration-plan.js";
|
|
2
|
+
import { PROOF_CONTRACT_VERSION } from "../public/proof-protocol.js";
|
|
3
|
+
import { type ProofIntegration } from "./integrations.js";
|
|
4
|
+
/** Migration action code of a reviewed proof integration write. */
|
|
5
|
+
export declare const PROOF_INTEGRATION_CONFIGURE = "proof_integration_configure";
|
|
6
|
+
export type ProposedIntegration = Readonly<{
|
|
7
|
+
integration: ProofIntegration;
|
|
8
|
+
/** The runner the proposal was derived from (for the review summary). */
|
|
9
|
+
runner: string;
|
|
10
|
+
/** What a proof-bearing test's proof_contract names for this integration. */
|
|
11
|
+
contractDefaults: Readonly<{
|
|
12
|
+
version: typeof PROOF_CONTRACT_VERSION;
|
|
13
|
+
integration: string;
|
|
14
|
+
required_proofs: ReadonlyArray<{
|
|
15
|
+
symbol_id: string;
|
|
16
|
+
target: string;
|
|
17
|
+
}>;
|
|
18
|
+
success_policy: "all_required_first_attempt";
|
|
19
|
+
}>;
|
|
20
|
+
}>;
|
|
21
|
+
export type ProofIntegrationPlanResult = Readonly<{
|
|
22
|
+
/** The hash-bound plan to review and apply with kb_apply_plan, if any. */
|
|
23
|
+
plan: MigrationPlan | null;
|
|
24
|
+
proposal: ProposedIntegration | null;
|
|
25
|
+
/** Why no plan was produced, or what applying it does. */
|
|
26
|
+
reason: string;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* The command-producer integration Kibi proposes for the repository's test
|
|
30
|
+
* runner: the package.json `test` script when there is one (it is what the
|
|
31
|
+
* project already runs), otherwise the first detected runner. A command
|
|
32
|
+
* integration is the universal floor: Kibi judges the run by its exit code
|
|
33
|
+
* (aggregate-run provenance), so it works for every runner without a
|
|
34
|
+
* reporter; a native producer can replace it later through an update plan.
|
|
35
|
+
*/
|
|
36
|
+
export declare function proposeProofIntegration(root: string, overrideId?: string): ProposedIntegration | null;
|
|
37
|
+
/**
|
|
38
|
+
* Build the hash-bound `kibi.migration-plan.v2` that writes
|
|
39
|
+
* `.kb/proof/integrations.json` through Kibi. Without `update`, a plan is
|
|
40
|
+
* produced only while the file does not exist; with `update` it adds or
|
|
41
|
+
* replaces the named integration of an existing, valid file. The plan carries the file's
|
|
42
|
+
* current hash and the hashes of the files the proposal was derived from;
|
|
43
|
+
* `kb_apply_plan` refuses it once either changed.
|
|
44
|
+
*/
|
|
45
|
+
export declare function buildProofIntegrationPlan(root: string, options?: Readonly<{
|
|
46
|
+
update?: string;
|
|
47
|
+
}>): ProofIntegrationPlanResult;
|
|
48
|
+
/**
|
|
49
|
+
* Apply one reviewed `proof_integration_configure` action: write
|
|
50
|
+
* `.kb/proof/integrations.json` (`kibi.proof-integration.v1`). A create is
|
|
51
|
+
* refused when the file exists; an update is refused unless the file still
|
|
52
|
+
* has the hash the plan was built against, and it adds or replaces only the
|
|
53
|
+
* named integration. Either is refused when
|
|
54
|
+
* a file the proposal was derived from changed since planning.
|
|
55
|
+
*/
|
|
56
|
+
export declare function applyProofIntegrationAction(action: MigrationAction, root: string): void;
|
|
57
|
+
//# sourceMappingURL=integration-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-plan.d.ts","sourceRoot":"","sources":["../../src/proof/integration-plan.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,aAAa,EAGnB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,sBAAsB,EAEvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,gBAAgB,EAGtB,MAAM,mBAAmB,CAAC;AAE3B,mEAAmE;AACnE,eAAO,MAAM,2BAA2B,gCAAgC,CAAC;AAqCzE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,gBAAgB,EAAE,QAAQ,CAAC;QACzB,OAAO,EAAE,OAAO,sBAAsB,CAAC;QACvC,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,aAAa,CAAC;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACtE,cAAc,EAAE,4BAA4B,CAAC;KAC9C,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IAChD,0EAA0E;IAC1E,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACrC,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAyGH;;;;;;;GAOG;AAEH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,GAClB,mBAAmB,GAAG,IAAI,CA8B5B;AAsCD;;;;;;;GAOG;AAEH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,QAAQ,CAAC;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAM,GAC1C,0BAA0B,CAiE5B;AAMD;;;;;;;GAOG;AAEH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,GACX,IAAI,CAyDN"}
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync, } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { buildMigrationPlan, migrationAction, } from "../public/operations/migration-plan.js";
|
|
5
|
+
import { PROOF_CONTRACT_VERSION, PROOF_INTEGRATION_VERSION, } from "../public/proof-protocol.js";
|
|
6
|
+
import { PROOF_INTEGRATIONS_PATH, integrationsPath, proofIntegrationErrors, } from "./integrations.js";
|
|
7
|
+
/** Migration action code of a reviewed proof integration write. */
|
|
8
|
+
export const PROOF_INTEGRATION_CONFIGURE = "proof_integration_configure";
|
|
9
|
+
/**
|
|
10
|
+
* Files the proposal is derived from. Their hashes are bound into the plan,
|
|
11
|
+
* so a plan reviewed against one package.json is refused after it changed.
|
|
12
|
+
*/
|
|
13
|
+
const PROPOSAL_SOURCES = [
|
|
14
|
+
"package.json",
|
|
15
|
+
"bun.lock",
|
|
16
|
+
"bun.lockb",
|
|
17
|
+
"pnpm-lock.yaml",
|
|
18
|
+
"yarn.lock",
|
|
19
|
+
"playwright.config.ts",
|
|
20
|
+
"playwright.config.mjs",
|
|
21
|
+
"playwright.config.js",
|
|
22
|
+
"vitest.config.ts",
|
|
23
|
+
"vitest.config.mjs",
|
|
24
|
+
"vitest.config.js",
|
|
25
|
+
"jest.config.ts",
|
|
26
|
+
"jest.config.mjs",
|
|
27
|
+
"jest.config.js",
|
|
28
|
+
"pytest.ini",
|
|
29
|
+
"pyproject.toml",
|
|
30
|
+
"setup.cfg",
|
|
31
|
+
"tox.ini",
|
|
32
|
+
"go.mod",
|
|
33
|
+
"Cargo.toml",
|
|
34
|
+
"pom.xml",
|
|
35
|
+
"build.gradle",
|
|
36
|
+
"build.gradle.kts",
|
|
37
|
+
"Gemfile",
|
|
38
|
+
"Rakefile",
|
|
39
|
+
];
|
|
40
|
+
/** npm writes this placeholder into a fresh package.json; it runs no tests. */
|
|
41
|
+
const NPM_PLACEHOLDER_TEST = /no test specified/i;
|
|
42
|
+
function readPackageJson(root) {
|
|
43
|
+
try {
|
|
44
|
+
const parsed = JSON.parse(readFileSync(path.join(root, "package.json"), "utf8"));
|
|
45
|
+
return parsed !== null &&
|
|
46
|
+
typeof parsed === "object" &&
|
|
47
|
+
!Array.isArray(parsed)
|
|
48
|
+
? parsed
|
|
49
|
+
: null;
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function packageTestCommand(root) {
|
|
56
|
+
const pkg = readPackageJson(root);
|
|
57
|
+
const scripts = pkg !== null &&
|
|
58
|
+
pkg.scripts !== null &&
|
|
59
|
+
typeof pkg.scripts === "object" &&
|
|
60
|
+
!Array.isArray(pkg.scripts)
|
|
61
|
+
? pkg.scripts
|
|
62
|
+
: {};
|
|
63
|
+
const test = scripts.test;
|
|
64
|
+
if (typeof test !== "string" || test.trim() === "")
|
|
65
|
+
return null;
|
|
66
|
+
if (NPM_PLACEHOLDER_TEST.test(test))
|
|
67
|
+
return null;
|
|
68
|
+
const has = (file) => existsSync(path.join(root, file));
|
|
69
|
+
if (has("bun.lock") || has("bun.lockb"))
|
|
70
|
+
return ["bun", "run", "test"];
|
|
71
|
+
if (has("pnpm-lock.yaml"))
|
|
72
|
+
return ["pnpm", "test"];
|
|
73
|
+
if (has("yarn.lock"))
|
|
74
|
+
return ["yarn", "test"];
|
|
75
|
+
return ["npm", "test"];
|
|
76
|
+
}
|
|
77
|
+
/** Ordered: the first runner whose marker file exists wins. */
|
|
78
|
+
const RUNNER_COMMANDS = [
|
|
79
|
+
{
|
|
80
|
+
runner: "playwright",
|
|
81
|
+
id: "e2e",
|
|
82
|
+
files: [
|
|
83
|
+
"playwright.config.ts",
|
|
84
|
+
"playwright.config.mjs",
|
|
85
|
+
"playwright.config.js",
|
|
86
|
+
],
|
|
87
|
+
command: ["npx", "playwright", "test"],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
runner: "vitest",
|
|
91
|
+
id: "unit",
|
|
92
|
+
files: ["vitest.config.ts", "vitest.config.mjs", "vitest.config.js"],
|
|
93
|
+
command: ["npx", "vitest", "run"],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
runner: "jest",
|
|
97
|
+
id: "unit",
|
|
98
|
+
files: ["jest.config.ts", "jest.config.mjs", "jest.config.js"],
|
|
99
|
+
command: ["npx", "jest", "--ci"],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
runner: "pytest",
|
|
103
|
+
id: "unit",
|
|
104
|
+
files: ["pytest.ini", "pyproject.toml", "setup.cfg", "tox.ini"],
|
|
105
|
+
command: ["pytest"],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
runner: "go test",
|
|
109
|
+
id: "unit",
|
|
110
|
+
files: ["go.mod"],
|
|
111
|
+
command: ["go", "test", "./..."],
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
runner: "cargo test",
|
|
115
|
+
id: "unit",
|
|
116
|
+
files: ["Cargo.toml"],
|
|
117
|
+
command: ["cargo", "test"],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
runner: "maven",
|
|
121
|
+
id: "unit",
|
|
122
|
+
files: ["pom.xml"],
|
|
123
|
+
command: ["mvn", "test"],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
runner: "gradle",
|
|
127
|
+
id: "unit",
|
|
128
|
+
files: ["build.gradle", "build.gradle.kts"],
|
|
129
|
+
command: ["gradle", "test"],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
runner: "rake test",
|
|
133
|
+
id: "unit",
|
|
134
|
+
files: ["Rakefile"],
|
|
135
|
+
command: ["bundle", "exec", "rake", "test"],
|
|
136
|
+
},
|
|
137
|
+
];
|
|
138
|
+
/**
|
|
139
|
+
* The command-producer integration Kibi proposes for the repository's test
|
|
140
|
+
* runner: the package.json `test` script when there is one (it is what the
|
|
141
|
+
* project already runs), otherwise the first detected runner. A command
|
|
142
|
+
* integration is the universal floor: Kibi judges the run by its exit code
|
|
143
|
+
* (aggregate-run provenance), so it works for every runner without a
|
|
144
|
+
* reporter; a native producer can replace it later through an update plan.
|
|
145
|
+
*/
|
|
146
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
147
|
+
export function proposeProofIntegration(root, overrideId) {
|
|
148
|
+
const npmCommand = packageTestCommand(root);
|
|
149
|
+
const detected = npmCommand !== null
|
|
150
|
+
? {
|
|
151
|
+
runner: `package.json test script (${npmCommand.join(" ")})`,
|
|
152
|
+
id: "unit",
|
|
153
|
+
command: npmCommand,
|
|
154
|
+
}
|
|
155
|
+
: RUNNER_COMMANDS.find((entry) => entry.files.some((file) => existsSync(path.join(root, file))));
|
|
156
|
+
if (detected === undefined)
|
|
157
|
+
return null;
|
|
158
|
+
const id = overrideId ?? detected.id;
|
|
159
|
+
return {
|
|
160
|
+
runner: detected.runner,
|
|
161
|
+
integration: {
|
|
162
|
+
id,
|
|
163
|
+
producer: "command",
|
|
164
|
+
command: [...detected.command],
|
|
165
|
+
targets: ["default"],
|
|
166
|
+
description: `Command proof: runs ${detected.command.join(" ")} once per kibi prove and judges every selected test by its exit code.`,
|
|
167
|
+
},
|
|
168
|
+
contractDefaults: {
|
|
169
|
+
version: PROOF_CONTRACT_VERSION,
|
|
170
|
+
integration: id,
|
|
171
|
+
required_proofs: [{ symbol_id: "SYM-<symbol the test proves>", target: "default" }],
|
|
172
|
+
success_policy: "all_required_first_attempt",
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function sha256(bytes) {
|
|
177
|
+
return createHash("sha256").update(bytes).digest("hex");
|
|
178
|
+
}
|
|
179
|
+
function fileHash(filePath) {
|
|
180
|
+
try {
|
|
181
|
+
return sha256(readFileSync(filePath));
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function sourceHashes(root) {
|
|
188
|
+
const hashes = {};
|
|
189
|
+
for (const file of PROPOSAL_SOURCES) {
|
|
190
|
+
const hash = fileHash(path.join(root, file));
|
|
191
|
+
if (hash !== null)
|
|
192
|
+
hashes[file] = hash;
|
|
193
|
+
}
|
|
194
|
+
return hashes;
|
|
195
|
+
}
|
|
196
|
+
function readIntegrationsFile(root) {
|
|
197
|
+
try {
|
|
198
|
+
const parsed = JSON.parse(readFileSync(integrationsPath(root), "utf8"));
|
|
199
|
+
return proofIntegrationErrors(parsed).length === 0 ? parsed : null;
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Build the hash-bound `kibi.migration-plan.v2` that writes
|
|
207
|
+
* `.kb/proof/integrations.json` through Kibi. Without `update`, a plan is
|
|
208
|
+
* produced only while the file does not exist; with `update` it adds or
|
|
209
|
+
* replaces the named integration of an existing, valid file. The plan carries the file's
|
|
210
|
+
* current hash and the hashes of the files the proposal was derived from;
|
|
211
|
+
* `kb_apply_plan` refuses it once either changed.
|
|
212
|
+
*/
|
|
213
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
214
|
+
export function buildProofIntegrationPlan(root, options = {}) {
|
|
215
|
+
const filePath = integrationsPath(root);
|
|
216
|
+
const exists = existsSync(filePath);
|
|
217
|
+
const update = options.update?.trim() || undefined;
|
|
218
|
+
if (exists && update === undefined) {
|
|
219
|
+
return {
|
|
220
|
+
plan: null,
|
|
221
|
+
proposal: null,
|
|
222
|
+
reason: `${PROOF_INTEGRATIONS_PATH} already exists; Kibi will not overwrite it. Run kibi proof inspect --update <integration id> for a plan that adds or replaces one named integration.`,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
if (!exists && update !== undefined) {
|
|
226
|
+
return {
|
|
227
|
+
plan: null,
|
|
228
|
+
proposal: null,
|
|
229
|
+
reason: `${PROOF_INTEGRATIONS_PATH} does not exist yet. Run kibi proof inspect without --update for a plan that creates it.`,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
if (update !== undefined && readIntegrationsFile(root) === null)
|
|
233
|
+
return {
|
|
234
|
+
plan: null,
|
|
235
|
+
proposal: null,
|
|
236
|
+
reason: `${PROOF_INTEGRATIONS_PATH} is not a valid ${PROOF_INTEGRATION_VERSION} file, so Kibi cannot update one integration in it. Run kibi prove for the validation error.`,
|
|
237
|
+
};
|
|
238
|
+
const proposal = proposeProofIntegration(root, update);
|
|
239
|
+
if (proposal === null) {
|
|
240
|
+
return {
|
|
241
|
+
plan: null,
|
|
242
|
+
proposal: null,
|
|
243
|
+
reason: "No test runner detected (no package.json test script and no known runner configuration), so Kibi has no command to propose. Proof integration stays deferred until the first proof-bearing test introduces a harness.",
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
const action = migrationAction({
|
|
247
|
+
id: `proof-integration-${proposal.integration.id}`,
|
|
248
|
+
code: PROOF_INTEGRATION_CONFIGURE,
|
|
249
|
+
category: "proof",
|
|
250
|
+
safety: "automatic",
|
|
251
|
+
autoApplicable: true,
|
|
252
|
+
invocation: {
|
|
253
|
+
kind: "review",
|
|
254
|
+
instruction: `Review the proposed ${proposal.integration.producer} integration '${proposal.integration.id}' (command: ${proposal.integration.command.join(" ")}), then apply this plan with kb_apply_plan (plan, approvedPlanHash, approvedActionIds) to ${update === undefined ? "create" : "update"} ${PROOF_INTEGRATIONS_PATH}.`,
|
|
255
|
+
},
|
|
256
|
+
affectedFiles: [PROOF_INTEGRATIONS_PATH],
|
|
257
|
+
evidence: {
|
|
258
|
+
path: PROOF_INTEGRATIONS_PATH,
|
|
259
|
+
mode: update === undefined ? "create" : "update",
|
|
260
|
+
integration: proposal.integration,
|
|
261
|
+
runner: proposal.runner,
|
|
262
|
+
contractDefaults: proposal.contractDefaults,
|
|
263
|
+
previousFileHash: update === undefined ? null : fileHash(filePath),
|
|
264
|
+
sourceHashes: sourceHashes(root),
|
|
265
|
+
},
|
|
266
|
+
postconditions: [
|
|
267
|
+
{ file: PROOF_INTEGRATIONS_PATH, version: PROOF_INTEGRATION_VERSION },
|
|
268
|
+
],
|
|
269
|
+
});
|
|
270
|
+
return {
|
|
271
|
+
plan: buildMigrationPlan({
|
|
272
|
+
evaluatedDomains: ["proof"],
|
|
273
|
+
actions: [action],
|
|
274
|
+
}),
|
|
275
|
+
proposal,
|
|
276
|
+
reason: `Applying the plan ${update === undefined ? "creates" : "updates"} ${PROOF_INTEGRATIONS_PATH} with the ${proposal.integration.producer} integration '${proposal.integration.id}' (${proposal.integration.command.join(" ")}). Proof-bearing tests then name it in proof_contract.integration and kibi prove runs it.`,
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function isRecord(value) {
|
|
280
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Apply one reviewed `proof_integration_configure` action: write
|
|
284
|
+
* `.kb/proof/integrations.json` (`kibi.proof-integration.v1`). A create is
|
|
285
|
+
* refused when the file exists; an update is refused unless the file still
|
|
286
|
+
* has the hash the plan was built against, and it adds or replaces only the
|
|
287
|
+
* named integration. Either is refused when
|
|
288
|
+
* a file the proposal was derived from changed since planning.
|
|
289
|
+
*/
|
|
290
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
291
|
+
export function applyProofIntegrationAction(action, root) {
|
|
292
|
+
const evidence = action.evidence;
|
|
293
|
+
const integration = evidence.integration;
|
|
294
|
+
if (evidence.path !== PROOF_INTEGRATIONS_PATH ||
|
|
295
|
+
(evidence.mode !== "create" && evidence.mode !== "update") ||
|
|
296
|
+
!isRecord(integration) ||
|
|
297
|
+
typeof integration.id !== "string")
|
|
298
|
+
throw new Error(`Proof integration action '${action.id}' is malformed; rerun kibi proof inspect for a new plan.`);
|
|
299
|
+
const planned = isRecord(evidence.sourceHashes) ? evidence.sourceHashes : {};
|
|
300
|
+
const live = sourceHashes(root);
|
|
301
|
+
const changed = [
|
|
302
|
+
...new Set([...Object.keys(planned), ...Object.keys(live)]),
|
|
303
|
+
].filter((file) => planned[file] !== live[file]);
|
|
304
|
+
if (changed.length > 0)
|
|
305
|
+
throw new Error(`Proof integration plan refused: ${changed.join(", ")} changed since planning; rerun kibi proof inspect and review the new plan.`);
|
|
306
|
+
const filePath = integrationsPath(root);
|
|
307
|
+
let integrations;
|
|
308
|
+
if (evidence.mode === "create") {
|
|
309
|
+
if (existsSync(filePath))
|
|
310
|
+
throw new Error(`Proof integration plan refused: ${PROOF_INTEGRATIONS_PATH} already exists and this plan only creates it. Run kibi proof inspect --update <integration id> for a plan that adds or replaces one named integration.`);
|
|
311
|
+
integrations = [integration];
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
if (fileHash(filePath) !== evidence.previousFileHash)
|
|
315
|
+
throw new Error(`Proof integration plan refused: ${PROOF_INTEGRATIONS_PATH} changed since planning; rerun kibi proof inspect --update ${integration.id}.`);
|
|
316
|
+
const current = readIntegrationsFile(root);
|
|
317
|
+
if (current === null)
|
|
318
|
+
throw new Error(`Proof integration plan refused: ${PROOF_INTEGRATIONS_PATH} is not a valid ${PROOF_INTEGRATION_VERSION} file.`);
|
|
319
|
+
integrations = current.integrations.some((entry) => entry.id === integration.id)
|
|
320
|
+
? current.integrations.map((entry) => entry.id === integration.id ? integration : entry)
|
|
321
|
+
: [...current.integrations, integration];
|
|
322
|
+
}
|
|
323
|
+
const file = { version: PROOF_INTEGRATION_VERSION, integrations };
|
|
324
|
+
const errors = proofIntegrationErrors(file);
|
|
325
|
+
if (errors.length > 0)
|
|
326
|
+
throw new Error(`Proof integration plan refused: the result would be invalid (${errors.join("; ")}).`);
|
|
327
|
+
mkdirSync(path.dirname(filePath), { recursive: true });
|
|
328
|
+
const temporary = `${filePath}.${process.pid}.tmp`;
|
|
329
|
+
writeFileSync(temporary, `${JSON.stringify(file, null, 2)}\n`, "utf8");
|
|
330
|
+
renameSync(temporary, filePath);
|
|
331
|
+
}
|
|
@@ -70,7 +70,7 @@ export function loadProofIntegrations(workspaceRoot) {
|
|
|
70
70
|
if (!existsSync(filePath)) {
|
|
71
71
|
return {
|
|
72
72
|
available: false,
|
|
73
|
-
error: `No proof integration configuration at ${PROOF_INTEGRATIONS_PATH}. Run
|
|
73
|
+
error: `No proof integration configuration at ${PROOF_INTEGRATIONS_PATH}. Run kibi proof inspect --json and apply its integrationPlan with kb_apply_plan to configure one.`,
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
let parsed;
|
|
@@ -572,7 +572,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
572
572
|
};
|
|
573
573
|
readonly requirementId: {
|
|
574
574
|
readonly type: "string";
|
|
575
|
-
readonly description: "Optional
|
|
575
|
+
readonly description: "Optional requirement ID. The strict write set updates this requirement instead of minting a REQ-AUTO id, and a typed logic rule attaches its requires_rule relationship to it.";
|
|
576
576
|
};
|
|
577
577
|
readonly claimKey: {
|
|
578
578
|
readonly type: "string";
|
|
@@ -1732,7 +1732,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
1732
1732
|
readonly type: "string";
|
|
1733
1733
|
readonly enum: readonly string[];
|
|
1734
1734
|
};
|
|
1735
|
-
readonly description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, source-relationship-parity, 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. 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.";
|
|
1735
|
+
readonly description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, 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, policy-ownership, policy-markers. 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.";
|
|
1736
1736
|
};
|
|
1737
1737
|
readonly sourceFiles: {
|
|
1738
1738
|
readonly type: "array";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Violation } from "../check-types.js";
|
|
1
2
|
import { type CheckDiagnostic, type CheckStructuredContent, buildStructuredContent, buildSummary } from "./check-format-shared.js";
|
|
2
3
|
import { getEffectiveRules, resolveCheckRules } from "./check-helpers.js";
|
|
3
4
|
import type { OperationContext } from "./runtime-types.js";
|
|
@@ -16,6 +17,21 @@ export type { CheckDiagnostic, CheckStructuredContent };
|
|
|
16
17
|
export { buildStructuredContent, buildSummary, getEffectiveRules, resolveCheckRules, };
|
|
17
18
|
export type CheckExecutionOptions = {
|
|
18
19
|
readonly collectFullQualityDiagnosticsForExplicitRules?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The engine reads the current branch's store although the context carries
|
|
22
|
+
* no branch attachment (the `kibi check` engine path). A context with a
|
|
23
|
+
* branch attachment (the CLI and MCP runtimes) implies it; without either,
|
|
24
|
+
* the attached store is unknown (an explicit --kb-path store or an injected
|
|
25
|
+
* test store) and the branch-store compilation check is skipped.
|
|
26
|
+
*/
|
|
27
|
+
readonly branchStoreAttached?: boolean;
|
|
19
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* The one finding for a branch whose store was never compiled while .kb/
|
|
31
|
+
* holds authored sources. Every store-backed rule would read an empty KB
|
|
32
|
+
* (source-relationship-parity alone reports each authored relationship as
|
|
33
|
+
* missing), so kb_check reports this instead of any of them.
|
|
34
|
+
*/
|
|
35
|
+
export declare function uncompiledBranchStoreViolation(context: OperationContext, workspaceRoot: string): Violation | null;
|
|
20
36
|
export declare function executeCheck(args: CheckInput, context: OperationContext, options?: CheckExecutionOptions): Promise<OperationResult<CheckPayload>>;
|
|
21
37
|
//# 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":"
|
|
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,sBAAsB,EAC3B,sBAAsB,EACtB,YAAY,EACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAGL,iBAAiB,EAGjB,iBAAiB,EAElB,MAAM,oBAAoB,CAAC;AAW5B,OAAO,KAAK,EAAE,gBAAgB,EAAc,MAAM,oBAAoB,CAAC;AAMvE,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,OAAO,CAAC;IAC5C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,sBAAsB,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,GAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,6CAA6C,CAAC,EAAE,OAAO,CAAC;IACjE;;;;;;OAMG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAoDF;;;;;GAKG;AAEH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,gBAAgB,EACzB,aAAa,EAAE,MAAM,GACpB,SAAS,GAAG,IAAI,CAgClB;AAGD,wBAAsB,YAAY,CAChC,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,gBAAgB,EACzB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAgOxC"}
|