@intentius/tsad-conformance 1.4.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 (257) hide show
  1. package/README.md +59 -0
  2. package/dist/adapter.d.ts +65 -0
  3. package/dist/adapter.d.ts.map +1 -0
  4. package/dist/adapter.js +2 -0
  5. package/dist/adapter.js.map +1 -0
  6. package/dist/bundled.d.ts +5 -0
  7. package/dist/bundled.d.ts.map +1 -0
  8. package/dist/bundled.js +28 -0
  9. package/dist/bundled.js.map +1 -0
  10. package/dist/fixture.d.ts +49 -0
  11. package/dist/fixture.d.ts.map +1 -0
  12. package/dist/fixture.js +95 -0
  13. package/dist/fixture.js.map +1 -0
  14. package/dist/host.d.ts +33 -0
  15. package/dist/host.d.ts.map +1 -0
  16. package/dist/host.js +79 -0
  17. package/dist/host.js.map +1 -0
  18. package/dist/index.d.ts +7 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +7 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/rules.d.ts +46 -0
  23. package/dist/rules.d.ts.map +1 -0
  24. package/dist/rules.js +135 -0
  25. package/dist/rules.js.map +1 -0
  26. package/dist/runner.d.ts +26 -0
  27. package/dist/runner.d.ts.map +1 -0
  28. package/dist/runner.js +152 -0
  29. package/dist/runner.js.map +1 -0
  30. package/fixtures/F-CallLeak/a-call-returns-a-live-object/expect.json +8 -0
  31. package/fixtures/F-CallLeak/a-call-returns-a-live-object/project/caller.ts +5 -0
  32. package/fixtures/F-CallLeak/a-call-returns-a-live-object/project/leaky.ts +7 -0
  33. package/fixtures/F-CallLeak/a-call-returns-a-live-object/project/pure.ts +5 -0
  34. package/fixtures/F-Cycle/mutual-imports/expect.json +6 -0
  35. package/fixtures/F-Cycle/mutual-imports/project/a.ts +3 -0
  36. package/fixtures/F-Cycle/mutual-imports/project/b.ts +3 -0
  37. package/fixtures/F-Depth/exhaustion-is-a-fallback/expect.json +19 -0
  38. package/fixtures/F-Depth/exhaustion-is-a-fallback/project/deep.ts +3 -0
  39. package/fixtures/F-Depth/exhaustion-is-a-fallback/project/rec.ts +3 -0
  40. package/fixtures/F-Div-Depth/new-inside-function-body/expect.json +21 -0
  41. package/fixtures/F-Div-Depth/new-inside-function-body/project/app.ts +3 -0
  42. package/fixtures/F-Div-Depth/new-inside-function-body/project/fn.ts +3 -0
  43. package/fixtures/F-Div-Eager/referenced-not-called/expect.json +8 -0
  44. package/fixtures/F-Div-Eager/referenced-not-called/project/app.ts +3 -0
  45. package/fixtures/F-Div-NsNew/namespace-callee/expect.json +18 -0
  46. package/fixtures/F-Div-NsNew/namespace-callee/input.ts +3 -0
  47. package/fixtures/F-Div-Provenance/helper-name-from-project-import/expect.json +20 -0
  48. package/fixtures/F-Div-Provenance/helper-name-from-project-import/project/app.ts +3 -0
  49. package/fixtures/F-Div-Provenance/helper-name-from-project-import/project/local.ts +3 -0
  50. package/fixtures/F-Div-SameFileNew/no-module-graph/expect.json +8 -0
  51. package/fixtures/F-Div-SameFileNew/no-module-graph/input.ts +5 -0
  52. package/fixtures/F-Div-Tag/unregistered-tag/expect.json +15 -0
  53. package/fixtures/F-Div-Tag/unregistered-tag/input.ts +1 -0
  54. package/fixtures/F-Eval-Array/spread-string-rejected/expect.json +14 -0
  55. package/fixtures/F-Eval-Array/spread-string-rejected/input.ts +1 -0
  56. package/fixtures/F-Eval-Binary/division-and-float/expect.json +19 -0
  57. package/fixtures/F-Eval-Binary/division-and-float/input.ts +1 -0
  58. package/fixtures/F-Eval-Binary/logical-return-operand/expect.json +20 -0
  59. package/fixtures/F-Eval-Binary/logical-return-operand/input.ts +1 -0
  60. package/fixtures/F-Eval-Binary/plus-dispatch/expect.json +19 -0
  61. package/fixtures/F-Eval-Binary/plus-dispatch/input.ts +1 -0
  62. package/fixtures/F-Eval-Binary/relational-on-strings/expect.json +18 -0
  63. package/fixtures/F-Eval-Binary/relational-on-strings/input.ts +1 -0
  64. package/fixtures/F-Eval-CallEager/evaluated-at-fold-time/expect.json +8 -0
  65. package/fixtures/F-Eval-CallEager/evaluated-at-fold-time/project/app.ts +3 -0
  66. package/fixtures/F-Eval-CallEager/not-a-function/expect.json +22 -0
  67. package/fixtures/F-Eval-CallEager/not-a-function/project/app.ts +3 -0
  68. package/fixtures/F-Eval-CallEager/not-a-function/project/local.ts +1 -0
  69. package/fixtures/F-Eval-CallHelper/helper-folds/expect.json +8 -0
  70. package/fixtures/F-Eval-CallHelper/helper-folds/project/app.ts +3 -0
  71. package/fixtures/F-Eval-CallHelper/inside-function-body/expect.json +22 -0
  72. package/fixtures/F-Eval-CallHelper/inside-function-body/project/app.ts +3 -0
  73. package/fixtures/F-Eval-CallHelper/inside-function-body/project/fn.ts +5 -0
  74. package/fixtures/F-Eval-CallIntrinsic/call-form-folds/expect.json +8 -0
  75. package/fixtures/F-Eval-CallIntrinsic/call-form-folds/project/app.ts +3 -0
  76. package/fixtures/F-Eval-CallIntrinsic/inside-function-body/expect.json +22 -0
  77. package/fixtures/F-Eval-CallIntrinsic/inside-function-body/project/app.ts +3 -0
  78. package/fixtures/F-Eval-CallIntrinsic/inside-function-body/project/fn.ts +5 -0
  79. package/fixtures/F-Eval-CallLocal/local-function-folds/expect.json +7 -0
  80. package/fixtures/F-Eval-CallLocal/local-function-folds/project/app.ts +3 -0
  81. package/fixtures/F-Eval-CallLocal/local-function-folds/project/pure.ts +3 -0
  82. package/fixtures/F-Eval-CallLocal/recursion-folds/expect.json +17 -0
  83. package/fixtures/F-Eval-CallLocal/recursion-folds/project/rec.ts +3 -0
  84. package/fixtures/F-Eval-CallLocal/recursion-folds/project/shallow.ts +3 -0
  85. package/fixtures/F-Eval-CallLocal/spread-argument-rejected/expect.json +20 -0
  86. package/fixtures/F-Eval-CallLocal/spread-argument-rejected/project/app.ts +5 -0
  87. package/fixtures/F-Eval-CallLocal/spread-argument-rejected/project/pure.ts +3 -0
  88. package/fixtures/F-Eval-CallMethod/method-missing/expect.json +17 -0
  89. package/fixtures/F-Eval-CallMethod/method-missing/input.ts +1 -0
  90. package/fixtures/F-Eval-CallMethod/null-receiver-dot/expect.json +13 -0
  91. package/fixtures/F-Eval-CallMethod/null-receiver-dot/input.ts +2 -0
  92. package/fixtures/F-Eval-CallMethod/null-receiver-optional/expect.json +2 -0
  93. package/fixtures/F-Eval-CallMethod/null-receiver-optional/input.ts +2 -0
  94. package/fixtures/F-Eval-CallMethod/real-receiver/expect.json +2 -0
  95. package/fixtures/F-Eval-CallMethod/real-receiver/input.ts +1 -0
  96. package/fixtures/F-Eval-Template/number-formatting/expect.json +11 -0
  97. package/fixtures/F-Eval-Template/number-formatting/input.ts +1 -0
  98. package/fixtures/F-Eval-Template/tostring-of-non-numbers/expect.json +10 -0
  99. package/fixtures/F-Eval-Template/tostring-of-non-numbers/input.ts +1 -0
  100. package/fixtures/F-Eval-Unary/coercion/expect.json +19 -0
  101. package/fixtures/F-Eval-Unary/coercion/input.ts +1 -0
  102. package/fixtures/F-Eval-Undefined/bare-undefined/expect.json +2 -0
  103. package/fixtures/F-Eval-Undefined/bare-undefined/input.ts +1 -0
  104. package/fixtures/F-Exc-Registry/call-form-without-registry/expect.json +15 -0
  105. package/fixtures/F-Exc-Registry/call-form-without-registry/input.ts +1 -0
  106. package/fixtures/F-Host-Closed-vs-Open/package-call-is-closed/expect.json +9 -0
  107. package/fixtures/F-Host-Closed-vs-Open/package-call-is-closed/project/closed.ts +3 -0
  108. package/fixtures/F-Host-Closed-vs-Open/package-call-is-closed/project/open.ts +3 -0
  109. package/fixtures/F-Host-Closed-vs-Open/package-call-is-closed/project/pure.ts +3 -0
  110. package/fixtures/F-Host-DataExports/plain-data-export/expect.json +8 -0
  111. package/fixtures/F-Host-DataExports/plain-data-export/project/app.ts +3 -0
  112. package/fixtures/F-Host-Registry/tag-called-as-function/expect.json +8 -0
  113. package/fixtures/F-Host-Registry/tag-called-as-function/project/app.ts +3 -0
  114. package/fixtures/F-Host-Trust/unowned-package/expect.json +6 -0
  115. package/fixtures/F-Host-Trust/unowned-package/project/app.ts +3 -0
  116. package/fixtures/F-Namespace/synthetic-namespace-object/expect.json +7 -0
  117. package/fixtures/F-Namespace/synthetic-namespace-object/project/use.ts +3 -0
  118. package/fixtures/F-Namespace/synthetic-namespace-object/project/values.ts +2 -0
  119. package/fixtures/F-NoExports/nothing-to-produce/expect.json +7 -0
  120. package/fixtures/F-NoExports/nothing-to-produce/project/defaulted.ts +1 -0
  121. package/fixtures/F-NoExports/nothing-to-produce/project/empty.ts +3 -0
  122. package/fixtures/F-Prebuild/same-file-construction-shared/expect.json +19 -0
  123. package/fixtures/F-Prebuild/same-file-construction-shared/project/shared.ts +6 -0
  124. package/fixtures/F-Profile-DataHost/plain-data-across-files/expect.json +39 -0
  125. package/fixtures/F-Profile-DataHost/plain-data-across-files/project/defaults.ts +5 -0
  126. package/fixtures/F-Profile-DataHost/plain-data-across-files/project/service.ts +10 -0
  127. package/fixtures/F-Seed/seeded-by-its-own-body/expect.json +8 -0
  128. package/fixtures/F-Seed/seeded-by-its-own-body/project/app.ts +8 -0
  129. package/fixtures/F-Seed/seeded-by-its-own-body/project/lone.ts +1 -0
  130. package/fixtures/F-Succ/backward-along-captures/expect.json +26 -0
  131. package/fixtures/F-Succ/backward-along-captures/project/breaker.ts +10 -0
  132. package/fixtures/F-Succ/backward-along-captures/project/shared.ts +1 -0
  133. package/fixtures/F-Succ/backward-along-captures/project/sibling.ts +3 -0
  134. package/fixtures/F-Succ/forward-into-imports/expect.json +8 -0
  135. package/fixtures/F-Succ/forward-into-imports/project/app.ts +10 -0
  136. package/fixtures/F-Succ/forward-into-imports/project/config.ts +1 -0
  137. package/fixtures/F-Taint/independent-file-still-folds/expect.json +9 -0
  138. package/fixtures/F-Taint/independent-file-still-folds/project/alone.ts +1 -0
  139. package/fixtures/F-Taint/independent-file-still-folds/project/app.ts +8 -0
  140. package/fixtures/F-Total/one-bad-declarator-fails-the-file/expect.json +7 -0
  141. package/fixtures/F-Total/one-bad-declarator-fails-the-file/project/mixed.ts +3 -0
  142. package/fixtures/F-Val-Arity/props-attributes-and-spread/expect.json +14 -0
  143. package/fixtures/F-Val-Arity/props-attributes-and-spread/project/arities.ts +5 -0
  144. package/fixtures/F-Val-Callable/host-function-as-value/expect.json +16 -0
  145. package/fixtures/F-Val-Callable/host-function-as-value/project/app.ts +3 -0
  146. package/fixtures/F-Val-Fate/revive-every-envelope/expect.json +15 -0
  147. package/fixtures/F-Val-Fate/revive-every-envelope/project/entities.ts +6 -0
  148. package/fixtures/F-Val-Live/plain-data-is-not-live/expect.json +9 -0
  149. package/fixtures/F-Val-Live/plain-data-is-not-live/project/breaker.ts +10 -0
  150. package/fixtures/F-Val-Live/plain-data-is-not-live/project/quiet.ts +3 -0
  151. package/fixtures/F-Val-Live/plain-data-is-not-live/project/source.ts +5 -0
  152. package/fixtures/F-Val-Position/attrref-in-host-arguments/expect.json +8 -0
  153. package/fixtures/F-Val-Position/attrref-in-host-arguments/project/rejected.ts +4 -0
  154. package/fixtures/F-Val-Undefined/array-element-undefined/expect.json +15 -0
  155. package/fixtures/F-Val-Undefined/array-element-undefined/input.ts +1 -0
  156. package/fixtures/F-Val-Undefined/conditional-yields-undefined/expect.json +13 -0
  157. package/fixtures/F-Val-Undefined/conditional-yields-undefined/input.ts +2 -0
  158. package/fixtures/F-Val-Undefined/optional-chain-yields-undefined-property/expect.json +13 -0
  159. package/fixtures/F-Val-Undefined/optional-chain-yields-undefined-property/input.ts +2 -0
  160. package/fixtures/F-Val-Undefined/property-literal-undefined/expect.json +16 -0
  161. package/fixtures/F-Val-Undefined/property-literal-undefined/input.ts +1 -0
  162. package/fixtures/F-Val-Undefined/spread-carries-undefined/expect.json +14 -0
  163. package/fixtures/F-Val-Undefined/spread-carries-undefined/input.ts +2 -0
  164. package/fixtures/S-Array/spread/expect.json +1 -0
  165. package/fixtures/S-Array/spread/input.ts +1 -0
  166. package/fixtures/S-Binary/arithmetic-and-concat/expect.json +1 -0
  167. package/fixtures/S-Binary/arithmetic-and-concat/input.ts +1 -0
  168. package/fixtures/S-Binary/lazy-untaken-unfoldable/expect.json +1 -0
  169. package/fixtures/S-Binary/lazy-untaken-unfoldable/input.ts +1 -0
  170. package/fixtures/S-Binary/nullish-coalesce/expect.json +1 -0
  171. package/fixtures/S-Binary/nullish-coalesce/input.ts +1 -0
  172. package/fixtures/S-CallLocal/imported-callee-is-shape-valid/expect.json +10 -0
  173. package/fixtures/S-CallLocal/imported-callee-is-shape-valid/input.ts +3 -0
  174. package/fixtures/S-Conditional/taken-branch-only/expect.json +1 -0
  175. package/fixtures/S-Conditional/taken-branch-only/input.ts +1 -0
  176. package/fixtures/S-ExportDefault/imported-by-sibling/expect.json +30 -0
  177. package/fixtures/S-ExportDefault/imported-by-sibling/project/app.ts +3 -0
  178. package/fixtures/S-ExportDefault/imported-by-sibling/project/policy.ts +1 -0
  179. package/fixtures/S-ExportDefault/plain-object/expect.json +21 -0
  180. package/fixtures/S-ExportDefault/plain-object/input.ts +1 -0
  181. package/fixtures/S-Ident/const-chain/expect.json +1 -0
  182. package/fixtures/S-Ident/const-chain/input.ts +1 -0
  183. package/fixtures/S-Ident/process/expect.json +1 -0
  184. package/fixtures/S-Ident/process/input.ts +1 -0
  185. package/fixtures/S-Ident/unresolved/expect.json +1 -0
  186. package/fixtures/S-Ident/unresolved/input.ts +1 -0
  187. package/fixtures/S-Index/dynamic-key/expect.json +1 -0
  188. package/fixtures/S-Index/dynamic-key/input.ts +1 -0
  189. package/fixtures/S-Index/literal-key/expect.json +1 -0
  190. package/fixtures/S-Index/literal-key/input.ts +1 -0
  191. package/fixtures/S-Literal/null-and-booleans/expect.json +1 -0
  192. package/fixtures/S-Literal/null-and-booleans/input.ts +1 -0
  193. package/fixtures/S-Literal/numeric/expect.json +1 -0
  194. package/fixtures/S-Literal/numeric/input.ts +1 -0
  195. package/fixtures/S-LocalFunction/arrow-const-call/expect.json +21 -0
  196. package/fixtures/S-LocalFunction/arrow-const-call/project/label.ts +3 -0
  197. package/fixtures/S-LocalFunction/function-as-value-still-rejects/expect.json +11 -0
  198. package/fixtures/S-LocalFunction/function-as-value-still-rejects/input.ts +3 -0
  199. package/fixtures/S-LocalFunction/same-file-declaration-call/expect.json +19 -0
  200. package/fixtures/S-LocalFunction/same-file-declaration-call/project/twice.ts +5 -0
  201. package/fixtures/S-Member/nested/expect.json +1 -0
  202. package/fixtures/S-Member/nested/input.ts +1 -0
  203. package/fixtures/S-Member/nullish-plain-refuses/expect.json +1 -0
  204. package/fixtures/S-Member/nullish-plain-refuses/input.ts +1 -0
  205. package/fixtures/S-Member/optional-chain/expect.json +1 -0
  206. package/fixtures/S-Member/optional-chain/input.ts +1 -0
  207. package/fixtures/S-Object/spread-later-wins/expect.json +1 -0
  208. package/fixtures/S-Object/spread-later-wins/input.ts +1 -0
  209. package/fixtures/S-Object/spread-non-object/expect.json +1 -0
  210. package/fixtures/S-Object/spread-non-object/input.ts +1 -0
  211. package/fixtures/S-Reject/arrow-as-value/expect.json +1 -0
  212. package/fixtures/S-Reject/arrow-as-value/input.ts +1 -0
  213. package/fixtures/S-Reject/call-as-value/expect.json +1 -0
  214. package/fixtures/S-Reject/call-as-value/input.ts +1 -0
  215. package/fixtures/S-Template/coercion/expect.json +2 -0
  216. package/fixtures/S-Template/coercion/input.ts +2 -0
  217. package/fixtures/S-Template/composite-step-span/expect.json +2 -0
  218. package/fixtures/S-Template/composite-step-span/input.ts +1 -0
  219. package/fixtures/S-Template/const-span/expect.json +2 -0
  220. package/fixtures/S-Template/const-span/input.ts +2 -0
  221. package/fixtures/S-Template/envelope-span/expect.json +2 -0
  222. package/fixtures/S-Template/envelope-span/input.ts +2 -0
  223. package/fixtures/S-Template/nested-construction-span/expect.json +2 -0
  224. package/fixtures/S-Template/nested-construction-span/input.ts +1 -0
  225. package/fixtures/S-Template/no-substitution/expect.json +2 -0
  226. package/fixtures/S-Template/no-substitution/input.ts +1 -0
  227. package/fixtures/S-Template/unfoldable-span/expect.json +16 -0
  228. package/fixtures/S-Template/unfoldable-span/input.ts +1 -0
  229. package/fixtures/S-Unary/not-and-negate/expect.json +1 -0
  230. package/fixtures/S-Unary/not-and-negate/input.ts +1 -0
  231. package/fixtures/S-Unclaimed/composite-step/expect.json +3 -0
  232. package/fixtures/S-Unclaimed/composite-step/input.ts +1 -0
  233. package/fixtures/S-Unwrap/as-and-parens/expect.json +1 -0
  234. package/fixtures/S-Unwrap/as-and-parens/input.ts +1 -0
  235. package/fixtures/UNCOVERED.md +37 -0
  236. package/package.json +35 -0
  237. package/spec/VERSION +1 -0
  238. package/spec/divergence.md +129 -0
  239. package/spec/grammar.md +277 -0
  240. package/spec/hosts.md +175 -0
  241. package/spec/judgments.md +1049 -0
  242. package/spec/rules.md +102 -0
  243. package/spec/values.md +247 -0
  244. package/src/adapter.ts +52 -0
  245. package/src/adapters/chant.ts +125 -0
  246. package/src/bundled.ts +27 -0
  247. package/src/chant-agreement.test.ts +67 -0
  248. package/src/corpus.test.ts +66 -0
  249. package/src/corpus.ts +540 -0
  250. package/src/fixture.ts +117 -0
  251. package/src/host.ts +105 -0
  252. package/src/index.ts +6 -0
  253. package/src/rules.test.ts +50 -0
  254. package/src/rules.ts +140 -0
  255. package/src/runner.test.ts +46 -0
  256. package/src/runner.ts +119 -0
  257. package/src/version.test.ts +31 -0
