kibi-cli 2.26.3 → 2.28.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 +1 -1
- package/dist/cli-operation-metadata.js +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +17 -2
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +2 -1
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +24 -0
- package/dist/commands/sync/persistence.d.ts +10 -0
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +24 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +5 -1
- package/dist/diagnostics.d.ts +6 -0
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics.js +25 -9
- package/dist/intent-search.d.ts +2 -0
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +5 -0
- package/dist/operations/bootstrap/activation.d.ts +6 -0
- package/dist/operations/bootstrap/activation.d.ts.map +1 -1
- package/dist/operations/bootstrap/activation.js +22 -0
- package/dist/operations/bootstrap/claim-restatement.d.ts +2 -0
- package/dist/operations/bootstrap/claim-restatement.d.ts.map +1 -1
- package/dist/operations/bootstrap/conflict-review.d.ts +24 -0
- package/dist/operations/bootstrap/conflict-review.d.ts.map +1 -0
- package/dist/operations/bootstrap/conflict-review.js +92 -0
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +18 -5
- package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance-actions.js +4 -1
- package/dist/operations/bootstrap/intent-claims.d.ts.map +1 -1
- package/dist/operations/bootstrap/intent-claims.js +1 -0
- package/dist/operations/bootstrap/presentation.d.ts.map +1 -1
- package/dist/operations/bootstrap/presentation.js +6 -2
- package/dist/operations/bootstrap/types.d.ts +7 -0
- package/dist/operations/bootstrap/types.d.ts.map +1 -1
- package/dist/operations/migration/entity-type.d.ts +35 -0
- package/dist/operations/migration/entity-type.d.ts.map +1 -0
- package/dist/operations/migration/entity-type.js +89 -0
- package/dist/operations/migration/schema6.d.ts.map +1 -1
- package/dist/operations/migration/schema6.js +32 -0
- package/dist/operations/mutation/symbol-granularity.d.ts +7 -1
- package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-granularity.js +46 -8
- package/dist/operations/mutation/upsert.d.ts +9 -1
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +46 -9
- package/dist/operations/mutation/validation.d.ts.map +1 -1
- package/dist/operations/mutation/validation.js +21 -0
- package/dist/operations/planning/compile-intent.d.ts +16 -0
- package/dist/operations/planning/compile-intent.d.ts.map +1 -1
- package/dist/operations/planning/compile-intent.js +118 -5
- package/dist/operations/planning/conflict-review.d.ts +69 -0
- package/dist/operations/planning/conflict-review.d.ts.map +1 -0
- package/dist/operations/planning/conflict-review.js +133 -0
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts +8 -0
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/ingestion-boundary.js +43 -2
- package/dist/public/impact/analyzer.d.ts.map +1 -1
- package/dist/public/impact/analyzer.js +26 -2
- package/dist/public/impact/requirement-statements.d.ts +29 -0
- package/dist/public/impact/requirement-statements.d.ts.map +1 -0
- package/dist/public/impact/requirement-statements.js +127 -0
- package/dist/public/operations/catalog.d.ts +26 -2
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/check-format-shared.d.ts +1 -1
- package/dist/public/operations/check-format-shared.d.ts.map +1 -1
- package/dist/public/operations/check-format-shared.js +19 -4
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +20 -13
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +14 -4
- package/dist/public/operations/result-envelope.d.ts +2 -0
- package/dist/public/operations/result-envelope.d.ts.map +1 -1
- package/dist/public/operations/result-envelope.js +21 -9
- package/dist/public/operations/specs/check.d.ts +1 -1
- package/dist/public/operations/specs/check.js +1 -1
- package/dist/public/operations/specs/planning.d.ts +25 -1
- package/dist/public/operations/specs/planning.d.ts.map +1 -1
- package/dist/public/operations/specs/planning.js +16 -1
- package/dist/public/skills/kibi-bootstrap/SKILL.md +2 -2
- package/dist/public/skills/kibi-usage/SKILL.md +11 -1
- package/dist/public/symbol-granularity.d.ts +5 -0
- package/dist/public/symbol-granularity.d.ts.map +1 -1
- package/dist/public/symbol-granularity.js +12 -3
- package/dist/traceability/staged-consistency.d.ts +1 -1
- package/dist/traceability/staged-consistency.d.ts.map +1 -1
- package/dist/traceability/staged-consistency.js +2 -2
- package/dist/traceability/staged-diagnostics.d.ts +1 -1
- package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
- package/dist/traceability/staged-entity-context.d.ts +18 -0
- package/dist/traceability/staged-entity-context.d.ts.map +1 -0
- package/dist/traceability/staged-entity-context.js +66 -0
- package/dist/utils/config.d.ts +8 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +10 -0
- package/package.json +2 -2
- package/src/public/impact/analyzer.ts +38 -2
- package/src/public/impact/requirement-statements.ts +171 -0
- package/src/public/operations/check-format-shared.ts +27 -4
- package/src/public/operations/discovery-executors.ts +20 -13
- package/src/public/operations/migration-plan.ts +24 -6
- package/src/public/operations/result-envelope.ts +18 -4
- package/src/public/operations/specs/check.ts +1 -1
- package/src/public/operations/specs/planning.ts +17 -1
- package/src/public/skills/kibi-bootstrap/SKILL.md +2 -2
- package/src/public/skills/kibi-usage/SKILL.md +11 -1
- package/src/public/symbol-granularity.ts +13 -5
|
@@ -157,10 +157,41 @@ export function validateSemanticInventoryBoundary(payload, relationships, receip
|
|
|
157
157
|
}
|
|
158
158
|
return { applicable, errors, sourceHash };
|
|
159
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* The inventory contract the advisor derives for this payload's prose, as
|
|
162
|
+
* the properties to resend: the version, source field and hash, one ledger
|
|
163
|
+
* entry per proposition and the assertive claim keys. An entry keeps the
|
|
164
|
+
* status the payload already gave the same claim key; otherwise it carries
|
|
165
|
+
* the advisor's status (an ambiguity or ontology gap stays explicit).
|
|
166
|
+
*/
|
|
167
|
+
// implements REQ-kb-upsert-ledger-contract-in-error
|
|
168
|
+
export function semanticInventoryContract(payload, receipt) {
|
|
169
|
+
const semanticSource = semanticSourceOf(payload);
|
|
170
|
+
const sent = new Map(inventoryOf(payload).map((entry) => [
|
|
171
|
+
stringValue(entry.claim_key),
|
|
172
|
+
stringValue(entry.status),
|
|
173
|
+
]));
|
|
174
|
+
return {
|
|
175
|
+
semantic_inventory_version: SEMANTIC_INVENTORY_VERSION,
|
|
176
|
+
semantic_source_field: semanticSource.field,
|
|
177
|
+
semantic_source_hash: semanticSourceHash(semanticSource.text),
|
|
178
|
+
semantic_inventory: receipt.propositions.map((proposition) => ({
|
|
179
|
+
claim_key: proposition.claim_key,
|
|
180
|
+
claim_text: proposition.claim_text,
|
|
181
|
+
role: proposition.role,
|
|
182
|
+
status: sent.get(proposition.claim_key) || proposition.status,
|
|
183
|
+
span: { start: proposition.span.start, end: proposition.span.end },
|
|
184
|
+
})),
|
|
185
|
+
logic_claims: receipt.propositions
|
|
186
|
+
.filter(propositionIsAssertive)
|
|
187
|
+
.map(({ claim_key }) => claim_key),
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
// implements REQ-kibi-proposition-complete-ingestion, REQ-kb-upsert-ledger-contract-in-error
|
|
160
191
|
export function assertSemanticInventoryBoundary(payload, relationships, receipt) {
|
|
161
192
|
const result = validateSemanticInventoryBoundary(payload, relationships, receipt);
|
|
162
193
|
if (result.errors.length > 0) {
|
|
163
|
-
throw new Error(`Proposition-complete ingestion failed: ${result.errors.join("; ")}.
|
|
194
|
+
throw new Error(`Proposition-complete ingestion failed: ${result.errors.join("; ")}. The contract kb_model mode analyze returns for this prose, to merge into properties and resend (a claim marked modeled needs one requires_property, requires_predicate or requires_rule link to a fact with its claim_key; otherwise keep the advisor's status): ${JSON.stringify(semanticInventoryContract(payload, receipt))}`);
|
|
164
195
|
}
|
|
165
196
|
}
|
|
166
197
|
function modeledClaimKeysOf(payload) {
|
|
@@ -182,10 +213,13 @@ function groundingTargets(payload, relationships) {
|
|
|
182
213
|
function plannedClaimKey(planned) {
|
|
183
214
|
return planned.type === "fact" ? stringValue(planned.claim_key) : "";
|
|
184
215
|
}
|
|
216
|
+
function missingGroundingFactError(target) {
|
|
217
|
+
return `Proposition-complete ingestion failed: logical grounding target '${target}' does not exist yet. Write the fact first: the kb_compile_intent plan has an earlier fact step for '${target}' that carries its claim_key; run that step before this one, or apply the whole plan with kb_apply_plan.`;
|
|
218
|
+
}
|
|
185
219
|
function groundingClaimKeyError(modeledClaimKeys, grounded) {
|
|
186
220
|
const missing = grounded.find(([, claimKey]) => !claimKey);
|
|
187
221
|
if (missing)
|
|
188
|
-
return `Proposition-complete ingestion failed: logical grounding target '${missing[0]}' must declare a claim_key.`;
|
|
222
|
+
return `Proposition-complete ingestion failed: logical grounding target '${missing[0]}' must declare a claim_key: it is a fact without the claim_key of the claim it grounds. Set the claim_key the kb_compile_intent plan's fact step gives it.`;
|
|
189
223
|
const groundedClaimKeys = grounded.map(([, claimKey]) => claimKey);
|
|
190
224
|
const duplicate = groundedClaimKeys.find((claimKey, index) => groundedClaimKeys.indexOf(claimKey) !== index);
|
|
191
225
|
if (duplicate)
|
|
@@ -256,6 +290,13 @@ export async function assertLogicalGroundingClaimKeys(prolog, payload, relations
|
|
|
256
290
|
claimKey = result.success
|
|
257
291
|
? stringValue(result.bindings.ClaimKey).replace(/^['"]|['"]$/g, "")
|
|
258
292
|
: "";
|
|
293
|
+
// implements REQ-kibi-symbol-link-guidance
|
|
294
|
+
// A target that is not stored yet is a skipped plan step, not a fact
|
|
295
|
+
// missing its key: say which step to run first.
|
|
296
|
+
if (!claimKey &&
|
|
297
|
+
!(await prolog.query(`once(kb_entity('${escapeAtom(target)}', _, _))`))
|
|
298
|
+
.success)
|
|
299
|
+
throw new Error(missingGroundingFactError(target));
|
|
259
300
|
}
|
|
260
301
|
grounded.push([target, claimKey]);
|
|
261
302
|
// The first target without a claim_key is reported; later reads are moot.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../../src/public/impact/analyzer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../../src/public/impact/analyzer.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAWpB,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,uBAAuB,CAAC,CA0LlC"}
|
|
@@ -7,11 +7,19 @@ import { extractSymbolsFromStagedFileAsync } from "../../traceability/symbol-ext
|
|
|
7
7
|
import { isTraceabilityRelationshipType } from "../symbol-granularity.js";
|
|
8
8
|
import { createSemanticReviewDiagnostics, createSymbolGranularityDiagnostics, } from "./diagnostics.js";
|
|
9
9
|
import { createImpactManifestLookup, readImpactManifestResults, } from "./manifest.js";
|
|
10
|
+
import { createRequirementStatementDiagnostics, readWorkspaceRequirement, workspaceFileChanged, } from "./requirement-statements.js";
|
|
10
11
|
import { normalizeSourceFile } from "./source-changes.js";
|
|
11
12
|
import { collectSourceChanges, uniqueSorted } from "./source-changes.js";
|
|
12
13
|
import { buildNextActions, collectLinkedEntities, formatExtractedSymbols, } from "./summaries.js";
|
|
13
14
|
import { createSymbolQualityDiagnostics } from "./symbol-quality.js";
|
|
14
15
|
import { createUnownedFileDiagnostics } from "./unowned-files.js";
|
|
16
|
+
/** The workspace-relative document a requirement was read from. */
|
|
17
|
+
function requirementSourcePath(requirement) {
|
|
18
|
+
const source = requirement.source;
|
|
19
|
+
return source && !source.includes("://")
|
|
20
|
+
? source.replace(/^\.\//, "")
|
|
21
|
+
: `.kb/requirements/${requirement.id}.md`;
|
|
22
|
+
}
|
|
15
23
|
export async function analyzeChangedFileImpact(options) {
|
|
16
24
|
const workspaceRoot = path.resolve(options.workspaceRoot);
|
|
17
25
|
const snapshot = options.staged
|
|
@@ -47,8 +55,11 @@ export async function analyzeChangedFileImpact(options) {
|
|
|
47
55
|
(filter.size === 0 || filter.has(file.path)))
|
|
48
56
|
.map((file) => file.path)
|
|
49
57
|
: sourceChanges.map((change) => change.file));
|
|
50
|
-
const
|
|
51
|
-
? readSnapshotKnowledge(snapshot.readGit, snapshot.headTree, snapshot.readBlobs)
|
|
58
|
+
const snapshotKnowledge = snapshot
|
|
59
|
+
? readSnapshotKnowledge(snapshot.readGit, snapshot.headTree, snapshot.readBlobs)
|
|
60
|
+
: undefined;
|
|
61
|
+
const manifestResults = snapshotKnowledge
|
|
62
|
+
? snapshotKnowledge.filter((result) => result.entity.type === "symbol")
|
|
52
63
|
: readImpactManifestResults(workspaceRoot);
|
|
53
64
|
const manifestLookup = createImpactManifestLookup(manifestResults);
|
|
54
65
|
const symbolsByFile = new Map();
|
|
@@ -92,6 +103,19 @@ export async function analyzeChangedFileImpact(options) {
|
|
|
92
103
|
requestedFiles: [...filter],
|
|
93
104
|
linkedSourceFiles,
|
|
94
105
|
}),
|
|
106
|
+
// What the changed code is meant to do, quoted, before the
|
|
107
|
+
// structural findings: "no violations" never compared it.
|
|
108
|
+
...createRequirementStatementDiagnostics({
|
|
109
|
+
workspaceRoot,
|
|
110
|
+
symbolsByFile,
|
|
111
|
+
readRequirement: (id) => snapshotKnowledge
|
|
112
|
+
? snapshotKnowledge.find((result) => result.entity.id === id)
|
|
113
|
+
?.entity
|
|
114
|
+
: readWorkspaceRequirement(workspaceRoot, id),
|
|
115
|
+
requirementChanged: (requirement) => snapshot
|
|
116
|
+
? snapshot.inventory.some((file) => file.path === requirementSourcePath(requirement))
|
|
117
|
+
: workspaceFileChanged(workspaceRoot, requirementSourcePath(requirement)),
|
|
118
|
+
}),
|
|
95
119
|
...createSymbolGranularityDiagnostics({
|
|
96
120
|
manifestResults: activeManifestResults,
|
|
97
121
|
symbolsByFile,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ExtractedEntity } from "../../extractors/markdown.js";
|
|
2
|
+
import type { KibiImpactDiagnostic } from "../../traceability/staged-diagnostics.js";
|
|
3
|
+
import type { ExtractedSymbol } from "../../traceability/symbol-extract.js";
|
|
4
|
+
export type RequirementStatementDiagnosticsOptions = {
|
|
5
|
+
readonly workspaceRoot: string;
|
|
6
|
+
readonly symbolsByFile: ReadonlyMap<string, readonly ExtractedSymbol[]>;
|
|
7
|
+
/** The requirement entity for an id, or undefined when it is unknown. */
|
|
8
|
+
readonly readRequirement: (id: string) => ExtractedEntity | undefined;
|
|
9
|
+
/** Whether the requirement's document changed in this change. */
|
|
10
|
+
readonly requirementChanged: (requirement: ExtractedEntity) => boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* One `requirement_statement_unverified` warning per current requirement that
|
|
14
|
+
* a changed behavioral symbol implements, quoting the requirement's statement
|
|
15
|
+
* and firmness. A requirement whose own document changed in the same change
|
|
16
|
+
* is left to the firmness and supersede checks.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createRequirementStatementDiagnostics(options: RequirementStatementDiagnosticsOptions): KibiImpactDiagnostic[];
|
|
19
|
+
/**
|
|
20
|
+
* Whether Git reports any change (staged, unstaged or untracked) to a
|
|
21
|
+
* workspace file against HEAD. Outside a repository nothing counts as changed.
|
|
22
|
+
*/
|
|
23
|
+
export declare function workspaceFileChanged(workspaceRoot: string, relativePath: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Read a requirement from its canonical document in the working tree
|
|
26
|
+
* (`.kb/requirements/<id>.md`).
|
|
27
|
+
*/
|
|
28
|
+
export declare function readWorkspaceRequirement(workspaceRoot: string, id: string): ExtractedEntity | undefined;
|
|
29
|
+
//# sourceMappingURL=requirement-statements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requirement-statements.d.ts","sourceRoot":"","sources":["../../../src/public/impact/requirement-statements.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAgB5E,MAAM,MAAM,sCAAsC,GAAG;IACnD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC,CAAC;IACxE,yEAAyE;IACzE,QAAQ,CAAC,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,CAAC;IACtE,iEAAiE;IACjE,QAAQ,CAAC,kBAAkB,EAAE,CAAC,WAAW,EAAE,eAAe,KAAK,OAAO,CAAC;CACxE,CAAC;AAiBF;;;;;GAKG;AACH,wBAAgB,qCAAqC,CACnD,OAAO,EAAE,sCAAsC,GAC9C,oBAAoB,EAAE,CAsExB;AAGD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,GACnB,OAAO,CAeT;AAGD;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,EACrB,EAAE,EAAE,MAAM,GACT,eAAe,GAAG,SAAS,CAS7B"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { effectiveFirmness } from "../../decision-firmness.js";
|
|
4
|
+
import { extractFromMarkdown, } from "../../extractors/markdown.js";
|
|
5
|
+
/**
|
|
6
|
+
* Kibi's checks compare structure (links, coverage, facts), never code with a
|
|
7
|
+
* requirement's prose. A change to code that implements a requirement can
|
|
8
|
+
* contradict it and still pass every rule, so the check says which
|
|
9
|
+
* requirements the changed code implements and quotes what each one says,
|
|
10
|
+
* instead of letting "no violations" read as "the change keeps them".
|
|
11
|
+
*/
|
|
12
|
+
const MAX_STATEMENT = 400;
|
|
13
|
+
const MAX_NAMED_SYMBOLS = 4;
|
|
14
|
+
const RETIRED_STATUS = /supersed|deprecat|reject|obsolete|retired|archived|removed|closed/i;
|
|
15
|
+
function implementedRequirementIds(symbol) {
|
|
16
|
+
return [
|
|
17
|
+
...(symbol.relationships ?? [])
|
|
18
|
+
.filter((relationship) => relationship.type === "implements")
|
|
19
|
+
.map((relationship) => relationship.to),
|
|
20
|
+
...symbol.reqLinks,
|
|
21
|
+
].filter((id) => id.startsWith("REQ-"));
|
|
22
|
+
}
|
|
23
|
+
function truncate(text, limit) {
|
|
24
|
+
const flat = text.replace(/\s+/g, " ").trim();
|
|
25
|
+
return flat.length > limit ? `${flat.slice(0, limit - 1)}…` : flat;
|
|
26
|
+
}
|
|
27
|
+
// implements REQ-kb-check-unverified-requirement-statements
|
|
28
|
+
/**
|
|
29
|
+
* One `requirement_statement_unverified` warning per current requirement that
|
|
30
|
+
* a changed behavioral symbol implements, quoting the requirement's statement
|
|
31
|
+
* and firmness. A requirement whose own document changed in the same change
|
|
32
|
+
* is left to the firmness and supersede checks.
|
|
33
|
+
*/
|
|
34
|
+
export function createRequirementStatementDiagnostics(options) {
|
|
35
|
+
const symbolsByRequirement = new Map();
|
|
36
|
+
for (const symbols of options.symbolsByFile.values()) {
|
|
37
|
+
for (const symbol of symbols) {
|
|
38
|
+
if (symbol.role !== "behavioral" || symbol.hunkRanges.length === 0)
|
|
39
|
+
continue;
|
|
40
|
+
for (const id of implementedRequirementIds(symbol)) {
|
|
41
|
+
const entry = symbolsByRequirement.get(id) ?? {
|
|
42
|
+
names: new Set(),
|
|
43
|
+
files: new Set(),
|
|
44
|
+
};
|
|
45
|
+
entry.names.add(symbol.name);
|
|
46
|
+
entry.files.add(symbol.location.file);
|
|
47
|
+
symbolsByRequirement.set(id, entry);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const diagnostics = [];
|
|
52
|
+
for (const id of [...symbolsByRequirement.keys()].sort()) {
|
|
53
|
+
const requirement = options.readRequirement(id);
|
|
54
|
+
if (requirement === undefined || requirement.type !== "req")
|
|
55
|
+
continue;
|
|
56
|
+
if (RETIRED_STATUS.test(requirement.status ?? ""))
|
|
57
|
+
continue;
|
|
58
|
+
if (options.requirementChanged(requirement))
|
|
59
|
+
continue;
|
|
60
|
+
const entry = symbolsByRequirement.get(id);
|
|
61
|
+
if (entry === undefined)
|
|
62
|
+
continue;
|
|
63
|
+
const firmness = effectiveFirmness("req", requirement.firmness, requirement.origin);
|
|
64
|
+
const label = firmness === "firm"
|
|
65
|
+
? "firm: ask before changing"
|
|
66
|
+
: (firmness ?? "default");
|
|
67
|
+
const statement = truncate(requirement.semantic_text ?? requirement.title, MAX_STATEMENT);
|
|
68
|
+
const sorted = [...entry.names].sort();
|
|
69
|
+
const names = sorted.length > MAX_NAMED_SYMBOLS
|
|
70
|
+
? `${sorted.slice(0, MAX_NAMED_SYMBOLS).join(", ")} and ${sorted.length - MAX_NAMED_SYMBOLS} more`
|
|
71
|
+
: sorted.join(", ");
|
|
72
|
+
const verb = sorted.length === 1 ? "implements" : "implement";
|
|
73
|
+
diagnostics.push({
|
|
74
|
+
id: "requirement_statement_unverified",
|
|
75
|
+
severity: "warning",
|
|
76
|
+
blocking: false,
|
|
77
|
+
category: "requirement",
|
|
78
|
+
entityId: id,
|
|
79
|
+
files: [...entry.files].sort(),
|
|
80
|
+
docs: ["docs/symbol-traceability-taxonomy.md"],
|
|
81
|
+
message: `The change edits ${names}, which ${verb} ${id} [${label}]: "${statement}" Kibi compared links and facts, not the code with this statement, so no violation here does not mean the change keeps it.`,
|
|
82
|
+
suggestion: firmness === "firm"
|
|
83
|
+
? `Confirm the changed code still does what ${id} says. If it no longer does, the request conflicts with a rule a person set: stop and ask whether to change ${id}; change it only with their words in origin.ref, and say in the final answer which rule changed.`
|
|
84
|
+
: `Confirm the changed code still does what ${id} says. If it no longer does, the request conflicts with a recorded rule: ask whether to change ${id} before keeping the change, then supersede or update it in the same change with the person's words, and say in the final answer which rule changed.`,
|
|
85
|
+
evidence: {
|
|
86
|
+
requirement: id,
|
|
87
|
+
firmness: firmness ?? "default",
|
|
88
|
+
statement,
|
|
89
|
+
symbols: sorted,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return diagnostics;
|
|
94
|
+
}
|
|
95
|
+
// implements REQ-kb-check-unverified-requirement-statements
|
|
96
|
+
/**
|
|
97
|
+
* Whether Git reports any change (staged, unstaged or untracked) to a
|
|
98
|
+
* workspace file against HEAD. Outside a repository nothing counts as changed.
|
|
99
|
+
*/
|
|
100
|
+
export function workspaceFileChanged(workspaceRoot, relativePath) {
|
|
101
|
+
try {
|
|
102
|
+
const output = execFileSync("git", ["status", "--porcelain", "--", relativePath], {
|
|
103
|
+
cwd: workspaceRoot,
|
|
104
|
+
encoding: "utf8",
|
|
105
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
106
|
+
});
|
|
107
|
+
return output.trim() !== "";
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// implements REQ-kb-check-unverified-requirement-statements
|
|
114
|
+
/**
|
|
115
|
+
* Read a requirement from its canonical document in the working tree
|
|
116
|
+
* (`.kb/requirements/<id>.md`).
|
|
117
|
+
*/
|
|
118
|
+
export function readWorkspaceRequirement(workspaceRoot, id) {
|
|
119
|
+
if (!/^REQ-[A-Za-z0-9._-]+$/.test(id))
|
|
120
|
+
return undefined;
|
|
121
|
+
try {
|
|
122
|
+
return extractFromMarkdown(path.join(workspaceRoot, ".kb", "requirements", `${id}.md`)).entity;
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -1858,7 +1858,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
1858
1858
|
};
|
|
1859
1859
|
readonly includeImpactDiagnostics: {
|
|
1860
1860
|
readonly type: "boolean";
|
|
1861
|
-
readonly description: "When true, include changed-file impact diagnostics such as symbol_granularity_violation, symbol_semantic_review_needed and
|
|
1861
|
+
readonly description: "When true, include changed-file impact diagnostics such as symbol_granularity_violation, symbol_semantic_review_needed, source_file_unowned and requirement_statement_unverified (each current requirement the changed code implements, with its statement and firmness, since the check never compares code with a statement) in structured output.";
|
|
1862
1862
|
};
|
|
1863
1863
|
readonly maxDiagnostics: {
|
|
1864
1864
|
readonly type: "integer";
|
|
@@ -1951,7 +1951,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
1951
1951
|
}, {
|
|
1952
1952
|
readonly name: "kb_compile_intent";
|
|
1953
1953
|
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. No mutation side effects.";
|
|
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.";
|
|
1955
1955
|
readonly businessInputSchema: {
|
|
1956
1956
|
readonly type: "object";
|
|
1957
1957
|
readonly required: readonly ["intent", "mode"];
|
|
@@ -2177,6 +2177,30 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
2177
2177
|
};
|
|
2178
2178
|
readonly description: "Explicit decisions for deterministic traceability proposals. Pending proposals never enter steps.";
|
|
2179
2179
|
};
|
|
2180
|
+
readonly conflictReviews: {
|
|
2181
|
+
readonly type: "array";
|
|
2182
|
+
readonly maxItems: 20;
|
|
2183
|
+
readonly items: {
|
|
2184
|
+
readonly type: "object";
|
|
2185
|
+
readonly required: readonly ["requirementId", "verdict"];
|
|
2186
|
+
readonly additionalProperties: false;
|
|
2187
|
+
readonly properties: {
|
|
2188
|
+
readonly requirementId: {
|
|
2189
|
+
readonly type: "string";
|
|
2190
|
+
readonly minLength: 1;
|
|
2191
|
+
};
|
|
2192
|
+
readonly verdict: {
|
|
2193
|
+
readonly type: "string";
|
|
2194
|
+
readonly enum: readonly ["conflict", "no_conflict"];
|
|
2195
|
+
};
|
|
2196
|
+
readonly note: {
|
|
2197
|
+
readonly type: "string";
|
|
2198
|
+
readonly maxLength: 2000;
|
|
2199
|
+
};
|
|
2200
|
+
};
|
|
2201
|
+
};
|
|
2202
|
+
readonly description: "Your verdict on each contradictionAnalysis.reviewCandidates entry of a previous compile: whether the intent contradicts that current requirement, which Kibi could not compare logically. A conflict verdict blocks the plan; a no_conflict verdict clears that candidate. A verdict may also name a current requirement discovery did not rank.";
|
|
2203
|
+
};
|
|
2180
2204
|
};
|
|
2181
2205
|
};
|
|
2182
2206
|
readonly requiresProlog: true;
|
|
@@ -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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBe,CAAC;AAyF9C,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,aAAa,GAClB,qBAAqB,CA+BvB;AAQD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,qBAAqB,GAAG,SAAS,EACvC,IAAI,EAAE,aAAa,GAClB,qBAAqB,CAKvB;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,aAAa,GAAG,qBAAqB,CAElE;AAGD,wBAAgB,SAAS,IAAI,SAAS,qBAAqB,EAAE,CAE5D"}
|
|
@@ -35,7 +35,7 @@ export interface CheckStructuredContent {
|
|
|
35
35
|
}
|
|
36
36
|
export declare function formatImpactText(impactResult: ChangedFileImpactResult): string;
|
|
37
37
|
export declare function formatQualityDiagnosticsText(diagnostics: readonly QualityDiagnostic[]): string;
|
|
38
|
-
export declare function formatViolationText(violations: readonly Violation[]): string;
|
|
38
|
+
export declare function formatViolationText(violations: readonly Violation[], unverifiedRequirements?: readonly string[]): string;
|
|
39
39
|
export declare function buildStructuredContent(input: {
|
|
40
40
|
violations: readonly Violation[];
|
|
41
41
|
evaluated: CheckEvaluated;
|
|
@@ -1 +1 @@
|
|
|
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AAG,SAAS,CAAC;IAClD,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B,GAAG,sBAAsB,CA4BzB;AAID,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,cAAc,GAAG,MAAM,CAQrE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAClC,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC;IACpC,QAAQ,CAAC,YAAY,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC3D,QAAQ,CAAC,kBAAkB,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC3D,GAAG,MAAM,CAaT"}
|
|
@@ -54,10 +54,23 @@ export function formatQualityDiagnosticsText(diagnostics) {
|
|
|
54
54
|
});
|
|
55
55
|
return `${diagnostics.length} quality diagnostic${diagnostics.length === 1 ? "" : "s"} found\n${details.join("\n")}`;
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Requirements the changed code implements whose statements the check did not
|
|
59
|
+
* compare with the code (`requirement_statement_unverified`).
|
|
60
|
+
*/
|
|
61
|
+
// implements REQ-kb-check-unverified-requirement-statements
|
|
62
|
+
function unverifiedRequirementIds(input) {
|
|
63
|
+
return (input.impactResult?.impactDiagnostics ?? [])
|
|
64
|
+
.filter((diagnostic) => diagnostic.id === "requirement_statement_unverified")
|
|
65
|
+
.map((diagnostic) => diagnostic.entityId)
|
|
66
|
+
.filter((id) => id !== undefined);
|
|
67
|
+
}
|
|
68
|
+
// implements REQ-mcp-tool-check, REQ-kb-check-unverified-requirement-statements
|
|
69
|
+
export function formatViolationText(violations, unverifiedRequirements = []) {
|
|
59
70
|
if (violations.length === 0) {
|
|
60
|
-
return
|
|
71
|
+
return unverifiedRequirements.length === 0
|
|
72
|
+
? "No violations found"
|
|
73
|
+
: `No structural violations found. The changed code implements ${unverifiedRequirements.join(", ")}; Kibi did not compare the code with ${unverifiedRequirements.length === 1 ? "its statement" : "their statements"} (quoted under requirement_statement_unverified below), so confirm the change still does what each says, and ask the person before keeping a change that contradicts one`;
|
|
61
74
|
}
|
|
62
75
|
const details = violations.map((violation) => {
|
|
63
76
|
const parts = [
|
|
@@ -116,7 +129,9 @@ export function formatEvaluatedText(evaluated) {
|
|
|
116
129
|
return `${rules}; domain-contradictions compared ${pairs.factPairsExamined} fact pair${pairs.factPairsExamined === 1 ? "" : "s"}${pairs.factPairsExamined === 0 ? " (no two current requirements constrain the same subject or predicate case)" : ""}.`;
|
|
117
130
|
}
|
|
118
131
|
export function buildSummary(input) {
|
|
119
|
-
const sections = [
|
|
132
|
+
const sections = [
|
|
133
|
+
formatViolationText(input.violations, unverifiedRequirementIds(input)),
|
|
134
|
+
];
|
|
120
135
|
if (input.evaluated !== undefined)
|
|
121
136
|
sections.push(formatEvaluatedText(input.evaluated));
|
|
122
137
|
if (input.impactResult !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-executors.d.ts","sourceRoot":"","sources":["../../../src/public/operations/discovery-executors.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAIpB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,wBAAwB,CAAC;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EACL,yBAAyB,EACzB,KAAK,qBAAqB,EAM3B,MAAM,6BAA6B,CAAC;AAWrC,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAGnB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,gBAAgB,EAAc,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,MA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AChC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;QAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACzD,CAAC;CACH,CAAC;AAqaF,wBAAsB,YAAY,CAChC,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAmFxC;AA4HD,wBAAsB,aAAa,CACjC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAoIzC;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"discovery-executors.d.ts","sourceRoot":"","sources":["../../../src/public/operations/discovery-executors.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAIpB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,wBAAwB,CAAC;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EACL,yBAAyB,EACzB,KAAK,qBAAqB,EAM3B,MAAM,6BAA6B,CAAC;AAWrC,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAGnB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,gBAAgB,EAAc,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,I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QAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACzD,CAAC;CACH,CAAC;AAqaF,wBAAsB,YAAY,CAChC,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAmFxC;AA4HD,wBAAsB,aAAa,CACjC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAoIzC;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAuWzC"}
|
|
@@ -947,35 +947,42 @@ export async function executeStatus(_input, context) {
|
|
|
947
947
|
planEligible: bootstrapActivation.activationState === "root_active_thin" &&
|
|
948
948
|
!bootstrapActivation.applyBlocked,
|
|
949
949
|
reason: bootstrapActivation.reason,
|
|
950
|
-
|
|
950
|
+
// implements REQ-legacy-kb-first-step-migrate
|
|
951
|
+
nextAction: bootstrapActivation.nextOperation !== undefined
|
|
951
952
|
? {
|
|
952
|
-
operation:
|
|
953
|
+
operation: bootstrapActivation.nextOperation,
|
|
953
954
|
reason: bootstrapActivation.reason,
|
|
954
955
|
required: true,
|
|
955
956
|
}
|
|
956
|
-
: bootstrapActivation.activationState === "
|
|
957
|
+
: bootstrapActivation.activationState === "root_uninitialized"
|
|
957
958
|
? {
|
|
958
|
-
operation: "kibi
|
|
959
|
+
operation: "kibi init",
|
|
959
960
|
reason: bootstrapActivation.reason,
|
|
960
961
|
required: true,
|
|
961
962
|
}
|
|
962
|
-
: bootstrapActivation.activationState === "
|
|
963
|
+
: bootstrapActivation.activationState === "root_partial"
|
|
963
964
|
? {
|
|
964
|
-
operation: "
|
|
965
|
+
operation: "kibi doctor",
|
|
965
966
|
reason: bootstrapActivation.reason,
|
|
966
967
|
required: true,
|
|
967
968
|
}
|
|
968
|
-
: bootstrapActivation.activationState === "
|
|
969
|
+
: bootstrapActivation.activationState === "vendored_only"
|
|
969
970
|
? {
|
|
970
|
-
operation: "
|
|
971
|
+
operation: "move-to-project-root",
|
|
971
972
|
reason: bootstrapActivation.reason,
|
|
972
973
|
required: true,
|
|
973
974
|
}
|
|
974
|
-
:
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
975
|
+
: bootstrapActivation.activationState === "root_active_thin"
|
|
976
|
+
? {
|
|
977
|
+
operation: "kb_plan_bootstrap",
|
|
978
|
+
reason: bootstrapActivation.reason,
|
|
979
|
+
required: true,
|
|
980
|
+
}
|
|
981
|
+
: {
|
|
982
|
+
operation: "continue-kibi-workflow",
|
|
983
|
+
reason: bootstrapActivation.reason,
|
|
984
|
+
required: false,
|
|
985
|
+
},
|
|
979
986
|
},
|
|
980
987
|
};
|
|
981
988
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-plan.d.ts","sourceRoot":"","sources":["../../../src/public/operations/migration-plan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"migration-plan.d.ts","sourceRoot":"","sources":["../../../src/public/operations/migration-plan.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,sBAAsB,EAAG,wBAAiC,CAAC;AAExE,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,SAAS,CAAC;AACvD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;AAErE,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,CAAC;IACP,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAA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AAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC,CAAC;AAEH,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,MAAM,GACpB,qBAAqB,CAoCvB;AAwBD,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAcnD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACrD,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAChD,YAAY,CAAC,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IAC5D,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,CACzB,oBAAoB,EAAE,MAAM,GAAG,IAAI,KAChC,0BAA0B,CAAC;CACjC,GAAG,aAAa,CA0VhB"}
|
|
@@ -3,7 +3,7 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import { planLegacyStorageMigration } from "../../commands/legacy-storage-migration.js";
|
|
5
5
|
import { BRANCH_STORE_NOT_COMPILED } from "../../utils/branch-store.js";
|
|
6
|
-
import { legacyConfigExists } from "../../utils/config.js";
|
|
6
|
+
import { LEGACY_KB_MIGRATION_COMMAND, LEGACY_KB_MIGRATION_NOTE, legacyConfigExists, } from "../../utils/config.js";
|
|
7
7
|
import { MTIME_SOURCE_REASON_CODES } from "../../utils/content-freshness.js";
|
|
8
8
|
import { readKbManifestStatus } from "../../utils/kb-manifest.js";
|
|
9
9
|
import { getSchemaVersionStatus, normalizeSchemaVersion, } from "../../utils/schema-version.js";
|
|
@@ -197,6 +197,11 @@ export function digestMigrationPlan(plan) {
|
|
|
197
197
|
else
|
|
198
198
|
group.count += 1;
|
|
199
199
|
}
|
|
200
|
+
const automaticActions = plan.actions.filter((action) => action.safety === "automatic");
|
|
201
|
+
const blockedAutomatic = automaticActions.filter((action) => action.state === "blocked").length;
|
|
202
|
+
const blockedNote = blockedAutomatic === 0
|
|
203
|
+
? ""
|
|
204
|
+
: ` ${blockedAutomatic === 1 ? "1 automatic action is" : `${blockedAutomatic} automatic actions are`} blocked: it waits for the actions in its dependsOn and needs no approval until a later plan shows it ready.`;
|
|
200
205
|
return {
|
|
201
206
|
version: MIGRATION_PLAN_DIGEST_VERSION,
|
|
202
207
|
planHash: plan.planHash,
|
|
@@ -204,12 +209,12 @@ export function digestMigrationPlan(plan) {
|
|
|
204
209
|
expected: plan.expected,
|
|
205
210
|
scope: plan.scope,
|
|
206
211
|
summary: plan.summary,
|
|
207
|
-
automaticActions
|
|
212
|
+
automaticActions,
|
|
208
213
|
actionGroups: [...groups.values()].sort((left, right) => right.count - left.count ||
|
|
209
214
|
left.code.localeCompare(right.code) ||
|
|
210
215
|
left.state.localeCompare(right.state)),
|
|
211
216
|
diagnostics: plan.diagnostics,
|
|
212
|
-
next:
|
|
217
|
+
next: `This digest cannot be applied. Run kb_status, kb_check and kb_coverage (or kibi migrate) for the full plan and its action details.${blockedNote}`,
|
|
213
218
|
};
|
|
214
219
|
}
|
|
215
220
|
/**
|
|
@@ -524,7 +529,12 @@ export function readMigrationConfigStatus(workspaceRoot) {
|
|
|
524
529
|
...schemaStatus,
|
|
525
530
|
currentVersion: normalizeSchemaVersion(legacySchemaVersion),
|
|
526
531
|
configHash: null,
|
|
527
|
-
|
|
532
|
+
// implements REQ-legacy-kb-first-step-migrate
|
|
533
|
+
// A legacy KB is migrated, never initialized: name the step kb_status's
|
|
534
|
+
// bootstrap.nextAction and kibi doctor name.
|
|
535
|
+
warning: status.state === "missing" && legacyConfigExists(workspaceRoot)
|
|
536
|
+
? `Kibi lifecycle manifest is missing because this KB was written by an older Kibi; run '${LEGACY_KB_MIGRATION_COMMAND}' (${LEGACY_KB_MIGRATION_NOTE}).`
|
|
537
|
+
: status.warning,
|
|
528
538
|
};
|
|
529
539
|
}
|
|
530
540
|
/**
|
|
@@ -3,6 +3,8 @@ export { codedErrorOf } from "../../cli-errors.js";
|
|
|
3
3
|
export type { CodedErrorFields } from "../../cli-errors.js";
|
|
4
4
|
export declare const KIBI_PROTOCOL_VERSION: 1;
|
|
5
5
|
export declare function failedEffectStatus(effect: OperationEffect, failure: Record<string, unknown>): KibiResult["effects"][number];
|
|
6
|
+
/** The envelope error code of a kb_upsert dry run on an invalid payload. */
|
|
7
|
+
export declare const UPSERT_DRY_RUN_INVALID: "UPSERT_DRY_RUN_INVALID";
|
|
6
8
|
export declare function resultVersion(spec: {
|
|
7
9
|
readonly name: OperationName | string;
|
|
8
10
|
readonly resultVersion?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-envelope.d.ts","sourceRoot":"","sources":["../../../src/public/operations/result-envelope.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,qBAAqB,EAAG,CAAU,CAAC;AAkEhD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,UAAU,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,C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