@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
package/spec/hosts.md ADDED
@@ -0,0 +1,175 @@
1
+ # The host interface
2
+
3
+ Normative draft (#16). What a host supplies to make the subset mean
4
+ something, and the rule by which each supplied thing is admitted. Rules are
5
+ `F-Host-*`. Derived from `IntrinsicDef` and the three fold predicates
6
+ (`lexicon.ts:219–352`), `createResource`/`createProperty` (`runtime.ts:21,
7
+ 67`), `FOLDABLE_AUTHORING_HELPERS` and its admission criteria
8
+ (`foldable-helpers.ts`), `isTrustedExecutableBinding`, and
9
+ `findCompositeDefinition`, at `e4074c17`.
10
+
11
+ The extraction (#19, `packages/reference/CUTS.md`) confirmed this list without
12
+ amendment. The expression layer needed items 3, 4 and 5 and nothing else;
13
+ items 1, 2 and 6 live in revival and interpretation, which the reference
14
+ implementation does not yet port (#21, #22).
15
+
16
+ ---
17
+
18
+ ## F-Host-Interface (what a host supplies)
19
+
20
+ Six things. The first four are the parameters R7 named; the last two are
21
+ what the trust rules need.
22
+
23
+ 1. **Entity constructors.** Classes whose instances are entities: built by
24
+ `createResource(type, lexicon, attrMap)`, `new (props, attributes?)` -
25
+ or `createProperty(type, lexicon)`, `new (props)`. They carry a
26
+ non-enumerable declarable marker, `lexicon`, `entityType`, and for
27
+ properties `kind: "property"`. Revival constructs them (F-Val-Fate).
28
+ 2. **Attribute exposure.** `attrMap` names the attributes an entity exposes;
29
+ reading one on a live instance yields an `AttrRef` bound to that instance
30
+ (F-Val-Live), and on a *name* yields the `{__attrRef}` envelope (R10.3).
31
+ 3. **An intrinsic registry** `ρ`: a list of `IntrinsicDef`.
32
+ 4. **An authoring-helper allowlist**: names a call may fold through as a
33
+ `{__helper}` envelope.
34
+ 5. **A trust set**: the package specifiers this build resolved and loaded
35
+ (R2.1 arm 1), plus the host's own module tree (arm 2).
36
+ 6. **A composite registration form**, `export const N = Composite(fn, "N")`
37
+ with `Composite` imported from the host, that makes a project-defined
38
+ factory *interpretable* (R7.2).
39
+ 7. **Rules**: the host's semantic checks over the folded namespace and the
40
+ artifact, under the contract of `rules.md` (F-Rule-Supply). A project may
41
+ supply more as a policy.
42
+
43
+ In the `data-host` profile (F-Profile-DataHost, judgments.md) a host is a
44
+ description rather than code: item 3, item 5, and a serialization mapping
45
+ that says what each envelope becomes in the artifact. Items 1, 2, 4 and 6
46
+ need something to invoke and are absent.
47
+
48
+ ## F-Host-Registry (the shape of an intrinsic registration)
49
+
50
+ ```
51
+ IntrinsicDef = { name, isTag: boolean, foldsAsCall?: boolean, foldsEagerly?: boolean, … }
52
+ ```
53
+
54
+ - `isTag` is **required**. An omitted value once defaulted silently to "not a
55
+ tag" and shipped the most-used intrinsic in the ecosystem unfoldable
56
+ (chant#1039, #1067). A registry entry that does not say is invalid.
57
+ - `isTag`, `foldsAsCall` and `foldsEagerly` are **mutually exclusive**. The
58
+ three fold predicates are: tag folds iff `isTag`; call form folds iff
59
+ `¬isTag ∧ foldsAsCall`; eager folds iff `¬isTag ∧ foldsEagerly`.
60
+ - `foldsAsCall` and `foldsEagerly` are **opt-in, per intrinsic, default
61
+ off**, and never inferred from the name, the tag flag, or the call's shape
62
+ (R3.3: closed allowlists).
63
+ - A registration is **validated against the export it names**, tagged
64
+ template signature versus plain call, and presence in the package's own
65
+ exports (`chant dev check-lexicon`). A host must provide the equivalent
66
+ check or its registry is a claim, not a fact.
67
+
68
+ ## F-Host-Admission (when a call may be registered)
69
+
70
+ A call-form intrinsic, an eager intrinsic, or an authoring helper qualifies
71
+ **only** if all hold:
72
+
73
+ - it is a **pure function of its arguments**, no I/O, no environment read,
74
+ no module-level mutable state, no observable side effect;
75
+ - it builds a **deterministic envelope or plain data** from them;
76
+ - **invoking it at fold time is indistinguishable from invoking it during a
77
+ real run** of the file.
78
+
79
+ That third clause is the whole correctness argument for every registered
80
+ call, and it is the same-function principle: revival invokes the function
81
+ the file's `import` names, never a reimplementation (F-Host-NoSubstitution).
82
+ Explicitly excluded by chant, with the reason each fails: `env()` reads
83
+ `process.env`; `Op()` returns an entity, and an entity-returning factory is
84
+ the nested-construction hazard wearing a call; `propagate()`,
85
+ `withDefaults()`, `resource()`, `mergeDefaults()` are composite *definition*
86
+ helpers and `propagate` mutates in place; `createResource()`/
87
+ `createProperty()` build classes at a module's top level, never as a value.
88
+
89
+ ## F-Host-Closed-vs-Open (why packages are closed and project files are open)
90
+
91
+ A call into a **package** folds only through a closed allowlist, a
92
+ registered intrinsic or helper, checked by name *and* by the provenance of
93
+ the binding (R3.3, F-Div-Provenance). A call into a **project file** folds
94
+ whenever the callee's body is itself in the subset (R6.5), with no allowlist.
95
+
96
+ The asymmetry is the trust boundary (R2.1, #36). Package code is already
97
+ loaded and executed by the build before discovery begins; admitting a call
98
+ into it costs no execution the process was not performing, so it is admitted
99
+ by declaration and verified by registration. Project code is the untrusted
100
+ input; it is admitted only when it can be *evaluated without being
101
+ executed*, folded or interpreted, which a syntactic body check decides and
102
+ an allowlist could not.
103
+
104
+ ## F-Host-NoSubstitution (the function that runs is the one imported)
105
+
106
+ For every registered name, helper, intrinsic, constructor, composite -
107
+ revival resolves the name **through the folding file's own `import`
108
+ bindings** and invokes what it finds (F-Val-Fate, J2 F-Call). A host never
109
+ substitutes its own implementation for a registered name. Two consequences:
110
+ a same-named helper the file declared or imported from elsewhere is not the
111
+ host's, and the file falls back (F-Div-Provenance); and the registry cannot
112
+ drift from the helpers' real behaviour, because it never reimplements them.
113
+ This is the CTFE principle ([`prior-art.md`](./prior-art.md)) made a rule.
114
+
115
+ ## F-Host-Composite (the registration that admits interpretation)
116
+
117
+ A project file's composite is interpretable (R7.2 rule 2) iff its defining
118
+ module has `export const N = Composite(fn, "N")` where `Composite` is bound,
119
+ *in that module*, to an import of the host's own, `fn` is an arrow or
120
+ function expression, and the name argument is absent or a string literal. A
121
+ plain helper that returns a composite is not registered and stays on the
122
+ invoking path. A host that offers interpretation must define an equivalent
123
+ registration form; the shape of `fn` is S-FactoryBody.
124
+
125
+ ## F-Host-DataExports (a package's plain data folds as values)
126
+
127
+ A named import from an **active** package resolves to the package's real
128
+ export (J2 F-Import). A plain-data export, a pseudo-parameter namespace, an
129
+ action-constant table, folds as a value; a live `Intrinsic` instance passes
130
+ through revival unchanged (F-Val-Live). A namespace import of a package is
131
+ never resolved (F-Namespace), so nothing is reachable through `ns.x` from a
132
+ package: the class or intrinsic has to be reachable through a *named*
133
+ import.
134
+
135
+ ## F-Host-Trust (what may be imported during a fold)
136
+
137
+ Arm 1: a specifier that is an active package of this build, or a subpath of
138
+ one, matched by text against the closed set the build already resolved. Arm
139
+ 2: a specifier that *resolves* to a path inside the host's own module tree -
140
+ text is insufficient because an untrusted repository controls both its
141
+ source and its `node_modules`. Nothing else, and a build with no package
142
+ list keeps only arm 2 (R2.1). Under `ι = isolated`, an import outside both
143
+ arms is F-IsolatedRefusal (J2).
144
+
145
+ ## F-Host-Generality (what varies and what does not)
146
+
147
+ What a host may vary: the six items of F-Host-Interface. What it may not:
148
+ the syntax (grammar.md), the semantics of admitted operators (R10, J1), the
149
+ module system, the value domain's shape (values.md), the judgments (J1–J3),
150
+ and the direction claim (divergence.md). Generality is over **host
151
+ vocabularies**, not languages (`README.md`, Scope). A host is one
152
+ instantiation; chant's lexicons are the reference instantiation, and the
153
+ reference implementation (#19, #20) is meant to carry the interface without
154
+ any of them.
155
+
156
+ ---
157
+
158
+ ## Rationale
159
+
160
+ Non-normative. The reasoning that motivated each rule, carried over from the retired `requirements.md` (#46). Keyed by the rule(s) each note supports.
161
+
162
+ **F-Host-Trust** *(was R2.1. Trust is decided by resolution, never by the text of a specifier)*
163
+
164
+ Two arms (L9.1–L9.4). Arm 1: an active lexicon package of *this build*,
165
+ matched by text against a closed set built from names the build already
166
+ resolved, and its subpaths, by extracting the package root from the specifier
167
+ text (L9.2). Arm 2: the specifier is *resolved* and the resulting path checked
168
+ against chant-core's own tree; text is explicitly insufficient because an
169
+ untrusted repository controls both its source and its `node_modules`.
170
+
171
+ A build that supplies no lexicon list keeps only arm 2, disabled, not loosened
172
+ (L9.4). One documented, accepted unsoundness: the bare-specifier resolution
173
+ cache is process-wide and assumes no nested `node_modules` version override
174
+ (L9.6); the spec should state it as an assumption rather than inherit it
175
+ silently.