kibi-cli 0.16.1 → 0.18.1
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-json-command.d.ts.map +1 -1
- package/dist/cli-json-command.js +87 -11
- package/dist/cli-register-maintenance.d.ts.map +1 -1
- package/dist/cli-register-maintenance.js +8 -0
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +5 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/commands/aggregated-checks.d.ts.map +1 -1
- package/dist/commands/aggregated-checks.js +1 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +1 -1
- package/dist/commands/coverage.d.ts +5 -0
- package/dist/commands/coverage.d.ts.map +1 -1
- package/dist/commands/coverage.js +5 -0
- package/dist/commands/discovery-table.d.ts.map +1 -1
- package/dist/commands/discovery-table.js +96 -5
- package/dist/commands/sync/cache.d.ts +2 -0
- package/dist/commands/sync/cache.d.ts.map +1 -1
- package/dist/commands/sync/cache.js +8 -0
- 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 +76 -2
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +72 -15
- package/dist/commands/usage-metrics.d.ts +66 -2
- package/dist/commands/usage-metrics.d.ts.map +1 -1
- package/dist/commands/usage-metrics.js +34 -24
- package/dist/commands/usage-remediation.d.ts +9 -0
- package/dist/commands/usage-remediation.d.ts.map +1 -0
- package/dist/commands/usage-remediation.js +52 -0
- package/dist/extractors/markdown.d.ts +17 -1
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +81 -2
- 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 +120 -0
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +83 -2
- package/dist/operations/modeling/predicate-applyplan.d.ts +1 -1
- package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applyplan.js +29 -4
- package/dist/operations/modeling/predicate-inference.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-inference.js +3 -0
- package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-loader.js +7 -1
- 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 +12 -1
- 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/modeling/suggest-predicates.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.js +35 -11
- package/dist/operations/mutation/audit.js +1 -1
- package/dist/operations/mutation/contradictions.d.ts +1 -1
- package/dist/operations/mutation/contradictions.d.ts.map +1 -1
- package/dist/operations/mutation/contradictions.js +23 -18
- 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 +6 -0
- package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
- package/dist/operations/mutation/strict-fact.js +68 -3
- package/dist/operations/mutation/upsert.d.ts +3 -1
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +51 -12
- package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
- package/dist/operations/mutation/validate-upsert.js +18 -2
- package/dist/operations/mutation/validation.d.ts.map +1 -1
- package/dist/operations/mutation/validation.js +8 -0
- 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 +30 -16
- 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 +464 -27
- package/dist/operations/semantic-advisor/clauses.d.ts +1 -0
- package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/clauses.js +7 -7
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts +18 -0
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/ingestion-boundary.js +167 -0
- 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 +9 -0
- package/dist/operations/semantic-advisor/shared.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/shared.js +38 -4
- package/dist/operations/semantic-advisor/types.d.ts +66 -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 +19 -2
- package/dist/prolog.d.ts +6 -0
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +247 -63
- package/dist/public/diagnostic-usage.d.ts +17 -0
- package/dist/public/diagnostic-usage.d.ts.map +1 -0
- package/dist/public/diagnostic-usage.js +152 -0
- package/dist/public/distribution-parity.d.ts +90 -0
- package/dist/public/distribution-parity.d.ts.map +1 -0
- package/dist/public/distribution-parity.js +367 -0
- package/dist/public/impact/full-kb-quality.d.ts +2 -0
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +53 -1
- package/dist/public/impact-diagnostics.d.ts +2 -0
- package/dist/public/impact-diagnostics.d.ts.map +1 -1
- package/dist/public/impact-diagnostics.js +1 -0
- package/dist/public/operations/catalog.d.ts +235 -11
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +4 -0
- package/dist/public/operations/discovery-executors.d.ts +6 -0
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +18 -2
- package/dist/public/operations/index.d.ts +5 -0
- package/dist/public/operations/index.d.ts.map +1 -1
- package/dist/public/operations/index.js +5 -0
- package/dist/public/operations/legacy-migration-plan.d.ts +113 -0
- package/dist/public/operations/legacy-migration-plan.d.ts.map +1 -0
- package/dist/public/operations/legacy-migration-plan.js +409 -0
- package/dist/public/operations/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +90 -0
- package/dist/public/operations/repair-plan.d.ts +184 -0
- package/dist/public/operations/repair-plan.d.ts.map +1 -0
- package/dist/public/operations/repair-plan.js +397 -0
- package/dist/public/operations/runtime-types.d.ts +7 -0
- package/dist/public/operations/runtime-types.d.ts.map +1 -1
- package/dist/public/operations/specs/check.d.ts +3 -3
- package/dist/public/operations/specs/check.d.ts.map +1 -1
- package/dist/public/operations/specs/check.js +5 -2
- package/dist/public/operations/specs/discovery.d.ts +1 -1
- package/dist/public/operations/specs/discovery.js +1 -1
- package/dist/public/operations/specs/modeling.d.ts +35 -1
- package/dist/public/operations/specs/modeling.d.ts.map +1 -1
- package/dist/public/operations/specs/modeling.js +32 -1
- package/dist/public/operations/specs/mutation-schemas.d.ts +133 -3
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +67 -1
- package/dist/public/operations/specs/reporting.d.ts +42 -1
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +70 -6
- 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 +35 -3
- package/dist/public/operations/specs/upsert.d.ts +133 -3
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/workspace-snapshot.d.ts +10 -0
- package/dist/public/operations/workspace-snapshot.d.ts.map +1 -0
- package/dist/public/operations/workspace-snapshot.js +20 -0
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +332 -0
- package/dist/public/schemas/relationship.d.ts.map +1 -1
- package/dist/public/schemas/relationship.js +1 -0
- package/dist/public/skills/kibi-traceability/SKILL.md +7 -1
- package/dist/public/skills/kibi-usage/SKILL.md +44 -12
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +12 -2
- 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 +40 -8
- 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/public/telemetry-acceptance.d.ts +89 -0
- package/dist/public/telemetry-acceptance.d.ts.map +1 -0
- package/dist/public/telemetry-acceptance.js +597 -0
- package/dist/public/telemetry-remediation.d.ts +33 -0
- package/dist/public/telemetry-remediation.d.ts.map +1 -0
- package/dist/public/telemetry-remediation.js +257 -0
- package/dist/public/verification-receipt.d.ts +75 -0
- package/dist/public/verification-receipt.d.ts.map +1 -0
- package/dist/public/verification-receipt.js +129 -0
- package/dist/schemas/entity.schema.json +401 -4
- 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 +49 -3
- package/dist/types/entities.d.ts +1 -0
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/types/relationships.d.ts +1 -1
- package/dist/types/relationships.d.ts.map +1 -1
- package/dist/utils/rule-registry.d.ts +2 -0
- 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 +34 -2
- package/src/public/diagnostic-usage.ts +206 -0
- package/src/public/distribution-parity.ts +580 -0
- package/src/public/impact/full-kb-quality.ts +74 -1
- package/src/public/impact-diagnostics.ts +16 -0
- package/src/public/operations/check-executor.ts +4 -0
- package/src/public/operations/discovery-executors.ts +24 -2
- package/src/public/operations/index.ts +5 -0
- package/src/public/operations/legacy-migration-plan.ts +688 -0
- package/src/public/operations/node-ports.ts +109 -0
- package/src/public/operations/repair-plan.ts +562 -0
- package/src/public/operations/runtime-types.ts +8 -0
- package/src/public/operations/specs/check.ts +5 -2
- package/src/public/operations/specs/discovery.ts +1 -1
- package/src/public/operations/specs/modeling.ts +39 -1
- package/src/public/operations/specs/mutation-schemas.ts +77 -1
- package/src/public/operations/specs/reporting.ts +91 -6
- package/src/public/operations/specs/semantic.ts +42 -3
- package/src/public/operations/workspace-snapshot.ts +28 -0
- package/src/public/schemas/entity.ts +340 -1
- package/src/public/schemas/relationship.ts +1 -0
- package/src/public/skills/kibi-traceability/SKILL.md +7 -1
- package/src/public/skills/kibi-usage/SKILL.md +44 -12
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +12 -2
- 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 +40 -8
- package/src/public/symbol-granularity.ts +25 -0
- package/src/public/telemetry-acceptance.ts +859 -0
- package/src/public/telemetry-remediation.ts +462 -0
- package/src/public/verification-receipt.ts +170 -0
- package/src/schemas/entity.schema.json +401 -4
- package/src/schemas/relationship.schema.json +1 -0
|
@@ -0,0 +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;AAE3E,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,KAAK,oBAAoB,GAAG,QAAQ,CAAC;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,OAAO,CAAC;CACd,CAAC,CAAC;AAgCH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,SAAS,oBAAoB,EAAE,EAC9C,OAAO,EAAE,sBAAsB,GAC9B,+BAA+B,CAmIjC;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,SAAS,oBAAoB,EAAE,EAC9C,OAAO,EAAE,sBAAsB,GAC9B,IAAI,CAWN;AAGD,wBAAsB,+BAA+B,CACnD,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,SAAS,oBAAoB,EAAE,GAC7C,OAAO,CAAC,IAAI,CAAC,CA+Cf"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { escapeAtom } from "../../prolog/codec.js";
|
|
2
|
+
import { semanticClaimKey } from "./clauses.js";
|
|
3
|
+
import { SEMANTIC_INVENTORY_VERSION, isRecord, propertiesOf, semanticSourceHash, semanticSourceOf, stringValue, } from "./shared.js";
|
|
4
|
+
const CURRENT_REQUIREMENT_STATUSES = new Set([
|
|
5
|
+
"open",
|
|
6
|
+
"in_progress",
|
|
7
|
+
"closed",
|
|
8
|
+
"active",
|
|
9
|
+
"approved",
|
|
10
|
+
]);
|
|
11
|
+
const CONTEXT_ROLES = new Set(["rationale", "example", "subjective"]);
|
|
12
|
+
const LOGICAL_RELATIONSHIPS = new Set([
|
|
13
|
+
"requires_property",
|
|
14
|
+
"requires_predicate",
|
|
15
|
+
"requires_rule",
|
|
16
|
+
]);
|
|
17
|
+
function inventoryOf(payload) {
|
|
18
|
+
const raw = propertiesOf(payload).semantic_inventory;
|
|
19
|
+
return Array.isArray(raw) ? raw.filter(isRecord) : [];
|
|
20
|
+
}
|
|
21
|
+
function exactSpanText(source, span) {
|
|
22
|
+
const start = span.start;
|
|
23
|
+
const end = span.end;
|
|
24
|
+
if (typeof start !== "number" ||
|
|
25
|
+
typeof end !== "number" ||
|
|
26
|
+
!Number.isInteger(start) ||
|
|
27
|
+
!Number.isInteger(end) ||
|
|
28
|
+
start < 0 ||
|
|
29
|
+
end <= start)
|
|
30
|
+
return null;
|
|
31
|
+
const bytes = Buffer.from(source, "utf8");
|
|
32
|
+
if (end > bytes.length)
|
|
33
|
+
return null;
|
|
34
|
+
return bytes.subarray(start, end).toString("utf8");
|
|
35
|
+
}
|
|
36
|
+
function propositionIsAssertive(proposition) {
|
|
37
|
+
return !CONTEXT_ROLES.has(proposition.role);
|
|
38
|
+
}
|
|
39
|
+
// implements REQ-kibi-proposition-complete-ingestion
|
|
40
|
+
export function validateSemanticInventoryBoundary(payload, relationships, receipt) {
|
|
41
|
+
const properties = propertiesOf(payload);
|
|
42
|
+
const semanticSource = semanticSourceOf(payload);
|
|
43
|
+
const sourceHash = semanticSourceHash(semanticSource.text);
|
|
44
|
+
const currentRequirement = stringValue(payload.type) === "req" &&
|
|
45
|
+
CURRENT_REQUIREMENT_STATUSES.has(stringValue(properties.status));
|
|
46
|
+
const assertive = receipt.propositions.filter(propositionIsAssertive);
|
|
47
|
+
const applicable = currentRequirement &&
|
|
48
|
+
semanticSource.text.length > 0 &&
|
|
49
|
+
(semanticSource.field !== "title" ||
|
|
50
|
+
assertive.some(({ role }) => role === "normative"));
|
|
51
|
+
if (!applicable)
|
|
52
|
+
return { applicable, errors: [], sourceHash };
|
|
53
|
+
const errors = [];
|
|
54
|
+
if (properties.semantic_inventory_version !== SEMANTIC_INVENTORY_VERSION) {
|
|
55
|
+
errors.push(`semantic_inventory_version must be '${SEMANTIC_INVENTORY_VERSION}'`);
|
|
56
|
+
}
|
|
57
|
+
if (properties.semantic_source_field !== semanticSource.field) {
|
|
58
|
+
errors.push(`semantic_source_field must be '${semanticSource.field}' for the current requirement prose`);
|
|
59
|
+
}
|
|
60
|
+
if (properties.semantic_source_hash !== sourceHash) {
|
|
61
|
+
errors.push(`semantic_source_hash must equal the SHA-256 hash of ${semanticSource.field} (expected '${sourceHash}')`);
|
|
62
|
+
}
|
|
63
|
+
const inventory = inventoryOf(payload);
|
|
64
|
+
if (!Array.isArray(properties.semantic_inventory)) {
|
|
65
|
+
errors.push("semantic_inventory must contain one entry for every advisor proposition");
|
|
66
|
+
}
|
|
67
|
+
if (inventory.length !== receipt.propositions.length) {
|
|
68
|
+
errors.push(`semantic_inventory must contain exactly ${receipt.propositions.length} proposition(s); received ${inventory.length}`);
|
|
69
|
+
}
|
|
70
|
+
const seenKeys = new Set();
|
|
71
|
+
const seenSpans = new Set();
|
|
72
|
+
for (const [index, entry] of inventory.entries()) {
|
|
73
|
+
const expected = receipt.propositions[index];
|
|
74
|
+
const claimKey = stringValue(entry.claim_key);
|
|
75
|
+
const claimText = stringValue(entry.claim_text);
|
|
76
|
+
const role = stringValue(entry.role);
|
|
77
|
+
const status = stringValue(entry.status);
|
|
78
|
+
const span = isRecord(entry.span) ? entry.span : {};
|
|
79
|
+
const start = span.start;
|
|
80
|
+
const end = span.end;
|
|
81
|
+
const spanKey = `${String(start)}:${String(end)}`;
|
|
82
|
+
if (seenKeys.has(claimKey))
|
|
83
|
+
errors.push(`semantic_inventory has duplicate claim_key '${claimKey}'`);
|
|
84
|
+
seenKeys.add(claimKey);
|
|
85
|
+
if (seenSpans.has(spanKey))
|
|
86
|
+
errors.push(`semantic_inventory has duplicate span '${spanKey}'`);
|
|
87
|
+
seenSpans.add(spanKey);
|
|
88
|
+
const derivedKey = semanticClaimKey(claimText);
|
|
89
|
+
if (claimKey !== derivedKey) {
|
|
90
|
+
errors.push(`semantic_inventory[${index}].claim_key must match claim_text (expected '${derivedKey}')`);
|
|
91
|
+
}
|
|
92
|
+
const sliced = exactSpanText(semanticSource.text, span);
|
|
93
|
+
if (sliced !== claimText) {
|
|
94
|
+
errors.push(`semantic_inventory[${index}].span must select its exact claim_text from ${semanticSource.field}`);
|
|
95
|
+
}
|
|
96
|
+
if (expected &&
|
|
97
|
+
(claimKey !== expected.claim_key ||
|
|
98
|
+
claimText !== expected.claim_text ||
|
|
99
|
+
role !== expected.role ||
|
|
100
|
+
start !== expected.span.start ||
|
|
101
|
+
end !== expected.span.end)) {
|
|
102
|
+
errors.push(`semantic_inventory[${index}] does not match advisor proposition '${expected.claim_key}'`);
|
|
103
|
+
}
|
|
104
|
+
const contextRole = CONTEXT_ROLES.has(role);
|
|
105
|
+
if (contextRole && status !== "nonlogical") {
|
|
106
|
+
errors.push(`semantic_inventory[${index}] role '${role}' must use status 'nonlogical'`);
|
|
107
|
+
}
|
|
108
|
+
if (!contextRole && status === "nonlogical") {
|
|
109
|
+
errors.push(`semantic_inventory[${index}] assertive role '${role}' cannot use status 'nonlogical'`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const declaredClaims = Array.isArray(properties.logic_claims)
|
|
113
|
+
? properties.logic_claims.filter((value) => typeof value === "string")
|
|
114
|
+
: [];
|
|
115
|
+
const expectedClaims = assertive.map(({ claim_key }) => claim_key);
|
|
116
|
+
if (declaredClaims.length !== expectedClaims.length ||
|
|
117
|
+
expectedClaims.some((claimKey) => !declaredClaims.includes(claimKey))) {
|
|
118
|
+
errors.push("logic_claims must contain exactly every assertive semantic_inventory claim_key");
|
|
119
|
+
}
|
|
120
|
+
const modeledCount = inventory.filter(({ status }) => status === "modeled").length;
|
|
121
|
+
const groundingCount = relationships.filter((relationship) => relationship.from === payload.id &&
|
|
122
|
+
LOGICAL_RELATIONSHIPS.has(stringValue(relationship.type))).length;
|
|
123
|
+
if (modeledCount !== groundingCount) {
|
|
124
|
+
errors.push(`modeled semantic_inventory entries (${modeledCount}) must equal logical grounding relationships (${groundingCount})`);
|
|
125
|
+
}
|
|
126
|
+
return { applicable, errors, sourceHash };
|
|
127
|
+
}
|
|
128
|
+
export function assertSemanticInventoryBoundary(payload, relationships, receipt) {
|
|
129
|
+
const result = validateSemanticInventoryBoundary(payload, relationships, receipt);
|
|
130
|
+
if (result.errors.length > 0) {
|
|
131
|
+
throw new Error(`Proposition-complete ingestion failed: ${result.errors.join("; ")}. Run kb_semantic_advisor with the complete prose and preserve its inventory contract before retrying.`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// implements REQ-kibi-proposition-complete-ingestion
|
|
135
|
+
export async function assertLogicalGroundingClaimKeys(prolog, payload, relationships) {
|
|
136
|
+
if (stringValue(payload.type) !== "req")
|
|
137
|
+
return;
|
|
138
|
+
if (propertiesOf(payload).semantic_inventory_version !==
|
|
139
|
+
SEMANTIC_INVENTORY_VERSION)
|
|
140
|
+
return;
|
|
141
|
+
const modeledClaimKeys = inventoryOf(payload)
|
|
142
|
+
.filter(({ status }) => status === "modeled")
|
|
143
|
+
.map(({ claim_key }) => stringValue(claim_key));
|
|
144
|
+
const groundedClaimKeys = [];
|
|
145
|
+
for (const relationship of relationships) {
|
|
146
|
+
if (relationship.from !== payload.id ||
|
|
147
|
+
!LOGICAL_RELATIONSHIPS.has(stringValue(relationship.type)))
|
|
148
|
+
continue;
|
|
149
|
+
const target = stringValue(relationship.to);
|
|
150
|
+
const result = await prolog.query(`once((kb_entity('${escapeAtom(target)}', fact, _SemanticGroundProps), memberchk(claim_key=_SemanticGroundRaw, _SemanticGroundProps), normalize_term_atom(_SemanticGroundRaw, ClaimKey)))`);
|
|
151
|
+
const claimKey = result.success
|
|
152
|
+
? stringValue(result.bindings.ClaimKey).replace(/^['"]|['"]$/g, "")
|
|
153
|
+
: "";
|
|
154
|
+
if (!claimKey) {
|
|
155
|
+
throw new Error(`Proposition-complete ingestion failed: logical grounding target '${target}' must declare a claim_key.`);
|
|
156
|
+
}
|
|
157
|
+
groundedClaimKeys.push(claimKey);
|
|
158
|
+
}
|
|
159
|
+
const duplicate = groundedClaimKeys.find((claimKey, index) => groundedClaimKeys.indexOf(claimKey) !== index);
|
|
160
|
+
if (duplicate) {
|
|
161
|
+
throw new Error(`Proposition-complete ingestion failed: claim '${duplicate}' has more than one logical grounding relationship.`);
|
|
162
|
+
}
|
|
163
|
+
if (groundedClaimKeys.length !== modeledClaimKeys.length ||
|
|
164
|
+
modeledClaimKeys.some((claimKey) => !groundedClaimKeys.includes(claimKey))) {
|
|
165
|
+
throw new Error("Proposition-complete ingestion failed: modeled proposition claim_keys must match logical grounding target claim_keys exactly.");
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observation-plan.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/observation-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"observation-plan.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/observation-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAMb,MAAM,aAAa,CAAC;AAGrB,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CA6B9C"}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import { shortHash, sourceOf, statementOf, stringValue, } from "./shared.js";
|
|
1
|
+
import { relationship, shortHash, sourceOf, statementOf, stringValue, } from "./shared.js";
|
|
2
2
|
// implements REQ-mcp-semantic-advisor-preflight
|
|
3
3
|
export function observationPlan(payload, title, tags) {
|
|
4
|
+
const factId = `FACT-OBS-${shortHash(`${stringValue(payload.id)}.${title}.${statementOf(payload)}`)}`;
|
|
5
|
+
const target = tags.includes("review:ambiguity")
|
|
6
|
+
? "review:ambiguous-claim"
|
|
7
|
+
: tags.includes("review:keyword-false-positive")
|
|
8
|
+
? "review:keyword-false-positive"
|
|
9
|
+
: tags.includes("review:ontology-gap")
|
|
10
|
+
? "review:ontology-gap"
|
|
11
|
+
: tags.includes("review:nonlogical")
|
|
12
|
+
? "review:nonlogical"
|
|
13
|
+
: undefined;
|
|
4
14
|
return [
|
|
5
15
|
{
|
|
6
16
|
type: "fact",
|
|
7
|
-
id:
|
|
17
|
+
id: factId,
|
|
8
18
|
properties: {
|
|
9
19
|
title,
|
|
10
20
|
status: "active",
|
|
@@ -13,7 +23,9 @@ export function observationPlan(payload, title, tags) {
|
|
|
13
23
|
text_ref: statementOf(payload),
|
|
14
24
|
tags,
|
|
15
25
|
},
|
|
16
|
-
relationships:
|
|
26
|
+
relationships: target === undefined
|
|
27
|
+
? []
|
|
28
|
+
: [relationship(factId, target, "relates_to")],
|
|
17
29
|
},
|
|
18
30
|
];
|
|
19
31
|
}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import type { SemanticModelingSuggestion, SemanticStrictPropertyClaim } from "./types.js";
|
|
2
2
|
export type Payload = Readonly<Record<string, unknown>>;
|
|
3
3
|
export type MatchGroups = Readonly<Record<string, string | undefined>>;
|
|
4
|
+
export declare const SEMANTIC_INVENTORY_VERSION = "kibi.semantic-inventory.v1";
|
|
5
|
+
export type SemanticSourceField = "semantic_text" | "text_ref" | "title";
|
|
4
6
|
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
5
7
|
export declare function stringValue(value: unknown): string;
|
|
6
8
|
export declare function canonicalize(value: unknown): string;
|
|
7
9
|
export declare function payloadHash(payload: Payload): string;
|
|
10
|
+
export declare function semanticSourceOf(payload: Payload): {
|
|
11
|
+
readonly field: SemanticSourceField;
|
|
12
|
+
readonly text: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function semanticSourceHash(text: string): string;
|
|
15
|
+
export declare function semanticClausesOf(payload: Payload): readonly string[] | undefined;
|
|
8
16
|
export declare function shortHash(value: string): string;
|
|
9
17
|
export declare function propertiesOf(payload: Payload): Record<string, unknown>;
|
|
10
18
|
export declare function statementOf(payload: Payload): string;
|
|
@@ -13,6 +21,7 @@ export declare function normalizeKey(value: string): string;
|
|
|
13
21
|
export declare function normalizePredicateToken(value: string): string;
|
|
14
22
|
export declare function singularize(value: string): string;
|
|
15
23
|
export declare function normalizeSubjectKey(value: string): string;
|
|
24
|
+
export declare function relationship(from: string, to: string, type: string): Record<string, unknown>;
|
|
16
25
|
export declare function strictSuggestion(payload: Payload, evidence: string, claim: SemanticStrictPropertyClaim, rationale: string, confidence?: number): SemanticModelingSuggestion;
|
|
17
26
|
export declare function predicateSuggestion(payload: Payload, evidence: string, name: string, args: readonly string[], rationale: string, polarity?: "assert" | "deny"): SemanticModelingSuggestion;
|
|
18
27
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/shared.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,0BAA0B,EAE1B,2BAA2B,EAC5B,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CA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,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAGD,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEtE;AAGD,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEpD;AAGD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAIjD;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlD;AAGD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ7D;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGjD;AAGD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,GACX,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzB;AAGD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,2BAA2B,EAClC,SAAS,EAAE,MAAM,EACjB,UAAU,SAAM,GACf,0BAA0B,CA0F5B;AAGD,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,QAAQ,GAAG,MAAiB,GACrC,0BAA0B,CA+C5B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { semanticClaimKey } from "./clauses.js";
|
|
3
|
+
export const SEMANTIC_INVENTORY_VERSION = "kibi.semantic-inventory.v1";
|
|
3
4
|
// implements REQ-mcp-semantic-advisor-preflight
|
|
4
5
|
export function isRecord(value) {
|
|
5
6
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -25,6 +26,35 @@ export function payloadHash(payload) {
|
|
|
25
26
|
const stable = Object.fromEntries(Object.entries(payload).filter(([key]) => !key.startsWith("_")));
|
|
26
27
|
return createHash("sha256").update(canonicalize(stable)).digest("hex");
|
|
27
28
|
}
|
|
29
|
+
// implements REQ-kibi-legacy-migration-preview-v2
|
|
30
|
+
export function semanticSourceOf(payload) {
|
|
31
|
+
const properties = propertiesOf(payload);
|
|
32
|
+
const declaredField = stringValue(properties.semantic_source_field);
|
|
33
|
+
if (declaredField === "semantic_text" ||
|
|
34
|
+
declaredField === "text_ref" ||
|
|
35
|
+
declaredField === "title") {
|
|
36
|
+
return {
|
|
37
|
+
field: declaredField,
|
|
38
|
+
text: stringValue(properties[declaredField]),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const semanticText = stringValue(properties.semantic_text);
|
|
42
|
+
if (semanticText)
|
|
43
|
+
return { field: "semantic_text", text: semanticText };
|
|
44
|
+
const textRef = stringValue(properties.text_ref);
|
|
45
|
+
return textRef
|
|
46
|
+
? { field: "text_ref", text: textRef }
|
|
47
|
+
: { field: "title", text: stringValue(properties.title) };
|
|
48
|
+
}
|
|
49
|
+
export function semanticSourceHash(text) {
|
|
50
|
+
return createHash("sha256").update(text).digest("hex");
|
|
51
|
+
}
|
|
52
|
+
export function semanticClausesOf(payload) {
|
|
53
|
+
const value = propertiesOf(payload).semantic_clauses;
|
|
54
|
+
if (!Array.isArray(value))
|
|
55
|
+
return undefined;
|
|
56
|
+
return value.filter((clause) => typeof clause === "string" && clause.trim().length > 0);
|
|
57
|
+
}
|
|
28
58
|
// implements REQ-mcp-semantic-advisor-preflight
|
|
29
59
|
export function shortHash(value) {
|
|
30
60
|
return createHash("sha256").update(value).digest("hex").slice(0, 12);
|
|
@@ -35,8 +65,7 @@ export function propertiesOf(payload) {
|
|
|
35
65
|
}
|
|
36
66
|
// implements REQ-mcp-semantic-advisor-preflight
|
|
37
67
|
export function statementOf(payload) {
|
|
38
|
-
|
|
39
|
-
return stringValue(properties.text_ref) || stringValue(properties.title);
|
|
68
|
+
return semanticSourceOf(payload).text;
|
|
40
69
|
}
|
|
41
70
|
// implements REQ-mcp-semantic-advisor-preflight
|
|
42
71
|
export function sourceOf(payload) {
|
|
@@ -71,12 +100,13 @@ export function singularize(value) {
|
|
|
71
100
|
export function normalizeSubjectKey(value) {
|
|
72
101
|
return normalizeKey(value).split("_").map(singularize).join(".");
|
|
73
102
|
}
|
|
74
|
-
function relationship(from, to, type) {
|
|
103
|
+
export function relationship(from, to, type) {
|
|
75
104
|
return { type, from, to };
|
|
76
105
|
}
|
|
77
106
|
// implements REQ-mcp-semantic-advisor-preflight
|
|
78
107
|
export function strictSuggestion(payload, evidence, claim, rationale, confidence = 0.9) {
|
|
79
108
|
const claimText = statementOf(payload);
|
|
109
|
+
const semanticSource = semanticSourceOf(payload);
|
|
80
110
|
const reqId = stringValue(payload.id) || `REQ-SEMANTIC-${shortHash(claim.subject_key)}`;
|
|
81
111
|
const subjectId = `FACT-SUBJECT-${shortHash(claim.subject_key)}`;
|
|
82
112
|
const propertyId = `FACT-PROP-${shortHash(`${claim.subject_key}.${claim.property_key}.${claim.operator}.${canonicalize(claim)}`)}`;
|
|
@@ -147,7 +177,11 @@ export function strictSuggestion(payload, evidence, claim, rationale, confidence
|
|
|
147
177
|
"Semantic advisor requirement suggestion",
|
|
148
178
|
status: "open",
|
|
149
179
|
source,
|
|
150
|
-
|
|
180
|
+
...(semanticSource.field === "semantic_text"
|
|
181
|
+
? { semantic_text: statementOf(payload) }
|
|
182
|
+
: semanticSource.field === "text_ref"
|
|
183
|
+
? { text_ref: statementOf(payload) }
|
|
184
|
+
: {}),
|
|
151
185
|
tags: ["semantic-advisor-suggestion"],
|
|
152
186
|
},
|
|
153
187
|
relationships: [
|
|
@@ -1,6 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
import type { LogicRuleIR } from "../../logic/ir.js";
|
|
2
|
+
export type SemanticAdvisorLane = "strict_property" | "predicate" | "rule" | "observation_review" | "none";
|
|
2
3
|
export type SemanticAdvisorReadiness = "modeled" | "needs_modeling" | "not_applicable";
|
|
3
4
|
export type SemanticLogicCoverageStatus = "complete" | "partial" | "unverified" | "not_applicable";
|
|
5
|
+
export type SemanticPropositionRole = "normative" | "definition" | "descriptive" | "condition" | "exception" | "rationale" | "example" | "subjective";
|
|
6
|
+
export type SemanticPropositionStatus = "modeled" | "ambiguous" | "ontology_gap" | "nonlogical" | "missing";
|
|
7
|
+
export interface SemanticPropositionSpan {
|
|
8
|
+
readonly start: number;
|
|
9
|
+
readonly end: number;
|
|
10
|
+
}
|
|
11
|
+
export interface SemanticProposition {
|
|
12
|
+
readonly claim_key: string;
|
|
13
|
+
readonly claim_text: string;
|
|
14
|
+
readonly role: SemanticPropositionRole;
|
|
15
|
+
readonly status: SemanticPropositionStatus;
|
|
16
|
+
readonly span: SemanticPropositionSpan;
|
|
17
|
+
readonly payload_hash?: string;
|
|
18
|
+
readonly semantic_key?: string;
|
|
19
|
+
readonly reason?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface SemanticInterpretationInput {
|
|
22
|
+
readonly claim_key: string;
|
|
23
|
+
readonly claim_text: string;
|
|
24
|
+
readonly ir: LogicRuleIR;
|
|
25
|
+
readonly confidence?: number;
|
|
26
|
+
readonly span?: SemanticPropositionSpan;
|
|
27
|
+
}
|
|
28
|
+
export interface SemanticInterpretationResult {
|
|
29
|
+
readonly claim_key: string;
|
|
30
|
+
readonly semantic_key?: string;
|
|
31
|
+
/** Canonical, schema-validated IR for inspection; never executable source. */
|
|
32
|
+
readonly normalized_ir?: LogicRuleIR;
|
|
33
|
+
readonly valid: boolean;
|
|
34
|
+
readonly confidence: number;
|
|
35
|
+
readonly errors: readonly string[];
|
|
36
|
+
readonly warnings: readonly string[];
|
|
37
|
+
readonly rendered_prolog?: string;
|
|
38
|
+
}
|
|
39
|
+
export type SemanticShadowCueKind = "modal" | "polarity" | "passive_voice" | "nominalization" | "conditional" | "causal" | "prerequisite" | "exception" | "temporal" | "quantifier" | "numeric" | "negation_scope" | "directionality";
|
|
40
|
+
export interface SemanticShadowCue {
|
|
41
|
+
readonly kind: SemanticShadowCueKind;
|
|
42
|
+
readonly evidence: string;
|
|
43
|
+
readonly represented: boolean;
|
|
44
|
+
}
|
|
4
45
|
export type SemanticSignalKind = "normative_modal" | "numeric_cardinality" | "numeric_threshold" | "conditional" | "permission" | "state_or_default";
|
|
5
46
|
export interface SemanticSignal {
|
|
6
47
|
readonly kind: SemanticSignalKind;
|
|
@@ -54,6 +95,20 @@ export type SemanticModelingSuggestion = {
|
|
|
54
95
|
readonly rejected_alternatives: readonly string[];
|
|
55
96
|
readonly applyPlan: readonly Readonly<Record<string, unknown>>[];
|
|
56
97
|
readonly relationshipPlan: Readonly<Record<string, unknown>> | null;
|
|
98
|
+
} | {
|
|
99
|
+
readonly kind: "rule";
|
|
100
|
+
readonly claim_key: string;
|
|
101
|
+
readonly claim_text: string;
|
|
102
|
+
readonly confidence: number;
|
|
103
|
+
readonly evidence: string;
|
|
104
|
+
readonly rationale: string;
|
|
105
|
+
readonly suggested_next_tool: "kb_model_requirement";
|
|
106
|
+
readonly rule: LogicRuleIR;
|
|
107
|
+
readonly semantic_key: string;
|
|
108
|
+
readonly rendered_prolog: string;
|
|
109
|
+
readonly rejected_alternatives: readonly string[];
|
|
110
|
+
readonly applyPlan: readonly Readonly<Record<string, unknown>>[];
|
|
111
|
+
readonly relationshipPlan: Readonly<Record<string, unknown>> | null;
|
|
57
112
|
} | {
|
|
58
113
|
readonly kind: "ambiguity_observation";
|
|
59
114
|
readonly claim_key: string;
|
|
@@ -82,10 +137,18 @@ export type SemanticModelingSuggestion = {
|
|
|
82
137
|
export interface SemanticAdvisorReceipt {
|
|
83
138
|
readonly version: string;
|
|
84
139
|
readonly payload_hash: string;
|
|
140
|
+
readonly inventory_contract: {
|
|
141
|
+
readonly version: "kibi.semantic-inventory.v1";
|
|
142
|
+
readonly source_field: "semantic_text" | "text_ref" | "title";
|
|
143
|
+
readonly source_hash: string;
|
|
144
|
+
};
|
|
85
145
|
readonly logic_readiness: SemanticAdvisorReadiness;
|
|
86
146
|
readonly candidate_lane: SemanticAdvisorLane;
|
|
87
147
|
readonly signals: readonly SemanticSignal[];
|
|
88
148
|
readonly ambiguity_witnesses: readonly SemanticAmbiguityWitness[];
|
|
149
|
+
readonly propositions: readonly SemanticProposition[];
|
|
150
|
+
readonly interpretations: readonly SemanticInterpretationResult[];
|
|
151
|
+
readonly shadow_analysis: readonly SemanticShadowCue[];
|
|
89
152
|
readonly suggestions: readonly SemanticModelingSuggestion[];
|
|
90
153
|
readonly clauses: readonly {
|
|
91
154
|
readonly claim_key: string;
|
|
@@ -108,6 +171,7 @@ export interface SemanticAdvisorReceipt {
|
|
|
108
171
|
export interface SemanticAdvisorInput {
|
|
109
172
|
readonly payload: Readonly<Record<string, unknown>>;
|
|
110
173
|
readonly clauses?: readonly string[];
|
|
174
|
+
readonly interpretations?: readonly SemanticInterpretationInput[];
|
|
111
175
|
}
|
|
112
176
|
export interface SemanticAdvisorAnalysisResult {
|
|
113
177
|
readonly receipt: SemanticAdvisorReceipt;
|
|
@@ -121,6 +185,7 @@ export interface SemanticAdvisorArgs {
|
|
|
121
185
|
readonly title?: string;
|
|
122
186
|
readonly source?: string;
|
|
123
187
|
readonly status?: string;
|
|
188
|
+
readonly interpretations?: readonly SemanticInterpretationInput[];
|
|
124
189
|
}
|
|
125
190
|
export interface SemanticAdvisorOperationResult {
|
|
126
191
|
readonly content: readonly {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAC3B,iBAAiB,GACjB,WAAW,GACX,oBAAoB,GACpB,MAAM,CAAC;AAEX,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AG,OAAO,CAkG5D;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAoD7E;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAGtE;AAqBD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAenD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAmBlE;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAoBzE;AAuDD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,EAAE,CA6DjE"}
|
package/dist/prolog/codec.js
CHANGED
|
@@ -157,7 +157,19 @@ export function parsePropertyList(propsStr) {
|
|
|
157
157
|
if (key === "..." || value === "..." || value === "...|...") {
|
|
158
158
|
continue;
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
let parsed = parsePrologValue(value);
|
|
161
|
+
if ((key === "rule_ir" ||
|
|
162
|
+
key === "semantic_inventory" ||
|
|
163
|
+
key === "verification_receipts") &&
|
|
164
|
+
typeof parsed === "string") {
|
|
165
|
+
try {
|
|
166
|
+
parsed = JSON.parse(parsed);
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
// Keep malformed structured fields as strings so the schema validator
|
|
170
|
+
// can report the precise payload problem instead of losing evidence.
|
|
171
|
+
}
|
|
172
|
+
}
|
|
161
173
|
if (!Object.hasOwn(props, key)) {
|
|
162
174
|
props[key] = parsed;
|
|
163
175
|
continue;
|
|
@@ -232,7 +244,12 @@ export function parsePrologValue(valueInput) {
|
|
|
232
244
|
}
|
|
233
245
|
// Handle quoted string
|
|
234
246
|
if (value.startsWith('"') && value.endsWith('"')) {
|
|
235
|
-
|
|
247
|
+
try {
|
|
248
|
+
return JSON.parse(value);
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
return value.substring(1, value.length - 1);
|
|
252
|
+
}
|
|
236
253
|
}
|
|
237
254
|
// Handle quoted atom
|
|
238
255
|
if (value.startsWith("'") && value.endsWith("'")) {
|
package/dist/prolog.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare class PrologProcess {
|
|
|
20
20
|
private cache;
|
|
21
21
|
private interactiveQueryTail;
|
|
22
22
|
private terminationPromise;
|
|
23
|
+
private oneShotProcesses;
|
|
23
24
|
private useOneShotMode;
|
|
24
25
|
private attachedKbPath;
|
|
25
26
|
private onProcessExit;
|
|
@@ -37,6 +38,11 @@ export declare class PrologProcess {
|
|
|
37
38
|
private clearQueryBuffers;
|
|
38
39
|
private appendOutputChunk;
|
|
39
40
|
private appendErrorChunk;
|
|
41
|
+
private goalLabel;
|
|
42
|
+
private addDiagnosticStage;
|
|
43
|
+
private lastDiagnosticStage;
|
|
44
|
+
private signalProcessTree;
|
|
45
|
+
private terminateProcessTree;
|
|
40
46
|
private isProcessUsable;
|
|
41
47
|
private extractBindings;
|
|
42
48
|
private translateError;
|
package/dist/prolog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prolog.d.ts","sourceRoot":"","sources":["../src/prolog.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prolog.d.ts","sourceRoot":"","sources":["../src/prolog.ts"],"names":[],"mappings":"AAkDA,wBAAgB,eAAe,IAAI,MAAM,CAsCxC;AACD,MAAM,WAAW,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