kibi-cli 0.16.1 → 0.17.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/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +1 -1
- package/dist/commands/sync/manifest.d.ts +12 -1
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +22 -5
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +18 -1
- package/dist/extractors/markdown.d.ts +9 -1
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +12 -0
- package/dist/logic/ir.d.ts +112 -0
- package/dist/logic/ir.d.ts.map +1 -0
- package/dist/logic/ir.js +729 -0
- package/dist/operations/modeling/logic-modeling.d.ts +22 -0
- package/dist/operations/modeling/logic-modeling.d.ts.map +1 -0
- package/dist/operations/modeling/logic-modeling.js +111 -0
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +56 -0
- package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applyplan.js +15 -2
- package/dist/operations/modeling/predicate-inference.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-inference.js +17 -2
- package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-loader.js +6 -0
- package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-ranker.js +40 -2
- package/dist/operations/modeling/predicate-types.d.ts +3 -0
- package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
- package/dist/operations/modeling/requirement-types.d.ts +12 -0
- package/dist/operations/modeling/requirement-types.d.ts.map +1 -1
- package/dist/operations/mutation/relationships.d.ts.map +1 -1
- package/dist/operations/mutation/relationships.js +8 -0
- package/dist/operations/mutation/serialization.d.ts.map +1 -1
- package/dist/operations/mutation/serialization.js +3 -0
- package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
- package/dist/operations/mutation/strict-fact.js +68 -3
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts +2 -2
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analysis-receipt.js +23 -15
- package/dist/operations/semantic-advisor/analyze-prose.d.ts +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +435 -13
- package/dist/operations/semantic-advisor/observation-plan.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/observation-plan.js +15 -3
- package/dist/operations/semantic-advisor/shared.d.ts +1 -0
- package/dist/operations/semantic-advisor/shared.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/shared.js +1 -1
- package/dist/operations/semantic-advisor/types.d.ts +61 -1
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +11 -1
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +7 -2
- package/dist/public/operations/catalog.d.ts +85 -6
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/index.d.ts +1 -0
- package/dist/public/operations/index.d.ts.map +1 -1
- package/dist/public/operations/index.js +1 -0
- package/dist/public/operations/specs/check.d.ts +2 -2
- package/dist/public/operations/specs/check.d.ts.map +1 -1
- package/dist/public/operations/specs/check.js +4 -1
- package/dist/public/operations/specs/modeling.d.ts +16 -0
- package/dist/public/operations/specs/modeling.d.ts.map +1 -1
- package/dist/public/operations/specs/modeling.js +16 -0
- package/dist/public/operations/specs/mutation-schemas.d.ts +37 -2
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +27 -0
- package/dist/public/operations/specs/semantic.d.ts +30 -2
- package/dist/public/operations/specs/semantic.d.ts.map +1 -1
- package/dist/public/operations/specs/semantic.js +34 -2
- package/dist/public/operations/specs/upsert.d.ts +37 -2
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +290 -0
- package/dist/public/schemas/relationship.d.ts.map +1 -1
- package/dist/public/schemas/relationship.js +1 -0
- package/dist/public/skills/kibi-usage/SKILL.md +35 -9
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +11 -1
- package/dist/public/skills/kibi-usage/resources/logic-ir.md +43 -0
- package/dist/public/skills/kibi-usage/resources/operation-access.md +19 -19
- package/dist/public/skills/kibi-usage/resources/ui-requirements.md +96 -0
- package/dist/public/skills/kibi-usage/resources/workflows.md +21 -6
- package/dist/public/symbol-granularity.d.ts +9 -0
- package/dist/public/symbol-granularity.d.ts.map +1 -1
- package/dist/public/symbol-granularity.js +16 -0
- package/dist/schemas/entity.schema.json +306 -3
- package/dist/traceability/staged-diagnostics.d.ts +1 -1
- package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
- package/dist/traceability/staged-diagnostics.js +17 -10
- package/dist/traceability/staged-impact-contract.js +1 -1
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +28 -10
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +13 -0
- package/dist/types/relationships.d.ts +1 -1
- package/dist/types/relationships.d.ts.map +1 -1
- package/dist/utils/rule-registry.d.ts.map +1 -1
- package/dist/utils/rule-registry.js +18 -0
- package/dist/utils/schema-version.d.ts +1 -1
- package/dist/utils/schema-version.js +1 -1
- package/package.json +6 -2
- package/src/public/operations/index.ts +1 -0
- package/src/public/operations/specs/check.ts +4 -1
- package/src/public/operations/specs/modeling.ts +20 -0
- package/src/public/operations/specs/mutation-schemas.ts +30 -0
- package/src/public/operations/specs/semantic.ts +41 -2
- package/src/public/schemas/entity.ts +297 -1
- package/src/public/schemas/relationship.ts +1 -0
- package/src/public/skills/kibi-usage/SKILL.md +35 -9
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +11 -1
- package/src/public/skills/kibi-usage/resources/logic-ir.md +43 -0
- package/src/public/skills/kibi-usage/resources/operation-access.md +19 -19
- package/src/public/skills/kibi-usage/resources/ui-requirements.md +96 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +21 -6
- package/src/public/symbol-granularity.ts +25 -0
- package/src/schemas/entity.schema.json +306 -3
- package/src/schemas/relationship.schema.json +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type LogicRuleIR } from "../../logic/ir.js";
|
|
2
|
+
export interface LogicApplyPlanInput {
|
|
3
|
+
readonly text: string;
|
|
4
|
+
readonly logic: LogicRuleIR;
|
|
5
|
+
readonly source: string;
|
|
6
|
+
readonly requirementId?: string;
|
|
7
|
+
readonly existingLogicClaims?: readonly string[];
|
|
8
|
+
readonly claimKey?: string;
|
|
9
|
+
readonly claimText?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface LogicApplyPlanResult {
|
|
12
|
+
readonly normalized: LogicRuleIR;
|
|
13
|
+
readonly ruleHash: string;
|
|
14
|
+
readonly semanticKey: string;
|
|
15
|
+
readonly claimKey: string;
|
|
16
|
+
readonly claimText: string;
|
|
17
|
+
readonly renderedProlog: string;
|
|
18
|
+
readonly applyPlan: Array<Record<string, unknown>>;
|
|
19
|
+
}
|
|
20
|
+
export declare function logicRuleFactId(semanticKey: string): string;
|
|
21
|
+
export declare function buildLogicApplyPlan(input: LogicApplyPlanInput): LogicApplyPlanResult;
|
|
22
|
+
//# sourceMappingURL=logic-modeling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logic-modeling.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/logic-modeling.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACpD;AAUD,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,mBAAmB,GACzB,oBAAoB,CAwGtB"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { logicSemanticKey, utf8Span, validateLogicIr, } from "../../logic/ir.js";
|
|
3
|
+
import { semanticClaimKey } from "../semantic-advisor/clauses.js";
|
|
4
|
+
function shortId(value) {
|
|
5
|
+
return createHash("sha256")
|
|
6
|
+
.update(value)
|
|
7
|
+
.digest("hex")
|
|
8
|
+
.slice(0, 16)
|
|
9
|
+
.toUpperCase();
|
|
10
|
+
}
|
|
11
|
+
export function logicRuleFactId(semanticKey) {
|
|
12
|
+
return `FACT-RULE-${shortId(semanticKey)}`;
|
|
13
|
+
}
|
|
14
|
+
export function buildLogicApplyPlan(input) {
|
|
15
|
+
const validation = validateLogicIr(input.logic);
|
|
16
|
+
if (!validation.valid ||
|
|
17
|
+
!validation.normalized ||
|
|
18
|
+
!validation.ruleHash ||
|
|
19
|
+
!validation.semanticKey ||
|
|
20
|
+
!validation.renderedProlog) {
|
|
21
|
+
throw new Error(`Logic IR validation failed: ${validation.errors.join("; ")}`);
|
|
22
|
+
}
|
|
23
|
+
const claimText = input.claimText?.trim() || input.text.trim();
|
|
24
|
+
const claimKey = input.claimKey || semanticClaimKey(claimText);
|
|
25
|
+
const semanticKey = logicSemanticKey(validation.normalized);
|
|
26
|
+
const schemaId = validation.normalized.ruleSchemaId ?? "FACT-RULE-SCHEMA-LOGIC-V1";
|
|
27
|
+
const ruleId = logicRuleFactId(semanticKey);
|
|
28
|
+
const span = utf8Span(input.text, 0, input.text.length);
|
|
29
|
+
const logicClaims = Array.from(new Set([...(input.existingLogicClaims ?? []), claimKey]));
|
|
30
|
+
const schemaPlan = input.logic.ruleSchemaId
|
|
31
|
+
? []
|
|
32
|
+
: [
|
|
33
|
+
{
|
|
34
|
+
type: "fact",
|
|
35
|
+
id: schemaId,
|
|
36
|
+
properties: {
|
|
37
|
+
title: "kibi.logic.v1 rule schema",
|
|
38
|
+
status: "active",
|
|
39
|
+
source: input.source,
|
|
40
|
+
fact_kind: "rule_schema",
|
|
41
|
+
rule_name: "kibi.logic.v1",
|
|
42
|
+
argument_names: ["rule_ir"],
|
|
43
|
+
argument_types: ["logic_ir"],
|
|
44
|
+
aliases: ["conditional rule", "constraint", "policy rule"],
|
|
45
|
+
examples: [validation.renderedProlog],
|
|
46
|
+
},
|
|
47
|
+
relationships: [],
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
return {
|
|
51
|
+
normalized: validation.normalized,
|
|
52
|
+
ruleHash: validation.ruleHash,
|
|
53
|
+
semanticKey,
|
|
54
|
+
claimKey,
|
|
55
|
+
claimText,
|
|
56
|
+
renderedProlog: validation.renderedProlog,
|
|
57
|
+
applyPlan: [
|
|
58
|
+
...schemaPlan,
|
|
59
|
+
{
|
|
60
|
+
type: "fact",
|
|
61
|
+
id: ruleId,
|
|
62
|
+
properties: {
|
|
63
|
+
title: `${validation.normalized.kind} rule ${semanticKey}`,
|
|
64
|
+
status: "active",
|
|
65
|
+
source: input.source,
|
|
66
|
+
fact_kind: "rule",
|
|
67
|
+
rule_ir: validation.normalized,
|
|
68
|
+
rule_hash: validation.ruleHash,
|
|
69
|
+
semantic_key: semanticKey,
|
|
70
|
+
rule_schema_id: schemaId,
|
|
71
|
+
rule_name: validation.normalized.ruleSchemaId ?? "kibi.logic.v1",
|
|
72
|
+
canonical_key: semanticKey,
|
|
73
|
+
claim_key: claimKey,
|
|
74
|
+
claim_text: claimText,
|
|
75
|
+
claim_span_start: span.start,
|
|
76
|
+
claim_span_end: span.end,
|
|
77
|
+
tags: ["lane:logic", "logic-ir-v1"],
|
|
78
|
+
},
|
|
79
|
+
relationships: [],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
type: "req",
|
|
83
|
+
id: input.requirementId ?? `REQ-LOGIC-${shortId(claimText)}`,
|
|
84
|
+
properties: {
|
|
85
|
+
title: claimText.split(/[.!?]/, 1)[0] || "Typed logical requirement",
|
|
86
|
+
status: "open",
|
|
87
|
+
source: input.source,
|
|
88
|
+
text_ref: claimText,
|
|
89
|
+
logic_claims: logicClaims,
|
|
90
|
+
semantic_inventory: [
|
|
91
|
+
{
|
|
92
|
+
claim_key: claimKey,
|
|
93
|
+
claim_text: claimText,
|
|
94
|
+
role: "normative",
|
|
95
|
+
status: "modeled",
|
|
96
|
+
span,
|
|
97
|
+
semantic_key: semanticKey,
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
relationships: [
|
|
102
|
+
{
|
|
103
|
+
type: "requires_rule",
|
|
104
|
+
from: input.requirementId ?? `REQ-LOGIC-${shortId(claimText)}`,
|
|
105
|
+
to: ruleId,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-requirement.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/model-requirement.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"model-requirement.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/model-requirement.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAIjF,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAMhC,YAAY,EACV,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,GACxB,CAAC;AAEF,wBAAsB,4BAA4B,CAChD,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgBxB;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,oBAAoB,EAC1B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,sBAAsB,CAAC,CA4IjC;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,sBAAsB,CAAC,CAEjC"}
|
|
@@ -3,6 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import { buildStrictWriteSet } from "../../public/check-types.js";
|
|
4
4
|
import { getSchemaVersionStatus } from "../../public/schema-version.js";
|
|
5
5
|
import { semanticClaimKey } from "../semantic-advisor/clauses.js";
|
|
6
|
+
import { buildLogicApplyPlan } from "./logic-modeling.js";
|
|
6
7
|
import { strictWriteSetToApplyPlan, writeSetPrimaryEntityId, } from "./requirement-applyplan.js";
|
|
7
8
|
import { estimateNormativeSignalConfidence, extractRequirementClaim, } from "./requirement-modeler.js";
|
|
8
9
|
import { normalizeOptionalString, normalizeSourceFiles, } from "./requirement-utils.js";
|
|
@@ -31,6 +32,61 @@ export async function handleKbModelRequirement(_prolog, args, workspaceRoot) {
|
|
|
31
32
|
normalizeSourceFiles(args.sourceFiles)[0] ??
|
|
32
33
|
"mcp://kibi/model-requirement",
|
|
33
34
|
});
|
|
35
|
+
if (args.logic !== undefined) {
|
|
36
|
+
const logicPlan = buildLogicApplyPlan({
|
|
37
|
+
text: args.text,
|
|
38
|
+
logic: args.logic,
|
|
39
|
+
source: extracted.source,
|
|
40
|
+
...(typeof args.requirementId === "string"
|
|
41
|
+
? { requirementId: args.requirementId }
|
|
42
|
+
: {}),
|
|
43
|
+
...(args.existingLogicClaims !== undefined
|
|
44
|
+
? { existingLogicClaims: args.existingLogicClaims }
|
|
45
|
+
: {}),
|
|
46
|
+
...(args.claimKey !== undefined ? { claimKey: args.claimKey } : {}),
|
|
47
|
+
...(args.claimText !== undefined ? { claimText: args.claimText } : {}),
|
|
48
|
+
});
|
|
49
|
+
const fallbackWriteSet = buildStrictWriteSet({
|
|
50
|
+
claim: extracted.claim,
|
|
51
|
+
statement: extracted.statement,
|
|
52
|
+
});
|
|
53
|
+
const migrationWarning = await getWorkspaceMigrationWarning(workspaceRoot);
|
|
54
|
+
const structuredContent = {
|
|
55
|
+
statement: extracted.statement,
|
|
56
|
+
claimKey: logicPlan.claimKey,
|
|
57
|
+
logicClaims: Array.from(new Set([...(args.existingLogicClaims ?? []), logicPlan.claimKey])),
|
|
58
|
+
source: extracted.source,
|
|
59
|
+
sourceFiles: extracted.sourceFiles,
|
|
60
|
+
claim: extracted.claim,
|
|
61
|
+
writeSet: fallbackWriteSet,
|
|
62
|
+
applyPlan: logicPlan.applyPlan,
|
|
63
|
+
isStrict: false,
|
|
64
|
+
confidence: args.confidence ?? 1,
|
|
65
|
+
extractionMode: extracted.extractionMode,
|
|
66
|
+
extractionWarnings: extracted.extractionWarnings,
|
|
67
|
+
warnings: [],
|
|
68
|
+
migrationWarning,
|
|
69
|
+
logic: {
|
|
70
|
+
semanticKey: logicPlan.semanticKey,
|
|
71
|
+
claimKey: logicPlan.claimKey,
|
|
72
|
+
claimText: logicPlan.claimText,
|
|
73
|
+
renderedProlog: logicPlan.renderedProlog,
|
|
74
|
+
normalized: logicPlan.normalized,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
content: [
|
|
79
|
+
{
|
|
80
|
+
type: "text",
|
|
81
|
+
text: `Modeled typed kibi.logic.v1 rule ${logicPlan.semanticKey}; apply the returned schema, rule, and requirement steps sequentially.`,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
structuredContent,
|
|
85
|
+
applyPlan: logicPlan.applyPlan,
|
|
86
|
+
writeSet: fallbackWriteSet,
|
|
87
|
+
migrationWarning,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
34
90
|
const writeSet = buildStrictWriteSet({
|
|
35
91
|
claim: extracted.claim,
|
|
36
92
|
statement: extracted.statement,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predicate-applyplan.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-applyplan.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAI9B,wBAAgB,eAAe,CAC7B,MAAM,EAAE,wBAAwB,EAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,mBAAmB,
|
|
1
|
+
{"version":3,"file":"predicate-applyplan.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-applyplan.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAI9B,wBAAgB,eAAe,CAC7B,MAAM,EAAE,wBAAwB,EAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,mBAAmB,CAuBrB;AAGD,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,mBAAmB,EAC/B,IAAI,EAAE,qBAAqB,GAC1B,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAgChC;AAGD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,SAAS,CAAC,EAAE,MAAM,EAClB,mBAAmB,GAAE,SAAS,MAAM,EAAO,GAC1C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAwBhC;AAGD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,qBAAqB,GAC1B,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA+BhC"}
|
|
@@ -6,12 +6,19 @@ import { hashId } from "./predicate-utils.js";
|
|
|
6
6
|
export function buildSuggestion(schema, text, subject, score) {
|
|
7
7
|
const predicateArgs = inferArgs(schema, text, subject);
|
|
8
8
|
const canonicalKey = `${schema.predicate_name}(${predicateArgs.join(",")})`;
|
|
9
|
+
// Permission-style inference carries the deontic decision as its final
|
|
10
|
+
// argument. Preserve that polarity in the typed suggestion instead of
|
|
11
|
+
// silently turning a prohibition into an assertion.
|
|
12
|
+
const polarity = predicateArgs.at(-1) === "deny" ||
|
|
13
|
+
/\b(?:must\s+not|shall\s+not|never|cannot|can't|forbidden|prohibited)\b/i.test(text)
|
|
14
|
+
? "deny"
|
|
15
|
+
: "assert";
|
|
9
16
|
return {
|
|
10
17
|
id: hashId("SUGGEST", [schema.id, canonicalKey, text]),
|
|
11
18
|
predicate_name: schema.predicate_name,
|
|
12
19
|
predicate_args: predicateArgs,
|
|
13
20
|
canonical_key: canonicalKey,
|
|
14
|
-
polarity
|
|
21
|
+
polarity,
|
|
15
22
|
score,
|
|
16
23
|
rationale: `Matched ${schema.predicate_name} because the prose overlaps with ${schema.tags.join(", ")} cues.`,
|
|
17
24
|
schema: schemaForCandidate(schema),
|
|
@@ -98,7 +105,13 @@ export function buildGapApplyPlan(text, args) {
|
|
|
98
105
|
claim_key: claimKey,
|
|
99
106
|
claim_text: text,
|
|
100
107
|
},
|
|
101
|
-
relationships: [
|
|
108
|
+
relationships: [
|
|
109
|
+
{
|
|
110
|
+
type: "relates_to",
|
|
111
|
+
from: factId,
|
|
112
|
+
to: "review:ontology-gap",
|
|
113
|
+
},
|
|
114
|
+
],
|
|
102
115
|
},
|
|
103
116
|
];
|
|
104
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predicate-inference.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-inference.ts"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EASL,YAAY,
|
|
1
|
+
{"version":3,"file":"predicate-inference.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-inference.ts"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EASL,YAAY,EAKb,MAAM,sBAAsB,CAAC;AAG9B,wBAAgB,SAAS,CACvB,MAAM,EAAE,wBAAwB,EAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,MAAM,EAAE,CA0JV;AAGD,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { inferAuditEventRuleArgs, inferAvailabilitySlaArgs, inferConsentRuleArgs, inferDataResidencyRuleArgs, inferDependencyRuleArgs, inferEscalationRuleArgs, inferExceptionRuleArgs, inferGuardArgs, inferIdempotencyRuleArgs, inferLifecycleRuleArgs, inferMutualExclusionArgs, inferNotificationRouteArgs, inferOwnershipRuleArgs, inferPermissionRuleArgs, inferRetryPolicyArgs, } from "./predicate-inference-1.js";
|
|
2
2
|
import { inferAbsenceRequirementArgs, inferAbstractionBoundaryRuleArgs, inferBatchOperationRuleArgs, inferBuildConstraintArgs, inferCodingStandardRuleArgs, inferConflictResolutionRuleArgs, inferConsistencyRuleArgs, inferEnvironmentSafetyRuleArgs, inferFallbackRuleArgs, inferMigrationBoundaryRuleArgs, inferOfflineBehaviorRuleArgs, inferOrderedStrategyRuleArgs, inferPlatformConsistencyRuleArgs, inferPreservationRuleArgs, inferRefreshPolicyRuleArgs, inferReleaseGateRuleArgs, inferSchemaInvariantRuleArgs, inferSecurityConfigurationRuleArgs, } from "./predicate-inference-2.js";
|
|
3
3
|
import { inferConditionalBehaviorArgs, inferDefaultValueArgs, inferDocumentationStandardRuleArgs, inferEnforcementLocationRuleArgs, inferRateLimitArgs, inferReconciliationRuleArgs, inferScopedAuthorizationRuleArgs, inferStateMembershipArgs, inferStateTransitionArgs, inferTemporalOrderArgs, inferThrottlePolicyRuleArgs, inferUniquenessArgs, inferVisualLayoutRuleArgs, inferWarmupPolicyRuleArgs, } from "./predicate-inference-3.js";
|
|
4
|
-
import { inferDuration, inferDurationUnit, inferEvent, inferGate, inferNumber, inferOperator, inferResource, inferScope, inferSubject, inferTrigger, inferUnit, slug, } from "./predicate-utils.js";
|
|
4
|
+
import { inferDuration, inferDurationUnit, inferEvent, inferGate, inferNumber, inferOperator, inferResource, inferScope, inferSubject, inferTrigger, inferUnit, normalizePredicateToken, slug, } from "./predicate-utils.js";
|
|
5
5
|
// implements REQ-mcp-suggest-predicates
|
|
6
6
|
export function inferArgs(schema, text, subject) {
|
|
7
7
|
const lower = text.toLowerCase();
|
|
@@ -141,7 +141,22 @@ export function inferArgs(schema, text, subject) {
|
|
|
141
141
|
case "rate_limit":
|
|
142
142
|
return inferRateLimitArgs(text);
|
|
143
143
|
default:
|
|
144
|
-
return schema.argument_names.map((name) =>
|
|
144
|
+
return schema.argument_names.map((name) => {
|
|
145
|
+
if (name === "subject")
|
|
146
|
+
return subject;
|
|
147
|
+
const normalized = normalizePredicateToken(name);
|
|
148
|
+
const words = normalized.split("_").filter((word) => word.length > 2);
|
|
149
|
+
// Project-local schemas often use the exact domain vocabulary in
|
|
150
|
+
// their ordered argument names. Reuse that declared value when the
|
|
151
|
+
// complete name (or all meaningful words) occurs in the claim; keep
|
|
152
|
+
// genuinely unbound arguments explicit instead of guessing.
|
|
153
|
+
const phrase = words.join(" ");
|
|
154
|
+
return phrase.length > 0 &&
|
|
155
|
+
(lower.includes(phrase) ||
|
|
156
|
+
words.every((word) => lower.includes(word)))
|
|
157
|
+
? normalized
|
|
158
|
+
: "unknown";
|
|
159
|
+
});
|
|
145
160
|
}
|
|
146
161
|
}
|
|
147
162
|
// implements REQ-mcp-suggest-predicates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predicate-loader.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAK3E,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAI9B,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CACxE,wBAAwB,EACxB,UAAU,CACX,GAAG;IACF,WAAW,EAAE,mBAAmB,CAAC;CAClC,
|
|
1
|
+
{"version":3,"file":"predicate-loader.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAK3E,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAI9B,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CACxE,wBAAwB,EACxB,UAAU,CACX,GAAG;IACF,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAmBA;AAGD,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,UAAU,GAAG,IAAI,EACzB,sBAAsB,EAAE,OAAO,EAC/B,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAwBrC;AAGD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,wBAAwB,EAAE,CAiC5B;AAGD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,mBAAmB,GAAG,SAAS,CAOjC;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAQpD"}
|
|
@@ -10,6 +10,10 @@ export function schemaForCandidate(schema) {
|
|
|
10
10
|
description: schema.description,
|
|
11
11
|
argument_names: schema.argument_names,
|
|
12
12
|
argument_types: schema.argument_types,
|
|
13
|
+
...(schema.aliases ? { aliases: schema.aliases } : {}),
|
|
14
|
+
...(schema.paraphrase_templates
|
|
15
|
+
? { paraphrase_templates: schema.paraphrase_templates }
|
|
16
|
+
: {}),
|
|
13
17
|
examples: schema.examples,
|
|
14
18
|
tags: schema.tags,
|
|
15
19
|
usage_hints: schema.usage_hints ??
|
|
@@ -62,6 +66,8 @@ export function predicateSchemaFromEntity(entity) {
|
|
|
62
66
|
...stringArray(entity.aliases),
|
|
63
67
|
...stringArray(entity.tags),
|
|
64
68
|
],
|
|
69
|
+
aliases: stringArray(entity.aliases),
|
|
70
|
+
paraphrase_templates: stringArray(entity.paraphrase_templates),
|
|
65
71
|
examples: stringArray(entity.examples),
|
|
66
72
|
tags: stringArray(entity.tags),
|
|
67
73
|
...(usageHints ? { usage_hints: usageHints } : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predicate-ranker.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-ranker.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"predicate-ranker.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-ranker.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AA6BrE,wBAAgB,WAAW,CACzB,MAAM,EAAE,wBAAwB,EAChC,IAAI,EAAE,MAAM,GACX,MAAM,CAuDR"}
|
|
@@ -2,6 +2,25 @@ import { scoreExactPredicates1 } from "./predicate-score-1.js";
|
|
|
2
2
|
import { scoreExactPredicates2 } from "./predicate-score-2.js";
|
|
3
3
|
import { scoreExactPredicates3 } from "./predicate-score-3.js";
|
|
4
4
|
import { matchesKeyword } from "./predicate-utils.js";
|
|
5
|
+
function tokens(value) {
|
|
6
|
+
return value.toLowerCase().match(/[a-z0-9]+/g) ?? [];
|
|
7
|
+
}
|
|
8
|
+
function stem(value) {
|
|
9
|
+
if (value.length > 5 && value.endsWith("ies"))
|
|
10
|
+
return `${value.slice(0, -3)}y`;
|
|
11
|
+
if (value.length > 4 && value.endsWith("ing"))
|
|
12
|
+
return value.slice(0, -3);
|
|
13
|
+
if (value.length > 4 && value.endsWith("ed"))
|
|
14
|
+
return value.slice(0, -2);
|
|
15
|
+
if (value.length > 4 && value.endsWith("s"))
|
|
16
|
+
return value.slice(0, -1);
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
function overlap(left, right) {
|
|
20
|
+
const target = new Set(right.map(stem));
|
|
21
|
+
const matches = new Set(left.map(stem).filter((token) => target.has(token)));
|
|
22
|
+
return target.size === 0 ? 0 : matches.size / target.size;
|
|
23
|
+
}
|
|
5
24
|
const EXACT_SCORERS = [
|
|
6
25
|
scoreExactPredicates1,
|
|
7
26
|
scoreExactPredicates2,
|
|
@@ -16,9 +35,28 @@ export function scoreSchema(schema, text) {
|
|
|
16
35
|
}
|
|
17
36
|
const lower = text.toLowerCase();
|
|
18
37
|
const keywordHits = schema.keywords.filter((keyword) => matchesKeyword(text, lower, keyword)).length;
|
|
19
|
-
|
|
38
|
+
const textTokens = tokens(text);
|
|
39
|
+
const descriptors = [
|
|
40
|
+
schema.predicate_name,
|
|
41
|
+
schema.title,
|
|
42
|
+
schema.description,
|
|
43
|
+
...(schema.aliases ?? []),
|
|
44
|
+
...(schema.paraphrase_templates ?? []),
|
|
45
|
+
...schema.examples,
|
|
46
|
+
];
|
|
47
|
+
const descriptorOverlap = Math.max(...descriptors.map((descriptor) => overlap(textTokens, tokens(descriptor))), 0);
|
|
48
|
+
const useWhenOverlap = Math.max(...(schema.usage_hints?.use_when ?? []).map((descriptor) => overlap(textTokens, tokens(descriptor))), 0);
|
|
49
|
+
const doNotUseWhenOverlap = Math.max(...(schema.usage_hints?.do_not_use_when ?? []).map((descriptor) => overlap(textTokens, tokens(descriptor))), 0);
|
|
50
|
+
const morphologyHits = schema.keywords.filter((keyword) => textTokens.map(stem).includes(stem(keyword.toLowerCase()))).length;
|
|
51
|
+
if (keywordHits === 0 && morphologyHits === 0 && descriptorOverlap < 0.25)
|
|
20
52
|
return 0;
|
|
21
53
|
const normalized = keywordHits / Math.max(3, schema.keywords.length / 2);
|
|
22
|
-
const score = Math.min(0.98, 0
|
|
54
|
+
const score = Math.min(0.98, Math.max(0, 0.2 +
|
|
55
|
+
normalized * 0.4 +
|
|
56
|
+
keywordHits * 0.05 +
|
|
57
|
+
morphologyHits * 0.04 +
|
|
58
|
+
descriptorOverlap * 0.3 +
|
|
59
|
+
useWhenOverlap * 0.08 -
|
|
60
|
+
doNotUseWhenOverlap * 0.18));
|
|
23
61
|
return Math.round(score * 100) / 100;
|
|
24
62
|
}
|
|
@@ -11,6 +11,9 @@ export interface PredicateSchemaCandidate {
|
|
|
11
11
|
argument_names: string[];
|
|
12
12
|
argument_types: string[];
|
|
13
13
|
keywords: string[];
|
|
14
|
+
/** Human-language aliases and controlled paraphrase templates used for deterministic retrieval. */
|
|
15
|
+
aliases?: string[];
|
|
16
|
+
paraphrase_templates?: string[];
|
|
14
17
|
examples: string[];
|
|
15
18
|
tags: string[];
|
|
16
19
|
usage_hints?: PredicateUsageHints;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predicate-types.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,MAAM,CAAC;AAGlD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAGD,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC;AAGD,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,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MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC3C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LogicRuleIR } from "../../logic/ir.js";
|
|
1
2
|
import type { SemanticClaim, StrictWriteSet } from "../../public/check-types.js";
|
|
2
3
|
export type ModelRequirementArgs = Readonly<Record<string, unknown>> & {
|
|
3
4
|
readonly text: string;
|
|
@@ -11,6 +12,10 @@ export type ModelRequirementArgs = Readonly<Record<string, unknown>> & {
|
|
|
11
12
|
readonly provenance?: string;
|
|
12
13
|
/** Existing requirement claim manifest. Returned req updates merge this list. */
|
|
13
14
|
readonly existingLogicClaims?: readonly string[];
|
|
15
|
+
readonly logic?: LogicRuleIR;
|
|
16
|
+
readonly claimKey?: string;
|
|
17
|
+
readonly claimText?: string;
|
|
18
|
+
readonly requirementId?: string;
|
|
14
19
|
};
|
|
15
20
|
export interface ExtractedRequirementClaim {
|
|
16
21
|
claim: SemanticClaim;
|
|
@@ -41,6 +46,13 @@ export interface ModelRequirementResult {
|
|
|
41
46
|
nextAction: string;
|
|
42
47
|
}>;
|
|
43
48
|
migrationWarning: string | null;
|
|
49
|
+
logic?: {
|
|
50
|
+
readonly semanticKey: string;
|
|
51
|
+
readonly claimKey: string;
|
|
52
|
+
readonly claimText: string;
|
|
53
|
+
readonly renderedProlog: string;
|
|
54
|
+
readonly normalized: LogicRuleIR;
|
|
55
|
+
};
|
|
44
56
|
};
|
|
45
57
|
applyPlan: Array<Record<string, unknown>>;
|
|
46
58
|
writeSet: StrictWriteSet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requirement-types.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/requirement-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACf,MAAM,6BAA6B,CAAC;AAGrC,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG;IACrE,Q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;YACd,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC;YAChB,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC,CAAC;QACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;QAChC,KAAK,CAAC,EAAE;YACN,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;YAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;YAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;YAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;YAChC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;SAClC,CAAC;KACH,CAAC;IACF,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1C,QAAQ,EAAE,cAAc,CAAC;IACzB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/relationships.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/relationships.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAsBpD,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,KAAK,iBAAiB,GAAG;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAgCF,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,iBAAiB,GACvB,MAAM,CAER;AAED,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAczE;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,SAAS,iBAAiB,EAAE,GAC1C,IAAI,CAMN;AAED,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,iBAAiB,GAC9B,MAAM,CAIR;AAuBD,wBAAsB,+BAA+B,CACnD,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,aAAa,EAAE,SAAS,iBAAiB,EAAE,GAC1C,OAAO,CAAC,IAAI,CAAC,CAuBf;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,UAAU,EAClB,aAAa,EAAE,SAAS,iBAAiB,EAAE,GAC1C,OAAO,CAAC,IAAI,CAAC,CAgCf;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,SAAS,iBAAiB,EAAE,CAAC,CAevC"}
|
|
@@ -12,6 +12,7 @@ const RELATIONSHIP_TYPES = [
|
|
|
12
12
|
"constrains",
|
|
13
13
|
"requires_property",
|
|
14
14
|
"requires_predicate",
|
|
15
|
+
"requires_rule",
|
|
15
16
|
"guards",
|
|
16
17
|
"publishes",
|
|
17
18
|
"consumes",
|
|
@@ -106,6 +107,13 @@ export async function validateLiveRelationshipTargets(prolog, entity, relationsh
|
|
|
106
107
|
export async function validateStrictLanePairing(prolog, relationships) {
|
|
107
108
|
for (const relationship of relationships) {
|
|
108
109
|
const target = stringField(relationship, "to");
|
|
110
|
+
if (relationship.type === "requires_rule") {
|
|
111
|
+
const result = await prolog.query(`once((kb_entity('${escapeAtom(target)}', fact, _RuleProps), memberchk(fact_kind=_RuleKind, _RuleProps), normalize_term_atom(_RuleKind, rule)))`);
|
|
112
|
+
if (!result.success) {
|
|
113
|
+
throw new Error(`Relationship 'requires_rule' requires target '${target}' to be a fact_kind=rule fact.`);
|
|
114
|
+
}
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
109
117
|
const wrongKind = relationship.type === "constrains"
|
|
110
118
|
? "property_value"
|
|
111
119
|
: relationship.type === "requires_property"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/serialization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/serialization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AA6CpD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,MAAM,CAMR;AAGD,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAOxE;AAGD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBtD"}
|
|
@@ -27,6 +27,9 @@ function serializeValue(key, value) {
|
|
|
27
27
|
}
|
|
28
28
|
if (Array.isArray(value))
|
|
29
29
|
return JSON.stringify(value);
|
|
30
|
+
if (key === "rule_ir" || key === "semantic_inventory") {
|
|
31
|
+
return toPrologString(JSON.stringify(value));
|
|
32
|
+
}
|
|
30
33
|
if (typeof value === "string") {
|
|
31
34
|
return ATOM_FIELDS.includes(key)
|
|
32
35
|
? toPrologAtom(value)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strict-fact.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/strict-fact.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"strict-fact.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/strict-fact.ts"],"names":[],"mappings":"AAUA,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAarD;AAGD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,MAAM,EAAE,CA+EV;AAGD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,IAAI,CAuDN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { validateLogicIr } from "../../logic/ir.js";
|
|
1
2
|
const PROPERTY_VALUE_FIELDS = [
|
|
2
3
|
"value_string",
|
|
3
4
|
"value_int",
|
|
@@ -43,6 +44,40 @@ export function factKindShapeHints(entity) {
|
|
|
43
44
|
}
|
|
44
45
|
return hints;
|
|
45
46
|
}
|
|
47
|
+
if (entity.fact_kind === "rule_schema") {
|
|
48
|
+
const missing = ["rule_name", "argument_names", "argument_types"].filter((field) => entity[field] === undefined);
|
|
49
|
+
const equalLengths = Array.isArray(entity.argument_names) &&
|
|
50
|
+
Array.isArray(entity.argument_types) &&
|
|
51
|
+
entity.argument_names.length === entity.argument_types.length;
|
|
52
|
+
const hints = missing.length > 0
|
|
53
|
+
? [`fact_kind 'rule_schema' requires ${missing.join(", ")}.`]
|
|
54
|
+
: equalLengths
|
|
55
|
+
? []
|
|
56
|
+
: [
|
|
57
|
+
"fact_kind 'rule_schema' requires argument_names and argument_types with equal lengths.",
|
|
58
|
+
];
|
|
59
|
+
return hints.length > 0
|
|
60
|
+
? [
|
|
61
|
+
...hints,
|
|
62
|
+
"Next action: define the kibi.logic.v1 schema before creating rule facts.",
|
|
63
|
+
]
|
|
64
|
+
: [];
|
|
65
|
+
}
|
|
66
|
+
if (entity.fact_kind === "rule") {
|
|
67
|
+
const missing = [
|
|
68
|
+
"rule_ir",
|
|
69
|
+
"rule_hash",
|
|
70
|
+
"rule_schema_id",
|
|
71
|
+
"rule_name",
|
|
72
|
+
"semantic_key",
|
|
73
|
+
].filter((field) => entity[field] === undefined);
|
|
74
|
+
return missing.length > 0
|
|
75
|
+
? [
|
|
76
|
+
`fact_kind 'rule' requires ${missing.join(", ")}.`,
|
|
77
|
+
"Next action: call kb_model_requirement with typed kibi.logic.v1 IR; raw Prolog is not accepted.",
|
|
78
|
+
]
|
|
79
|
+
: [];
|
|
80
|
+
}
|
|
46
81
|
if (entity.fact_kind !== "predicate")
|
|
47
82
|
return [];
|
|
48
83
|
const args = entity.predicate_args;
|
|
@@ -51,12 +86,12 @@ export function factKindShapeHints(entity) {
|
|
|
51
86
|
...(!Array.isArray(args) || args.length === 0 ? ["predicate_args"] : []),
|
|
52
87
|
...(entity.canonical_key === undefined ? ["canonical_key"] : []),
|
|
53
88
|
];
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
: [
|
|
89
|
+
if (missing.length !== 0)
|
|
90
|
+
return [
|
|
57
91
|
`fact_kind 'predicate' requires ${missing.join(", ")}.`,
|
|
58
92
|
"Next action: call kb_suggest_predicates before hand-writing ontology predicate facts.",
|
|
59
93
|
];
|
|
94
|
+
return [];
|
|
60
95
|
}
|
|
61
96
|
// implements REQ-kibi-operation-interface-parity
|
|
62
97
|
export function validateFactModelingShape(entity) {
|
|
@@ -64,4 +99,34 @@ export function validateFactModelingShape(entity) {
|
|
|
64
99
|
if (hints.length > 0) {
|
|
65
100
|
throw new Error(`Entity validation failed: ${hints.join("; ")}`);
|
|
66
101
|
}
|
|
102
|
+
if (entity.type === "fact" && entity.fact_kind === "rule") {
|
|
103
|
+
const validation = validateLogicIr(entity.rule_ir);
|
|
104
|
+
if (!validation.valid || !validation.semanticKey) {
|
|
105
|
+
throw new Error(`Entity validation failed: rule_ir is unsafe or malformed (${validation.errors.join("; ")})`);
|
|
106
|
+
}
|
|
107
|
+
if (entity.rule_hash !== undefined &&
|
|
108
|
+
entity.rule_hash !== validation.ruleHash) {
|
|
109
|
+
throw new Error(`Entity validation failed: rule_hash must equal ${validation.ruleHash}`);
|
|
110
|
+
}
|
|
111
|
+
if (entity.semantic_key !== undefined &&
|
|
112
|
+
entity.semantic_key !== validation.semanticKey) {
|
|
113
|
+
throw new Error(`Entity validation failed: semantic_key must equal ${validation.semanticKey}`);
|
|
114
|
+
}
|
|
115
|
+
for (const field of ["rule_schema_id", "rule_name"]) {
|
|
116
|
+
if (typeof entity[field] !== "string" || entity[field].trim() === "") {
|
|
117
|
+
throw new Error(`Entity validation failed: fact_kind 'rule' requires ${field}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (entity.type === "fact" && entity.fact_kind === "rule_schema") {
|
|
122
|
+
if (typeof entity.rule_name !== "string" ||
|
|
123
|
+
entity.rule_name.trim() === "") {
|
|
124
|
+
throw new Error("Entity validation failed: fact_kind 'rule_schema' requires rule_name");
|
|
125
|
+
}
|
|
126
|
+
if (!Array.isArray(entity.argument_names) ||
|
|
127
|
+
!Array.isArray(entity.argument_types) ||
|
|
128
|
+
entity.argument_names.length !== entity.argument_types.length) {
|
|
129
|
+
throw new Error("Entity validation failed: rule_schema argument_names and argument_types must have equal lengths");
|
|
130
|
+
}
|
|
131
|
+
}
|
|
67
132
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SemanticClause } from "./clauses.js";
|
|
2
2
|
import { type Payload } from "./shared.js";
|
|
3
|
-
import type { SemanticAdvisorAnalysisResult, SemanticModelingSuggestion, SemanticSignal } from "./types.js";
|
|
4
|
-
export declare function buildAdvisorResult(payload: Payload, signals: readonly SemanticSignal[], modeled: boolean, suggestions: readonly SemanticModelingSuggestion[], clauses: readonly SemanticClause[]): SemanticAdvisorAnalysisResult;
|
|
3
|
+
import type { SemanticAdvisorAnalysisResult, SemanticInterpretationResult, SemanticModelingSuggestion, SemanticProposition, SemanticShadowCue, SemanticSignal } from "./types.js";
|
|
4
|
+
export declare function buildAdvisorResult(payload: Payload, signals: readonly SemanticSignal[], modeled: boolean, suggestions: readonly SemanticModelingSuggestion[], clauses: readonly SemanticClause[], propositions: readonly SemanticProposition[], interpretations: readonly SemanticInterpretationResult[], shadowAnalysis: readonly SemanticShadowCue[]): SemanticAdvisorAnalysisResult;
|
|
5
5
|
//# sourceMappingURL=analysis-receipt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analysis-receipt.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/analysis-receipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,KAAK,OAAO,EAA6B,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EACV,6BAA6B,EAI7B,0BAA0B,EAC1B,cAAc,EACf,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"analysis-receipt.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/analysis-receipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,KAAK,OAAO,EAA6B,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EACV,6BAA6B,EAI7B,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACf,MAAM,YAAY,CAAC;AA0CpB,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,SAAS,0BAA0B,EAAE,EAClD,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,YAAY,EAAE,SAAS,mBAAmB,EAAE,EAC5C,eAAe,EAAE,SAAS,4BAA4B,EAAE,EACxD,cAAc,EAAE,SAAS,iBAAiB,EAAE,GAC3C,6BAA6B,CA4G/B"}
|