@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.
- package/README.md +59 -0
- package/dist/adapter.d.ts +65 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +2 -0
- package/dist/adapter.js.map +1 -0
- package/dist/bundled.d.ts +5 -0
- package/dist/bundled.d.ts.map +1 -0
- package/dist/bundled.js +28 -0
- package/dist/bundled.js.map +1 -0
- package/dist/fixture.d.ts +49 -0
- package/dist/fixture.d.ts.map +1 -0
- package/dist/fixture.js +95 -0
- package/dist/fixture.js.map +1 -0
- package/dist/host.d.ts +33 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +79 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/rules.d.ts +46 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +135 -0
- package/dist/rules.js.map +1 -0
- package/dist/runner.d.ts +26 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +152 -0
- package/dist/runner.js.map +1 -0
- package/fixtures/F-CallLeak/a-call-returns-a-live-object/expect.json +8 -0
- package/fixtures/F-CallLeak/a-call-returns-a-live-object/project/caller.ts +5 -0
- package/fixtures/F-CallLeak/a-call-returns-a-live-object/project/leaky.ts +7 -0
- package/fixtures/F-CallLeak/a-call-returns-a-live-object/project/pure.ts +5 -0
- package/fixtures/F-Cycle/mutual-imports/expect.json +6 -0
- package/fixtures/F-Cycle/mutual-imports/project/a.ts +3 -0
- package/fixtures/F-Cycle/mutual-imports/project/b.ts +3 -0
- package/fixtures/F-Depth/exhaustion-is-a-fallback/expect.json +19 -0
- package/fixtures/F-Depth/exhaustion-is-a-fallback/project/deep.ts +3 -0
- package/fixtures/F-Depth/exhaustion-is-a-fallback/project/rec.ts +3 -0
- package/fixtures/F-Div-Depth/new-inside-function-body/expect.json +21 -0
- package/fixtures/F-Div-Depth/new-inside-function-body/project/app.ts +3 -0
- package/fixtures/F-Div-Depth/new-inside-function-body/project/fn.ts +3 -0
- package/fixtures/F-Div-Eager/referenced-not-called/expect.json +8 -0
- package/fixtures/F-Div-Eager/referenced-not-called/project/app.ts +3 -0
- package/fixtures/F-Div-NsNew/namespace-callee/expect.json +18 -0
- package/fixtures/F-Div-NsNew/namespace-callee/input.ts +3 -0
- package/fixtures/F-Div-Provenance/helper-name-from-project-import/expect.json +20 -0
- package/fixtures/F-Div-Provenance/helper-name-from-project-import/project/app.ts +3 -0
- package/fixtures/F-Div-Provenance/helper-name-from-project-import/project/local.ts +3 -0
- package/fixtures/F-Div-SameFileNew/no-module-graph/expect.json +8 -0
- package/fixtures/F-Div-SameFileNew/no-module-graph/input.ts +5 -0
- package/fixtures/F-Div-Tag/unregistered-tag/expect.json +15 -0
- package/fixtures/F-Div-Tag/unregistered-tag/input.ts +1 -0
- package/fixtures/F-Eval-Array/spread-string-rejected/expect.json +14 -0
- package/fixtures/F-Eval-Array/spread-string-rejected/input.ts +1 -0
- package/fixtures/F-Eval-Binary/division-and-float/expect.json +19 -0
- package/fixtures/F-Eval-Binary/division-and-float/input.ts +1 -0
- package/fixtures/F-Eval-Binary/logical-return-operand/expect.json +20 -0
- package/fixtures/F-Eval-Binary/logical-return-operand/input.ts +1 -0
- package/fixtures/F-Eval-Binary/plus-dispatch/expect.json +19 -0
- package/fixtures/F-Eval-Binary/plus-dispatch/input.ts +1 -0
- package/fixtures/F-Eval-Binary/relational-on-strings/expect.json +18 -0
- package/fixtures/F-Eval-Binary/relational-on-strings/input.ts +1 -0
- package/fixtures/F-Eval-CallEager/evaluated-at-fold-time/expect.json +8 -0
- package/fixtures/F-Eval-CallEager/evaluated-at-fold-time/project/app.ts +3 -0
- package/fixtures/F-Eval-CallEager/not-a-function/expect.json +22 -0
- package/fixtures/F-Eval-CallEager/not-a-function/project/app.ts +3 -0
- package/fixtures/F-Eval-CallEager/not-a-function/project/local.ts +1 -0
- package/fixtures/F-Eval-CallHelper/helper-folds/expect.json +8 -0
- package/fixtures/F-Eval-CallHelper/helper-folds/project/app.ts +3 -0
- package/fixtures/F-Eval-CallHelper/inside-function-body/expect.json +22 -0
- package/fixtures/F-Eval-CallHelper/inside-function-body/project/app.ts +3 -0
- package/fixtures/F-Eval-CallHelper/inside-function-body/project/fn.ts +5 -0
- package/fixtures/F-Eval-CallIntrinsic/call-form-folds/expect.json +8 -0
- package/fixtures/F-Eval-CallIntrinsic/call-form-folds/project/app.ts +3 -0
- package/fixtures/F-Eval-CallIntrinsic/inside-function-body/expect.json +22 -0
- package/fixtures/F-Eval-CallIntrinsic/inside-function-body/project/app.ts +3 -0
- package/fixtures/F-Eval-CallIntrinsic/inside-function-body/project/fn.ts +5 -0
- package/fixtures/F-Eval-CallLocal/local-function-folds/expect.json +7 -0
- package/fixtures/F-Eval-CallLocal/local-function-folds/project/app.ts +3 -0
- package/fixtures/F-Eval-CallLocal/local-function-folds/project/pure.ts +3 -0
- package/fixtures/F-Eval-CallLocal/recursion-folds/expect.json +17 -0
- package/fixtures/F-Eval-CallLocal/recursion-folds/project/rec.ts +3 -0
- package/fixtures/F-Eval-CallLocal/recursion-folds/project/shallow.ts +3 -0
- package/fixtures/F-Eval-CallLocal/spread-argument-rejected/expect.json +20 -0
- package/fixtures/F-Eval-CallLocal/spread-argument-rejected/project/app.ts +5 -0
- package/fixtures/F-Eval-CallLocal/spread-argument-rejected/project/pure.ts +3 -0
- package/fixtures/F-Eval-CallMethod/method-missing/expect.json +17 -0
- package/fixtures/F-Eval-CallMethod/method-missing/input.ts +1 -0
- package/fixtures/F-Eval-CallMethod/null-receiver-dot/expect.json +13 -0
- package/fixtures/F-Eval-CallMethod/null-receiver-dot/input.ts +2 -0
- package/fixtures/F-Eval-CallMethod/null-receiver-optional/expect.json +2 -0
- package/fixtures/F-Eval-CallMethod/null-receiver-optional/input.ts +2 -0
- package/fixtures/F-Eval-CallMethod/real-receiver/expect.json +2 -0
- package/fixtures/F-Eval-CallMethod/real-receiver/input.ts +1 -0
- package/fixtures/F-Eval-Template/number-formatting/expect.json +11 -0
- package/fixtures/F-Eval-Template/number-formatting/input.ts +1 -0
- package/fixtures/F-Eval-Template/tostring-of-non-numbers/expect.json +10 -0
- package/fixtures/F-Eval-Template/tostring-of-non-numbers/input.ts +1 -0
- package/fixtures/F-Eval-Unary/coercion/expect.json +19 -0
- package/fixtures/F-Eval-Unary/coercion/input.ts +1 -0
- package/fixtures/F-Eval-Undefined/bare-undefined/expect.json +2 -0
- package/fixtures/F-Eval-Undefined/bare-undefined/input.ts +1 -0
- package/fixtures/F-Exc-Registry/call-form-without-registry/expect.json +15 -0
- package/fixtures/F-Exc-Registry/call-form-without-registry/input.ts +1 -0
- package/fixtures/F-Host-Closed-vs-Open/package-call-is-closed/expect.json +9 -0
- package/fixtures/F-Host-Closed-vs-Open/package-call-is-closed/project/closed.ts +3 -0
- package/fixtures/F-Host-Closed-vs-Open/package-call-is-closed/project/open.ts +3 -0
- package/fixtures/F-Host-Closed-vs-Open/package-call-is-closed/project/pure.ts +3 -0
- package/fixtures/F-Host-DataExports/plain-data-export/expect.json +8 -0
- package/fixtures/F-Host-DataExports/plain-data-export/project/app.ts +3 -0
- package/fixtures/F-Host-Registry/tag-called-as-function/expect.json +8 -0
- package/fixtures/F-Host-Registry/tag-called-as-function/project/app.ts +3 -0
- package/fixtures/F-Host-Trust/unowned-package/expect.json +6 -0
- package/fixtures/F-Host-Trust/unowned-package/project/app.ts +3 -0
- package/fixtures/F-Namespace/synthetic-namespace-object/expect.json +7 -0
- package/fixtures/F-Namespace/synthetic-namespace-object/project/use.ts +3 -0
- package/fixtures/F-Namespace/synthetic-namespace-object/project/values.ts +2 -0
- package/fixtures/F-NoExports/nothing-to-produce/expect.json +7 -0
- package/fixtures/F-NoExports/nothing-to-produce/project/defaulted.ts +1 -0
- package/fixtures/F-NoExports/nothing-to-produce/project/empty.ts +3 -0
- package/fixtures/F-Prebuild/same-file-construction-shared/expect.json +19 -0
- package/fixtures/F-Prebuild/same-file-construction-shared/project/shared.ts +6 -0
- package/fixtures/F-Profile-DataHost/plain-data-across-files/expect.json +39 -0
- package/fixtures/F-Profile-DataHost/plain-data-across-files/project/defaults.ts +5 -0
- package/fixtures/F-Profile-DataHost/plain-data-across-files/project/service.ts +10 -0
- package/fixtures/F-Seed/seeded-by-its-own-body/expect.json +8 -0
- package/fixtures/F-Seed/seeded-by-its-own-body/project/app.ts +8 -0
- package/fixtures/F-Seed/seeded-by-its-own-body/project/lone.ts +1 -0
- package/fixtures/F-Succ/backward-along-captures/expect.json +26 -0
- package/fixtures/F-Succ/backward-along-captures/project/breaker.ts +10 -0
- package/fixtures/F-Succ/backward-along-captures/project/shared.ts +1 -0
- package/fixtures/F-Succ/backward-along-captures/project/sibling.ts +3 -0
- package/fixtures/F-Succ/forward-into-imports/expect.json +8 -0
- package/fixtures/F-Succ/forward-into-imports/project/app.ts +10 -0
- package/fixtures/F-Succ/forward-into-imports/project/config.ts +1 -0
- package/fixtures/F-Taint/independent-file-still-folds/expect.json +9 -0
- package/fixtures/F-Taint/independent-file-still-folds/project/alone.ts +1 -0
- package/fixtures/F-Taint/independent-file-still-folds/project/app.ts +8 -0
- package/fixtures/F-Total/one-bad-declarator-fails-the-file/expect.json +7 -0
- package/fixtures/F-Total/one-bad-declarator-fails-the-file/project/mixed.ts +3 -0
- package/fixtures/F-Val-Arity/props-attributes-and-spread/expect.json +14 -0
- package/fixtures/F-Val-Arity/props-attributes-and-spread/project/arities.ts +5 -0
- package/fixtures/F-Val-Callable/host-function-as-value/expect.json +16 -0
- package/fixtures/F-Val-Callable/host-function-as-value/project/app.ts +3 -0
- package/fixtures/F-Val-Fate/revive-every-envelope/expect.json +15 -0
- package/fixtures/F-Val-Fate/revive-every-envelope/project/entities.ts +6 -0
- package/fixtures/F-Val-Live/plain-data-is-not-live/expect.json +9 -0
- package/fixtures/F-Val-Live/plain-data-is-not-live/project/breaker.ts +10 -0
- package/fixtures/F-Val-Live/plain-data-is-not-live/project/quiet.ts +3 -0
- package/fixtures/F-Val-Live/plain-data-is-not-live/project/source.ts +5 -0
- package/fixtures/F-Val-Position/attrref-in-host-arguments/expect.json +8 -0
- package/fixtures/F-Val-Position/attrref-in-host-arguments/project/rejected.ts +4 -0
- package/fixtures/F-Val-Undefined/array-element-undefined/expect.json +15 -0
- package/fixtures/F-Val-Undefined/array-element-undefined/input.ts +1 -0
- package/fixtures/F-Val-Undefined/conditional-yields-undefined/expect.json +13 -0
- package/fixtures/F-Val-Undefined/conditional-yields-undefined/input.ts +2 -0
- package/fixtures/F-Val-Undefined/optional-chain-yields-undefined-property/expect.json +13 -0
- package/fixtures/F-Val-Undefined/optional-chain-yields-undefined-property/input.ts +2 -0
- package/fixtures/F-Val-Undefined/property-literal-undefined/expect.json +16 -0
- package/fixtures/F-Val-Undefined/property-literal-undefined/input.ts +1 -0
- package/fixtures/F-Val-Undefined/spread-carries-undefined/expect.json +14 -0
- package/fixtures/F-Val-Undefined/spread-carries-undefined/input.ts +2 -0
- package/fixtures/S-Array/spread/expect.json +1 -0
- package/fixtures/S-Array/spread/input.ts +1 -0
- package/fixtures/S-Binary/arithmetic-and-concat/expect.json +1 -0
- package/fixtures/S-Binary/arithmetic-and-concat/input.ts +1 -0
- package/fixtures/S-Binary/lazy-untaken-unfoldable/expect.json +1 -0
- package/fixtures/S-Binary/lazy-untaken-unfoldable/input.ts +1 -0
- package/fixtures/S-Binary/nullish-coalesce/expect.json +1 -0
- package/fixtures/S-Binary/nullish-coalesce/input.ts +1 -0
- package/fixtures/S-CallLocal/imported-callee-is-shape-valid/expect.json +10 -0
- package/fixtures/S-CallLocal/imported-callee-is-shape-valid/input.ts +3 -0
- package/fixtures/S-Conditional/taken-branch-only/expect.json +1 -0
- package/fixtures/S-Conditional/taken-branch-only/input.ts +1 -0
- package/fixtures/S-ExportDefault/imported-by-sibling/expect.json +30 -0
- package/fixtures/S-ExportDefault/imported-by-sibling/project/app.ts +3 -0
- package/fixtures/S-ExportDefault/imported-by-sibling/project/policy.ts +1 -0
- package/fixtures/S-ExportDefault/plain-object/expect.json +21 -0
- package/fixtures/S-ExportDefault/plain-object/input.ts +1 -0
- package/fixtures/S-Ident/const-chain/expect.json +1 -0
- package/fixtures/S-Ident/const-chain/input.ts +1 -0
- package/fixtures/S-Ident/process/expect.json +1 -0
- package/fixtures/S-Ident/process/input.ts +1 -0
- package/fixtures/S-Ident/unresolved/expect.json +1 -0
- package/fixtures/S-Ident/unresolved/input.ts +1 -0
- package/fixtures/S-Index/dynamic-key/expect.json +1 -0
- package/fixtures/S-Index/dynamic-key/input.ts +1 -0
- package/fixtures/S-Index/literal-key/expect.json +1 -0
- package/fixtures/S-Index/literal-key/input.ts +1 -0
- package/fixtures/S-Literal/null-and-booleans/expect.json +1 -0
- package/fixtures/S-Literal/null-and-booleans/input.ts +1 -0
- package/fixtures/S-Literal/numeric/expect.json +1 -0
- package/fixtures/S-Literal/numeric/input.ts +1 -0
- package/fixtures/S-LocalFunction/arrow-const-call/expect.json +21 -0
- package/fixtures/S-LocalFunction/arrow-const-call/project/label.ts +3 -0
- package/fixtures/S-LocalFunction/function-as-value-still-rejects/expect.json +11 -0
- package/fixtures/S-LocalFunction/function-as-value-still-rejects/input.ts +3 -0
- package/fixtures/S-LocalFunction/same-file-declaration-call/expect.json +19 -0
- package/fixtures/S-LocalFunction/same-file-declaration-call/project/twice.ts +5 -0
- package/fixtures/S-Member/nested/expect.json +1 -0
- package/fixtures/S-Member/nested/input.ts +1 -0
- package/fixtures/S-Member/nullish-plain-refuses/expect.json +1 -0
- package/fixtures/S-Member/nullish-plain-refuses/input.ts +1 -0
- package/fixtures/S-Member/optional-chain/expect.json +1 -0
- package/fixtures/S-Member/optional-chain/input.ts +1 -0
- package/fixtures/S-Object/spread-later-wins/expect.json +1 -0
- package/fixtures/S-Object/spread-later-wins/input.ts +1 -0
- package/fixtures/S-Object/spread-non-object/expect.json +1 -0
- package/fixtures/S-Object/spread-non-object/input.ts +1 -0
- package/fixtures/S-Reject/arrow-as-value/expect.json +1 -0
- package/fixtures/S-Reject/arrow-as-value/input.ts +1 -0
- package/fixtures/S-Reject/call-as-value/expect.json +1 -0
- package/fixtures/S-Reject/call-as-value/input.ts +1 -0
- package/fixtures/S-Template/coercion/expect.json +2 -0
- package/fixtures/S-Template/coercion/input.ts +2 -0
- package/fixtures/S-Template/composite-step-span/expect.json +2 -0
- package/fixtures/S-Template/composite-step-span/input.ts +1 -0
- package/fixtures/S-Template/const-span/expect.json +2 -0
- package/fixtures/S-Template/const-span/input.ts +2 -0
- package/fixtures/S-Template/envelope-span/expect.json +2 -0
- package/fixtures/S-Template/envelope-span/input.ts +2 -0
- package/fixtures/S-Template/nested-construction-span/expect.json +2 -0
- package/fixtures/S-Template/nested-construction-span/input.ts +1 -0
- package/fixtures/S-Template/no-substitution/expect.json +2 -0
- package/fixtures/S-Template/no-substitution/input.ts +1 -0
- package/fixtures/S-Template/unfoldable-span/expect.json +16 -0
- package/fixtures/S-Template/unfoldable-span/input.ts +1 -0
- package/fixtures/S-Unary/not-and-negate/expect.json +1 -0
- package/fixtures/S-Unary/not-and-negate/input.ts +1 -0
- package/fixtures/S-Unclaimed/composite-step/expect.json +3 -0
- package/fixtures/S-Unclaimed/composite-step/input.ts +1 -0
- package/fixtures/S-Unwrap/as-and-parens/expect.json +1 -0
- package/fixtures/S-Unwrap/as-and-parens/input.ts +1 -0
- package/fixtures/UNCOVERED.md +37 -0
- package/package.json +35 -0
- package/spec/VERSION +1 -0
- package/spec/divergence.md +129 -0
- package/spec/grammar.md +277 -0
- package/spec/hosts.md +175 -0
- package/spec/judgments.md +1049 -0
- package/spec/rules.md +102 -0
- package/spec/values.md +247 -0
- package/src/adapter.ts +52 -0
- package/src/adapters/chant.ts +125 -0
- package/src/bundled.ts +27 -0
- package/src/chant-agreement.test.ts +67 -0
- package/src/corpus.test.ts +66 -0
- package/src/corpus.ts +540 -0
- package/src/fixture.ts +117 -0
- package/src/host.ts +105 -0
- package/src/index.ts +6 -0
- package/src/rules.test.ts +50 -0
- package/src/rules.ts +140 -0
- package/src/runner.test.ts +46 -0
- package/src/runner.ts +119 -0
- 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.
|