aontu 0.53.0 → 0.55.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 (197) hide show
  1. package/dist/aontu.d.ts +3 -2
  2. package/dist/aontu.js +36 -7
  3. package/dist/aontu.js.map +1 -1
  4. package/dist/cli.d.ts +2 -1
  5. package/dist/cli.js +500 -8
  6. package/dist/cli.js.map +1 -1
  7. package/dist/ctx.d.ts +5 -0
  8. package/dist/ctx.js +1 -0
  9. package/dist/ctx.js.map +1 -1
  10. package/dist/diff.js.map +1 -1
  11. package/dist/err.js +7 -1
  12. package/dist/err.js.map +1 -1
  13. package/dist/graph.d.ts +2 -5
  14. package/dist/graph.js +83 -46
  15. package/dist/graph.js.map +1 -1
  16. package/dist/hcanon.js +9 -10
  17. package/dist/hcanon.js.map +1 -1
  18. package/dist/hints.js +94 -26
  19. package/dist/hints.js.map +1 -1
  20. package/dist/jsonschema.js +34 -0
  21. package/dist/jsonschema.js.map +1 -1
  22. package/dist/lang.js +593 -191
  23. package/dist/lang.js.map +1 -1
  24. package/dist/lsp.d.ts +1 -1
  25. package/dist/lsp.js +86 -6
  26. package/dist/lsp.js.map +1 -1
  27. package/dist/mcp.js +153 -6
  28. package/dist/mcp.js.map +1 -1
  29. package/dist/mod-tool.js +42 -8
  30. package/dist/mod-tool.js.map +1 -1
  31. package/dist/mod.d.ts +4 -0
  32. package/dist/mod.js +97 -2
  33. package/dist/mod.js.map +1 -1
  34. package/dist/patch.d.ts +5 -0
  35. package/dist/patch.js +25 -25
  36. package/dist/patch.js.map +1 -1
  37. package/dist/provenance.d.ts +1 -0
  38. package/dist/provenance.js +2 -1
  39. package/dist/provenance.js.map +1 -1
  40. package/dist/query.js.map +1 -1
  41. package/dist/reach.d.ts +1 -0
  42. package/dist/reach.js +49 -21
  43. package/dist/reach.js.map +1 -1
  44. package/dist/relation.d.ts +4 -0
  45. package/dist/relation.js +125 -200
  46. package/dist/relation.js.map +1 -1
  47. package/dist/sig.d.ts +25 -0
  48. package/dist/sig.js +277 -0
  49. package/dist/sig.js.map +1 -0
  50. package/dist/sigdecl.d.ts +2 -0
  51. package/dist/sigdecl.js +11 -0
  52. package/dist/sigdecl.js.map +1 -0
  53. package/dist/siggate.d.ts +4 -0
  54. package/dist/siggate.js +90 -0
  55. package/dist/siggate.js.map +1 -0
  56. package/dist/std.js +75 -16
  57. package/dist/std.js.map +1 -1
  58. package/dist/subsume.js +57 -10
  59. package/dist/subsume.js.map +1 -1
  60. package/dist/tsconfig.tsbuildinfo +1 -1
  61. package/dist/unify.d.ts +2 -2
  62. package/dist/unify.js +93 -114
  63. package/dist/unify.js.map +1 -1
  64. package/dist/utility.d.ts +1 -2
  65. package/dist/utility.js +7 -61
  66. package/dist/utility.js.map +1 -1
  67. package/dist/val/AggFuncVal.d.ts +12 -1
  68. package/dist/val/AggFuncVal.js +165 -3
  69. package/dist/val/AggFuncVal.js.map +1 -1
  70. package/dist/val/BagVal.d.ts +2 -0
  71. package/dist/val/BagVal.js +56 -8
  72. package/dist/val/BagVal.js.map +1 -1
  73. package/dist/val/ConstraintVal.js +33 -5
  74. package/dist/val/ConstraintVal.js.map +1 -1
  75. package/dist/val/ContainerKindVal.d.ts +35 -0
  76. package/dist/val/ContainerKindVal.js +99 -0
  77. package/dist/val/ContainerKindVal.js.map +1 -0
  78. package/dist/val/CopyFuncVal.js +0 -7
  79. package/dist/val/CopyFuncVal.js.map +1 -1
  80. package/dist/val/DisjunctVal.d.ts +1 -2
  81. package/dist/val/DisjunctVal.js +146 -39
  82. package/dist/val/DisjunctVal.js.map +1 -1
  83. package/dist/val/ExpectVal.js +37 -2
  84. package/dist/val/ExpectVal.js.map +1 -1
  85. package/dist/val/FuncBaseVal.d.ts +1 -0
  86. package/dist/val/FuncBaseVal.js +19 -8
  87. package/dist/val/FuncBaseVal.js.map +1 -1
  88. package/dist/val/GraphAtomVal.d.ts +39 -0
  89. package/dist/val/GraphAtomVal.js +184 -0
  90. package/dist/val/GraphAtomVal.js.map +1 -0
  91. package/dist/val/JunctionVal.js +22 -5
  92. package/dist/val/JunctionVal.js.map +1 -1
  93. package/dist/val/ListVal.js +27 -34
  94. package/dist/val/ListVal.js.map +1 -1
  95. package/dist/val/MapVal.d.ts +1 -0
  96. package/dist/val/MapVal.js +82 -35
  97. package/dist/val/MapVal.js.map +1 -1
  98. package/dist/val/PathFuncVal.d.ts +2 -2
  99. package/dist/val/PathFuncVal.js +75 -16
  100. package/dist/val/PathFuncVal.js.map +1 -1
  101. package/dist/val/PathVal.d.ts +25 -0
  102. package/dist/val/PathVal.js +150 -0
  103. package/dist/val/PathVal.js.map +1 -0
  104. package/dist/val/PlusOpVal.d.ts +2 -1
  105. package/dist/val/PlusOpVal.js +50 -35
  106. package/dist/val/PlusOpVal.js.map +1 -1
  107. package/dist/val/PrefVal.d.ts +2 -0
  108. package/dist/val/PrefVal.js +159 -32
  109. package/dist/val/PrefVal.js.map +1 -1
  110. package/dist/val/RecurseVal.d.ts +19 -0
  111. package/dist/val/RecurseVal.js +217 -0
  112. package/dist/val/RecurseVal.js.map +1 -0
  113. package/dist/val/RefVal.d.ts +2 -1
  114. package/dist/val/RefVal.js +105 -72
  115. package/dist/val/RefVal.js.map +1 -1
  116. package/dist/val/ReferFuncVal.d.ts +30 -7
  117. package/dist/val/ReferFuncVal.js +395 -94
  118. package/dist/val/ReferFuncVal.js.map +1 -1
  119. package/dist/val/ScalarKindVal.d.ts +4 -2
  120. package/dist/val/ScalarKindVal.js +12 -1
  121. package/dist/val/ScalarKindVal.js.map +1 -1
  122. package/dist/val/SuperFuncVal.d.ts +4 -2
  123. package/dist/val/SuperFuncVal.js +118 -14
  124. package/dist/val/SuperFuncVal.js.map +1 -1
  125. package/dist/val/TopVal.d.ts +1 -1
  126. package/dist/val/Val.d.ts +2 -3
  127. package/dist/val/Val.js +39 -20
  128. package/dist/val/Val.js.map +1 -1
  129. package/dist/val/arith.js +4 -1
  130. package/dist/val/arith.js.map +1 -1
  131. package/dist/vet.d.ts +1 -0
  132. package/dist/vet.js +32 -1
  133. package/dist/vet.js.map +1 -1
  134. package/dist/view.d.ts +90 -0
  135. package/dist/view.js +2168 -0
  136. package/dist/view.js.map +1 -0
  137. package/grammar/aontu.gbnf +18 -10
  138. package/grammar/aontu.lark +15 -10
  139. package/grammar/aontu.tmLanguage.json +184 -0
  140. package/package.json +10 -3
  141. package/skill/grammar-card.md +1 -2
  142. package/src/aontu.ts +37 -7
  143. package/src/cli.ts +553 -8
  144. package/src/ctx.ts +20 -0
  145. package/src/diff.ts +4 -2
  146. package/src/err.ts +8 -1
  147. package/src/graph.ts +125 -75
  148. package/src/hcanon.ts +9 -11
  149. package/src/hints.ts +112 -29
  150. package/src/jsonschema.ts +41 -0
  151. package/src/lang.ts +642 -203
  152. package/src/lsp.ts +75 -6
  153. package/src/mcp.ts +164 -6
  154. package/src/mod-tool.ts +48 -9
  155. package/src/mod.ts +110 -1
  156. package/src/patch.ts +31 -27
  157. package/src/provenance.ts +8 -1
  158. package/src/query.ts +4 -2
  159. package/src/reach.ts +52 -23
  160. package/src/relation.ts +139 -236
  161. package/src/sig.ts +345 -0
  162. package/src/sigdecl.ts +11 -0
  163. package/src/siggate.ts +144 -0
  164. package/src/std.ts +77 -16
  165. package/src/subsume.ts +59 -10
  166. package/src/unify.ts +102 -125
  167. package/src/utility.ts +7 -67
  168. package/src/val/AggFuncVal.ts +231 -4
  169. package/src/val/BagVal.ts +58 -9
  170. package/src/val/ConstraintVal.ts +34 -5
  171. package/src/val/ContainerKindVal.ts +158 -0
  172. package/src/val/CopyFuncVal.ts +0 -7
  173. package/src/val/DisjunctVal.ts +152 -40
  174. package/src/val/ExpectVal.ts +39 -4
  175. package/src/val/FuncBaseVal.ts +21 -8
  176. package/src/val/GraphAtomVal.ts +264 -0
  177. package/src/val/JunctionVal.ts +23 -6
  178. package/src/val/ListVal.ts +30 -37
  179. package/src/val/MapVal.ts +87 -39
  180. package/src/val/PathFuncVal.ts +107 -19
  181. package/src/val/PathVal.ts +221 -0
  182. package/src/val/PlusOpVal.ts +56 -37
  183. package/src/val/PrefVal.ts +186 -38
  184. package/src/val/RecurseVal.ts +285 -0
  185. package/src/val/RefVal.ts +105 -83
  186. package/src/val/ReferFuncVal.ts +445 -100
  187. package/src/val/ScalarKindVal.ts +12 -0
  188. package/src/val/SuperFuncVal.ts +137 -13
  189. package/src/val/TopVal.ts +1 -1
  190. package/src/val/Val.ts +44 -35
  191. package/src/val/arith.ts +4 -1
  192. package/src/vet.ts +41 -4
  193. package/src/view.ts +2882 -0
  194. package/dist/val/IdFuncVal.d.ts +0 -13
  195. package/dist/val/IdFuncVal.js +0 -54
  196. package/dist/val/IdFuncVal.js.map +0 -1
  197. package/src/val/IdFuncVal.ts +0 -91
