aontu 0.62.0 → 0.64.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 +7 -7
- package/dist/agentsmd.js +0 -27
- package/dist/agentsmd.js.map +1 -1
- package/dist/alias.js.map +1 -1
- package/dist/allow.js +0 -92
- package/dist/allow.js.map +1 -1
- package/dist/aontu.d.ts +3 -3
- package/dist/aontu.js +4 -84
- package/dist/aontu.js.map +1 -1
- package/dist/aontumodel.d.ts +4 -0
- package/dist/aontumodel.js +27 -0
- package/dist/aontumodel.js.map +1 -0
- package/dist/casing.d.ts +5 -0
- package/dist/casing.js +90 -0
- package/dist/casing.js.map +1 -0
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +228 -935
- package/dist/cli.js.map +1 -1
- package/dist/ctx.js +0 -48
- package/dist/ctx.js.map +1 -1
- package/dist/diff.js +0 -32
- package/dist/diff.js.map +1 -1
- package/dist/err.js +0 -40
- package/dist/err.js.map +1 -1
- package/dist/escape.js +0 -45
- package/dist/escape.js.map +1 -1
- package/dist/exactjson.d.ts +0 -35
- package/dist/exactjson.js +0 -131
- package/dist/exactjson.js.map +1 -1
- package/dist/format.js +13 -203
- package/dist/format.js.map +1 -1
- package/dist/grammar.d.ts +9 -0
- package/dist/grammar.js +54 -0
- package/dist/grammar.js.map +1 -0
- package/dist/graph.js +0 -26
- package/dist/graph.js.map +1 -1
- package/dist/hcanon.js +0 -82
- package/dist/hcanon.js.map +1 -1
- package/dist/helpdoc.js +2 -2
- package/dist/helpdoc.js.map +1 -1
- package/dist/hints.d.ts +0 -6
- package/dist/hints.js +57 -55
- package/dist/hints.js.map +1 -1
- package/dist/jsonschema.js +0 -114
- package/dist/jsonschema.js.map +1 -1
- package/dist/keyorder.d.ts +0 -7
- package/dist/keyorder.js +0 -41
- package/dist/keyorder.js.map +1 -1
- package/dist/lang.js +17 -915
- package/dist/lang.js.map +1 -1
- package/dist/lsp-server.js +0 -16
- package/dist/lsp-server.js.map +1 -1
- package/dist/lsp.d.ts +1 -1
- package/dist/lsp.js +12 -159
- package/dist/lsp.js.map +1 -1
- package/dist/mcp-server.js +0 -26
- package/dist/mcp-server.js.map +1 -1
- package/dist/mcp.js +0 -149
- package/dist/mcp.js.map +1 -1
- package/dist/mod-tool.js +16 -131
- package/dist/mod-tool.js.map +1 -1
- package/dist/mod.js +0 -162
- package/dist/mod.js.map +1 -1
- package/dist/patch.js +0 -217
- package/dist/patch.js.map +1 -1
- package/dist/profile.d.ts +9 -0
- package/dist/profile.js +28 -0
- package/dist/profile.js.map +1 -0
- package/dist/provenance.js +0 -140
- package/dist/provenance.js.map +1 -1
- package/dist/query.js +0 -75
- package/dist/query.js.map +1 -1
- package/dist/reach.js +0 -43
- package/dist/reach.js.map +1 -1
- package/dist/relation.js +0 -61
- package/dist/relation.js.map +1 -1
- package/dist/report-sarif.d.ts +0 -11
- package/dist/report-sarif.js +0 -28
- package/dist/report-sarif.js.map +1 -1
- package/dist/sig.js +0 -35
- package/dist/sig.js.map +1 -1
- package/dist/sigdecl.js +1 -1
- package/dist/sigdecl.js.map +1 -1
- package/dist/siggate.js +0 -4
- package/dist/siggate.js.map +1 -1
- package/dist/site.js +3 -29
- package/dist/site.js.map +1 -1
- package/dist/subsume.d.ts +0 -10
- package/dist/subsume.js +0 -137
- package/dist/subsume.js.map +1 -1
- package/dist/template.d.ts +2 -1
- package/dist/template.js +58 -138
- package/dist/template.js.map +1 -1
- package/dist/trace.d.ts +21 -0
- package/dist/trace.js +107 -0
- package/dist/trace.js.map +1 -0
- package/dist/trim.js +0 -41
- package/dist/trim.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/type.js.map +1 -1
- package/dist/unify.js +13 -248
- package/dist/unify.js.map +1 -1
- package/dist/utility.js +0 -22
- package/dist/utility.js.map +1 -1
- package/dist/val/AbnfFuncVal.d.ts +18 -0
- package/dist/val/AbnfFuncVal.js +132 -0
- package/dist/val/AbnfFuncVal.js.map +1 -0
- package/dist/val/AbsentVal.d.ts +11 -0
- package/dist/val/AbsentVal.js +30 -0
- package/dist/val/AbsentVal.js.map +1 -0
- package/dist/val/AggFuncVal.d.ts +10 -1
- package/dist/val/AggFuncVal.js +104 -116
- package/dist/val/AggFuncVal.js.map +1 -1
- package/dist/val/ArithFuncVal.js +0 -12
- package/dist/val/ArithFuncVal.js.map +1 -1
- package/dist/val/BagVal.js +1 -78
- package/dist/val/BagVal.js.map +1 -1
- package/dist/val/BigDecimalVal.js +0 -16
- package/dist/val/BigDecimalVal.js.map +1 -1
- package/dist/val/BigIntegerVal.js +0 -16
- package/dist/val/BigIntegerVal.js.map +1 -1
- package/dist/val/CloseFuncVal.js +0 -9
- package/dist/val/CloseFuncVal.js.map +1 -1
- package/dist/val/CmpFuncVal.d.ts +2 -0
- package/dist/val/CmpFuncVal.js +49 -72
- package/dist/val/CmpFuncVal.js.map +1 -1
- package/dist/val/ConjunctVal.js +0 -29
- package/dist/val/ConjunctVal.js.map +1 -1
- package/dist/val/ConstraintVal.js +0 -500
- package/dist/val/ConstraintVal.js.map +1 -1
- package/dist/val/ContainerKindVal.js +0 -2
- package/dist/val/ContainerKindVal.js.map +1 -1
- package/dist/val/CopyFuncVal.js +0 -3
- package/dist/val/CopyFuncVal.js.map +1 -1
- package/dist/val/Decimal.js +0 -179
- package/dist/val/Decimal.js.map +1 -1
- package/dist/val/DeprecateFuncVal.js.map +1 -1
- package/dist/val/DisjunctVal.js +0 -152
- package/dist/val/DisjunctVal.js.map +1 -1
- package/dist/val/EachFuncVal.js +0 -3
- package/dist/val/EachFuncVal.js.map +1 -1
- package/dist/val/EmitFuncVal.d.ts +1 -1
- package/dist/val/EmitFuncVal.js +6 -119
- package/dist/val/EmitFuncVal.js.map +1 -1
- package/dist/val/ExpectVal.js +0 -62
- package/dist/val/ExpectVal.js.map +1 -1
- package/dist/val/FilterFuncVal.js +0 -25
- package/dist/val/FilterFuncVal.js.map +1 -1
- package/dist/val/FuncBaseVal.d.ts +1 -0
- package/dist/val/FuncBaseVal.js +7 -127
- package/dist/val/FuncBaseVal.js.map +1 -1
- package/dist/val/GraphAtomVal.js +0 -15
- package/dist/val/GraphAtomVal.js.map +1 -1
- package/dist/val/HideFuncVal.js +0 -13
- package/dist/val/HideFuncVal.js.map +1 -1
- package/dist/val/IntegerVal.js +0 -61
- package/dist/val/IntegerVal.js.map +1 -1
- package/dist/val/JunctionVal.js +0 -20
- package/dist/val/JunctionVal.js.map +1 -1
- package/dist/val/KeyFuncVal.js +0 -46
- package/dist/val/KeyFuncVal.js.map +1 -1
- package/dist/val/ListVal.js +0 -57
- package/dist/val/ListVal.js.map +1 -1
- package/dist/val/LowerFuncVal.js +0 -11
- package/dist/val/LowerFuncVal.js.map +1 -1
- package/dist/val/MapVal.js +0 -151
- package/dist/val/MapVal.js.map +1 -1
- package/dist/val/MatchFuncVal.js +0 -27
- package/dist/val/MatchFuncVal.js.map +1 -1
- package/dist/val/{FormFuncVal.d.ts → MaybeFuncVal.d.ts} +5 -5
- package/dist/val/MaybeFuncVal.js +50 -0
- package/dist/val/MaybeFuncVal.js.map +1 -0
- package/dist/val/MoveFuncVal.js +0 -18
- package/dist/val/MoveFuncVal.js.map +1 -1
- package/dist/val/NilVal.js +0 -60
- package/dist/val/NilVal.js.map +1 -1
- package/dist/val/NomFuncVal.js +18 -54
- package/dist/val/NomFuncVal.js.map +1 -1
- package/dist/val/NumberVal.js +0 -15
- package/dist/val/NumberVal.js.map +1 -1
- package/dist/val/OpBaseVal.d.ts +1 -0
- package/dist/val/OpBaseVal.js +3 -15
- package/dist/val/OpBaseVal.js.map +1 -1
- package/dist/val/PackFuncVal.js +0 -34
- package/dist/val/PackFuncVal.js.map +1 -1
- package/dist/val/PathFuncVal.js +0 -6
- package/dist/val/PathFuncVal.js.map +1 -1
- package/dist/val/PathVal.js +0 -41
- package/dist/val/PathVal.js.map +1 -1
- package/dist/val/PlaceVal.js +0 -25
- package/dist/val/PlaceVal.js.map +1 -1
- package/dist/val/PlusOpVal.d.ts +1 -7
- package/dist/val/PlusOpVal.js +13 -74
- package/dist/val/PlusOpVal.js.map +1 -1
- package/dist/val/PrefFuncVal.js +0 -1
- package/dist/val/PrefFuncVal.js.map +1 -1
- package/dist/val/PrefVal.js +0 -167
- package/dist/val/PrefVal.js.map +1 -1
- package/dist/val/RecurseVal.js +0 -55
- package/dist/val/RecurseVal.js.map +1 -1
- package/dist/val/RefVal.js +0 -282
- package/dist/val/RefVal.js.map +1 -1
- package/dist/val/ReferFuncVal.js +3 -232
- package/dist/val/ReferFuncVal.js.map +1 -1
- package/dist/val/ScalarKindVal.js +0 -49
- package/dist/val/ScalarKindVal.js.map +1 -1
- package/dist/val/ScalarVal.js +0 -11
- package/dist/val/ScalarVal.js.map +1 -1
- package/dist/val/StrFuncVal.js +0 -18
- package/dist/val/StrFuncVal.js.map +1 -1
- package/dist/val/SuperFuncVal.js +0 -32
- package/dist/val/SuperFuncVal.js.map +1 -1
- package/dist/val/TopVal.js +0 -1
- package/dist/val/TopVal.js.map +1 -1
- package/dist/val/TranslateFuncVal.js +1 -3
- package/dist/val/TranslateFuncVal.js.map +1 -1
- package/dist/val/UpperFuncVal.js +0 -11
- package/dist/val/UpperFuncVal.js.map +1 -1
- package/dist/val/Val.d.ts +1 -0
- package/dist/val/Val.js +2 -133
- package/dist/val/Val.js.map +1 -1
- package/dist/val/VarVal.js +0 -12
- package/dist/val/VarVal.js.map +1 -1
- package/dist/val/arith.js +0 -37
- package/dist/val/arith.js.map +1 -1
- package/dist/val/caserange.js +0 -61
- package/dist/val/caserange.js.map +1 -1
- package/dist/val/members.js +0 -6
- package/dist/val/members.js.map +1 -1
- package/dist/val/numcmp.js +0 -11
- package/dist/val/numcmp.js.map +1 -1
- package/dist/val/numkind.js +0 -145
- package/dist/val/numkind.js.map +1 -1
- package/dist/val/valutil.js +0 -16
- package/dist/val/valutil.js.map +1 -1
- package/dist/vet.js +0 -461
- package/dist/vet.js.map +1 -1
- package/dist/view.js +0 -414
- package/dist/view.js.map +1 -1
- package/dist/walk.js +0 -41
- package/dist/walk.js.map +1 -1
- package/grammar/aontu.abnf +8 -6
- package/grammar/aontu.gbnf +4 -4
- package/grammar/aontu.lark +4 -4
- package/grammar/aontu.tmLanguage.json +1 -1
- package/package.json +4 -2
- package/skill/tasks.md +9 -7
- package/src/agentsmd.ts +0 -35
- package/src/alias.ts +0 -39
- package/src/allow.ts +1 -96
- package/src/aontu.ts +4 -116
- package/src/aontumodel.ts +26 -0
- package/src/casing.ts +95 -0
- package/src/cli.ts +258 -1024
- package/src/ctx.ts +0 -103
- package/src/diff.ts +0 -40
- package/src/err.ts +0 -40
- package/src/escape.ts +0 -46
- package/src/exactjson.ts +0 -131
- package/src/format.ts +14 -257
- package/src/grammar.ts +72 -0
- package/src/graph.ts +0 -61
- package/src/hcanon.ts +0 -82
- package/src/helpdoc.ts +2 -2
- package/src/hints.ts +69 -57
- package/src/jsonschema.ts +0 -123
- package/src/keyorder.ts +0 -42
- package/src/lang.ts +19 -931
- package/src/lsp-server.ts +0 -16
- package/src/lsp.ts +12 -180
- package/src/mcp-server.ts +0 -31
- package/src/mcp.ts +0 -169
- package/src/mod-tool.ts +18 -159
- package/src/mod.ts +0 -178
- package/src/patch.ts +0 -232
- package/src/profile.ts +42 -0
- package/src/provenance.ts +0 -183
- package/src/query.ts +0 -84
- package/src/reach.ts +0 -53
- package/src/relation.ts +0 -84
- package/src/report-sarif.ts +0 -48
- package/src/sig.ts +0 -35
- package/src/sigdecl.ts +1 -1
- package/src/siggate.ts +0 -30
- package/src/site.ts +3 -29
- package/src/subsume.ts +1 -161
- package/src/template.ts +69 -140
- package/src/trace.ts +157 -0
- package/src/trim.ts +0 -53
- package/src/type.ts +2 -45
- package/src/unify.ts +14 -257
- package/src/utility.ts +0 -31
- package/src/val/AbnfFuncVal.ts +181 -0
- package/src/val/AbsentVal.ts +54 -0
- package/src/val/AggFuncVal.ts +152 -188
- package/src/val/ArithFuncVal.ts +0 -20
- package/src/val/BagVal.ts +1 -78
- package/src/val/BigDecimalVal.ts +0 -16
- package/src/val/BigIntegerVal.ts +0 -16
- package/src/val/CloseFuncVal.ts +0 -9
- package/src/val/CmpFuncVal.ts +68 -184
- package/src/val/ConjunctVal.ts +0 -33
- package/src/val/ConstraintVal.ts +2 -537
- package/src/val/ContainerKindVal.ts +0 -18
- package/src/val/CopyFuncVal.ts +0 -5
- package/src/val/Decimal.ts +1 -185
- package/src/val/DeprecateFuncVal.ts +0 -10
- package/src/val/DisjunctVal.ts +0 -157
- package/src/val/EachFuncVal.ts +0 -40
- package/src/val/EmitFuncVal.ts +8 -208
- package/src/val/ExpectVal.ts +0 -62
- package/src/val/FilterFuncVal.ts +0 -55
- package/src/val/FuncBaseVal.ts +9 -130
- package/src/val/GraphAtomVal.ts +0 -42
- package/src/val/HideFuncVal.ts +0 -15
- package/src/val/IntegerVal.ts +0 -61
- package/src/val/JunctionVal.ts +0 -20
- package/src/val/KeyFuncVal.ts +0 -48
- package/src/val/ListVal.ts +0 -59
- package/src/val/LowerFuncVal.ts +0 -12
- package/src/val/MapVal.ts +0 -151
- package/src/val/MatchFuncVal.ts +0 -59
- package/src/val/MaybeFuncVal.ts +86 -0
- package/src/val/MoveFuncVal.ts +0 -20
- package/src/val/NilVal.ts +0 -60
- package/src/val/NomFuncVal.ts +10 -99
- package/src/val/NumberVal.ts +0 -16
- package/src/val/OpBaseVal.ts +4 -17
- package/src/val/PackFuncVal.ts +0 -63
- package/src/val/PathFuncVal.ts +0 -32
- package/src/val/PathVal.ts +0 -66
- package/src/val/PlaceVal.ts +0 -45
- package/src/val/PlusOpVal.ts +18 -75
- package/src/val/PrefFuncVal.ts +0 -1
- package/src/val/PrefVal.ts +0 -179
- package/src/val/RecurseVal.ts +0 -81
- package/src/val/RefVal.ts +1 -285
- package/src/val/ReferFuncVal.ts +4 -255
- package/src/val/ScalarKindVal.ts +0 -50
- package/src/val/ScalarVal.ts +0 -12
- package/src/val/StrFuncVal.ts +0 -44
- package/src/val/SuperFuncVal.ts +0 -42
- package/src/val/TopVal.ts +0 -1
- package/src/val/TranslateFuncVal.ts +1 -51
- package/src/val/UpperFuncVal.ts +0 -12
- package/src/val/Val.ts +3 -192
- package/src/val/VarVal.ts +0 -15
- package/src/val/arith.ts +0 -92
- package/src/val/caserange.ts +0 -62
- package/src/val/members.ts +0 -23
- package/src/val/numcmp.ts +1 -27
- package/src/val/numkind.ts +0 -149
- package/src/val/valutil.ts +0 -16
- package/src/vet.ts +1 -582
- package/src/view.ts +0 -507
- package/src/walk.ts +0 -41
- package/dist/lower.d.ts +0 -23
- package/dist/lower.js +0 -578
- package/dist/lower.js.map +0 -1
- package/dist/render.d.ts +0 -53
- package/dist/render.js +0 -547
- package/dist/render.js.map +0 -1
- package/dist/std.d.ts +0 -3
- package/dist/std.js +0 -672
- package/dist/std.js.map +0 -1
- package/dist/val/FormFuncVal.js +0 -55
- package/dist/val/FormFuncVal.js.map +0 -1
- package/dist/val/NamerFuncVal.d.ts +0 -12
- package/dist/val/NamerFuncVal.js +0 -176
- package/dist/val/NamerFuncVal.js.map +0 -1
- package/src/lower.ts +0 -636
- package/src/render.ts +0 -732
- package/src/std.ts +0 -683
package/dist/helpdoc.js
CHANGED
|
@@ -7,7 +7,7 @@ const HELPDOC = [
|
|
|
7
7
|
"topic": "tasks",
|
|
8
8
|
"summary": "what do you want to do? — the verb for a job",
|
|
9
9
|
"source": "docs/skill/tasks.md",
|
|
10
|
-
"text": "# What do you want to do?\n\nThe verb for a job, found by the word you arrived with. aontu's own\nvocabulary is on the right; yours is probably on the left.\n\n## Start from a document that works\n\nNothing written yet? Do not invent the first document, edit one:\n\n```\naontu init # into the working directory\naontu init model/ # or into a named one\nsh check.sh # the four questions, on what was just written\n```\n\n`init` writes `model.aon` (an entity map constrained with `&:`),\n`data.aon` (an instance of it that holds) and `check.sh` (the four\nchecks to run after every edit). It never overwrites: if any\nof the three already stands there, it refuses and writes none of them.\n\n## Describe a domain\n\nAn **ontology**, a **schema**, a **data model**, a **contract** — in\naontu these are all one thing: a document. Write the entities as a\n**map keyed by name**, and say what every entry must satisfy with the\n`&:` template:\n\n```\nentity: {\n &: {\n table: string\n fields: { &: { type: string, required: *false | boolean } }\n }\n planet: { table: \"planets\", fields: { name: { type: \"string\" } } }\n moon: { table: \"moons\", fields: { name: { type: \"string\" } } }\n}\n```\n\n`&:` is the construct to reach for first, and the one most easily\nmissed. It meets **every** key of the map it sits in. A quoted `\"*\"`\nis not a wildcard — it is a key named `*`, and a schema written that\nway constrains nothing while still reporting `valid`.\n\nPrefer a named map to a list unless the order is a fact (a migration\nsequence, a rule table tried in order). A key is an address, a name\nother parts can refer to, and a diff that shows one insertion instead\nof every following element renumbered.\n\n## Check data against a model\n\n```\naontu vet model.aon data.aon\n```\n\nExit `0` valid, `1` a contradiction, `3` incomplete (nothing\ncontradicts, but the model is not yet satisfied), `4` the model does\nnot stand up on its own. `--format json` for the machine-readable\nreport, `--closed` to refuse keys the model does not declare,\n`--max-errors <n>` to cap the list.\n\n**Make the check prove it checked something.** A check that examined\nnothing answers exactly like one that passed:\n\n```\naontu vet --coverage model.aon data.aon # what did it examine?\naontu vet --strict-coverage model.aon data.aon # exit 1 if nothing\n```\n\n`--coverage` reports how many data leaves a declaration constrained,\nthe data paths none did, and the declarations no data met.\n`--strict-coverage` exits 1 when the answer is nothing. The usual\ncause is the `\"*\"` mistake above: reach for `&:`.\n\n## Check the model is coherent with itself\n\n```\naontu relations model.aon # declared entity edges: targets resolve, no cycles\naontu reaches planet moon model.aon # does one entity reach another, at any remove?\naontu trim --check model.aon # entries whose removal changes nothing\n```\n\n##
|
|
10
|
+
"text": "# What do you want to do?\n\nThe verb for a job, found by the word you arrived with. aontu's own\nvocabulary is on the right; yours is probably on the left.\n\n## Start from a document that works\n\nNothing written yet? Do not invent the first document, edit one:\n\n```\naontu init # into the working directory\naontu init model/ # or into a named one\nsh check.sh # the four questions, on what was just written\n```\n\n`init` writes `model.aon` (an entity map constrained with `&:`),\n`data.aon` (an instance of it that holds) and `check.sh` (the four\nchecks to run after every edit). It never overwrites: if any\nof the three already stands there, it refuses and writes none of them.\n\n## Describe a domain\n\nAn **ontology**, a **schema**, a **data model**, a **contract** — in\naontu these are all one thing: a document. Write the entities as a\n**map keyed by name**, and say what every entry must satisfy with the\n`&:` template:\n\n```\nentity: {\n &: {\n table: string\n fields: { &: { type: string, required: *false | boolean } }\n }\n planet: { table: \"planets\", fields: { name: { type: \"string\" } } }\n moon: { table: \"moons\", fields: { name: { type: \"string\" } } }\n}\n```\n\n`&:` is the construct to reach for first, and the one most easily\nmissed. It meets **every** key of the map it sits in. A quoted `\"*\"`\nis not a wildcard — it is a key named `*`, and a schema written that\nway constrains nothing while still reporting `valid`.\n\nPrefer a named map to a list unless the order is a fact (a migration\nsequence, a rule table tried in order). A key is an address, a name\nother parts can refer to, and a diff that shows one insertion instead\nof every following element renumbered.\n\n## Check data against a model\n\n```\naontu vet model.aon data.aon\n```\n\nExit `0` valid, `1` a contradiction, `3` incomplete (nothing\ncontradicts, but the model is not yet satisfied), `4` the model does\nnot stand up on its own. `--format json` for the machine-readable\nreport, `--closed` to refuse keys the model does not declare,\n`--max-errors <n>` to cap the list.\n\n**Make the check prove it checked something.** A check that examined\nnothing answers exactly like one that passed:\n\n```\naontu vet --coverage model.aon data.aon # what did it examine?\naontu vet --strict-coverage model.aon data.aon # exit 1 if nothing\n```\n\n`--coverage` reports how many data leaves a declaration constrained,\nthe data paths none did, and the declarations no data met.\n`--strict-coverage` exits 1 when the answer is nothing. The usual\ncause is the `\"*\"` mistake above: reach for `&:`.\n\n## Check the model is coherent with itself\n\n```\naontu relations model.aon # declared entity edges: targets resolve, no cycles\naontu reaches planet moon model.aon # does one entity reach another, at any remove?\naontu trim --check model.aon # entries whose removal changes nothing\n```\n\n## Generate code from a model, and hold it\n\n```\naontu get out gen.aon # the component tree: files, and the lines in them\naontu trace gen.aon # what rule wrote each line\n```\n\nA generator answers a **component tree** -- `file(name, [lines])` and\nits neighbours -- which a generator runtime writes to disk. Hand the\ntree to one and compare with what is committed: the model is the truth,\nthe code is the claim, and drift is a finding. `aontu trace` answers\nthe other direction: for a line of the output, the model node and the\nrule behind it.\n\n## Ask what a model says, and why\n\n```\naontu get $.entity.planet.table model.aon\naontu why $.entity.planet.table model.aon\naontu get $.entity --keys model.aon\naontu get $.entity --types model.aon\n```\n\n`why` names **every** contribution to a value, with the file and line\neach was written on. It is the first thing to run when a value is not\nwhat you expected, and the second thing to run when `vet` refuses.\n\n## Change a value without editing the file\n\n```\naontu set '$.entity.planet.table=planet_v2' --entry model.aon --overlay local.aon\n```\n\nThe change is checked before it is written; a change that contradicts\na pinned value is refused, and the file is left alone.\n\n## Gate a change to the model itself\n\n```\naontu subsume old.aon new.aon # does the general admit every specific?\naontu breaking --against git#HEAD~1 model.aon\naontu hash model.aon # a pin that survives reformatting\n```\n\n## Hand a model to another agent\n\n```\naontu agentsmd --write AGENTS.md model.aon\n```\n\nSplices a derived stanza — the pin, the root keys, the shape, and the\ncommands spelled with paths that exist — between two markers, and\nleaves the rest of the file alone. Re-run it in the commit that\nchanges the model.\n\n## When something refuses\n\nRead the code in the brackets, then look it up:\n\n```\naontu explain no_scalar_unify\n```\n\nEvery finding carries a `code`, a `class`, a `path` and the **two\nsites** that disagree — the value and the constraint it failed, each\nwith its file and line. The class says what kind of answer it is:\n`conflict` (two things cannot both hold), `incomplete` (nothing is\nwrong yet, something is missing), `parse`, `reference`, `budget`.\n\nFull index: [`error-codes.md`](error-codes.md). The language on one\npage: [`grammar-card.md`](grammar-card.md). The worked ladder from\nplain JSON upward: [`examples.md`](examples.md).\n"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"topic": "language",
|
|
@@ -31,7 +31,7 @@ const HELPDOC = [
|
|
|
31
31
|
"topic": "grammar",
|
|
32
32
|
"summary": "the published ABNF, for a parser or a constrained decoder",
|
|
33
33
|
"source": "grammar/aontu.abnf",
|
|
34
|
-
"text": "; Aontu --- published grammar (ABNF, RFC 5234 + RFC 7405).\n;\n; The same language as grammar/aontu.gbnf, rule for rule and name for\n; name, in the notation an RFC reader expects. The GBNF form is for a\n; constrained decoder; THIS form is for a person, and for the railroad\n; diagram in the language reference, which is generated from this file\n; (ts/scripts/figures.cjs).\n;\n; It covers the DOCUMENTED EMISSION SURFACE: what a model should be\n; allowed to write, which is a superset of JSON plus the operators,\n; constraints and marks the language's own canonical form emits. It is\n; CONSERVATIVE BY CONSTRUCTION --- it may accept less than the parser\n; does, never more. The same two deliberate exclusions the GBNF has:\n;\n; - `@\"...\"` includes. A generated document should describe values,\n; not reach for files.\n; - Unquoted keys and the other spellings the parser tolerates.\n; Canon quotes every key, and one spelling is what a grammar is\n; for.\n;\n; TWO NOTATION CHOICES worth stating, because both are load-bearing.\n;\n; EVERY LITERAL IS CASE-SENSITIVE, spelled `%s\"...\"` (RFC 7405). A\n; plain `\"...\"` is case-INSENSITIVE in RFC 5234, and Aontu is not:\n; `TRUE` is a bare word and `true` is a boolean. The reader in\n; ts/scripts/abnf.cjs refuses a bare quoted string rather than guess\n; which was meant.\n;\n; ALTERNATION IS ORDERED. RFC 5234's `/` is formally unordered, and\n; the consumers of this file (a PEG-style matcher here, a railroad\n; renderer) take the first branch that matches. Where one spelling is\n; a prefix of another the longer comes first --- `exact` before\n; `number`, `refer` before `rem` before `re`, `biginteger` before\n; `boolean` --- so the ordered reading and the unordered one accept\n; the same language. ts/test/grammar.test.ts holds this file to the\n; whole canon corpus of test/spec/*.tsv, which is what proves it.\n\nroot = ws value ws\n\n; No pipe. `|>` was parse-time sugar; it was removed, `x |> f(a)`\n; being written `f(x, a)`.\nvalue = disjunct\n\ndisjunct = conjunct *( ws %s\"|\" ws conjunct )\n\nconjunct = prefixed *( ws %s\"&\" ws prefixed )\n\n; A preference marks the alternative a generation picks.\nprefixed = %s\"*\" ws prefixed / sum\n\nsum = atom *( ws %s\"+\" ws atom )\n\natom = map\n / list\n / func\n / ref\n / kind\n / place\n / scalar\n / %s\"(\" ws value ws %s\")\"\n\nmap = %s\"{\" ws [ entry *( ws %s\",\" ws entry ) ws ] %s\"}\"\n\nentry = spread / pair\n\n; The template every key of the bag must also satisfy.\nspread = %s\"&\" ws %s\":\" ws value\n\npair = string ws [ %s\"?\" ] ws %s\":\" ws value\n\n; A list ELEMENT is a value, not a pair --- only the template is keyed.\nlist = %s\"[\" ws [ element *( ws %s\",\" ws element ) ws ] %s\"]\"\n\nelement = spread / value\n\n; The builtins, applied. The name set is closed on purpose: an unknown\n; function is a parse-time error in the engine, so a grammar that\n; allowed any name would over-approximate.\nfunc = name %s\"(\" ws [ value *( ws %s\",\" ws value ) ws ] %s\")\"\n\n; ORDER MATTERS where one name is a prefix of another: `refer` is\n; listed before `re`, and `rem` before `re` as well.\nname = %s\"above\" / %s\"acyclic\" / %s\"add\" / %s\"below\" / %s\"close\"\n / %s\"copy\" / %s\"deprecate\" / %s\"div\"\n / %s\"each\" / %s\"emit\" / %s\"esc\" / %s\"filter\" / %s\"greatest\"\n / %s\"hide\"\n / %s\"inverse\" / %s\"join\" / %s\"key\" / %s\"least\"\n / %s\"length\" / %s\"list\" / %s\"lower\" / %s\"map\" / %s\"match\"\n / %s\"max\" / %s\"min\" / %s\"mod\" / %s\"move\"\n / %s\"mul\" / %s\"must\"\n / %s\"neq\"\n / %s\"open\" / %s\"pack\" / %s\"path\" / %s\"pick\" / %s\"pref\"\n / %s\"refer\" / %s\"rel\" / %s\"rem\" / %s\"rep\" / %s\"re\" / %s\"split\"\n / %s\"super\"\n / %s\"sub\" / %s\"sum\"\n / %s\"type\"\n / %s\"unique\" / %s\"upper\" / %s\"usc\"\n\n; A path reference, absolute from the document root. At least one\n; segment: a bare `$` is an incomplete expression, not a reference.\n; A RELATIVE reference has no `$`: `.n` names a sibling, resolved\n; against the enclosing map rather than the document root. Canon emits\n; one wherever a spread template survives unresolved, so a grammar\n; without it cannot parse this engine's own output. No conflict with\n; `number`: a numeric literal always starts with a digit or `-`.\nref = %s\"$\" 1*( %s\".\" segment ) / 1*( %s\".\" segment )\n\n; No `-`: it is not a bare-text character (test/spec/op-chars.tsv pins\n; `a:6-2` as a parse error), so admitting it would over-approximate.\nsegment = 1*( ALPHA / DIGIT / %s\"_\" )\n\n; The placeholder: a hole a call is filled through. BARE only --- `\"_\"`\n; is an ordinary string, and a longer bare word containing it is\n; ordinary text.\nplace = %s\"_\"\n\n; `biginteger` before `bigdecimal` is not required (they differ at the\n; fourth character), but `biginteger` before `boolean` is: see the\n; ordered-alternation note above.\nkind = %s\"biginteger\" / %s\"bigdecimal\" / %s\"boolean\" / %s\"float\"\n / %s\"integer\" / %s\"number\" / %s\"string\" / %s\"top\" / %s\"nil\"\n\n; `exact` before `number`, or `0d5` would match `number` as the single\n; digit `0` and leave `d5` unconsumed.\nscalar = string / exact / number / %s\"true\" / %s\"false\" / %s\"null\"\n\nstring = DQUOTE *char DQUOTE\n\nchar = unescaped / %x5C escape\n\n; Every code point but the quote and the backslash, which is what the\n; GBNF's `[^\"\\\\]` says. Control characters included: canon writes them\n; escaped, and a grammar that refused them would refuse less than the\n; parser accepts in the one direction this file may not.\nunescaped = %x00-21 / %x23-5B / %x5D-10FFFF\n\nescape = DQUOTE / %x5C / %s\"/\" / %s\"b\" / %s\"f\" / %s\"n\" / %s\"r\"\n / %s\"t\" / %s\"u\" hex hex hex hex\n\nhex = DIGIT / %x41-46 / %x61-66\n\n; The exact leaves: arbitrary precision, spelled with the 0d marker.\nexact = [ %s\"-\" ] %s\"0d\" digits [ %s\".\" digits ] [ exponent ]\n\nnumber = [ %s\"-\" ] digits [ %s\".\" digits ] [ exponent ]\n\nexponent = ( %s\"e\" / %s\"E\" ) [ %s\"-\" / %s\"+\" ] digits\n\ndigits = 1*DIGIT\n\nws = *( %x20 / %x09 / %x0A / %x0D )\n\n; RFC 5234's core rules, written out so this file stands alone.\nALPHA = %x41-5A / %x61-7A\nDIGIT = %x30-39\nDQUOTE = %x22\n"
|
|
34
|
+
"text": "; Aontu --- published grammar (ABNF, RFC 5234 + RFC 7405).\n;\n; The same language as grammar/aontu.gbnf, rule for rule and name for\n; name, in the notation an RFC reader expects. The GBNF form is for a\n; constrained decoder; THIS form is for a person, and for the railroad\n; diagram in the language reference, which is generated from this file\n; (ts/scripts/figures.cjs).\n;\n; It covers the DOCUMENTED EMISSION SURFACE: what a model should be\n; allowed to write, which is a superset of JSON plus the operators,\n; constraints and marks the language's own canonical form emits. It is\n; CONSERVATIVE BY CONSTRUCTION --- it may accept less than the parser\n; does, never more. The same two deliberate exclusions the GBNF has:\n;\n; - `@\"...\"` includes. A generated document should describe values,\n; not reach for files.\n; - Unquoted keys and the other spellings the parser tolerates.\n; Canon quotes every key, and one spelling is what a grammar is\n; for.\n;\n; TWO NOTATION CHOICES worth stating, because both are load-bearing.\n;\n; EVERY LITERAL IS CASE-SENSITIVE, spelled `%s\"...\"` (RFC 7405). A\n; plain `\"...\"` is case-INSENSITIVE in RFC 5234, and Aontu is not:\n; `TRUE` is a bare word and `true` is a boolean. The reader in\n; ts/scripts/abnf.cjs refuses a bare quoted string rather than guess\n; which was meant.\n;\n; ALTERNATION IS ORDERED. RFC 5234's `/` is formally unordered, and\n; the consumers of this file (a PEG-style matcher here, a railroad\n; renderer) take the first branch that matches. Where one spelling is\n; a prefix of another the longer comes first --- `exact` before\n; `number`, `refer` before `rem` before `re`, `biginteger` before\n; `boolean` --- so the ordered reading and the unordered one accept\n; the same language. ts/test/grammar.test.ts holds this file to the\n; whole canon corpus of test/spec/*.tsv, which is what proves it.\n\nroot = ws value ws\n\n; No pipe. `|>` was parse-time sugar; it was removed, `x |> f(a)`\n; being written `f(x, a)`.\nvalue = disjunct\n\ndisjunct = conjunct *( ws %s\"|\" ws conjunct )\n\nconjunct = prefixed *( ws %s\"&\" ws prefixed )\n\n; A preference marks the alternative a generation picks.\nprefixed = %s\"*\" ws prefixed / sum\n\nsum = atom *( ws %s\"+\" ws atom )\n\natom = map\n / list\n / func\n / ref\n / kind\n / place\n / scalar\n / %s\"(\" ws value ws %s\")\"\n\nmap = %s\"{\" ws [ entry *( ws %s\",\" ws entry ) ws ] %s\"}\"\n\nentry = spread / pair\n\n; The template every key of the bag must also satisfy.\nspread = %s\"&\" ws %s\":\" ws value\n\npair = string ws [ %s\"?\" ] ws %s\":\" ws value\n\n; A list ELEMENT is a value, not a pair --- only the template is keyed.\nlist = %s\"[\" ws [ element *( ws %s\",\" ws element ) ws ] %s\"]\"\n\nelement = spread / value\n\n; The builtins, applied. The name set is closed on purpose: an unknown\n; function is a parse-time error in the engine, so a grammar that\n; allowed any name would over-approximate.\nfunc = name %s\"(\" ws [ value *( ws %s\",\" ws value ) ws ] %s\")\"\n\n; ORDER MATTERS where one name is a prefix of another: `refer` is\n; listed before `re`, and `rem` before `re` as well.\nname = %s\"abnf\" / %s\"above\" / %s\"acyclic\" / %s\"add\" / %s\"below\" / %s\"close\"\n / %s\"copyfiles\" / %s\"copy\" / %s\"deprecate\" / %s\"div\"\n / %s\"each\" / %s\"emit\" / %s\"esc\" / %s\"filter\" / %s\"greatest\"\n / %s\"hide\"\n / %s\"inverse\" / %s\"join\" / %s\"key\" / %s\"least\"\n / %s\"length\" / %s\"listitems\" / %s\"list\" / %s\"lower\" / %s\"map\" / %s\"match\"\n / %s\"maybe\" / %s\"max\" / %s\"min\" / %s\"mod\" / %s\"move\"\n / %s\"mul\" / %s\"must\"\n / %s\"neq\"\n / %s\"open\" / %s\"pack\" / %s\"parse\" / %s\"path\" / %s\"pick\" / %s\"pref\"\n / %s\"refer\" / %s\"rel\" / %s\"rem\" / %s\"rep\" / %s\"re\" / %s\"sort\" / %s\"split\"\n / %s\"super\"\n / %s\"content\" / %s\"file\" / %s\"folder\" / %s\"fragment\" / %s\"inject\"\n / %s\"line\" / %s\"nom\" / %s\"project\" / %s\"slot\" / %s\"translate\"\n / %s\"sub\" / %s\"sum\"\n / %s\"type\"\n / %s\"unique\" / %s\"upper\" / %s\"usc\"\n\n; A path reference, absolute from the document root. At least one\n; segment: a bare `$` is an incomplete expression, not a reference.\n; A RELATIVE reference has no `$`: `.n` names a sibling, resolved\n; against the enclosing map rather than the document root. Canon emits\n; one wherever a spread template survives unresolved, so a grammar\n; without it cannot parse this engine's own output. No conflict with\n; `number`: a numeric literal always starts with a digit or `-`.\nref = %s\"$\" 1*( %s\".\" segment ) / 1*( %s\".\" segment )\n\n; No `-`: it is not a bare-text character (test/spec/op-chars.tsv pins\n; `a:6-2` as a parse error), so admitting it would over-approximate.\nsegment = 1*( ALPHA / DIGIT / %s\"_\" )\n\n; The placeholder: a hole a call is filled through. BARE only --- `\"_\"`\n; is an ordinary string, and a longer bare word containing it is\n; ordinary text.\nplace = %s\"_\"\n\n; `biginteger` before `bigdecimal` is not required (they differ at the\n; fourth character), but `biginteger` before `boolean` is: see the\n; ordered-alternation note above.\nkind = %s\"biginteger\" / %s\"bigdecimal\" / %s\"boolean\" / %s\"float\"\n / %s\"integer\" / %s\"number\" / %s\"string\" / %s\"top\" / %s\"nil\"\n\n; `exact` before `number`, or `0d5` would match `number` as the single\n; digit `0` and leave `d5` unconsumed.\nscalar = string / exact / number / %s\"true\" / %s\"false\" / %s\"null\"\n\nstring = DQUOTE *char DQUOTE\n\nchar = unescaped / %x5C escape\n\n; Every code point but the quote and the backslash, which is what the\n; GBNF's `[^\"\\\\]` says. Control characters included: canon writes them\n; escaped, and a grammar that refused them would refuse less than the\n; parser accepts in the one direction this file may not.\nunescaped = %x00-21 / %x23-5B / %x5D-10FFFF\n\nescape = DQUOTE / %x5C / %s\"/\" / %s\"b\" / %s\"f\" / %s\"n\" / %s\"r\"\n / %s\"t\" / %s\"u\" hex hex hex hex\n\nhex = DIGIT / %x41-46 / %x61-66\n\n; The exact leaves: arbitrary precision, spelled with the 0d marker.\nexact = [ %s\"-\" ] %s\"0d\" digits [ %s\".\" digits ] [ exponent ]\n\nnumber = [ %s\"-\" ] digits [ %s\".\" digits ] [ exponent ]\n\nexponent = ( %s\"e\" / %s\"E\" ) [ %s\"-\" / %s\"+\" ] digits\n\ndigits = 1*DIGIT\n\nws = *( %x20 / %x09 / %x0A / %x0D )\n\n; RFC 5234's core rules, written out so this file stands alone.\nALPHA = %x41-5A / %x61-7A\nDIGIT = %x30-39\nDQUOTE = %x22\n"
|
|
35
35
|
}
|
|
36
36
|
];
|
|
37
37
|
exports.HELPDOC = HELPDOC;
|
package/dist/helpdoc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpdoc.js","sourceRoot":"","sources":["../src/helpdoc.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAcpD,MAAM,OAAO,GAAgB;IAC3B;QACE,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,8CAA8C;QACzD,QAAQ,EAAE,qBAAqB;QAC/B,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"helpdoc.js","sourceRoot":"","sources":["../src/helpdoc.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAcpD,MAAM,OAAO,GAAgB;IAC3B;QACE,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,8CAA8C;QACzD,QAAQ,EAAE,qBAAqB;QAC/B,MAAM,EAAE,61KAA61K;KACt2K;IACD;QACE,OAAO,EAAE,UAAU;QACnB,SAAS,EAAE,gEAAgE;QAC3E,QAAQ,EAAE,4BAA4B;QACtC,MAAM,EAAE,iuEAAiuE;KAC1uE;IACD;QACE,OAAO,EAAE,UAAU;QACnB,SAAS,EAAE,sDAAsD;QACjE,QAAQ,EAAE,wBAAwB;QAClC,MAAM,EAAE,uwEAAuwE;KAChxE;IACD;QACE,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,+CAA+C;QAC1D,QAAQ,EAAE,2BAA2B;QACrC,MAAM,EAAE,8mGAA8mG;KACvnG;IACD;QACE,OAAO,EAAE,SAAS;QAClB,SAAS,EAAE,2DAA2D;QACtE,QAAQ,EAAE,oBAAoB;QAC9B,MAAM,EAAE,urNAAurN;KAChsN;CACF,CAAA;QA+BQ,OAAO;AAtBhB,MAAM,OAAO,GAAe;IAC1B;QACE,MAAM,EAAE,2BAA2B;QACnC,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,opBAAopB;KAC7pB;IACD;QACE,MAAM,EAAE,0BAA0B;QAClC,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,2WAA2W;KACpX;IACD;QACE,MAAM,EAAE,0BAA0B;QAClC,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,m+BAAm+B;KAC5+B;CACF,CAAA;QAGiB,OAAO"}
|
package/dist/hints.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error code hints for Aontu unification errors.
|
|
3
|
-
*
|
|
4
|
-
* Each key is an error code that can be passed to makeNilErr.
|
|
5
|
-
* Each value is a human-readable explanation of what the error means.
|
|
6
|
-
*/
|
|
7
1
|
declare const hints: Record<string, string>;
|
|
8
2
|
declare const codeClasses: Record<string, string>;
|
|
9
3
|
declare function codeClass(code: string): string;
|
package/dist/hints.js
CHANGED
|
@@ -3,12 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.codeClasses = exports.hints = void 0;
|
|
5
5
|
exports.codeClass = codeClass;
|
|
6
|
-
/**
|
|
7
|
-
* Error code hints for Aontu unification errors.
|
|
8
|
-
*
|
|
9
|
-
* Each key is an error code that can be passed to makeNilErr.
|
|
10
|
-
* Each value is a human-readable explanation of what the error means.
|
|
11
|
-
*/
|
|
12
6
|
const hints = {
|
|
13
7
|
scalar_value: 'Literal scalar values of the same kind can only unify if they are\n' +
|
|
14
8
|
'exactly equal.' +
|
|
@@ -30,7 +24,6 @@ const hints = {
|
|
|
30
24
|
'there is no single value to generate. Supply a value that selects\n' +
|
|
31
25
|
'one alternative, or write a preference (*) to say which one holds\n' +
|
|
32
26
|
'when nothing else does.',
|
|
33
|
-
// TODO: extend errors to have details so we can name the key
|
|
34
27
|
mapval_required: 'This map value is required.',
|
|
35
28
|
mapval_no_gen: 'This value was present after unification, and cannot be generated\n' +
|
|
36
29
|
'because it is not a literal value.',
|
|
@@ -77,6 +70,25 @@ const hints = {
|
|
|
77
70
|
' must("gold"|"silver","tier") & "lead" -> nil # ... reported\n' +
|
|
78
71
|
' # with "tier";\n' +
|
|
79
72
|
' min(0) & must(integer,"whole") & 3 -> 3 # Bands compose.',
|
|
73
|
+
abnf_grammar: 'This ABNF grammar could not be compiled:\n' +
|
|
74
|
+
'{reason}\n' +
|
|
75
|
+
' \n' +
|
|
76
|
+
'abnf() takes RFC 5234 ABNF -- `=` and `/`, not `::=`. The\n' +
|
|
77
|
+
'compiler reports the first thing it could not read; a rule\n' +
|
|
78
|
+
'referenced but never defined is the usual cause, after a\n' +
|
|
79
|
+
'quantifier written the EBNF way.',
|
|
80
|
+
parse_arg: 'parse(grammar, text) takes two strings: a grammar, normally the\n' +
|
|
81
|
+
'answer of an abnf() call, and the text to parse.\n' +
|
|
82
|
+
' \n' +
|
|
83
|
+
'Examples:\n' +
|
|
84
|
+
' G: abnf("v = 1*DIGIT")\n' +
|
|
85
|
+
' a: parse($.G, "12") # the AST\n' +
|
|
86
|
+
' b: parse($.G, 12) # parse_arg: the text is not a string',
|
|
87
|
+
parse_failed: 'The text does not parse under this grammar:\n' +
|
|
88
|
+
'{reason}\n' +
|
|
89
|
+
' \n' +
|
|
90
|
+
'A failure to parse is a failure to unify, so the field is\n' +
|
|
91
|
+
'refused rather than set to a value meaning "no".',
|
|
80
92
|
constraint_pattern: 'This re() pattern is outside the supported subset. It uses\n' +
|
|
81
93
|
'{reason}.\n' +
|
|
82
94
|
' \n' +
|
|
@@ -143,6 +155,9 @@ const hints = {
|
|
|
143
155
|
refer_unresolved: 'A refer() address names no node in this evaluation. Within one\nevaluation the document-set is fixed, so a link to nothing is an error\nrather than something to resolve later: check the spelling, or add the\nnode it was meant to reach. A relative address that climbs off the top\nof the tree lands here too.\n \nExamples:\n a:{p:1} b:refer()&"$.a" -> "$.a" # $.a is a node;\n a:{p:1} b:refer()&"$.a.p" -> "$.a.p" # ... and so is a node inside it;\n b:refer()&"$.nope" -> nil # ... but nothing is here.',
|
|
144
156
|
view_relation_unknown: 'The relation named to the view has no edges in this document, so\nthe figure would be empty -- and an empty figure and a misspelled name are\nthe same file on disk. Check the spelling against the relations the\nnote lists, or drop the relation to draw every relation at once.',
|
|
145
157
|
view_kind_unknown: 'The figure kind is not one the verb draws. The kinds are tree, matrix,\ngraph, layer, sets, layers, ladder and poset; the note lists them.',
|
|
158
|
+
// RETIRED with the `render` verb (ADR-038). Registered still,
|
|
159
|
+
// errcodes.tsv being append-only, so a code a released engine raised
|
|
160
|
+
// keeps its meaning.
|
|
146
161
|
render_path: 'A unit path is written below the output directory: relative, with no\n`..` segment, and no two units the same. Rename the unit.',
|
|
147
162
|
render_lang: 'A text escape carries verbatim syntax of ONE language, and it must be\nthe unit\'s: a text of another language in this unit would be written\nas if it were this one. Move it to a unit of its own language.',
|
|
148
163
|
render_profile: 'Only fragments and text escapes render without a lowering, under the\ntext profile. A record, enum, alias, const or func needs a profile\nwhose language has one (typescript, go): set the unit\'s lang, or\nwrite the declaration as a fragment.',
|
|
@@ -150,15 +165,6 @@ const hints = {
|
|
|
150
165
|
render_unit: 'The unit asked for is not in the instance. The report names the\npath; the units are listed by `--format json`.',
|
|
151
166
|
view_profile_unknown: 'The figure kind does not render into the profile asked for: there is no\ntext form of a node-link drawing and no Mermaid form of a matrix. The\nnote lists the profiles the kind declares; the first is its default.',
|
|
152
167
|
format_check: 'The formatted text is not the same document, so nothing was written.\nThis is a formatter defect: please report it, with the source.',
|
|
153
|
-
// THIS PORT NEVER RAISES decimal_syntax -- Go's construct.go does,
|
|
154
|
-
// and go/hints.go's header records that the CODE is Go-only. The
|
|
155
|
-
// TEXT is here anyway, verbatim, because since G11 phase 3 this
|
|
156
|
-
// table is a LOOKUP surface as well as a message source: the code is
|
|
157
|
-
// in the shared registry (test/spec/errcodes.tsv), so
|
|
158
|
-
// `aontu explain decimal_syntax` must answer the same in both ports
|
|
159
|
-
// or the agent that met the error under one binary learns nothing
|
|
160
|
-
// from the other. An entry for a code this port cannot raise is
|
|
161
|
-
// never read on an error path, only on that lookup.
|
|
162
168
|
decimal_syntax: 'This 0d literal is not a valid exact number.',
|
|
163
169
|
view_style_profile: 'Each profile has ONE way to carry the meaning of a figure\'s marks:\nSGR escapes for text, CSS classes for svg. Asking for the other one is\na usage error rather than a silent no-op. `none` works everywhere.',
|
|
164
170
|
view_style_unknown: 'The styles are none, ansi and css, plus `auto` at the command line,\nwhich the command resolves before the library runs: whether the\ndestination is a terminal is not something a library can see.',
|
|
@@ -247,6 +253,35 @@ const hints = {
|
|
|
247
253
|
' pick([{a:1},{a:2}], a) -> [1,2] # Every child has it;\n' +
|
|
248
254
|
' pick([{a:1},{b:2}], a) -> nil # ... the second does not;\n' +
|
|
249
255
|
' pick([[9],[8]], 0) -> [9,8] # A list child takes an index.',
|
|
256
|
+
sort_key: 'A child of this bag has no key `{key}` to order by. Ordering\n' +
|
|
257
|
+
'refuses rather than skipping, for the reason `pick` does: a\n' +
|
|
258
|
+
'shorter list orders a DIFFERENT set of records than the one the\n' +
|
|
259
|
+
'author named. Give every child the key, or filter the bag first.\n' +
|
|
260
|
+
' \n' +
|
|
261
|
+
'Examples:\n' +
|
|
262
|
+
' sort([{a:2},{a:1}], a) -> [{a:1},{a:2}] # Every child has it;\n' +
|
|
263
|
+
' sort([{a:1},{b:2}], a) -> nil # ... the second does not;\n' +
|
|
264
|
+
' sort([[9],[8]], 0) -> [[8],[9]] # A list child takes an index.',
|
|
265
|
+
sort_domain: 'This bag cannot be ordered: `{member}`. There are two orders and no\n' +
|
|
266
|
+
'third -- text by code point, numbers by the exact comparator -- so a\n' +
|
|
267
|
+
'bag that mixes them, or holds a boolean, a null or a container, has\n' +
|
|
268
|
+
'no order to be put in. Project a field that is all one kind, or\n' +
|
|
269
|
+
'filter the bag first.\n' +
|
|
270
|
+
' \n' +
|
|
271
|
+
'Examples:\n' +
|
|
272
|
+
' sort([3,1,2]) -> [1,2,3] # All numbers;\n' +
|
|
273
|
+
' sort([b,a]) -> ["a","b"] # ... or all text;\n' +
|
|
274
|
+
' sort([1,a]) -> nil # ... never both.',
|
|
275
|
+
sort_dir: 'A sort direction names no direction: `{dir}`. The third argument is\n' +
|
|
276
|
+
'`asc` or `desc`, and omitting it is `asc`. The second argument is\n' +
|
|
277
|
+
'the field to order by, so a keyless descending sort writes the\n' +
|
|
278
|
+
'empty projector: the member itself.\n' +
|
|
279
|
+
' \n' +
|
|
280
|
+
'Examples:\n' +
|
|
281
|
+
' sort($.rows, n) # Ascending by field `n`;\n' +
|
|
282
|
+
' sort($.rows, n, desc) # ... descending;\n' +
|
|
283
|
+
' sort($.tags) # The members themselves, ascending;\n' +
|
|
284
|
+
' sort($.tags, "", desc) # ... descending.',
|
|
250
285
|
join_member: 'A member of this bag is not text and never will be: `{member}`.\n' +
|
|
251
286
|
'`join` folds with `+` seeded with the empty string, and `+` with a\n' +
|
|
252
287
|
'string on the left RESIDUATES on a map, a list or a null rather\n' +
|
|
@@ -357,8 +392,6 @@ const hints = {
|
|
|
357
392
|
// Junction errors (disjunction/conjection)
|
|
358
393
|
'empty': 'Empty disjunction. The disjunction has no valid alternatives.',
|
|
359
394
|
'empty-dist': 'Empty disjunction distribution. All alternatives in the disjunction are invalid.',
|
|
360
|
-
// ADR-011 R2: two DEFAULTS of equal rank that cannot agree. The
|
|
361
|
-
// fix is a rank, so the hint names it.
|
|
362
395
|
'pref_rank_clash': 'Two defaults of the same rank disagree.' +
|
|
363
396
|
' Rank one of them (`**x`) to say which is the weaker layer,' +
|
|
364
397
|
' or give them the same value.',
|
|
@@ -380,15 +413,6 @@ const hints = {
|
|
|
380
413
|
'op[': 'Operator value error: ',
|
|
381
414
|
};
|
|
382
415
|
exports.hints = hints;
|
|
383
|
-
// codeClasses assigns every error code a CLASS: conflict | incomplete |
|
|
384
|
-
// reference | parse | budget | internal. The contract lives in
|
|
385
|
-
// test/spec/errcodes.tsv (mode `errcode`): the spec suite executes one
|
|
386
|
-
// row per code against this table and asserts SET EQUALITY between the
|
|
387
|
-
// file and these keys, in both implementations (go/hints.go mirrors
|
|
388
|
-
// this map exactly). Codes are append-only and never renamed; a class
|
|
389
|
-
// change is a breaking change. Class rulings (why decimal_budget and
|
|
390
|
-
// lossy_integer_literal are conflict, not budget; why unknown_function
|
|
391
|
-
// is reference) are documented in the tsv header.
|
|
392
416
|
const codeClasses = {
|
|
393
417
|
// parse -- the source text is malformed or unusable
|
|
394
418
|
parse: 'parse',
|
|
@@ -420,10 +444,6 @@ const codeClasses = {
|
|
|
420
444
|
patch_not_editable: 'reference',
|
|
421
445
|
patch_ambiguous: 'reference',
|
|
422
446
|
patch_span_mismatch: 'internal',
|
|
423
|
-
// G4 phase 2 -- the checked link: a string that is not a tree
|
|
424
|
-
// address (class `parse`, the text is wrong), and an address that
|
|
425
|
-
// names nothing in this evaluation (class `reference`, the same
|
|
426
|
-
// class as `no_path`, because it is the same kind of miss).
|
|
427
447
|
refer_address: 'parse',
|
|
428
448
|
rel_address: 'parse',
|
|
429
449
|
refer_unresolved: 'reference',
|
|
@@ -460,10 +480,6 @@ const codeClasses = {
|
|
|
460
480
|
// tree address, met by path()'s capture or promotion. The same
|
|
461
481
|
// class as refer_address, because it is the same mistake.
|
|
462
482
|
path_address: 'parse',
|
|
463
|
-
// G8 phase 1 -- the generation combinators. All three are class
|
|
464
|
-
// `parse`: what is wrong is the CALL as written (data that is not a
|
|
465
|
-
// bag, a list element that is not a name), not any pair of values a
|
|
466
|
-
// meet brought together.
|
|
467
483
|
pack_data: 'parse',
|
|
468
484
|
pack_key: 'parse',
|
|
469
485
|
each_data: 'parse',
|
|
@@ -474,41 +490,21 @@ const codeClasses = {
|
|
|
474
490
|
// meet, reported once for the whole form.
|
|
475
491
|
filter_data: 'parse',
|
|
476
492
|
match_none: 'conflict',
|
|
477
|
-
// G9 phase 6 -- the string builtins. All five are class `parse`:
|
|
478
|
-
// what is wrong is the CALL as written -- a variant that names no
|
|
479
|
-
// convention, a pattern outside the subset, a substitution naming a
|
|
480
|
-
// group that does not exist, a separator that is neither string nor
|
|
481
|
-
// pattern. `usc_malformed` is the odd one and still `parse`: the
|
|
482
|
-
// TEXT the call was given has no inverse, which is a fact about the
|
|
483
|
-
// argument rather than about any meet.
|
|
484
493
|
esc_variant: 'parse',
|
|
485
494
|
usc_malformed: 'parse',
|
|
486
495
|
rep_pattern: 'parse',
|
|
487
496
|
rep_sub: 'parse',
|
|
488
497
|
split_sep: 'parse',
|
|
489
|
-
// G9 phase 6 -- apply-templates. The four shape codes are class
|
|
490
|
-
// `parse`: what is wrong is the CALL as written -- a selection with
|
|
491
|
-
// no children, a table that is not one, a rule missing a half.
|
|
492
|
-
// `emit_none` is class `conflict` for `match_none`'s reason: the
|
|
493
|
-
// node and every pattern written for it disagreed.
|
|
494
498
|
emit_data: 'parse',
|
|
495
499
|
emit_table: 'parse',
|
|
496
500
|
emit_template: 'parse',
|
|
497
501
|
emit_body: 'parse',
|
|
498
502
|
emit_none: 'conflict',
|
|
499
503
|
emit_ref: 'conflict',
|
|
500
|
-
// RENDER P6 -- `replace` on a template, and `form`. The two
|
|
501
|
-
// template checks are class `parse`: what is wrong is the TEMPLATE
|
|
502
|
-
// as written, before any node. `replace_value` is class `conflict`:
|
|
503
|
-
// the node's value and the body that wanted text disagreed.
|
|
504
|
-
// `form_data` is `each_data`'s retired twin (ADR-027).
|
|
505
504
|
replace_overlap: 'parse',
|
|
506
505
|
replace_unused: 'parse',
|
|
507
506
|
replace_value: 'conflict',
|
|
508
507
|
form_data: 'parse',
|
|
509
|
-
// G8 phase 3 -- the placeholder. Class `conflict`: two values met
|
|
510
|
-
// and neither could answer for the other, which is what every
|
|
511
|
-
// conflict is.
|
|
512
508
|
place_pair: 'conflict',
|
|
513
509
|
// G6 phase 2 -- modules. Both are class `parse`: a module import is
|
|
514
510
|
// resolved while the source is READ, and neither a module that is
|
|
@@ -546,6 +542,9 @@ const codeClasses = {
|
|
|
546
542
|
constraint: 'conflict',
|
|
547
543
|
must: 'conflict',
|
|
548
544
|
constraint_pattern: 'conflict',
|
|
545
|
+
abnf_grammar: 'parse',
|
|
546
|
+
parse_arg: 'parse',
|
|
547
|
+
parse_failed: 'conflict',
|
|
549
548
|
scalar_value: 'conflict',
|
|
550
549
|
scalar_kind: 'conflict',
|
|
551
550
|
no_scalar_unify: 'conflict',
|
|
@@ -563,6 +562,9 @@ const codeClasses = {
|
|
|
563
562
|
exact_float_mix: 'conflict',
|
|
564
563
|
inexact_integer_sum: 'conflict',
|
|
565
564
|
pick_key: 'conflict',
|
|
565
|
+
sort_key: 'conflict',
|
|
566
|
+
sort_domain: 'conflict',
|
|
567
|
+
sort_dir: 'parse',
|
|
566
568
|
aggregate_data: 'conflict',
|
|
567
569
|
aggregate_empty: 'conflict',
|
|
568
570
|
join_member: 'conflict',
|
package/dist/hints.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hints.js","sourceRoot":"","sources":["../src/hints.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;QA6xBlD,SAAS;AA3xBX;;;;;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,sB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ED
|
@@ -3,34 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.jsonSchema = jsonSchema;
|
|
4
4
|
/* Copyright (c) 2025 Richard Rodger, MIT License */
|
|
5
5
|
const utility_1 = require("./utility");
|
|
6
|
-
// JSON SCHEMA EXPORT (the review's finding I / SUPPORT.md act 2).
|
|
7
|
-
//
|
|
8
|
-
// "JSON Schema's decisive 2026 advantage is not its validator ecosystem
|
|
9
|
-
// -- it is that every major LLM provider's structured-output API
|
|
10
|
-
// natively constrains generation to JSON Schema." Without an export,
|
|
11
|
-
// Aontu cannot ride that path and then apply `vet` as the semantic gate
|
|
12
|
-
// -- the hybrid an enterprise would actually deploy -- and an MCP tool's
|
|
13
|
-
// `inputSchema`, which the protocol REQUIRES to be JSON Schema, cannot
|
|
14
|
-
// be derived from an Aontu tool model at all (use case 09's interop
|
|
15
|
-
// wall).
|
|
16
|
-
//
|
|
17
|
-
// THE MAPPING IS LOSSY, AND SAYS SO PER CONSTRUCT. That is the whole
|
|
18
|
-
// design. Aontu's constraint algebra maps cleanly onto JSON Schema's
|
|
19
|
-
// core -- bounds, patterns, lengths, enums, required and closed -- and
|
|
20
|
-
// then stops: an evaluate-only `must()` is opaque by construction, an
|
|
21
|
-
// exact `0d` leaf has no JSON type that preserves it, a cross-field
|
|
22
|
-
// reference is not a property constraint at all, and `unique(k)` has no
|
|
23
|
-
// JSON Schema spelling. A converter that dropped those silently would
|
|
24
|
-
// hand its caller a schema that ADMITS MORE than the model does, which
|
|
25
|
-
// is the failure mode this whole language exists to refuse. So every
|
|
26
|
-
// loss is reported with its path, its construct and its reason, and
|
|
27
|
-
// `--strict` turns the report into a refusal.
|
|
28
|
-
//
|
|
29
|
-
// It exports the UNIFIED value, not the parse: what a document MEANS is
|
|
30
|
-
// what a consumer should be constrained to, and the meaning is what the
|
|
31
|
-
// fixpoint produced.
|
|
32
|
-
//
|
|
33
|
-
// Draft 2020-12, because that is what the structured-output APIs read.
|
|
34
6
|
const aontu_1 = require("./aontu");
|
|
35
7
|
const err_1 = require("./err");
|
|
36
8
|
const BagVal_1 = require("./val/BagVal");
|
|
@@ -43,11 +15,6 @@ function pathText(path) {
|
|
|
43
15
|
function lose(ctx, path, construct, reason) {
|
|
44
16
|
ctx.lossy.push({ path: pathText(path), construct, reason });
|
|
45
17
|
}
|
|
46
|
-
// The JSON type for a kind marker, by the marker CLASS's name -- the
|
|
47
|
-
// same load-bearing name canon renders (ScalarKindVal). `number` and
|
|
48
|
-
// its four leaves all become JSON's two numeric types; the exactness of
|
|
49
|
-
// `biginteger`/`bigdecimal` has no JSON type at all, which is a loss the
|
|
50
|
-
// caller is told about rather than a silent widening.
|
|
51
18
|
const KIND_TYPE = {
|
|
52
19
|
String: 'string',
|
|
53
20
|
Boolean: 'boolean',
|
|
@@ -56,15 +23,8 @@ const KIND_TYPE = {
|
|
|
56
23
|
Float: 'number',
|
|
57
24
|
BigDecimal: 'number',
|
|
58
25
|
Number: 'number',
|
|
59
|
-
// A path value is its address string at the JSON boundary
|
|
60
|
-
// (docs/design/PATHS.0.md), so the projection says `string` -- the
|
|
61
|
-
// same lossy-projection rule the exact numeric leaves follow.
|
|
62
26
|
Path: 'string',
|
|
63
27
|
};
|
|
64
|
-
// The JSON value of a concrete scalar, for `const`, `enum` and
|
|
65
|
-
// `default`. An exact leaf renders through its own digits rather than
|
|
66
|
-
// through binary64 -- and is reported as a loss where it is emitted,
|
|
67
|
-
// because JSON's number has no exactness to receive it.
|
|
68
28
|
function scalarJson(v) {
|
|
69
29
|
if (v.isBigInteger) {
|
|
70
30
|
return Number(v.peg);
|
|
@@ -84,9 +44,6 @@ function scalarType(v) {
|
|
|
84
44
|
const t = typeof v.peg;
|
|
85
45
|
return 'number' === t ? 'number' : 'boolean' === t ? 'boolean' : 'string';
|
|
86
46
|
}
|
|
87
|
-
// The constraint residual's atoms, onto JSON Schema's keywords. The
|
|
88
|
-
// three that map exactly (bounds, pattern, count) go across; the two
|
|
89
|
-
// that cannot (`must`, `unique(k)`) are reported.
|
|
90
47
|
function fromConstraint(ctx, path, c) {
|
|
91
48
|
const out = {};
|
|
92
49
|
if (null != c.kind && null != KIND_TYPE[c.kind.name]) {
|
|
@@ -98,9 +55,6 @@ function fromConstraint(ctx, path, c) {
|
|
|
98
55
|
else if ('number' === c.domain) {
|
|
99
56
|
out.type = 'number';
|
|
100
57
|
}
|
|
101
|
-
// Bounds. An OPEN endpoint is JSON Schema's exclusive form, which is
|
|
102
|
-
// a keyword of its own in 2020-12 rather than the boolean flag draft-4
|
|
103
|
-
// used.
|
|
104
58
|
if (null != c.lo) {
|
|
105
59
|
out[c.lo.open ? 'exclusiveMinimum' : 'minimum'] = scalarJson(c.lo.v);
|
|
106
60
|
}
|
|
@@ -112,21 +66,12 @@ function fromConstraint(ctx, path, c) {
|
|
|
112
66
|
if (0 < c.neqs.length) {
|
|
113
67
|
out.not = { enum: c.neqs.map(scalarJson) };
|
|
114
68
|
}
|
|
115
|
-
// Patterns. Aontu DEFINES its portable subset (`re`'s abbreviations
|
|
116
|
-
// mean the same in both ports); every member of that subset is also
|
|
117
|
-
// an ECMA-262 regular expression, which is what JSON Schema's
|
|
118
|
-
// `pattern` is read as, so this crosses without translation. More
|
|
119
|
-
// than one pattern needs `allOf`: `pattern` is a single keyword.
|
|
120
69
|
if (1 === c.res.length) {
|
|
121
70
|
out.pattern = c.res[0].src;
|
|
122
71
|
}
|
|
123
72
|
else if (1 < c.res.length) {
|
|
124
73
|
out.allOf = c.res.map((r) => ({ pattern: r.src }));
|
|
125
74
|
}
|
|
126
|
-
// A COUNT is a length or a size depending on what is counted, and the
|
|
127
|
-
// residual does not always know which. Where the domain says string,
|
|
128
|
-
// it is minLength/maxLength; otherwise the container keywords, since
|
|
129
|
-
// a count atom on a container is what `length` overwhelmingly means.
|
|
130
75
|
if (null != c.count) {
|
|
131
76
|
const lo = null == c.count.lo ? undefined : scalarJson(c.count.lo.v);
|
|
132
77
|
const hi = null == c.count.hi ? undefined : scalarJson(c.count.hi.v);
|
|
@@ -157,28 +102,6 @@ function fromConstraint(ctx, path, c) {
|
|
|
157
102
|
}
|
|
158
103
|
return out;
|
|
159
104
|
}
|
|
160
|
-
// The exporter proper. Every arm answers a schema; the ones that cannot
|
|
161
|
-
// answer honestly report a loss and fall back to `{}`, which admits
|
|
162
|
-
// anything -- the safe direction for a document that will be checked
|
|
163
|
-
// again by `vet`, and the direction the loss report exists to make
|
|
164
|
-
// visible.
|
|
165
|
-
// NO DEFENSIVE GUARD ON `v`. Every caller walks a bag's own children
|
|
166
|
-
// and a bag holds Vals, so a non-Val here is not a degenerate input,
|
|
167
|
-
// it is a bug in this file -- and an unreachable `if` is a branch arm
|
|
168
|
-
// the ADR-002 gate counts and no `node:coverage ignore` suppresses
|
|
169
|
-
// (the marker drops LINES, not branches). Go's twin keeps its `nil ==
|
|
170
|
-
// v` arm because a missing map key there yields a typed nil rather
|
|
171
|
-
// than an absent property.
|
|
172
|
-
// DEPRECATION IS AN ANNOTATION, and 2020-12 has one: `deprecated`.
|
|
173
|
-
// The export used to drop the whole record in SILENCE -- no keyword,
|
|
174
|
-
// and no loss line even under --strict -- which is the one thing the
|
|
175
|
-
// verb's own contract says it never does (use-cases/BUGS.md §56).
|
|
176
|
-
//
|
|
177
|
-
// The boolean crosses faithfully. The record's STRINGS (msg, use,
|
|
178
|
-
// since) have no home in 2020-12, so they are reported as a loss
|
|
179
|
-
// rather than invented into `description`: this exporter emits no
|
|
180
|
-
// `description` anywhere, and quietly making it mean "deprecation
|
|
181
|
-
// note" would be a mapping a consumer cannot undo.
|
|
182
105
|
function fromVal(ctx, path, v) {
|
|
183
106
|
const out = fromValInner(ctx, path, v);
|
|
184
107
|
const dep = v?.deprecation;
|
|
@@ -194,16 +117,8 @@ function fromVal(ctx, path, v) {
|
|
|
194
117
|
}
|
|
195
118
|
return out;
|
|
196
119
|
}
|
|
197
|
-
// The record's text keys -- the ones with nothing to carry them.
|
|
198
|
-
// `DEPRECATION_KEYS` in DeprecateFuncVal.ts is the authority on what a
|
|
199
|
-
// record may hold; this is that list, and a key added there without a
|
|
200
|
-
// JSON Schema home belongs here too.
|
|
201
120
|
const DEPRECATION_TEXT = ['msg', 'use', 'since'];
|
|
202
121
|
function fromValInner(ctx, path, v) {
|
|
203
|
-
// A preference is its inner value plus a DEFAULT. JSON Schema's
|
|
204
|
-
// `default` is annotation rather than constraint -- it does not
|
|
205
|
-
// validate -- which is exactly what a preference is when something
|
|
206
|
-
// else supplies the value.
|
|
207
122
|
if (true === v.isPref) {
|
|
208
123
|
const inner = fromVal(ctx, path, v.peg);
|
|
209
124
|
const gen = generated(v.peg);
|
|
@@ -215,12 +130,6 @@ function fromValInner(ctx, path, v) {
|
|
|
215
130
|
if (true === v.isConstraint) {
|
|
216
131
|
return fromConstraint(ctx, path, v);
|
|
217
132
|
}
|
|
218
|
-
// A SIZING RESIDUE is a container and its own sizing atom, kept
|
|
219
|
-
// together because more members could still change the atom's reading
|
|
220
|
-
// (use-cases/BUGS.md §16). Both halves are exportable and both must
|
|
221
|
-
// be: the container gives the shape, the atom gives `uniqueItems` and
|
|
222
|
-
// the length keywords, and a walk that saw only "a conjunct" would
|
|
223
|
-
// report the whole field as unresolved and admit anything.
|
|
224
133
|
const residue = (0, BagVal_1.sizingResidue)(v);
|
|
225
134
|
if (undefined !== residue) {
|
|
226
135
|
return {
|
|
@@ -241,10 +150,6 @@ function fromValInner(ctx, path, v) {
|
|
|
241
150
|
'this leaf exists for cannot be carried; the schema says ' +
|
|
242
151
|
'"' + t + '" and a consumer may round');
|
|
243
152
|
}
|
|
244
|
-
// KIND_TYPE is TOTAL over the kinds a marker can carry, so there is
|
|
245
|
-
// no miss to fall back from -- and a fallback that cannot be taken
|
|
246
|
-
// is a branch arm the coverage gate counts. Go's twin keeps its
|
|
247
|
-
// empty-map arm, which its own ignore mechanism can carry.
|
|
248
153
|
return { type: t };
|
|
249
154
|
}
|
|
250
155
|
if (true === v.isNull) {
|
|
@@ -260,9 +165,6 @@ function fromValInner(ctx, path, v) {
|
|
|
260
165
|
}
|
|
261
166
|
return { const: scalarJson(v), type: scalarType(v) };
|
|
262
167
|
}
|
|
263
|
-
// Everything else is residue: a reference that did not resolve, a
|
|
264
|
-
// function or operator still waiting, a nil. None of them is a
|
|
265
|
-
// property constraint, and guessing one would be inventing a promise.
|
|
266
168
|
lose(ctx, path, residueName(v), 'this is not a value yet, so there is nothing to constrain a ' +
|
|
267
169
|
'consumer to; the schema admits anything here');
|
|
268
170
|
return {};
|
|
@@ -277,19 +179,11 @@ function residueName(v) {
|
|
|
277
179
|
// generate. Used for `default` and for `enum` members: both are VALUES
|
|
278
180
|
// in the schema, so a member that is itself a shape has none to give.
|
|
279
181
|
function generated(v) {
|
|
280
|
-
// No try/catch: a collecting context RECORDS a failed generation on
|
|
281
|
-
// itself instead of throwing, which is the whole point of the mode.
|
|
282
|
-
// Neither `vet` nor the Go twin (`schemaGenerated`) wraps this
|
|
283
|
-
// either, and an untakeable catch is a branch arm the gate counts.
|
|
284
182
|
const a0 = new aontu_1.Aontu();
|
|
285
183
|
const ctx = a0.ctx({ collect: true });
|
|
286
184
|
const out = v.gen(ctx);
|
|
287
185
|
return 0 === ctx.err.length ? out : undefined;
|
|
288
186
|
}
|
|
289
|
-
// A disjunction of CONCRETE members is an enum -- the shape a
|
|
290
|
-
// structured-output API constrains best. Anything else is `anyOf`. A
|
|
291
|
-
// preferred member contributes the `default` either way, which is how
|
|
292
|
-
// `*"a"|"b"|"c"` reaches a provider as a defaulted enum.
|
|
293
187
|
function fromDisjunct(ctx, path, v) {
|
|
294
188
|
const members = v.peg;
|
|
295
189
|
let def = undefined;
|
|
@@ -367,8 +261,6 @@ function fromList(ctx, path, v) {
|
|
|
367
261
|
}
|
|
368
262
|
return out;
|
|
369
263
|
}
|
|
370
|
-
// A written list literal is a TUPLE: position by position, and no
|
|
371
|
-
// more. 2020-12 spells that `prefixItems` plus `items: false`.
|
|
372
264
|
return {
|
|
373
265
|
type: 'array',
|
|
374
266
|
prefixItems: els.map((el, i) => fromVal(ctx, [...path, String(i)], el)),
|
|
@@ -380,12 +272,6 @@ function fromList(ctx, path, v) {
|
|
|
380
272
|
function jsonSchema(src, options) {
|
|
381
273
|
const opts = options ?? {};
|
|
382
274
|
const aontu = new aontu_1.Aontu((0, utility_1.includeOpts)(opts));
|
|
383
|
-
// COLLECT MODE, so a syntax error arrives on the context rather than
|
|
384
|
-
// as a throw -- the same failure Go's `parseEntry` hands back as an
|
|
385
|
-
// error, reached by the branch below. No try/catch here for the same
|
|
386
|
-
// reason `vet` has none: the mode exists so the failure can be
|
|
387
|
-
// reported rather than escape, and a catch that cannot be entered is
|
|
388
|
-
// a branch arm the ADR-002 gate counts.
|
|
389
275
|
const actx = aontu.ctx({ collect: true });
|
|
390
276
|
const root = aontu.unify(src, { path: opts.path, collect: true }, actx);
|
|
391
277
|
// A nil root always arrives with its reason collected beside it, which
|