kibi-cli 2.29.0 → 2.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-operation-metadata.d.ts +8 -8
- package/dist/cli-operation-metadata.js +8 -8
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +35 -2
- package/dist/commands/check-certificates.d.ts +52 -0
- package/dist/commands/check-certificates.d.ts.map +1 -0
- package/dist/commands/check-certificates.js +163 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +4 -0
- package/dist/commands/discovery-table.d.ts.map +1 -1
- package/dist/commands/discovery-table.js +14 -2
- package/dist/commands/report.js +3 -3
- package/dist/commands/signoff.d.ts +37 -0
- package/dist/commands/signoff.d.ts.map +1 -0
- package/dist/commands/signoff.js +155 -0
- package/dist/operations/modeling/predicate-applicability.d.ts +5 -1
- package/dist/operations/modeling/predicate-applicability.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applicability.js +35 -2
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.js +3 -1
- package/dist/operations/mutation/contradictions.d.ts +7 -5
- package/dist/operations/mutation/contradictions.d.ts.map +1 -1
- package/dist/operations/mutation/contradictions.js +8 -6
- package/dist/operations/mutation/source-authoring.d.ts +15 -0
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +19 -7
- package/dist/operations/mutation/types.d.ts +5 -0
- package/dist/operations/mutation/types.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.d.ts +14 -0
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +42 -36
- package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
- package/dist/operations/mutation/validate-upsert.js +61 -37
- package/dist/operations/planning/apply-plan.js +5 -5
- package/dist/operations/proof/baseline-diff.d.ts +1 -1
- package/dist/operations/proof/baseline-diff.js +1 -1
- package/dist/operations/proof/impact.d.ts +10 -4
- package/dist/operations/proof/impact.d.ts.map +1 -1
- package/dist/operations/proof/impact.js +27 -7
- package/dist/public/diagnostic-usage.js +2 -2
- package/dist/public/operations/catalog.d.ts +31 -10
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +2 -0
- package/dist/public/operations/specs/bootstrap.d.ts +1 -1
- package/dist/public/operations/specs/bootstrap.js +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
- package/dist/public/operations/specs/check-rules.generated.js +3 -1
- package/dist/public/operations/specs/check.d.ts +1 -1
- package/dist/public/operations/specs/composite.d.ts +1 -1
- package/dist/public/operations/specs/composite.js +1 -1
- package/dist/public/operations/specs/discovery.d.ts +1 -1
- package/dist/public/operations/specs/discovery.js +1 -1
- package/dist/public/operations/specs/impact-review-preparation.d.ts +2 -1
- package/dist/public/operations/specs/impact-review-preparation.d.ts.map +1 -1
- package/dist/public/operations/specs/impact-review-preparation.js +2 -1
- package/dist/public/operations/specs/planning.d.ts +1 -1
- package/dist/public/operations/specs/planning.js +1 -1
- package/dist/public/operations/specs/reporting.d.ts +25 -5
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +102 -26
- package/dist/public/skills/kibi-commit-review/SKILL.md +125 -0
- package/dist/public/skills/kibi-commit-review/resources/staged-gate.md +98 -0
- package/dist/public/skills/kibi-decisions/SKILL.md +130 -0
- package/dist/public/skills/kibi-decisions/resources/decision-records.md +142 -0
- package/dist/public/skills/kibi-decisions/resources/signoff-views.md +66 -0
- package/dist/public/skills/kibi-freshness/SKILL.md +3 -1
- package/dist/public/skills/kibi-traceability/SKILL.md +4 -0
- package/dist/public/skills/kibi-usage/SKILL.md +21 -16
- package/dist/public/skills/kibi-usage/resources/proof.md +36 -4
- package/dist/public/skills/kibi-usage/resources/workflows.md +1 -1
- package/dist/report/html-report.css +11 -4
- package/dist/report/html-report.d.ts +2 -2
- package/dist/report/html-report.d.ts.map +1 -1
- package/dist/report/html-report.js +27 -21
- package/dist/report/report-view.d.ts +2 -2
- package/dist/report/report-view.js +2 -2
- package/dist/signoff/collect.d.ts +39 -0
- package/dist/signoff/collect.d.ts.map +1 -0
- package/dist/signoff/collect.js +402 -0
- package/dist/signoff/html.d.ts +4 -0
- package/dist/signoff/html.d.ts.map +1 -0
- package/dist/signoff/html.js +210 -0
- package/dist/signoff/markdown.d.ts +20 -0
- package/dist/signoff/markdown.d.ts.map +1 -0
- package/dist/signoff/markdown.js +203 -0
- package/dist/signoff/model.d.ts +139 -0
- package/dist/signoff/model.d.ts.map +1 -0
- package/dist/signoff/model.js +142 -0
- package/dist/traceability/staged-consistency.d.ts.map +1 -1
- package/dist/traceability/staged-consistency.js +3 -1
- package/dist/utils/rule-registry.generated.d.ts +10 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +12 -0
- package/package.json +2 -2
- package/src/public/diagnostic-usage.ts +3 -3
- package/src/public/operations/contracts.ts +2 -0
- package/src/public/operations/specs/bootstrap.ts +1 -1
- package/src/public/operations/specs/check-rules.generated.ts +3 -1
- package/src/public/operations/specs/composite.ts +1 -1
- package/src/public/operations/specs/discovery.ts +1 -1
- package/src/public/operations/specs/impact-review-preparation.ts +3 -1
- package/src/public/operations/specs/planning.ts +1 -1
- package/src/public/operations/specs/reporting.ts +114 -26
- package/src/public/skills/kibi-commit-review/SKILL.md +125 -0
- package/src/public/skills/kibi-commit-review/resources/staged-gate.md +98 -0
- package/src/public/skills/kibi-decisions/SKILL.md +130 -0
- package/src/public/skills/kibi-decisions/resources/decision-records.md +142 -0
- package/src/public/skills/kibi-decisions/resources/signoff-views.md +66 -0
- package/src/public/skills/kibi-freshness/SKILL.md +3 -1
- package/src/public/skills/kibi-traceability/SKILL.md +4 -0
- package/src/public/skills/kibi-usage/SKILL.md +21 -16
- package/src/public/skills/kibi-usage/resources/proof.md +36 -4
- package/src/public/skills/kibi-usage/resources/workflows.md +1 -1
- package/templates/github/kibi-badge.yml +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// implements REQ-kibi-operation-interface-parity
|
|
2
|
+
import { codedErrorOf } from "../../cli-errors.js";
|
|
2
3
|
import { escapeAtom } from "../../prolog/codec.js";
|
|
3
|
-
import { loadEntities } from "../../public/operations/discovery-entities.js";
|
|
4
4
|
import { entityIdStyleWarnings } from "../../utils/entity-id-style.js";
|
|
5
5
|
import { entityContextWarnings } from "./context-warning.js";
|
|
6
6
|
import { buildUpsertContradictionPreviewGoal, buildWhatIfAnalysisGoal, formatUpsertError, } from "./contradictions.js";
|
|
7
7
|
import { validateRelationshipSources } from "./relationships.js";
|
|
8
|
-
import { canonicalSourcePath } from "./source-authoring.js";
|
|
8
|
+
import { canonicalSourcePath, renderSourceWrite } from "./source-authoring.js";
|
|
9
9
|
import { validateSymbolGranularity } from "./symbol-granularity.js";
|
|
10
|
-
import { analyzeUpsertSemantics, validateAppendOnlyProofReceipts, validateUpsertForCommit, } from "./upsert.js";
|
|
10
|
+
import { analyzeUpsertSemantics, sourceWriteScope, validateAppendOnlyProofReceipts, validateUpsertForCommit, } from "./upsert.js";
|
|
11
11
|
import { validateUpsertInput } from "./validation.js";
|
|
12
12
|
import { symbolCoverageWarnings } from "./warnings.js";
|
|
13
13
|
import { isBlockingWitness, parseWhatIfAnalysis } from "./what-if.js";
|
|
@@ -18,49 +18,53 @@ async function entityExists(prolog, id) {
|
|
|
18
18
|
}
|
|
19
19
|
// implements REQ-kibi-operation-interface-parity, REQ-kb-entity-body-context
|
|
20
20
|
/**
|
|
21
|
-
* The authored document a real kb_upsert would update, resolved
|
|
22
|
-
* write's own rules (
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* write
|
|
21
|
+
* The authored document a real kb_upsert would update, resolved and rendered
|
|
22
|
+
* with the write's own rules (sourceWriteScope and renderSourceWrite) but
|
|
23
|
+
* never written. A path or format the write would refuse
|
|
24
|
+
* (DOCUMENT_PATH_REQUIRED, SOURCE_PATH_INVALID, SOURCE_FORMAT_UNSUPPORTED)
|
|
25
|
+
* throws the write's own error. The preview entity's `source` is the runtime
|
|
26
|
+
* marker, so the returned path lets the context warning judge the existing
|
|
27
|
+
* body the write preserves. Undefined when the write would not touch a
|
|
28
|
+
* document.
|
|
26
29
|
*/
|
|
27
|
-
async function
|
|
28
|
-
|
|
30
|
+
async function previewSourceWrite(input, entity, context) {
|
|
31
|
+
const fs = context.fs;
|
|
32
|
+
if (fs === undefined || context.sourceFirst === false)
|
|
29
33
|
return undefined;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}))[0];
|
|
38
|
-
const existingSource = typeof existing?.source === "string" ? existing.source : undefined;
|
|
39
|
-
if (input.document === undefined &&
|
|
40
|
-
existing !== undefined &&
|
|
41
|
-
!existingSource?.match(/\.(?:md|mdx|ya?ml|json)$/i)) {
|
|
34
|
+
if (context.prolog === undefined) {
|
|
35
|
+
// No store, so no write either: only locate the document for the
|
|
36
|
+
// context warning.
|
|
37
|
+
try {
|
|
38
|
+
return canonicalSourcePath(context, input, entity);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
42
41
|
return undefined;
|
|
43
42
|
}
|
|
44
|
-
return canonicalSourcePath(context, input, entity, existing);
|
|
45
43
|
}
|
|
46
|
-
|
|
44
|
+
const scope = await sourceWriteScope(input, context);
|
|
45
|
+
if (scope === null)
|
|
47
46
|
return undefined;
|
|
48
|
-
}
|
|
47
|
+
const { relative } = await renderSourceWrite(input, entity, scope.existing, {
|
|
48
|
+
...context,
|
|
49
|
+
fs,
|
|
50
|
+
});
|
|
51
|
+
return relative;
|
|
49
52
|
}
|
|
50
53
|
// implements REQ-kibi-operation-interface-parity, REQ-kibi-truthful-consistency
|
|
51
54
|
/**
|
|
52
|
-
* The commit
|
|
53
|
-
* copy of the store
|
|
54
|
-
*
|
|
55
|
-
*
|
|
55
|
+
* The commit goal's own refusal rules, run against a staged and rolled-back
|
|
56
|
+
* copy of the store for every entity type: a relationship whose endpoint
|
|
57
|
+
* does not exist, an invalid relationship direction, a symbol mixing
|
|
58
|
+
* executable_for with implements/covered_by, and the requirement
|
|
59
|
+
* contradiction check (only a `req` commit runs it, and
|
|
60
|
+
* `_skipContradictionCheck` skips it at commit and here alike). A refusal
|
|
61
|
+
* carries the same message the commit would raise.
|
|
56
62
|
*/
|
|
57
|
-
async function
|
|
58
|
-
if (input.type !== "req" || input._skipContradictionCheck === true)
|
|
59
|
-
return;
|
|
63
|
+
async function previewCommit(prolog, input, entity, relationships) {
|
|
60
64
|
const preview = await prolog.query(buildUpsertContradictionPreviewGoal({
|
|
61
65
|
entity,
|
|
62
66
|
relationships,
|
|
63
|
-
skipContradictionCheck:
|
|
67
|
+
skipContradictionCheck: input._skipContradictionCheck === true,
|
|
64
68
|
}));
|
|
65
69
|
if (!preview.success) {
|
|
66
70
|
throw new Error(formatUpsertError(input.id, preview.error, preview.errorRecord));
|
|
@@ -167,6 +171,12 @@ async function validateWithoutStore(input, context) {
|
|
|
167
171
|
});
|
|
168
172
|
return { entity: validated.entity, semantic };
|
|
169
173
|
}
|
|
174
|
+
function isModuleLoadFailure(error) {
|
|
175
|
+
if (!(error instanceof Error))
|
|
176
|
+
return false;
|
|
177
|
+
const code = error.code;
|
|
178
|
+
return code === "MODULE_NOT_FOUND" || code === "ERR_MODULE_NOT_FOUND";
|
|
179
|
+
}
|
|
170
180
|
// implements REQ-kibi-operation-interface-parity, REQ-kibi-truthful-consistency
|
|
171
181
|
/**
|
|
172
182
|
* kb_upsert dryRun:true (and the former kb_validate_upsert preflight). With a
|
|
@@ -181,14 +191,20 @@ export async function executeValidateUpsert(input, context) {
|
|
|
181
191
|
let whatIf;
|
|
182
192
|
let stagedFacts;
|
|
183
193
|
let relationships = input.relationships ?? [];
|
|
194
|
+
let targetPath;
|
|
184
195
|
const { entity, semantic } = context.prolog !== undefined
|
|
185
196
|
? await stagePlannedFacts(input, context).then(async (facts) => {
|
|
186
197
|
const result = await validateUpsertForCommit(input, context, facts === null ? {} : { staged: facts.staged });
|
|
187
|
-
// The
|
|
188
|
-
//
|
|
198
|
+
// The write publishes the authored document before its commit
|
|
199
|
+
// goal; render it (without writing) in the same order, so a
|
|
200
|
+
// source refusal surfaces here exactly as the write raises it.
|
|
201
|
+
targetPath = await previewSourceWrite(input, result.validated.entity, context);
|
|
202
|
+
// The commit goal refuses missing relationship endpoints, mixed
|
|
203
|
+
// symbol roles and requirement contradictions after the
|
|
204
|
+
// validations above; a dry run previews that goal as well, so
|
|
189
205
|
// "valid" means the commit would not refuse the write.
|
|
190
206
|
if (facts === null) {
|
|
191
|
-
await
|
|
207
|
+
await previewCommit(context.prolog, input, result.validated.entity, result.validated.relationships);
|
|
192
208
|
}
|
|
193
209
|
else {
|
|
194
210
|
stagedFacts = [...facts.staged.entities.keys()];
|
|
@@ -201,6 +217,8 @@ export async function executeValidateUpsert(input, context) {
|
|
|
201
217
|
};
|
|
202
218
|
})
|
|
203
219
|
: await validateWithoutStore(input, context);
|
|
220
|
+
if (context.prolog === undefined)
|
|
221
|
+
targetPath = await previewSourceWrite(input, entity, context);
|
|
204
222
|
// Style warnings apply only to entities this upsert would create, so the
|
|
205
223
|
// existence read happens only when the ID actually has a style issue.
|
|
206
224
|
const candidateIdStyleWarnings = entityIdStyleWarnings({
|
|
@@ -225,7 +243,7 @@ export async function executeValidateUpsert(input, context) {
|
|
|
225
243
|
...coverageWarnings,
|
|
226
244
|
...idStyleWarnings,
|
|
227
245
|
...entityContextWarnings(input, entity, context.workspaceRoot, {
|
|
228
|
-
targetPath
|
|
246
|
+
targetPath,
|
|
229
247
|
}),
|
|
230
248
|
],
|
|
231
249
|
semanticAdvisor: semantic.receipt,
|
|
@@ -247,13 +265,19 @@ export async function executeValidateUpsert(input, context) {
|
|
|
247
265
|
};
|
|
248
266
|
}
|
|
249
267
|
catch (error) {
|
|
268
|
+
// A module that fails to load is a broken installation, not a property of
|
|
269
|
+
// the payload: report it as a tool failure instead of an invalid payload.
|
|
270
|
+
if (isModuleLoadFailure(error))
|
|
271
|
+
throw error;
|
|
250
272
|
const message = error instanceof Error ? error.message : String(error);
|
|
273
|
+
const errorCode = codedErrorOf(error)?.code;
|
|
251
274
|
const payload = {
|
|
252
275
|
valid: false,
|
|
253
276
|
errors: [message],
|
|
254
277
|
warnings: [],
|
|
255
278
|
semanticAdvisor: null,
|
|
256
279
|
normalizedPreview: null,
|
|
280
|
+
...(errorCode !== undefined ? { errorCode } : {}),
|
|
257
281
|
};
|
|
258
282
|
return {
|
|
259
283
|
content: [
|
|
@@ -2265,13 +2265,13 @@ async function applyMigrationPlan(args, context, onCommitted = () => undefined)
|
|
|
2265
2265
|
: finalStatus.proofSnapshotDirty === false
|
|
2266
2266
|
? "fresh"
|
|
2267
2267
|
: "not_evaluated";
|
|
2268
|
-
const
|
|
2268
|
+
const tested = coverageSummary?.proofTested;
|
|
2269
2269
|
const missing = coverageSummary?.proofMissing;
|
|
2270
|
-
const proofState = typeof
|
|
2270
|
+
const proofState = typeof tested !== "number" || typeof missing !== "number"
|
|
2271
2271
|
? "not_evaluated"
|
|
2272
|
-
:
|
|
2273
|
-
? "
|
|
2274
|
-
:
|
|
2272
|
+
: tested > 0 && missing === 0
|
|
2273
|
+
? "tested"
|
|
2274
|
+
: tested > 0
|
|
2275
2275
|
? "mixed"
|
|
2276
2276
|
: "unresolved";
|
|
2277
2277
|
const payload = {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
(at your option) any later version.
|
|
9
9
|
*/
|
|
10
10
|
// implements REQ-kibi-verification-evidence-contract
|
|
11
|
-
export const PROOF_BASELINE_VERSION = "kibi.proof-baseline.
|
|
11
|
+
export const PROOF_BASELINE_VERSION = "kibi.proof-baseline.v3";
|
|
12
12
|
function asStringArray(value) {
|
|
13
13
|
if (!Array.isArray(value))
|
|
14
14
|
return [];
|
|
@@ -5,8 +5,8 @@ export type ProofBaselineFile = {
|
|
|
5
5
|
readonly version?: string;
|
|
6
6
|
readonly mode?: string;
|
|
7
7
|
readonly currentRequirements?: number;
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
8
|
+
readonly proofTested?: number;
|
|
9
|
+
readonly currentUntested?: number;
|
|
10
10
|
readonly trackedGaps?: Record<string, number>;
|
|
11
11
|
readonly requirements?: RequirementFingerprints;
|
|
12
12
|
};
|
|
@@ -14,8 +14,8 @@ export type ProofImpactResult = {
|
|
|
14
14
|
readonly comparisonTarget: typeof COMMITTED_BASELINE_PATH;
|
|
15
15
|
readonly baselineVersion: string;
|
|
16
16
|
readonly currentRequirements: number;
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
17
|
+
readonly proofTested: number;
|
|
18
|
+
readonly currentUntested: number;
|
|
19
19
|
readonly changes: ReturnType<typeof diffFingerprints>;
|
|
20
20
|
};
|
|
21
21
|
export type ReadCommittedFile = (workspaceRoot: string, relativePath: string) => string | Promise<string>;
|
|
@@ -27,6 +27,12 @@ export type ProofImpactExecuteOptions = {
|
|
|
27
27
|
};
|
|
28
28
|
export declare function readCommittedHeadFile(workspaceRoot: string, relativePath: string): string;
|
|
29
29
|
export declare function loadCommittedBaseline(workspaceRoot: string, readCommittedFile?: ReadCommittedFile): Promise<ProofBaselineFile>;
|
|
30
|
+
/**
|
|
31
|
+
* A baseline committed before kibi.proof-baseline.v3 records a fully tested
|
|
32
|
+
* requirement as `proven`. Read it as `tested`, so the comparison shows real
|
|
33
|
+
* changes instead of a rename on every row.
|
|
34
|
+
*/
|
|
35
|
+
export declare function upgradeBaselineStatuses(baseline: ProofBaselineFile): ProofBaselineFile;
|
|
30
36
|
/** Diagnostic only: successful evaluation always exits 0. Ratchet lives in check-proof-baseline.mjs. */
|
|
31
37
|
export declare function proofImpactExitCode(_result: ProofImpactResult): 0;
|
|
32
38
|
export declare function buildProofImpact(baseline: ProofBaselineFile, coverage: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impact.d.ts","sourceRoot":"","sources":["../../../src/operations/proof/impact.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,EACL,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"impact.d.ts","sourceRoot":"","sources":["../../../src/operations/proof/impact.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,uBAAuB,EAC5B,gBAAgB,EAGjB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,uBAAuB,CAAC;IAC1D,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC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ACzB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC;IACT,MAAM,EAAE,iBAAiB,CAAC;IAC1B,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAmBD"}
|
|
@@ -58,12 +58,32 @@ export function readCommittedHeadFile(workspaceRoot, relativePath) {
|
|
|
58
58
|
// implements REQ-kibi-verification-evidence-contract
|
|
59
59
|
export async function loadCommittedBaseline(workspaceRoot, readCommittedFile = readCommittedHeadFile) {
|
|
60
60
|
const raw = await readCommittedFile(workspaceRoot, COMMITTED_BASELINE_PATH);
|
|
61
|
+
let parsed;
|
|
61
62
|
try {
|
|
62
|
-
|
|
63
|
+
parsed = JSON.parse(raw);
|
|
63
64
|
}
|
|
64
65
|
catch {
|
|
65
66
|
throw new Error(`proof impact: HEAD:${COMMITTED_BASELINE_PATH} is not valid JSON`);
|
|
66
67
|
}
|
|
68
|
+
return upgradeBaselineStatuses(parsed);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A baseline committed before kibi.proof-baseline.v3 records a fully tested
|
|
72
|
+
* requirement as `proven`. Read it as `tested`, so the comparison shows real
|
|
73
|
+
* changes instead of a rename on every row.
|
|
74
|
+
*/
|
|
75
|
+
// implements REQ-kibi-evidence-levels
|
|
76
|
+
export function upgradeBaselineStatuses(baseline) {
|
|
77
|
+
if (baseline.requirements === undefined)
|
|
78
|
+
return baseline;
|
|
79
|
+
const requirements = {};
|
|
80
|
+
for (const [id, entry] of Object.entries(baseline.requirements)) {
|
|
81
|
+
requirements[id] =
|
|
82
|
+
entry?.proofStatus === "proven"
|
|
83
|
+
? { ...entry, proofStatus: "tested" }
|
|
84
|
+
: entry;
|
|
85
|
+
}
|
|
86
|
+
return { ...baseline, requirements };
|
|
67
87
|
}
|
|
68
88
|
/** Diagnostic only: successful evaluation always exits 0. Ratchet lives in check-proof-baseline.mjs. */
|
|
69
89
|
export function proofImpactExitCode(_result) {
|
|
@@ -77,8 +97,8 @@ export function buildProofImpact(baseline, coverage) {
|
|
|
77
97
|
const summary = coverage.summary ?? {};
|
|
78
98
|
const proofNotApplicable = asNumber(summary.proofNotApplicable);
|
|
79
99
|
const total = asNumber(summary.total);
|
|
80
|
-
const
|
|
81
|
-
const
|
|
100
|
+
const proofTested = asNumber(summary.proofTested);
|
|
101
|
+
const currentUntested = asNumber(summary.proofMissing) + asNumber(summary.proofUnresolved);
|
|
82
102
|
const current = fingerprintRequirements(rows);
|
|
83
103
|
const changes = diffFingerprints(baseline.requirements, current);
|
|
84
104
|
return {
|
|
@@ -87,8 +107,8 @@ export function buildProofImpact(baseline, coverage) {
|
|
|
87
107
|
comparisonTarget: COMMITTED_BASELINE_PATH,
|
|
88
108
|
baselineVersion: baseline.version ?? "unknown",
|
|
89
109
|
currentRequirements: total - proofNotApplicable,
|
|
90
|
-
|
|
91
|
-
|
|
110
|
+
proofTested,
|
|
111
|
+
currentUntested,
|
|
92
112
|
changes,
|
|
93
113
|
},
|
|
94
114
|
};
|
|
@@ -99,8 +119,8 @@ export function renderProofImpact(result, rows) {
|
|
|
99
119
|
`Proof impact compared to committed ${result.comparisonTarget}`,
|
|
100
120
|
`baseline version: ${result.baselineVersion}`,
|
|
101
121
|
`current requirements: ${result.currentRequirements}`,
|
|
102
|
-
`
|
|
103
|
-
`
|
|
122
|
+
`proofTested: ${result.proofTested}`,
|
|
123
|
+
`currentUntested: ${result.currentUntested}`,
|
|
104
124
|
`changed requirements: ${result.changes.length}`,
|
|
105
125
|
"",
|
|
106
126
|
];
|
|
@@ -103,7 +103,7 @@ function appendCoverageFields(fields, args, result) {
|
|
|
103
103
|
const scope = isRecord(repairPlan?.scope) ? repairPlan.scope : undefined;
|
|
104
104
|
fields.coverage_by = typeof args.by === "string" ? args.by : "req";
|
|
105
105
|
fields.coverage_requirement_count = Number(summary.total ?? rows.length);
|
|
106
|
-
fields.
|
|
106
|
+
fields.coverage_tested_count = Number(summary.proofTested ?? 0);
|
|
107
107
|
fields.coverage_proof_missing_count = Number(summary.proofMissing ?? 0);
|
|
108
108
|
fields.coverage_proof_gap_count = gapCodes.length;
|
|
109
109
|
fields.coverage_gap_codes = [...new Set(gapCodes)].sort();
|
|
@@ -160,7 +160,7 @@ export function deriveDiagnosticUsageFields(tool, args, telemetry, result) {
|
|
|
160
160
|
}
|
|
161
161
|
if (tool === "kb_coverage" && structured) {
|
|
162
162
|
appendCoverageFields(fields, args, structured);
|
|
163
|
-
fields.result_summary = `${String(fields.
|
|
163
|
+
fields.result_summary = `${String(fields.coverage_tested_count)} tested; ${String(fields.coverage_proof_gap_count)} proof gaps`;
|
|
164
164
|
}
|
|
165
165
|
if (tool === "kb_semantic_advisor" && structured) {
|
|
166
166
|
appendSemanticFields(fields, structured.receipt);
|
|
@@ -308,7 +308,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
308
308
|
}, {
|
|
309
309
|
readonly name: "kb_status";
|
|
310
310
|
readonly cliName: "status";
|
|
311
|
-
readonly description: "Report current branch, KB snapshot, freshness metadata, schema status, and a typed kibi.migration-plan.v2 action graph. Read-only status inspection with no mutation side effects; damaged stores are diagnosed without starting the engine.";
|
|
311
|
+
readonly description: "Report current branch, KB snapshot, freshness metadata, schema status, and a typed kibi.migration-plan.v2 action graph. Call it first to orient on a branch or after a failed call; use kb_check for validation findings and kb_coverage for proof status. Read-only status inspection with no mutation side effects; damaged stores are diagnosed without starting the engine.";
|
|
312
312
|
readonly businessInputSchema: {
|
|
313
313
|
readonly type: "object";
|
|
314
314
|
readonly properties: {};
|
|
@@ -320,42 +320,49 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
320
320
|
}, {
|
|
321
321
|
readonly name: "kb_find_gaps";
|
|
322
322
|
readonly cliName: "find-gaps";
|
|
323
|
-
readonly description: "
|
|
323
|
+
readonly description: "List KB entities by the relationships they lack or have. Use for questions like which requirements lack scenarios or tests; all filters must match, and a relationship counts in either direction. Use kb_coverage instead for proof status and repair plans, and kb_check for rule violations. No mutation side effects.";
|
|
324
324
|
readonly businessInputSchema: {
|
|
325
325
|
readonly type: "object";
|
|
326
326
|
readonly properties: {
|
|
327
327
|
readonly type: {
|
|
328
328
|
readonly type: "string";
|
|
329
329
|
readonly enum: readonly ["req", "scenario", "test", "adr", "flag", "event", "symbol", "fact"];
|
|
330
|
+
readonly description: "Only report entities of this type. Omit for all types.";
|
|
330
331
|
};
|
|
331
332
|
readonly missingRelationships: {
|
|
332
333
|
readonly type: "array";
|
|
333
334
|
readonly items: {
|
|
334
335
|
readonly type: "string";
|
|
335
336
|
};
|
|
337
|
+
readonly description: "Relationship types the entity must have none of, in either direction, for example specified_by or verified_by. verified_by and validates satisfy each other.";
|
|
336
338
|
};
|
|
337
339
|
readonly presentRelationships: {
|
|
338
340
|
readonly type: "array";
|
|
339
341
|
readonly items: {
|
|
340
342
|
readonly type: "string";
|
|
341
343
|
};
|
|
344
|
+
readonly description: "Relationship types the entity must have at least one of each, in either direction.";
|
|
342
345
|
};
|
|
343
346
|
readonly tags: {
|
|
344
347
|
readonly type: "array";
|
|
345
348
|
readonly items: {
|
|
346
349
|
readonly type: "string";
|
|
347
350
|
};
|
|
351
|
+
readonly description: "Keep entities carrying any of these metadata tags. Bootstrap provenance stubs appear in rows only when this names bootstrap:provenance-stub.";
|
|
348
352
|
};
|
|
349
353
|
readonly sourceFile: {
|
|
350
354
|
readonly type: "string";
|
|
355
|
+
readonly description: "Keep entities whose source path contains this substring.";
|
|
351
356
|
};
|
|
352
357
|
readonly limit: {
|
|
353
358
|
readonly type: "integer";
|
|
354
359
|
readonly default: 100;
|
|
360
|
+
readonly description: "Maximum rows to return; count reports the full total.";
|
|
355
361
|
};
|
|
356
362
|
readonly offset: {
|
|
357
363
|
readonly type: "integer";
|
|
358
364
|
readonly default: 0;
|
|
365
|
+
readonly description: "Zero-based row offset for pagination.";
|
|
359
366
|
};
|
|
360
367
|
};
|
|
361
368
|
};
|
|
@@ -365,7 +372,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
365
372
|
}, {
|
|
366
373
|
readonly name: "kb_coverage";
|
|
367
374
|
readonly cliName: "coverage";
|
|
368
|
-
readonly description: "Generate curated structural coverage and conservative end-to-end requirement proof reports for requirements, symbols, or grouped types. Reports include the compatible repair plan plus typed kibi.migration-plan.v2 actions; semantic and E2E actions remain review/execution work. Paginated plans identify incomplete scope and no mutation occurs.";
|
|
375
|
+
readonly description: "Generate curated structural coverage and conservative end-to-end requirement proof reports for requirements, symbols, or grouped types. Use it to ask which requirements are tested end to end, how strong each requirement's evidence is (evidenceLevel: proved, tested, asserted or unverified), and what blocks the rest; use kb_find_gaps for a plain list of missing links and kb_check for rule violations. Reports include the compatible repair plan plus typed kibi.migration-plan.v2 actions; semantic and E2E actions remain review/execution work. Paginated plans identify incomplete scope and no mutation occurs.";
|
|
369
376
|
readonly businessInputSchema: {
|
|
370
377
|
readonly type: "object";
|
|
371
378
|
readonly properties: {
|
|
@@ -373,36 +380,42 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
373
380
|
readonly type: "string";
|
|
374
381
|
readonly enum: readonly ["req", "symbol", "type"];
|
|
375
382
|
readonly default: "req";
|
|
383
|
+
readonly description: "Report shape: req gives per-requirement proof status and a repair plan, symbol gives per-symbol ownership coverage, type gives counts per entity type.";
|
|
376
384
|
};
|
|
377
385
|
readonly tags: {
|
|
378
386
|
readonly type: "array";
|
|
379
387
|
readonly items: {
|
|
380
388
|
readonly type: "string";
|
|
381
389
|
};
|
|
390
|
+
readonly description: "Keep rows for entities carrying any of these metadata tags.";
|
|
382
391
|
};
|
|
383
392
|
readonly includePassing: {
|
|
384
393
|
readonly type: "boolean";
|
|
385
394
|
readonly default: false;
|
|
395
|
+
readonly description: "Also return rows that are already tested or not applicable. By default only rows that still need repair are returned.";
|
|
386
396
|
};
|
|
387
397
|
readonly statuses: {
|
|
388
398
|
readonly type: "array";
|
|
389
399
|
readonly items: {
|
|
390
400
|
readonly type: "string";
|
|
391
|
-
readonly enum: readonly ["
|
|
401
|
+
readonly enum: readonly ["tested", "missing", "unresolved", "not_applicable"];
|
|
392
402
|
};
|
|
393
403
|
readonly description: "Requirement proof-status filter (req mode): include only rows whose proofStatus is listed. Selecting statuses implies include-passing; not_applicable rows carry their typed applicability reason in proofStages.applicability.reason. The summary always reflects the whole KB.";
|
|
394
404
|
};
|
|
395
405
|
readonly includeTransitive: {
|
|
396
406
|
readonly type: "boolean";
|
|
397
407
|
readonly default: true;
|
|
408
|
+
readonly description: "Count symbol coverage reached transitively through linked entities, not only direct links.";
|
|
398
409
|
};
|
|
399
410
|
readonly limit: {
|
|
400
411
|
readonly type: "integer";
|
|
401
412
|
readonly default: 100;
|
|
413
|
+
readonly description: "Maximum rows to return. When the repair plan reports scope.complete false, rerun with offset 0 and a larger limit.";
|
|
402
414
|
};
|
|
403
415
|
readonly offset: {
|
|
404
416
|
readonly type: "integer";
|
|
405
417
|
readonly default: 0;
|
|
418
|
+
readonly description: "Zero-based row offset for pagination.";
|
|
406
419
|
};
|
|
407
420
|
readonly includeMigrationPreview: {
|
|
408
421
|
readonly type: "boolean";
|
|
@@ -444,7 +457,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
444
457
|
}, {
|
|
445
458
|
readonly name: "kb_graph";
|
|
446
459
|
readonly cliName: "graph";
|
|
447
|
-
readonly description: "Run bounded graph traversal from one or more seed IDs across curated relationship types. No mutation side effects.";
|
|
460
|
+
readonly description: "Run bounded graph traversal from one or more seed IDs across curated relationship types and return the nodes and edges reached. Use it to follow links from IDs you already have, such as a requirement to its scenarios and tests or a symbol to the requirements it implements; use kb_query to find entities by filter and kb_search to ask a question. Traversal stops at depth, maxNodes or maxEdges and then sets truncated. No mutation side effects.";
|
|
448
461
|
readonly businessInputSchema: {
|
|
449
462
|
readonly type: "object";
|
|
450
463
|
readonly required: readonly ["seedIds"];
|
|
@@ -454,37 +467,44 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
454
467
|
readonly items: {
|
|
455
468
|
readonly type: "string";
|
|
456
469
|
};
|
|
470
|
+
readonly description: "Entity IDs to start from, for example REQ-... or SCEN-.... Seeds are always returned as nodes.";
|
|
457
471
|
};
|
|
458
472
|
readonly relationships: {
|
|
459
473
|
readonly type: "array";
|
|
460
474
|
readonly items: {
|
|
461
475
|
readonly type: "string";
|
|
462
476
|
};
|
|
477
|
+
readonly description: "Relationship types to follow, for example specified_by, verified_by or implements. Omit to follow every relationship type.";
|
|
463
478
|
};
|
|
464
479
|
readonly direction: {
|
|
465
480
|
readonly type: "string";
|
|
466
481
|
readonly enum: readonly ["outgoing", "incoming", "both"];
|
|
467
482
|
readonly default: "outgoing";
|
|
483
|
+
readonly description: "outgoing follows links from each node, incoming follows links pointing at it, both does either.";
|
|
468
484
|
};
|
|
469
485
|
readonly depth: {
|
|
470
486
|
readonly type: "integer";
|
|
471
487
|
readonly default: 1;
|
|
472
488
|
readonly minimum: 1;
|
|
473
489
|
readonly maximum: 5;
|
|
490
|
+
readonly description: "Number of hops from the seeds.";
|
|
474
491
|
};
|
|
475
492
|
readonly entityTypes: {
|
|
476
493
|
readonly type: "array";
|
|
477
494
|
readonly items: {
|
|
478
495
|
readonly type: "string";
|
|
479
496
|
};
|
|
497
|
+
readonly description: "Keep only nodes of these types (req, scenario, test, adr, flag, event, symbol, fact) in the result, and the edges between them. Traversal still passes through other types.";
|
|
480
498
|
};
|
|
481
499
|
readonly maxNodes: {
|
|
482
500
|
readonly type: "integer";
|
|
483
501
|
readonly default: 200;
|
|
502
|
+
readonly description: "Stop and set truncated once this many nodes are reached.";
|
|
484
503
|
};
|
|
485
504
|
readonly maxEdges: {
|
|
486
505
|
readonly type: "integer";
|
|
487
506
|
readonly default: 500;
|
|
507
|
+
readonly description: "Stop and set truncated once this many edges are reached.";
|
|
488
508
|
};
|
|
489
509
|
};
|
|
490
510
|
};
|
|
@@ -723,7 +743,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
723
743
|
}, {
|
|
724
744
|
readonly name: "kb_model";
|
|
725
745
|
readonly cliName: "model";
|
|
726
|
-
readonly description: "Turn requirement prose into checkable structure without writing the KB. mode:analyze returns the semantic advisor receipt: the clause ledger, what is grounded, what is ambiguous and suggested modeling (pass clauses for compound prose and optional typed kibi.logic.v1 interpretations). mode:requirement converts one claim (subjectKey, propertyKey, operator, value, or typed logic) into a strict-lane write set and applyPlan. mode:predicates ranks ontology predicate schemas and returns an applicable predicate-fact plan only for reviewed bindings, otherwise an ontology-gap observation. With requirementId, mode:predicates also returns a hash-bound plan (fact write plus requires_predicate link) for kb_apply_plan, whose contradictionAnalysis is the what-if over the current KB; other returned plans apply with kb_upsert, and kb_upsert dryRun with plannedFacts previews a requirement before its facts exist.";
|
|
746
|
+
readonly description: "Turn requirement prose into checkable structure without writing the KB. Use it for one requirement's prose; to plan a whole change request use kb_compile_intent. mode:analyze returns the semantic advisor receipt: the clause ledger, what is grounded, what is ambiguous and suggested modeling (pass clauses for compound prose and optional typed kibi.logic.v1 interpretations). mode:requirement converts one claim (subjectKey, propertyKey, operator, value, or typed logic) into a strict-lane write set and applyPlan. mode:predicates ranks ontology predicate schemas and returns an applicable predicate-fact plan only for reviewed bindings, otherwise an ontology-gap observation. With requirementId, mode:predicates also returns a hash-bound plan (fact write plus requires_predicate link) for kb_apply_plan, whose contradictionAnalysis is the what-if over the current KB; other returned plans apply with kb_upsert, and kb_upsert dryRun with plannedFacts previews a requirement before its facts exist.";
|
|
727
747
|
readonly businessInputSchema: {
|
|
728
748
|
readonly type: "object";
|
|
729
749
|
readonly required: readonly ["mode", "text"];
|
|
@@ -741,7 +761,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
741
761
|
}, {
|
|
742
762
|
readonly name: "kb_plan_bootstrap";
|
|
743
763
|
readonly cliName: "plan-bootstrap";
|
|
744
|
-
readonly description: "Generate a deterministic, snapshot-bound kibi.bootstrap-plan.v1 for repository onboarding. Read-only analysis of the repository plus any declared knowledge sources and cited intent claims returns evidence, bounded context questions, exact dependency-ordered actions, a canonical plan hash, and no mutation side effects.";
|
|
764
|
+
readonly description: "Generate a deterministic, snapshot-bound kibi.bootstrap-plan.v1 for repository onboarding. Use it only to onboard a repository whose KB is empty or incomplete (the kibi-bootstrap skill drives it); for a change in an onboarded project use kb_compile_intent. Read-only analysis of the repository plus any declared knowledge sources and cited intent claims returns evidence, bounded context questions, exact dependency-ordered actions, a canonical plan hash, and no mutation side effects.";
|
|
745
765
|
readonly businessInputSchema: {
|
|
746
766
|
readonly type: "object";
|
|
747
767
|
readonly properties: {
|
|
@@ -1839,7 +1859,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
1839
1859
|
readonly type: "string";
|
|
1840
1860
|
readonly enum: readonly string[];
|
|
1841
1861
|
};
|
|
1842
|
-
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. 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.";
|
|
1862
|
+
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. 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.";
|
|
1843
1863
|
};
|
|
1844
1864
|
readonly sourceFiles: {
|
|
1845
1865
|
readonly type: "array";
|
|
@@ -1882,13 +1902,14 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
1882
1902
|
}, {
|
|
1883
1903
|
readonly name: "kb_prepare_impact_review";
|
|
1884
1904
|
readonly cliName: "prepare-impact-review";
|
|
1885
|
-
readonly description: "Prepare complete content-bound impact-review authoring inputs from the current staged snapshot or explicitly selected immutable Git commits. Returns strict reviewer schemas and an unauthored template; it does not decide, approve, sign, stage, or prove the review.";
|
|
1905
|
+
readonly description: "Prepare complete content-bound impact-review authoring inputs from the current staged snapshot or explicitly selected immutable Git commits. Use it when kb_check reports that changed files need an impact review; it does not plan KB changes. Returns strict reviewer schemas and an unauthored template; it does not decide, approve, sign, stage, or prove the review.";
|
|
1886
1906
|
readonly businessInputSchema: {
|
|
1887
1907
|
readonly type: "object";
|
|
1888
1908
|
readonly additionalProperties: false;
|
|
1889
1909
|
readonly required: readonly ["scope"];
|
|
1890
1910
|
readonly properties: {
|
|
1891
1911
|
readonly scope: {
|
|
1912
|
+
readonly description: "What to review: {\"kind\":\"staged\"} for the staged snapshot, or {\"kind\":\"diff\",\"baseCommit\":\"<sha>\",\"headCommit\":\"<sha>\"} with full commit hashes.";
|
|
1892
1913
|
readonly oneOf: readonly [{
|
|
1893
1914
|
readonly type: "object";
|
|
1894
1915
|
readonly additionalProperties: false;
|
|
@@ -1951,7 +1972,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
1951
1972
|
}, {
|
|
1952
1973
|
readonly name: "kb_compile_intent";
|
|
1953
1974
|
readonly cliName: "compile-intent";
|
|
1954
|
-
readonly description: "Compile complete change intent into a deterministic, snapshot-bound read-only plan. Reuses intent-aware discovery and semantic modeling, accounts for every proposition, reports contradiction witnesses, proposes traceability links, and emits dependency-ordered kb_upsert-style steps only for resolved typed claims. contradictionAnalysis.outcome is no_conflict only when the check could decide: an unmodeled proposition or a related current requirement without logic leaves it unresolved with reasons and reviewCandidates to compare and judge through conflictReviews. No mutation side effects.";
|
|
1975
|
+
readonly description: "Compile complete change intent into a deterministic, snapshot-bound read-only plan. Use it before editing code for a change request that may touch several requirements; use kb_model for one requirement's prose and kb_plan_bootstrap for first-time onboarding. Reuses intent-aware discovery and semantic modeling, accounts for every proposition, reports contradiction witnesses, proposes traceability links, and emits dependency-ordered kb_upsert-style steps only for resolved typed claims. contradictionAnalysis.outcome is no_conflict only when the check could decide: an unmodeled proposition or a related current requirement without logic leaves it unresolved with reasons and reviewCandidates to compare and judge through conflictReviews. No mutation side effects.";
|
|
1955
1976
|
readonly businessInputSchema: {
|
|
1956
1977
|
readonly type: "object";
|
|
1957
1978
|
readonly required: readonly ["intent", "mode"];
|
|
@@ -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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D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/public/operations/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC1B,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAsZpE;;uEAEuE;AACvE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,mBAAmB,GAC1B,mBAAmB,CAMrB;
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/public/operations/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC1B,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAsZpE;;uEAEuE;AACvE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,mBAAmB,GAC1B,mBAAmB,CAMrB;AAuaD,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAa3C,CAAC;AAmDF,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,EAClD,YAAY,EAAE,MAAM,GACnB,IAAI,CAIN;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,SAAS,0BAA0B,EAAE,CAoBvC"}
|
|
@@ -538,6 +538,7 @@ const BASE_DATA_SCHEMAS = {
|
|
|
538
538
|
warnings: valueArray,
|
|
539
539
|
semanticAdvisor: nullableJsonSchema(recordValue),
|
|
540
540
|
normalizedPreview: nullableJsonSchema(recordValue),
|
|
541
|
+
errorCode: stringValue,
|
|
541
542
|
stagedFacts: stringArray,
|
|
542
543
|
whatIf: recordValue,
|
|
543
544
|
}),
|
|
@@ -566,6 +567,7 @@ const BASE_DATA_SCHEMAS = {
|
|
|
566
567
|
warnings: valueArray,
|
|
567
568
|
semanticAdvisor: nullableJsonSchema(recordValue),
|
|
568
569
|
normalizedPreview: nullableJsonSchema(recordValue),
|
|
570
|
+
errorCode: stringValue,
|
|
569
571
|
stagedFacts: stringArray,
|
|
570
572
|
whatIf: recordValue,
|
|
571
573
|
dryRun: { const: true },
|
|
@@ -4,7 +4,7 @@ export { executePlanBootstrap } from "../../../operations/bootstrap/generate.js"
|
|
|
4
4
|
export declare const planBootstrapSpec: {
|
|
5
5
|
readonly name: "kb_plan_bootstrap";
|
|
6
6
|
readonly cliName: "plan-bootstrap";
|
|
7
|
-
readonly description: "Generate a deterministic, snapshot-bound kibi.bootstrap-plan.v1 for repository onboarding. Read-only analysis of the repository plus any declared knowledge sources and cited intent claims returns evidence, bounded context questions, exact dependency-ordered actions, a canonical plan hash, and no mutation side effects.";
|
|
7
|
+
readonly description: "Generate a deterministic, snapshot-bound kibi.bootstrap-plan.v1 for repository onboarding. Use it only to onboard a repository whose KB is empty or incomplete (the kibi-bootstrap skill drives it); for a change in an onboarded project use kb_compile_intent. Read-only analysis of the repository plus any declared knowledge sources and cited intent claims returns evidence, bounded context questions, exact dependency-ordered actions, a canonical plan hash, and no mutation side effects.";
|
|
8
8
|
readonly businessInputSchema: {
|
|
9
9
|
readonly type: "object";
|
|
10
10
|
readonly properties: {
|