kibi-cli 2.21.2 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-register-foundation.d.ts.map +1 -1
- package/dist/cli-register-foundation.js +1 -0
- package/dist/commands/check.d.ts +0 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +47 -111
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +96 -6
- package/dist/commands/init-helpers.d.ts +14 -1
- package/dist/commands/init-helpers.d.ts.map +1 -1
- package/dist/commands/init-helpers.js +49 -10
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +12 -1
- package/dist/commands/legacy-storage-migration.d.ts +46 -1
- package/dist/commands/legacy-storage-migration.d.ts.map +1 -1
- package/dist/commands/legacy-storage-migration.js +219 -9
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +48 -182
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +9 -0
- package/dist/extractors/symbols-coordinator.js +1 -0
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +28 -6
- package/dist/operations/migration/inventory-rederive.d.ts +40 -1
- package/dist/operations/migration/inventory-rederive.d.ts.map +1 -1
- package/dist/operations/migration/inventory-rederive.js +99 -8
- package/dist/operations/migration/requirement-status.d.ts +25 -0
- package/dist/operations/migration/requirement-status.d.ts.map +1 -0
- package/dist/operations/migration/requirement-status.js +105 -0
- package/dist/operations/migration/schema6.d.ts +25 -0
- package/dist/operations/migration/schema6.d.ts.map +1 -1
- package/dist/operations/migration/schema6.js +265 -7
- package/dist/operations/migration/symbol-legacy-links.d.ts +51 -0
- package/dist/operations/migration/symbol-legacy-links.d.ts.map +1 -0
- package/dist/operations/migration/symbol-legacy-links.js +319 -0
- package/dist/operations/mutation/context-warning.d.ts +12 -2
- package/dist/operations/mutation/context-warning.d.ts.map +1 -1
- package/dist/operations/mutation/context-warning.js +6 -6
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +130 -35
- package/dist/operations/mutation/types.d.ts +2 -1
- package/dist/operations/mutation/types.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.d.ts +17 -2
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +28 -11
- package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
- package/dist/operations/mutation/validate-upsert.js +40 -8
- package/dist/operations/planning/apply-plan.d.ts.map +1 -1
- package/dist/operations/planning/apply-plan.js +18 -3
- package/dist/public/impact/diagnostics.d.ts.map +1 -1
- package/dist/public/impact/diagnostics.js +24 -14
- package/dist/public/operations/catalog.d.ts +3 -3
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +3 -0
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +6 -1
- package/dist/public/operations/discovery-executors.d.ts +2 -0
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +9 -2
- package/dist/public/operations/migration-plan.d.ts +2 -0
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +101 -16
- package/dist/public/operations/result-envelope.d.ts.map +1 -1
- package/dist/public/operations/result-envelope.js +27 -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 +2 -1
- package/dist/public/operations/specs/check.d.ts +1 -1
- package/dist/public/operations/specs/planning.d.ts +2 -2
- package/dist/public/operations/specs/planning.js +2 -2
- package/dist/public/operations/symbol-granularity-check.d.ts +18 -0
- package/dist/public/operations/symbol-granularity-check.d.ts.map +1 -0
- package/dist/public/operations/symbol-granularity-check.js +175 -0
- package/dist/public/symbol-granularity.d.ts +17 -0
- package/dist/public/symbol-granularity.d.ts.map +1 -1
- package/dist/public/symbol-granularity.js +21 -0
- package/dist/traceability/evidence-model.d.ts +7 -3
- package/dist/traceability/evidence-model.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +6 -5
- package/dist/traceability/validate.d.ts +14 -1
- package/dist/traceability/validate.d.ts.map +1 -1
- package/dist/traceability/validate.js +41 -0
- package/dist/utils/rule-registry.generated.d.ts +5 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +6 -0
- package/package.json +3 -3
- package/src/public/impact/diagnostics.ts +29 -17
- package/src/public/operations/check-executor.ts +7 -0
- package/src/public/operations/contracts.ts +6 -1
- package/src/public/operations/discovery-executors.ts +12 -2
- package/src/public/operations/migration-plan.ts +100 -19
- package/src/public/operations/result-envelope.ts +34 -1
- package/src/public/operations/specs/check-rules.generated.ts +2 -1
- package/src/public/operations/specs/planning.ts +2 -2
- package/src/public/operations/symbol-granularity-check.ts +233 -0
- package/src/public/symbol-granularity.ts +37 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OperationContext } from "../../public/operations/runtime-types.js";
|
|
2
2
|
import type { OperationResult } from "../../public/operations/types.js";
|
|
3
|
-
import {
|
|
3
|
+
import type { SemanticAdvisorReceipt } from "../semantic-advisor/types.js";
|
|
4
4
|
import { type StoredEntityLookup } from "./stored-entity.js";
|
|
5
5
|
import type { RelationshipInput, StagedUpsertState, UpsertInput, UpsertPayload, ValidatedUpsert } from "./types.js";
|
|
6
6
|
export declare function assertRelationshipShardContained(workspaceRoot: string, shardPath: string): void;
|
|
@@ -15,11 +15,26 @@ export type UpsertValidationOptions = Readonly<{
|
|
|
15
15
|
*/
|
|
16
16
|
readonly staged?: StagedUpsertState;
|
|
17
17
|
}>;
|
|
18
|
+
/** The semantic advisor result an upsert reports; no receipt for a non-requirement. */
|
|
19
|
+
export type UpsertSemanticAnalysis = Readonly<{
|
|
20
|
+
readonly receipt: SemanticAdvisorReceipt | null;
|
|
21
|
+
readonly warnings: readonly string[];
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* The semantic advisor analyses requirement prose: its propositions, claim
|
|
25
|
+
* keys and inventory contract describe a requirement. Any other entity has no
|
|
26
|
+
* prose inventory, so analysing its title (the fallback prose) would report
|
|
27
|
+
* claim keys nothing declares, for example a fact whose claim_key derives
|
|
28
|
+
* from claim_text. Its upsert carries no receipt.
|
|
29
|
+
*/
|
|
30
|
+
export declare function analyzeUpsertSemantics(payload: UpsertInput & {
|
|
31
|
+
readonly relationships: readonly RelationshipInput[];
|
|
32
|
+
}): UpsertSemanticAnalysis;
|
|
18
33
|
export type UpsertValidation = Readonly<{
|
|
19
34
|
readonly validated: ValidatedUpsert;
|
|
20
35
|
/** The upsert's relationships merged with the entity's existing ones. */
|
|
21
36
|
readonly relationships: readonly RelationshipInput[];
|
|
22
|
-
readonly semantic:
|
|
37
|
+
readonly semantic: UpsertSemanticAnalysis;
|
|
23
38
|
}>;
|
|
24
39
|
/**
|
|
25
40
|
* The complete validation an upsert passes before its first write: schema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/upsert.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/upsert.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAexE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAyB3E,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,oBAAoB,CAAC;AAQ5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CASxB;AAGD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,yEAAyE;IACzE,QAAQ,CAAC,aAAa,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACrD,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;CAC3C,CAAC,CAAC;AAGH;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,gBAAgB,EACzB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,gBAAgB,CAAC,CA0E3B;AAgDD,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C;;;;;;OAMG;IAEH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IACzC;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IACtC;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC,CAAC;AAyBH,wBAAsB,aAAa,CACjC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,gBAAgB,EACzB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CA2hBzC"}
|
|
@@ -59,6 +59,11 @@ function storedClaimKey(entity) {
|
|
|
59
59
|
? { claimKey: entity.claim_key }
|
|
60
60
|
: {};
|
|
61
61
|
}
|
|
62
|
+
// implements REQ-mcp-semantic-advisor-preflight
|
|
63
|
+
/** The written result's semantic advisor receipt, omitted for a non-requirement. */
|
|
64
|
+
function advisorReceipt(receipt) {
|
|
65
|
+
return receipt === null ? {} : { semanticAdvisor: receipt };
|
|
66
|
+
}
|
|
62
67
|
function fileHash(pathname) {
|
|
63
68
|
if (!existsSync(pathname))
|
|
64
69
|
return null;
|
|
@@ -194,6 +199,21 @@ function reextractCanonicalSymbolEntity(symbolId, authoredRelativePath, workspac
|
|
|
194
199
|
: { sourceFile: result.sourceFile }),
|
|
195
200
|
};
|
|
196
201
|
}
|
|
202
|
+
// implements REQ-mcp-semantic-advisor-preflight
|
|
203
|
+
/**
|
|
204
|
+
* The semantic advisor analyses requirement prose: its propositions, claim
|
|
205
|
+
* keys and inventory contract describe a requirement. Any other entity has no
|
|
206
|
+
* prose inventory, so analysing its title (the fallback prose) would report
|
|
207
|
+
* claim keys nothing declares, for example a fact whose claim_key derives
|
|
208
|
+
* from claim_text. Its upsert carries no receipt.
|
|
209
|
+
*/
|
|
210
|
+
export function analyzeUpsertSemantics(payload) {
|
|
211
|
+
if (payload.type !== "req")
|
|
212
|
+
return { receipt: null, warnings: [] };
|
|
213
|
+
const semantic = analyzeSemanticAdvisorInput({ payload });
|
|
214
|
+
assertSemanticInventoryBoundary(payload, payload.relationships, semantic.receipt);
|
|
215
|
+
return semantic;
|
|
216
|
+
}
|
|
197
217
|
// implements REQ-kibi-truthful-consistency
|
|
198
218
|
/**
|
|
199
219
|
* The complete validation an upsert passes before its first write: schema,
|
|
@@ -223,10 +243,7 @@ export async function validateUpsertForCommit(payload, context, options = {}) {
|
|
|
223
243
|
await validateStrictLanePairing(prolog, validated.relationships, staged);
|
|
224
244
|
await validateLiveRelationshipTargets(prolog, validated.entity, validated.relationships, staged);
|
|
225
245
|
await validateSupersedesSourceHistory(prolog, validated.entity, validated.relationships, context.workspaceRoot, undefined, staged);
|
|
226
|
-
const semantic =
|
|
227
|
-
payload: { ...input, relationships },
|
|
228
|
-
});
|
|
229
|
-
assertSemanticInventoryBoundary({ ...input, relationships }, relationships, semantic.receipt);
|
|
246
|
+
const semantic = analyzeUpsertSemantics({ ...input, relationships });
|
|
230
247
|
await assertLogicalGroundingClaimKeys(prolog, { ...input, relationships }, relationships, staged);
|
|
231
248
|
await assertPredicateArgumentVocabulary(prolog, validated.entity, staged);
|
|
232
249
|
// The origin the write records is added last: none of the checks above
|
|
@@ -321,7 +338,7 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
321
338
|
let commitEntity;
|
|
322
339
|
let relationshipCount = 0;
|
|
323
340
|
let changeKind = null;
|
|
324
|
-
let semanticAdvisor;
|
|
341
|
+
let semanticAdvisor = null;
|
|
325
342
|
let compilerLock;
|
|
326
343
|
let sourceMutationLock;
|
|
327
344
|
let operationFailure;
|
|
@@ -510,7 +527,7 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
510
527
|
updated: 0,
|
|
511
528
|
relationships_created: validated.relationships.length,
|
|
512
529
|
warnings: [...planRecoveryWarnings, ...semantic.warnings],
|
|
513
|
-
|
|
530
|
+
...advisorReceipt(semantic.receipt),
|
|
514
531
|
...storedClaimKey(commitEntity ?? validated.entity),
|
|
515
532
|
deferredCommit,
|
|
516
533
|
...(sourceWrite ? { sourceWrites: [sourceWrite.receipt] } : {}),
|
|
@@ -587,10 +604,10 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
587
604
|
...semantic.warnings,
|
|
588
605
|
...coverage,
|
|
589
606
|
...idStyleWarnings,
|
|
590
|
-
...entityContextWarnings(input, commitEntity ?? validated.entity, context.workspaceRoot, sourceWrite?.receipt.path),
|
|
607
|
+
...entityContextWarnings(input, commitEntity ?? validated.entity, context.workspaceRoot, { writtenPath: sourceWrite?.receipt.path }),
|
|
591
608
|
...shardWarnings,
|
|
592
609
|
],
|
|
593
|
-
|
|
610
|
+
...advisorReceipt(semantic.receipt),
|
|
594
611
|
...storedClaimKey(commitEntity ?? validated.entity),
|
|
595
612
|
...(shardWarnings.length > 0
|
|
596
613
|
? {
|
|
@@ -625,9 +642,9 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
625
642
|
? "skipped"
|
|
626
643
|
: "no-conflict",
|
|
627
644
|
checked_req_id: input.id,
|
|
628
|
-
strict_readiness: semantic.receipt
|
|
645
|
+
strict_readiness: semantic.receipt?.logic_readiness === "modeled"
|
|
629
646
|
? "modeled"
|
|
630
|
-
: semantic.receipt
|
|
647
|
+
: (semantic.receipt?.candidate_lane ?? "none"),
|
|
631
648
|
},
|
|
632
649
|
}
|
|
633
650
|
: {}),
|
|
@@ -662,7 +679,7 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
662
679
|
updated: changeKind === "updated" ? 1 : 0,
|
|
663
680
|
relationships_created: relationshipCount,
|
|
664
681
|
warnings: [...planRecoveryWarnings, detail],
|
|
665
|
-
semanticAdvisor
|
|
682
|
+
...advisorReceipt(semanticAdvisor),
|
|
666
683
|
status: "committed_with_repairs",
|
|
667
684
|
effectFailures: [
|
|
668
685
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/validate-upsert.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate-upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/validate-upsert.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAWxE,OAAO,KAAK,EAIV,WAAW,EACX,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAiPpB;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC,CAkHjD"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// implements REQ-kibi-operation-interface-parity
|
|
2
2
|
import { escapeAtom } from "../../prolog/codec.js";
|
|
3
|
+
import { loadEntities } from "../../public/operations/discovery-entities.js";
|
|
3
4
|
import { entityIdStyleWarnings } from "../../utils/entity-id-style.js";
|
|
4
|
-
import { analyzeSemanticAdvisorInput } from "../semantic-advisor/analyze-prose.js";
|
|
5
|
-
import { assertSemanticInventoryBoundary } from "../semantic-advisor/ingestion-boundary.js";
|
|
6
5
|
import { entityContextWarnings } from "./context-warning.js";
|
|
7
6
|
import { buildUpsertContradictionPreviewGoal, buildWhatIfAnalysisGoal, formatUpsertError, } from "./contradictions.js";
|
|
8
7
|
import { validateRelationshipSources } from "./relationships.js";
|
|
8
|
+
import { canonicalSourcePath } from "./source-authoring.js";
|
|
9
9
|
import { validateSymbolGranularity } from "./symbol-granularity.js";
|
|
10
|
-
import { validateAppendOnlyProofReceipts, validateUpsertForCommit, } from "./upsert.js";
|
|
10
|
+
import { analyzeUpsertSemantics, 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";
|
|
@@ -16,6 +16,37 @@ async function entityExists(prolog, id) {
|
|
|
16
16
|
const result = await prolog.query(`once(kb_entity('${escapeAtom(id)}', _Type, _Props))`);
|
|
17
17
|
return result.success;
|
|
18
18
|
}
|
|
19
|
+
// implements REQ-kibi-operation-interface-parity, REQ-kb-entity-body-context
|
|
20
|
+
/**
|
|
21
|
+
* The authored document a real kb_upsert would update, resolved with the
|
|
22
|
+
* write's own rules (stored authored source, else the canonical lane path).
|
|
23
|
+
* The preview entity's `source` is the runtime marker, so without this the
|
|
24
|
+
* context warning would judge the statement instead of the existing body the
|
|
25
|
+
* write preserves. Undefined when the write would not touch a document.
|
|
26
|
+
*/
|
|
27
|
+
async function previewDocumentPath(input, entity, context) {
|
|
28
|
+
if (context.fs === undefined || context.sourceFirst === false) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const existing = context.prolog === undefined
|
|
33
|
+
? undefined
|
|
34
|
+
: (await loadEntities(context.prolog, {
|
|
35
|
+
id: input.id,
|
|
36
|
+
type: input.type,
|
|
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)) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
return canonicalSourcePath(context, input, entity, existing);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
19
50
|
// implements REQ-kibi-operation-interface-parity, REQ-kibi-truthful-consistency
|
|
20
51
|
/**
|
|
21
52
|
* The commit-time contradiction check, run against a staged and rolled-back
|
|
@@ -130,11 +161,10 @@ async function validateWithoutStore(input, context) {
|
|
|
130
161
|
await validateAppendOnlyProofReceipts(validated.entity, context);
|
|
131
162
|
validateRelationshipSources(input.id, validated.relationships);
|
|
132
163
|
await validateSymbolGranularity(validated.entity, validated.relationships, context);
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
164
|
+
const semantic = analyzeUpsertSemantics({
|
|
165
|
+
...input,
|
|
166
|
+
relationships: validated.relationships,
|
|
136
167
|
});
|
|
137
|
-
assertSemanticInventoryBoundary({ ...input, relationships }, relationships, semantic.receipt);
|
|
138
168
|
return { entity: validated.entity, semantic };
|
|
139
169
|
}
|
|
140
170
|
// implements REQ-kibi-operation-interface-parity, REQ-kibi-truthful-consistency
|
|
@@ -194,7 +224,9 @@ export async function executeValidateUpsert(input, context) {
|
|
|
194
224
|
...semantic.warnings,
|
|
195
225
|
...coverageWarnings,
|
|
196
226
|
...idStyleWarnings,
|
|
197
|
-
...entityContextWarnings(input, entity, context.workspaceRoot
|
|
227
|
+
...entityContextWarnings(input, entity, context.workspaceRoot, {
|
|
228
|
+
targetPath: await previewDocumentPath(input, entity, context),
|
|
229
|
+
}),
|
|
198
230
|
],
|
|
199
231
|
semanticAdvisor: semantic.receipt,
|
|
200
232
|
normalizedPreview: entity,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-plan.d.ts","sourceRoot":"","sources":["../../../src/operations/planning/apply-plan.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAEV,gBAAgB,EAGjB,MAAM,0CAA0C,CAAC;AASlD,OAAO,EACL,KAAK,eAAe,EAIrB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"apply-plan.d.ts","sourceRoot":"","sources":["../../../src/operations/planning/apply-plan.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAEV,gBAAgB,EAGjB,MAAM,0CAA0C,CAAC;AASlD,OAAO,EACL,KAAK,eAAe,EAIrB,MAAM,uBAAuB,CAAC;AAiE/B,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EAGhB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,aAAa,EACb,eAAe,EACf,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAG/B,eAAO,MAAM,yBAAyB,EAAG,2BAAoC,CAAC;AA6G9E,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,IAAI,CAMN;AAED,wBAAgB,mCAAmC,CACjD,SAAS,EAAE,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EAAE,EACnE,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAC3B,IAAI,CAaN;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,SAAS,cAAoB,GAC5B,eAAe,EAAE,CA2CnB;AAi1BD;;;;;;GAMG;AAEH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAiCf;AAyqDD,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,gBAAgB;AACzB;;;GAGG;AACH,WAAW,GAAE,MAAM,IAAsB,GACxC,OAAO,CAAC;IACT,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,iBAAiB,EAAE,eAAe,CAAC;CACpC,CAAC,CAmDD"}
|
|
@@ -16,7 +16,7 @@ import { canonicalFilesystemPath } from "../../utils/canonical-path.js";
|
|
|
16
16
|
import { isDerivedKbPath } from "../../utils/kb-paths.js";
|
|
17
17
|
import { bootstrapEmptyKbSnapshotId, bootstrapPlanHash, } from "../bootstrap/types.js";
|
|
18
18
|
import { validateBootstrapPayload } from "../bootstrap/validation.js";
|
|
19
|
-
import { SCHEMA6_AUTOMATIC_CODES, applySchema6MigrationAction, } from "../migration/schema6.js";
|
|
19
|
+
import { SCHEMA6_APPROVABLE_REVIEW_CODES, SCHEMA6_AUTOMATIC_CODES, applySchema6MigrationAction, } from "../migration/schema6.js";
|
|
20
20
|
import { buildUpsertBatchCommitGoal, formatUpsertError, } from "../mutation/contradictions.js";
|
|
21
21
|
import { executeDelete } from "../mutation/delete.js";
|
|
22
22
|
import { PLAN_APPLY_JOURNAL_VERSION, contentHash, createPlanApplyJournal, isPlanApplyJournalId, openPlanApplyJournal, openPlanApplyJournalById, planRecoveryNotes, publishJournaledFiles, reconcilePendingSourceReceipts, recordPlanApplyJournal, recoverPlanApplyJournal, restoreJournaledFiles, settlePendingPlanApplyJournals, storeFingerprint, withPlanRecoveryNotes, } from "../mutation/plan-apply-journal.js";
|
|
@@ -273,7 +273,8 @@ function validateMigrationPlanShape(args) {
|
|
|
273
273
|
for (const action of actions) {
|
|
274
274
|
if (action.state !== "ready")
|
|
275
275
|
throw new Error(`Migration apply failed: action '${action.id}' is blocked`);
|
|
276
|
-
if (action.safety
|
|
276
|
+
if (!(action.safety === "automatic" && action.autoApplicable === true) &&
|
|
277
|
+
!isApprovableReviewAction(action))
|
|
277
278
|
throw new Error(`Migration apply failed: action '${action.id}' is not automatic`);
|
|
278
279
|
for (const dependency of action.dependsOn) {
|
|
279
280
|
if (!selected.has(dependency))
|
|
@@ -282,6 +283,19 @@ function validateMigrationPlanShape(args) {
|
|
|
282
283
|
}
|
|
283
284
|
return actions;
|
|
284
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* A review action Kibi can execute once a person approves it by id. Callers
|
|
288
|
+
* pass the approved ids explicitly; `kibi migrate --apply-safe` without
|
|
289
|
+
* `--approved-action` selects only automatic actions, so these never run on
|
|
290
|
+
* their own.
|
|
291
|
+
*/
|
|
292
|
+
// implements REQ-agent-guided-migration-orchestration, REQ-cli-schema-migration
|
|
293
|
+
function isApprovableReviewAction(action) {
|
|
294
|
+
return (action.safety === "review" &&
|
|
295
|
+
action.autoApplicable === false &&
|
|
296
|
+
action.invocation.kind === "cli" &&
|
|
297
|
+
SCHEMA6_APPROVABLE_REVIEW_CODES.has(action.code));
|
|
298
|
+
}
|
|
285
299
|
function topologicalActions(actions) {
|
|
286
300
|
const byId = new Map(actions.map((action) => [action.id, action]));
|
|
287
301
|
const result = [];
|
|
@@ -2354,7 +2368,8 @@ async function applyMigrationAction(action, context) {
|
|
|
2354
2368
|
applyProofIntegrationAction(action, context.workspaceRoot);
|
|
2355
2369
|
return;
|
|
2356
2370
|
default:
|
|
2357
|
-
if (SCHEMA6_AUTOMATIC_CODES.has(action.code)
|
|
2371
|
+
if (SCHEMA6_AUTOMATIC_CODES.has(action.code) ||
|
|
2372
|
+
SCHEMA6_APPROVABLE_REVIEW_CODES.has(action.code)) {
|
|
2358
2373
|
await applySchema6MigrationAction(action, context);
|
|
2359
2374
|
return;
|
|
2360
2375
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../src/public/impact/diagnostics.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../src/public/impact/diagnostics.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAarF,OAAO,KAAK,EACV,iBAAiB,EACjB,gCAAgC,EAChC,mCAAmC,EACpC,MAAM,YAAY,CAAC;AAoFpB,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,mCAAmC,GAC3C,oBAAoB,EAAE,CAmExB;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,gCAAgC,GACxC,oBAAoB,EAAE,CAsBxB;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,SAAS,oBAAoB,EAAE,GAC3C,OAAO,CAET;AAED,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,SAAS,iBAAiB,EAAE,GACxC,OAAO,CAIT"}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import { extractSymbolsFromStagedFile, } from "../../traceability/symbol-extract.js";
|
|
4
|
-
import { ALLOWED_GRANULARITY_REASONS_PROSE, getBehavioralSymbolNames, getNonBehavioralSymbolNames, isAllowedGranularityReason, isTraceabilityRelationshipType, } from "../symbol-granularity.js";
|
|
5
|
-
function isNarrowerSymbol(manifestSymbolName, candidate, sourceSymbols) {
|
|
6
|
-
if (candidate.name === manifestSymbolName)
|
|
7
|
-
return false;
|
|
8
|
-
if (candidate.name.startsWith(`${manifestSymbolName}.`))
|
|
9
|
-
return true;
|
|
10
|
-
return !sourceSymbols.some((symbol) => symbol.name === manifestSymbolName);
|
|
11
|
-
}
|
|
4
|
+
import { ALLOWED_GRANULARITY_REASONS_PROSE, getBehavioralSymbolNames, getNonBehavioralSymbolNames, isAllowedGranularityReason, isTraceabilityRelationshipType, narrowerSymbols, } from "../symbol-granularity.js";
|
|
12
5
|
function hasTraceabilityRelationship(result) {
|
|
13
6
|
return result.relationships.some((relationship) => isTraceabilityRelationshipType(relationship.type));
|
|
14
7
|
}
|
|
@@ -62,6 +55,7 @@ function isChangedBehavioralReviewCandidate(symbol) {
|
|
|
62
55
|
return false;
|
|
63
56
|
return symbol.hunkRanges.length > 0;
|
|
64
57
|
}
|
|
58
|
+
// implements REQ-cli-staged-impact-enforcement, REQ-cli-check
|
|
65
59
|
export function createSymbolGranularityDiagnostics(options) {
|
|
66
60
|
const diagnostics = [];
|
|
67
61
|
for (const result of options.manifestResults) {
|
|
@@ -76,25 +70,41 @@ export function createSymbolGranularityDiagnostics(options) {
|
|
|
76
70
|
if (hasValidGranularityReason(result))
|
|
77
71
|
continue;
|
|
78
72
|
const { candidateSymbols, sourceSymbols } = getGranularSymbolsForSourceFile(result.sourceFile, options);
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
73
|
+
const narrower = narrowerSymbols(result.entity.title, candidateSymbols, sourceSymbols);
|
|
74
|
+
if (narrower.length === 0)
|
|
81
75
|
continue;
|
|
82
|
-
const behavioralNames = getBehavioralSymbolNames(
|
|
76
|
+
const behavioralNames = getBehavioralSymbolNames(narrower);
|
|
83
77
|
if (behavioralNames.length === 0)
|
|
84
78
|
continue;
|
|
85
|
-
const nonBehavioralNames = getNonBehavioralSymbolNames(
|
|
79
|
+
const nonBehavioralNames = getNonBehavioralSymbolNames(narrower);
|
|
86
80
|
const ignoredSymbolsSuggestion = nonBehavioralNames.length > 0
|
|
87
81
|
? ` Non-behavioral symbols ignored for this decision: ${nonBehavioralNames.join(", ")}.`
|
|
88
82
|
: "";
|
|
83
|
+
// A title the extractor does not produce (a private class member, a
|
|
84
|
+
// renamed or removed declaration) can never become granular by refresh:
|
|
85
|
+
// say so instead of only calling the link coarse.
|
|
86
|
+
const titleExtracted = sourceSymbols.some((symbol) => symbol.name === result.entity.title);
|
|
89
87
|
diagnostics.push({
|
|
90
88
|
id: "symbol_granularity_violation",
|
|
91
89
|
severity: "error",
|
|
92
90
|
blocking: true,
|
|
93
91
|
category: "symbol",
|
|
92
|
+
entityId: result.entity.id,
|
|
93
|
+
...(result.entity.source ? { source: result.entity.source } : {}),
|
|
94
94
|
files: [result.entity.source, result.sourceFile],
|
|
95
95
|
docs: ["docs/symbol-traceability-taxonomy.md"],
|
|
96
|
-
message:
|
|
97
|
-
|
|
96
|
+
message: titleExtracted
|
|
97
|
+
? `Symbol ${result.entity.id} links ${result.sourceFile} coarsely while granular symbols are available (behavioral only): ${behavioralNames.join(", ")}`
|
|
98
|
+
: `Symbol ${result.entity.id} names '${result.entity.title}', which the source extractor does not produce for ${result.sourceFile} (private class members and removed or renamed declarations are not tracked), so it links ${result.sourceFile} coarsely while granular symbols are available (behavioral only): ${behavioralNames.join(", ")}`,
|
|
99
|
+
suggestion: titleExtracted
|
|
100
|
+
? `Move ownership/coverage/test relationships to the narrow behavioral symbol, add a manifest behavioral anchor, or add granularity_reason with ${ALLOWED_GRANULARITY_REASONS_PROSE} when the coarse symbol is intentional.${ignoredSymbolsSuggestion}`
|
|
101
|
+
: `Re-point this symbol's relationships to the public declaration that owns the behavior (one of: ${behavioralNames.join(", ")}) or remove the symbol; add granularity_reason with ${ALLOWED_GRANULARITY_REASONS_PROSE} only when coarse ownership is intentional.${ignoredSymbolsSuggestion}`,
|
|
102
|
+
evidence: {
|
|
103
|
+
sourceFile: result.sourceFile,
|
|
104
|
+
title: result.entity.title,
|
|
105
|
+
titleExtracted,
|
|
106
|
+
granularSymbols: behavioralNames,
|
|
107
|
+
},
|
|
98
108
|
});
|
|
99
109
|
}
|
|
100
110
|
return diagnostics;
|
|
@@ -1834,7 +1834,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
1834
1834
|
readonly type: "string";
|
|
1835
1835
|
readonly enum: readonly string[];
|
|
1836
1836
|
};
|
|
1837
|
-
readonly description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, source-relationship-parity, branch-store-not-compiled, source-path-dangling, no-cycles, required-fields, deprecated-adr-no-successor, superseded-requirement-open, scenario-feasibility, scenario-feasibility-unknown, exception-claim-keys, numeric-string-value, rule-key-arguments-missing, domain-contradictions, logic-coverage, rule-safety, rule-verifiability, query-plan-safety, req-status-vocabulary, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, strict-readiness, semantic-completeness, related-requirement-unmodeled, proof-contract-symbols, entity-id-style, domain-redundancy, domain-implication, subject-key-identity, subject-key-shape, ontology-quality, exception-unapproved, exception-approval-self-attested, agent-requirement-unapproved, requirement-rationale-missing, symbol-owner-superseded, adr-unlinked, adr-proposed, predicate-schema-conformance, entity-context-missing, entity-context-acknowledged, decision-firm-unreferenced, decision-firm-superseded, 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.";
|
|
1837
|
+
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, 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.";
|
|
1838
1838
|
};
|
|
1839
1839
|
readonly sourceFiles: {
|
|
1840
1840
|
readonly type: "array";
|
|
@@ -2207,7 +2207,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
2207
2207
|
readonly plan: {
|
|
2208
2208
|
readonly type: "object";
|
|
2209
2209
|
readonly required: readonly ["version", "planHash"];
|
|
2210
|
-
readonly description: "The complete kibi.bootstrap-plan.v1, kibi.compile-plan.v1, kibi.migration-plan.v2, or hash-bound kibi.entity-deletion-plan.v1 object. Migration plans require approvedActionIds and reject blocked
|
|
2210
|
+
readonly description: "The complete kibi.bootstrap-plan.v1, kibi.compile-plan.v1, kibi.migration-plan.v2, or hash-bound kibi.entity-deletion-plan.v1 object. Migration plans require approvedActionIds and reject blocked actions and review actions Kibi cannot execute.";
|
|
2211
2211
|
};
|
|
2212
2212
|
readonly approvedActionIds: {
|
|
2213
2213
|
readonly type: "array";
|
|
@@ -2215,7 +2215,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
2215
2215
|
readonly type: "string";
|
|
2216
2216
|
readonly minLength: 1;
|
|
2217
2217
|
};
|
|
2218
|
-
readonly description: "Required for migration-plan.v2. Exact
|
|
2218
|
+
readonly description: "Required for migration-plan.v2. Exact action IDs explicitly approved for this application: automatic actions, or review actions with a cli invocation that Kibi executes only when approved by id (for example semantic_inventory_rederive_drop_grounding).";
|
|
2219
2219
|
};
|
|
2220
2220
|
readonly recoveryJournalId: {
|
|
2221
2221
|
readonly type: "string";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-executor.d.ts","sourceRoot":"","sources":["../../../src/public/operations/check-executor.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAA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GAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,6CAA6C,CAAC,EAAE,OAAO,CAAC;IACjE;;;;;;OAMG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAoFF;;;;;GAKG;AAEH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,gBAAgB,EACzB,aAAa,EAAE,MAAM,GACpB,SAAS,GAAG,IAAI,CAgClB;AAGD,wBAAsB,YAAY,CAChC,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,gBAAgB,EACzB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAqPxC"}
|
|
@@ -13,6 +13,7 @@ import { collectOriginReviewViolations } from "./origin-review.js";
|
|
|
13
13
|
import { collectPredicateSchemaConformanceViolations } from "./predicate-schema-conformance.js";
|
|
14
14
|
import { SOURCE_PATH_DANGLING_RULE, collectSourcePathDanglingViolations, } from "./source-path-dangling.js";
|
|
15
15
|
import { collectSourceRelationshipParityViolations } from "./source-relationship-parity.js";
|
|
16
|
+
import { collectSymbolGranularityViolations } from "./symbol-granularity-check.js";
|
|
16
17
|
import { readWorkspaceSnapshot } from "./workspace-snapshot.js";
|
|
17
18
|
export { buildStructuredContent, buildSummary, getEffectiveRules, resolveCheckRules, };
|
|
18
19
|
// implements REQ-search-answer-hygiene
|
|
@@ -236,6 +237,7 @@ export async function executeCheck(args, context, options = {}) {
|
|
|
236
237
|
const sourcePathFindings = rulesAllowlist.has(SOURCE_PATH_DANGLING_RULE)
|
|
237
238
|
? collectSourcePathDanglingViolations(workspaceRoot)
|
|
238
239
|
: [];
|
|
240
|
+
const symbolGranularityFindings = await collectSymbolGranularityViolations(prolog, workspaceRoot, rulesAllowlist);
|
|
239
241
|
const originReviewFindings = await collectOriginReviewViolations(prolog, rulesAllowlist, workspaceRoot);
|
|
240
242
|
const entityContextFindings = collectEntityContextViolations(rulesAllowlist, workspaceRoot);
|
|
241
243
|
const decisionFirmnessFindings = collectDecisionFirmnessViolations(rulesAllowlist, workspaceRoot);
|
|
@@ -245,6 +247,7 @@ export async function executeCheck(args, context, options = {}) {
|
|
|
245
247
|
...queryPlanViolations,
|
|
246
248
|
...sourceRelationshipParityViolations,
|
|
247
249
|
...sourcePathFindings,
|
|
250
|
+
...symbolGranularityFindings,
|
|
248
251
|
...predicateConformanceFindings,
|
|
249
252
|
...originReviewFindings,
|
|
250
253
|
...entityContextFindings,
|
|
@@ -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;AAoaD,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"}
|
|
@@ -345,7 +345,12 @@ const BASE_DATA_SCHEMAS = {
|
|
|
345
345
|
sourceType: stringValue,
|
|
346
346
|
}),
|
|
347
347
|
kb_skills_read: objectData({ content: stringValue }, ["content"]),
|
|
348
|
-
kb_query: objectData({
|
|
348
|
+
kb_query: objectData({
|
|
349
|
+
entities: recordArray,
|
|
350
|
+
count: integerValue,
|
|
351
|
+
factQuery: recordValue,
|
|
352
|
+
branchStore: recordValue,
|
|
353
|
+
}, ["entities", "count"]),
|
|
349
354
|
kb_search: objectData({
|
|
350
355
|
results: valueArray,
|
|
351
356
|
count: integerValue,
|
|
@@ -51,6 +51,8 @@ export type QueryPayload = {
|
|
|
51
51
|
readonly entities: readonly Record<string, unknown>[];
|
|
52
52
|
readonly count: number;
|
|
53
53
|
readonly factQuery?: FactQueryPayload;
|
|
54
|
+
/** Present when an empty answer came from a store never compiled for this branch. */
|
|
55
|
+
readonly branchStore?: SearchBranchStoreNotice;
|
|
54
56
|
};
|
|
55
57
|
export declare const FACT_KINDS: readonly ["subject", "property_value", "predicate", "predicate_schema", "observation", "meta", "rule", "rule_schema"];
|
|
56
58
|
export type SearchInput = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-executors.d.ts","sourceRoot":"","sources":["../../../src/public/operations/discovery-executors.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAGpB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,wBAAwB,CAAC;AA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,CAAC,eAAe,EAAE,MAAM,CAAC;QACjC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;QAChC,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,CA8DxC;AAmDD,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,CAmUzC"}
|
|
@@ -448,8 +448,11 @@ export async function executeQuery(input, context) {
|
|
|
448
448
|
? entity
|
|
449
449
|
: { ...entity, firmness };
|
|
450
450
|
});
|
|
451
|
+
// An empty page from a never-compiled store says nothing about the
|
|
452
|
+
// authored entities, so the answer names the store state.
|
|
453
|
+
const storeNotice = indexedPage.count === 0 ? uncompiledSearchNotice(context) : null;
|
|
451
454
|
const text = indexedPage.count === 0
|
|
452
|
-
? `No entities found${type ? ` of type '${type}'` : ""}.`
|
|
455
|
+
? `No entities found${type ? ` of type '${type}'` : ""}.${storeNotice ? ` Note: ${storeNotice.detail} Run kibi sync before relying on query results.` : ""}`
|
|
453
456
|
: `Found ${indexedPage.count} entities${type ? ` of type '${type}'` : ""}. Showing ${paginated.length} (offset ${offset}, limit ${limit}): ${paginated
|
|
454
457
|
.map((entity) => {
|
|
455
458
|
const entityId = String(entity.id ?? "").replace(/^file:\/\/.*\//, "");
|
|
@@ -458,7 +461,11 @@ export async function executeQuery(input, context) {
|
|
|
458
461
|
.join(", ")}`;
|
|
459
462
|
return {
|
|
460
463
|
content: [{ type: "text", text }],
|
|
461
|
-
structuredContent: {
|
|
464
|
+
structuredContent: {
|
|
465
|
+
entities: paginated,
|
|
466
|
+
count: indexedPage.count,
|
|
467
|
+
...(storeNotice ? { branchStore: storeNotice } : {}),
|
|
468
|
+
},
|
|
462
469
|
};
|
|
463
470
|
}
|
|
464
471
|
catch (error) {
|
|
@@ -77,6 +77,8 @@ export declare function withoutActionCodes(plan: MigrationPlan, codes: ReadonlyS
|
|
|
77
77
|
export declare function migrationAction(input: Partial<MigrationAction> & Pick<MigrationAction, "id" | "code">): MigrationAction;
|
|
78
78
|
/** Migration code for mechanical predicate namespace/alias repairs. */
|
|
79
79
|
export declare const PREDICATE_SCHEMA_ALIGNMENT_CODE = "predicate_schema_alignment";
|
|
80
|
+
/** Migration code of the grouped untracked-source parity findings. */
|
|
81
|
+
export declare const UNTRACKED_KNOWLEDGE_SOURCES_CODE = "untracked_knowledge_sources";
|
|
80
82
|
export declare function buildActionsFromCheck(input: {
|
|
81
83
|
violations?: readonly Readonly<Record<string, unknown>>[];
|
|
82
84
|
qualityDiagnostics?: readonly Readonly<Record<string, unknown>>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-plan.d.ts","sourceRoot":"","sources":["../../../src/public/operations/migration-plan.ts"],"names":[],"mappings":"AAiBA,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,W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