aontu 0.61.0 → 0.63.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 +4 -4
- package/dist/agentsmd.d.ts +1 -0
- package/dist/agentsmd.js +7 -28
- package/dist/agentsmd.js.map +1 -1
- package/dist/alias.js.map +1 -1
- package/dist/allow.d.ts +23 -0
- package/dist/allow.js +138 -0
- package/dist/allow.js.map +1 -0
- package/dist/aontu.d.ts +4 -2
- package/dist/aontu.js +4 -80
- package/dist/aontu.js.map +1 -1
- package/dist/aontumodel.d.ts +4 -0
- package/dist/aontumodel.js +33 -0
- package/dist/aontumodel.js.map +1 -0
- package/dist/cli.d.ts +10 -1
- package/dist/cli.js +877 -479
- 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 +55 -189
- 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.d.ts +16 -0
- package/dist/helpdoc.js +59 -0
- package/dist/helpdoc.js.map +1 -0
- package/dist/hints.d.ts +0 -6
- package/dist/hints.js +59 -47
- 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 +32 -877
- package/dist/lang.js.map +1 -1
- package/dist/lower.d.ts +3 -0
- package/dist/lower.js +14 -61
- package/dist/lower.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 -113
- package/dist/mcp.js.map +1 -1
- package/dist/mod-tool.js +0 -130
- 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/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.d.ts +2 -0
- package/dist/relation.js +3 -58
- package/dist/relation.js.map +1 -1
- package/dist/render.js +33 -143
- package/dist/render.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/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 +12 -242
- 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 +20 -0
- package/dist/val/CmpFuncVal.js +188 -0
- package/dist/val/CmpFuncVal.js.map +1 -0
- 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.d.ts +1 -2
- package/dist/val/EachFuncVal.js +12 -29
- 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 +11 -6
- 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 +2 -36
- package/dist/val/NilVal.js.map +1 -1
- package/dist/val/NomFuncVal.d.ts +12 -0
- package/dist/val/NomFuncVal.js +153 -0
- package/dist/val/NomFuncVal.js.map +1 -0
- 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 +0 -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.d.ts +12 -0
- package/dist/val/TranslateFuncVal.js +99 -0
- package/dist/val/TranslateFuncVal.js.map +1 -0
- package/dist/val/UpperFuncVal.js +11 -6
- 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.d.ts +3 -0
- package/dist/val/caserange.js +49 -0
- package/dist/val/caserange.js.map +1 -0
- 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.d.ts +12 -0
- package/dist/vet.js +159 -412
- 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 +9 -7
- package/grammar/aontu.gbnf +5 -5
- package/grammar/aontu.lark +5 -5
- package/grammar/aontu.tmLanguage.json +1 -1
- package/package.json +4 -2
- package/skill/SKILL.md +8 -0
- package/skill/init/check.sh +28 -0
- package/skill/init/data.aon +12 -0
- package/skill/init/model.aon +19 -0
- package/skill/tasks.md +151 -0
- package/src/agentsmd.ts +8 -32
- package/src/alias.ts +0 -39
- package/src/allow.ts +221 -0
- package/src/aontu.ts +10 -108
- package/src/aontumodel.ts +32 -0
- package/src/cli.ts +1009 -540
- 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 +63 -234
- package/src/grammar.ts +72 -0
- package/src/graph.ts +0 -61
- package/src/hcanon.ts +0 -82
- package/src/helpdoc.ts +77 -0
- package/src/hints.ts +72 -49
- package/src/jsonschema.ts +0 -123
- package/src/keyorder.ts +0 -42
- package/src/lang.ts +39 -895
- package/src/lower.ts +15 -65
- 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 -130
- package/src/mod-tool.ts +0 -158
- package/src/mod.ts +0 -178
- package/src/patch.ts +0 -232
- package/src/provenance.ts +0 -183
- package/src/query.ts +0 -84
- package/src/reach.ts +0 -53
- package/src/relation.ts +7 -71
- package/src/render.ts +33 -180
- 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/trim.ts +0 -53
- package/src/type.ts +2 -45
- package/src/unify.ts +13 -251
- 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 +249 -0
- 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 +12 -53
- 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 +12 -7
- 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 +2 -36
- package/src/val/NomFuncVal.ts +200 -0
- 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 +0 -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 +132 -0
- package/src/val/UpperFuncVal.ts +12 -7
- 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 +53 -0
- 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 +209 -504
- package/src/view.ts +0 -507
- package/src/walk.ts +0 -41
- package/dist/std.d.ts +0 -3
- package/dist/std.js +0 -637
- package/dist/std.js.map +0 -1
- package/dist/val/FormFuncVal.js +0 -55
- package/dist/val/FormFuncVal.js.map +0 -1
- package/src/std.ts +0 -648
- package/src/val/FormFuncVal.ts +0 -119
package/dist/helpdoc.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Copyright (c) 2025 Richard Rodger, MIT License */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.INITDOC = exports.HELPDOC = void 0;
|
|
5
|
+
const HELPDOC = [
|
|
6
|
+
{
|
|
7
|
+
"topic": "tasks",
|
|
8
|
+
"summary": "what do you want to do? — the verb for a job",
|
|
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## Check code against a model\n\n```\naontu render --check src/ --profile go.aon model.aon\n```\n\n`render` writes code from the model; `--check` writes nothing and\nlists what on disk differs from what the model implies. That is the\ngate: the model is the truth, the code is the claim, and drift is a\nfinding. `--coverage` reports the other direction — model paths no\noutput consumed, and rendered declarations no rule produced.\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
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"topic": "language",
|
|
14
|
+
"summary": "the grammar card — everything the language spells, on one page",
|
|
15
|
+
"source": "docs/skill/grammar-card.md",
|
|
16
|
+
"text": "# aontu grammar card\n\nEverything the language spells, on one page. The published machine\ngrammars are [`grammar/aontu.abnf`](../../grammar/aontu.abnf) — the\nnotation a person reads, with railroad diagrams — and\n[`aontu.gbnf`](../../grammar/aontu.gbnf), `aontu.lark` and\n`aontu.tmLanguage.json` for constrained decoding, parsing and\nhighlighting; this is their human twin.\n\n## Values\n\n| Write | Means |\n|-------|-------|\n| `{\"a\":1}`, `a: 1` | a map; keys may be bare or quoted |\n| `[1,2]` | a list |\n| `\"s\"`, `1`, `1.5`, `true`, `null` | scalars, as JSON |\n| `0d9007199254740993` | an EXACT number, at any magnitude |\n| `string integer number float boolean null` | kinds: any value of that kind |\n| `top` | anything at all; `nil` is the failure |\n\n## Combining\n\n| Write | Means |\n|-------|-------|\n| `a & b` | both must hold — the meet |\n| `a \\| b` | either may hold — the join |\n| `*1 \\| integer` | either, with `1` the DEFAULT a generation picks |\n| | the branch keeps its kind: a later `1.5` is refused, not admitted |\n| `x: 1` twice | the two meet; `1 & 2` is an error, `1 & integer` is `1` |\n| `$.a.b` | the value at that path of this document |\n| `1 + 2` | arithmetic on concrete numbers |\n\n## Maps that say more\n\n| Write | Means |\n|-------|-------|\n| `{&: {k: integer}}` | a TEMPLATE every key must satisfy |\n| `close({a:1})` | no key beyond those named |\n| `{a?: 1}` | optional: dropped if unresolved |\n| `hide(x)` | evaluated, then dropped from the output |\n| `type(x)` | a definition, not a value: it generates nothing |\n| `deprecate(x, {msg:\"…\"})` | still works, and says so |\n| `refer(t) & path($.a.b)` | a checked LINK: the tree address must resolve, and `t` flows into it |\n\n## Constraints\n\n`min(n) max(n) above(n) below(n)` bound a number;\n`length(n)` and `unique()` bound a list or string;\n`re(\"^…$\")` matches a string; `neq(v)` refuses one value;\n`must(cond, \"why\")` is the escape hatch.\n\nBounds compose: `integer & min(1) & max(10)` is a range, and two\nranges meet to their overlap.\n\n## Files\n\n`@\"other.aon\"` includes another document — it unifies in, it does not\nconcatenate. (A constrained decoder is not given this: generated\ndocuments describe values, they do not load files.)\n"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"topic": "examples",
|
|
20
|
+
"summary": "the ladder — plain JSON, then one addition at a time",
|
|
21
|
+
"source": "docs/skill/examples.md",
|
|
22
|
+
"text": "# aontu by example\n\nThe ladder: start with the JSON you already know, add one thing at a\ntime. Every rung is a valid document.\n\n## 1. It is JSON\n\n```\n{\"service\": {\"name\": \"auth\", \"port\": 8080}}\n```\n\nBare keys and no commas also parse, so this is the same document:\n\n```\nservice: {\n name: \"auth\"\n port: 8080\n}\n```\n\n## 2. Say what a value MAY be\n\n```\nservice: {\n name: string\n port: integer\n}\n```\n\nNothing generates yet — this is a truth, not a value. `aontu vet\nservice.aon deploy.aon` says whether a deployment satisfies it.\n\n## 3. Say what it SHOULD be\n\n```\nservice: {\n name: string\n port: *8080 | integer # 8080 unless told otherwise\n replicas: *1 | integer\n}\n```\n\nNow it generates: `{\"service\":{\"name\":…,\"port\":8080,\"replicas\":1}}` —\nexcept `name`, which nothing has supplied. Defaults are picked at\ngeneration; they do not stop a caller from choosing something else.\n\n`*8080 | integer` means what it reads as: a caller's `9090` overrides\nit, and a caller's `1.5` is refused, because the branch admits only the\nkind it names. Write `*8080 | number` if any numeric value should be\nallowed to win.\n\n## 4. Say it once, for every key\n\n```\nservices: {\n &: { port: integer, replicas: *1 | integer }\n auth: { port: 8080 }\n db: { port: 5432, replicas: 3 }\n}\n```\n\nThe `&:` template meets EVERY key. `aontu why $.services.db.replicas`\nreports both contributions — the template's `*1|integer` and the\nliteral `3` — with the line each was written on.\n\n## 5. Bound it\n\n```\nservices: {\n &: {\n port: integer & min(1) & max(65535)\n name: string & re(\"^[a-z][a-z0-9-]*$\")\n }\n}\n```\n\nA port of `0` is now an error with a path, not a runtime surprise.\n\n## 6. Layer it\n\n```\n# base.aon\nservice: { image: string, replicas: *1 | integer }\n\n# prod.aon\n@\"base.aon\"\nservice: { image: \"auth:v2.3\", replicas: 5 }\n```\n\nUnification is order-independent: `base & prod` is `prod & base`. To\nchange a value without editing the file, append to an overlay:\n\n```\naontu set '$.service.replicas=7' --entry prod.aon --overlay local.aon\n```\n\nIf the value is PINNED rather than open, that command refuses and\nnames the pinning site — which is the honest answer, and where\n`aontu why` takes you next.\n"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"topic": "codes",
|
|
26
|
+
"summary": "what a refusal means, and what to do about it",
|
|
27
|
+
"source": "docs/skill/error-codes.md",
|
|
28
|
+
"text": "# What a refusal means\n\nEvery aontu error carries a **code**, and every code has a **class**.\nThe class says what kind of thing went wrong, which is what decides\nyour next move. The full registry — every code, its class, and the\nversion it appeared in — is\n[`test/spec/errcodes.tsv`](../../test/spec/errcodes.tsv), which the\ntest suite holds to the engine in both implementations.\n\n| Class | Meaning | What to do |\n|-------|---------|------------|\n| `parse` | the text is not a document | fix the syntax at the site the frame points at |\n| `conflict` | two values cannot both hold | one of them is wrong: `aontu why <path>` names both and where they were written |\n| `incomplete` | nothing contradicts, but the value is not concrete | supply what is missing, or accept it with `--partial` |\n| `reference` | a path names nothing | check the spelling; `aontu get $ --keys` lists what is there |\n| `compat` | a change breaks an earlier version | that is `aontu subsume` / `aontu breaking` talking: widen the change or version it |\n| `budget` | evaluation hit a deterministic limit | usually a cycle; simplify, or raise the budget deliberately |\n| `internal` | the engine surprised itself | a bug worth reporting |\n\n## The repair loop\n\n```\naontu vet schema.aon mine.aon --format json\n```\n\nThe exit code branches for you: `0` valid, `1` invalid (fix the\ndata), `3` incomplete (supply more), `4` the schema itself is\nunusable (fix the truth, not the data). Every finding carries\n`path`, `code`, and the sites on both sides — the data site first,\nbecause that is the one to edit. A site names **the file whose text\nit excerpts**, so its row and column are safe to edit at even when\nthe document loads others.\n\nRead `hint` before guessing. `message` is the one-line headline;\n`hint` is the engine's own explanation of the failure class with the\noffending values filled in, and for several codes it names the fix\noutright — `lossy_integer_literal` tells you to write the literal as\n`0d…`. It is absent for codes that have no hint text.\n\nFor a conflict, `aontu why <path> mine.aon` lists every contribution\nto that path with its role and source line, which turns \"these\ndisagree\" into \"these two lines disagree\".\n\nThen fix it:\n\n```\naontu set '$.replicas=5' --entry schema.aon --overlay mine.aon --in-place\n```\n\n`--in-place` rewrites the pinned literal **where it was written**, so\ncomments and layout survive. Without it, `set` APPENDS — which is the\nright thing when the document left a hole, and cannot work when it\npinned the wrong value, because unification only narrows.\n\nThe edit is verified before a byte is written: a site carries the\nsource text it covers, and the text at the span must match it. Where\nthat cannot be established — the value comes from a `&:` template or a\n`$ref`, two statements pin the path, the site names the opening token\nof a compound like `min(1)`, or the overlay `@\"includes\"` another\ndocument — the assignment is appended as usual and a **warning** says\nwhich case it hit. A warning never changes the verdict, so asking for\n`--in-place` cannot make a run fail that would have succeeded.\n"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"topic": "grammar",
|
|
32
|
+
"summary": "the published ABNF, for a parser or a constrained decoder",
|
|
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\"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
|
+
}
|
|
36
|
+
];
|
|
37
|
+
exports.HELPDOC = HELPDOC;
|
|
38
|
+
const INITDOC = [
|
|
39
|
+
{
|
|
40
|
+
"file": "docs/skill/init/model.aon",
|
|
41
|
+
"name": "model.aon",
|
|
42
|
+
"mode": 420,
|
|
43
|
+
"text": "# model.aon --- the truth. `aontu vet model.aon data.aon` asks whether\n# a document satisfies it.\n#\n# `&:` is the construct to learn first: it meets EVERY key of the map\n# it sits in, so one statement constrains every entity. A quoted \"*\" is\n# not a wildcard -- it is a key named `*`, it meets nothing, and a\n# schema written that way reports `valid` over data that violates it.\n# `aontu vet --strict-coverage` refuses to pass such a check.\nentity: {\n &: {\n table: string & re(\"^[a-z][a-z0-9_]*$\")\n fields: {\n &: {\n type: \"string\" | \"integer\" | \"boolean\"\n required: *false | boolean\n }\n }\n }\n}\n"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"file": "docs/skill/init/data.aon",
|
|
47
|
+
"name": "data.aon",
|
|
48
|
+
"mode": 420,
|
|
49
|
+
"text": "# data.aon --- an instance of the truth in model.aon. Edit it and run\n# check.sh: every change is checked against the model, and a change the\n# model refuses is named with the line it is on.\nentity: {\n planet: {\n table: \"planets\"\n fields: {\n name: { type: \"string\", required: true }\n diameter: { type: \"integer\" }\n }\n }\n}\n"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"file": "docs/skill/init/check.sh",
|
|
53
|
+
"name": "check.sh",
|
|
54
|
+
"mode": 493,
|
|
55
|
+
"text": "#!/usr/bin/env sh\n# check.sh --- the four questions to ask of a model. Run it after\n# every edit to model.aon or data.aon.\n#\n# `aontu help tasks` maps a job to a verb; `aontu explain <code>` says\n# what a refusal means; `aontu help language` is the whole grammar on\n# one page. None of them needs a network.\nset -eu\n\nAONTU=\"${AONTU:-aontu}\"\ncd \"$(dirname \"$0\")\"\n\n# 1. Does the data satisfy the truth -- and did the check examine\n# anything? --strict-coverage exits 1 on a check that constrained no\n# value, which is the failure a passing gate hides.\n$AONTU vet --strict-coverage model.aon data.aon\n\n# 2. What does it say at a path?\n$AONTU get '$.entity.planet.table' data.aon\n\n# 3. Why does it say that? Every contribution, with the line it is on.\n$AONTU why '$.entity.planet.table' data.aon\n\n# 4. A pin for the truth: it survives reformatting and moves on any\n# change of meaning.\n$AONTU hash model.aon\n\necho \"ok --- model.aon and data.aon agree\"\n"
|
|
56
|
+
}
|
|
57
|
+
];
|
|
58
|
+
exports.INITDOC = INITDOC;
|
|
59
|
+
//# sourceMappingURL=helpdoc.js.map
|
|
@@ -0,0 +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,0tKAA0tK;KACnuK;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' +
|
|
@@ -150,6 +162,7 @@ const hints = {
|
|
|
150
162
|
render_unit: 'The unit asked for is not in the instance. The report names the\npath; the units are listed by `--format json`.',
|
|
151
163
|
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
164
|
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.',
|
|
165
|
+
decimal_syntax: 'This 0d literal is not a valid exact number.',
|
|
153
166
|
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.',
|
|
154
167
|
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.',
|
|
155
168
|
view_rows_exceeded: 'The figure has more rows than --max-rows allows. This is a REFUSAL,\nnot a truncation: a view that quietly omits things is the failure the\nverb exists to avoid. Narrow the figure with --at or --relation, or\nraise the limit.',
|
|
@@ -162,7 +175,7 @@ const hints = {
|
|
|
162
175
|
view_document_shape: 'A view document declares each figure as a map of view options --\nthe flag names without the dashes -- and every declaration must name\nits `kind` and the `out` file it draws into. This one names an option\nthat is not one, gives a value of the wrong shape, or leaves out what\nevery declaration needs. `aontu view --help` lists the options.',
|
|
163
176
|
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.',
|
|
164
177
|
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.',
|
|
165
|
-
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
|
|
178
|
+
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 are taken in sorted-key order.\n \nExamples:\n each([a,b], upper(_)) -> [..] # 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.',
|
|
166
179
|
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.',
|
|
167
180
|
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.',
|
|
168
181
|
emit_data: 'The first argument to emit() is not a bag. `emit` visits the\nchildren of its SELECTION, so the selection has to have children: a\nlist of nodes, or a map whose values are the nodes.\n \nExamples:\n emit([{k:1}], {match:{k:1},body:[a]}) -> [..] # A list of nodes;\n emit({x:{k:1}}, {match:{k:1},body:[a]}) -> [..] # ... or a map of them;\n emit(1, {match:{k:1},body:[a]}) -> nil # ... but not a scalar.',
|
|
@@ -174,6 +187,9 @@ const hints = {
|
|
|
174
187
|
replace_overlap: "Two keys of a template's `replace` map overlap: {key} is inside\n{other}. A replacement is one left-to-right scan of the body's literal\ntext taking the longest key at each position, and a key inside\nanother is ambiguous whatever the order -- so it is refused on the\ntemplate, before any node is visited.\n \nExamples:\n replace: {PIN: .pin, MSG: .msg} # Two keys, neither inside the other;\n replace: {PIN: .pin} # ... or one alone;\n replace: {P: .p, PIN: .pin} # ... but P is inside PIN.",
|
|
175
188
|
replace_unused: 'A key of a template\'s `replace` map matches nothing: {key} appears\nin none of the body\'s literal lines. A replacement key is an exact\nstring the body already holds as ordinary target text, so a key the\nbody does not hold means the template drifted from its map -- refused\nbefore any node is visited, since the drift is the same for every\nnode.\n \nExamples:\n {replace: {PIN: .pin}, body: ["listen(PIN)"]} # The body holds PIN;\n {replace: {PIN: .pin}, body: ["pin: PIN"]} # ... anywhere in a line;\n {replace: {PIN: .pin}, body: ["listen(pin)"]} # ... but not here.',
|
|
176
189
|
replace_value: 'A replacement value is not text: the `replace` key {key} came to\n{value} at the node. A value reaches the body as a string -- a number\nor a boolean spells itself, as it does after `+` -- and it has to\nhave settled by the time the dispatch fires, so a map, a list, a\nnull or a value still unresolved is refused rather than written into\na file as something else.\n \nExamples:\n replace: {PIN: .pin} # A string field;\n replace: {PORT: .port} # ... or a number, as digits;\n replace: {ALL: _} # ... but the node itself is a map.',
|
|
190
|
+
// RETIRED with the name `form` (ADR-027): the function is `each` now
|
|
191
|
+
// and answers `each_data`. Registered still, errcodes.tsv being
|
|
192
|
+
// append-only, so a code a released engine raised keeps its meaning.
|
|
177
193
|
form_data: 'The first argument to form() is not a bag. `form` makes one list\nelement per child of its DATA, so the data has to have children: a\nlist, or a map whose values are taken in sorted-key order.\n \nExamples:\n form([a,b], upper(_)) -> [..] # A list, in source order;\n form({b:2,a:1}, _) -> [..] # ... a map, in sorted-key order;\n form(1, _) -> nil # ... but a scalar has no children.',
|
|
178
194
|
esc_variant: 'esc(), usc() or a template\'s `esc:` key were given a variant that\nnames no convention.\nA variant names a CONVENTION rather than a language, because several\nlanguages share one and one language has several. The names are `sq`,\n`sql`, `shell`, `xml`, `uri` and `regex`; written with no variant at\nall it is the C escape, JSON canonical, which covers the double-quoted\nliteral of every C-family language.\n \nExamples:\n esc(text) -> ... # C / JSON, the default;\n esc(text, sq) -> ... # ... single-quoted C-family;\n esc(text, pascal) -> nil # ... but that is not a convention.',
|
|
179
195
|
usc_malformed: 'usc() was given text the convention could not have produced,\nso there is nothing to read back out: a truncated code-point escape, an\nescape the convention does not define, or an escape character standing\nalone where the convention doubles it. `usc` is the LEFT inverse of\n`esc` and it is partial — every escaped value has an original, but not\nevery string is an escaped value.\n \nExamples:\n usc(esc(text)) -> ... # Whatever esc() wrote;\n usc(text, sql) -> ... # ... in the same convention;\n usc(text, shell) -> nil # ... but not in another one.',
|
|
@@ -234,6 +250,35 @@ const hints = {
|
|
|
234
250
|
' pick([{a:1},{a:2}], a) -> [1,2] # Every child has it;\n' +
|
|
235
251
|
' pick([{a:1},{b:2}], a) -> nil # ... the second does not;\n' +
|
|
236
252
|
' pick([[9],[8]], 0) -> [9,8] # A list child takes an index.',
|
|
253
|
+
sort_key: 'A child of this bag has no key `{key}` to order by. Ordering\n' +
|
|
254
|
+
'refuses rather than skipping, for the reason `pick` does: a\n' +
|
|
255
|
+
'shorter list orders a DIFFERENT set of records than the one the\n' +
|
|
256
|
+
'author named. Give every child the key, or filter the bag first.\n' +
|
|
257
|
+
' \n' +
|
|
258
|
+
'Examples:\n' +
|
|
259
|
+
' sort([{a:2},{a:1}], a) -> [{a:1},{a:2}] # Every child has it;\n' +
|
|
260
|
+
' sort([{a:1},{b:2}], a) -> nil # ... the second does not;\n' +
|
|
261
|
+
' sort([[9],[8]], 0) -> [[8],[9]] # A list child takes an index.',
|
|
262
|
+
sort_domain: 'This bag cannot be ordered: `{member}`. There are two orders and no\n' +
|
|
263
|
+
'third -- text by code point, numbers by the exact comparator -- so a\n' +
|
|
264
|
+
'bag that mixes them, or holds a boolean, a null or a container, has\n' +
|
|
265
|
+
'no order to be put in. Project a field that is all one kind, or\n' +
|
|
266
|
+
'filter the bag first.\n' +
|
|
267
|
+
' \n' +
|
|
268
|
+
'Examples:\n' +
|
|
269
|
+
' sort([3,1,2]) -> [1,2,3] # All numbers;\n' +
|
|
270
|
+
' sort([b,a]) -> ["a","b"] # ... or all text;\n' +
|
|
271
|
+
' sort([1,a]) -> nil # ... never both.',
|
|
272
|
+
sort_dir: 'A sort direction names no direction: `{dir}`. The third argument is\n' +
|
|
273
|
+
'`asc` or `desc`, and omitting it is `asc`. The second argument is\n' +
|
|
274
|
+
'the field to order by, so a keyless descending sort writes the\n' +
|
|
275
|
+
'empty projector: the member itself.\n' +
|
|
276
|
+
' \n' +
|
|
277
|
+
'Examples:\n' +
|
|
278
|
+
' sort($.rows, n) # Ascending by field `n`;\n' +
|
|
279
|
+
' sort($.rows, n, desc) # ... descending;\n' +
|
|
280
|
+
' sort($.tags) # The members themselves, ascending;\n' +
|
|
281
|
+
' sort($.tags, "", desc) # ... descending.',
|
|
237
282
|
join_member: 'A member of this bag is not text and never will be: `{member}`.\n' +
|
|
238
283
|
'`join` folds with `+` seeded with the empty string, and `+` with a\n' +
|
|
239
284
|
'string on the left RESIDUATES on a map, a list or a null rather\n' +
|
|
@@ -344,8 +389,6 @@ const hints = {
|
|
|
344
389
|
// Junction errors (disjunction/conjection)
|
|
345
390
|
'empty': 'Empty disjunction. The disjunction has no valid alternatives.',
|
|
346
391
|
'empty-dist': 'Empty disjunction distribution. All alternatives in the disjunction are invalid.',
|
|
347
|
-
// ADR-011 R2: two DEFAULTS of equal rank that cannot agree. The
|
|
348
|
-
// fix is a rank, so the hint names it.
|
|
349
392
|
'pref_rank_clash': 'Two defaults of the same rank disagree.' +
|
|
350
393
|
' Rank one of them (`**x`) to say which is the weaker layer,' +
|
|
351
394
|
' or give them the same value.',
|
|
@@ -367,15 +410,6 @@ const hints = {
|
|
|
367
410
|
'op[': 'Operator value error: ',
|
|
368
411
|
};
|
|
369
412
|
exports.hints = hints;
|
|
370
|
-
// codeClasses assigns every error code a CLASS: conflict | incomplete |
|
|
371
|
-
// reference | parse | budget | internal. The contract lives in
|
|
372
|
-
// test/spec/errcodes.tsv (mode `errcode`): the spec suite executes one
|
|
373
|
-
// row per code against this table and asserts SET EQUALITY between the
|
|
374
|
-
// file and these keys, in both implementations (go/hints.go mirrors
|
|
375
|
-
// this map exactly). Codes are append-only and never renamed; a class
|
|
376
|
-
// change is a breaking change. Class rulings (why decimal_budget and
|
|
377
|
-
// lossy_integer_literal are conflict, not budget; why unknown_function
|
|
378
|
-
// is reference) are documented in the tsv header.
|
|
379
413
|
const codeClasses = {
|
|
380
414
|
// parse -- the source text is malformed or unusable
|
|
381
415
|
parse: 'parse',
|
|
@@ -407,10 +441,6 @@ const codeClasses = {
|
|
|
407
441
|
patch_not_editable: 'reference',
|
|
408
442
|
patch_ambiguous: 'reference',
|
|
409
443
|
patch_span_mismatch: 'internal',
|
|
410
|
-
// G4 phase 2 -- the checked link: a string that is not a tree
|
|
411
|
-
// address (class `parse`, the text is wrong), and an address that
|
|
412
|
-
// names nothing in this evaluation (class `reference`, the same
|
|
413
|
-
// class as `no_path`, because it is the same kind of miss).
|
|
414
444
|
refer_address: 'parse',
|
|
415
445
|
rel_address: 'parse',
|
|
416
446
|
refer_unresolved: 'reference',
|
|
@@ -447,10 +477,6 @@ const codeClasses = {
|
|
|
447
477
|
// tree address, met by path()'s capture or promotion. The same
|
|
448
478
|
// class as refer_address, because it is the same mistake.
|
|
449
479
|
path_address: 'parse',
|
|
450
|
-
// G8 phase 1 -- the generation combinators. All three are class
|
|
451
|
-
// `parse`: what is wrong is the CALL as written (data that is not a
|
|
452
|
-
// bag, a list element that is not a name), not any pair of values a
|
|
453
|
-
// meet brought together.
|
|
454
480
|
pack_data: 'parse',
|
|
455
481
|
pack_key: 'parse',
|
|
456
482
|
each_data: 'parse',
|
|
@@ -461,41 +487,21 @@ const codeClasses = {
|
|
|
461
487
|
// meet, reported once for the whole form.
|
|
462
488
|
filter_data: 'parse',
|
|
463
489
|
match_none: 'conflict',
|
|
464
|
-
// G9 phase 6 -- the string builtins. All five are class `parse`:
|
|
465
|
-
// what is wrong is the CALL as written -- a variant that names no
|
|
466
|
-
// convention, a pattern outside the subset, a substitution naming a
|
|
467
|
-
// group that does not exist, a separator that is neither string nor
|
|
468
|
-
// pattern. `usc_malformed` is the odd one and still `parse`: the
|
|
469
|
-
// TEXT the call was given has no inverse, which is a fact about the
|
|
470
|
-
// argument rather than about any meet.
|
|
471
490
|
esc_variant: 'parse',
|
|
472
491
|
usc_malformed: 'parse',
|
|
473
492
|
rep_pattern: 'parse',
|
|
474
493
|
rep_sub: 'parse',
|
|
475
494
|
split_sep: 'parse',
|
|
476
|
-
// G9 phase 6 -- apply-templates. The four shape codes are class
|
|
477
|
-
// `parse`: what is wrong is the CALL as written -- a selection with
|
|
478
|
-
// no children, a table that is not one, a rule missing a half.
|
|
479
|
-
// `emit_none` is class `conflict` for `match_none`'s reason: the
|
|
480
|
-
// node and every pattern written for it disagreed.
|
|
481
495
|
emit_data: 'parse',
|
|
482
496
|
emit_table: 'parse',
|
|
483
497
|
emit_template: 'parse',
|
|
484
498
|
emit_body: 'parse',
|
|
485
499
|
emit_none: 'conflict',
|
|
486
500
|
emit_ref: 'conflict',
|
|
487
|
-
// RENDER P6 -- `replace` on a template, and `form`. The two
|
|
488
|
-
// template checks are class `parse`: what is wrong is the TEMPLATE
|
|
489
|
-
// as written, before any node. `replace_value` is class `conflict`:
|
|
490
|
-
// the node's value and the body that wanted text disagreed.
|
|
491
|
-
// `form_data` is `each_data`'s twin.
|
|
492
501
|
replace_overlap: 'parse',
|
|
493
502
|
replace_unused: 'parse',
|
|
494
503
|
replace_value: 'conflict',
|
|
495
504
|
form_data: 'parse',
|
|
496
|
-
// G8 phase 3 -- the placeholder. Class `conflict`: two values met
|
|
497
|
-
// and neither could answer for the other, which is what every
|
|
498
|
-
// conflict is.
|
|
499
505
|
place_pair: 'conflict',
|
|
500
506
|
// G6 phase 2 -- modules. Both are class `parse`: a module import is
|
|
501
507
|
// resolved while the source is READ, and neither a module that is
|
|
@@ -533,6 +539,9 @@ const codeClasses = {
|
|
|
533
539
|
constraint: 'conflict',
|
|
534
540
|
must: 'conflict',
|
|
535
541
|
constraint_pattern: 'conflict',
|
|
542
|
+
abnf_grammar: 'parse',
|
|
543
|
+
parse_arg: 'parse',
|
|
544
|
+
parse_failed: 'conflict',
|
|
536
545
|
scalar_value: 'conflict',
|
|
537
546
|
scalar_kind: 'conflict',
|
|
538
547
|
no_scalar_unify: 'conflict',
|
|
@@ -550,6 +559,9 @@ const codeClasses = {
|
|
|
550
559
|
exact_float_mix: 'conflict',
|
|
551
560
|
inexact_integer_sum: 'conflict',
|
|
552
561
|
pick_key: 'conflict',
|
|
562
|
+
sort_key: 'conflict',
|
|
563
|
+
sort_domain: 'conflict',
|
|
564
|
+
sort_dir: 'parse',
|
|
553
565
|
aggregate_data: 'conflict',
|
|
554
566
|
aggregate_empty: 'conflict',
|
|
555
567
|
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;;;QA+wBlD,SAAS;AA7wBX;;;;;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;Q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AA;AACnB,CAAC,CAAC,iCAAiC"}
|
package/dist/jsonschema.js
CHANGED
|
@@ -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
|