@intentius/tsad-conformance 1.4.0 → 1.6.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 (130) hide show
  1. package/dist/adapter.d.ts +53 -1
  2. package/dist/adapter.d.ts.map +1 -1
  3. package/dist/fixture.d.ts +28 -1
  4. package/dist/fixture.d.ts.map +1 -1
  5. package/dist/fixture.js +27 -2
  6. package/dist/fixture.js.map +1 -1
  7. package/dist/host.d.ts +13 -0
  8. package/dist/host.d.ts.map +1 -1
  9. package/dist/host.js +33 -0
  10. package/dist/host.js.map +1 -1
  11. package/dist/runner.d.ts +28 -2
  12. package/dist/runner.d.ts.map +1 -1
  13. package/dist/runner.js +129 -3
  14. package/dist/runner.js.map +1 -1
  15. package/fixtures/F-Call/a-host-factory-is-invoked/expect.json +45 -0
  16. package/fixtures/F-Call/a-host-factory-is-invoked/project/app.ts +4 -0
  17. package/fixtures/F-Call/a-host-factory-is-invoked/project/nested.ts +3 -0
  18. package/fixtures/F-Call/a-host-factory-is-invoked/project/plain.ts +3 -0
  19. package/fixtures/F-Declarator/a-const-alias-of-a-call-resolves-at-the-declarator/expect.json +50 -0
  20. package/fixtures/F-Declarator/a-const-alias-of-a-call-resolves-at-the-declarator/project/app.ts +13 -0
  21. package/fixtures/F-Declarator/a-const-alias-of-a-call-resolves-at-the-declarator/project/nested.ts +5 -0
  22. package/fixtures/F-Declarator/a-const-alias-of-a-call-resolves-at-the-declarator/project/store.ts +3 -0
  23. package/fixtures/F-Div-Step/step-reads-the-resolved-composite/expect.json +48 -0
  24. package/fixtures/F-Div-Step/step-reads-the-resolved-composite/project/app.ts +4 -0
  25. package/fixtures/F-Div-Step/step-reads-the-resolved-composite/project/pipeline.ts +3 -0
  26. package/fixtures/F-Host-Closed-vs-Open/package-call-is-closed/expect.json +18 -5
  27. package/fixtures/F-Host-Composite/a-registered-composite-is-interpreted/expect.json +47 -0
  28. package/fixtures/F-Host-Composite/a-registered-composite-is-interpreted/project/app.ts +4 -0
  29. package/fixtures/F-Host-Composite/a-registered-composite-is-interpreted/project/store.ts +6 -0
  30. package/fixtures/F-IsolatedRefusal/a-project-factory-is-refused-not-invoked/expect.json +18 -0
  31. package/fixtures/F-IsolatedRefusal/a-project-factory-is-refused-not-invoked/project/app.ts +3 -0
  32. package/fixtures/F-IsolatedRefusal/a-project-factory-is-refused-not-invoked/project/shapes.ts +5 -0
  33. package/fixtures/F-Obs-Counters/a-build-reports-its-counts/expect.json +43 -0
  34. package/fixtures/F-Obs-Counters/a-build-reports-its-counts/project/app.ts +5 -0
  35. package/fixtures/F-Obs-Counters/a-build-reports-its-counts/project/shapes.ts +3 -0
  36. package/fixtures/F-Rule-Equivalence/same-source-same-findings/expect.json +21 -0
  37. package/fixtures/F-Rule-Equivalence/same-source-same-findings/project/buckets.ts +8 -0
  38. package/fixtures/F-Rule-Equivalence/same-source-same-findings/project/helpers.ts +3 -0
  39. package/fixtures/F-Rule-Input/a-rule-sees-the-folded-namespace/expect.json +21 -0
  40. package/fixtures/F-Rule-Input/a-rule-sees-the-folded-namespace/project/buckets.ts +4 -0
  41. package/fixtures/F-Rule-Phase/a-post-rule-reads-the-artifact/expect.json +21 -0
  42. package/fixtures/F-Rule-Phase/a-post-rule-reads-the-artifact/project/pairs.ts +3 -0
  43. package/fixtures/F-Rule-Pure/findings-are-a-function-of-the-input/expect.json +21 -0
  44. package/fixtures/F-Rule-Pure/findings-are-a-function-of-the-input/project/buckets.ts +4 -0
  45. package/fixtures/F-Rule-Pure/findings-are-a-function-of-the-input/project/clock.ts +1 -0
  46. package/fixtures/F-Rule-Supply/the-host-names-the-rule/expect.json +21 -0
  47. package/fixtures/F-Rule-Supply/the-host-names-the-rule/project/app.ts +4 -0
  48. package/fixtures/F-Val-Domain/every-case-is-a-value/expect.json +49 -0
  49. package/fixtures/F-Val-Domain/every-case-is-a-value/project/app.ts +6 -0
  50. package/fixtures/F-Val-Envelope/envelopes-are-the-output-in-data-host/expect.json +41 -0
  51. package/fixtures/F-Val-Envelope/envelopes-are-the-output-in-data-host/project/app.ts +5 -0
  52. package/fixtures/F-Val-Source/a-form-per-case-in-data-host/expect.json +74 -0
  53. package/fixtures/F-Val-Source/a-form-per-case-in-data-host/project/app.ts +8 -0
  54. package/fixtures/F-Val-Source/a-form-per-case-in-full/expect.json +35 -0
  55. package/fixtures/F-Val-Source/a-form-per-case-in-full/project/app.ts +7 -0
  56. package/fixtures/F-Val-Symbol-Scope/a-symbol-only-inside-an-intrinsic/expect.json +32 -0
  57. package/fixtures/F-Val-Symbol-Scope/a-symbol-only-inside-an-intrinsic/project/interior.ts +3 -0
  58. package/fixtures/F-Val-Symbol-Scope/a-symbol-only-inside-an-intrinsic/project/top.ts +1 -0
  59. package/fixtures/S-Disqualify/each-arm-disqualifies-the-file/expect.json +34 -0
  60. package/fixtures/S-Disqualify/each-arm-disqualifies-the-file/project/array.ts +1 -0
  61. package/fixtures/S-Disqualify/each-arm-disqualifies-the-file/project/class.ts +1 -0
  62. package/fixtures/S-Disqualify/each-arm-disqualifies-the-file/project/default-function.ts +3 -0
  63. package/fixtures/S-Disqualify/each-arm-disqualifies-the-file/project/let.ts +1 -0
  64. package/fixtures/S-Disqualify/each-arm-disqualifies-the-file/project/ok.ts +1 -0
  65. package/fixtures/S-Disqualify/each-arm-disqualifies-the-file/project/rest.ts +1 -0
  66. package/fixtures/S-Disqualify/each-arm-disqualifies-the-file/project/star.ts +1 -0
  67. package/fixtures/S-Disqualify/each-arm-disqualifies-the-file/project/uninitialized.ts +1 -0
  68. package/fixtures/S-Disqualify/each-arm-disqualifies-the-file/project/var.ts +1 -0
  69. package/fixtures/S-ExportDestructure/plain-elements/expect.json +16 -0
  70. package/fixtures/S-ExportDestructure/plain-elements/project/app.ts +3 -0
  71. package/fixtures/S-ExportNamed/local-names-with-an-alias/expect.json +19 -0
  72. package/fixtures/S-ExportNamed/local-names-with-an-alias/project/app.ts +4 -0
  73. package/fixtures/S-ExportResource/new-with-props/expect.json +26 -0
  74. package/fixtures/S-ExportResource/new-with-props/project/app.ts +3 -0
  75. package/fixtures/S-ExportSingle/an-expression-initializer/expect.json +21 -0
  76. package/fixtures/S-ExportSingle/an-expression-initializer/input.ts +1 -0
  77. package/fixtures/S-ExportTypeOnly/type-exports-are-invisible/expect.json +19 -0
  78. package/fixtures/S-ExportTypeOnly/type-exports-are-invisible/project/app.ts +12 -0
  79. package/fixtures/S-FactoryBody/consts-then-a-final-return/expect.json +38 -0
  80. package/fixtures/S-FactoryBody/consts-then-a-final-return/project/bad-shapes.ts +7 -0
  81. package/fixtures/S-FactoryBody/consts-then-a-final-return/project/empty.ts +3 -0
  82. package/fixtures/S-FactoryBody/consts-then-a-final-return/project/good-shapes.ts +7 -0
  83. package/fixtures/S-FactoryBody/consts-then-a-final-return/project/good.ts +3 -0
  84. package/fixtures/S-FactoryBody/consts-then-a-final-return/project/no-return.ts +3 -0
  85. package/fixtures/S-FactoryParams/one-plainly-bound-parameter/expect.json +38 -0
  86. package/fixtures/S-FactoryParams/one-plainly-bound-parameter/project/bad-shapes.ts +4 -0
  87. package/fixtures/S-FactoryParams/one-plainly-bound-parameter/project/good-shapes.ts +3 -0
  88. package/fixtures/S-FactoryParams/one-plainly-bound-parameter/project/named.ts +3 -0
  89. package/fixtures/S-FactoryParams/one-plainly-bound-parameter/project/rest.ts +3 -0
  90. package/fixtures/S-FactoryParams/one-plainly-bound-parameter/project/two.ts +3 -0
  91. package/fixtures/S-Module/non-exported-statements-are-invisible/expect.json +17 -0
  92. package/fixtures/S-Module/non-exported-statements-are-invisible/project/app.ts +13 -0
  93. package/fixtures/S-Prop/a-computed-key-rejects/expect.json +10 -0
  94. package/fixtures/S-Prop/a-computed-key-rejects/input.ts +3 -0
  95. package/fixtures/S-Prop/literal-keys/expect.json +15 -0
  96. package/fixtures/S-Prop/literal-keys/input.ts +1 -0
  97. package/fixtures/S-ReExport/named-from-a-sibling/expect.json +18 -0
  98. package/fixtures/S-ReExport/named-from-a-sibling/project/app.ts +1 -0
  99. package/fixtures/S-ReExport/named-from-a-sibling/project/config.ts +2 -0
  100. package/fixtures/S-Shorthand/a-shorthand-property-resolves-as-an-identifier/expect.json +14 -0
  101. package/fixtures/S-Shorthand/a-shorthand-property-resolves-as-an-identifier/input.ts +4 -0
  102. package/fixtures/S-TopConst/an-unexported-const-is-a-binding/expect.json +16 -0
  103. package/fixtures/S-TopConst/an-unexported-const-is-a-binding/project/binding.ts +3 -0
  104. package/fixtures/S-TopConst/an-unexported-const-is-a-binding/project/invisible.ts +3 -0
  105. package/fixtures/UNCOVERED.md +1 -28
  106. package/fixtures/roundtrip/a-resource-and-its-attribute/expect.json +8 -0
  107. package/fixtures/roundtrip/a-resource-and-its-attribute/value.json +29 -0
  108. package/fixtures/roundtrip/a-resource-by-args/expect.json +8 -0
  109. package/fixtures/roundtrip/a-resource-by-args/value.json +14 -0
  110. package/fixtures/roundtrip/intrinsics-and-a-symbol/expect.json +8 -0
  111. package/fixtures/roundtrip/intrinsics-and-a-symbol/value.json +36 -0
  112. package/fixtures/roundtrip/scalars-and-containers/expect.json +8 -0
  113. package/fixtures/roundtrip/scalars-and-containers/value.json +28 -0
  114. package/package.json +1 -1
  115. package/spec/VERSION +1 -1
  116. package/spec/hosts.md +6 -2
  117. package/spec/judgments.md +27 -10
  118. package/spec/rules.md +7 -4
  119. package/spec/values.md +47 -2
  120. package/src/adapter.ts +53 -0
  121. package/src/adapters/chant.ts +361 -10
  122. package/src/adapters/rust.ts +77 -0
  123. package/src/chant-agreement.test.ts +68 -23
  124. package/src/corpus.test.ts +12 -0
  125. package/src/corpus.ts +76 -34
  126. package/src/fixture.ts +42 -3
  127. package/src/host.ts +50 -0
  128. package/src/runner.test.ts +6 -2
  129. package/src/runner.ts +107 -5
  130. package/src/rust-agreement.test.ts +37 -0
