aontu 0.64.0 → 0.66.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.
Files changed (64) hide show
  1. package/README.md +2 -2
  2. package/dist/agentsmd.js +3 -3
  3. package/dist/agentsmd.js.map +1 -1
  4. package/dist/aontu.d.ts +1 -1
  5. package/dist/aontu.js +1 -1
  6. package/dist/cli.d.ts +16 -2
  7. package/dist/cli.js +741 -137
  8. package/dist/cli.js.map +1 -1
  9. package/dist/compat.d.ts +7 -0
  10. package/dist/compat.js +113 -0
  11. package/dist/compat.js.map +1 -0
  12. package/dist/helpdoc.js +5 -5
  13. package/dist/helpdoc.js.map +1 -1
  14. package/dist/hints.js +11 -5
  15. package/dist/hints.js.map +1 -1
  16. package/dist/lang.d.ts +1 -0
  17. package/dist/lang.js +8 -0
  18. package/dist/lang.js.map +1 -1
  19. package/dist/lsp.d.ts +1 -1
  20. package/dist/mod.d.ts +18 -3
  21. package/dist/mod.js +117 -46
  22. package/dist/mod.js.map +1 -1
  23. package/dist/pkg-net.d.ts +227 -0
  24. package/dist/pkg-net.js +1598 -0
  25. package/dist/pkg-net.js.map +1 -0
  26. package/dist/pkg-zip.d.ts +8 -0
  27. package/dist/pkg-zip.js +196 -0
  28. package/dist/pkg-zip.js.map +1 -0
  29. package/dist/pkg.d.ts +159 -0
  30. package/dist/pkg.js +767 -0
  31. package/dist/pkg.js.map +1 -0
  32. package/dist/report-sarif.js +1 -1
  33. package/dist/report-sarif.js.map +1 -1
  34. package/dist/subsume.d.ts +3 -1
  35. package/dist/subsume.js +2 -0
  36. package/dist/subsume.js.map +1 -1
  37. package/dist/tsconfig.tsbuildinfo +1 -1
  38. package/grammar/aontu.gbnf +8 -18
  39. package/grammar/aontu.lark +6 -14
  40. package/grammar/aontu.tmLanguage.json +4 -6
  41. package/package.json +3 -2
  42. package/skill/SKILL.md +3 -3
  43. package/skill/error-codes.md +4 -4
  44. package/skill/examples.md +4 -4
  45. package/skill/grammar-card.md +1 -1
  46. package/skill/init/check.sh +2 -2
  47. package/skill/tasks.md +17 -12
  48. package/src/agentsmd.ts +3 -3
  49. package/src/aontu.ts +1 -1
  50. package/src/cli.ts +851 -151
  51. package/src/compat.ts +148 -0
  52. package/src/helpdoc.ts +5 -5
  53. package/src/hints.ts +11 -7
  54. package/src/lang.ts +9 -1
  55. package/src/mod.ts +142 -51
  56. package/src/pkg-net.ts +1945 -0
  57. package/src/pkg-zip.ts +228 -0
  58. package/src/pkg.ts +1018 -0
  59. package/src/report-sarif.ts +1 -1
  60. package/src/subsume.ts +2 -2
  61. package/dist/mod-tool.d.ts +0 -58
  62. package/dist/mod-tool.js +0 -418
  63. package/dist/mod-tool.js.map +0 -1
  64. package/src/mod-tool.ts +0 -578
@@ -1,9 +1,9 @@
1
1
  # Aontu — published grammar (GBNF), for constrained decoding.
2
2
  #
3
- # G7 phase 6, docs/capability-review/g7-machine-access.md. This
4
- # grammar covers the DOCUMENTED EMISSION SURFACE: what a model should
5
- # be allowed to write, which is a superset of JSON plus the operators,
6
- # constraints and marks the language's own canonical form emits.
3
+ # This grammar covers the DOCUMENTED EMISSION SURFACE: what a model
4
+ # should be allowed to write, which is a superset of JSON plus the
5
+ # operators, constraints and marks the language's own canonical form
6
+ # emits.
7
7
  #