@@ -9,6 +9,8 @@ const err_1 = require("../err");
9
9
  const utility_1 = require("../utility");
10
10
  const top_1 = require("./top");
11
11
  const FeatureVal_1 = require("./FeatureVal");
12
+ const FuncBaseVal_1 = require("./FuncBaseVal");
13
+ const SuperFuncVal_1 = require("./SuperFuncVal");
12
14
  // The innermost preferred value under every pref layer: the value a
13
15
  // preference of ANY rank ultimately defends, and the one generation
14
16
  // emits for it. Shared by the disjunct admission gate (DisjunctVal),
@@ -21,6 +23,22 @@ function prefInnerPeg(v) {
21
23
  }
22
24
  return out;
23
25
  }
26
+ // A CONTAINER DEFAULT IS LEAFWISE (ADR-011 R3,
27
+ // docs/design/DEFAULTS.0.md): `*{p:1}` MEANS `{p: *1}` and `*[1]`
28
+ // means `[*1]`, so there is no such thing as a preference whose
29
+ // preferred value is a bag. Shape is not a value and takes no star --
30
+ // key optionality, closedness and a `&:` spread template ride through
31
+ // untouched; only the values a reader could override are defaulted.
32
+ //
33
+ // This is the rule `pref()` already had (its resolve walked and
34
+ // wrapped every scalar child) and the star prefix did not, so the two
35
+ // spellings of one operator disagreed: `pref({p:1}) & {q:2}` kept the
36
+ // `p` default and `*{p:1} & {q:2}` dropped it. Both spellings and the
37
+ // resolve-time case (`*$.shape`) come through here now, so they
38
+ // cannot drift apart again. Wrapping the non-bag arm rather than
39
+ // walking for scalars also closes the other half of that gap:
40
+ // `pref(integer)` and `pref(min(3))` used to answer the bare value,
41
+ // losing the preference outright.
24
42
  class PrefVal extends FeatureVal_1.FeatureVal {
25
43
  constructor(spec, ctx) {
26
44
  super(spec, ctx);
@@ -55,12 +73,21 @@ class PrefVal extends FeatureVal_1.FeatureVal {
55
73
  if (spec.peg instanceof PrefVal) {
56
74
  this.rank = 1 + spec.peg.rank;
57
75
  }
58
- this.resuper();
76
+ this.resuper(ctx);
59
77
  // console.log('PVC', this.peg.canon, this.superpeg.canon)
60
78
  }
61
79
  // Recompute the type yardstick and the override gate from the current
62
80
  // peg. Called again whenever the peg resolves (e.g. a ref).
63
- resuper() {
81
+ //
82
+ // THE GATE IS super() (ADR-011 R4, docs/design/DEFAULTS.0.md). `*x`
83
+ // is sugar for `*x | super(x)`, so the type an overriding peer must
84
+ // pass is the one the long form spells out loud -- one function, not
85
+ // a second implementation that agrees with it on the common case.
86
+ // Two special cases retired with the switch: a KIND peg gated
87
+ // nothing (`*integer` was overridden by `"s"`) and a CONSTRAINT peg
88
+ // had no gate at all, both written when a kind's superior was top.
89
+ // `super(integer)` is `number`, so `7` still wins and `"s"` refuses.
90
+ resuper(ctx) {
64
91
  // THE RANK-UNIFORM MEET (ADR-004). The yardstick is the INNERMOST
65
92
  // preferred value's kind, whatever the preference's rank: `**1.5`
66
93
  // defends `float` exactly as `*1.5` does. The old rule read the
@@ -72,23 +99,33 @@ class PrefVal extends FeatureVal_1.FeatureVal {
72
99
  // rank-1 spelling of the same document kept it. One rule, every
73
100
  // rank. Pinned by test/spec/pref.tsv (pref-rank2-* rows, and the
74
101
  // flipped pref-nested-concrete-wins).
102
+ // THE RANK-UNIFORM MEET (ADR-004) is unchanged: the yardstick is
103
+ // the INNERMOST preferred value, whatever the rank, so `**1.5`
104
+ // defends `float` exactly as `*1.5` does.
75
105
  let peg = this.peg;
76
106
  while (true === peg?.isPref) {
77
107
  peg = peg.peg;
78
108
  }
79
- // A preference whose peg is ITSELF a kind (`*integer`) constrains
80
- // nothing: there is no type-of-a-type in this lattice, so any peer
81
- // wins. (Pinned by test/spec/var.tsv:var-pref-kind-narrow. Before
82
- // the tower this fell out of a ScalarKindVal's superior being top;
83
- // now that a leaf kind lifts to `number`, it has to be said.)
84
- if (true === peg.isScalarKind) {
85
- this.superpeg = (0, top_1.top)();
86
- return;
109
+ const base = (0, SuperFuncVal_1.superOf)(ctx, peg);
110
+ // A gate that a meet has already narrowed stays narrowed: the
111
+ // override space only ever shrinks.
112
+ this.superpeg = null == this.narrowed ? base
113
+ : (0, unify_1.unite)(ctx, base, this.narrowed, 'pref-narrow/' + this.id);
114
+ }
115
+ // The default, standing but NARROWED: `*integer & 7` is `*7`, which
116
+ // is what the long form answers (`(integer&7) | (number&7)` keeps
117
+ // the star on the arm that survived). The rank rides across -- a
118
+ // ladder rung that narrows is still that rung.
119
+ // The rank is REBUILT as nesting rather than stamped: canon renders
120
+ // one star per layer (`'*' + peg.canon`), so a rank set directly on
121
+ // a single layer would print `*x` for a rank-2 default and the
122
+ // document would no longer round-trip.
123
+ restand(met, ctx) {
124
+ let out = met;
125
+ for (let rI = 0; rI <= this.rank; rI++) {
126
+ out = new PrefVal({ peg: out }, ctx);
87
127
  }
88
- // No optional chain: superior() is contractually non-null (every
89
- // Val returns one, a NilVal returning itself), so guarding against
90
- // nullish here would claim a possibility the type does not have.
91
- this.superpeg = peg.superior();
128
+ return this.place(out);
92
129
  }
93
130
  // PrefVal unify always returns a PrefVal
94
131
  // PrefVals can only be removed by becoming Nil in a Disjunct
@@ -101,8 +138,25 @@ class PrefVal extends FeatureVal_1.FeatureVal {
101
138
  const resolved = (0, unify_1.unite)(te ? ctx.clone({ explain: (0, utility_1.ec)(te, 'RES') }) : ctx, this.peg, (0, top_1.top)(), 'pref/resolve');
102
139
  // console.log('PREF-RESOLVED', this.peg.canon, '->', resolved)
103
140
  this.peg = resolved;
104
- this.resuper();
141
+ this.resuper(ctx);
105
142
  }
143
+ // A CONTAINER DEFAULT IS LEAFWISE IN EFFECT (ADR-011 R3), and it
144
+ // gets there through the meet above rather than through a rewrite.
145
+ // `*{p:1}` keeps its written shape -- canon prints `*{"p":1}` and
146
+ // reparses to itself, which a rewrite to `{p:*1}` would break, and
147
+ // an alternative still has a star for a disjunction to choose by.
148
+ // What makes it leafwise is that the two arms decide:
149
+ //
150
+ // `& {q:2}` the preferred value ITSELF admits the peer (maps
151
+ // merge), so the default stands as `*{p:1,q:2}` and
152
+ // `p` survives -- it used to be REPLACED outright.
153
+ // `& {p:2}` the preferred value refuses, so the gate answers:
154
+ // `super({p:1})` is `{p:integer}`, which admits it.
155
+ // `& "s"` both arms are empty, so the whole default is --
156
+ // a string used to override a map default silently.
157
+ //
158
+ // Which is every rule R3 asks for, with no bag ever standing where
159
+ // the author wrote a scalar and no canon that fails to round-trip.
106
160
  if (peer instanceof PrefVal) {
107
161
  why += 'pref-';
108
162
  if (this.id === peer.id) {
@@ -127,30 +181,93 @@ class PrefVal extends FeatureVal_1.FeatureVal {
127
181
  // this.peg.id, this.peg, this.peg.done,
128
182
  // peer.peg.id, peer.peg, peer.peg.done,
129
183
  // )
130
- let peg = (0, unify_1.unite)(te ? ctx.clone({ explain: (0, utility_1.ec)(te, 'PREF-PEER') }) : ctx, this.peg, peer.peg, 'pref-peer/' + this.id);
131
- out = new PrefVal({ peg }, ctx);
184
+ const peg = (0, FuncBaseVal_1.trialUnify)(ctx, prefInnerPeg(this).clone(ctx), prefInnerPeg(peer));
185
+ // TWO DEFAULTS OF EQUAL RANK THAT CANNOT AGREE (ADR-011 R2):
186
+ // the refusal is about the DEFAULTS, not about the values they
187
+ // happen to hold, and its hint names the fix -- rank one of
188
+ // them. Compatible pegs still fold (`*1 & *integer` is `*1`),
189
+ // and identical ones collapse, so only a real disagreement
190
+ // reaches this arm. The three spellings of it -- `*1 & *7`,
191
+ // `(*1|integer) & *7` and `*1|*7` -- used to answer a value
192
+ // conflict, the newcomer, and the newcomer again.
193
+ out = undefined === peg
194
+ ? (0, err_1.makeNilErr)(ctx, 'pref_rank_clash', this, peer, 'unify')
195
+ : this.restand(peg, ctx);
132
196
  // console.log('PREF-RANK-SAME-OUT', peg, peg.done, out, out.done)
133
197
  why += 'rank-same';
134
198
  }
135
199
  }
136
200
  else if (!peer.isTop) {
137
201
  why += 'super-';
138
- out = (0, unify_1.unite)(te ? ctx.clone({ explain: (0, utility_1.ec)(te, 'SUPER') }) : ctx, this.superpeg, peer, 'pref-super/' + this.id);
139
- // The peer added nothing beyond a type the preferred value already
140
- // satisfies (`*1 & integer`, `*1 & number`), so the preference
141
- // stands — as ITSELF, rank intact (ADR-004). Returning the peg
142
- // here (the old rule) demoted the preference to a concrete value
143
- // at rank 0 and to a lower rank above it, which both destroyed
144
- // overridability (`*1 & integer` then `2` was a conflict) and
145
- // broke the layered-defaults ladder: a team's `**debug|string`
146
- // meeting an env's `string` branch produced a rank-0 `*debug`
147
- // that then fought the env's own rank-0 `*warn` as an equal.
148
- // Anything else is a concrete override and wins (subject to the
149
- // disjunct admission gate in DisjunctVal).
150
- if (out.same(this.superpeg)) {
151
- out = this;
152
- why += 'same';
202
+ // THE MEET IS THE DESUGARING, DISTRIBUTED (ADR-011 R1,
203
+ // docs/design/DEFAULTS.0.md). `*x` stands for `*x | super(x)`,
204
+ // and a peer meets a disjunction arm by arm:
205
+ //
206
+ // (x & peer) | (super(x) & peer)
207
+ //
208
+ // THE FIRST ARM DECIDES. When the preferred value itself still
209
+ // satisfies the peer the default STANDS -- `*1 & integer`,
210
+ // `*8080 & min(1024)`, `**2 & neq(1)`: the peer narrowed the
211
+ // type without ruling the default out, which is the whole point
212
+ // of writing one. Only when that arm is empty does the second
213
+ // answer, and that is the override. When BOTH are empty nothing
214
+ // remains of the disjunction the star stands for -- `empty`,
215
+ // the same refusal the written-out long form gives.
216
+ //
217
+ // The old rule asked instead whether the peer resolved to
218
+ // exactly `super(x)`, so any narrowing at all counted as an
219
+ // override: `*1 & integer` stood (the peer WAS the gate) but
220
+ // `*8080 & min(1024)` silently dropped the default and answered
221
+ // the bare constraint, and a rank ladder lost its weaker arm to
222
+ // the same rule the moment anything narrowed it.
223
+ //
224
+ // Trialled against a CLONE, on the innermost value (the
225
+ // rank-uniform meet): the preferred value must stay pristine for
226
+ // the arm that stands, and a failed trial must not leave its
227
+ // errors on the context -- the DisjunctVal admission gate's own
228
+ // precedent, and its mechanism.
229
+ const met = (0, FuncBaseVal_1.trialUnify)(ctx, prefInnerPeg(this).clone(ctx), peer);
230
+ if (undefined !== met) {
231
+ // THE SECOND ARM IS CARRIED FORWARD, not discarded. It is the
232
+ // override space -- everything the peer would still admit
233
+ // INSTEAD of the default -- and meeting a peer narrows it just
234
+ // as it narrows the default: two successive meets compose to
235
+ // `(x & p1 & p2) | (super(x) & p1 & p2)`, which is the
236
+ // distribution over both. Dropping it let a constraint that
237
+ // arrived beside a default vanish: `r:*2` with `r:max(20)`
238
+ // stood as a bare `*2`, and `r:40` then overrode it through a
239
+ // gate that no longer remembered the bound.
240
+ //
241
+ // It cannot fail: the first arm succeeded, so `x & peer` has a
242
+ // value, and that value satisfies `super(x)` and `peer` both.
243
+ const gate = (0, unify_1.unite)(te ? ctx.clone({ explain: (0, utility_1.ec)(te, 'GATE') }) : ctx, this.superpeg.clone(ctx), peer, 'pref-gate/' + this.id);
244
+ // Unchanged on both counts is the SAME preference, returned as
245
+ // itself: minting a new one every pass would keep the fixpoint
246
+ // moving for ever.
247
+ if (met.same(prefInnerPeg(this)) && gate.same(this.superpeg)) {
248
+ out = this;
249
+ }
250
+ else {
251
+ const stood = this.restand(met, ctx);
252
+ stood.narrowed = gate;
253
+ stood.superpeg = gate;
254
+ out = stood;
255
+ }
256
+ why += 'stands';
257
+ (0, utility_1.explainClose)(te, out);
258
+ out.dc = type_1.DONE;
259
+ return out;
153
260
  }
261
+ // The override arm is trialled too: its failure is not the
262
+ // answer, it is half of the reason the answer is `empty`, and a
263
+ // recorded `no_scalar_unify` would be the code the reader sees
264
+ // however the refusal is relabelled afterwards.
265
+ const over = (0, FuncBaseVal_1.trialUnify)(ctx, this.superpeg.clone(ctx), peer);
266
+ out = undefined !== over ? over
267
+ // A peer that arrived already failed keeps its own refusal:
268
+ // that is its failure, not the default's.
269
+ : peer.isNil ? peer
270
+ : (0, err_1.makeNilErr)(ctx, 'empty', this, peer, 'unify');
154
271
  // }
155
272
  }
156
273
  else {
@@ -173,6 +290,16 @@ class PrefVal extends FeatureVal_1.FeatureVal {
173
290
  }
174
291
  clone(ctx, spec) {
175
292
  let out = super.clone(ctx, spec);
293
+ // THE NARROWED OVERRIDE SPACE TRAVELS WITH THE COPY (ADR-011 R1).
294
+ // A default a meet has pinned stays pinned through a reference:
295
+ // without this, `T:{e:***false & false}` copied by `f:$.T` handed
296
+ // back a default whose gate had widened again to `boolean`, and
297
+ // `f:{e:true}` overrode a value the author had pinned. The Go
298
+ // twin carries the same two fields explicitly (clone.go).
299
+ if (null != this.narrowed) {
300
+ out.narrowed = this.narrowed;
301
+ out.superpeg = this.superpeg;
302
+ }
176
303
  // THE PER-DESTINATION INSTANTIATION RULE (ADR-005). The default
177
304
  // clone shares the preferred value (`peg: this.peg` in Val.clone)
178
305
  // — a cloned pref spread template resolves its inner value at the
@@ -1 +1 @@
1
- {"version":3,"file":"PrefVal.js","sourceRoot":"","sources":["../../src/val/PrefVal.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;QAoRvD,YAAY;AA7Qd,kCAEgB;AAGhB,oCAAgC;AAChC,gCAAmC;AAEnC,wCAImB;AAGnB,+BAA2B;AAE3B,6CAAyC;AAGzC,oEAAoE;AACpE,oEAAoE;AACpE,qEAAqE;AACrE,wEAAwE;AACxE,uEAAuE;AACvE,SAAS,YAAY,CAAC,CAAM;IAC1B,IAAI,GAAG,GAAQ,CAAC,CAAA;IAChB,OAAO,IAAI,KAAK,GAAG,EAAE,MAAM,EAAE,CAAC;QAC5B,GAAG,GAA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B;QACpB,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;QAElB,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;YACd,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;gBAChB,MAAM,IAAI,gBAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;QAED,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACrB,CAAC;CACF,CAAC,iCAAiC;QAIjC,OAAO"}
@@ -0,0 +1,19 @@
1
+ import type { Val, ValSpec } from '../type';
2
+ import { AontuContext } from '../ctx';
3
+ import { FeatureVal } from './FeatureVal';
4
+ declare class RecurseVal extends FeatureVal {
5
+ isRecurse: boolean;
6
+ isGenable: boolean;
7
+ cjo: number;
8
+ target: string[];
9
+ xc: number;
10
+ constructor(spec: ValSpec, ctx?: AontuContext);
11
+ clone(ctx: AontuContext, spec?: ValSpec): Val;
12
+ private body;
13
+ unify(peer: Val, ctx: AontuContext): Val;
14
+ get canon(): string;
15
+ gen(ctx: AontuContext): undefined;
16
+ }
17
+ declare function bumpRecurse(v: any, xc: number): void;
18
+ declare function containsRecurseOf(v: any, target: string[], depth?: number): boolean;
19
+ export { RecurseVal, bumpRecurse, containsRecurseOf, };
@@ -0,0 +1,217 @@
1
+ "use strict";
2
+ /* Copyright (c) 2025 Richard Rodger, MIT License */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.RecurseVal = void 0;
5
+ exports.bumpRecurse = bumpRecurse;
6
+ exports.containsRecurseOf = containsRecurseOf;
7
+ const type_1 = require("../type");
8
+ const err_1 = require("../err");
9
+ const FeatureVal_1 = require("./FeatureVal");
10
+ const ConjunctVal_1 = require("./ConjunctVal");
11
+ const unify_1 = require("../unify");
12
+ const utility_1 = require("../utility");
13
+ class RecurseVal extends FeatureVal_1.FeatureVal {
14
+ constructor(spec, ctx) {
15
+ super(spec, ctx);
16
+ this.isRecurse = true;
17
+ this.isGenable = true;
18
+ // LAST in a conjunct fold, after even the graph atoms: the residual
19
+ // wants to see the assembled concrete structure it expands against.
20
+ this.cjo = 47000;
21
+ this.target = spec.target ?? [];
22
+ this.xc = spec.xc ?? 0;
23
+ // A settled residual: a type() body carrying one must settle, and
24
+ // an unmet recursion is its own value until data arrives.
25
+ this.dc = type_1.DONE;
26
+ }
27
+ clone(ctx, spec) {
28
+ const out = super.clone(ctx, spec);
29
+ out.target = this.target;
30
+ out.xc = this.xc;
31
+ return out;
32
+ }
33
+ // The schema body the target names, from the ROOT: the fixpoint is
34
+ // over the finished definition, and the definition's own residual
35
+ // keeps it finite. When the root does not contain the target -- the
36
+ // residual was LIFTED out of its defining tree, as vet's anchored
37
+ // meet does -- fall back to ctx._fixroot, the settled tree the
38
+ // lifter kept for exactly this walk.
39
+ body(ctx) {
40
+ return walkTarget(ctx.root, this.target)
41
+ ?? walkTarget(ctx._fixroot, this.target);
42
+ }
43
+ unify(peer, ctx) {
44
+ const p = peer;
45
+ // The self-drive: nothing to advance -- the residual waits for
46
+ // structure. (A null/nil peer never arrives; unite's ladder
47
+ // absorbs both.)
48
+ if (null == peer || true === p.isTop) {
49
+ return this;
50
+ }
51
+ // The same fixpoint twice is one fixpoint.
52
+ if (true === p.isRecurse) {
53
+ if (this.target.length === p.target.length
54
+ && this.target.every((s, i) => s === p.target[i])) {
55
+ return this;
56
+ }
57
+ // Different targets -- mutual recursion meeting -- are BOTH
58
+ // held: each expands as data arrives, through the fold that
59
+ // keeps a conjunct's members separate.
60
+ const out = new ConjunctVal_1.ConjunctVal({ peg: [this, peer] }, ctx);
61
+ (0, utility_1.propagateMarks)(this, out);
62
+ out.path = this.path;
63
+ return out;
64
+ }
65
+ // CONCRETE STRUCTURE: expand one level against it.
66
+ if (true === p.isMap || true === p.isList || true === p.isScalar) {
67
+ if (ctx.budget.depth <= this.xc) {
68
+ return (0, err_1.makeNilErr)(ctx, 'recursion_budget', this, peer, 'recurse', { target: '$.' + this.target.join('.') });
69
+ }
70
+ const body = this.body(ctx);
71
+ if (undefined === body) {
72
+ // The definition has not assembled yet (an early pass): hold
73
+ // the peer beside the residual and try again when it has.
74
+ const out = new ConjunctVal_1.ConjunctVal({ peg: [this, peer] }, ctx);
75
+ (0, utility_1.propagateMarks)(this, out);
76
+ out.path = this.path;
77
+ return out;
78
+ }
79
+ // ADR-005's clone discipline: the expansion is a per-destination
80
+ // instantiation, so the definition itself is never written
81
+ // into. The clone's type/hide marks are CLEARED at every depth,
82
+ // exactly as a plain reference copy clears them (concreteFlow's
83
+ // rule): the schema is hidden, the instances it expands into
84
+ // are the output.
85
+ // The clone is REBASED to the DRIVE path explicitly (spec.path;
86
+ // the Go twin passes cp(r.path), whose stored paths its clone
87
+ // arms keep clean): the default rebase slices the definition's
88
+ // path by the destination's length, which leaks definition
89
+ // segments into instance paths whenever the destination is
90
+ // shallower -- a residual carried inside a copied definition
91
+ // body (`chain: $.spec.Step` inside Policy, copied to a slot
92
+ // shallower than the definition) reported
93
+ // `$.payments_policy.Policy.chain.then.approver` for the
94
+ // finding Go placed at `$.payments_policy.chain.then.approver`.
95
+ // The drive path is also right under vet's anchored meet, which
96
+ // drives AT the anchor's own path (see vet.ts), so anchored
97
+ // findings land in the schema's namespace in both ports.
98
+ const level = body.clone(ctx, {
99
+ dup: true, path: [...ctx.path],
100
+ });
101
+ (0, utility_1.walk)(level, (_key, v) => {
102
+ v.mark.type = false;
103
+ v.mark.hide = false;
104
+ return v;
105
+ });
106
+ bumpRecurse(level, this.xc + 1);
107
+ return (0, unify_1.unite)(ctx, level, peer, 'recurse-expand');
108
+ }
109
+ // Anything else -- a func still resolving, a reference, a
110
+ // constraint -- waits beside the residual.
111
+ const out = new ConjunctVal_1.ConjunctVal({ peg: [this, peer] }, ctx);
112
+ (0, utility_1.propagateMarks)(this, out);
113
+ out.path = this.path;
114
+ return out;
115
+ }
116
+ get canon() {
117
+ return '$.' + this.target.join('.');
118
+ }
119
+ gen(ctx) {
120
+ // An unexpanded residual in a demanded position refuses;
121
+ // guardedness is emergent -- under an optional key the bag's
122
+ // isolated context swallows this and drops the key.
123
+ (0, err_1.makeNilErr)(ctx, 'recursion_unexpanded', this, undefined, 'recurse', { target: '$.' + this.target.join('.') });
124
+ return undefined;
125
+ }
126
+ }
127
+ exports.RecurseVal = RecurseVal;
128
+ // walkTarget descends a tree by the residual's absolute target path,
129
+ // answering the definition node or undefined.
130
+ function walkTarget(root, target) {
131
+ let node = root;
132
+ for (const seg of target) {
133
+ node = node?.peg?.[seg];
134
+ }
135
+ return null != node && true === node.isVal ? node : undefined;
136
+ }
137
+ // bumpRecurse stamps the expansion depth onto every residual inside a
138
+ // freshly cloned level, so descent is charged along the chain.
139
+ function bumpRecurse(v, xc) {
140
+ if (null == v || true !== v.isVal) {
141
+ return;
142
+ }
143
+ if (true === v.isRecurse) {
144
+ v.xc = Math.max(v.xc, xc);
145
+ return;
146
+ }
147
+ const peg = v.peg;
148
+ if (true === v.isMap && null != peg) {
149
+ for (const k of Object.keys(peg)) {
150
+ bumpRecurse(peg[k], xc);
151
+ }
152
+ }
153
+ else if (true === v.isList && Array.isArray(peg)) {
154
+ for (const e of peg) {
155
+ bumpRecurse(e, xc);
156
+ }
157
+ }
158
+ else if (true === v.isConjunct && Array.isArray(peg)) {
159
+ for (const e of peg) {
160
+ bumpRecurse(e, xc);
161
+ }
162
+ }
163
+ if (null != v.spread?.cj) {
164
+ bumpRecurse(v.spread.cj, xc);
165
+ }
166
+ }
167
+ // containsRecurseOf answers whether a definition holds a residual of
168
+ // the given target -- i.e. the definition is (transitively) the
169
+ // fixpoint that target names. A reference RESOLVING to such a
170
+ // definition must itself answer the residual: cloned instead, every
171
+ // reparse of a canon unrolled the schema one more level and canon
172
+ // never converged.
173
+ function containsRecurseOf(v, target, depth) {
174
+ const d = depth ?? 0;
175
+ if (null == v || true !== v.isVal || 8 < d) {
176
+ return false;
177
+ }
178
+ if (true === v.isRecurse) {
179
+ return v.target.length === target.length
180
+ && v.target.every((s, i) => s === target[i]);
181
+ }
182
+ // A RAW REFERENCE to the target IS the recursion, minted or not:
183
+ // the answer must not depend on whether the definition's own
184
+ // prefix position has been visited yet. Without this arm the
185
+ // answer was ORDER-DEPENDENT -- reparsing a generated canon puts
186
+ // the instance before the definition, its trailing `$.spec.Step`
187
+ // leaves resolved before `Step.then` had minted, and each resolve
188
+ // cloned one more unrolled level until the unify depth guard
189
+ // (unify_cycle) killed the document.
190
+ if (true === v.isRef && Array.isArray(v.peg)) {
191
+ if (v.peg.length === target.length
192
+ && v.peg.every((s, i) => s === target[i])) {
193
+ return true;
194
+ }
195
+ }
196
+ const peg = v.peg;
197
+ if (true === v.isMap && null != peg) {
198
+ for (const k of Object.keys(peg)) {
199
+ if (containsRecurseOf(peg[k], target, d + 1)) {
200
+ return true;
201
+ }
202
+ }
203
+ }
204
+ else if ((true === v.isList || true === v.isConjunct || true === v.isDisjunct)
205
+ && Array.isArray(peg)) {
206
+ for (const e of peg) {
207
+ if (containsRecurseOf(e, target, d + 1)) {
208
+ return true;
209
+ }
210
+ }
211
+ }
212
+ if (null != v.spread?.cj && containsRecurseOf(v.spread.cj, target, d + 1)) {
213
+ return true;
214
+ }
215
+ return false;
216
+ } /* node:coverage ignore next 7 */
217
+ //# sourceMappingURL=RecurseVal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecurseVal.js","sourceRoot":"","sources":["../../src/val/RecurseVal.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;QA0RlD,WAAW;QACX,iBAAiB;AAzPnB,kCAEgB;AAMhB,gCAAmC;AAEnC,6CAAyC;AACzC,+CAA2C;AAC3C,oCAAgC;AAChC,wCAAiD;AAGjD,MAAM,UAAW,SAAQ,uBAAU;IAcjC,YAAY,IAAa,EAAE,GAAkB;QAC3C,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QAdlB,cAAS,GAAG,IAAI,CAAA;QAChB,cAAS,GAAG,IAAI,CAAA;QAChB,oEAAoE;QACpE,oEAAoE;QACpE,QA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EAAE,CAAC;gBACxC,OAAO,IAAI,CAAA;YACb,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAI,IAAI,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAC1E,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAC,iCAAiC"}
@@ -1,6 +1,7 @@
1
1
  import type { Val, ValSpec } from '../type';
2
2
  import { AontuContext } from '../ctx';
3
3
  import { FeatureVal } from './FeatureVal';
4
+ declare function pendingMarkWrapper(v: any): boolean;
4
5
  declare class RefVal extends FeatureVal {
5
6
  isRef: boolean;
6
7
  isGenable: boolean;
@@ -23,4 +24,4 @@ declare class RefVal extends FeatureVal {
23
24
  gen(ctx: AontuContext): undefined;
24
25
  inspection(): string;
25
26
  }
26
- export { RefVal, };
27
+ export { pendingMarkWrapper, RefVal, };