glasspane-mcp 1.31.2 → 1.31.4
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/dispatch.d.ts +1 -1
- package/dist/http-gateway-cli.js +154 -33
- package/dist/http-gateway.js +154 -33
- package/dist/index.js +131 -12
- package/dist/stdio-session.js +131 -12
- package/package.json +2 -2
- package/schemas/convergence-round-state.schema.json +7 -4
- package/schemas/decision-log-entry.schema.json +4 -2
- package/schemas/evidence-pack.schema.json +10 -6
- package/schemas/invariant-report.schema.json +5 -3
- package/schemas/provider-registration.schema.json +1 -1
- package/schemas/reverification-request.schema.json +1 -1
- package/schemas/run-plan.schema.json +1 -0
package/dist/dispatch.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare const MCP_PROTOCOL_VERSION: "2025-06-18";
|
|
|
26
26
|
export declare const SUPPORTED_PROTOCOL_VERSIONS: readonly string[];
|
|
27
27
|
export declare const SERVER_INFO: {
|
|
28
28
|
readonly name: "glasspane-mcp";
|
|
29
|
-
readonly version: "1.31.
|
|
29
|
+
readonly version: "1.31.4";
|
|
30
30
|
};
|
|
31
31
|
export declare const PARSE_ERROR = -32700;
|
|
32
32
|
export declare const INVALID_REQUEST = -32600;
|
package/dist/http-gateway-cli.js
CHANGED
|
@@ -1207,6 +1207,29 @@ import { URL } from "node:url";
|
|
|
1207
1207
|
|
|
1208
1208
|
// ../node_modules/iterate-kernel/dist/dimension-context.js
|
|
1209
1209
|
import { z } from "zod";
|
|
1210
|
+
|
|
1211
|
+
// ../node_modules/iterate-kernel/dist/errors.js
|
|
1212
|
+
var KernelSchemaError = class extends Error {
|
|
1213
|
+
code = "KERNEL_E_SCHEMA";
|
|
1214
|
+
issues;
|
|
1215
|
+
constructor(label, issues) {
|
|
1216
|
+
const detail = issues.map((issue) => `${issue.path.length > 0 ? issue.path : "<root>"}: ${issue.message}`).join("; ");
|
|
1217
|
+
super(`invalid ${label}: ${detail}`);
|
|
1218
|
+
this.name = "KernelSchemaError";
|
|
1219
|
+
this.issues = issues;
|
|
1220
|
+
}
|
|
1221
|
+
};
|
|
1222
|
+
function segmentText(segment) {
|
|
1223
|
+
return typeof segment === "symbol" ? segment.description ?? "<symbol>" : String(segment);
|
|
1224
|
+
}
|
|
1225
|
+
function schemaErrorFrom(label, error) {
|
|
1226
|
+
return new KernelSchemaError(label, error.issues.map((issue) => ({
|
|
1227
|
+
path: issue.path.map(segmentText).join("."),
|
|
1228
|
+
message: issue.message
|
|
1229
|
+
})));
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
// ../node_modules/iterate-kernel/dist/dimension-context.js
|
|
1210
1233
|
var DIMENSION_ID_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
1211
1234
|
var DIMENSION_ID_MAX_LENGTH = 64;
|
|
1212
1235
|
var DIMENSION_LABEL_MAX_LENGTH = 256;
|
|
@@ -1687,41 +1710,80 @@ function normalizeEvidencePackForRead(input) {
|
|
|
1687
1710
|
}
|
|
1688
1711
|
var EvidencePackReadSchema = z2.preprocess(normalizeEvidencePackForRead, EvidencePackSchema);
|
|
1689
1712
|
|
|
1690
|
-
// ../node_modules/iterate-kernel/dist/errors.js
|
|
1691
|
-
var KernelSchemaError = class extends Error {
|
|
1692
|
-
code = "KERNEL_E_SCHEMA";
|
|
1693
|
-
issues;
|
|
1694
|
-
constructor(label, issues) {
|
|
1695
|
-
const detail = issues.map((issue) => `${issue.path.length > 0 ? issue.path : "<root>"}: ${issue.message}`).join("; ");
|
|
1696
|
-
super(`invalid ${label}: ${detail}`);
|
|
1697
|
-
this.name = "KernelSchemaError";
|
|
1698
|
-
this.issues = issues;
|
|
1699
|
-
}
|
|
1700
|
-
};
|
|
1701
|
-
function segmentText(segment) {
|
|
1702
|
-
return typeof segment === "symbol" ? segment.description ?? "<symbol>" : String(segment);
|
|
1703
|
-
}
|
|
1704
|
-
function schemaErrorFrom(label, error) {
|
|
1705
|
-
return new KernelSchemaError(label, error.issues.map((issue) => ({
|
|
1706
|
-
path: issue.path.map(segmentText).join("."),
|
|
1707
|
-
message: issue.message
|
|
1708
|
-
})));
|
|
1709
|
-
}
|
|
1710
|
-
|
|
1711
1713
|
// ../node_modules/iterate-kernel/dist/decision-log-entry.js
|
|
1712
1714
|
import { z as z3 } from "zod";
|
|
1713
1715
|
|
|
1714
1716
|
// ../node_modules/iterate-kernel/dist/canonical-json.js
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1717
|
+
var CANONICAL_JSON_CODES = {
|
|
1718
|
+
value: "KERNEL_E_CANONICAL_VALUE",
|
|
1719
|
+
depth: "KERNEL_E_CANONICAL_DEPTH"
|
|
1720
|
+
};
|
|
1721
|
+
var KernelCanonicalJsonError = class extends Error {
|
|
1722
|
+
code;
|
|
1723
|
+
remedy;
|
|
1724
|
+
constructor(code, message, remedy) {
|
|
1725
|
+
super(`${code}: ${message}`);
|
|
1726
|
+
this.name = "KernelCanonicalJsonError";
|
|
1727
|
+
this.code = code;
|
|
1728
|
+
this.remedy = remedy;
|
|
1718
1729
|
}
|
|
1719
|
-
|
|
1720
|
-
|
|
1730
|
+
};
|
|
1731
|
+
var CANONICAL_JSON_MAX_DEPTH = 512;
|
|
1732
|
+
var KERNEL_SAFE_INTEGER_MAX = Number.MAX_SAFE_INTEGER;
|
|
1733
|
+
var KERNEL_SAFE_INTEGER_MIN = -Number.MAX_SAFE_INTEGER;
|
|
1734
|
+
function canonicalJson(value) {
|
|
1735
|
+
return write(value, 0);
|
|
1736
|
+
}
|
|
1737
|
+
function write(value, depth) {
|
|
1738
|
+
if (depth > CANONICAL_JSON_MAX_DEPTH) {
|
|
1739
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.depth, `value is nested deeper than ${CANONICAL_JSON_MAX_DEPTH} levels`, "flatten what is being recorded: a digest over a structure this deep cannot be recomputed by a reader that streams the form, and no contract in this package describes nesting this deep");
|
|
1740
|
+
}
|
|
1741
|
+
if (value === null)
|
|
1742
|
+
return "null";
|
|
1743
|
+
switch (typeof value) {
|
|
1744
|
+
case "string":
|
|
1745
|
+
case "boolean":
|
|
1746
|
+
return JSON.stringify(value);
|
|
1747
|
+
case "number":
|
|
1748
|
+
if (!Number.isFinite(value)) {
|
|
1749
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `${String(value)} has no JSON representation, and JSON.stringify would print it as \`null\``, "record the number the measurement produced, or record the absence of one; a digest that collapses NaN, Infinity and null into the same bytes cannot tell a failed measurement from an absent one");
|
|
1750
|
+
}
|
|
1751
|
+
return JSON.stringify(value);
|
|
1752
|
+
case "object": {
|
|
1753
|
+
if (Array.isArray(value)) {
|
|
1754
|
+
const items = [];
|
|
1755
|
+
for (let i = 0; i < value.length; i++) {
|
|
1756
|
+
if (!Object.hasOwn(value, String(i))) {
|
|
1757
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `array index ${i} is a hole, which JSON has no token for`, "fill the position with null or drop it; a sparse array would serialise to a missing element between commas, which is not JSON at all");
|
|
1758
|
+
}
|
|
1759
|
+
items.push(write(value[i], depth + 1));
|
|
1760
|
+
}
|
|
1761
|
+
return "[" + items.join(",") + "]";
|
|
1762
|
+
}
|
|
1763
|
+
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) {
|
|
1764
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `a ${value instanceof Date ? "Date" : "value whose prototype is not Object.prototype"} has no place in the canonical form; JSON.stringify would print it as a string or as an empty object`, "convert it to the fields the contract states before digesting it \u2014 a class instance's own enumerable properties are not a documented shape, so two runtimes would print two different byte sequences for it");
|
|
1765
|
+
}
|
|
1766
|
+
const record = value;
|
|
1767
|
+
const keys = Object.keys(record).sort();
|
|
1768
|
+
return "{" + keys.map((key) => JSON.stringify(key) + ":" + write(record[key], depth + 1)).join(",") + "}";
|
|
1769
|
+
}
|
|
1770
|
+
default:
|
|
1771
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `cannot canonicalise ${typeName(value)}: JSON.stringify would print it as the bare word \`undefined\`, which is not JSON`, "undefined, functions, symbols and bigints are not values this form can name; omit the key or put the value the producer actually has");
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
function typeName(value) {
|
|
1775
|
+
switch (typeof value) {
|
|
1776
|
+
case "function":
|
|
1777
|
+
return "a function";
|
|
1778
|
+
case "symbol":
|
|
1779
|
+
return "a symbol";
|
|
1780
|
+
case "bigint":
|
|
1781
|
+
return "a bigint";
|
|
1782
|
+
case "undefined":
|
|
1783
|
+
return "an undefined value";
|
|
1784
|
+
default:
|
|
1785
|
+
return `a ${typeof value}`;
|
|
1721
1786
|
}
|
|
1722
|
-
const record = value;
|
|
1723
|
-
const keys = Object.keys(record).sort();
|
|
1724
|
-
return "{" + keys.map((key) => JSON.stringify(key) + ":" + canonicalJson(record[key])).join(",") + "}";
|
|
1725
1787
|
}
|
|
1726
1788
|
|
|
1727
1789
|
// ../node_modules/iterate-kernel/dist/decision-log-entry.js
|
|
@@ -1730,6 +1792,7 @@ var PREV_ENTRY_HASH_PATTERN = /^([0-9a-f]{64})?$/;
|
|
|
1730
1792
|
var SUMMARY_MAX_LENGTH = 2048;
|
|
1731
1793
|
var DECISION_KIND_PATTERN = /^[a-z][a-z0-9_]{0,31}$/;
|
|
1732
1794
|
var PAYLOAD_MAX_CANONICAL_LENGTH = 8192;
|
|
1795
|
+
var PAYLOAD_RESERVED_KEYS = ["__proto__"];
|
|
1733
1796
|
var DecisionOutcomeSchema = z3.enum(["pass", "fail", "blocked", "inconclusive"]);
|
|
1734
1797
|
var DecisionLogEntrySchema = z3.strictObject({
|
|
1735
1798
|
entryId: z3.string().regex(DECISION_ENTRY_ID_PATTERN),
|
|
@@ -1742,7 +1805,37 @@ var DecisionLogEntrySchema = z3.strictObject({
|
|
|
1742
1805
|
kind: z3.string().regex(DECISION_KIND_PATTERN).optional(),
|
|
1743
1806
|
round: z3.number().int().min(0).optional(),
|
|
1744
1807
|
dimension: z3.string().regex(DIMENSION_ID_PATTERN).max(DIMENSION_ID_MAX_LENGTH).optional(),
|
|
1745
|
-
payload: z3.record(z3.string(), z3.unknown()).optional().
|
|
1808
|
+
payload: z3.record(z3.string(), z3.unknown()).optional().superRefine((value, ctx) => {
|
|
1809
|
+
if (value === void 0)
|
|
1810
|
+
return;
|
|
1811
|
+
for (const key of Object.keys(value)) {
|
|
1812
|
+
if (PAYLOAD_RESERVED_KEYS.includes(key)) {
|
|
1813
|
+
ctx.addIssue({
|
|
1814
|
+
code: z3.ZodIssueCode.custom,
|
|
1815
|
+
path: ["payload", key],
|
|
1816
|
+
message: `\`payload\` cannot carry the key "${key}": assigning it in JavaScript rewrites the object instead of storing a value, so the key would disappear from the canonical bytes this entry is hashed over`
|
|
1817
|
+
});
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
let canonical;
|
|
1821
|
+
try {
|
|
1822
|
+
canonical = canonicalJson(value);
|
|
1823
|
+
} catch (error) {
|
|
1824
|
+
ctx.addIssue({
|
|
1825
|
+
code: z3.ZodIssueCode.custom,
|
|
1826
|
+
path: ["payload"],
|
|
1827
|
+
message: error instanceof Error ? error.message : "payload contains a value with no JSON representation"
|
|
1828
|
+
});
|
|
1829
|
+
return;
|
|
1830
|
+
}
|
|
1831
|
+
if (canonical.length > PAYLOAD_MAX_CANONICAL_LENGTH) {
|
|
1832
|
+
ctx.addIssue({
|
|
1833
|
+
code: z3.ZodIssueCode.custom,
|
|
1834
|
+
path: ["payload"],
|
|
1835
|
+
message: `payload must stay within ${PAYLOAD_MAX_CANONICAL_LENGTH} characters of canonical JSON`
|
|
1836
|
+
});
|
|
1837
|
+
}
|
|
1838
|
+
})
|
|
1746
1839
|
});
|
|
1747
1840
|
|
|
1748
1841
|
// ../node_modules/iterate-kernel/dist/recipe-config.js
|
|
@@ -1851,6 +1944,20 @@ var ReverificationTargetsSchema = z6.strictObject({
|
|
|
1851
1944
|
message: "an empty target set is not a re-verification: state which recipe steps, dimensions, or operations to re-run"
|
|
1852
1945
|
});
|
|
1853
1946
|
}
|
|
1947
|
+
for (const field of ["dimensions", "operationIds"]) {
|
|
1948
|
+
const list = targets[field];
|
|
1949
|
+
if (list === void 0)
|
|
1950
|
+
continue;
|
|
1951
|
+
list.forEach((name, index) => {
|
|
1952
|
+
if (list.indexOf(name) !== index) {
|
|
1953
|
+
ctx.addIssue({
|
|
1954
|
+
code: z6.ZodIssueCode.custom,
|
|
1955
|
+
path: [field, index],
|
|
1956
|
+
message: `"${name}" is listed twice in ${field}; a repeated target asks for the same work twice while the schedule reads the list as a set`
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
});
|
|
1960
|
+
}
|
|
1854
1961
|
});
|
|
1855
1962
|
var ReverificationRequestSchema = z6.strictObject({
|
|
1856
1963
|
schemaVersion: z6.literal(REVERIFICATION_SCHEMA_VERSION),
|
|
@@ -1925,8 +2032,22 @@ var ProviderMethodSchema = z8.strictObject({
|
|
|
1925
2032
|
* What this method needs to run: capability names, not booleans per capability,
|
|
1926
2033
|
* so adding one does not require widening a schema on both sides. An empty list
|
|
1927
2034
|
* means "no prerequisites", which is a claim the provider has to make.
|
|
2035
|
+
*
|
|
2036
|
+
* `uniqueItems` is declared in `schemas/provider-registration.schema.json`, and
|
|
2037
|
+
* a declared rule the validator does not enforce is a rule one consumer can
|
|
2038
|
+
* break while every reader believes it.
|
|
1928
2039
|
*/
|
|
1929
|
-
requires: z8.array(z8.string().regex(PROVIDER_ID_PATTERN).max(PROVIDER_ID_MAX_LENGTH)).max(16)
|
|
2040
|
+
requires: z8.array(z8.string().regex(PROVIDER_ID_PATTERN).max(PROVIDER_ID_MAX_LENGTH)).max(16).superRefine((names, ctx) => {
|
|
2041
|
+
names.forEach((name, index) => {
|
|
2042
|
+
if (names.indexOf(name) !== index) {
|
|
2043
|
+
ctx.addIssue({
|
|
2044
|
+
code: z8.ZodIssueCode.custom,
|
|
2045
|
+
path: [index],
|
|
2046
|
+
message: `"${name}" is listed twice; a repeated prerequisite changes nothing about what the method needs, so the repetition is either a mistake or an attempt to make a list mean two things at once`
|
|
2047
|
+
});
|
|
2048
|
+
}
|
|
2049
|
+
});
|
|
2050
|
+
})
|
|
1930
2051
|
});
|
|
1931
2052
|
var ProviderRegistrationSchema = z8.strictObject({
|
|
1932
2053
|
schemaVersion: z8.literal(PROVIDER_SCHEMA_VERSION),
|
|
@@ -1985,7 +2106,7 @@ function registerProvider(registry, provider) {
|
|
|
1985
2106
|
return { ...registry, [parsed.id]: parsed };
|
|
1986
2107
|
}
|
|
1987
2108
|
function resolveProvider(registry, id) {
|
|
1988
|
-
const provider = registry[id];
|
|
2109
|
+
const provider = Object.hasOwn(registry, id) ? registry[id] : void 0;
|
|
1989
2110
|
if (!provider) {
|
|
1990
2111
|
throw new KernelProviderError(PROVIDER_CODES.unknown, id, `no provider registered under "${id}"`, `registered: ${registeredIds(registry)}`);
|
|
1991
2112
|
}
|
|
@@ -4021,7 +4142,7 @@ function mapAuditError(error, engineMethod = "last_evidence") {
|
|
|
4021
4142
|
}
|
|
4022
4143
|
|
|
4023
4144
|
// src/dispatch.ts
|
|
4024
|
-
var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.
|
|
4145
|
+
var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.4" };
|
|
4025
4146
|
|
|
4026
4147
|
// src/http-gateway.ts
|
|
4027
4148
|
var GLASSPANE_HTTP_TOKEN_ENV = "GLASSPANE_HTTP_TOKEN";
|
package/dist/http-gateway.js
CHANGED
|
@@ -1155,6 +1155,29 @@ function unixSocketEngineClient(socketPath, options = {}) {
|
|
|
1155
1155
|
|
|
1156
1156
|
// ../node_modules/iterate-kernel/dist/dimension-context.js
|
|
1157
1157
|
import { z } from "zod";
|
|
1158
|
+
|
|
1159
|
+
// ../node_modules/iterate-kernel/dist/errors.js
|
|
1160
|
+
var KernelSchemaError = class extends Error {
|
|
1161
|
+
code = "KERNEL_E_SCHEMA";
|
|
1162
|
+
issues;
|
|
1163
|
+
constructor(label, issues) {
|
|
1164
|
+
const detail = issues.map((issue) => `${issue.path.length > 0 ? issue.path : "<root>"}: ${issue.message}`).join("; ");
|
|
1165
|
+
super(`invalid ${label}: ${detail}`);
|
|
1166
|
+
this.name = "KernelSchemaError";
|
|
1167
|
+
this.issues = issues;
|
|
1168
|
+
}
|
|
1169
|
+
};
|
|
1170
|
+
function segmentText(segment) {
|
|
1171
|
+
return typeof segment === "symbol" ? segment.description ?? "<symbol>" : String(segment);
|
|
1172
|
+
}
|
|
1173
|
+
function schemaErrorFrom(label, error) {
|
|
1174
|
+
return new KernelSchemaError(label, error.issues.map((issue) => ({
|
|
1175
|
+
path: issue.path.map(segmentText).join("."),
|
|
1176
|
+
message: issue.message
|
|
1177
|
+
})));
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
// ../node_modules/iterate-kernel/dist/dimension-context.js
|
|
1158
1181
|
var DIMENSION_ID_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
1159
1182
|
var DIMENSION_ID_MAX_LENGTH = 64;
|
|
1160
1183
|
var DIMENSION_LABEL_MAX_LENGTH = 256;
|
|
@@ -1635,41 +1658,80 @@ function normalizeEvidencePackForRead(input) {
|
|
|
1635
1658
|
}
|
|
1636
1659
|
var EvidencePackReadSchema = z2.preprocess(normalizeEvidencePackForRead, EvidencePackSchema);
|
|
1637
1660
|
|
|
1638
|
-
// ../node_modules/iterate-kernel/dist/errors.js
|
|
1639
|
-
var KernelSchemaError = class extends Error {
|
|
1640
|
-
code = "KERNEL_E_SCHEMA";
|
|
1641
|
-
issues;
|
|
1642
|
-
constructor(label, issues) {
|
|
1643
|
-
const detail = issues.map((issue) => `${issue.path.length > 0 ? issue.path : "<root>"}: ${issue.message}`).join("; ");
|
|
1644
|
-
super(`invalid ${label}: ${detail}`);
|
|
1645
|
-
this.name = "KernelSchemaError";
|
|
1646
|
-
this.issues = issues;
|
|
1647
|
-
}
|
|
1648
|
-
};
|
|
1649
|
-
function segmentText(segment) {
|
|
1650
|
-
return typeof segment === "symbol" ? segment.description ?? "<symbol>" : String(segment);
|
|
1651
|
-
}
|
|
1652
|
-
function schemaErrorFrom(label, error) {
|
|
1653
|
-
return new KernelSchemaError(label, error.issues.map((issue) => ({
|
|
1654
|
-
path: issue.path.map(segmentText).join("."),
|
|
1655
|
-
message: issue.message
|
|
1656
|
-
})));
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
1661
|
// ../node_modules/iterate-kernel/dist/decision-log-entry.js
|
|
1660
1662
|
import { z as z3 } from "zod";
|
|
1661
1663
|
|
|
1662
1664
|
// ../node_modules/iterate-kernel/dist/canonical-json.js
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1665
|
+
var CANONICAL_JSON_CODES = {
|
|
1666
|
+
value: "KERNEL_E_CANONICAL_VALUE",
|
|
1667
|
+
depth: "KERNEL_E_CANONICAL_DEPTH"
|
|
1668
|
+
};
|
|
1669
|
+
var KernelCanonicalJsonError = class extends Error {
|
|
1670
|
+
code;
|
|
1671
|
+
remedy;
|
|
1672
|
+
constructor(code, message, remedy) {
|
|
1673
|
+
super(`${code}: ${message}`);
|
|
1674
|
+
this.name = "KernelCanonicalJsonError";
|
|
1675
|
+
this.code = code;
|
|
1676
|
+
this.remedy = remedy;
|
|
1666
1677
|
}
|
|
1667
|
-
|
|
1668
|
-
|
|
1678
|
+
};
|
|
1679
|
+
var CANONICAL_JSON_MAX_DEPTH = 512;
|
|
1680
|
+
var KERNEL_SAFE_INTEGER_MAX = Number.MAX_SAFE_INTEGER;
|
|
1681
|
+
var KERNEL_SAFE_INTEGER_MIN = -Number.MAX_SAFE_INTEGER;
|
|
1682
|
+
function canonicalJson(value) {
|
|
1683
|
+
return write(value, 0);
|
|
1684
|
+
}
|
|
1685
|
+
function write(value, depth) {
|
|
1686
|
+
if (depth > CANONICAL_JSON_MAX_DEPTH) {
|
|
1687
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.depth, `value is nested deeper than ${CANONICAL_JSON_MAX_DEPTH} levels`, "flatten what is being recorded: a digest over a structure this deep cannot be recomputed by a reader that streams the form, and no contract in this package describes nesting this deep");
|
|
1688
|
+
}
|
|
1689
|
+
if (value === null)
|
|
1690
|
+
return "null";
|
|
1691
|
+
switch (typeof value) {
|
|
1692
|
+
case "string":
|
|
1693
|
+
case "boolean":
|
|
1694
|
+
return JSON.stringify(value);
|
|
1695
|
+
case "number":
|
|
1696
|
+
if (!Number.isFinite(value)) {
|
|
1697
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `${String(value)} has no JSON representation, and JSON.stringify would print it as \`null\``, "record the number the measurement produced, or record the absence of one; a digest that collapses NaN, Infinity and null into the same bytes cannot tell a failed measurement from an absent one");
|
|
1698
|
+
}
|
|
1699
|
+
return JSON.stringify(value);
|
|
1700
|
+
case "object": {
|
|
1701
|
+
if (Array.isArray(value)) {
|
|
1702
|
+
const items = [];
|
|
1703
|
+
for (let i = 0; i < value.length; i++) {
|
|
1704
|
+
if (!Object.hasOwn(value, String(i))) {
|
|
1705
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `array index ${i} is a hole, which JSON has no token for`, "fill the position with null or drop it; a sparse array would serialise to a missing element between commas, which is not JSON at all");
|
|
1706
|
+
}
|
|
1707
|
+
items.push(write(value[i], depth + 1));
|
|
1708
|
+
}
|
|
1709
|
+
return "[" + items.join(",") + "]";
|
|
1710
|
+
}
|
|
1711
|
+
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) {
|
|
1712
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `a ${value instanceof Date ? "Date" : "value whose prototype is not Object.prototype"} has no place in the canonical form; JSON.stringify would print it as a string or as an empty object`, "convert it to the fields the contract states before digesting it \u2014 a class instance's own enumerable properties are not a documented shape, so two runtimes would print two different byte sequences for it");
|
|
1713
|
+
}
|
|
1714
|
+
const record = value;
|
|
1715
|
+
const keys = Object.keys(record).sort();
|
|
1716
|
+
return "{" + keys.map((key) => JSON.stringify(key) + ":" + write(record[key], depth + 1)).join(",") + "}";
|
|
1717
|
+
}
|
|
1718
|
+
default:
|
|
1719
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `cannot canonicalise ${typeName(value)}: JSON.stringify would print it as the bare word \`undefined\`, which is not JSON`, "undefined, functions, symbols and bigints are not values this form can name; omit the key or put the value the producer actually has");
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
function typeName(value) {
|
|
1723
|
+
switch (typeof value) {
|
|
1724
|
+
case "function":
|
|
1725
|
+
return "a function";
|
|
1726
|
+
case "symbol":
|
|
1727
|
+
return "a symbol";
|
|
1728
|
+
case "bigint":
|
|
1729
|
+
return "a bigint";
|
|
1730
|
+
case "undefined":
|
|
1731
|
+
return "an undefined value";
|
|
1732
|
+
default:
|
|
1733
|
+
return `a ${typeof value}`;
|
|
1669
1734
|
}
|
|
1670
|
-
const record = value;
|
|
1671
|
-
const keys = Object.keys(record).sort();
|
|
1672
|
-
return "{" + keys.map((key) => JSON.stringify(key) + ":" + canonicalJson(record[key])).join(",") + "}";
|
|
1673
1735
|
}
|
|
1674
1736
|
|
|
1675
1737
|
// ../node_modules/iterate-kernel/dist/decision-log-entry.js
|
|
@@ -1678,6 +1740,7 @@ var PREV_ENTRY_HASH_PATTERN = /^([0-9a-f]{64})?$/;
|
|
|
1678
1740
|
var SUMMARY_MAX_LENGTH = 2048;
|
|
1679
1741
|
var DECISION_KIND_PATTERN = /^[a-z][a-z0-9_]{0,31}$/;
|
|
1680
1742
|
var PAYLOAD_MAX_CANONICAL_LENGTH = 8192;
|
|
1743
|
+
var PAYLOAD_RESERVED_KEYS = ["__proto__"];
|
|
1681
1744
|
var DecisionOutcomeSchema = z3.enum(["pass", "fail", "blocked", "inconclusive"]);
|
|
1682
1745
|
var DecisionLogEntrySchema = z3.strictObject({
|
|
1683
1746
|
entryId: z3.string().regex(DECISION_ENTRY_ID_PATTERN),
|
|
@@ -1690,7 +1753,37 @@ var DecisionLogEntrySchema = z3.strictObject({
|
|
|
1690
1753
|
kind: z3.string().regex(DECISION_KIND_PATTERN).optional(),
|
|
1691
1754
|
round: z3.number().int().min(0).optional(),
|
|
1692
1755
|
dimension: z3.string().regex(DIMENSION_ID_PATTERN).max(DIMENSION_ID_MAX_LENGTH).optional(),
|
|
1693
|
-
payload: z3.record(z3.string(), z3.unknown()).optional().
|
|
1756
|
+
payload: z3.record(z3.string(), z3.unknown()).optional().superRefine((value, ctx) => {
|
|
1757
|
+
if (value === void 0)
|
|
1758
|
+
return;
|
|
1759
|
+
for (const key of Object.keys(value)) {
|
|
1760
|
+
if (PAYLOAD_RESERVED_KEYS.includes(key)) {
|
|
1761
|
+
ctx.addIssue({
|
|
1762
|
+
code: z3.ZodIssueCode.custom,
|
|
1763
|
+
path: ["payload", key],
|
|
1764
|
+
message: `\`payload\` cannot carry the key "${key}": assigning it in JavaScript rewrites the object instead of storing a value, so the key would disappear from the canonical bytes this entry is hashed over`
|
|
1765
|
+
});
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
let canonical;
|
|
1769
|
+
try {
|
|
1770
|
+
canonical = canonicalJson(value);
|
|
1771
|
+
} catch (error) {
|
|
1772
|
+
ctx.addIssue({
|
|
1773
|
+
code: z3.ZodIssueCode.custom,
|
|
1774
|
+
path: ["payload"],
|
|
1775
|
+
message: error instanceof Error ? error.message : "payload contains a value with no JSON representation"
|
|
1776
|
+
});
|
|
1777
|
+
return;
|
|
1778
|
+
}
|
|
1779
|
+
if (canonical.length > PAYLOAD_MAX_CANONICAL_LENGTH) {
|
|
1780
|
+
ctx.addIssue({
|
|
1781
|
+
code: z3.ZodIssueCode.custom,
|
|
1782
|
+
path: ["payload"],
|
|
1783
|
+
message: `payload must stay within ${PAYLOAD_MAX_CANONICAL_LENGTH} characters of canonical JSON`
|
|
1784
|
+
});
|
|
1785
|
+
}
|
|
1786
|
+
})
|
|
1694
1787
|
});
|
|
1695
1788
|
|
|
1696
1789
|
// ../node_modules/iterate-kernel/dist/recipe-config.js
|
|
@@ -1799,6 +1892,20 @@ var ReverificationTargetsSchema = z6.strictObject({
|
|
|
1799
1892
|
message: "an empty target set is not a re-verification: state which recipe steps, dimensions, or operations to re-run"
|
|
1800
1893
|
});
|
|
1801
1894
|
}
|
|
1895
|
+
for (const field of ["dimensions", "operationIds"]) {
|
|
1896
|
+
const list = targets[field];
|
|
1897
|
+
if (list === void 0)
|
|
1898
|
+
continue;
|
|
1899
|
+
list.forEach((name, index) => {
|
|
1900
|
+
if (list.indexOf(name) !== index) {
|
|
1901
|
+
ctx.addIssue({
|
|
1902
|
+
code: z6.ZodIssueCode.custom,
|
|
1903
|
+
path: [field, index],
|
|
1904
|
+
message: `"${name}" is listed twice in ${field}; a repeated target asks for the same work twice while the schedule reads the list as a set`
|
|
1905
|
+
});
|
|
1906
|
+
}
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1802
1909
|
});
|
|
1803
1910
|
var ReverificationRequestSchema = z6.strictObject({
|
|
1804
1911
|
schemaVersion: z6.literal(REVERIFICATION_SCHEMA_VERSION),
|
|
@@ -1873,8 +1980,22 @@ var ProviderMethodSchema = z8.strictObject({
|
|
|
1873
1980
|
* What this method needs to run: capability names, not booleans per capability,
|
|
1874
1981
|
* so adding one does not require widening a schema on both sides. An empty list
|
|
1875
1982
|
* means "no prerequisites", which is a claim the provider has to make.
|
|
1983
|
+
*
|
|
1984
|
+
* `uniqueItems` is declared in `schemas/provider-registration.schema.json`, and
|
|
1985
|
+
* a declared rule the validator does not enforce is a rule one consumer can
|
|
1986
|
+
* break while every reader believes it.
|
|
1876
1987
|
*/
|
|
1877
|
-
requires: z8.array(z8.string().regex(PROVIDER_ID_PATTERN).max(PROVIDER_ID_MAX_LENGTH)).max(16)
|
|
1988
|
+
requires: z8.array(z8.string().regex(PROVIDER_ID_PATTERN).max(PROVIDER_ID_MAX_LENGTH)).max(16).superRefine((names, ctx) => {
|
|
1989
|
+
names.forEach((name, index) => {
|
|
1990
|
+
if (names.indexOf(name) !== index) {
|
|
1991
|
+
ctx.addIssue({
|
|
1992
|
+
code: z8.ZodIssueCode.custom,
|
|
1993
|
+
path: [index],
|
|
1994
|
+
message: `"${name}" is listed twice; a repeated prerequisite changes nothing about what the method needs, so the repetition is either a mistake or an attempt to make a list mean two things at once`
|
|
1995
|
+
});
|
|
1996
|
+
}
|
|
1997
|
+
});
|
|
1998
|
+
})
|
|
1878
1999
|
});
|
|
1879
2000
|
var ProviderRegistrationSchema = z8.strictObject({
|
|
1880
2001
|
schemaVersion: z8.literal(PROVIDER_SCHEMA_VERSION),
|
|
@@ -1933,7 +2054,7 @@ function registerProvider(registry, provider) {
|
|
|
1933
2054
|
return { ...registry, [parsed.id]: parsed };
|
|
1934
2055
|
}
|
|
1935
2056
|
function resolveProvider(registry, id) {
|
|
1936
|
-
const provider = registry[id];
|
|
2057
|
+
const provider = Object.hasOwn(registry, id) ? registry[id] : void 0;
|
|
1937
2058
|
if (!provider) {
|
|
1938
2059
|
throw new KernelProviderError(PROVIDER_CODES.unknown, id, `no provider registered under "${id}"`, `registered: ${registeredIds(registry)}`);
|
|
1939
2060
|
}
|
|
@@ -3969,7 +4090,7 @@ function mapAuditError(error, engineMethod = "last_evidence") {
|
|
|
3969
4090
|
}
|
|
3970
4091
|
|
|
3971
4092
|
// src/dispatch.ts
|
|
3972
|
-
var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.
|
|
4093
|
+
var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.4" };
|
|
3973
4094
|
|
|
3974
4095
|
// src/http-gateway.ts
|
|
3975
4096
|
var GLASSPANE_HTTP_TOKEN_ENV = "GLASSPANE_HTTP_TOKEN";
|
package/dist/index.js
CHANGED
|
@@ -443,16 +443,76 @@ function schemaErrorFrom(label, error) {
|
|
|
443
443
|
import { z as z3 } from "zod";
|
|
444
444
|
|
|
445
445
|
// ../node_modules/iterate-kernel/dist/canonical-json.js
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
446
|
+
var CANONICAL_JSON_CODES = {
|
|
447
|
+
value: "KERNEL_E_CANONICAL_VALUE",
|
|
448
|
+
depth: "KERNEL_E_CANONICAL_DEPTH"
|
|
449
|
+
};
|
|
450
|
+
var KernelCanonicalJsonError = class extends Error {
|
|
451
|
+
code;
|
|
452
|
+
remedy;
|
|
453
|
+
constructor(code, message, remedy) {
|
|
454
|
+
super(`${code}: ${message}`);
|
|
455
|
+
this.name = "KernelCanonicalJsonError";
|
|
456
|
+
this.code = code;
|
|
457
|
+
this.remedy = remedy;
|
|
449
458
|
}
|
|
450
|
-
|
|
451
|
-
|
|
459
|
+
};
|
|
460
|
+
var CANONICAL_JSON_MAX_DEPTH = 512;
|
|
461
|
+
var KERNEL_SAFE_INTEGER_MAX = Number.MAX_SAFE_INTEGER;
|
|
462
|
+
var KERNEL_SAFE_INTEGER_MIN = -Number.MAX_SAFE_INTEGER;
|
|
463
|
+
function canonicalJson2(value) {
|
|
464
|
+
return write(value, 0);
|
|
465
|
+
}
|
|
466
|
+
function write(value, depth) {
|
|
467
|
+
if (depth > CANONICAL_JSON_MAX_DEPTH) {
|
|
468
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.depth, `value is nested deeper than ${CANONICAL_JSON_MAX_DEPTH} levels`, "flatten what is being recorded: a digest over a structure this deep cannot be recomputed by a reader that streams the form, and no contract in this package describes nesting this deep");
|
|
469
|
+
}
|
|
470
|
+
if (value === null)
|
|
471
|
+
return "null";
|
|
472
|
+
switch (typeof value) {
|
|
473
|
+
case "string":
|
|
474
|
+
case "boolean":
|
|
475
|
+
return JSON.stringify(value);
|
|
476
|
+
case "number":
|
|
477
|
+
if (!Number.isFinite(value)) {
|
|
478
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `${String(value)} has no JSON representation, and JSON.stringify would print it as \`null\``, "record the number the measurement produced, or record the absence of one; a digest that collapses NaN, Infinity and null into the same bytes cannot tell a failed measurement from an absent one");
|
|
479
|
+
}
|
|
480
|
+
return JSON.stringify(value);
|
|
481
|
+
case "object": {
|
|
482
|
+
if (Array.isArray(value)) {
|
|
483
|
+
const items = [];
|
|
484
|
+
for (let i = 0; i < value.length; i++) {
|
|
485
|
+
if (!Object.hasOwn(value, String(i))) {
|
|
486
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `array index ${i} is a hole, which JSON has no token for`, "fill the position with null or drop it; a sparse array would serialise to a missing element between commas, which is not JSON at all");
|
|
487
|
+
}
|
|
488
|
+
items.push(write(value[i], depth + 1));
|
|
489
|
+
}
|
|
490
|
+
return "[" + items.join(",") + "]";
|
|
491
|
+
}
|
|
492
|
+
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) {
|
|
493
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `a ${value instanceof Date ? "Date" : "value whose prototype is not Object.prototype"} has no place in the canonical form; JSON.stringify would print it as a string or as an empty object`, "convert it to the fields the contract states before digesting it \u2014 a class instance's own enumerable properties are not a documented shape, so two runtimes would print two different byte sequences for it");
|
|
494
|
+
}
|
|
495
|
+
const record = value;
|
|
496
|
+
const keys = Object.keys(record).sort();
|
|
497
|
+
return "{" + keys.map((key) => JSON.stringify(key) + ":" + write(record[key], depth + 1)).join(",") + "}";
|
|
498
|
+
}
|
|
499
|
+
default:
|
|
500
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `cannot canonicalise ${typeName(value)}: JSON.stringify would print it as the bare word \`undefined\`, which is not JSON`, "undefined, functions, symbols and bigints are not values this form can name; omit the key or put the value the producer actually has");
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
function typeName(value) {
|
|
504
|
+
switch (typeof value) {
|
|
505
|
+
case "function":
|
|
506
|
+
return "a function";
|
|
507
|
+
case "symbol":
|
|
508
|
+
return "a symbol";
|
|
509
|
+
case "bigint":
|
|
510
|
+
return "a bigint";
|
|
511
|
+
case "undefined":
|
|
512
|
+
return "an undefined value";
|
|
513
|
+
default:
|
|
514
|
+
return `a ${typeof value}`;
|
|
452
515
|
}
|
|
453
|
-
const record = value;
|
|
454
|
-
const keys = Object.keys(record).sort();
|
|
455
|
-
return "{" + keys.map((key) => JSON.stringify(key) + ":" + canonicalJson2(record[key])).join(",") + "}";
|
|
456
516
|
}
|
|
457
517
|
|
|
458
518
|
// ../node_modules/iterate-kernel/dist/dimension-context.js
|
|
@@ -504,6 +564,7 @@ var PREV_ENTRY_HASH_PATTERN = /^([0-9a-f]{64})?$/;
|
|
|
504
564
|
var SUMMARY_MAX_LENGTH = 2048;
|
|
505
565
|
var DECISION_KIND_PATTERN = /^[a-z][a-z0-9_]{0,31}$/;
|
|
506
566
|
var PAYLOAD_MAX_CANONICAL_LENGTH = 8192;
|
|
567
|
+
var PAYLOAD_RESERVED_KEYS = ["__proto__"];
|
|
507
568
|
var DecisionOutcomeSchema = z3.enum(["pass", "fail", "blocked", "inconclusive"]);
|
|
508
569
|
var DecisionLogEntrySchema = z3.strictObject({
|
|
509
570
|
entryId: z3.string().regex(DECISION_ENTRY_ID_PATTERN),
|
|
@@ -516,7 +577,37 @@ var DecisionLogEntrySchema = z3.strictObject({
|
|
|
516
577
|
kind: z3.string().regex(DECISION_KIND_PATTERN).optional(),
|
|
517
578
|
round: z3.number().int().min(0).optional(),
|
|
518
579
|
dimension: z3.string().regex(DIMENSION_ID_PATTERN).max(DIMENSION_ID_MAX_LENGTH).optional(),
|
|
519
|
-
payload: z3.record(z3.string(), z3.unknown()).optional().
|
|
580
|
+
payload: z3.record(z3.string(), z3.unknown()).optional().superRefine((value, ctx) => {
|
|
581
|
+
if (value === void 0)
|
|
582
|
+
return;
|
|
583
|
+
for (const key of Object.keys(value)) {
|
|
584
|
+
if (PAYLOAD_RESERVED_KEYS.includes(key)) {
|
|
585
|
+
ctx.addIssue({
|
|
586
|
+
code: z3.ZodIssueCode.custom,
|
|
587
|
+
path: ["payload", key],
|
|
588
|
+
message: `\`payload\` cannot carry the key "${key}": assigning it in JavaScript rewrites the object instead of storing a value, so the key would disappear from the canonical bytes this entry is hashed over`
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
let canonical;
|
|
593
|
+
try {
|
|
594
|
+
canonical = canonicalJson2(value);
|
|
595
|
+
} catch (error) {
|
|
596
|
+
ctx.addIssue({
|
|
597
|
+
code: z3.ZodIssueCode.custom,
|
|
598
|
+
path: ["payload"],
|
|
599
|
+
message: error instanceof Error ? error.message : "payload contains a value with no JSON representation"
|
|
600
|
+
});
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
if (canonical.length > PAYLOAD_MAX_CANONICAL_LENGTH) {
|
|
604
|
+
ctx.addIssue({
|
|
605
|
+
code: z3.ZodIssueCode.custom,
|
|
606
|
+
path: ["payload"],
|
|
607
|
+
message: `payload must stay within ${PAYLOAD_MAX_CANONICAL_LENGTH} characters of canonical JSON`
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
})
|
|
520
611
|
});
|
|
521
612
|
|
|
522
613
|
// ../node_modules/iterate-kernel/dist/recipe-config.js
|
|
@@ -625,6 +716,20 @@ var ReverificationTargetsSchema = z6.strictObject({
|
|
|
625
716
|
message: "an empty target set is not a re-verification: state which recipe steps, dimensions, or operations to re-run"
|
|
626
717
|
});
|
|
627
718
|
}
|
|
719
|
+
for (const field of ["dimensions", "operationIds"]) {
|
|
720
|
+
const list = targets[field];
|
|
721
|
+
if (list === void 0)
|
|
722
|
+
continue;
|
|
723
|
+
list.forEach((name, index) => {
|
|
724
|
+
if (list.indexOf(name) !== index) {
|
|
725
|
+
ctx.addIssue({
|
|
726
|
+
code: z6.ZodIssueCode.custom,
|
|
727
|
+
path: [field, index],
|
|
728
|
+
message: `"${name}" is listed twice in ${field}; a repeated target asks for the same work twice while the schedule reads the list as a set`
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
});
|
|
732
|
+
}
|
|
628
733
|
});
|
|
629
734
|
var ReverificationRequestSchema = z6.strictObject({
|
|
630
735
|
schemaVersion: z6.literal(REVERIFICATION_SCHEMA_VERSION),
|
|
@@ -699,8 +804,22 @@ var ProviderMethodSchema = z8.strictObject({
|
|
|
699
804
|
* What this method needs to run: capability names, not booleans per capability,
|
|
700
805
|
* so adding one does not require widening a schema on both sides. An empty list
|
|
701
806
|
* means "no prerequisites", which is a claim the provider has to make.
|
|
807
|
+
*
|
|
808
|
+
* `uniqueItems` is declared in `schemas/provider-registration.schema.json`, and
|
|
809
|
+
* a declared rule the validator does not enforce is a rule one consumer can
|
|
810
|
+
* break while every reader believes it.
|
|
702
811
|
*/
|
|
703
|
-
requires: z8.array(z8.string().regex(PROVIDER_ID_PATTERN).max(PROVIDER_ID_MAX_LENGTH)).max(16)
|
|
812
|
+
requires: z8.array(z8.string().regex(PROVIDER_ID_PATTERN).max(PROVIDER_ID_MAX_LENGTH)).max(16).superRefine((names, ctx) => {
|
|
813
|
+
names.forEach((name, index) => {
|
|
814
|
+
if (names.indexOf(name) !== index) {
|
|
815
|
+
ctx.addIssue({
|
|
816
|
+
code: z8.ZodIssueCode.custom,
|
|
817
|
+
path: [index],
|
|
818
|
+
message: `"${name}" is listed twice; a repeated prerequisite changes nothing about what the method needs, so the repetition is either a mistake or an attempt to make a list mean two things at once`
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
});
|
|
822
|
+
})
|
|
704
823
|
});
|
|
705
824
|
var ProviderRegistrationSchema = z8.strictObject({
|
|
706
825
|
schemaVersion: z8.literal(PROVIDER_SCHEMA_VERSION),
|
|
@@ -759,7 +878,7 @@ function registerProvider(registry, provider) {
|
|
|
759
878
|
return { ...registry, [parsed.id]: parsed };
|
|
760
879
|
}
|
|
761
880
|
function resolveProvider(registry, id) {
|
|
762
|
-
const provider = registry[id];
|
|
881
|
+
const provider = Object.hasOwn(registry, id) ? registry[id] : void 0;
|
|
763
882
|
if (!provider) {
|
|
764
883
|
throw new KernelProviderError(PROVIDER_CODES.unknown, id, `no provider registered under "${id}"`, `registered: ${registeredIds(registry)}`);
|
|
765
884
|
}
|
|
@@ -5063,7 +5182,7 @@ var SUPPORTED_PROTOCOL_VERSIONS = [
|
|
|
5063
5182
|
"2025-03-26",
|
|
5064
5183
|
MCP_PROTOCOL_VERSION
|
|
5065
5184
|
];
|
|
5066
|
-
var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.
|
|
5185
|
+
var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.4" };
|
|
5067
5186
|
var PARSE_ERROR = -32700;
|
|
5068
5187
|
var INVALID_REQUEST = -32600;
|
|
5069
5188
|
var METHOD_NOT_FOUND = -32601;
|
package/dist/stdio-session.js
CHANGED
|
@@ -438,16 +438,76 @@ function schemaErrorFrom(label, error) {
|
|
|
438
438
|
import { z as z3 } from "zod";
|
|
439
439
|
|
|
440
440
|
// ../node_modules/iterate-kernel/dist/canonical-json.js
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
441
|
+
var CANONICAL_JSON_CODES = {
|
|
442
|
+
value: "KERNEL_E_CANONICAL_VALUE",
|
|
443
|
+
depth: "KERNEL_E_CANONICAL_DEPTH"
|
|
444
|
+
};
|
|
445
|
+
var KernelCanonicalJsonError = class extends Error {
|
|
446
|
+
code;
|
|
447
|
+
remedy;
|
|
448
|
+
constructor(code, message, remedy) {
|
|
449
|
+
super(`${code}: ${message}`);
|
|
450
|
+
this.name = "KernelCanonicalJsonError";
|
|
451
|
+
this.code = code;
|
|
452
|
+
this.remedy = remedy;
|
|
444
453
|
}
|
|
445
|
-
|
|
446
|
-
|
|
454
|
+
};
|
|
455
|
+
var CANONICAL_JSON_MAX_DEPTH = 512;
|
|
456
|
+
var KERNEL_SAFE_INTEGER_MAX = Number.MAX_SAFE_INTEGER;
|
|
457
|
+
var KERNEL_SAFE_INTEGER_MIN = -Number.MAX_SAFE_INTEGER;
|
|
458
|
+
function canonicalJson2(value) {
|
|
459
|
+
return write(value, 0);
|
|
460
|
+
}
|
|
461
|
+
function write(value, depth) {
|
|
462
|
+
if (depth > CANONICAL_JSON_MAX_DEPTH) {
|
|
463
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.depth, `value is nested deeper than ${CANONICAL_JSON_MAX_DEPTH} levels`, "flatten what is being recorded: a digest over a structure this deep cannot be recomputed by a reader that streams the form, and no contract in this package describes nesting this deep");
|
|
464
|
+
}
|
|
465
|
+
if (value === null)
|
|
466
|
+
return "null";
|
|
467
|
+
switch (typeof value) {
|
|
468
|
+
case "string":
|
|
469
|
+
case "boolean":
|
|
470
|
+
return JSON.stringify(value);
|
|
471
|
+
case "number":
|
|
472
|
+
if (!Number.isFinite(value)) {
|
|
473
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `${String(value)} has no JSON representation, and JSON.stringify would print it as \`null\``, "record the number the measurement produced, or record the absence of one; a digest that collapses NaN, Infinity and null into the same bytes cannot tell a failed measurement from an absent one");
|
|
474
|
+
}
|
|
475
|
+
return JSON.stringify(value);
|
|
476
|
+
case "object": {
|
|
477
|
+
if (Array.isArray(value)) {
|
|
478
|
+
const items = [];
|
|
479
|
+
for (let i = 0; i < value.length; i++) {
|
|
480
|
+
if (!Object.hasOwn(value, String(i))) {
|
|
481
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `array index ${i} is a hole, which JSON has no token for`, "fill the position with null or drop it; a sparse array would serialise to a missing element between commas, which is not JSON at all");
|
|
482
|
+
}
|
|
483
|
+
items.push(write(value[i], depth + 1));
|
|
484
|
+
}
|
|
485
|
+
return "[" + items.join(",") + "]";
|
|
486
|
+
}
|
|
487
|
+
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) {
|
|
488
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `a ${value instanceof Date ? "Date" : "value whose prototype is not Object.prototype"} has no place in the canonical form; JSON.stringify would print it as a string or as an empty object`, "convert it to the fields the contract states before digesting it \u2014 a class instance's own enumerable properties are not a documented shape, so two runtimes would print two different byte sequences for it");
|
|
489
|
+
}
|
|
490
|
+
const record = value;
|
|
491
|
+
const keys = Object.keys(record).sort();
|
|
492
|
+
return "{" + keys.map((key) => JSON.stringify(key) + ":" + write(record[key], depth + 1)).join(",") + "}";
|
|
493
|
+
}
|
|
494
|
+
default:
|
|
495
|
+
throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `cannot canonicalise ${typeName(value)}: JSON.stringify would print it as the bare word \`undefined\`, which is not JSON`, "undefined, functions, symbols and bigints are not values this form can name; omit the key or put the value the producer actually has");
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
function typeName(value) {
|
|
499
|
+
switch (typeof value) {
|
|
500
|
+
case "function":
|
|
501
|
+
return "a function";
|
|
502
|
+
case "symbol":
|
|
503
|
+
return "a symbol";
|
|
504
|
+
case "bigint":
|
|
505
|
+
return "a bigint";
|
|
506
|
+
case "undefined":
|
|
507
|
+
return "an undefined value";
|
|
508
|
+
default:
|
|
509
|
+
return `a ${typeof value}`;
|
|
447
510
|
}
|
|
448
|
-
const record = value;
|
|
449
|
-
const keys = Object.keys(record).sort();
|
|
450
|
-
return "{" + keys.map((key) => JSON.stringify(key) + ":" + canonicalJson2(record[key])).join(",") + "}";
|
|
451
511
|
}
|
|
452
512
|
|
|
453
513
|
// ../node_modules/iterate-kernel/dist/dimension-context.js
|
|
@@ -499,6 +559,7 @@ var PREV_ENTRY_HASH_PATTERN = /^([0-9a-f]{64})?$/;
|
|
|
499
559
|
var SUMMARY_MAX_LENGTH = 2048;
|
|
500
560
|
var DECISION_KIND_PATTERN = /^[a-z][a-z0-9_]{0,31}$/;
|
|
501
561
|
var PAYLOAD_MAX_CANONICAL_LENGTH = 8192;
|
|
562
|
+
var PAYLOAD_RESERVED_KEYS = ["__proto__"];
|
|
502
563
|
var DecisionOutcomeSchema = z3.enum(["pass", "fail", "blocked", "inconclusive"]);
|
|
503
564
|
var DecisionLogEntrySchema = z3.strictObject({
|
|
504
565
|
entryId: z3.string().regex(DECISION_ENTRY_ID_PATTERN),
|
|
@@ -511,7 +572,37 @@ var DecisionLogEntrySchema = z3.strictObject({
|
|
|
511
572
|
kind: z3.string().regex(DECISION_KIND_PATTERN).optional(),
|
|
512
573
|
round: z3.number().int().min(0).optional(),
|
|
513
574
|
dimension: z3.string().regex(DIMENSION_ID_PATTERN).max(DIMENSION_ID_MAX_LENGTH).optional(),
|
|
514
|
-
payload: z3.record(z3.string(), z3.unknown()).optional().
|
|
575
|
+
payload: z3.record(z3.string(), z3.unknown()).optional().superRefine((value, ctx) => {
|
|
576
|
+
if (value === void 0)
|
|
577
|
+
return;
|
|
578
|
+
for (const key of Object.keys(value)) {
|
|
579
|
+
if (PAYLOAD_RESERVED_KEYS.includes(key)) {
|
|
580
|
+
ctx.addIssue({
|
|
581
|
+
code: z3.ZodIssueCode.custom,
|
|
582
|
+
path: ["payload", key],
|
|
583
|
+
message: `\`payload\` cannot carry the key "${key}": assigning it in JavaScript rewrites the object instead of storing a value, so the key would disappear from the canonical bytes this entry is hashed over`
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
let canonical;
|
|
588
|
+
try {
|
|
589
|
+
canonical = canonicalJson2(value);
|
|
590
|
+
} catch (error) {
|
|
591
|
+
ctx.addIssue({
|
|
592
|
+
code: z3.ZodIssueCode.custom,
|
|
593
|
+
path: ["payload"],
|
|
594
|
+
message: error instanceof Error ? error.message : "payload contains a value with no JSON representation"
|
|
595
|
+
});
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
if (canonical.length > PAYLOAD_MAX_CANONICAL_LENGTH) {
|
|
599
|
+
ctx.addIssue({
|
|
600
|
+
code: z3.ZodIssueCode.custom,
|
|
601
|
+
path: ["payload"],
|
|
602
|
+
message: `payload must stay within ${PAYLOAD_MAX_CANONICAL_LENGTH} characters of canonical JSON`
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
})
|
|
515
606
|
});
|
|
516
607
|
|
|
517
608
|
// ../node_modules/iterate-kernel/dist/recipe-config.js
|
|
@@ -620,6 +711,20 @@ var ReverificationTargetsSchema = z6.strictObject({
|
|
|
620
711
|
message: "an empty target set is not a re-verification: state which recipe steps, dimensions, or operations to re-run"
|
|
621
712
|
});
|
|
622
713
|
}
|
|
714
|
+
for (const field of ["dimensions", "operationIds"]) {
|
|
715
|
+
const list = targets[field];
|
|
716
|
+
if (list === void 0)
|
|
717
|
+
continue;
|
|
718
|
+
list.forEach((name, index) => {
|
|
719
|
+
if (list.indexOf(name) !== index) {
|
|
720
|
+
ctx.addIssue({
|
|
721
|
+
code: z6.ZodIssueCode.custom,
|
|
722
|
+
path: [field, index],
|
|
723
|
+
message: `"${name}" is listed twice in ${field}; a repeated target asks for the same work twice while the schedule reads the list as a set`
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
}
|
|
623
728
|
});
|
|
624
729
|
var ReverificationRequestSchema = z6.strictObject({
|
|
625
730
|
schemaVersion: z6.literal(REVERIFICATION_SCHEMA_VERSION),
|
|
@@ -694,8 +799,22 @@ var ProviderMethodSchema = z8.strictObject({
|
|
|
694
799
|
* What this method needs to run: capability names, not booleans per capability,
|
|
695
800
|
* so adding one does not require widening a schema on both sides. An empty list
|
|
696
801
|
* means "no prerequisites", which is a claim the provider has to make.
|
|
802
|
+
*
|
|
803
|
+
* `uniqueItems` is declared in `schemas/provider-registration.schema.json`, and
|
|
804
|
+
* a declared rule the validator does not enforce is a rule one consumer can
|
|
805
|
+
* break while every reader believes it.
|
|
697
806
|
*/
|
|
698
|
-
requires: z8.array(z8.string().regex(PROVIDER_ID_PATTERN).max(PROVIDER_ID_MAX_LENGTH)).max(16)
|
|
807
|
+
requires: z8.array(z8.string().regex(PROVIDER_ID_PATTERN).max(PROVIDER_ID_MAX_LENGTH)).max(16).superRefine((names, ctx) => {
|
|
808
|
+
names.forEach((name, index) => {
|
|
809
|
+
if (names.indexOf(name) !== index) {
|
|
810
|
+
ctx.addIssue({
|
|
811
|
+
code: z8.ZodIssueCode.custom,
|
|
812
|
+
path: [index],
|
|
813
|
+
message: `"${name}" is listed twice; a repeated prerequisite changes nothing about what the method needs, so the repetition is either a mistake or an attempt to make a list mean two things at once`
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
});
|
|
817
|
+
})
|
|
699
818
|
});
|
|
700
819
|
var ProviderRegistrationSchema = z8.strictObject({
|
|
701
820
|
schemaVersion: z8.literal(PROVIDER_SCHEMA_VERSION),
|
|
@@ -754,7 +873,7 @@ function registerProvider(registry, provider) {
|
|
|
754
873
|
return { ...registry, [parsed.id]: parsed };
|
|
755
874
|
}
|
|
756
875
|
function resolveProvider(registry, id) {
|
|
757
|
-
const provider = registry[id];
|
|
876
|
+
const provider = Object.hasOwn(registry, id) ? registry[id] : void 0;
|
|
758
877
|
if (!provider) {
|
|
759
878
|
throw new KernelProviderError(PROVIDER_CODES.unknown, id, `no provider registered under "${id}"`, `registered: ${registeredIds(registry)}`);
|
|
760
879
|
}
|
|
@@ -5058,7 +5177,7 @@ var SUPPORTED_PROTOCOL_VERSIONS = [
|
|
|
5058
5177
|
"2025-03-26",
|
|
5059
5178
|
MCP_PROTOCOL_VERSION
|
|
5060
5179
|
];
|
|
5061
|
-
var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.
|
|
5180
|
+
var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.4" };
|
|
5062
5181
|
var PARSE_ERROR = -32700;
|
|
5063
5182
|
var INVALID_REQUEST = -32600;
|
|
5064
5183
|
var METHOD_NOT_FOUND = -32601;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glasspane-mcp",
|
|
3
|
-
"version": "1.31.
|
|
3
|
+
"version": "1.31.4",
|
|
4
4
|
"description": "GlassPane MCP stdio shell: JSON-RPC 2.0 over stdio bridging an AI agent to the glasspane engine daemon",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"ai-agents"
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"iterate-kernel": "0.1.
|
|
61
|
+
"iterate-kernel": "0.1.13",
|
|
62
62
|
"zod": "4.6.7"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://schemas.iterate.dev/convergence-round-state-0.1.json",
|
|
4
4
|
"title": "ConvergenceRoundState",
|
|
5
|
-
"description": "What a caller states about the round that just finished, which the convergence rules turn into an action (5.7 R40 scenario 4). Every field is a verdict somebody else produced; this contract moves none of them. NOTE ON SOURCE OF TRUTH: the field constraints are duplicated from `src/convergence.ts`, which is the definition; this file mirrors it. The ordering that decides which verdict wins (breaker, then budget, then errored check, then findings, then evidence, then invariants, then converged) is arithmetic in the validator and cannot be expressed in JSON Schema — a schema-only implementation must re-implement `convergenceDecision` and be tested against the cases in `fixtures/convergence.ok-01.json`.",
|
|
5
|
+
"description": "What a caller states about the round that just finished, which the convergence rules turn into an action (5.7 R40 scenario 4). Every field is a verdict somebody else produced; this contract moves none of them. NOTE ON SOURCE OF TRUTH: the field constraints are duplicated from `src/convergence.ts`, which is the definition; this file mirrors it. The ordering that decides which verdict wins (breaker, then budget, then errored check, then findings, then evidence, then invariants, then converged) is arithmetic in the validator and cannot be expressed in JSON Schema — a schema-only implementation must re-implement `convergenceDecision` and be tested against the cases in `fixtures/convergence.ok-01.json`. INTEGERS ARE BOUNDED: every integer field carries both `minimum` and `maximum` inside ±2^53−1, which is the range every runtime prints identically — ECMAScript renders 1e21 as `1e+21` where Python prints 1000000000000000000000, so a state outside the bound would digest to different bytes in each implementation and the validators refuse it.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"required": [
|
|
@@ -18,11 +18,13 @@
|
|
|
18
18
|
},
|
|
19
19
|
"round": {
|
|
20
20
|
"type": "integer",
|
|
21
|
-
"minimum": 1
|
|
21
|
+
"minimum": 1,
|
|
22
|
+
"maximum": 9007199254740991
|
|
22
23
|
},
|
|
23
24
|
"maxRounds": {
|
|
24
25
|
"type": "integer",
|
|
25
|
-
"minimum": 1
|
|
26
|
+
"minimum": 1,
|
|
27
|
+
"maximum": 9007199254740991
|
|
26
28
|
},
|
|
27
29
|
"invariantState": {
|
|
28
30
|
"enum": [
|
|
@@ -34,7 +36,8 @@
|
|
|
34
36
|
},
|
|
35
37
|
"openFindings": {
|
|
36
38
|
"type": "integer",
|
|
37
|
-
"minimum": 0
|
|
39
|
+
"minimum": 0,
|
|
40
|
+
"maximum": 9007199254740991
|
|
38
41
|
},
|
|
39
42
|
"evidenceComplete": {
|
|
40
43
|
"type": "boolean"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://schemas.iterate.dev/decision-log-entry-0.1-draft.json",
|
|
4
4
|
"title": "DecisionLogEntry",
|
|
5
|
-
"description": "Entry-level contract of the opID-to-decision one-way hash chain (audit chain, Phase A part). Each entry links to the previous entry via SHA-256 of its canonical form; the genesis entry uses an empty prevEntryHash.",
|
|
5
|
+
"description": "Entry-level contract of the opID-to-decision one-way hash chain (audit chain, Phase A part). Each entry links to the previous entry via SHA-256 of its canonical form; the genesis entry uses an empty prevEntryHash. INTEGERS ARE BOUNDED: `sequence` and `round` carry both `minimum` and `maximum` inside ±2^53−1, because that is the range every runtime prints identically — ECMAScript renders 1e21 as `1e+21` where Python prints 1000000000000000000000 — and a line outside it would hash to different bytes in each implementation. Two rules are validator-only because JSON Schema cannot state them: a `payload` value must have a JSON representation (an `undefined`, a function, a symbol, a `NaN` or an `Infinity` would be printed as a token this form does not have), and a `payload` key must not be `__proto__` — the one key the JavaScript object model reinterprets instead of storing, so it would disappear from the canonical bytes the chain hashes (`prototype` and `constructor` are ordinary own properties and are carried like any other) — see `src/decision-log-entry.ts`.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"required": [
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"sequence": {
|
|
22
22
|
"type": "integer",
|
|
23
|
-
"minimum": 0
|
|
23
|
+
"minimum": 0,
|
|
24
|
+
"maximum": 9007199254740991
|
|
24
25
|
},
|
|
25
26
|
"prevEntryHash": {
|
|
26
27
|
"type": "string",
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
"round": {
|
|
50
51
|
"type": "integer",
|
|
51
52
|
"minimum": 0,
|
|
53
|
+
"maximum": 9007199254740991,
|
|
52
54
|
"description": "Loop position the decision belongs to, when the producer counts rounds. Optional because a one-off tool execution is not part of a round."
|
|
53
55
|
},
|
|
54
56
|
"dimension": {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://schemas.iterate.dev/evidence-pack-0.1.json",
|
|
4
4
|
"title": "EvidencePack",
|
|
5
|
-
"description": "GlassPane P0 evidence package (schema v0.1-draft). C35 dual-language contract: this JSON Schema is the single source of truth; Swift Codable and TS zod bindings must stay in sync via the shared truth fixtures.",
|
|
5
|
+
"description": "GlassPane P0 evidence package (schema v0.1-draft). C35 dual-language contract: this JSON Schema is the single source of truth; Swift Codable and TS zod bindings must stay in sync via the shared truth fixtures. INTEGERS ARE BOUNDED: every integer field carries both `minimum` and `maximum` inside ±2^53−1, which is the range every runtime prints identically (ECMAScript renders 1e21 as `1e+21` where Python prints 1000000000000000000000). NON-FINITE NUMBERS ARE REFUSED by the validators and this schema cannot say so: `NaN` and ±Infinity are `type: number` to a schema-only reader, while `JSON.stringify` prints all three as `null` — a pack that did that would be indistinguishable from one that measured nothing.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"required": [
|
|
@@ -101,7 +101,8 @@
|
|
|
101
101
|
},
|
|
102
102
|
"nodeCount": {
|
|
103
103
|
"type": "integer",
|
|
104
|
-
"minimum": 0
|
|
104
|
+
"minimum": 0,
|
|
105
|
+
"maximum": 9007199254740991
|
|
105
106
|
},
|
|
106
107
|
"axChanged": {
|
|
107
108
|
"type": "boolean"
|
|
@@ -142,7 +143,8 @@
|
|
|
142
143
|
},
|
|
143
144
|
"windowId": {
|
|
144
145
|
"type": "integer",
|
|
145
|
-
"minimum": 0
|
|
146
|
+
"minimum": 0,
|
|
147
|
+
"maximum": 9007199254740991
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
150
|
},
|
|
@@ -229,7 +231,8 @@
|
|
|
229
231
|
},
|
|
230
232
|
"hitCount": {
|
|
231
233
|
"type": "integer",
|
|
232
|
-
"minimum": 0
|
|
234
|
+
"minimum": 0,
|
|
235
|
+
"maximum": 9007199254740991
|
|
233
236
|
},
|
|
234
237
|
"handlers": {
|
|
235
238
|
"type": "array",
|
|
@@ -240,13 +243,14 @@
|
|
|
240
243
|
"required": ["file", "line"],
|
|
241
244
|
"properties": {
|
|
242
245
|
"file": { "type": "string", "minLength": 1, "maxLength": 512 },
|
|
243
|
-
"line": { "type": "integer", "minimum": 0 }
|
|
246
|
+
"line": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
|
|
244
247
|
}
|
|
245
248
|
}
|
|
246
249
|
},
|
|
247
250
|
"lateCount": {
|
|
248
251
|
"type": "integer",
|
|
249
|
-
"minimum": 0
|
|
252
|
+
"minimum": 0,
|
|
253
|
+
"maximum": 9007199254740991
|
|
250
254
|
}
|
|
251
255
|
}
|
|
252
256
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://schemas.iterate.dev/invariant-report-0.1.json",
|
|
4
4
|
"title": "InvariantReport",
|
|
5
|
-
"description": "What the invariant runner observed when it checked a recipe's invariants (5.7 R40 scenario 1: the failure that has to reach the other harness). Whoever runs the checks produces this; whoever decides whether to re-verify reads it. A check kind of `refused` means the runner declined to execute a configured command because it carries shell metacharacters or is empty — it is a violation, so a report whose only failing check was refused is `fail`, never `error`. NOTE ON SOURCE OF TRUTH: the check-name and detail constraints are duplicated from `src/invariant-report.ts`, which is the definition; this file mirrors it. The outcome-vs-checks rule IS expressible here and is expressed twice on purpose: the `allOf` branches below and the zod `superRefine` must refuse the same reports, so a second implementation that only validates JSON Schema still cannot carry a pass over a failed check.",
|
|
5
|
+
"description": "What the invariant runner observed when it checked a recipe's invariants (5.7 R40 scenario 1: the failure that has to reach the other harness). Whoever runs the checks produces this; whoever decides whether to re-verify reads it. A check kind of `refused` means the runner declined to execute a configured command because it carries shell metacharacters or is empty — it is a violation, so a report whose only failing check was refused is `fail`, never `error`. NOTE ON SOURCE OF TRUTH: the check-name and detail constraints are duplicated from `src/invariant-report.ts`, which is the definition; this file mirrors it. The outcome-vs-checks rule IS expressible here and is expressed twice on purpose: the `allOf` branches below and the zod `superRefine` must refuse the same reports, so a second implementation that only validates JSON Schema still cannot carry a pass over a failed check. INTEGERS ARE BOUNDED: `round` and `durationMs` carry both `minimum` and `maximum` inside ±2^53−1, the range every runtime prints identically, because a report outside it would digest to different bytes in each implementation.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"required": ["schemaVersion", "outcome", "checks"],
|
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
},
|
|
24
24
|
"round": {
|
|
25
25
|
"type": "integer",
|
|
26
|
-
"minimum": 1
|
|
26
|
+
"minimum": 1,
|
|
27
|
+
"maximum": 9007199254740991
|
|
27
28
|
},
|
|
28
29
|
"durationMs": {
|
|
29
30
|
"type": "integer",
|
|
30
|
-
"minimum": 0
|
|
31
|
+
"minimum": 0,
|
|
32
|
+
"maximum": 9007199254740991
|
|
31
33
|
}
|
|
32
34
|
},
|
|
33
35
|
"allOf": [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://schemas.iterate.dev/provider-registration-0.1.json",
|
|
4
4
|
"title": "ProviderRegistration",
|
|
5
|
-
"description": "Metadata for one judgement producer, so both harnesses can consume the same provider through the same shape (5.7 R40 scenario 5). It declares who provides what and what they need; it never carries a judgement, which stays in the engine and the reviewers. NOTE ON SOURCE OF TRUTH: the field constraints are duplicated from `src/provider-registration.ts`, which is the definition; this file mirrors it. METHOD-LEVEL UNIQUENESS IS ENFORCED BY ZOD ONLY: `uniqueItems` compares whole objects, so two methods with the same name but different `requires` pass this schema and are refused by `ProviderRegistrationSchema`. The registry semantics (refusing to overwrite an id, no default provider, no fuzzy resolve) are functions in the validator, not schema features.",
|
|
5
|
+
"description": "Metadata for one judgement producer, so both harnesses can consume the same provider through the same shape (5.7 R40 scenario 5). It declares who provides what and what they need; it never carries a judgement, which stays in the engine and the reviewers. NOTE ON SOURCE OF TRUTH: the field constraints are duplicated from `src/provider-registration.ts`, which is the definition; this file mirrors it. METHOD-LEVEL UNIQUENESS IS ENFORCED BY ZOD ONLY: `uniqueItems` compares whole objects, so two methods with the same name but different `requires` pass this schema and are refused by `ProviderRegistrationSchema`. The registry semantics (refusing to overwrite an id, no default provider, no fuzzy resolve) are functions in the validator, not schema features. The `uniqueItems` declared on a method's `requires` IS enforced by the validator too, so the two sides refuse the same duplicate list.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"required": ["schemaVersion", "id", "kind", "version", "methods"],
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://schemas.iterate.dev/reverification-request-0.1.json",
|
|
4
4
|
"title": "ReverificationRequest",
|
|
5
|
-
"description": "The ask that comes out of a failed invariant report (5.7 R40 scenario 1): re-run these recipe steps, dimensions, or operations. It cites the failure by digest rather than embedding it, so the ledger line that records the re-verification can be checked against the ledger line that records the failure. NOTE ON SOURCE OF TRUTH: the field constraints are duplicated from `src/invariant-report.ts`, which is the definition; this file mirrors it. The 'an empty target set is not a re-verification' rule IS expressible here and is expressed twice on purpose, via `anyOf`, so a schema-only implementation refuses it too.",
|
|
5
|
+
"description": "The ask that comes out of a failed invariant report (5.7 R40 scenario 1): re-run these recipe steps, dimensions, or operations. It cites the failure by digest rather than embedding it, so the ledger line that records the re-verification can be checked against the ledger line that records the failure. NOTE ON SOURCE OF TRUTH: the field constraints are duplicated from `src/invariant-report.ts`, which is the definition; this file mirrors it. The 'an empty target set is not a re-verification' rule IS expressible here and is expressed twice on purpose, via `anyOf`, so a schema-only implementation refuses it too. The `uniqueItems` on `targets.dimensions` and `targets.operationIds` is likewise enforced by the validator, so a target listed twice is refused on both sides rather than scheduled twice by one of them.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"required": ["schemaVersion", "trigger", "targets"],
|