8
8
  # It is CONSERVATIVE BY CONSTRUCTION: it may accept less than the
9
9
  # parser does, never more. Two deliberate exclusions:
@@ -21,19 +21,9 @@
21
21
 
22
22
  root ::= ws value ws
23
23
 
24
- # No pipe. `|>` was parse-time sugar (G8 phase 4); ADR-018 removed it,
25
- # `x |> f(a)` being written `f(x, a)`.
26
- #
27
- # That ADR says "the operator from both grammars", and both kept it
28
- # anyway — the engine, the suite, the error code and the docs were
29
- # done, these two files were not. Nothing caught it, and nothing here
30
- # could have: the parity discipline above runs one way, requiring every
31
- # canon output to PARSE, so a rule canon never emits is unreachable and
32
- # a test that only reads this file cannot tell a dead rule from a live
33
- # one. What it cost was the direction that matters to this file's
34
- # consumer — a decoder constrained by the old text could emit `|>` and
35
- # have the engine refuse it with `aontu/unexpected`. Fixed before the
36
- # next release, so no published grammar ever disagreed with its engine.
24
+ # No pipe. `|>` is not in the language; `x |> f(a)` is written
25
+ # `f(x, a)`. A decoder constrained by this file cannot emit a spelling
26
+ # the engine refuses with `aontu/unexpected`.
37
27
  value ::= disjunct
38
28
 
39
29
  disjunct ::= conjunct ( ws "|" ws conjunct )*
@@ -108,7 +98,7 @@ ref ::= "$" ( "." segment )+ | ( "." segment )+
108
98
  # `a:6-2` as a parse error), so admitting it over-approximated.
109
99
  segment ::= ( [a-zA-Z0-9_] )+
110
100
 
111
- # The placeholder: a hole a call is filled through (G8 phase 3). BARE
101
+ # The placeholder: a hole a call is filled through. BARE
112
102
  # only -- `"_"` is an ordinary string, and a longer bare word
113
103
  # containing it is ordinary text.
114
104
  place ::= "_"
@@ -1,9 +1,8 @@
1
1
  // Aontu — published grammar (lark), for constrained decoding.
2
2
  //
3
- // G7 phase 6, docs/capability-review/g7-machine-access.md. The same
4
- // rules as grammar/aontu.gbnf, for the other consumer: keep the two in
5
- // step, and note that ts/test/grammar.test.ts checks that every rule
6
- // named there is named here.
3
+ // The same rules as grammar/aontu.gbnf, for the other consumer: keep
4
+ // the two in step, and note that ts/test/grammar.test.ts checks that
5
+ // every rule named there is named here.
7
6
  //
8
7
  // The gbnf file is the one the parity test INTERPRETS against the
9
8
  // shared suite's canonical output; this file is its transcription, so
@@ -15,16 +14,9 @@
15
14
 
16
15
  root: value
17
16
 
18
- // No pipe. `|>` was parse-time sugar (G8 phase 4); ADR-018 removed it,
19
- // `x |> f(a)` being written `f(x, a)`.
20
- //
21
- // That ADR says "the operator from both grammars", and both kept it
22
- // anyway — the engine, the suite, the error code and the docs were
23
- // done, these two files were not. Nothing caught it: a rule nothing
24
- // derives never matches, so every canon still parsed and every test
25
- // stayed green while the grammars offered a spelling the parser
26
- // refuses with `aontu/unexpected`. Fixed before the next release, so
27
- // no published grammar ever disagreed with its engine.
17
+ // No pipe. `|>` is not in the language; `x |> f(a)` is written
18
+ // `f(x, a)`. The engine refuses the old spelling with
19
+ // `aontu/unexpected`, and all three published grammars agree with it.
28
20
  value: disjunct
29
21
 