@@ -0,0 +1,74 @@
1
+ {
2
+ "rules": [
3
+ "F-Val-Source"
4
+ ],
5
+ "project": true,
6
+ "host": "shapes",
7
+ "profiles": [
8
+ "data-host"
9
+ ],
10
+ "verdicts": {
11
+ "app.ts": "fold"
12
+ },
13
+ "exports": {
14
+ "app.ts": {
15
+ "scalars": {
16
+ "s": "text",
17
+ "n": 1.5,
18
+ "b": true,
19
+ "z": null,
20
+ "u": "$undefined"
21
+ },
22
+ "nested": [
23
+ 1,
24
+ {
25
+ "a-b": [
26
+ 2,
27
+ 3
28
+ ]
29
+ }
30
+ ],
31
+ "logs": {
32
+ "__resource": "Bucket",
33
+ "props": {
34
+ "name": "logs"
35
+ },
36
+ "attributes": {
37
+ "region": "eu"
38
+ }
39
+ },
40
+ "arn": {
41
+ "__attrRef": {
42
+ "entity": "logs",
43
+ "attribute": "arn"
44
+ }
45
+ },
46
+ "tagged": {
47
+ "__intrinsic": "join",
48
+ "strings": [
49
+ "arn:",
50
+ ":",
51
+ ""
52
+ ],
53
+ "values": [
54
+ {
55
+ "__symbol": "Region.Name"
56
+ },
57
+ {
58
+ "__attrRef": {
59
+ "entity": "logs",
60
+ "attribute": "arn"
61
+ }
62
+ }
63
+ ]
64
+ },
65
+ "called": {
66
+ "__intrinsic": "ref",
67
+ "args": [
68
+ "logs"
69
+ ]
70
+ }
71
+ }
72
+ },
73
+ "note": "F-Val-Source's table, written by hand: the form it names for each case that data-host has, scalar, array, object, resource, attribute reference, both intrinsic forms and a symbol inside an interior, and the value each folds to. The roundtrip family is the same table with the source written by the implementation's generator."
74
+ }
@@ -0,0 +1,8 @@
1
+ import { Bucket, join, ref } from "@tsad/shapes";
2
+
3
+ export const scalars = { s: "text", n: 1.5, b: true, z: null, u: undefined };
4
+ export const nested = [1, { "a-b": [2, 3] }];
5
+ export const logs = new Bucket({ name: "logs" }, { region: "eu" });
6
+ export const arn = logs.arn;
7
+ export const tagged = join`arn:${Region.Name}:${logs.arn}`;
8
+ export const called = ref("logs");
@@ -0,0 +1,35 @@
1
+ {
2
+ "rules": [
3
+ "F-Val-Source",
4
+ "F-Val-Fate"
5
+ ],
6
+ "project": true,
7
+ "host": "shapes",
8
+ "verdicts": {
9
+ "app.ts": "fold"
10
+ },
11
+ "exports": {
12
+ "app.ts": {
13
+ "logs": {
14
+ "entityType": "Bucket",
15
+ "lexicon": "shapes",
16
+ "props": {
17
+ "name": "logs"
18
+ },
19
+ "attributes": {}
20
+ },
21
+ "arn": {
22
+ "__attrRef": {
23
+ "entity": "logs",
24
+ "attribute": "arn"
25
+ }
26
+ },
27
+ "tagged": "arn:logs",
28
+ "called": {
29
+ "Ref": "logs"
30
+ },
31
+ "helped": "LOGS"
32
+ }
33
+ },
34
+ "note": "The same forms in full, where the fold of a form is the value after F-Val-Fate: the resource is a live instance, the intrinsics and the helper are invoked, and only the attribute reference at the top is still the envelope. Inside the tag's interpolation an attribute reference would be rejected (F-Val-Position), so the span holds a literal. This is why the round trip is stated per profile."
35
+ }
@@ -0,0 +1,7 @@
1
+ import { Bucket, join, ref, upper } from "@tsad/shapes";
2
+
3
+ export const logs = new Bucket({ name: "logs" });
4
+ export const arn = logs.arn;
5
+ export const tagged = join`arn:${"logs"}`;
6
+ export const called = ref("logs");
7
+ export const helped = upper("logs");
@@ -0,0 +1,32 @@
1
+ {
2
+ "rules": [
3
+ "F-Val-Symbol-Scope",
4
+ "F-Eval-Interior"
5
+ ],
6
+ "project": true,
7
+ "host": "shapes",
8
+ "profiles": [
9
+ "data-host"
10
+ ],
11
+ "verdicts": {
12
+ "interior.ts": "fold",
13
+ "top.ts": "run"
14
+ },
15
+ "exports": {
16
+ "interior.ts": {
17
+ "inside": {
18
+ "__intrinsic": "join",
19
+ "strings": [
20
+ "arn:",
21
+ ":logs"
22
+ ],
23
+ "values": [
24
+ {
25
+ "__symbol": "Region.Name"
26
+ }
27
+ ]
28
+ }
29
+ }
30
+ },
31
+ "note": "The same unresolved chain twice. Inside a tag's interpolation it folds to a __symbol envelope, which the intrinsic will resolve; at the top of an expression it is a located rejection and the file runs. A __symbol never appears at the top of a folded tree."
32
+ }
@@ -0,0 +1,3 @@
1
+ import { join } from "@tsad/shapes";
2
+
3
+ export const inside = join`arn:${Region.Name}:logs`;
@@ -0,0 +1 @@
1
+ export const top = Region.Name;
@@ -0,0 +1,34 @@
1
+ {
2
+ "rules": [
3
+ "S-Disqualify",
4
+ "F-Scan"
5
+ ],
6
+ "project": true,
7
+ "verdicts": {
8
+ "ok.ts": "fold",
9
+ "let.ts": "run",
10
+ "var.ts": "run",
11
+ "class.ts": "run",
12
+ "star.ts": "run",
13
+ "uninitialized.ts": "run",
14
+ "array.ts": "run",
15
+ "rest.ts": "run",
16
+ "default-function.ts": "run"
17
+ },
18
+ "rejectRule": {
19
+ "let.ts": "F-Scan",
20
+ "var.ts": "F-Scan",
21
+ "class.ts": "F-Scan",
22
+ "star.ts": "F-Scan",
23
+ "uninitialized.ts": "F-Scan",
24
+ "array.ts": "F-Scan",
25
+ "rest.ts": "F-Scan",
26
+ "default-function.ts": "F-Scan"
27
+ },
28
+ "exports": {
29
+ "ok.ts": {
30
+ "fine": 1
31
+ }
32
+ },
33
+ "note": "One file per disqualifying statement form, and one that folds. A single match rejects the whole file at F-Scan before any expression is judged; export default with an expression is the arm S-ExportDefault admits in data-host, so it is not here."
34
+ }
@@ -0,0 +1 @@
1
+ export const [x] = [1];
@@ -0,0 +1,3 @@
1
+ export default function x() {
2
+ return 1;
3
+ }
@@ -0,0 +1 @@
1
+ export const fine = 1;
@@ -0,0 +1 @@
1
+ export const { ...rest } = { a: 1 };
@@ -0,0 +1 @@
1
+ export * from "./let";
@@ -0,0 +1,16 @@
1
+ {
2
+ "rules": [
3
+ "S-ExportDestructure"
4
+ ],
5
+ "project": true,
6
+ "verdicts": {
7
+ "app.ts": "fold"
8
+ },
9
+ "exports": {
10
+ "app.ts": {
11
+ "port": 8080,
12
+ "hostname": "localhost"
13
+ }
14
+ },
15
+ "note": "A destructured export with plain elements only, one of them renamed. Each element becomes an export bound to the property of the folded initializer; the property nobody named is not exported."
16
+ }
@@ -0,0 +1,3 @@
1
+ const config = { port: 8080, host: "localhost", debug: false };
2
+
3
+ export const { port, host: hostname } = config;
@@ -0,0 +1,19 @@
1
+ {
2
+ "rules": [
3
+ "S-ExportNamed",
4
+ "S-TopConst"
5
+ ],
6
+ "project": true,
7
+ "verdicts": {
8
+ "app.ts": "fold"
9
+ },
10
+ "exports": {
11
+ "app.ts": {
12
+ "a": 1,
13
+ "c": {
14
+ "two": 2
15
+ }
16
+ }
17
+ },
18
+ "note": "An export list over local names, one aliased. Each element exports the binding S-TopConst made under the name the list gives it."
19
+ }
@@ -0,0 +1,4 @@
1
+ const a = 1;
2
+ const b = { two: 2 };
3
+
4
+ export { a, b as c };
@@ -0,0 +1,26 @@
1
+ {
2
+ "rules": [
3
+ "S-ExportResource",
4
+ "F-Val-Fate"
5
+ ],
6
+ "project": true,
7
+ "host": "shapes",
8
+ "verdicts": {
9
+ "app.ts": "fold"
10
+ },
11
+ "exports": {
12
+ "app.ts": {
13
+ "logs": {
14
+ "entityType": "Bucket",
15
+ "lexicon": "shapes",
16
+ "props": {
17
+ "BucketName": "logs"
18
+ },
19
+ "attributes": {
20
+ "region": "eu"
21
+ }
22
+ }
23
+ }
24
+ },
25
+ "note": "The resource declarator: export const, an identifier, a new expression with arguments. J1 yields a __resource envelope and revival constructs the class the file imported from props and attributes."
26
+ }
@@ -0,0 +1,3 @@
1
+ import { Bucket } from "@tsad/shapes";
2
+
3
+ export const logs = new Bucket({ BucketName: "logs" }, { region: "eu" });
@@ -0,0 +1,21 @@
1
+ {
2
+ "rules": [
3
+ "S-ExportSingle",
4
+ "S-Object"
5
+ ],
6
+ "export": "x",
7
+ "shape": "accept",
8
+ "fold": "fold",
9
+ "value": {
10
+ "a": 1,
11
+ "b": [
12
+ true,
13
+ null,
14
+ "s"
15
+ ],
16
+ "c": {
17
+ "d": 2
18
+ }
19
+ },
20
+ "note": "The plain declarator: export const, one identifier, one expression. The initializer is judged by the expression grammar and folds to its value."
21
+ }
@@ -0,0 +1 @@
1
+ export const x = { a: 1, b: [true, null, "s"], c: { d: 2 } };
@@ -0,0 +1,19 @@
1
+ {
2
+ "rules": [
3
+ "S-ExportTypeOnly",
4
+ "S-ExportNamed"
5
+ ],
6
+ "project": true,
7
+ "verdicts": {
8
+ "app.ts": "fold"
9
+ },
10
+ "exports": {
11
+ "app.ts": {
12
+ "square": {
13
+ "sides": 4
14
+ },
15
+ "x": 4
16
+ }
17
+ },
18
+ "note": "export type { }, an exported type alias and a type-only element of an export list are erased; the gate neither admits nor rejects them. What remains, a value export list and a const, folds."
19
+ }
@@ -0,0 +1,12 @@
1
+ type Shape = { sides: number };
2
+ interface Named {
3
+ name: string;
4
+ }
5
+
6
+ export type { Shape };
7
+ export type Alias = Named;
8
+
9
+ const square: Shape = { sides: 4 };
10
+
11
+ export { square, type Named };
12
+ export const x = square.sides;
@@ -0,0 +1,38 @@
1
+ {
2
+ "rules": [
3
+ "S-FactoryBody",
4
+ "F-Call",
5
+ "F-IsolatedRefusal"
6
+ ],
7
+ "project": true,
8
+ "host": "shapes",
9
+ "verdicts": {
10
+ "good-shapes.ts": "run",
11
+ "bad-shapes.ts": "run",
12
+ "good.ts": "fold",
13
+ "no-return.ts": "run",
14
+ "empty.ts": "run"
15
+ },
16
+ "rejectRule": {
17
+ "good-shapes.ts": "F-Eval-Function",
18
+ "bad-shapes.ts": "F-Eval-Function",
19
+ "no-return.ts": "F-IsolatedRefusal",
20
+ "empty.ts": "F-IsolatedRefusal"
21
+ },
22
+ "exports": {
23
+ "good.ts": {
24
+ "g": {
25
+ "bucket": {
26
+ "entityType": "Bucket",
27
+ "lexicon": "shapes",
28
+ "props": {
29
+ "name": "a-base-x"
30
+ },
31
+ "attributes": {}
32
+ }
33
+ }
34
+ }
35
+ },
36
+ "note": "A factory body is consts, plain or destructured, then a final return, and the return is required: a body without one and an empty body are not interpretable, unlike a project-local function's block (S-FnBody), which yields undefined. Both registration modules run on their own (F-Eval-Function); the good caller folds by interpretation and under ι = isolated the bad callers are F-IsolatedRefusal: step 4 finds the factory not interpretable and step 5 refuses to invoke a project module.",
37
+ "mode": "isolated"
38
+ }
@@ -0,0 +1,7 @@
1
+ import { Bucket, Composite } from "@tsad/shapes";
2
+
3
+ export const NoReturn = Composite((props: { name: string }) => {
4
+ const bucket = new Bucket({ name: props.name });
5
+ }, "NoReturn");
6
+
7
+ export const Empty = Composite(() => {}, "Empty");
@@ -0,0 +1,3 @@
1
+ import { Empty } from "./bad-shapes";
2
+
3
+ export const e = Empty({});
@@ -0,0 +1,7 @@
1
+ import { Bucket, Composite } from "@tsad/shapes";
2
+
3
+ export const Good = Composite((props: { name: string }) => {
4
+ const base = `${props.name}-base`;
5
+ const { suffix } = { suffix: "x" };
6
+ return { bucket: new Bucket({ name: `${base}-${suffix}` }) };
7
+ }, "Good");
@@ -0,0 +1,3 @@
1
+ import { Good } from "./good-shapes";
2
+
3
+ export const g = Good({ name: "a" });
@@ -0,0 +1,3 @@
1
+ import { NoReturn } from "./bad-shapes";
2
+
3
+ export const n = NoReturn({ name: "a" });
@@ -0,0 +1,38 @@
1
+ {
2
+ "rules": [
3
+ "S-FactoryParams",
4
+ "F-Call",
5
+ "F-IsolatedRefusal"
6
+ ],
7
+ "project": true,
8
+ "host": "shapes",
9
+ "verdicts": {
10
+ "good-shapes.ts": "run",
11
+ "bad-shapes.ts": "run",
12
+ "named.ts": "fold",
13
+ "rest.ts": "run",
14
+ "two.ts": "run"
15
+ },
16
+ "rejectRule": {
17
+ "good-shapes.ts": "F-Eval-Function",
18
+ "bad-shapes.ts": "F-Eval-Function",
19
+ "rest.ts": "F-IsolatedRefusal",
20
+ "two.ts": "F-IsolatedRefusal"
21
+ },
22
+ "exports": {
23
+ "named.ts": {
24
+ "n": {
25
+ "bucket": {
26
+ "entityType": "Bucket",
27
+ "lexicon": "shapes",
28
+ "props": {
29
+ "name": "a"
30
+ },
31
+ "attributes": {}
32
+ }
33
+ }
34
+ }
35
+ },
36
+ "note": "At most one parameter, bound plainly: an identifier or an object pattern with plain elements. A rest parameter and a second parameter each make the factory not interpretable, so under ι = isolated their callers are F-IsolatedRefusal, step 5 refusing what step 4 could not interpret; the registration modules run on their own (F-Eval-Function) and the good caller folds.",
37
+ "mode": "isolated"
38
+ }
@@ -0,0 +1,4 @@
1
+ import { Bucket, Composite } from "@tsad/shapes";
2
+
3
+ export const Rest = Composite((...all: { name: string }[]) => ({ bucket: new Bucket({ name: all[0].name }) }), "Rest");
4
+ export const Two = Composite((a: { name: string }, b: string) => ({ bucket: new Bucket({ name: a.name + b }) }), "Two");
@@ -0,0 +1,3 @@
1
+ import { Bucket, Composite } from "@tsad/shapes";
2
+
3
+ export const Named = Composite(({ name }: { name: string }) => ({ bucket: new Bucket({ name }) }), "Named");
@@ -0,0 +1,3 @@
1
+ import { Named } from "./good-shapes";
2
+
3
+ export const n = Named({ name: "a" });
@@ -0,0 +1,3 @@
1
+ import { Rest } from "./bad-shapes";
2
+
3
+ export const r = Rest({ name: "a" });
@@ -0,0 +1,3 @@
1
+ import { Two } from "./bad-shapes";
2
+
3
+ export const t = Two({ name: "a" }, "b");
@@ -0,0 +1,17 @@
1
+ {
2
+ "rules": [
3
+ "S-Module"
4
+ ],
5
+ "project": true,
6
+ "verdicts": {
7
+ "app.ts": "fold"
8
+ },
9
+ "exports": {
10
+ "app.ts": {
11
+ "x": {
12
+ "answer": 42
13
+ }
14
+ }
15
+ },
16
+ "note": "The gate examines only statements carrying export. A non-exported let, an assignment, an if, a class and a bare call are neither admitted nor disqualifiers; they are invisible and their effects are never performed, so the file folds on its one export."
17
+ }
@@ -0,0 +1,13 @@
1
+ let counter = 0;
2
+ counter += 1;
3
+ if (counter > 0) {
4
+ counter = 2;
5
+ }
6
+ class Hidden {
7
+ run() {
8
+ return counter;
9
+ }
10
+ }
11
+ console.log(new Hidden().run());
12
+
13
+ export const x = { answer: 42 };
@@ -0,0 +1,10 @@
1
+ {
2
+ "rules": [
3
+ "S-Prop",
4
+ "S-Reject"
5
+ ],
6
+ "export": "x",
7
+ "shape": "reject",
8
+ "fold": "run",
9
+ "note": "A property key must be a literal key: an identifier, a string or a number. A computed key is a shape rejection even when it would evaluate to a constant."
10
+ }
@@ -0,0 +1,3 @@
1
+ const k = "a";
2
+
3
+ export const x = { [k]: 1 };
@@ -0,0 +1,15 @@
1
+ {
2
+ "rules": [
3
+ "S-Prop",
4
+ "S-Object"
5
+ ],
6
+ "export": "x",
7
+ "shape": "accept",
8
+ "fold": "fold",
9
+ "value": {
10
+ "plain": 1,
11
+ "with-dash": 2,
12
+ "3": "three"
13
+ },
14
+ "note": "The three literal key forms, each with an expression value; the numeric key folds to the string key JavaScript gives it."
15
+ }
@@ -0,0 +1 @@
1
+ export const x = { plain: 1, "with-dash": 2, 3: "three" };
@@ -0,0 +1,18 @@
1
+ {
2
+ "rules": [
3
+ "S-ReExport",
4
+ "F-Import"
5
+ ],
6
+ "project": true,
7
+ "verdicts": {
8
+ "config.ts": "fold",
9
+ "app.ts": "fold"
10
+ },
11
+ "exports": {
12
+ "app.ts": {
13
+ "listenOn": 8080,
14
+ "host": "localhost"
15
+ }
16
+ },
17
+ "note": "A re-export list with a specifier: each element exports the sibling's folded value under the name given, and nothing in this file is evaluated. The values are scalars, so no capture edge is recorded."
18
+ }
@@ -0,0 +1 @@
1
+ export { port as listenOn, host } from "./config";
@@ -0,0 +1,2 @@
1
+ export const port = 8080;
2
+ export const host = "localhost";
@@ -0,0 +1,14 @@
1
+ {
2
+ "rules": [
3
+ "S-Shorthand",
4
+ "S-Ident"
5
+ ],
6
+ "export": "x",
7
+ "shape": "accept",
8
+ "fold": "fold",
9
+ "value": {
10
+ "name": "svc",
11
+ "port": 80
12
+ },
13
+ "note": "A shorthand property is always shape-valid; its name resolves the way an identifier does, here to two top-level consts."
14
+ }
@@ -0,0 +1,4 @@
1
+ const name = "svc";
2
+ const port = 80;
3
+
4
+ export const x = { name, port };
@@ -0,0 +1,16 @@
1
+ {
2
+ "rules": [
3
+ "S-TopConst"
4
+ ],
5
+ "project": true,
6
+ "verdicts": {
7
+ "binding.ts": "fold",
8
+ "invisible.ts": "run"
9
+ },
10
+ "exports": {
11
+ "binding.ts": {
12
+ "x": 42
13
+ }
14
+ },
15
+ "note": "A top-level const with an identifier and an initializer binds its name whether or not it is exported, so binding.ts folds through base. A destructured top-level const is not a binding: q is invisible, and invisible.ts runs because y reads a name nothing bound."
16
+ }