aontu 0.52.1 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -0
- package/bin/aontu-mcp.js +4 -0
- package/dist/agentsmd.d.ts +16 -0
- package/dist/agentsmd.js +107 -0
- package/dist/agentsmd.js.map +1 -0
- package/dist/aontu.d.ts +14 -3
- package/dist/aontu.js +96 -4
- package/dist/aontu.js.map +1 -1
- package/dist/cli.d.ts +44 -1
- package/dist/cli.js +2401 -44
- package/dist/cli.js.map +1 -1
- package/dist/ctx.d.ts +13 -0
- package/dist/ctx.js +43 -0
- package/dist/ctx.js.map +1 -1
- package/dist/diff.d.ts +22 -0
- package/dist/diff.js +141 -0
- package/dist/diff.js.map +1 -0
- package/dist/err.d.ts +3 -1
- package/dist/err.js +38 -7
- package/dist/err.js.map +1 -1
- package/dist/graph.d.ts +16 -0
- package/dist/graph.js +73 -0
- package/dist/graph.js.map +1 -0
- package/dist/hcanon.d.ts +3 -0
- package/dist/hcanon.js +146 -0
- package/dist/hcanon.js.map +1 -0
- package/dist/hints.js +167 -4
- package/dist/hints.js.map +1 -1
- package/dist/jsonschema.d.ts +20 -0
- package/dist/jsonschema.js +391 -0
- package/dist/jsonschema.js.map +1 -0
- package/dist/lang.js +512 -69
- package/dist/lang.js.map +1 -1
- package/dist/lsp.d.ts +9 -2
- package/dist/lsp.js +262 -47
- package/dist/lsp.js.map +1 -1
- package/dist/mcp-server.d.ts +20 -0
- package/dist/mcp-server.js +147 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/mcp.d.ts +42 -0
- package/dist/mcp.js +814 -0
- package/dist/mcp.js.map +1 -0
- package/dist/mod-tool.d.ts +58 -0
- package/dist/mod-tool.js +498 -0
- package/dist/mod-tool.js.map +1 -0
- package/dist/mod.d.ts +31 -0
- package/dist/mod.js +250 -0
- package/dist/mod.js.map +1 -0
- package/dist/patch.d.ts +44 -0
- package/dist/patch.js +506 -0
- package/dist/patch.js.map +1 -0
- package/dist/provenance.d.ts +40 -0
- package/dist/provenance.js +335 -0
- package/dist/provenance.js.map +1 -0
- package/dist/query.d.ts +27 -0
- package/dist/query.js +294 -0
- package/dist/query.js.map +1 -0
- package/dist/reach.d.ts +14 -0
- package/dist/reach.js +140 -0
- package/dist/reach.js.map +1 -0
- package/dist/relation.d.ts +19 -0
- package/dist/relation.js +305 -0
- package/dist/relation.js.map +1 -0
- package/dist/report-sarif.d.ts +14 -0
- package/dist/report-sarif.js +102 -0
- package/dist/report-sarif.js.map +1 -0
- package/dist/site.d.ts +4 -0
- package/dist/site.js +31 -0
- package/dist/site.js.map +1 -1
- package/dist/std.d.ts +1 -0
- package/dist/std.js +73 -0
- package/dist/std.js.map +1 -0
- package/dist/subsume.d.ts +39 -0
- package/dist/subsume.js +526 -0
- package/dist/subsume.js.map +1 -0
- package/dist/trim.d.ts +19 -0
- package/dist/trim.js +155 -0
- package/dist/trim.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/type.d.ts +17 -1
- package/dist/type.js.map +1 -1
- package/dist/unify.d.ts +2 -1
- package/dist/unify.js +253 -36
- package/dist/unify.js.map +1 -1
- package/dist/utility.d.ts +9 -1
- package/dist/utility.js +122 -1
- package/dist/utility.js.map +1 -1
- package/dist/val/AggFuncVal.d.ts +33 -0
- package/dist/val/AggFuncVal.js +202 -0
- package/dist/val/AggFuncVal.js.map +1 -0
- package/dist/val/ArithFuncVal.d.ts +31 -0
- package/dist/val/ArithFuncVal.js +62 -0
- package/dist/val/ArithFuncVal.js.map +1 -0
- package/dist/val/BagVal.d.ts +5 -0
- package/dist/val/BagVal.js +96 -5
- package/dist/val/BagVal.js.map +1 -1
- package/dist/val/CloseFuncVal.js +9 -1
- package/dist/val/CloseFuncVal.js.map +1 -1
- package/dist/val/ConjunctVal.d.ts +1 -1
- package/dist/val/ConjunctVal.js +19 -0
- package/dist/val/ConjunctVal.js.map +1 -1
- package/dist/val/ConstraintVal.d.ts +7 -1
- package/dist/val/ConstraintVal.js +490 -40
- package/dist/val/ConstraintVal.js.map +1 -1
- package/dist/val/CopyFuncVal.d.ts +1 -2
- package/dist/val/CopyFuncVal.js +7 -0
- package/dist/val/CopyFuncVal.js.map +1 -1
- package/dist/val/Decimal.d.ts +1 -0
- package/dist/val/Decimal.js +13 -0
- package/dist/val/Decimal.js.map +1 -1
- package/dist/val/DeprecateFuncVal.d.ts +11 -0
- package/dist/val/DeprecateFuncVal.js +47 -0
- package/dist/val/DeprecateFuncVal.js.map +1 -0
- package/dist/val/DisjunctVal.js +130 -21
- package/dist/val/DisjunctVal.js.map +1 -1
- package/dist/val/EachFuncVal.d.ts +15 -0
- package/dist/val/EachFuncVal.js +75 -0
- package/dist/val/EachFuncVal.js.map +1 -0
- package/dist/val/ExpectVal.js +27 -4
- package/dist/val/ExpectVal.js.map +1 -1
- package/dist/val/FeatureVal.js +1 -1
- package/dist/val/FeatureVal.js.map +1 -1
- package/dist/val/FilterFuncVal.d.ts +15 -0
- package/dist/val/FilterFuncVal.js +91 -0
- package/dist/val/FilterFuncVal.js.map +1 -0
- package/dist/val/FuncBaseVal.d.ts +6 -1
- package/dist/val/FuncBaseVal.js +171 -1
- package/dist/val/FuncBaseVal.js.map +1 -1
- package/dist/val/HideFuncVal.js.map +1 -1
- package/dist/val/IdFuncVal.d.ts +13 -0
- package/dist/val/IdFuncVal.js +54 -0
- package/dist/val/IdFuncVal.js.map +1 -0
- package/dist/val/JunctionVal.js +7 -1
- package/dist/val/JunctionVal.js.map +1 -1
- package/dist/val/KeyFuncVal.d.ts +1 -1
- package/dist/val/KeyFuncVal.js +38 -30
- package/dist/val/KeyFuncVal.js.map +1 -1
- package/dist/val/ListVal.js +101 -14
- package/dist/val/ListVal.js.map +1 -1
- package/dist/val/LowerFuncVal.js.map +1 -1
- package/dist/val/MapVal.js +93 -8
- package/dist/val/MapVal.js.map +1 -1
- package/dist/val/MatchFuncVal.d.ts +15 -0
- package/dist/val/MatchFuncVal.js +107 -0
- package/dist/val/MatchFuncVal.js.map +1 -0
- package/dist/val/MoveFuncVal.js.map +1 -1
- package/dist/val/NilVal.js +24 -0
- package/dist/val/NilVal.js.map +1 -1
- package/dist/val/OpBaseVal.d.ts +1 -1
- package/dist/val/OpBaseVal.js +19 -1
- package/dist/val/OpBaseVal.js.map +1 -1
- package/dist/val/OpenFuncVal.js +4 -1
- package/dist/val/OpenFuncVal.js.map +1 -1
- package/dist/val/PackFuncVal.d.ts +15 -0
- package/dist/val/PackFuncVal.js +108 -0
- package/dist/val/PackFuncVal.js.map +1 -0
- package/dist/val/PathFuncVal.js.map +1 -1
- package/dist/val/PlaceVal.d.ts +13 -0
- package/dist/val/PlaceVal.js +131 -0
- package/dist/val/PlaceVal.js.map +1 -0
- package/dist/val/PlusOpVal.js +11 -2
- package/dist/val/PlusOpVal.js.map +1 -1
- package/dist/val/PrefFuncVal.js.map +1 -1
- package/dist/val/PrefVal.d.ts +2 -2
- package/dist/val/PrefVal.js +78 -23
- package/dist/val/PrefVal.js.map +1 -1
- package/dist/val/RefVal.d.ts +1 -1
- package/dist/val/RefVal.js +89 -7
- package/dist/val/RefVal.js.map +1 -1
- package/dist/val/ReferFuncVal.d.ts +36 -0
- package/dist/val/ReferFuncVal.js +303 -0
- package/dist/val/ReferFuncVal.js.map +1 -0
- package/dist/val/ScalarKindVal.d.ts +1 -2
- package/dist/val/ScalarKindVal.js +0 -11
- package/dist/val/ScalarKindVal.js.map +1 -1
- package/dist/val/TopVal.js.map +1 -1
- package/dist/val/TypeFuncVal.js.map +1 -1
- package/dist/val/UpperFuncVal.js.map +1 -1
- package/dist/val/Val.d.ts +8 -1
- package/dist/val/Val.js +150 -1
- package/dist/val/Val.js.map +1 -1
- package/dist/val/VarVal.js.map +1 -1
- package/dist/val/arith.d.ts +6 -0
- package/dist/val/arith.js +170 -0
- package/dist/val/arith.js.map +1 -0
- package/dist/vet.d.ts +45 -0
- package/dist/vet.js +776 -0
- package/dist/vet.js.map +1 -0
- package/dist/walk.d.ts +2 -0
- package/dist/walk.js +91 -0
- package/dist/walk.js.map +1 -0
- package/grammar/aontu.gbnf +130 -0
- package/grammar/aontu.lark +113 -0
- package/package.json +21 -6
- package/skill/SKILL.md +37 -0
- package/skill/error-codes.md +62 -0
- package/skill/examples.md +99 -0
- package/skill/grammar-card.md +57 -0
- package/src/agentsmd.ts +135 -0
- package/src/aontu.ts +135 -4
- package/src/cli.ts +2858 -71
- package/src/ctx.ts +73 -1
- package/src/diff.ts +196 -0
- package/src/err.ts +42 -7
- package/src/graph.ts +135 -0
- package/src/hcanon.ts +169 -0
- package/src/hints.ts +208 -4
- package/src/jsonschema.ts +511 -0
- package/src/lang.ts +570 -70
- package/src/lsp.ts +281 -48
- package/src/mcp-server.ts +187 -0
- package/src/mcp.ts +993 -0
- package/src/mod-tool.ts +679 -0
- package/src/mod.ts +344 -0
- package/src/patch.ts +624 -0
- package/src/provenance.ts +430 -0
- package/src/query.ts +379 -0
- package/src/reach.ts +184 -0
- package/src/relation.ts +395 -0
- package/src/report-sarif.ts +137 -0
- package/src/site.ts +36 -1
- package/src/std.ts +73 -0
- package/src/subsume.ts +690 -0
- package/src/trim.ts +195 -0
- package/src/tsconfig.json +10 -4
- package/src/type.ts +51 -2
- package/src/unify.ts +274 -36
- package/src/utility.ts +139 -1
- package/src/val/AggFuncVal.ts +319 -0
- package/src/val/ArithFuncVal.ts +108 -0
- package/src/val/BagVal.ts +101 -4
- package/src/val/CloseFuncVal.ts +9 -1
- package/src/val/ConjunctVal.ts +20 -0
- package/src/val/ConstraintVal.ts +542 -43
- package/src/val/CopyFuncVal.ts +7 -1
- package/src/val/Decimal.ts +15 -0
- package/src/val/DeprecateFuncVal.ts +84 -0
- package/src/val/DisjunctVal.ts +139 -28
- package/src/val/EachFuncVal.ts +133 -0
- package/src/val/ExpectVal.ts +28 -6
- package/src/val/FeatureVal.ts +1 -1
- package/src/val/FilterFuncVal.ts +154 -0
- package/src/val/FuncBaseVal.ts +192 -1
- package/src/val/HideFuncVal.ts +0 -2
- package/src/val/IdFuncVal.ts +91 -0
- package/src/val/JunctionVal.ts +7 -1
- package/src/val/KeyFuncVal.ts +39 -35
- package/src/val/ListVal.ts +108 -15
- package/src/val/LowerFuncVal.ts +0 -1
- package/src/val/MapVal.ts +99 -8
- package/src/val/MatchFuncVal.ts +176 -0
- package/src/val/MoveFuncVal.ts +0 -2
- package/src/val/NilVal.ts +25 -0
- package/src/val/OpBaseVal.ts +20 -1
- package/src/val/OpenFuncVal.ts +4 -2
- package/src/val/PackFuncVal.ts +175 -0
- package/src/val/PathFuncVal.ts +0 -1
- package/src/val/PlaceVal.ts +193 -0
- package/src/val/PlusOpVal.ts +11 -2
- package/src/val/PrefFuncVal.ts +0 -1
- package/src/val/PrefVal.ts +79 -36
- package/src/val/RefVal.ts +91 -8
- package/src/val/ReferFuncVal.ts +387 -0
- package/src/val/ScalarKindVal.ts +0 -13
- package/src/val/TopVal.ts +0 -1
- package/src/val/TypeFuncVal.ts +0 -2
- package/src/val/UpperFuncVal.ts +0 -1
- package/src/val/Val.ts +205 -2
- package/src/val/VarVal.ts +0 -1
- package/src/val/arith.ts +316 -0
- package/src/vet.ts +992 -0
- package/src/walk.ts +99 -0
package/dist/err.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"err.js","sourceRoot":"","sources":["../src/err.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;
|
|
1
|
+
{"version":3,"file":"err.js","sourceRoot":"","sources":["../src/err.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;QAyPvD,OAAO;QACP,UAAU;QACV,OAAO;QAEP,QAAQ;QACR,WAAW;AA3Pb,2CAAqC;AAMrC,yCAAgD;AAEhD,mCAA+B;AAG/B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,aAAI,CAAA;AAGlC,qEAAqE;AACrE,sEAAsE;AACtE,uEAAuE;AACvE,uEAAuE;AACvE,cAAc;AACd,EAAE;AACF,wEAAwE;AACxE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IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;QACnC,IAAI,MAAM,EAAE,GAAG,EAAE,CAAC;YAChB,GAAG,GAAG,MAAM,CAAC,GAAG,CAAA;QAClB,CAAC;aACI,IAAI,MAAM,EAAE,CAAC;YAChB,GAAG,GAAG,mBAAmB,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1D,CAAC,IAAI,IAAI,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QAC1C,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC;AAGD,MAAM,UAAW,SAAQ,KAAK;IAG5B,YAAY,GAAW,EAAE,IAAe;QACtC,KAAK,CAAC,GAAG,CAAC,CAAA;QAHZ,UAAK,GAAG,IAAI,CAAA;QAIV,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QACjC,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAA;QAE5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC;aACjC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;aAClD,IAAI,CAAC,IAAI,CAAC,CAAA;IACf,CAAC;CAGF,CAAC,kCAAkC;QAOlC,UAAU"}
|
package/dist/graph.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Val } from './type';
|
|
2
|
+
export type EntityEntry = {
|
|
3
|
+
id: string;
|
|
4
|
+
paths: string[];
|
|
5
|
+
};
|
|
6
|
+
export type Edge = {
|
|
7
|
+
from: string;
|
|
8
|
+
key: string;
|
|
9
|
+
to: string;
|
|
10
|
+
at: string;
|
|
11
|
+
};
|
|
12
|
+
export type Graph = {
|
|
13
|
+
entities: EntityEntry[];
|
|
14
|
+
edges: Edge[];
|
|
15
|
+
};
|
|
16
|
+
export declare function graphOf(root: Val): Graph;
|
package/dist/graph.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Copyright (c) 2025 Richard Rodger, MIT License */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.graphOf = graphOf;
|
|
5
|
+
const keyorder_1 = require("./keyorder");
|
|
6
|
+
const formatPath = (path) => 0 === path.length ? '$' : '$.' + path.join('.');
|
|
7
|
+
// The nearest map key on the path below an entity: list indices are
|
|
8
|
+
// positions within a relation, not relations of their own. Digits-only
|
|
9
|
+
// segments are the indices, which is exactly how the rest of the engine
|
|
10
|
+
// spells them.
|
|
11
|
+
const relationKey = (tail) => {
|
|
12
|
+
for (let i = tail.length - 1; 0 <= i; i--) {
|
|
13
|
+
if (!/^[0-9]+$/.test(tail[i])) {
|
|
14
|
+
return tail[i];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return '';
|
|
18
|
+
};
|
|
19
|
+
// The graph of an evaluated tree. Walks POSITIONS, not values: two
|
|
20
|
+
// positions of one entity share a value object after the merge, so a
|
|
21
|
+
// walk guarded by object identity would find the entity once and miss
|
|
22
|
+
// every other place it is declared. The guard is therefore the
|
|
23
|
+
// ancestor chain — which is what a cycle actually is.
|
|
24
|
+
function graphOf(root) {
|
|
25
|
+
const byId = new Map();
|
|
26
|
+
const edges = [];
|
|
27
|
+
const visit = (node, path, entity, tail, ancestors) => {
|
|
28
|
+
if (null == node || true !== node.isVal || ancestors.has(node)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
let inside = entity;
|
|
32
|
+
let below = tail;
|
|
33
|
+
const name = node.entity;
|
|
34
|
+
if (null != name) {
|
|
35
|
+
let paths = byId.get(name);
|
|
36
|
+
if (undefined === paths) {
|
|
37
|
+
paths = [];
|
|
38
|
+
byId.set(name, paths);
|
|
39
|
+
}
|
|
40
|
+
paths.push(formatPath(path));
|
|
41
|
+
// A nested entity is not a component of the one above it: the
|
|
42
|
+
// key path restarts at the identified node.
|
|
43
|
+
inside = name;
|
|
44
|
+
below = [];
|
|
45
|
+
}
|
|
46
|
+
const link = node.link;
|
|
47
|
+
if (null != link) {
|
|
48
|
+
edges.push({
|
|
49
|
+
from: inside,
|
|
50
|
+
key: relationKey(below),
|
|
51
|
+
to: link,
|
|
52
|
+
at: formatPath(path),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if ((true === node.isMap || true === node.isList) && null != node.peg) {
|
|
56
|
+
ancestors.add(node);
|
|
57
|
+
for (const k of Object.keys(node.peg)) {
|
|
58
|
+
visit(node.peg[k], [...path, k], inside, [...below, k], ancestors);
|
|
59
|
+
}
|
|
60
|
+
ancestors.delete(node);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
visit(root, [], '', [], new Set());
|
|
64
|
+
// DETERMINISTIC by construction, not by luck: ids in code-point
|
|
65
|
+
// order, each id's paths in code-point order, edges by the position
|
|
66
|
+
// they are written at (which is unique — one link, one place).
|
|
67
|
+
const entities = [...byId.keys()]
|
|
68
|
+
.sort(keyorder_1.cmpCodePoint)
|
|
69
|
+
.map((id) => ({ id, paths: byId.get(id).sort(keyorder_1.cmpCodePoint) }));
|
|
70
|
+
edges.sort((a, b) => (0, keyorder_1.cmpCodePoint)(a.at, b.at));
|
|
71
|
+
return { entities, edges };
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAiBpD,yCAAyC;AAmCzC,MAAM,UAAU,GAAG,CAAC,IAAc,EAAU,EAAE,CAC5C,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC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,IAAI,EAAE,CAAC;SAC7C,IAAI,CAAC,uBAAY,CAAC;SAClB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAc,CAAC,IAAI,CAAC,uBAAY,CAAC,EAAE,CAAC,CAAC,CAAA;IAE9E,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAA,uBAAY,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAE9C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;AAC5B,CAAC"}
|
package/dist/hcanon.d.ts
ADDED
package/dist/hcanon.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Copyright (c) 2025 Richard Rodger, MIT License */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.hcanon = hcanon;
|
|
5
|
+
exports.canonHash = canonHash;
|
|
6
|
+
// The HASH FORM (G6 phase 0, docs/capability-review/g6-distribution.md):
|
|
7
|
+
// exactly the unify-level canon with the additions that close its
|
|
8
|
+
// semantic gaps, so that two documents with the same hash form have the
|
|
9
|
+
// same meaning:
|
|
10
|
+
//
|
|
11
|
+
// - a CLOSED map or list renders wrapped: close({...}), close([...])
|
|
12
|
+
// (canon drops closedness);
|
|
13
|
+
// - the type/hide MARKS render as their builtin wrappers: type(x),
|
|
14
|
+
// hide(x) (canon drops marks).
|
|
15
|
+
//
|
|
16
|
+
// Both additions reuse existing parseable syntax, so the hash form
|
|
17
|
+
// remains valid Aontu source and round-trips:
|
|
18
|
+
// hcanon(unify(parse(hcanon(v)))) == hcanon(v) is a spec-suite property
|
|
19
|
+
// (test/spec/hcanon.tsv). User-facing canon is UNCHANGED — hcanon is a
|
|
20
|
+
// separate rendering.
|
|
21
|
+
//
|
|
22
|
+
// The marks PROPAGATE to every descendant at unification (walkMark), so
|
|
23
|
+
// a wrapper is emitted only where a mark STARTS: the walk carries the
|
|
24
|
+
// inherited marks down and a child whose mark the parent already
|
|
25
|
+
// carries renders bare. Without that, hide({a:1}) would render every
|
|
26
|
+
// leaf re-wrapped — still correct, never minimal, and not what the
|
|
27
|
+
// source said.
|
|
28
|
+
//
|
|
29
|
+
// canonHash (G6 phase 1) is the pin built on it:
|
|
30
|
+
// "aon1-" + base64url( SHA-256( UTF-8( hcanon(v) ) ) )
|
|
31
|
+
// (unpadded base64url, RFC 4648 section 5). The "aon1-" scheme id
|
|
32
|
+
// exists so a future semantically-stronger normal form is an upgrade,
|
|
33
|
+
// not a breakage. This is a CANONICAL-TEXT hash, not a semantic
|
|
34
|
+
// equivalence class: the failure direction is the safe one — a false
|
|
35
|
+
// "changed" forces a needless re-review; a false "unchanged" would need
|
|
36
|
+
// two hash forms with the same bytes and different meanings, which is
|
|
37
|
+
// exactly the gap the close/mark wrappers exist to shut.
|
|
38
|
+
const node_crypto_1 = require("node:crypto");
|
|
39
|
+
const keyorder_1 = require("./keyorder");
|
|
40
|
+
// One node's rendering, carrying the marks the ANCESTORS already
|
|
41
|
+
// wrapped. Bags and junctions recurse structurally (their canon getters
|
|
42
|
+
// render children through plain canon, which would drop a nested
|
|
43
|
+
// close); everything else — scalars, kinds, funcs, refs, constraints —
|
|
44
|
+
// delegates to its own canon, whose text is already in cross-port
|
|
45
|
+
// parity. The non-Val arm mirrors MapVal.canon's raw-peg fallback and
|
|
46
|
+
// is unreachable through an evaluated tree (direct-tested, ADR-002).
|
|
47
|
+
function render(v, inh) {
|
|
48
|
+
if (true !== v?.isVal) {
|
|
49
|
+
return String(v);
|
|
50
|
+
}
|
|
51
|
+
const mtype = true === v.mark?.type;
|
|
52
|
+
const mhide = true === v.mark?.hide;
|
|
53
|
+
const inner = {
|
|
54
|
+
type: inh.type || mtype,
|
|
55
|
+
hide: inh.hide || mhide,
|
|
56
|
+
};
|
|
57
|
+
let s;
|
|
58
|
+
if (true === v.isMap) {
|
|
59
|
+
const keys = Object.keys(v.peg).sort(keyorder_1.cmpCodePoint);
|
|
60
|
+
s = '{' +
|
|
61
|
+
(v.spread.cj ? '&:' + render(v.spread.cj, inner) +
|
|
62
|
+
(0 < keys.length ? ',' : '') : '') +
|
|
63
|
+
keys.map((k) => JSON.stringify(k) +
|
|
64
|
+
(v.optionalKeys.includes(k) ? '?' : '') +
|
|
65
|
+
':' +
|
|
66
|
+
render(v.peg[k], inner)).join(',') +
|
|
67
|
+
'}';
|
|
68
|
+
if (true === v.closed) {
|
|
69
|
+
s = 'close(' + s + ')';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else if (true === v.isList) {
|
|
73
|
+
const keys = Object.keys(v.peg);
|
|
74
|
+
s = '[' +
|
|
75
|
+
(v.spread.cj ? '&:' + render(v.spread.cj, inner) +
|
|
76
|
+
(0 < keys.length ? ',' : '') : '') +
|
|
77
|
+
keys.map((k) => render(v.peg[k], inner)).join(',') +
|
|
78
|
+
']';
|
|
79
|
+
if (true === v.closed) {
|
|
80
|
+
s = 'close(' + s + ')';
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (true === v.isPref) {
|
|
84
|
+
s = '*' + render(v.peg, inner);
|
|
85
|
+
}
|
|
86
|
+
else if (true === v.isConjunct || true === v.isDisjunct) {
|
|
87
|
+
s = junctionText(v, true === v.isConjunct ? '&' : '|', inner);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
s = v.canon;
|
|
91
|
+
}
|
|
92
|
+
// The IDENTITY is innermost, exactly as canon writes it (G4 phase
|
|
93
|
+
// 1). It is IN the hash — a node declared `id(svc/auth)` and the
|
|
94
|
+
// same node declared `id(svc/billing)` describe different systems,
|
|
95
|
+
// and a pin that could not tell them apart would be a pin on the
|
|
96
|
+
// shape rather than on the meaning.
|
|
97
|
+
const e = v.entity;
|
|
98
|
+
if (null != e) {
|
|
99
|
+
s = 'id(' + JSON.stringify(e) + ')&' + s;
|
|
100
|
+
}
|
|
101
|
+
if (mtype && !inh.type) {
|
|
102
|
+
s = 'type(' + s + ')';
|
|
103
|
+
}
|
|
104
|
+
if (mhide && !inh.hide) {
|
|
105
|
+
s = 'hide(' + s + ')';
|
|
106
|
+
}
|
|
107
|
+
// The deprecation record rides outermost, as canonRiders
|
|
108
|
+
// renders it (the wrappers are all reparseable calls, so order only
|
|
109
|
+
// has to be FIXED, and this matches the canon the G3 rows pinned).
|
|
110
|
+
const d = v.deprecation;
|
|
111
|
+
if (null != d) {
|
|
112
|
+
const dkeys = Object.keys(d).sort();
|
|
113
|
+
const rec = dkeys.map((k) => JSON.stringify(k) + ':' + JSON.stringify(d[k])).join(',');
|
|
114
|
+
s = 'deprecate(' + s + ('' === rec ? '' : ',{' + rec + '}') + ')';
|
|
115
|
+
}
|
|
116
|
+
return s;
|
|
117
|
+
}
|
|
118
|
+
// The JunctionVal.canon parenthesisation rule, kept: a member that is
|
|
119
|
+
// itself a junction with more than one term keeps its parens so the
|
|
120
|
+
// text reparses with the same structure (`(1|2)&3`, not the
|
|
121
|
+
// differently-parsing `1|2&3`). Post-unification junctions are
|
|
122
|
+
// flattened by norm, so no SOURCE reaches the wrapping arm -- it is
|
|
123
|
+
// pinned by direct tests over constructed Vals in both ports, because
|
|
124
|
+
// a hash form that could render ambiguously would be a pin that
|
|
125
|
+
// silently agrees with a document it should not.
|
|
126
|
+
function junctionText(v, sym, inner) {
|
|
127
|
+
return v.peg.map((m) => true === m?.isJunction && 1 < m.peg.length
|
|
128
|
+
? '(' + render(m, inner) + ')'
|
|
129
|
+
: render(m, inner))
|
|
130
|
+
.join(sym);
|
|
131
|
+
}
|
|
132
|
+
// The hash form of an EVALUATED Val (unify first; parse-level canon
|
|
133
|
+
// parenthesisation differs between the ports and is excluded by
|
|
134
|
+
// construction — AGENTS.md).
|
|
135
|
+
function hcanon(v) {
|
|
136
|
+
return render(v, { type: false, hide: false });
|
|
137
|
+
}
|
|
138
|
+
// The canon-hash pin. Scoped to the module evaluated STANDALONE: its
|
|
139
|
+
// own include closure resolved and unified at its own root, before any
|
|
140
|
+
// consumer context — which is what makes the pin transitive (an edit
|
|
141
|
+
// two includes deep changes the unified root, hence the hash).
|
|
142
|
+
function canonHash(v) {
|
|
143
|
+
return 'aon1-' +
|
|
144
|
+
(0, node_crypto_1.createHash)('sha256').update(hcanon(v), 'utf8').digest('base64url');
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=hcanon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hcanon.js","sourceRoot":"","sources":["../src/hcanon.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;;AAEpD,yEAAyE;AACzE,kEAAkE;AAClE,wEAAwE;AACxE,gBAAgB;AAChB,EAAE;AACF,uEAAuE;AACvE,gCAAgC;AAChC,qEAAqE;AACrE,mCAAmC;AACnC,EAAE;AACF,mEAAmE;AACnE,8CAA8C;AAC9C,wEAAwE;AACxE,uEAAuE;AACvE,sBAAsB;AACtB,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,iEAAiE;AACjE,qEAAqE;AACrE,mEAAmE;AACnE,eAAe;AACf,EAAE;AACF,iDAAiD;AACjD,yDAAyD;AACzD,kEAAkE;AAClE,sEAAsE;AACtE,gEAAgE;AAChE,qEAAqE;AACrE,wEAAwE;AACxE,sEAAsE;AACtE,yDAAyD;AAEzD,6CAAwC;AAIxC,yCAAyC;AASzC,iEAAiE;AACjE,wEAAwE;AACxE,iEAAiE;AACjE,uEAAuE;AACvE,kEAAkE;AAClE,sEAAsE;AACtE,qEAAqE;AACrE,SAAS,MAAM,CAAC,CAAM,EAAE,GAAW;IACjC,IAAI,IAAI,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;QACtB,OAAO,MAAM,CAAC,CAAC,CAAC,CAAA;IAClB,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,C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;IACtD,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAC1B,IAAI,KAAK,CAAC,EAAE,UAAU,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM;QACxC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG;QAC9B,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;SACpB,IAAI,CAAC,GAAG,CAAC,CAAA;AACd,CAAC;AAGD,oEAAoE;AACpE,gEAAgE;AAChE,6BAA6B;AAC7B,gBAAuB,CAAM;IAC3B,OAAO,MAAM,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;AAChD,CAAC;AAGD,qEAAqE;AACrE,uEAAuE;AACvE,qEAAqE;AACrE,+DAA+D;AAC/D,mBAA0B,CAAM;IAC9B,OAAO,OAAO;QACZ,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;AACtE,CAAC"}
|
package/dist/hints.js
CHANGED
|
@@ -26,6 +26,10 @@ const hints = {
|
|
|
26
26
|
'generated because nil is not a literal value.',
|
|
27
27
|
no_gen: 'This value was present after unification, and cannot be generated\n' +
|
|
28
28
|
'because it is not a literal value.',
|
|
29
|
+
disjunct_no_gen: 'More than one alternative of this disjunction is still admitted, so\n' +
|
|
30
|
+
'there is no single value to generate. Supply a value that selects\n' +
|
|
31
|
+
'one alternative, or write a preference (*) to say which one holds\n' +
|
|
32
|
+
'when nothing else does.',
|
|
29
33
|
// TODO: extend errors to have details so we can name the key
|
|
30
34
|
mapval_required: 'This map value is required.',
|
|
31
35
|
mapval_no_gen: 'This value was present after unification, and cannot be generated\n' +
|
|
@@ -110,8 +114,24 @@ const hints = {
|
|
|
110
114
|
// Parsing errors
|
|
111
115
|
'parse_bad_src': 'Invalid source provided for parsing. The source must be a non-empty string.',
|
|
112
116
|
merge_conflict: 'A version-control conflict marker was found in the source. The\nfile still holds an unresolved merge: resolve it and remove the\n`<<<<<<<`, `=======` and `>>>>>>>` lines before unifying.\n \nExamples:\n <<<<<<< HEAD -> nil # A conflict marker, not a `<` operation;\n ======= -> nil # ... nor a chain of `=` characters;\n >>>>>>> other -> nil # ... nor a `>` operation.',
|
|
117
|
+
include_denied: 'An @"..." include was refused by the active trust profile\n(docs/trust.md). The document asked to read a source the evaluation\'s\ninclude capability does not allow: widen the capability if the read is\nintended, or remove the include if it is not.\n \nExamples:\n a:@"in-root.aon" -> {..} # Inside the confinement root: allowed;\n a:@"../secret.aon" -> nil # ... but escaping the root is denied;\n a:@"/etc/hostname" -> nil # ... and so is an absolute path outside it.',
|
|
113
118
|
func_arity: 'This function was called with the wrong number of arguments:\n{func} takes {want}, but was given {got}.\n \nExamples:\n upper(\"a\") -> \"A\" # One argument, which is what upper takes;\n upper(\"a\",\"b\") -> nil # ... so two is a mistake in the source;\n key() -> \"\" # key takes none, or one level count;\n neq(1,2,3) -> neq # ... and neq takes one or more exclusions.',
|
|
114
119
|
elided_value: 'A key or element was written with no value after the colon. An\nelided value is a mistake in the source rather than a null: write\n`null` if that is what was meant, or supply the value.\n \nExamples:\n a:null -> null # An explicit null, which is a value;\n a: -> nil # ... but nothing at all is not;\n a: b:1 -> {..} # A colon chain is not an elision;\n [1,] -> [1] # ... nor is a trailing comma.',
|
|
120
|
+
id_name: 'The argument to id() is not an entity name. A name is one or\nmore letters, digits, `_`, `-` or `/`, and NO dots: a dot separates\nan entity name from a path inside that entity, so a dotted name\nwould be ambiguous. A `-` must be quoted, because it is not a\nbare-text character.\n \nExamples:\n id(svc/auth) -> id # Letters, digits and `/` may be bare;\n id("team-pay") -> id # ... a `-` name must be quoted;\n id(svc.auth) -> nil # ... a dot is a path separator, not a name;\n id(1) -> nil # ... and a number is not a name at all.',
|
|
121
|
+
id_conflict: 'One value was declared to be two different entities. An id() says\nwhat a value IS, so two names on one node is a contradiction, not a\nmerge — the same kind of failure as unifying 1 with 2. Give the node\none name, or give the two names to two nodes.\n \nExamples:\n id(a) & id(a) & {} -> {..} # One entity, said twice;\n id(a) & {x:1} -> {..} # ... an entity with content;\n id(a) & id(b) & {} -> nil # ... but a node cannot be both.',
|
|
122
|
+
id_spread: 'A spread template stamps one id() onto every child. `&: id(x) & …`\nsays that EVERY child of the bag is the entity `x`, and identity\nmerging would then unify all of them into one. Use a\npath-dependent name — `id(key())` — to give each child its own,\nor move the id() to the one child that has it.\n \nExamples:\n {&: id(key()), a:{}, b:{}} -> {..} # A name per child;\n {a: id(x) & {}} -> {..} # ... or one named child;\n {&: id(x), a:{}, b:{}} -> nil # ... but not one name for all.',
|
|
123
|
+
refer_address: 'A refer() was given something that is not an entity address. An\naddress is an entity name, optionally followed by a dot-separated path\ninside that entity — and only a STRING can be one.\n \nExamples:\n refer() & "svc/auth" -> "svc/auth" # An entity;\n refer() & "svc/auth.port" -> ... # ... and a node inside it;\n refer() & "svc/auth." -> nil # ... but not a trailing dot;\n refer() & 1 -> nil # ... and not a number.',
|
|
124
|
+
refer_unresolved: 'A refer() address names no entity in this evaluation. Within one\nevaluation the document-set is fixed, so a link to nothing is an\nerror rather than something to resolve later: check the spelling, or\nadd the id() that was meant to declare it.\n \nExamples:\n a:id(svc/x)&{} b:refer()&"svc/x" -> "svc/x" # Declared, so it resolves;\n a:id(svc/x)&{p:1} b:refer()&"svc/x.p" -> "svc/x.p" # ... and so does a node inside it;\n b:refer()&"svc/nope" -> nil # ... but nothing declares this.',
|
|
125
|
+
pack_data: 'The first argument to pack() is not a bag. `pack` makes one child\nper child of its DATA, so the data has to have children: a list of\nnames, or a map whose keys are the names.\n \nExamples:\n pack([a,b], {x:1}) -> {..} # A list of names;\n pack({a:1,b:2}, {x:1}) -> {..} # ... or a map, keyed by its keys;\n pack(1, {x:1}) -> nil # ... but a scalar has no children.',
|
|
126
|
+
pack_key: 'A list packed by pack() holds something that is not a string. The\nelements of a packed list ARE the generated keys, and only a string\nis a key — an element keyed by its position would churn every\ngenerated child the moment the list was reordered.\n \nExamples:\n pack([a,b], {x:1}) -> {..} # Names;\n pack(["a b"], {x:1}) -> {..} # ... a quoted name is still a name;\n pack([1,2], {x:1}) -> nil # ... but a number is not one.',
|
|
127
|
+
each_data: 'The first argument to each() is not a bag. `each` makes one list\nelement per child of its DATA, so the data has to have children: a\nlist, or a map whose values become the elements in sorted-key order.\n \nExamples:\n each([1,2]) -> [..] # A list, in source order;\n each({b:2,a:1}) -> [..] # ... a map, in sorted-key order;\n each(1) -> nil # ... but a scalar has no children.',
|
|
128
|
+
filter_data: 'The first argument to filter() is not a bag. `filter` keeps the\nchildren of its DATA that already satisfy a condition, so the data\nhas to have children: a list, or a map.\n \nExamples:\n filter([1,x], integer) -> [..] # A list;\n filter({a:1,b:x}, integer) -> {..} # ... or a map, keys kept;\n filter(1, integer) -> nil # ... but a scalar has none.',
|
|
129
|
+
match_none: 'No pattern matched, and there is no default. `match` tries each\npattern in the order written and takes the first the value unifies\nwith; the value {value} unified with none of {tried}. Add a trailing\ndefault — the argument after the last pair — if the rest was meant\nto be allowed.\n \nExamples:\n match(1, integer, ok) -> "ok" # The first pattern matches;\n match(x, integer, ok, other) -> "other" # ... or the default does;\n match(x, integer, ok) -> nil # ... but nothing here does.',
|
|
130
|
+
place_pair: 'Two placeholders met, and neither has a value to fill the other.\n`_` is a HOLE: it is filled by whatever the call is unified with, so\na call holding one needs a peer that does not. Give one side a\nvalue.\n \nExamples:\n upper(_) & hello -> "HELLO" # The peer fills the hole;\n _ + 2 & 1 -> 3 # ... whatever the call is;\n upper(_) & lower(_) -> nil # ... but two holes fill nothing.',
|
|
131
|
+
pipe_target: 'The right-hand side of a `|>` is not a function. A pipe puts the\nvalue on its left in as the FIRST argument of the call on its\nright, so the right side has to be one: a call, or the bare name of\na built-in.\n \nExamples:\n hello |> upper -> "HELLO" # A bare name is the call;\n $.names |> pack({}) -> {..} # ... or a call with more arguments;\n 1 |> 2 -> nil # ... but a value is not a function.',
|
|
132
|
+
module_missing: 'A module import names a module that is not in this project. A\nmodule is resolved from LOCAL stores only -- `aon_vendor/` beside the\nproject\'s mod.aon, then the user cache -- because evaluation never\ntouches the network. Fetching is a separate step, and the message\nnames it.\n \nExamples:\n @"corp.example/s@1" -> nil # Not fetched: run aontu mod get;\n @"./local.aon" -> {..} # ... a local path is not a module;\n @"corp.example/s@1#aon1-…" -> {..} # ... and a pin does not fetch it either.',
|
|
133
|
+
module_integrity: 'A module resolved locally does not have the MEANING it was pinned\nto. The pin is a canon-hash -- the hash of the module unified\nstandalone -- so it survives comments, formatting and refactoring and\nbreaks on any semantic change in the module\'s transitive closure.\nVerification is always local: the registry\'s annotation is advisory.\n \nExamples:\n @"corp.example/s@1" -> {..} # No pin, no check;\n @"corp.example/s@1#aon1-x" -> nil # ... a pin that disagrees refuses;\n aontu hash <file> # ... and this is what it should be.',
|
|
134
|
+
module_depth: 'Module verification nested too deep. A pinned module is checked by\nEVALUATING it, and that evaluation resolves the module\'s own imports\n-- so a vendor tree that leads back to itself would recurse until the\nhost ran out of stack. The bound makes that a stated refusal rather\nthan a crash whose verdict depends on the machine.\n \nExamples:\n @"corp.example/s@1" -> {..} # Ordinary nesting is far below it;\n aontu mod vendor # ... rebuild a vendor tree that loops;\n aontu hash <file> # ... and check what it hashes to.',
|
|
115
135
|
// Unification errors
|
|
116
136
|
'unify_no_src': 'No source provided for unification. Cannot unify without source values.',
|
|
117
137
|
'unify_no_res': 'Unification produced no result. The values could not be unified.',
|
|
@@ -152,11 +172,72 @@ const hints = {
|
|
|
152
172
|
' 1 + 2.0 -> 3.0 # ... and float still mixes with integer;\n' +
|
|
153
173
|
' 1.0 + 0d2 -> nil # float with biginteger;\n' +
|
|
154
174
|
' 0d0.5 + 1.0 -> nil # ... and the same the other way round.',
|
|
175
|
+
pick_key: 'A child of this bag has no key `{key}` to pick. Projection\n' +
|
|
176
|
+
'refuses rather than skipping: a shorter list would make the\n' +
|
|
177
|
+
'aggregate over it total a DIFFERENT set of records than the one\n' +
|
|
178
|
+
'the author named, which is the failure an aggregate exists to\n' +
|
|
179
|
+
'prevent. Give every child the key, or filter the bag first.' +
|
|
180
|
+
'\n \nExamples:\n' +
|
|
181
|
+
' pick([{a:1},{a:2}], a) -> [1,2] # Every child has it;\n' +
|
|
182
|
+
' pick([{a:1},{b:2}], a) -> nil # ... the second does not;\n' +
|
|
183
|
+
' pick([[9],[8]], 0) -> [9,8] # A list child takes an index.',
|
|
184
|
+
aggregate_data: 'This aggregate needs a BAG to fold: a list or a map. `sum`,\n' +
|
|
185
|
+
'`least` and `greatest` walk the children of the value they are\n' +
|
|
186
|
+
'given, so a scalar, a kind or an unresolved reference is not\n' +
|
|
187
|
+
'something they can total.' +
|
|
188
|
+
'\n \nExamples:\n' +
|
|
189
|
+
' sum([1,2,3]) -> 6 # A list;\n' +
|
|
190
|
+
' sum({a:1,b:2}) -> 3 # ... or a map, by sorted key;\n' +
|
|
191
|
+
' sum(3) -> nil # A scalar is not a bag;\n' +
|
|
192
|
+
' x:[1,2] sum($.x) -> 3 # A reference to one is fine.',
|
|
193
|
+
aggregate_empty: 'There is no least or greatest element of an EMPTY bag. Addition\n' +
|
|
194
|
+
'has an identity, so `sum([])` is 0; comparison has none, and\n' +
|
|
195
|
+
'answering with a zero or an infinity would be inventing a value\n' +
|
|
196
|
+
'the data does not contain. Guard the bag, or give it a floor with\n' +
|
|
197
|
+
'a written element.' +
|
|
198
|
+
'\n \nExamples:\n' +
|
|
199
|
+
' sum([]) -> 0 # Zero IS the empty sum;\n' +
|
|
200
|
+
' least([]) -> nil # ... but nothing is the least of none;\n' +
|
|
201
|
+
' least([0]) -> 0 # A written floor answers.',
|
|
202
|
+
divide_by_zero: 'Division by zero. `div`, `mod` and `rem` refuse a zero divisor in\n' +
|
|
203
|
+
'every numeric leaf, including binary floats: Aontu is a JSON\n' +
|
|
204
|
+
'superset with no notation for an infinity, so there is no value\n' +
|
|
205
|
+
'the operation could answer with. A definition that divides by zero\n' +
|
|
206
|
+
'is wrong, and this says so where it is written rather than\n' +
|
|
207
|
+
'somewhere downstream.' +
|
|
208
|
+
'\n \nExamples:\n' +
|
|
209
|
+
' div(7, 0) -> nil # No answer exists;\n' +
|
|
210
|
+
' mod(7, 0) -> nil # ... nor for the modulus;\n' +
|
|
211
|
+
' div(7.0, 0.0) -> nil # ... and a float would say Infinity.',
|
|
212
|
+
inexact_divide: 'Exact decimal division is not closed: one third has no finite\n' +
|
|
213
|
+
'decimal form, so `div`, `mod` and `rem` refuse a `0d` operand\n' +
|
|
214
|
+
'rather than round one. Two ways out. Scale to integers and divide\n' +
|
|
215
|
+
'those -- which is the convention money should be carried in\n' +
|
|
216
|
+
'anyway, minor units as an integer -- or use binary floats if an\n' +
|
|
217
|
+
'approximation is acceptable here.' +
|
|
218
|
+
'\n \nExamples:\n' +
|
|
219
|
+
' div(0d10.0, 0d4.0) -> nil # Refused, though this one terminates;\n' +
|
|
220
|
+
' div(0d10, 0d4) -> 0d2 # A biginteger is not a decimal;\n' +
|
|
221
|
+
' div(1000, 4) -> 250 # Integer cents, exact;\n' +
|
|
222
|
+
' div(10.0, 4.0) -> 2.5 # ... or binary64, approximate;\n' +
|
|
223
|
+
' mul(0d10.0, 0d4.0) -> 0d40.0 # Multiplication IS exact and stays.',
|
|
224
|
+
float_overflow: 'This result is not a finite binary64 number, so it is not a value\n' +
|
|
225
|
+
'Aontu can carry. There is no notation for an infinity or a NaN in\n' +
|
|
226
|
+
'a JSON superset, and no JSON a generator could emit for one, so\n' +
|
|
227
|
+
'the operation is refused where it is written rather than escaping\n' +
|
|
228
|
+
'as an internal error or an unserialisable value.\n' +
|
|
229
|
+
'Use the exact leaves (`0d`) if the magnitude is real rather than\n' +
|
|
230
|
+
'an accident.' +
|
|
231
|
+
'\n \nExamples:\n' +
|
|
232
|
+
' 1.0e308 + 1.0e308 -> nil # Overflows binary64;\n' +
|
|
233
|
+
' mul(1.0e200, 1.0e200) -> nil # ... and so does this;\n' +
|
|
234
|
+
' 0d1e308 + 0d1e308 -> 0d2e308 # Exact, and well inside budget.',
|
|
155
235
|
inexact_integer_sum: 'The `integer` leaf holds a value only when it is integral, within\n' +
|
|
156
|
-
'the int64 range, and exactly representable in binary64. This
|
|
157
|
-
'is not: {sum}.\n' +
|
|
158
|
-
'Aontu
|
|
159
|
-
'-- write `0d<digits>` for an exact integer beyond that
|
|
236
|
+
'the int64 range, and exactly representable in binary64. This\n' +
|
|
237
|
+
'result is not: {sum}.\n' +
|
|
238
|
+
'Aontu computes integers exactly and refuses to store a rounded\n' +
|
|
239
|
+
'answer -- write `0d<digits>` for an exact integer beyond that\n' +
|
|
240
|
+
'window.' +
|
|
160
241
|
'\n \nExamples:\n' +
|
|
161
242
|
' 4503599627370496 + 4503599627370496 -> 9007199254740992 # Exact;\n' +
|
|
162
243
|
' 4503599627370496 + 4503599627370497 -> nil # 2^53+1 is not;\n' +
|
|
@@ -230,6 +311,81 @@ const codeClasses = {
|
|
|
230
311
|
parse_unknown: 'parse',
|
|
231
312
|
parse_bad_src: 'parse',
|
|
232
313
|
merge_conflict: 'parse',
|
|
314
|
+
include_denied: 'parse',
|
|
315
|
+
// G3 -- the subsumption query's report vocabulary (class compat):
|
|
316
|
+
// the compat_* codes are its findings, the sub_* codes its undecided
|
|
317
|
+
// reasons. Report-layer codes: no NilVal ever carries one, so they
|
|
318
|
+
// have no hint text.
|
|
319
|
+
compat_narrowed: 'compat',
|
|
320
|
+
compat_required_added: 'compat',
|
|
321
|
+
compat_default_changed: 'compat',
|
|
322
|
+
compat_marks_changed: 'compat',
|
|
323
|
+
sub_unresolved: 'compat',
|
|
324
|
+
sub_disjunct_distribution: 'compat',
|
|
325
|
+
sub_path_dependent_spread: 'compat',
|
|
326
|
+
sub_evaluate_only: 'compat',
|
|
327
|
+
sub_default_indeterminate: 'compat',
|
|
328
|
+
deprecated: 'compat',
|
|
329
|
+
pref_not_instance: 'compat',
|
|
330
|
+
// G7 phase 5 -- the overlay patch verb: an assignment that is not
|
|
331
|
+
// <path>=<value>. Class `parse`, because what is malformed IS
|
|
332
|
+
// source text; report-layer, so no NilVal carries it.
|
|
333
|
+
patch_assignment: 'parse',
|
|
334
|
+
patch_not_editable: 'reference',
|
|
335
|
+
patch_ambiguous: 'reference',
|
|
336
|
+
patch_span_mismatch: 'internal',
|
|
337
|
+
// G4 phase 1 -- the identity mark: a name that is not one, and two
|
|
338
|
+
// different names on one node. `id_name` is a parse-class refusal
|
|
339
|
+
// of the argument; `id_conflict` is a conflict like any other
|
|
340
|
+
// failed meet, because that is exactly what it is.
|
|
341
|
+
id_name: 'parse',
|
|
342
|
+
id_conflict: 'conflict',
|
|
343
|
+
// Clearing rule 3: a constant `id()` inside an `&:` template. Class
|
|
344
|
+
// `parse`, because what is wrong is the TEXT of the template rather
|
|
345
|
+
// than any pair of values it brought together.
|
|
346
|
+
id_spread: 'parse',
|
|
347
|
+
// G4 phase 2 -- the checked link: a string that is not an entity
|
|
348
|
+
// address (class `parse`, the text is wrong), and an address that
|
|
349
|
+
// names nothing in this evaluation (class `reference`, the same
|
|
350
|
+
// class as `no_path`, because it is the same kind of miss).
|
|
351
|
+
refer_address: 'parse',
|
|
352
|
+
refer_unresolved: 'reference',
|
|
353
|
+
// G8 phase 1 -- the generation combinators. All three are class
|
|
354
|
+
// `parse`: what is wrong is the CALL as written (data that is not a
|
|
355
|
+
// bag, a list element that is not a name), not any pair of values a
|
|
356
|
+
// meet brought together.
|
|
357
|
+
pack_data: 'parse',
|
|
358
|
+
pack_key: 'parse',
|
|
359
|
+
each_data: 'parse',
|
|
360
|
+
// G8 phase 2 -- selection. `filter_data` is class `parse` for the
|
|
361
|
+
// same reason `pack_data` is: the CALL names something with no
|
|
362
|
+
// children. `match_none` is class `conflict` -- the value and every
|
|
363
|
+
// pattern written for it disagreed, which is an ordinary failed
|
|
364
|
+
// meet, reported once for the whole form.
|
|
365
|
+
filter_data: 'parse',
|
|
366
|
+
match_none: 'conflict',
|
|
367
|
+
// G8 phase 3 -- the placeholder. Class `conflict`: two values met
|
|
368
|
+
// and neither could answer for the other, which is what every
|
|
369
|
+
// conflict is.
|
|
370
|
+
place_pair: 'conflict',
|
|
371
|
+
// G8 phase 4 -- the pipe. Class `parse`: a pipe is sugar resolved
|
|
372
|
+
// while reading the source, so a pipe into something that is not a
|
|
373
|
+
// call is wrong in the TEXT and no later pass can repair it.
|
|
374
|
+
pipe_target: 'parse',
|
|
375
|
+
// G6 phase 2 -- modules. Both are class `parse`: a module import is
|
|
376
|
+
// resolved while the source is READ, and neither a module that is
|
|
377
|
+
// absent nor one whose meaning disagrees with its pin can be
|
|
378
|
+
// repaired by any later pass.
|
|
379
|
+
module_missing: 'parse',
|
|
380
|
+
module_integrity: 'parse',
|
|
381
|
+
module_depth: 'budget',
|
|
382
|
+
// G4 phase 5 -- the relation graph checks. Class `conflict`: the
|
|
383
|
+
// model contradicts a property it declared for itself. Report-layer,
|
|
384
|
+
// so no NilVal carries either -- both are global and non-monotone,
|
|
385
|
+
// and a lattice citizen may not be falsified by more information.
|
|
386
|
+
relation_cycle: 'conflict',
|
|
387
|
+
relation_inverse_missing: 'conflict',
|
|
388
|
+
relation_target_unmet: 'conflict',
|
|
233
389
|
func_arity: 'parse',
|
|
234
390
|
elided_value: 'parse',
|
|
235
391
|
unify_no_src: 'parse',
|
|
@@ -258,6 +414,12 @@ const codeClasses = {
|
|
|
258
414
|
'|:empty-dist': 'conflict',
|
|
259
415
|
exact_float_mix: 'conflict',
|
|
260
416
|
inexact_integer_sum: 'conflict',
|
|
417
|
+
pick_key: 'conflict',
|
|
418
|
+
aggregate_data: 'conflict',
|
|
419
|
+
aggregate_empty: 'conflict',
|
|
420
|
+
divide_by_zero: 'conflict',
|
|
421
|
+
inexact_divide: 'conflict',
|
|
422
|
+
float_overflow: 'conflict',
|
|
261
423
|
decimal_budget: 'conflict',
|
|
262
424
|
lossy_integer_literal: 'conflict',
|
|
263
425
|
arg: 'conflict',
|
|
@@ -275,6 +437,7 @@ const codeClasses = {
|
|
|
275
437
|
close: 'conflict',
|
|
276
438
|
// incomplete -- residue: the truth requires more than was supplied
|
|
277
439
|
no_gen: 'incomplete',
|
|
440
|
+
disjunct_no_gen: 'incomplete',
|
|
278
441
|
conjunct: 'incomplete',
|
|
279
442
|
mapval_no_gen: 'incomplete',
|
|
280
443
|
mapval_required: 'incomplete',
|
package/dist/hints.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hints.js","sourceRoot":"","sources":["../src/hints.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;
|
|
1
|
+
{"version":3,"file":"hints.js","sourceRoot":"","sources":["../src/hints.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;QAkmBlD,SAAS;AAhmBX;;;;;GAKG;AAEH,MAAM,KAAK,GAA2B;IAEpC,YAAY,EACV,qEAAqE;QACrE,gBAAgB;QAChB,kBAAkB;QAClB,oDAAoD;QACpD,mDAAmD;QACnD,0DAA0D;QAC1D,8DAA8D;IAEhE,WAAW,EACT,wDAAwD;QACxD,kBAAkB;QAClB,oDAAoD;QACpD,iEAAiE;QACjE,8DAA8D;IAEhE,OAAO,EACL,kEAAkE;QAClE,+CAA+C;IAEjD,MAAM,EACJ,qEAAqE;QACrE,oCAAoC;IAEtC,eAAe,EACb,uEAAuE;QACvE,qEAAqE;QACrE,qEAAqE;QACrE,yBAAyB;IAG3B,6DAA6D;IAC7D,eAAe,EAAE,6BAA6B;IAE9C,aAAa,EACX,qEAAqE;QACrE,oCAAoC;IAEtC,sBAAsB,EACpB,0DAA0D;IAE5D,gBAAgB,EAAE,gCAAgC;IAElD,cAAc,EACZ,4EAA4E;QAC5E,oCAAoC;IAEtC,uBAAuB,EACrB,0DAA0D;IAE5D,gBAAgB,EACd,uCAAuC;IAEzC,WAAW,EACT,kDAAkD;IAEpD,WAAW,EAAE,iDAAi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AAA;IAC7B,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;QAChB,OAAO,GAAG,CAAA;IACZ,CAAC;IACD,KAAK,MAAM,MAAM,IAAI,aAAa,EAAE,CAAC;QACnC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,OAAO,WAAW,CAAC,MAAM,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC,CAAC,iCAAiC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { VetFinding } from './vet';
|
|
2
|
+
import type { TrustOptions } from './type';
|
|
3
|
+
export type SchemaLoss = {
|
|
4
|
+
path: string;
|
|
5
|
+
construct: string;
|
|
6
|
+
reason: string;
|
|
7
|
+
};
|
|
8
|
+
export type SchemaVerdict = 'ok' | 'lossy' | 'error';
|
|
9
|
+
export type SchemaReport = {
|
|
10
|
+
verdict: SchemaVerdict;
|
|
11
|
+
schema: any;
|
|
12
|
+
lossy: SchemaLoss[];
|
|
13
|
+
errors?: VetFinding[];
|
|
14
|
+
};
|
|
15
|
+
export type SchemaOptions = {
|
|
16
|
+
at?: string;
|
|
17
|
+
path?: string;
|
|
18
|
+
trust?: TrustOptions;
|
|
19
|
+
};
|
|
20
|
+
export declare function jsonSchema(src: string, options?: SchemaOptions): SchemaReport;
|