30
22
  disjunct: conjunct ("|" conjunct)*
@@ -14,16 +14,14 @@
14
14
  "rejects AS THOUGH it were valid, which is why the builtin list below is",
15
15
  "the engine's own set and not a hand-picked sample of it.",
16
16
  "",
17
- "THE BUILTIN LIST IS A COPY, AND A COPY DRIFTS. aontu.lark carried",
18
- "`same` — never a builtin — and was missing `acyclic`, `inverse` and",
19
- "`rel` for two releases, with every test green. So the same guard the",
17
+ "THE BUILTIN LIST IS A COPY, AND A COPY DRIFTS, so the same guard the",
20
18
  "other two grammars have covers this file: ts/test/grammar.test.ts,",
21
19
  "`the-textmate-grammar-names-exactly-the-engine-builtins`, asserts this",
22
20
  "list against BUILTIN_FUNCS in BOTH directions. Add a builtin to the",
23
21
  "engine without adding it here and that test fails.",
24
22
  "",
25
- "No `|>`: ADR-018 removed the pipe from the language, and all three",
26
- "published grammars now agree about that."
23
+ "No `|>`: the pipe is not in the language, and all three published",
24
+ "grammars agree about that."
27
25
  ],
28
26
  "name": "aontu",
29
27
  "displayName": "Aontu",
@@ -130,7 +128,7 @@
130
128
  "match": "\\b(true|false|null)\\b"
131
129
  },
132
130
  {
133
- "comment": "`_` is a literal of the language as of G8 phase 3, not text.",
131
+ "comment": "`_` is a literal of the language, not text.",
134
132
  "name": "constant.language.placeholder.aontu",
135
133
  "match": "(?<![A-Za-z0-9_])_(?![A-Za-z0-9_])"
136
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aontu",
3
- "version": "0.64.0",
3
+ "version": "0.66.0",
4
4
  "main": "dist/aontu.js",
5
5
  "type": "commonjs",
6
6
  "types": "dist/aontu.d.ts",
@@ -78,7 +78,8 @@
78
78
  "@tabnas/parser": "0.9.7",
79
79
  "@tabnas/path": "0.3.2",
80
80
  "@tabnas/toml": "0.5.7",
81
- "@tabnas/yaml": "0.5.7"
81
+ "@tabnas/yaml": "0.5.7",
82
+ "jostraca": "0.38.0"
82
83
  },