@@ -0,0 +1 @@
1
+ export const x = [0 || "x", "" && 1, null ?? 0, 0 ?? 1, "" ?? "y", false || null, "a" && "b", undefined ?? null];
@@ -0,0 +1,19 @@
1
+ {
2
+ "rules": [
3
+ "F-Eval-Binary"
4
+ ],
5
+ "export": "x",
6
+ "shape": "accept",
7
+ "fold": "fold",
8
+ "value": [
9
+ "12",
10
+ "34",
11
+ "33",
12
+ "123",
13
+ 2,
14
+ 1,
15
+ 0.30000000000000004,
16
+ 0.7999999999999999
17
+ ],
18
+ "note": "+ dispatches on the operands after ToPrimitive: one string makes it concatenation, left to right, so 1 + 2 + \"3\" is \"33\" and \"1\" + 2 + 3 is \"123\"; booleans and null go through ToNumber. The two float results are the doubles ECMAScript produces, not what decimal arithmetic would (R10.1)."
19
+ }
@@ -0,0 +1 @@
1
+ export const x = [1 + "2", "3" + 4, 1 + 2 + "3", "1" + 2 + 3, true + 1, null + 1, 0.1 + 0.2, 0.1 + 0.7];
@@ -0,0 +1,18 @@
1
+ {
2
+ "rules": [
3
+ "F-Eval-Binary"
4
+ ],
5
+ "export": "x",
6
+ "shape": "accept",
7
+ "fold": "fold",
8
+ "value": [
9
+ true,
10
+ true,
11
+ false,
12
+ true,
13
+ false,
14
+ true,
15
+ true
16
+ ],
17
+ "note": "Relational operators compare two strings by code unit (\"10\" < \"9\") and coerce a string against a number (\"10\" < 9 is 10 < 9). Strict equality never coerces. All ECMAScript, and all easy to get wrong in a port that reaches for its host language's comparison."
18
+ }
@@ -0,0 +1 @@
1
+ export const x = ["b" > "a", "10" < "9", "10" < 9, "a" === "a", 1 === "1", "1" !== 1, 2 >= "2"];
@@ -0,0 +1,8 @@
1
+ {
2
+ "rules": ["F-Eval-CallEager", "F-Host-Admission", "S-CallEager"],
3
+ "project": true,
4
+ "host": "shapes",
5
+ "verdicts": { "app.ts": "fold" },
6
+ "exports": { "app.ts": { "n": 3 } },
7
+ "note": "An eager intrinsic is invoked now, with the folded arguments, and the result is the value. F-Host-Admission is what makes that sound: count is a pure function of its arguments, so invoking it at fold time is indistinguishable from invoking it during a run."
8
+ }
@@ -0,0 +1,3 @@
1
+ import { count } from "@tsad/shapes";
2
+
3
+ export const n = count([1, 2, 3]);
@@ -0,0 +1,22 @@
1
+ {
2
+ "rules": [
3
+ "F-Eval-CallEager",
4
+ "F-Host-NoSubstitution"
5
+ ],
6
+ "project": true,
7
+ "host": "shapes",
8
+ "verdicts": {
9
+ "local.ts": "run",
10
+ "app.ts": "run"
11
+ },
12
+ "rejectRule": {
13
+ "app.ts": "F-Eval-CallEager"
14
+ },
15
+ "note": "The registry names count as eager, but the binding the file imported is a project file's number, not the host's function. Revival invokes what the import names and never substitutes the host's own (F-Host-NoSubstitution), so the call rejects: the name alone admits nothing. local.ts would fold on its own; app.ts imports it and runs, so the forward edge (F-Succ) takes it along.",
16
+ "tentative": {
17
+ "local.ts": "fold"
18
+ },
19
+ "taintedBy": {
20
+ "local.ts": "app.ts"
21
+ }
22
+ }
@@ -0,0 +1,3 @@
1
+ import { count } from "./local";
2
+
3
+ export const n = count([1, 2, 3]);
@@ -0,0 +1 @@
1
+ export const count = 3;
@@ -0,0 +1,8 @@
1
+ {
2
+ "rules": ["F-Eval-CallHelper", "S-CallHelper"],
3
+ "project": true,
4
+ "host": "shapes",
5
+ "verdicts": { "app.ts": "fold" },
6
+ "exports": { "app.ts": { "v": "DONE" } },
7
+ "note": "A registered authoring helper: J1 yields a {__helper} envelope, revival invokes the function the file imported."
8
+ }
@@ -0,0 +1,3 @@
1
+ import { upper } from "@tsad/shapes";
2
+
3
+ export const v = upper("done");
@@ -0,0 +1,22 @@
1
+ {
2
+ "rules": [
3
+ "F-Eval-CallHelper",
4
+ "F-Div-Depth"
5
+ ],
6
+ "project": true,
7
+ "host": "shapes",
8
+ "verdicts": {
9
+ "fn.ts": "run",
10
+ "app.ts": "run"
11
+ },
12
+ "rejectRule": {
13
+ "app.ts": "F-Eval-CallHelper"
14
+ },
15
+ "note": "A helper call inside a folded function body is refused, the same way a `new` and an intrinsic call are. fn.ts would fold on its own; app.ts imports it and runs, so the forward edge (F-Succ) takes it along.",
16
+ "tentative": {
17
+ "fn.ts": "fold"
18
+ },
19
+ "taintedBy": {
20
+ "fn.ts": "app.ts"
21
+ }
22
+ }
@@ -0,0 +1,3 @@
1
+ import { shout } from "./fn";
2
+
3
+ export const v = shout("a");
@@ -0,0 +1,5 @@
1
+ import { upper } from "@tsad/shapes";
2
+
3
+ export function shout(s: string) {
4
+ return upper(s);
5
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "rules": ["F-Eval-CallIntrinsic", "F-Host-Registry", "F-Host-Interface", "S-CallIntrinsic"],
3
+ "project": true,
4
+ "host": "shapes",
5
+ "verdicts": { "app.ts": "fold" },
6
+ "exports": { "app.ts": { "r": { "Ref": "Bucket" } } },
7
+ "note": "An intrinsic registered with foldsAsCall: J1 yields an {__intrinsic} envelope and revival invokes the function the file imported. The registry entry is what admits the call form; the same name without the flag is F-Host-Registry's tag-called-as-function fixture."
8
+ }
@@ -0,0 +1,3 @@
1
+ import { ref } from "@tsad/shapes";
2
+
3
+ export const r = ref("Bucket");
@@ -0,0 +1,22 @@
1
+ {
2
+ "rules": [
3
+ "F-Eval-CallIntrinsic",
4
+ "F-Div-Depth"
5
+ ],
6
+ "project": true,
7
+ "host": "shapes",
8
+ "verdicts": {
9
+ "fn.ts": "run",
10
+ "app.ts": "run"
11
+ },
12
+ "rejectRule": {
13
+ "app.ts": "F-Eval-CallIntrinsic"
14
+ },
15
+ "note": "The call form is refused at depth > 0: an intrinsic reached through a project-local call would be an envelope the file's own declarators never produced. fn.ts would fold on its own; app.ts imports it and runs, so the forward edge (F-Succ) takes it along.",
16
+ "tentative": {
17
+ "fn.ts": "fold"
18
+ },
19
+ "taintedBy": {
20
+ "fn.ts": "app.ts"
21
+ }
22
+ }
@@ -0,0 +1,3 @@
1
+ import { r } from "./fn";
2
+
3
+ export const v = r();
@@ -0,0 +1,5 @@
1
+ import { ref } from "@tsad/shapes";
2
+
3
+ export function r() {
4
+ return ref("x");
5
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "rules": ["F-Eval-CallLocal", "S-FnBody", "S-FnParams", "S-ExportFunction", "S-Call"],
3
+ "project": true,
4
+ "verdicts": { "pure.ts": "fold", "app.ts": "fold" },
5
+ "exports": { "app.ts": { "x": { "doubled": 42 } } },
6
+ "note": "A call into a project file folds whenever the callee's body is in the subset (S-FnBody), with no allowlist: the argument folds in the caller's scope, the body in the defining module's, and the result is plain data."
7
+ }
@@ -0,0 +1,3 @@
1
+ import { twice } from "./pure";
2
+
3
+ export const x = twice(21);
@@ -0,0 +1,3 @@
1
+ export function twice(n: number) {
2
+ return { doubled: n * 2 };
3
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "rules": [
3
+ "F-Eval-CallLocal",
4
+ "S-FnBody"
5
+ ],
6
+ "project": true,
7
+ "verdicts": {
8
+ "rec.ts": "fold",
9
+ "shallow.ts": "fold"
10
+ },
11
+ "exports": {
12
+ "shallow.ts": {
13
+ "floor": 0
14
+ }
15
+ },
16
+ "note": "A recursive project-local function, called three deep: the body folds in the defining module's scope, where its own name is bound, and the conditional takes only the taken branch. The bound on depth is F-Depth's, and a fixture for it waits on the spec deciding whether the number is normative."
17
+ }
@@ -0,0 +1,3 @@
1
+ export function down(n: number) {
2
+ return n <= 0 ? 0 : down(n - 1);
3
+ }
@@ -0,0 +1,3 @@
1
+ import { down } from "./rec";
2
+
3
+ export const floor = down(3);
@@ -0,0 +1,20 @@
1
+ {
2
+ "rules": [
3
+ "F-Eval-CallLocal"
4
+ ],
5
+ "project": true,
6
+ "verdicts": {
7
+ "pure.ts": "run",
8
+ "app.ts": "run"
9
+ },
10
+ "rejectRule": {
11
+ "app.ts": "F-Eval-CallLocal"
12
+ },
13
+ "note": "Step 3: a spread argument rejects. The callee is fine; the call is not. pure.ts would fold on its own; app.ts imports it and runs, so the forward edge (F-Succ) takes it along.",
14
+ "tentative": {
15
+ "pure.ts": "fold"
16
+ },
17
+ "taintedBy": {
18
+ "pure.ts": "app.ts"
19
+ }
20
+ }
@@ -0,0 +1,5 @@
1
+ import { twice } from "./pure";
2
+
3
+ const args = [21];
4
+
5
+ export const x = twice(...args);
@@ -0,0 +1,3 @@
1
+ export function twice(n: number) {
2
+ return { doubled: n * 2 };
3
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "rules": [
3
+ "F-Eval-CallMethod",
4
+ "F-Div-Method",
5
+ "F-Div",
6
+ "F-Direction",
7
+ "S-CallMethod"
8
+ ],
9
+ "export": "x",
10
+ "shape": "accept",
11
+ "fold": "run",
12
+ "note": "The receiver folds, but its `m` is not a function. Shape accepts (receiver and arguments are valid expressions; the method name is unconstrained); the folder rejects at the call. F-Direction: the divergence runs the permitted way.",
13
+ "rejectAt": {
14
+ "line": 1,
15
+ "column": 18
16
+ }
17
+ }
@@ -0,0 +1 @@
1
+ export const x = ({ m: 1 }).m();
@@ -0,0 +1,13 @@
1
+ {
2
+ "rules": [
3
+ "F-Eval-CallMethod"
4
+ ],
5
+ "export": "x",
6
+ "shape": "accept",
7
+ "fold": "run",
8
+ "note": "A `.` method call on a receiver that folds to null: running it would throw, so the folder refuses rather than guess.",
9
+ "rejectAt": {
10
+ "line": 2,
11
+ "column": 18
12
+ }
13
+ }
@@ -0,0 +1,2 @@
1
+ const o = null;
2
+ export const x = o.m();
@@ -0,0 +1,2 @@
1
+ { "rules": ["F-Eval-CallMethod", "S-CallMethod"], "export": "x", "shape": "accept", "fold": "fold", "value": "$undefined",
2
+ "note": "The same call with `?.`: the chain short-circuits to undefined, which is what running it does." }
@@ -0,0 +1,2 @@
1
+ const o = null;
2
+ export const x = o?.m();
@@ -0,0 +1,2 @@
1
+ { "rules": ["F-Eval-CallMethod", "S-CallMethod"], "export": "x", "shape": "accept", "fold": "fold", "value": "ABC",
2
+ "note": "A method call on a receiver that folds to a real value whose named property is a function: applied at fold time." }
@@ -0,0 +1 @@
1
+ export const x = "abc".toUpperCase();
@@ -0,0 +1,11 @@
1
+ {
2
+ "rules": [
3
+ "F-Eval-Template",
4
+ "F-Eval-Binary"
5
+ ],
6
+ "export": "x",
7
+ "shape": "accept",
8
+ "fold": "fold",
9
+ "value": "0.30000000000000004|1e+21|0|0.3333333333333333|100|1.5e-7|9007199254740992|Infinity|123456789012345680000",
10
+ "note": "ToString of a Number is ECMAScript Number::toString: shortest round-trip digits, exponent form at and above 1e21, -0 prints as 0, an integer literal beyond 2^53 rounds to the nearest double before it is ever formatted. An evaluator in another language has to reproduce every one of these or the same file prints differently per platform (#81)."
11
+ }
@@ -0,0 +1 @@
1
+ export const x = `${0.1 + 0.2}|${1e21}|${-0}|${1 / 3}|${100}|${1.5e-7}|${9007199254740993}|${1 / 0}|${123456789012345680000}`;
@@ -0,0 +1,10 @@
1
+ {
2
+ "rules": [
3
+ "F-Eval-Template"
4
+ ],
5
+ "export": "x",
6
+ "shape": "accept",
7
+ "fold": "fold",
8
+ "value": "true|null|undefined|1,2||s",
9
+ "note": "ToString for the rest of the scalars and for an array, which joins on a comma with no brackets. An envelope in a span is refused instead (F-Div-TemplateEnvelope); a plain object would print as [object Object] and is deliberately not exercised here."
10
+ }
@@ -0,0 +1 @@
1
+ export const x = `${true}|${null}|${undefined}|${[1, 2]}|${[]}|${"s"}`;
@@ -0,0 +1,19 @@
1
+ {
2
+ "rules": [
3
+ "F-Eval-Unary"
4
+ ],
5
+ "export": "x",
6
+ "shape": "accept",
7
+ "fold": "fold",
8
+ "value": [
9
+ true,
10
+ false,
11
+ false,
12
+ false,
13
+ -3,
14
+ -12,
15
+ -1,
16
+ 0
17
+ ],
18
+ "note": "! is ¬truthy: the empty string is falsy and \"0\" is truthy, every object and array is truthy. Unary minus is −ToNumber: a numeric string with surrounding whitespace parses, true is 1, null is 0, and -null is -0, which the comparison form writes as 0 (R10.1)."
19
+ }
@@ -0,0 +1 @@
1
+ export const x = [!"", !"0", ![], !{}, -"3", -" 12 ", -true, -null];
@@ -0,0 +1,2 @@
1
+ { "rules": ["F-Eval-Undefined", "S-Undefined", "F-Val-Undefined"], "export": "u", "shape": "accept", "fold": "fold", "value": "$undefined",
2
+ "note": "The identifier `undefined` is a value, not an unresolved name." }
@@ -0,0 +1 @@
1
+ export const u = undefined;
@@ -0,0 +1,15 @@
1
+ {
2
+ "rules": [
3
+ "F-Exc-Registry",
4
+ "F-Exc",
5
+ "S-CallIntrinsic"
6
+ ],
7
+ "export": "r",
8
+ "shape": "reject",
9
+ "fold": "run",
10
+ "note": "The call form of an intrinsic is admitted by registration. With no registry the classifier rejects conservatively rather than guess, which is the exception F-Exc-Registry states to the shape-accepts direction; the folder, also without one, has no rule for the call and rejects too.",
11
+ "rejectAt": {
12
+ "line": 1,
13
+ "column": 18
14
+ }
15
+ }
@@ -0,0 +1 @@
1
+ export const r = ref("Bucket");
@@ -0,0 +1,9 @@
1
+ {
2
+ "rules": ["F-Host-Closed-vs-Open", "F-Eval-Reject"],
3
+ "project": true,
4
+ "host": "shapes",
5
+ "verdicts": { "pure.ts": "fold", "open.ts": "fold", "closed.ts": "run" },
6
+ "exports": { "open.ts": { "v": "n1" } },
7
+ "rejectRule": { "closed.ts": "F-Eval-Reject" },
8
+ "note": "The asymmetry: a call into a project file folds whenever the body is in the subset, with no allowlist; a call into a package folds only through a registered name, and Bucket is registered as nothing but a constructor."
9
+ }
@@ -0,0 +1,3 @@
1
+ import { Bucket } from "@tsad/shapes";
2
+
3
+ export const v = Bucket({ name: "b" });
@@ -0,0 +1,3 @@
1
+ import { label } from "./pure";
2
+
3
+ export const v = label(1);
@@ -0,0 +1,3 @@
1
+ export function label(n: number) {
2
+ return "n" + n;
3
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "rules": ["F-Host-DataExports", "F-Import"],
3
+ "project": true,
4
+ "host": "shapes",
5
+ "verdicts": { "app.ts": "fold" },
6
+ "exports": { "app.ts": { "s": 3 } },
7
+ "note": "A named import from an active package resolves to the package's real export, and a plain-data export folds as a value."
8
+ }
@@ -0,0 +1,3 @@
1
+ import { SIZES } from "@tsad/shapes";
2
+
3
+ export const s = SIZES.large;
@@ -0,0 +1,8 @@
1
+ {
2
+ "rules": ["F-Host-Registry", "F-Eval-Reject"],
3
+ "project": true,
4
+ "host": "shapes",
5
+ "verdicts": { "app.ts": "run" },
6
+ "rejectRule": { "app.ts": "F-Eval-Reject" },
7
+ "note": "join is registered with isTag, and the three flags are mutually exclusive: the call form folds iff not a tag and foldsAsCall. Calling a tag as a function is admitted by no rule, and the flag is never inferred from the call's shape."
8
+ }
@@ -0,0 +1,3 @@
1
+ import { join } from "@tsad/shapes";
2
+
3
+ export const j = join("a");
@@ -0,0 +1,6 @@
1
+ {
2
+ "rules": ["F-Host-Trust", "F-Import", "F-Reference"],
3
+ "project": true,
4
+ "verdicts": { "app.ts": "run" },
5
+ "note": "A bare specifier outside both trust arms is never resolved: the binding is absent and a reference to it is an unresolved identifier. Not an error in the import, an unresolved name at the use."
6
+ }
@@ -0,0 +1,3 @@
1
+ import { thing } from "some-package";
2
+
3
+ export const x = { thing };
@@ -0,0 +1,7 @@
1
+ {
2
+ "rules": ["F-Namespace", "F-Import", "F-Bind"],
3
+ "project": true,
4
+ "verdicts": { "values.ts": "fold", "use.ts": "fold" },
5
+ "exports": { "use.ts": { "url": "localhost:8080" } },
6
+ "note": "A namespace import of a project file is a synthetic plain object of the target's namespace, so a member access on it indexes like any other object. Every entry here is a primitive, so nothing is captured and no edge exists."
7
+ }
@@ -0,0 +1,3 @@
1
+ import * as values from "./values";
2
+
3
+ export const url = `${values.host}:${values.port}`;
@@ -0,0 +1,2 @@
1
+ export const host = "localhost";
2
+ export const port = 8080;
@@ -0,0 +1,7 @@
1
+ {
2
+ "rules": ["F-NoExports", "F-Scan"],
3
+ "project": true,
4
+ "verdicts": { "empty.ts": "run", "defaulted.ts": "run" },
5
+ "tentative": { "empty.ts": "run", "defaulted.ts": "run" },
6
+ "note": "Two ways to fail before any expression is reduced. empty.ts passes the statement gate and yields no declarator, so there is nothing to fold to; defaulted.ts is disqualified by the gate itself. Neither is folded to an empty namespace."
7
+ }
@@ -0,0 +1 @@
1
+ export default { port: 8080 };
@@ -0,0 +1,3 @@
1
+ const internal = 1;
2
+
3
+ console.log(internal);
@@ -0,0 +1,19 @@
1
+ {
2
+ "rules": ["F-Prebuild", "F-Count"],
3
+ "project": true,
4
+ "host": "shapes",
5
+ "verdicts": { "shared.ts": "fold" },
6
+ "exports": {
7
+ "shared.ts": {
8
+ "wrapper": {
9
+ "inner": { "entityType": "Bucket", "lexicon": "shapes", "props": { "name": "base" }, "attributes": {} },
10
+ "twice": [
11
+ { "entityType": "Bucket", "lexicon": "shapes", "props": { "name": "base" }, "attributes": {} },
12
+ { "entityType": "Bucket", "lexicon": "shapes", "props": { "name": "base" }, "attributes": {} }
13
+ ]
14
+ },
15
+ "base": { "entityType": "Bucket", "lexicon": "shapes", "props": { "name": "base" }, "attributes": {} }
16
+ }
17
+ },
18
+ "note": "A non-exported same-file construction read as a value from an exported sibling, and re-exported by name. Under F-Eval-Ident step 1 without F-Prebuild every reference rejects; with it the file folds and every reference is the one instance F-Prebuild built. Found by the corpus cross-check (#25, #68): twelve chant examples fold this shape and the reference refused all of them."
19
+ }
@@ -0,0 +1,6 @@
1
+ import { Bucket } from "@tsad/shapes";
2
+
3
+ const base = new Bucket({ name: "base" });
4
+
5
+ export const wrapper = { inner: base, twice: [base, base] };
6
+ export { base };
@@ -0,0 +1,39 @@
1
+ {
2
+ "rules": [
3
+ "F-Profile",
4
+ "F-Profile-DataHost"
5
+ ],
6
+ "project": true,
7
+ "profiles": [
8
+ "full",
9
+ "data-host"
10
+ ],
11
+ "verdicts": {
12
+ "defaults.ts": "fold",
13
+ "service.ts": "fold"
14
+ },
15
+ "exports": {
16
+ "service.ts": {
17
+ "service": {
18
+ "name": "svc-platform",
19
+ "labels": {
20
+ "team": "platform",
21
+ "tier": "gold",
22
+ "exposed": true
23
+ },
24
+ "ports": [
25
+ {
26
+ "containerPort": 8080,
27
+ "protocol": "TCP"
28
+ },
29
+ {
30
+ "containerPort": 8443,
31
+ "protocol": "TCP"
32
+ }
33
+ ],
34
+ "replicas": 3
35
+ }
36
+ }
37
+ },
38
+ "note": "The whole of what a data-host evaluator needs: literals, a shared const, a spread, a template, a conditional, a cross-file import, and a project-local function folded by interpretation. No host, no new, no run path, and the same answer whether folded or run in JavaScript."
39
+ }
@@ -0,0 +1,5 @@
1
+ export const labels = { team: "platform", tier: "gold" };
2
+
3
+ export function port(n: number) {
4
+ return { containerPort: n, protocol: "TCP" };
5
+ }
@@ -0,0 +1,10 @@
1
+ import { labels, port } from "./defaults";
2
+
3
+ const http = port(8080);
4
+
5
+ export const service = {
6
+ name: `svc-${labels.team}`,
7
+ labels: { ...labels, exposed: true },
8
+ ports: [http, port(8443)],
9
+ replicas: labels.tier === "gold" ? 3 : 1,
10
+ };
@@ -0,0 +1,8 @@
1
+ {
2
+ "rules": ["F-Seed", "F-Verdict", "F-Call"],
3
+ "project": true,
4
+ "verdicts": { "app.ts": "run", "lone.ts": "fold" },
5
+ "tentative": { "app.ts": "run", "lone.ts": "fold" },
6
+ "exports": { "lone.ts": { "value": 1 } },
7
+ "note": "Seed(B) is exactly the files J2 refused. app.ts calls a local function whose body leaves S-FnBody, so it is in the seed on its own account, with no edge involved. lone.ts shares no edge and folds."
8
+ }