kibi-cli 2.14.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-register-proof.d.ts.map +1 -1
- package/dist/cli-register-proof.js +16 -2
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +5 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +83 -4
- package/dist/commands/prove.js +1 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +5 -2
- package/dist/operations/bootstrap/discovery.d.ts.map +1 -1
- package/dist/operations/bootstrap/discovery.js +6 -1
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +1 -0
- package/dist/operations/bootstrap/guidance-actions.d.ts +2 -1
- package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance-actions.js +10 -1
- package/dist/operations/bootstrap/guidance.d.ts +2 -0
- package/dist/operations/bootstrap/guidance.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance.js +1 -1
- package/dist/operations/bootstrap/plugin-offers.d.ts +16 -0
- package/dist/operations/bootstrap/plugin-offers.d.ts.map +1 -0
- package/dist/operations/bootstrap/plugin-offers.js +66 -0
- package/dist/operations/bootstrap/presentation.d.ts +2 -0
- package/dist/operations/bootstrap/presentation.d.ts.map +1 -1
- package/dist/operations/bootstrap/presentation.js +2 -0
- package/dist/operations/bootstrap/types.d.ts +2 -0
- package/dist/operations/bootstrap/types.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.d.ts +5 -0
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +17 -5
- package/dist/operations/modeling/predicate-applicability.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applicability.js +27 -1
- package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applyplan.js +16 -6
- package/dist/operations/modeling/predicate-binding-hints.d.ts +10 -0
- package/dist/operations/modeling/predicate-binding-hints.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-binding-hints.js +74 -0
- package/dist/operations/modeling/predicate-catalog-5.d.ts +2 -2
- package/dist/operations/modeling/predicate-catalog-5.js +2 -2
- package/dist/operations/modeling/predicate-catalog-6.d.ts +9 -0
- package/dist/operations/modeling/predicate-catalog-6.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-6.js +106 -0
- package/dist/operations/modeling/predicate-catalog.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog.js +2 -0
- package/dist/operations/modeling/predicate-usage-hints-4.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-usage-hints-4.js +32 -0
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.js +32 -11
- package/dist/operations/mutation/contradictions.d.ts +8 -0
- package/dist/operations/mutation/contradictions.d.ts.map +1 -1
- package/dist/operations/mutation/contradictions.js +13 -0
- package/dist/operations/mutation/source-authoring.d.ts +13 -0
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +70 -2
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +9 -3
- package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
- package/dist/operations/mutation/validate-upsert.js +30 -4
- package/dist/operations/planning/apply-plan.d.ts.map +1 -1
- package/dist/operations/planning/apply-plan.js +15 -0
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/ingestion-boundary.js +20 -1
- package/dist/plugins/approved-source-analyzers.generated.d.ts +5 -5
- package/dist/plugins/approved-source-analyzers.generated.js +5 -5
- package/dist/plugins/check-policies.d.ts +24 -0
- package/dist/plugins/check-policies.d.ts.map +1 -0
- package/dist/plugins/check-policies.js +73 -0
- package/dist/plugins/registry.d.ts.map +1 -1
- package/dist/plugins/registry.js +10 -1
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +8 -1
- package/dist/proof/inspect.d.ts +18 -1
- package/dist/proof/inspect.d.ts.map +1 -1
- package/dist/proof/inspect.js +17 -8
- package/dist/proof/integration-plan.d.ts +57 -0
- package/dist/proof/integration-plan.d.ts.map +1 -0
- package/dist/proof/integration-plan.js +331 -0
- package/dist/proof/integrations.js +1 -1
- package/dist/public/operations/catalog.d.ts +2 -2
- package/dist/public/operations/check-executor.d.ts +16 -0
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +83 -0
- package/dist/public/operations/check-policy-rules.d.ts +49 -0
- package/dist/public/operations/check-policy-rules.d.ts.map +1 -0
- package/dist/public/operations/check-policy-rules.js +305 -0
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +5 -0
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +13 -3
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +28 -0
- package/dist/public/operations/source-relationship-parity.d.ts.map +1 -1
- package/dist/public/operations/source-relationship-parity.js +16 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
- package/dist/public/operations/specs/check-rules.generated.js +4 -1
- package/dist/public/operations/specs/check.d.ts +1 -1
- package/dist/public/operations/specs/composite.d.ts +16 -3
- package/dist/public/operations/specs/composite.d.ts.map +1 -1
- package/dist/public/operations/specs/composite.js +79 -2
- package/dist/public/operations/specs/modeling.d.ts +1 -1
- package/dist/public/operations/specs/modeling.js +1 -1
- package/dist/public/operations/specs/reporting.d.ts +9 -0
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +6 -2
- package/dist/public/skills/kibi-bootstrap/SKILL.md +3 -2
- package/dist/public/skills/kibi-usage/SKILL.md +82 -3
- package/dist/public/skills/kibi-usage/resources/proof.md +15 -3
- package/dist/public/skills/kibi-usage/resources/ui-requirements.md +42 -3
- package/dist/report/html-report.d.ts.map +1 -1
- package/dist/report/html-report.js +13 -2
- package/dist/utils/branch-store.d.ts +32 -0
- package/dist/utils/branch-store.d.ts.map +1 -1
- package/dist/utils/branch-store.js +122 -1
- package/dist/utils/rule-registry.generated.d.ts +15 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +18 -0
- package/dist/utils/strict-modeling.d.ts +12 -0
- package/dist/utils/strict-modeling.d.ts.map +1 -1
- package/dist/utils/strict-modeling.js +12 -1
- package/package.json +4 -4
- package/src/public/operations/check-executor.ts +112 -0
- package/src/public/operations/check-policy-rules.ts +462 -0
- package/src/public/operations/contracts.ts +6 -0
- package/src/public/operations/discovery-executors.ts +19 -2
- package/src/public/operations/migration-plan.ts +35 -0
- package/src/public/operations/source-relationship-parity.ts +17 -2
- package/src/public/operations/specs/check-rules.generated.ts +4 -1
- package/src/public/operations/specs/composite.ts +110 -11
- package/src/public/operations/specs/modeling.ts +1 -1
- package/src/public/operations/specs/reporting.ts +13 -2
- package/src/public/skills/kibi-bootstrap/SKILL.md +3 -2
- package/src/public/skills/kibi-usage/SKILL.md +82 -3
- package/src/public/skills/kibi-usage/resources/proof.md +15 -3
- package/src/public/skills/kibi-usage/resources/ui-requirements.md +42 -3
|
@@ -8,6 +8,18 @@ export type SourceWriteReceipt = Readonly<{
|
|
|
8
8
|
created: boolean;
|
|
9
9
|
}>;
|
|
10
10
|
export declare function writePendingSourceReceipt(workspaceRoot: string, relativePath: string, afterHash: string): void;
|
|
11
|
+
type FileTimes = Readonly<{
|
|
12
|
+
atime: Date;
|
|
13
|
+
mtime: Date;
|
|
14
|
+
}>;
|
|
15
|
+
/** The access and modification times of a file, or `null` when unreadable. */
|
|
16
|
+
export declare function readFileTimes(absolutePath: string): FileTimes | null;
|
|
17
|
+
/**
|
|
18
|
+
* Put a restored file's times back so freshness checks, which compare file
|
|
19
|
+
* times with the compiled snapshot, do not report a rolled-back write as a
|
|
20
|
+
* newer source. Best effort: a port without a host file is left alone.
|
|
21
|
+
*/
|
|
22
|
+
export declare function restoreFileTimes(absolutePath: string, times: FileTimes | null): void;
|
|
11
23
|
/**
|
|
12
24
|
* Retire the pending receipt of a source that a committed plan deleted. A
|
|
13
25
|
* receipt binds untracked input to exact bytes, so one left behind for a
|
|
@@ -74,4 +86,5 @@ export declare function writeSourceForUpsert(input: UpsertInput, entity: Readonl
|
|
|
74
86
|
} | null>;
|
|
75
87
|
/** Resolve and normalize the canonical authored path for an entity. */
|
|
76
88
|
export declare function canonicalSourcePath(context: OperationContext, input: UpsertInput, entity: Readonly<Record<string, unknown>>, existing?: Readonly<Record<string, unknown>>): string;
|
|
89
|
+
export {};
|
|
77
90
|
//# sourceMappingURL=source-authoring.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-authoring.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/source-authoring.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAMjF,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAmBH,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,GAChB,IAAI,CAiBN;AAED;;;;GAIG;AAEH,wBAAgB,0BAA0B,CACxC,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,GACnB,IA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MAAM,GAC9B,OAAO,CAAC;IACT,OAAO,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B,GAAG,IAAI,CAAC,CA6IR;AAED,uEAAuE;AACvE,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAC3C,MAAM,CAOR"}
|
|
@@ -25,6 +25,46 @@ export function writePendingSourceReceipt(workspaceRoot, relativePath, afterHash
|
|
|
25
25
|
createdAt: new Date().toISOString(),
|
|
26
26
|
}, null, 2)}\n`, { mode: 0o600 });
|
|
27
27
|
}
|
|
28
|
+
/** The access and modification times of a file, or `null` when unreadable. */
|
|
29
|
+
// implements REQ-core-atomic-upsert-persistence
|
|
30
|
+
export function readFileTimes(absolutePath) {
|
|
31
|
+
try {
|
|
32
|
+
const stat = fs.statSync(absolutePath);
|
|
33
|
+
return { atime: stat.atime, mtime: stat.mtime };
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Put a restored file's times back so freshness checks, which compare file
|
|
41
|
+
* times with the compiled snapshot, do not report a rolled-back write as a
|
|
42
|
+
* newer source. Best effort: a port without a host file is left alone.
|
|
43
|
+
*/
|
|
44
|
+
// implements REQ-core-atomic-upsert-persistence
|
|
45
|
+
export function restoreFileTimes(absolutePath, times) {
|
|
46
|
+
if (times === null)
|
|
47
|
+
return;
|
|
48
|
+
try {
|
|
49
|
+
fs.utimesSync(absolutePath, times.atime, times.mtime);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// The bytes are restored; a failed time reset only costs a sync.
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Snapshot a pending-source receipt's bytes, or `null` when none exists, so a
|
|
57
|
+
* rolled-back write can restore the receipt exactly as it found it.
|
|
58
|
+
*/
|
|
59
|
+
// implements REQ-core-atomic-upsert-persistence
|
|
60
|
+
function readPendingSourceReceiptBytes(receiptPath) {
|
|
61
|
+
try {
|
|
62
|
+
return fs.readFileSync(receiptPath, "utf8");
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
28
68
|
/**
|
|
29
69
|
* Retire the pending receipt of a source that a committed plan deleted. A
|
|
30
70
|
* receipt binds untracked input to exact bytes, so one left behind for a
|
|
@@ -644,6 +684,10 @@ export async function writeSourceForUpsert(input, entity, existing, context, sou
|
|
|
644
684
|
catch {
|
|
645
685
|
before = undefined;
|
|
646
686
|
}
|
|
687
|
+
// Freshness compares file times with the compiled snapshot, so restoring
|
|
688
|
+
// the bytes alone would still make an untouched entity read as stale after
|
|
689
|
+
// a rolled-back write. Snapshot the times before the publication below.
|
|
690
|
+
const priorTimes = before === undefined ? null : readFileTimes(absolute);
|
|
647
691
|
// Proof-receipt ingest supplies pre-patched bytes so unrelated frontmatter
|
|
648
692
|
// keeps its authored formatting (and the workspace snapshot stays stable).
|
|
649
693
|
// Only valid when the document already exists; a new document still needs
|
|
@@ -676,6 +720,12 @@ export async function writeSourceForUpsert(input, entity, existing, context, sou
|
|
|
676
720
|
afterHash: digest(after),
|
|
677
721
|
created: before === undefined,
|
|
678
722
|
};
|
|
723
|
+
const pendingReceipt = pendingReceiptPath(context.workspaceRoot, relative);
|
|
724
|
+
// Snapshot the pending-source receipt before this write republishes it. A
|
|
725
|
+
// commit-time refusal restores the authored bytes, so the receipt must go
|
|
726
|
+
// back to the hash it bound before the write (or disappear again) or the
|
|
727
|
+
// next sync reports hash drift against a file that never changed.
|
|
728
|
+
const priorReceiptBytes = readPendingSourceReceiptBytes(pendingReceipt);
|
|
679
729
|
const rollback = async () => {
|
|
680
730
|
const fsPort = context.fs;
|
|
681
731
|
if (fsPort === undefined)
|
|
@@ -700,8 +750,14 @@ export async function writeSourceForUpsert(input, entity, existing, context, sou
|
|
|
700
750
|
await fsPort.unlink(absolute);
|
|
701
751
|
else
|
|
702
752
|
await fsPort.writeFile(absolute, "");
|
|
753
|
+
// implements REQ-core-atomic-upsert-persistence
|
|
754
|
+
// A receipt that predates this write (its file was removed outside
|
|
755
|
+
// Kibi) keeps binding the missing source so sync still reports it.
|
|
703
756
|
try {
|
|
704
|
-
|
|
757
|
+
if (priorReceiptBytes === null)
|
|
758
|
+
fs.unlinkSync(pendingReceipt);
|
|
759
|
+
else
|
|
760
|
+
fs.writeFileSync(pendingReceipt, priorReceiptBytes, { mode: 0o600 });
|
|
705
761
|
}
|
|
706
762
|
catch {
|
|
707
763
|
// The pending receipt is advisory recovery metadata.
|
|
@@ -722,9 +778,21 @@ export async function writeSourceForUpsert(input, entity, existing, context, sou
|
|
|
722
778
|
await fsPort.unlink?.(rollbackTemp).catch(() => undefined);
|
|
723
779
|
throw error;
|
|
724
780
|
}
|
|
781
|
+
// implements REQ-core-atomic-upsert-persistence
|
|
782
|
+
// The authored bytes are back to `before`; rebind the pending receipt
|
|
783
|
+
// and the file times to the same state they had before this write.
|
|
784
|
+
try {
|
|
785
|
+
if (priorReceiptBytes === null)
|
|
786
|
+
fs.unlinkSync(pendingReceipt);
|
|
787
|
+
else
|
|
788
|
+
fs.writeFileSync(pendingReceipt, priorReceiptBytes, { mode: 0o600 });
|
|
789
|
+
}
|
|
790
|
+
catch {
|
|
791
|
+
// The pending receipt is advisory recovery metadata.
|
|
792
|
+
}
|
|
793
|
+
restoreFileTimes(absolute, priorTimes);
|
|
725
794
|
}
|
|
726
795
|
};
|
|
727
|
-
const pendingReceipt = pendingReceiptPath(context.workspaceRoot, relative);
|
|
728
796
|
try {
|
|
729
797
|
if (receipt.afterHash !== null &&
|
|
730
798
|
(before === undefined || fs.existsSync(pendingReceipt))) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/upsert.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAUxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/upsert.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAUxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AA8BnF,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,eAAe,EAChB,MAAM,YAAY,CAAC;AA6CpB,wBAAgB,gCAAgC,CAC9C,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,IAAI,CAkBN;AAwCD,wBAAsB,+BAA+B,CACnD,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,OAAO,EAAE,gBAAgB,EACzB,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAqBf;AAED,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,aAAa,EAAE,SAAS,iBAAiB,EAAE,EAC3C,OAAO,EAAE,gBAAgB,EACzB,MAAM,CAAC,EAAE,iBA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argets, validateRelationshipSources, validateStrictLanePairing, validateSupersedesSourceHistory, } from "./relationships.js";
|
|
21
21
|
import { withStoredRequirementSemantics } from "./requirement-semantics.js";
|
|
22
22
|
import { MutationRollbackFailureError, MutationSaga } from "./saga.js";
|
|
23
|
-
import { writePendingSourceReceipt, writeSourceForUpsert, } from "./source-authoring.js";
|
|
23
|
+
import { readFileTimes, restoreFileTimes, writePendingSourceReceipt, writeSourceForUpsert, } from "./source-authoring.js";
|
|
24
24
|
import { storedEntityLookup, } from "./stored-entity.js";
|
|
25
25
|
import { acquireSymbolCompilerLock, releaseSymbolCompilerLock, } from "./symbol-compiler-lock.js";
|
|
26
26
|
import { validateSymbolGranularity } from "./symbol-granularity.js";
|
|
@@ -69,7 +69,7 @@ export function assertRelationshipShardContained(workspaceRoot, shardPath) {
|
|
|
69
69
|
throw new OperationError("SOURCE_PATH_INVALID", `Relationship shard follows a symlink outside the workspace: ${shardPath}`);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
function restoreRelationshipShard(shardPath, before, expectedAfterHash) {
|
|
72
|
+
function restoreRelationshipShard(shardPath, before, expectedAfterHash, beforeTimes = null) {
|
|
73
73
|
// Compare before restore: a concurrent writer may have replaced the shard
|
|
74
74
|
// after our append. Never clobber newer bytes; the next check/sync reports
|
|
75
75
|
// any canonical source path that needs reconciliation.
|
|
@@ -96,6 +96,10 @@ function restoreRelationshipShard(shardPath, before, expectedAfterHash) {
|
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
writeFileSync(shardPath, before, "utf8");
|
|
99
|
+
// implements REQ-core-atomic-upsert-persistence
|
|
100
|
+
// Freshness compares file times with the compiled snapshot; a restored
|
|
101
|
+
// shard with a new time would read as a newer source after a refusal.
|
|
102
|
+
restoreFileTimes(shardPath, beforeTimes);
|
|
99
103
|
}
|
|
100
104
|
export async function validateAppendOnlyProofReceipts(entity, context, staged) {
|
|
101
105
|
if (entity.type !== "test")
|
|
@@ -269,6 +273,7 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
269
273
|
let sourceMutationLock;
|
|
270
274
|
let operationFailure;
|
|
271
275
|
const relationshipShardBefore = new Map();
|
|
276
|
+
const relationshipShardBeforeTimes = new Map();
|
|
272
277
|
const relationshipShardAfterHash = new Map();
|
|
273
278
|
let planRecoveryWarnings = [];
|
|
274
279
|
const holdsSymbolCompilerLock = input.type === "symbol" &&
|
|
@@ -346,7 +351,7 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
346
351
|
name: "relationship-shards",
|
|
347
352
|
rollback: () => {
|
|
348
353
|
for (const [shardPath, before] of relationshipShardBefore) {
|
|
349
|
-
restoreRelationshipShard(shardPath, before, relationshipShardAfterHash.get(shardPath) ?? null);
|
|
354
|
+
restoreRelationshipShard(shardPath, before, relationshipShardAfterHash.get(shardPath) ?? null, relationshipShardBeforeTimes.get(shardPath) ?? null);
|
|
350
355
|
}
|
|
351
356
|
},
|
|
352
357
|
});
|
|
@@ -360,6 +365,7 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
360
365
|
assertRelationshipShardContained(context.workspaceRoot, shardPath);
|
|
361
366
|
if (!relationshipShardBefore.has(shardPath)) {
|
|
362
367
|
relationshipShardBefore.set(shardPath, existsSync(shardPath) ? readFileSync(shardPath, "utf8") : null);
|
|
368
|
+
relationshipShardBeforeTimes.set(shardPath, readFileTimes(shardPath));
|
|
363
369
|
}
|
|
364
370
|
appendRelationship(path.join(context.workspaceRoot, ".kb"), {
|
|
365
371
|
type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/validate-upsert.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"validate-upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/validate-upsert.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAWxE,OAAO,KAAK,EAEV,WAAW,EACX,qBAAqB,EACtB,MAAM,YAAY,CAAC;AA2EpB;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC,CAuEjD"}
|
|
@@ -4,6 +4,7 @@ import { entityIdStyleWarnings } from "../../utils/entity-id-style.js";
|
|
|
4
4
|
import { analyzeSemanticAdvisorInput } from "../semantic-advisor/analyze-prose.js";
|
|
5
5
|
import { assertSemanticInventoryBoundary } from "../semantic-advisor/ingestion-boundary.js";
|
|
6
6
|
import { entityContextWarnings } from "./context-warning.js";
|
|
7
|
+
import { buildUpsertContradictionPreviewGoal, formatUpsertError, } from "./contradictions.js";
|
|
7
8
|
import { validateRelationshipSources } from "./relationships.js";
|
|
8
9
|
import { validateSymbolGranularity } from "./symbol-granularity.js";
|
|
9
10
|
import { validateAppendOnlyProofReceipts, validateUpsertForCommit, } from "./upsert.js";
|
|
@@ -13,6 +14,25 @@ async function entityExists(prolog, id) {
|
|
|
13
14
|
const result = await prolog.query(`once(kb_entity('${escapeAtom(id)}', _Type, _Props))`);
|
|
14
15
|
return result.success;
|
|
15
16
|
}
|
|
17
|
+
// implements REQ-kibi-operation-interface-parity, REQ-kibi-truthful-consistency
|
|
18
|
+
/**
|
|
19
|
+
* The commit-time contradiction check, run against a staged and rolled-back
|
|
20
|
+
* copy of the store. Only a `req` commit runs it (facts and scenarios never
|
|
21
|
+
* do), and `_skipContradictionCheck` skips it at commit, so the preview skips
|
|
22
|
+
* it too. A refusal carries the same message the commit would raise.
|
|
23
|
+
*/
|
|
24
|
+
async function previewContradictions(prolog, input, entity, relationships) {
|
|
25
|
+
if (input.type !== "req" || input._skipContradictionCheck === true)
|
|
26
|
+
return;
|
|
27
|
+
const preview = await prolog.query(buildUpsertContradictionPreviewGoal({
|
|
28
|
+
entity,
|
|
29
|
+
relationships,
|
|
30
|
+
skipContradictionCheck: false,
|
|
31
|
+
}));
|
|
32
|
+
if (!preview.success) {
|
|
33
|
+
throw new Error(formatUpsertError(input.id, preview.error, preview.errorRecord));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
16
36
|
/**
|
|
17
37
|
* The validation chain for a runtime without a store: everything that does
|
|
18
38
|
* not need to read the KB.
|
|
@@ -39,10 +59,16 @@ async function validateWithoutStore(input, context) {
|
|
|
39
59
|
export async function executeValidateUpsert(input, context) {
|
|
40
60
|
try {
|
|
41
61
|
const { entity, semantic } = context.prolog !== undefined
|
|
42
|
-
? await validateUpsertForCommit(input, context).then((result) =>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
62
|
+
? await validateUpsertForCommit(input, context).then(async (result) => {
|
|
63
|
+
// The commit goal checks requirement contradictions after the
|
|
64
|
+
// validations above; a dry run previews that stage as well, so
|
|
65
|
+
// "valid" means the commit would not refuse the write.
|
|
66
|
+
await previewContradictions(context.prolog, input, result.validated.entity, result.validated.relationships);
|
|
67
|
+
return {
|
|
68
|
+
entity: result.validated.entity,
|
|
69
|
+
semantic: result.semantic,
|
|
70
|
+
};
|
|
71
|
+
})
|
|
46
72
|
: await validateWithoutStore(input, context);
|
|
47
73
|
// Style warnings apply only to entities this upsert would create, so the
|
|
48
74
|
// existence read happens only when the ID actually has a style issue.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-plan.d.ts","sourceRoot":"","sources":["../../../src/operations/planning/apply-plan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apply-plan.d.ts","sourceRoot":"","sources":["../../../src/operations/planning/apply-plan.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAEV,gBAAgB,EAGjB,MAAM,0CAA0C,CAAC;AASlD,OAAO,EACL,KAAK,eAAe,EAIrB,MAAM,uBAAuB,CAAC;AA+D/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;AA8zBD;;;;;;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,GACxB,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,CAkDD"}
|
|
@@ -4,12 +4,14 @@ import { OperationError } from "../../cli-errors.js";
|
|
|
4
4
|
import { branchEnsureCommand, branchMigrateCommand, branchRecoverCommand, } from "../../commands/branch.js";
|
|
5
5
|
import { migrateCommand } from "../../commands/migrate.js";
|
|
6
6
|
import { syncCommand } from "../../commands/sync.js";
|
|
7
|
+
import { PROOF_INTEGRATION_CONFIGURE, applyProofIntegrationAction, } from "../../proof/integration-plan.js";
|
|
7
8
|
import { loadEntities } from "../../public/operations/discovery-entities.js";
|
|
8
9
|
import { executeStatus } from "../../public/operations/discovery-executors.js";
|
|
9
10
|
import { PREDICATE_SCHEMA_ALIGNMENT_CODE, migrationPlanHash, } from "../../public/operations/migration-plan.js";
|
|
10
11
|
import { readMigrationConfigStatus } from "../../public/operations/migration-plan.js";
|
|
11
12
|
import { readWorkspaceSnapshot } from "../../public/operations/workspace-snapshot.js";
|
|
12
13
|
import { computeShardPath, renderShardWithRelationship, } from "../../relationships/shards.js";
|
|
14
|
+
import { BRANCH_STORE_NOT_COMPILED } from "../../utils/branch-store.js";
|
|
13
15
|
import { canonicalFilesystemPath } from "../../utils/canonical-path.js";
|
|
14
16
|
import { isDerivedKbPath } from "../../utils/kb-paths.js";
|
|
15
17
|
import { bootstrapEmptyKbSnapshotId, bootstrapPlanHash, } from "../bootstrap/types.js";
|
|
@@ -2278,6 +2280,15 @@ async function applyMigrationAction(action, context) {
|
|
|
2278
2280
|
case "missing_exact_branch_store":
|
|
2279
2281
|
await branchEnsureCommand({ workspaceRoot: context.workspaceRoot });
|
|
2280
2282
|
return;
|
|
2283
|
+
// implements REQ-cli-status-pre-first-sync
|
|
2284
|
+
case BRANCH_STORE_NOT_COMPILED: {
|
|
2285
|
+
const result = await syncCommand({
|
|
2286
|
+
workspaceRoot: context.workspaceRoot,
|
|
2287
|
+
});
|
|
2288
|
+
if (!result.success)
|
|
2289
|
+
throw new Error("Compiling the branch store (kibi sync) did not complete successfully.");
|
|
2290
|
+
return;
|
|
2291
|
+
}
|
|
2281
2292
|
case "damaged_exact_branch_store":
|
|
2282
2293
|
await branchRecoverCommand({
|
|
2283
2294
|
apply: true,
|
|
@@ -2307,6 +2318,10 @@ async function applyMigrationAction(action, context) {
|
|
|
2307
2318
|
case PREDICATE_SCHEMA_ALIGNMENT_CODE:
|
|
2308
2319
|
await applyPredicateSchemaAlignment(action, context);
|
|
2309
2320
|
return;
|
|
2321
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
2322
|
+
case PROOF_INTEGRATION_CONFIGURE:
|
|
2323
|
+
applyProofIntegrationAction(action, context.workspaceRoot);
|
|
2324
|
+
return;
|
|
2310
2325
|
default:
|
|
2311
2326
|
if (SCHEMA6_AUTOMATIC_CODES.has(action.code)) {
|
|
2312
2327
|
await applySchema6MigrationAction(action, context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestion-boundary.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/ingestion-boundary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAG3E,OAAO,EACL,KAAK,OAAO,EAOb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,sBAAsB,EAAuB,MAAM,YAAY,CAAC;AAgB9E,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,OAAO,CAAC;CACd,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"ingestion-boundary.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/ingestion-boundary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAG3E,OAAO,EACL,KAAK,OAAO,EAOb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,sBAAsB,EAAuB,MAAM,YAAY,CAAC;AAgB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
|
return bytes.subarray(start, end).toString("utf8");
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Why Kibi reads the requirement prose from `field`, so a payload that
|
|
47
|
+
* declared no (or an unknown) `semantic_source_field` can be fixed in one
|
|
48
|
+
* try: the rule is `semantic_text` when set, else `text_ref`, else `title`,
|
|
49
|
+
* and a declared field among those three is honored as given.
|
|
50
|
+
*/
|
|
51
|
+
// implements REQ-kibi-proposition-complete-ingestion
|
|
52
|
+
function semanticSourceDerivation(properties, field) {
|
|
53
|
+
const declared = stringValue(properties.semantic_source_field);
|
|
54
|
+
const declaredNote = declared
|
|
55
|
+
? `'${declared}' is not a semantic source field; `
|
|
56
|
+
: "no semantic_source_field was sent; ";
|
|
57
|
+
const derived = field === "semantic_text"
|
|
58
|
+
? "the prose comes from semantic_text because it is set"
|
|
59
|
+
: field === "text_ref"
|
|
60
|
+
? "the prose comes from text_ref because semantic_text is unset"
|
|
61
|
+
: "the prose comes from title because semantic_text and text_ref are unset";
|
|
62
|
+
return `${declaredNote}${derived}. Set semantic_source_field to '${field}' and hash that field's text, or declare one of semantic_text, text_ref or title explicitly`;
|
|
63
|
+
}
|
|
45
64
|
function propositionIsAssertive(proposition) {
|
|
46
65
|
return !CONTEXT_ROLES.has(proposition.role);
|
|
47
66
|
}
|
|
@@ -64,7 +83,7 @@ export function validateSemanticInventoryBoundary(payload, relationships, receip
|
|
|
64
83
|
errors.push(`semantic_inventory_version must be '${SEMANTIC_INVENTORY_VERSION}'`);
|
|
65
84
|
}
|
|
66
85
|
if (properties.semantic_source_field !== semanticSource.field) {
|
|
67
|
-
errors.push(`semantic_source_field must be '${semanticSource.field}' for the current requirement prose`);
|
|
86
|
+
errors.push(`semantic_source_field must be '${semanticSource.field}' for the current requirement prose (${semanticSourceDerivation(properties, semanticSource.field)})`);
|
|
68
87
|
}
|
|
69
88
|
if (properties.semantic_source_hash !== sourceHash) {
|
|
70
89
|
errors.push(`semantic_source_hash must equal the SHA-256 hash of ${semanticSource.field} (expected '${sourceHash}')`);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const qualifiedSourceAnalyzers: readonly [{
|
|
2
2
|
readonly packageName: "kibi-plugin-treesitter";
|
|
3
|
-
readonly version: "
|
|
3
|
+
readonly version: "2.0.0";
|
|
4
4
|
readonly files: {
|
|
5
|
-
readonly "SBOM.spdx.json": "
|
|
5
|
+
readonly "SBOM.spdx.json": "579e1574f09042cf85d9fa76837555c06a15f133f321fc0800fadd2f9539c52c";
|
|
6
6
|
readonly "THIRD_PARTY_NOTICES.md": "0b1ede96cb261dab73fd1ec8c51d7bb5b2492eed0502f6c10ed071736daa263c";
|
|
7
7
|
readonly "assets/queries/bash.scm": "6ca535e8fe652b51203ac272831881dab001f7ac508e50551bc2cdc4a15d7b6c";
|
|
8
8
|
readonly "assets/queries/c.scm": "774ca67cfe23b0e0d1d3a4f01788049a822beb1311feee72b20a595a37be1e28";
|
|
@@ -32,13 +32,13 @@ export declare const qualifiedSourceAnalyzers: readonly [{
|
|
|
32
32
|
readonly "assets/tree-sitter-ruby.wasm": "09a96427d7c72f0613ed470cd9812223fc4a91d6a9c025c0235cc6bd59ff96f4";
|
|
33
33
|
readonly "assets/tree-sitter-rust.wasm": "f65f354215611fd94ad34134b3427eb3d58cbb745df7b6509ba722184db73d57";
|
|
34
34
|
readonly "assets/tree-sitter-terraform.release.wasm": "59dbcbb0f08eb78b78f37510834559a48ce5c9d4866c978d62c6390796461cb5";
|
|
35
|
-
readonly "catalog.json": "
|
|
35
|
+
readonly "catalog.json": "6c1101d0e831ea11f1002edf4baeca88521ac6f4c18a2e1c64f2f030f8bf6bba";
|
|
36
36
|
readonly "dist/analysis-worker.js": "75a1e646f636c1d1ace9ae22a9141a51e94bddc70203bed08de7bd13dae1764e";
|
|
37
37
|
readonly "dist/catalog.js": "460243c48cb6a03b8c7971273729d8a1134955186978b6c0d04182c71960ebff";
|
|
38
38
|
readonly "dist/extractor.js": "1d8cd819e7ec8fcc291a44e5ffe4ccfe77099301677913fcfe0d92e7ce971f33";
|
|
39
39
|
readonly "dist/index.js": "adc03d77d94c0133b3188950b35f79db19e447cf7bfa1f7e1cf1f5c97a582a44";
|
|
40
40
|
readonly "dist/performance-timing.js": "56cce530f627c8fd079e8ec070322f84378ae50c40a6765d88b418850692940b";
|
|
41
|
-
readonly "integrity.json": "
|
|
41
|
+
readonly "integrity.json": "a77eb4b614452f158202b3f8aa91b91750dd2ad94693cc9c375460ec5b80c48b";
|
|
42
42
|
readonly "licenses/tree-sitter-bash-MIT.txt": "49bf33cf78ef5897e4e161ce1517df7de1ae5042a65b6bcfd44401e0fc606559";
|
|
43
43
|
readonly "licenses/tree-sitter-c-MIT.txt": "2e0110e07abef7c2548b26ec9d6969775617ca539a0dc8dbeeb14d6452c711d1";
|
|
44
44
|
readonly "licenses/tree-sitter-c-sharp-MIT.txt": "778fb7d63b8c1844da315648c02f325c4713a6f4a5d19644fd413421422776d3";
|
|
@@ -51,7 +51,7 @@ export declare const qualifiedSourceAnalyzers: readonly [{
|
|
|
51
51
|
readonly "licenses/tree-sitter-ruby-MIT.txt": "9c99b99e93d3c6461bef9f6bac45d17b8bf014172625c24f76319bbd235a7b80";
|
|
52
52
|
readonly "licenses/tree-sitter-rust-MIT.txt": "31d5b6f4243d5c7c6e1c4ebbbb9f6407bd1457a08bcc4f706521710341acba36";
|
|
53
53
|
readonly "licenses/web-tree-sitter-MIT.txt": "c5cfb43042b6b72045f4ba997834d0a7786d2793d91680868b5815b39f14fc78";
|
|
54
|
-
readonly "package.json": "
|
|
54
|
+
readonly "package.json": "db0277b9bfd47a242dd457bd1d4fb29bf126121734c9b393ffe6b91af5e5919b";
|
|
55
55
|
};
|
|
56
56
|
readonly dependencies: readonly [{
|
|
57
57
|
readonly packageName: "web-tree-sitter";
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
export const qualifiedSourceAnalyzers = [
|
|
5
5
|
{
|
|
6
6
|
packageName: "kibi-plugin-treesitter",
|
|
7
|
-
version: "
|
|
7
|
+
version: "2.0.0",
|
|
8
8
|
files: {
|
|
9
|
-
"SBOM.spdx.json": "
|
|
9
|
+
"SBOM.spdx.json": "579e1574f09042cf85d9fa76837555c06a15f133f321fc0800fadd2f9539c52c",
|
|
10
10
|
"THIRD_PARTY_NOTICES.md": "0b1ede96cb261dab73fd1ec8c51d7bb5b2492eed0502f6c10ed071736daa263c",
|
|
11
11
|
"assets/queries/bash.scm": "6ca535e8fe652b51203ac272831881dab001f7ac508e50551bc2cdc4a15d7b6c",
|
|
12
12
|
"assets/queries/c.scm": "774ca67cfe23b0e0d1d3a4f01788049a822beb1311feee72b20a595a37be1e28",
|
|
@@ -36,13 +36,13 @@ export const qualifiedSourceAnalyzers = [
|
|
|
36
36
|
"assets/tree-sitter-ruby.wasm": "09a96427d7c72f0613ed470cd9812223fc4a91d6a9c025c0235cc6bd59ff96f4",
|
|
37
37
|
"assets/tree-sitter-rust.wasm": "f65f354215611fd94ad34134b3427eb3d58cbb745df7b6509ba722184db73d57",
|
|
38
38
|
"assets/tree-sitter-terraform.release.wasm": "59dbcbb0f08eb78b78f37510834559a48ce5c9d4866c978d62c6390796461cb5",
|
|
39
|
-
"catalog.json": "
|
|
39
|
+
"catalog.json": "6c1101d0e831ea11f1002edf4baeca88521ac6f4c18a2e1c64f2f030f8bf6bba",
|
|
40
40
|
"dist/analysis-worker.js": "75a1e646f636c1d1ace9ae22a9141a51e94bddc70203bed08de7bd13dae1764e",
|
|
41
41
|
"dist/catalog.js": "460243c48cb6a03b8c7971273729d8a1134955186978b6c0d04182c71960ebff",
|
|
42
42
|
"dist/extractor.js": "1d8cd819e7ec8fcc291a44e5ffe4ccfe77099301677913fcfe0d92e7ce971f33",
|
|
43
43
|
"dist/index.js": "adc03d77d94c0133b3188950b35f79db19e447cf7bfa1f7e1cf1f5c97a582a44",
|
|
44
44
|
"dist/performance-timing.js": "56cce530f627c8fd079e8ec070322f84378ae50c40a6765d88b418850692940b",
|
|
45
|
-
"integrity.json": "
|
|
45
|
+
"integrity.json": "a77eb4b614452f158202b3f8aa91b91750dd2ad94693cc9c375460ec5b80c48b",
|
|
46
46
|
"licenses/tree-sitter-bash-MIT.txt": "49bf33cf78ef5897e4e161ce1517df7de1ae5042a65b6bcfd44401e0fc606559",
|
|
47
47
|
"licenses/tree-sitter-c-MIT.txt": "2e0110e07abef7c2548b26ec9d6969775617ca539a0dc8dbeeb14d6452c711d1",
|
|
48
48
|
"licenses/tree-sitter-c-sharp-MIT.txt": "778fb7d63b8c1844da315648c02f325c4713a6f4a5d19644fd413421422776d3",
|
|
@@ -55,7 +55,7 @@ export const qualifiedSourceAnalyzers = [
|
|
|
55
55
|
"licenses/tree-sitter-ruby-MIT.txt": "9c99b99e93d3c6461bef9f6bac45d17b8bf014172625c24f76319bbd235a7b80",
|
|
56
56
|
"licenses/tree-sitter-rust-MIT.txt": "31d5b6f4243d5c7c6e1c4ebbbb9f6407bd1457a08bcc4f706521710341acba36",
|
|
57
57
|
"licenses/web-tree-sitter-MIT.txt": "c5cfb43042b6b72045f4ba997834d0a7786d2793d91680868b5815b39f14fc78",
|
|
58
|
-
"package.json": "
|
|
58
|
+
"package.json": "db0277b9bfd47a242dd457bd1d4fb29bf126121734c9b393ffe6b91af5e5919b",
|
|
59
59
|
},
|
|
60
60
|
dependencies: [
|
|
61
61
|
{
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type CheckPolicyDocument } from "kibi-plugin-sdk";
|
|
2
|
+
/** A check policy read from an activated plugin package, as data. */
|
|
3
|
+
export type ActiveCheckPolicy = Readonly<{
|
|
4
|
+
packageName: string;
|
|
5
|
+
packageVersion: string;
|
|
6
|
+
document: CheckPolicyDocument;
|
|
7
|
+
}>;
|
|
8
|
+
/** Why an activated check policy could not be read. */
|
|
9
|
+
export type CheckPolicyLoadError = Readonly<{
|
|
10
|
+
packageName: string;
|
|
11
|
+
message: string;
|
|
12
|
+
}>;
|
|
13
|
+
export type CheckPolicyReadResult = Readonly<{
|
|
14
|
+
policies: readonly ActiveCheckPolicy[];
|
|
15
|
+
errors: readonly CheckPolicyLoadError[];
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Read the check policies of every package activated for
|
|
19
|
+
* `kibi.check-policy.v1`. Only package.json files and the declared policy JSON
|
|
20
|
+
* are read; no plugin module is imported, so maintenance paths such as
|
|
21
|
+
* `kb_check` stay free of third-party code.
|
|
22
|
+
*/
|
|
23
|
+
export declare function readActiveCheckPolicies(workspaceRoot: string): CheckPolicyReadResult;
|
|
24
|
+
//# sourceMappingURL=check-policies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-policies.d.ts","sourceRoot":"","sources":["../../src/plugins/check-policies.ts"],"names":[],"mappings":"AAoBA,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,iBAAiB,CAAC;AAQzB,qEAAqE;AAErE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,mBAAmB,CAAC;CAC/B,CAAC,CAAC;AAEH,uDAAuD;AAEvD,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAGH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACvC,MAAM,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACzC,CAAC,CAAC;AAoBH;;;;;GAKG;AAEH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,MAAM,GACpB,qBAAqB,CAoCvB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Kibi — repo-local, per-branch, queryable long-term memory for software projects
|
|
3
|
+
Copyright (C) 2026 Piotr Franczyk
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify
|
|
6
|
+
it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
(at your option) any later version.
|
|
9
|
+
|
|
10
|
+
This program is distributed in the hope that it will be useful,
|
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
GNU Affero General Public License for more details.
|
|
14
|
+
|
|
15
|
+
You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import * as fs from "node:fs";
|
|
19
|
+
import { join } from "node:path";
|
|
20
|
+
import { CHECK_POLICY_CAPABILITY_ID, validateCheckPolicyDocument, } from "kibi-plugin-sdk";
|
|
21
|
+
import { readProjectKibiConfig } from "./project-config.js";
|
|
22
|
+
import { assertResolvedEntryInsidePackageRoot, resolveProjectLocalPackage, } from "./resolve-package.js";
|
|
23
|
+
function message(error) {
|
|
24
|
+
return error instanceof Error ? error.message : String(error);
|
|
25
|
+
}
|
|
26
|
+
function policyPath(packageJson) {
|
|
27
|
+
const kibi = packageJson.kibi;
|
|
28
|
+
const path = typeof kibi === "object" && kibi !== null && !Array.isArray(kibi)
|
|
29
|
+
? kibi.checkPolicy
|
|
30
|
+
: undefined;
|
|
31
|
+
if (typeof path !== "string" || path.trim() === "") {
|
|
32
|
+
throw new Error(`its package.json has no kibi.checkPolicy path to a ${CHECK_POLICY_CAPABILITY_ID} document`);
|
|
33
|
+
}
|
|
34
|
+
return path;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Read the check policies of every package activated for
|
|
38
|
+
* `kibi.check-policy.v1`. Only package.json files and the declared policy JSON
|
|
39
|
+
* are read; no plugin module is imported, so maintenance paths such as
|
|
40
|
+
* `kb_check` stay free of third-party code.
|
|
41
|
+
*/
|
|
42
|
+
// implements REQ-capability-check-policy
|
|
43
|
+
export function readActiveCheckPolicies(workspaceRoot) {
|
|
44
|
+
let entries;
|
|
45
|
+
try {
|
|
46
|
+
entries = (readProjectKibiConfig(workspaceRoot).plugins ?? []).filter((entry) => entry.capabilities[CHECK_POLICY_CAPABILITY_ID] !== undefined);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return {
|
|
50
|
+
policies: [],
|
|
51
|
+
errors: [{ packageName: "package.json", message: message(error) }],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const policies = [];
|
|
55
|
+
const errors = [];
|
|
56
|
+
for (const entry of entries) {
|
|
57
|
+
try {
|
|
58
|
+
const resolved = resolveProjectLocalPackage(workspaceRoot, entry.package);
|
|
59
|
+
const documentPath = assertResolvedEntryInsidePackageRoot(resolved.packageRoot, join(resolved.packageRoot, policyPath(resolved.packageJson)));
|
|
60
|
+
const document = validateCheckPolicyDocument(JSON.parse(fs.readFileSync(documentPath, "utf8")));
|
|
61
|
+
const version = resolved.packageJson.version;
|
|
62
|
+
policies.push({
|
|
63
|
+
packageName: entry.package,
|
|
64
|
+
packageVersion: typeof version === "string" ? version : "unknown",
|
|
65
|
+
document,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
errors.push({ packageName: entry.package, message: message(error) });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return { policies, errors };
|
|
73
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/plugins/registry.ts"],"names":[],"mappings":"AAkBA,OAAO,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/plugins/registry.ts"],"names":[],"mappings":"AAkBA,OAAO,EAGL,KAAK,YAAY,EAGjB,KAAK,YAAY,EAEjB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB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OAAO,CACzC,wBAAwB,CAAC,qBAAqB,CAAC,CAChD;IAMK,iBAAiB,CACrB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAc7C;;;OAGG;IACH,kBAAkB,CAAC,CAAC,EAClB,UAAU,EAAE,wBAAwB,CAAC,CAAC,CAAC,GACtC,SAAS,yBAAyB,CAAC,CAAC,CAAC,EAAE;YAO5B,yBAAyB;YAyFzB,mBAAmB;CAsBlC;AAED;;GAEG;AAEH,qBAAa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyC;IAEpE,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAI1D,WAAW,CACT,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC,GACzD,kBAAkB;IAWrB,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,GAAG,IAAI;IAI9D,KAAK,IAAI,IAAI;CAGd;AAGD,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,yBAAyB,GACjC,kBAAkB,CAEpB;AAGD,wBAAgB,6BAA6B,IAAI,uBAAuB,CAEvE;AAGD,MAAM,MAAM,+BAA+B,GAAG,yBAAyB,GAAG;IACxE,QAAQ,CAAC,KAAK,CAAC,EAAE,uBAAuB,CAAC;CAC1C,CAAC;AAEF;;;GAGG;AAEH,wBAAgB,wBAAwB,CACtC,sBAAsB,EAAE,MAAM,GAAG,+BAA+B,EAChE,OAAO,CAAC,EAAE,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC,GAAG;IAC3D,QAAQ,CAAC,KAAK,CAAC,EAAE,uBAAuB,CAAC;CAC1C,GACA,kBAAkB,CAoBpB"}
|
package/dist/plugins/registry.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import { KIBI_PLUGIN_API_VERSION, ONTOLOGY_PACK_CAPABILITY_ID, SEMANTIC_CLASSIFIER_CAPABILITY_ID, SYMBOL_EXTRACTOR_CAPABILITY_ID, SYMBOL_EXTRACTOR_V2_CAPABILITY_ID, VOCABULARY_ALIGNMENT_CAPABILITY_ID, defineKibiPlugin, validateKibiPlugin, } from "kibi-plugin-sdk";
|
|
18
|
+
import { CHECK_POLICY_CAPABILITY_ID, CHECK_POLICY_CONTRACT_VERSION, KIBI_PLUGIN_API_VERSION, ONTOLOGY_PACK_CAPABILITY_ID, SEMANTIC_CLASSIFIER_CAPABILITY_ID, SYMBOL_EXTRACTOR_CAPABILITY_ID, SYMBOL_EXTRACTOR_V2_CAPABILITY_ID, VOCABULARY_ALIGNMENT_CAPABILITY_ID, defineKibiPlugin, validateKibiPlugin, } from "kibi-plugin-sdk";
|
|
19
19
|
import { loadPluginPackage } from "./load-plugin.js";
|
|
20
20
|
import { readProjectKibiConfig } from "./project-config.js";
|
|
21
21
|
import { PluginResolutionError } from "./resolve-package.js";
|
|
@@ -25,6 +25,7 @@ const CAPABILITY_SLOT = {
|
|
|
25
25
|
[SYMBOL_EXTRACTOR_CAPABILITY_ID]: "symbolExtractor",
|
|
26
26
|
[SYMBOL_EXTRACTOR_V2_CAPABILITY_ID]: "symbolExtractorV2",
|
|
27
27
|
[VOCABULARY_ALIGNMENT_CAPABILITY_ID]: "vocabularyAlignment",
|
|
28
|
+
[CHECK_POLICY_CAPABILITY_ID]: "checkPolicy",
|
|
28
29
|
};
|
|
29
30
|
/**
|
|
30
31
|
* Minimal builtin used when no factory is injected and the builtin package is
|
|
@@ -83,6 +84,14 @@ export function createStubBuiltinPlugin() {
|
|
|
83
84
|
})),
|
|
84
85
|
}),
|
|
85
86
|
},
|
|
87
|
+
checkPolicy: {
|
|
88
|
+
id: "kibi-plugin-builtin-stub.check-policy",
|
|
89
|
+
document: {
|
|
90
|
+
contractVersion: CHECK_POLICY_CONTRACT_VERSION,
|
|
91
|
+
id: "builtin-stub",
|
|
92
|
+
title: "Builtin stub check policy",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
86
95
|
},
|
|
87
96
|
}));
|
|
88
97
|
}
|
package/dist/prolog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prolog.d.ts","sourceRoot":"","sources":["../src/prolog.ts"],"names":[],"mappings":"AA2BA,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,4BAA4B,CAAC;AAUpC,wBAAgB,eAAe,IAAI,MAAM,CAsCxC;AACD,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,aAAa,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,IAAI,+BAA+B;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,MAAM;CAO3B;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC;AAGD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,EAC5B,OAAO,EAAE,MAAM,IAAI,EACnB,EAAE,GAAE,CAAC,KAAK,EAAE,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