83
84
  "devDependencies": {
84
85
  "@tabnas/railroad": "0.3.6",
package/skill/SKILL.md CHANGED
@@ -32,9 +32,9 @@ The verbs, all of which answer as JSON with `--format json`:
32
32
 
33
33
  ```
34
34
  aontu vet schema.aon data.aon # does this data satisfy that truth?
35
- aontu get $.a.b file.aon # what does it say at a path?
36
- aontu why $.a.b file.aon # why does that value hold?
37
- aontu set $.a.b=1 --entry file.aon --overlay over.aon
35
+ aontu model get $.a.b file.aon # what does it say at a path?
36
+ aontu model why $.a.b file.aon # why does that value hold?
37
+ aontu model set $.a.b=1 --entry file.aon --overlay over.aon
38
38
  aontu allow --role dev roles.aon $.a.b # may this role change that subtree?
39
39
  aontu hash file.aon # a pin that survives reformatting
40
40
  ```
@@ -10,9 +10,9 @@ test suite holds to the engine in both implementations.
10
10
  | Class | Meaning | What to do |
11
11
  |-------|---------|------------|
12
12
  | `parse` | the text is not a document | fix the syntax at the site the frame points at |
13
- | `conflict` | two values cannot both hold | one of them is wrong: `aontu why <path>` names both and where they were written |
13
+ | `conflict` | two values cannot both hold | one of them is wrong: `aontu model why <path>` names both and where they were written |
14
14
  | `incomplete` | nothing contradicts, but the value is not concrete | supply what is missing, or accept it with `--partial` |
15
- | `reference` | a path names nothing | check the spelling; `aontu get $ --keys` lists what is there |
15
+ | `reference` | a path names nothing | check the spelling; `aontu model get $ --keys` lists what is there |
16
16
  | `compat` | a change breaks an earlier version | that is `aontu subsume` / `aontu breaking` talking: widen the change or version it |
17
17
  | `budget` | evaluation hit a deterministic limit | usually a cycle; simplify, or raise the budget deliberately |
18
18
  | `internal` | the engine surprised itself | a bug worth reporting |
@@ -37,14 +37,14 @@ offending values filled in, and for several codes it names the fix
37
37
  outright — `lossy_integer_literal` tells you to write the literal as
38
38
  `0d…`. It is absent for codes that have no hint text.
39
39
 
40
- For a conflict, `aontu why <path> mine.aon` lists every contribution
40
+ For a conflict, `aontu model why <path> mine.aon` lists every contribution
41
41
  to that path with its role and source line, which turns "these
42
42
  disagree" into "these two lines disagree".
43
43
 
44
44
  Then fix it:
45
45
 
46
46
  ```
47
- aontu set '$.replicas=5' --entry schema.aon --overlay mine.aon --in-place
47
+ aontu model set '$.replicas=5' --entry schema.aon --overlay mine.aon --in-place
48
48
  ```
49
49
 
50
50
  `--in-place` rewrites the pinned literal **where it was written**, so
package/skill/examples.md CHANGED
@@ -59,7 +59,7 @@ services: {
59
59
  }
60
60
  ```
61
61
 
62
- The `&:` template meets EVERY key. `aontu why $.services.db.replicas`
62
+ The `&:` template meets EVERY key. `aontu model why $.services.db.replicas`
63
63
  reports both contributions — the template's `*1|integer` and the
64
64
  literal `3` — with the line each was written on.
65
65
 
@@ -83,7 +83,7 @@ A port of `0` is now an error with a path, not a runtime surprise.
83
83
  service: { image: string, replicas: *1 | integer }
84
84
 
85
85
  # prod.aon
86
- @"base.aon"
86
+ @"./base.aon"
87
87
  service: { image: "auth:v2.3", replicas: 5 }
88
88
  ```
89
89
 
@@ -91,9 +91,9 @@ Unification is order-independent: `base & prod` is `prod & base`. To
91
91
  change a value without editing the file, append to an overlay:
92
92
 
93
93
  ```
94
- aontu set '$.service.replicas=7' --entry prod.aon --overlay local.aon
94
+ aontu model set '$.service.replicas=7' --entry prod.aon --overlay local.aon
95
95
  ```
96
96
 
97
97
  If the value is PINNED rather than open, that command refuses and
98
98
  names the pinning site — which is the honest answer, and where
99
- `aontu why` takes you next.
99
+ `aontu model why` takes you next.
@@ -54,6 +54,6 @@ ranges meet to their overlap.
54
54
 
55
55
  ## Files
56
56
 
57
- `@"other.aon"` includes another document — it unifies in, it does not
57
+ `@"./other.aon"` includes another document — it unifies in, it does not
58
58
  concatenate. (A constrained decoder is not given this: generated
59
59
  documents describe values, they do not load files.)
@@ -16,10 +16,10 @@ cd "$(dirname "$0")"
16
16
  $AONTU vet --strict-coverage model.aon data.aon
17
17
 
18
18
  # 2. What does it say at a path?
19
- $AONTU get '$.entity.planet.table' data.aon
19
+ $AONTU model get '$.entity.planet.table' data.aon
20
20
 
21
21
  # 3. Why does it say that? Every contribution, with the line it is on.
22
- $AONTU why '$.entity.planet.table' data.aon
22
+ $AONTU model why '$.entity.planet.table' data.aon
23
23
 
24
24
  # 4. A pin for the truth: it survives reformatting and moves on any
25
25
  # change of meaning.
package/skill/tasks.md CHANGED
@@ -82,24 +82,29 @@ aontu trim --check model.aon # entries whose removal changes nothing
82
82
  ## Generate code from a model, and hold it
83
83
 
84
84
  ```
85
- aontu get out gen.aon # the component tree: files, and the lines in them
86
- aontu trace gen.aon # what rule wrote each line
85
+ aontu render gen.aon build # write the files below build/
86
+ aontu render --check gen.aon build # write nothing; exit 1 when build/ has drifted
87
+ aontu render gen/ build # every generator directly in gen/, as one run
88
+ aontu model get out gen.aon # the component tree: files, and the lines in them
89
+ aontu trace gen.aon # what rule wrote each line
87
90
  ```
88
91
 
89
92
  A generator answers a **component tree** -- `file(name, [lines])` and
90
- its neighbours -- which a generator runtime writes to disk. Hand the
91
- tree to one and compare with what is committed: the model is the truth,
92
- the code is the claim, and drift is a finding. `aontu trace` answers
93
- the other direction: for a line of the output, the model node and the
94
- rule behind it.
93
+ its neighbours -- which `aontu render` hands to jostraca, the generator
94
+ runtime, to write. A tree that is one file is written to the path
95
+ itself, and a folder of generators is one run. `--check` compares with
96
+ what is committed: the model is the
97
+ truth, the code is the claim, and drift is a finding. `aontu trace`
98
+ answers the other direction: for a line of the output, the model node
99
+ and the rule behind it.
95
100
 
96
101
  ## Ask what a model says, and why
97
102
 
98
103
  ```
99
- aontu get $.entity.planet.table model.aon
100
- aontu why $.entity.planet.table model.aon
101
- aontu get $.entity --keys model.aon
102
- aontu get $.entity --types model.aon
104
+ aontu model get $.entity.planet.table model.aon
105
+ aontu model why $.entity.planet.table model.aon
106
+ aontu model get $.entity --keys model.aon
107
+ aontu model get $.entity --types model.aon
103
108
  ```
104
109
 
105
110
  `why` names **every** contribution to a value, with the file and line
@@ -109,7 +114,7 @@ what you expected, and the second thing to run when `vet` refuses.
109
114
  ## Change a value without editing the file
110
115
 
111
116
  ```
112
- aontu set '$.entity.planet.table=planet_v2' --entry model.aon --overlay local.aon
117
+ aontu model set '$.entity.planet.table=planet_v2' --entry model.aon --overlay local.aon
113
118
  ```
114
119
 
115
120
  The change is checked before it is written; a change that contradicts
package/src/agentsmd.ts CHANGED
@@ -80,16 +80,16 @@ export function agentsMd(
80
80
  '',
81
81
  '```',
82
82
  '# what does it say at a path?',
83
- 'aontu get ' + example + ' ' + name,
83
+ 'aontu model get ' + example + ' ' + name,
84
84
  '',
85
85
  '# why does that value hold?',
86
- 'aontu why ' + example + ' ' + name,
86
+ 'aontu model why ' + example + ' ' + name,
87
87
  '',
88
88
  '# does my document satisfy it?',
89
89
  'aontu vet ' + name + ' mine.aon',
90
90
  '',
91
91
  '# change it without editing it',
92
- 'aontu set ' + example + '=<value> --entry ' + name +
92
+ 'aontu model set ' + example + '=<value> --entry ' + name +
93
93
  ' --overlay overlay.aon',
94
94
  '',
95
95
  '# the language itself, offline: the whole grammar on one page',
package/src/aontu.ts CHANGED
@@ -35,7 +35,7 @@ import { format, unifiedDiff } from './format'
35
35
  export type { LintFinding, FormatReport, FormatOptions } from './format'
36
36
 
37
37
 
38
- const VERSION = '0.64.0'
38
+ const VERSION = '0.66.0'
39
39
 
40
40
 
41
41
  function genQuiet(val: any, aontu: Aontu): any {