@kumwe/studio-testkit 0.1.0-alpha.6 → 0.1.0-alpha.8

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 (150) hide show
  1. package/README.md +75 -10
  2. package/corpus-manifest.json +1106 -0
  3. package/dist/host-testbed.d.ts +22 -2
  4. package/dist/host-testbed.d.ts.map +1 -1
  5. package/dist/host-testbed.js +357 -31
  6. package/dist/host-testbed.js.map +1 -1
  7. package/dist/http-host-adapter.d.ts.map +1 -1
  8. package/dist/http-host-adapter.js +15 -0
  9. package/dist/http-host-adapter.js.map +1 -1
  10. package/dist/index.d.ts +40 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +36 -2
  13. package/dist/index.js.map +1 -1
  14. package/fixtures/field-adapter.example.json +27 -0
  15. package/fixtures/host-capabilities.example.json +11 -5
  16. package/fixtures/host-operations.example.json +270 -0
  17. package/fixtures/inspector.example.json +17 -0
  18. package/fixtures/media-upload-grant.example.json +14 -0
  19. package/fixtures/preview.render.example.json +1 -0
  20. package/fixtures/studio-config.example.json +4 -4
  21. package/invalid/host-capabilities.invalid-protocol-version.json +1 -1
  22. package/invalid/host-sequence.pending-expectation.json +52 -0
  23. package/invalid/host-sequence.preview-render-missing-request-id.json +50 -0
  24. package/invalid/inspector.empty-block-types.json +20 -0
  25. package/invalid/media-upload-grant.insecure-url.json +14 -0
  26. package/invalid/preview-message.activated-unknown-interaction.json +16 -0
  27. package/invalid/preview-message.duplicate-marker.json +24 -0
  28. package/invalid/preview-message.invalid-digest.json +1 -0
  29. package/invalid/preview-message.invalid-marker-grammar.json +19 -0
  30. package/invalid/preview-message.missing-marker-map.json +20 -0
  31. package/invalid/preview-message.missing-render-request-id.json +18 -0
  32. package/invalid/preview-message.unknown-type.json +13 -0
  33. package/invalid/preview-message.viewport-height-too-small.json +13 -0
  34. package/invalid/preview-message.viewport-role-and-size.json +16 -0
  35. package/invalid/preview-message.viewport-unsafe-role.json +13 -0
  36. package/package.json +6 -4
  37. package/vectors/canonical/array-order.json +13 -0
  38. package/vectors/canonical/control-characters.json +13 -0
  39. package/vectors/canonical/depth-exceeded.json +21 -0
  40. package/vectors/canonical/empty-containers.json +14 -0
  41. package/vectors/canonical/forbidden-member.json +14 -0
  42. package/vectors/canonical/member-order.json +16 -0
  43. package/vectors/canonical/negative-zero.json +13 -0
  44. package/vectors/canonical/nested-order.json +19 -0
  45. package/vectors/canonical/non-ascii.json +13 -0
  46. package/vectors/canonical/numbers.json +16 -0
  47. package/vectors/canonical/string-escapes.json +13 -0
  48. package/vectors/canonical/surrogate-pair.json +13 -0
  49. package/vectors/host/artifact.dependencies.result.json +35 -0
  50. package/vectors/host/artifact.load.stored.json +36 -0
  51. package/vectors/host/artifact.load.unknown.error.json +37 -0
  52. package/vectors/host/artifact.publish.accepted.json +37 -0
  53. package/vectors/host/artifact.publish.forbidden.error.json +37 -0
  54. package/vectors/host/artifact.publish.stale.error.json +38 -0
  55. package/vectors/host/artifact.save.accepted.json +38 -0
  56. package/vectors/host/artifact.save.forbidden.error.json +38 -0
  57. package/vectors/host/artifact.save.stale.error.json +39 -0
  58. package/vectors/host/artifact.unpublish.stale.error.json +38 -0
  59. package/vectors/host/envelope.malformed-context.error.json +36 -0
  60. package/vectors/host/envelope.protocol-version.error.json +36 -0
  61. package/vectors/host/envelope.stale-generation.error.json +36 -0
  62. package/vectors/host/localization.messages.unknown-locale.error.json +36 -0
  63. package/vectors/host/media.abort-upload.unknown.error.json +35 -0
  64. package/vectors/host/media.authorize-upload.granted.json +37 -0
  65. package/vectors/host/media.authorize-upload.path-filename.error.json +39 -0
  66. package/vectors/host/media.authorize-upload.too-large.error.json +38 -0
  67. package/vectors/host/media.complete-upload.unknown.error.json +36 -0
  68. package/vectors/host/media.get.unknown.json +34 -0
  69. package/vectors/host/media.import-external.private-host.error.json +36 -0
  70. package/vectors/host/media.list.cursor.error.json +36 -0
  71. package/vectors/host/media.list.limit.error.json +35 -0
  72. package/vectors/host/media.upload-status.unknown.error.json +35 -0
  73. package/vectors/host/permission.explain.withheld.json +34 -0
  74. package/vectors/host/permission.refresh.snapshot.json +31 -0
  75. package/vectors/host/recovery.load.absent.json +31 -0
  76. package/vectors/host/telemetry.emit.accepted.json +37 -0
  77. package/vectors/host/telemetry.emit.non-primitive.error.json +40 -0
  78. package/vectors/host-sequence/artifact.publish.changed-intent.sequence.json +75 -0
  79. package/vectors/host-sequence/artifact.publish.idempotent-replay.sequence.json +111 -0
  80. package/vectors/host-sequence/preview.cancel.cross-context.sequence.json +78 -0
  81. package/vectors/host-sequence/preview.render.cancelled.sequence.json +75 -0
  82. package/vectors/host-sequence/recovery.store.canonical-number.sequence.json +72 -0
  83. package/vectors/host-sequence/recovery.store.changed-context.sequence.json +61 -0
  84. package/vectors/host-sequence/recovery.store.rate-limited.sequence.json +93 -0
  85. package/vectors/host-sequence/recovery.store.resource-scope.sequence.json +61 -0
  86. package/vectors/host-sequence/recovery.store.wrong-operation-id.sequence.json +56 -0
  87. package/vectors/preview/canonical-preorder.json +102 -0
  88. package/vectors/preview/empty-draft.json +36 -0
  89. package/vectors/schema-profile/alternative-limit.accepted.json +95 -0
  90. package/vectors/schema-profile/alternative-limit.rejected.json +92 -0
  91. package/vectors/schema-profile/array-composition.accepted.json +35 -0
  92. package/vectors/schema-profile/byte-limit.accepted.json +30 -0
  93. package/vectors/schema-profile/byte-limit.rejected.json +26 -0
  94. package/vectors/schema-profile/closed-object.accepted.json +38 -0
  95. package/vectors/schema-profile/decimal-multiple.accepted.json +54 -0
  96. package/vectors/schema-profile/depth-limit.accepted.json +90 -0
  97. package/vectors/schema-profile/depth-limit.rejected.json +88 -0
  98. package/vectors/schema-profile/description-limit.accepted.json +29 -0
  99. package/vectors/schema-profile/description-limit.rejected.json +25 -0
  100. package/vectors/schema-profile/diagnostic-precedence.rejected.json +26 -0
  101. package/vectors/schema-profile/duplicate-dependent-required.rejected.json +21 -0
  102. package/vectors/schema-profile/duplicate-required.rejected.json +18 -0
  103. package/vectors/schema-profile/empty-combinator.rejected.json +17 -0
  104. package/vectors/schema-profile/empty-enum.rejected.json +17 -0
  105. package/vectors/schema-profile/enum-limit.accepted.json +89 -0
  106. package/vectors/schema-profile/enum-limit.rejected.json +84 -0
  107. package/vectors/schema-profile/examples-limit.accepted.json +35 -0
  108. package/vectors/schema-profile/examples-limit.rejected.json +31 -0
  109. package/vectors/schema-profile/format-keyword.rejected.json +17 -0
  110. package/vectors/schema-profile/forward-reference-path-precedence.rejected.json +20 -0
  111. package/vectors/schema-profile/invalid-pointer.rejected.json +18 -0
  112. package/vectors/schema-profile/json-depth-limit.accepted.json +278 -0
  113. package/vectors/schema-profile/json-depth-limit.rejected.json +276 -0
  114. package/vectors/schema-profile/json-item-limit.accepted.json +686 -0
  115. package/vectors/schema-profile/json-item-limit.rejected.json +682 -0
  116. package/vectors/schema-profile/json-property-limit.accepted.json +1031 -0
  117. package/vectors/schema-profile/json-property-limit.rejected.json +1028 -0
  118. package/vectors/schema-profile/local-reference.accepted.json +28 -0
  119. package/vectors/schema-profile/memoized-diagnostic.accepted.json +31 -0
  120. package/vectors/schema-profile/node-limit.accepted.json +1097 -0
  121. package/vectors/schema-profile/node-limit.rejected.json +1094 -0
  122. package/vectors/schema-profile/non-object-root.rejected.json +9 -0
  123. package/vectors/schema-profile/non-schema-reference.rejected.json +21 -0
  124. package/vectors/schema-profile/object-key-limit.accepted.json +32 -0
  125. package/vectors/schema-profile/object-key-limit.rejected.json +28 -0
  126. package/vectors/schema-profile/open-root.rejected.json +13 -0
  127. package/vectors/schema-profile/percent-encoded-pointer.rejected.json +26 -0
  128. package/vectors/schema-profile/property-name-limit.accepted.json +543 -0
  129. package/vectors/schema-profile/property-name-limit.rejected.json +536 -0
  130. package/vectors/schema-profile/recursive-diagnostic-precedence.rejected.json +30 -0
  131. package/vectors/schema-profile/recursive-reference.rejected.json +24 -0
  132. package/vectors/schema-profile/reference-fanout.accepted.json +662 -0
  133. package/vectors/schema-profile/reference-length-limit.accepted.json +45 -0
  134. package/vectors/schema-profile/reference-length-limit.rejected.json +39 -0
  135. package/vectors/schema-profile/reference-limit.accepted.json +416 -0
  136. package/vectors/schema-profile/reference-limit.rejected.json +415 -0
  137. package/vectors/schema-profile/reference-vs-keyword-precedence.rejected.json +22 -0
  138. package/vectors/schema-profile/reserved-pointer.rejected.json +26 -0
  139. package/vectors/schema-profile/root-diagnostic-precedence.rejected.json +16 -0
  140. package/vectors/schema-profile/root-vs-reference-precedence.rejected.json +19 -0
  141. package/vectors/schema-profile/schema-map-limit.accepted.json +539 -0
  142. package/vectors/schema-profile/schema-map-limit.rejected.json +536 -0
  143. package/vectors/schema-profile/semantic-recursion-precedence.rejected.json +21 -0
  144. package/vectors/schema-profile/semantic-reference-precedence.rejected.json +21 -0
  145. package/vectors/schema-profile/title-limit.accepted.json +29 -0
  146. package/vectors/schema-profile/title-limit.rejected.json +25 -0
  147. package/vectors/schema-profile/unresolved-reference.rejected.json +17 -0
  148. package/vectors/schema-profile/unsafe-dependent-required.rejected.json +24 -0
  149. package/vectors/schema-profile/unsafe-member.rejected.json +17 -0
  150. package/vectors/schema-profile/unsafe-required.rejected.json +17 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumwe/studio-testkit",
3
- "version": "0.1.0-alpha.6",
3
+ "version": "0.1.0-alpha.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/kumwe/studio.git",
@@ -13,11 +13,12 @@
13
13
  "sideEffects": false,
14
14
  "files": [
15
15
  "LICENSE",
16
+ "README.md",
16
17
  "conformance",
18
+ "corpus-manifest.json",
17
19
  "dist",
18
20
  "fixtures",
19
21
  "invalid",
20
- "README.md",
21
22
  "vectors"
22
23
  ],
23
24
  "exports": {
@@ -26,6 +27,7 @@
26
27
  "import": "./dist/index.js"
27
28
  },
28
29
  "./conformance/*": "./conformance/*",
30
+ "./corpus-manifest.json": "./corpus-manifest.json",
29
31
  "./fixtures/*": "./fixtures/*",
30
32
  "./invalid/*": "./invalid/*",
31
33
  "./vectors/*": "./vectors/*"
@@ -34,8 +36,8 @@
34
36
  "build": "tsc -b"
35
37
  },
36
38
  "dependencies": {
37
- "@kumwe/studio-core": "0.1.0-alpha.6",
38
- "@kumwe/studio-protocol": "0.1.0-alpha.4"
39
+ "@kumwe/studio-core": "0.1.0-alpha.8",
40
+ "@kumwe/studio-protocol": "0.1.0-alpha.6"
39
41
  },
40
42
  "publishConfig": {
41
43
  "access": "public",
@@ -0,0 +1,13 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "canonical-vector",
4
+ "id": "vector.canonical-vector.array-order",
5
+ "description": "Arrays keep semantic order; only object members are sorted.",
6
+ "value": {
7
+ "items": ["c", "a", "b"]
8
+ },
9
+ "expect": {
10
+ "canonical": "{\"items\":[\"c\",\"a\",\"b\"]}",
11
+ "digest": "sha256-Skzt0qRLwO/5TqmcmghEQQEADtJ5ASbjphmWAaasB7U="
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "canonical-vector",
4
+ "id": "vector.canonical-vector.control-characters",
5
+ "description": "Control characters without a short form are escaped as four hex digits.",
6
+ "value": {
7
+ "value": "bell\u0007 unit\u001f"
8
+ },
9
+ "expect": {
10
+ "canonical": "{\"value\":\"bell\\u0007 unit\\u001f\"}",
11
+ "digest": "sha256-V332co6E4LRxsTuTQ5OLD98jGjDBZAAmzZDCJOFGDNA="
12
+ }
13
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "canonical-vector",
4
+ "id": "vector.canonical-vector.depth-exceeded",
5
+ "description": "Nesting deeper than the declared bound is refused rather than truncated.",
6
+ "value": {
7
+ "a": {
8
+ "a": {
9
+ "a": {
10
+ "a": {
11
+ "a": 1
12
+ }
13
+ }
14
+ }
15
+ }
16
+ },
17
+ "maximumDepth": 3,
18
+ "expect": {
19
+ "rejected": "depth-exceeded"
20
+ }
21
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "canonical-vector",
4
+ "id": "vector.canonical-vector.empty-containers",
5
+ "description": "Empty objects and arrays serialize without padding.",
6
+ "value": {
7
+ "array": [],
8
+ "object": {}
9
+ },
10
+ "expect": {
11
+ "canonical": "{\"array\":[],\"object\":{}}",
12
+ "digest": "sha256-E7OK6rLhiixi3ilF25YAcggBtIPkGTb1oVTb2nJhvnA="
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "canonical-vector",
4
+ "id": "vector.canonical-vector.forbidden-member",
5
+ "description": "A forbidden member name is refused rather than silently dropped.",
6
+ "value": {
7
+ "__proto__": {
8
+ "polluted": true
9
+ }
10
+ },
11
+ "expect": {
12
+ "rejected": "forbidden-member"
13
+ }
14
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "canonical-vector",
4
+ "id": "vector.canonical-vector.member-order",
5
+ "description": "Object members sort by Unicode code unit, not by locale or insertion order.",
6
+ "value": {
7
+ "b": 1,
8
+ "A": 2,
9
+ "a": 3,
10
+ "Z": 4
11
+ },
12
+ "expect": {
13
+ "canonical": "{\"A\":2,\"Z\":4,\"a\":3,\"b\":1}",
14
+ "digest": "sha256-Vn19opLXri8fGzPIdqbQbXdepLMLLlGlhBb5yr19cyk="
15
+ }
16
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "canonical-vector",
4
+ "id": "vector.canonical-vector.negative-zero",
5
+ "description": "Negative zero canonicalizes to zero so two equal values never differ in bytes.",
6
+ "value": {
7
+ "value": -0.0
8
+ },
9
+ "expect": {
10
+ "canonical": "{\"value\":0}",
11
+ "digest": "sha256-I9eyhr1ClGC5KiocIbavw0EQRGxQNMFzY/2jY6oKfF0="
12
+ }
13
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "canonical-vector",
4
+ "id": "vector.canonical-vector.nested-order",
5
+ "description": "Sorting is recursive: every nested object is ordered the same way.",
6
+ "value": {
7
+ "outer": {
8
+ "z": 1,
9
+ "a": {
10
+ "y": 2,
11
+ "b": 3
12
+ }
13
+ }
14
+ },
15
+ "expect": {
16
+ "canonical": "{\"outer\":{\"a\":{\"b\":3,\"y\":2},\"z\":1}}",
17
+ "digest": "sha256-3TQ80V/GRN0uwwkENcctjI199+5MjvAWVuMxlJcDZRw="
18
+ }
19
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "canonical-vector",
4
+ "id": "vector.canonical-vector.non-ascii",
5
+ "description": "Non-ASCII text is emitted as UTF-8, never as escape sequences.",
6
+ "value": {
7
+ "value": "héllo — 日本語"
8
+ },
9
+ "expect": {
10
+ "canonical": "{\"value\":\"héllo — 日本語\"}",
11
+ "digest": "sha256-lrSVhIWiYBcsHDXMZ3FTt4QcB2pNvqKW8TRX2F803+Y="
12
+ }
13
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "canonical-vector",
4
+ "id": "vector.canonical-vector.numbers",
5
+ "description": "Integers and decimals use the deterministic number grammar.",
6
+ "value": {
7
+ "decimal": 1.5,
8
+ "integer": 42,
9
+ "large": 9007199254740991,
10
+ "negative": -7
11
+ },
12
+ "expect": {
13
+ "canonical": "{\"decimal\":1.5,\"integer\":42,\"large\":9007199254740991,\"negative\":-7}",
14
+ "digest": "sha256-HI1BWhgmbgXvatESL+t+Y1QwYSfvAT4DOaYjU2fmdbQ="
15
+ }
16
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "canonical-vector",
4
+ "id": "vector.canonical-vector.string-escapes",
5
+ "description": "Only the characters ECMA-404 requires are escaped, using the short forms where they exist.",
6
+ "value": {
7
+ "value": "quote\" backslash\\ newline\n tab\t"
8
+ },
9
+ "expect": {
10
+ "canonical": "{\"value\":\"quote\\\" backslash\\\\ newline\\n tab\\t\"}",
11
+ "digest": "sha256-cci0wehH9sStfAleZcirUIOhCgpJKS8jPtKs34gE+ic="
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "canonical-vector",
4
+ "id": "vector.canonical-vector.surrogate-pair",
5
+ "description": "An astral character stays one code point in the UTF-8 bytes.",
6
+ "value": {
7
+ "value": "😀"
8
+ },
9
+ "expect": {
10
+ "canonical": "{\"value\":\"😀\"}",
11
+ "digest": "sha256-L8ufbEEor6c96MSNyg/HwfpSDn3KX29eewMH1oMoIMk="
12
+ }
13
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "host-vector",
4
+ "id": "vector.host-vector.artifact.dependencies",
5
+ "description": "Dependency inspection answers with the authorized reference list.",
6
+ "profile": "studio.profile/host-baseline",
7
+ "port": "artifact",
8
+ "operation": "dependencies",
9
+ "given": {
10
+ "artifacts": [
11
+ {
12
+ "id": "vector.blueprint",
13
+ "kind": "blueprint",
14
+ "revision": "vector.blueprint-r1"
15
+ }
16
+ ],
17
+ "permissions": ["studio.permission/publish", "studio.permission/save"],
18
+ "sessionGeneration": "session-r1"
19
+ },
20
+ "context": {
21
+ "operationId": "studio.operation/artifact.dependencies",
22
+ "protocolVersion": "0.1.0-draft.2",
23
+ "requestId": "requests/vector-1",
24
+ "resourceContextKey": "contexts/vector",
25
+ "sessionGeneration": "session-r1"
26
+ },
27
+ "argument": {
28
+ "id": "vector.blueprint",
29
+ "version": "1.0.0"
30
+ },
31
+ "expect": {
32
+ "outcome": "result",
33
+ "value": "artifact-references"
34
+ }
35
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "host-vector",
4
+ "id": "vector.host-vector.artifact.load.stored",
5
+ "description": "Loading a stored artifact returns it with the revision it is stored at.",
6
+ "profile": "studio.profile/host-baseline",
7
+ "port": "artifact",
8
+ "operation": "load",
9
+ "given": {
10
+ "artifacts": [
11
+ {
12
+ "id": "vector.blueprint",
13
+ "kind": "blueprint",
14
+ "revision": "vector.blueprint-r1"
15
+ }
16
+ ],
17
+ "permissions": ["studio.permission/publish", "studio.permission/save"],
18
+ "sessionGeneration": "session-r1"
19
+ },
20
+ "context": {
21
+ "operationId": "studio.operation/artifact.load",
22
+ "protocolVersion": "0.1.0-draft.2",
23
+ "requestId": "requests/vector-1",
24
+ "resourceContextKey": "contexts/vector",
25
+ "sessionGeneration": "session-r1"
26
+ },
27
+ "argument": {
28
+ "id": "vector.blueprint",
29
+ "version": "1.0.0"
30
+ },
31
+ "expect": {
32
+ "outcome": "result",
33
+ "revision": "vector.blueprint-r1",
34
+ "value": "artifact"
35
+ }
36
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "host-vector",
4
+ "id": "vector.host-vector.artifact.load.unknown",
5
+ "description": "An unknown artifact identifier is refused as not-found without disclosing whether it exists.",
6
+ "profile": "studio.profile/host-baseline",
7
+ "port": "artifact",
8
+ "operation": "load",
9
+ "given": {
10
+ "artifacts": [
11
+ {
12
+ "id": "vector.blueprint",
13
+ "kind": "blueprint",
14
+ "revision": "vector.blueprint-r1"
15
+ }
16
+ ],
17
+ "permissions": ["studio.permission/publish", "studio.permission/save"],
18
+ "sessionGeneration": "session-r1"
19
+ },
20
+ "context": {
21
+ "operationId": "studio.operation/artifact.load",
22
+ "protocolVersion": "0.1.0-draft.2",
23
+ "requestId": "requests/vector-1",
24
+ "resourceContextKey": "contexts/vector",
25
+ "sessionGeneration": "session-r1"
26
+ },
27
+ "argument": {
28
+ "id": "vector.absent",
29
+ "version": "1.0.0"
30
+ },
31
+ "expect": {
32
+ "outcome": "error",
33
+ "category": "not-found",
34
+ "retryable": false,
35
+ "messageMustNotContain": ["vector.absent"]
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "host-vector",
4
+ "id": "vector.host-vector.artifact.publish.accepted",
5
+ "description": "Publishing under the current revision is accepted and advances the revision.",
6
+ "profile": "studio.profile/host-baseline",
7
+ "port": "artifact",
8
+ "operation": "publish",
9
+ "given": {
10
+ "artifacts": [
11
+ {
12
+ "id": "vector.blueprint",
13
+ "kind": "blueprint",
14
+ "revision": "vector.blueprint-r1"
15
+ }
16
+ ],
17
+ "permissions": ["studio.permission/publish", "studio.permission/save"],
18
+ "sessionGeneration": "session-r1"
19
+ },
20
+ "context": {
21
+ "operationId": "studio.operation/artifact.publish",
22
+ "protocolVersion": "0.1.0-draft.2",
23
+ "requestId": "requests/vector-1",
24
+ "resourceContextKey": "contexts/vector",
25
+ "sessionGeneration": "session-r1",
26
+ "expectedRevision": "vector.blueprint-r1"
27
+ },
28
+ "argument": {
29
+ "id": "vector.blueprint",
30
+ "version": "1.0.0"
31
+ },
32
+ "expect": {
33
+ "outcome": "result",
34
+ "revisionAdvances": true,
35
+ "value": "null"
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "host-vector",
4
+ "id": "vector.host-vector.artifact.publish.forbidden",
5
+ "description": "Publication authority is distinct from save authority: holding one never grants the other.",
6
+ "profile": "studio.profile/host-baseline",
7
+ "port": "artifact",
8
+ "operation": "publish",
9
+ "given": {
10
+ "artifacts": [
11
+ {
12
+ "id": "vector.blueprint",
13
+ "kind": "blueprint",
14
+ "revision": "vector.blueprint-r1"
15
+ }
16
+ ],
17
+ "permissions": ["studio.permission/save"],
18
+ "sessionGeneration": "session-r1"
19
+ },
20
+ "context": {
21
+ "operationId": "studio.operation/artifact.publish",
22
+ "protocolVersion": "0.1.0-draft.2",
23
+ "requestId": "requests/vector-1",
24
+ "resourceContextKey": "contexts/vector",
25
+ "sessionGeneration": "session-r1",
26
+ "expectedRevision": "vector.blueprint-r1"
27
+ },
28
+ "argument": {
29
+ "id": "vector.blueprint",
30
+ "version": "1.0.0"
31
+ },
32
+ "expect": {
33
+ "outcome": "error",
34
+ "category": "forbidden",
35
+ "retryable": false
36
+ }
37
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "host-vector",
4
+ "id": "vector.host-vector.artifact.publish.stale",
5
+ "description": "Publishing against a superseded revision conflicts and carries the safe current revision.",
6
+ "profile": "studio.profile/host-baseline",
7
+ "port": "artifact",
8
+ "operation": "publish",
9
+ "given": {
10
+ "artifacts": [
11
+ {
12
+ "id": "vector.blueprint",
13
+ "kind": "blueprint",
14
+ "revision": "vector.blueprint-r1"
15
+ }
16
+ ],
17
+ "permissions": ["studio.permission/publish", "studio.permission/save"],
18
+ "sessionGeneration": "session-r1"
19
+ },
20
+ "context": {
21
+ "operationId": "studio.operation/artifact.publish",
22
+ "protocolVersion": "0.1.0-draft.2",
23
+ "requestId": "requests/vector-1",
24
+ "resourceContextKey": "contexts/vector",
25
+ "sessionGeneration": "session-r1",
26
+ "expectedRevision": "vector.blueprint-r0"
27
+ },
28
+ "argument": {
29
+ "id": "vector.blueprint",
30
+ "version": "1.0.0"
31
+ },
32
+ "expect": {
33
+ "outcome": "error",
34
+ "category": "conflict",
35
+ "retryable": false,
36
+ "revision": "vector.blueprint-r1"
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "host-vector",
4
+ "id": "vector.host-vector.artifact.save.accepted",
5
+ "description": "A save whose expected revision matches the stored revision is accepted and advances the revision.",
6
+ "profile": "studio.profile/host-baseline",
7
+ "port": "artifact",
8
+ "operation": "save",
9
+ "given": {
10
+ "artifacts": [
11
+ {
12
+ "id": "vector.blueprint",
13
+ "kind": "blueprint",
14
+ "revision": "vector.blueprint-r1"
15
+ }
16
+ ],
17
+ "permissions": ["studio.permission/publish", "studio.permission/save"],
18
+ "sessionGeneration": "session-r1"
19
+ },
20
+ "context": {
21
+ "operationId": "studio.operation/artifact.save",
22
+ "protocolVersion": "0.1.0-draft.2",
23
+ "requestId": "requests/vector-1",
24
+ "resourceContextKey": "contexts/vector",
25
+ "sessionGeneration": "session-r1",
26
+ "expectedRevision": "vector.blueprint-r1",
27
+ "idempotencyKey": "idempotency/save-1"
28
+ },
29
+ "argument": {
30
+ "id": "vector.blueprint",
31
+ "kind": "blueprint"
32
+ },
33
+ "expect": {
34
+ "outcome": "result",
35
+ "revisionAdvances": true,
36
+ "value": "null"
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "host-vector",
4
+ "id": "vector.host-vector.artifact.save.forbidden",
5
+ "description": "A save the acting identity is not authorized for is refused before the artifact is touched, and the refusal does not disclose whether it exists.",
6
+ "profile": "studio.profile/host-baseline",
7
+ "port": "artifact",
8
+ "operation": "save",
9
+ "given": {
10
+ "artifacts": [
11
+ {
12
+ "id": "vector.blueprint",
13
+ "kind": "blueprint",
14
+ "revision": "vector.blueprint-r1"
15
+ }
16
+ ],
17
+ "permissions": ["studio.permission/publish"],
18
+ "sessionGeneration": "session-r1"
19
+ },
20
+ "context": {
21
+ "operationId": "studio.operation/artifact.save",
22
+ "protocolVersion": "0.1.0-draft.2",
23
+ "requestId": "requests/vector-1",
24
+ "resourceContextKey": "contexts/vector",
25
+ "sessionGeneration": "session-r1",
26
+ "expectedRevision": "vector.blueprint-r1"
27
+ },
28
+ "argument": {
29
+ "id": "vector.blueprint",
30
+ "kind": "blueprint"
31
+ },
32
+ "expect": {
33
+ "outcome": "error",
34
+ "category": "forbidden",
35
+ "retryable": false,
36
+ "messageMustNotContain": ["vector.blueprint"]
37
+ }
38
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "host-vector",
4
+ "id": "vector.host-vector.artifact.save.stale",
5
+ "description": "A save against a superseded revision conflicts and returns the safe current revision so the client resolves without a second read.",
6
+ "profile": "studio.profile/host-baseline",
7
+ "port": "artifact",
8
+ "operation": "save",
9
+ "given": {
10
+ "artifacts": [
11
+ {
12
+ "id": "vector.blueprint",
13
+ "kind": "blueprint",
14
+ "revision": "vector.blueprint-r1"
15
+ }
16
+ ],
17
+ "permissions": ["studio.permission/publish", "studio.permission/save"],
18
+ "sessionGeneration": "session-r1"
19
+ },
20
+ "context": {
21
+ "operationId": "studio.operation/artifact.save",
22
+ "protocolVersion": "0.1.0-draft.2",
23
+ "requestId": "requests/vector-1",
24
+ "resourceContextKey": "contexts/vector",
25
+ "sessionGeneration": "session-r1",
26
+ "expectedRevision": "vector.blueprint-r0",
27
+ "idempotencyKey": "idempotency/save-2"
28
+ },
29
+ "argument": {
30
+ "id": "vector.blueprint",
31
+ "kind": "blueprint"
32
+ },
33
+ "expect": {
34
+ "outcome": "error",
35
+ "category": "conflict",
36
+ "retryable": false,
37
+ "revision": "vector.blueprint-r1"
38
+ }
39
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "host-vector",
4
+ "id": "vector.host-vector.artifact.unpublish.stale",
5
+ "description": "Unpublishing is revision-checked exactly like every other mutation.",
6
+ "profile": "studio.profile/host-baseline",
7
+ "port": "artifact",
8
+ "operation": "unpublish",
9
+ "given": {
10
+ "artifacts": [
11
+ {
12
+ "id": "vector.blueprint",
13
+ "kind": "blueprint",
14
+ "revision": "vector.blueprint-r1"
15
+ }
16
+ ],
17
+ "permissions": ["studio.permission/publish", "studio.permission/save"],
18
+ "sessionGeneration": "session-r1"
19
+ },
20
+ "context": {
21
+ "operationId": "studio.operation/artifact.unpublish",
22
+ "protocolVersion": "0.1.0-draft.2",
23
+ "requestId": "requests/vector-1",
24
+ "resourceContextKey": "contexts/vector",
25
+ "sessionGeneration": "session-r1",
26
+ "expectedRevision": "vector.blueprint-r0"
27
+ },
28
+ "argument": {
29
+ "id": "vector.blueprint",
30
+ "version": "1.0.0"
31
+ },
32
+ "expect": {
33
+ "outcome": "error",
34
+ "category": "conflict",
35
+ "retryable": false,
36
+ "revision": "vector.blueprint-r1"
37
+ }
38
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "kind": "host-vector",
4
+ "id": "vector.host-vector.envelope.malformed-context",
5
+ "description": "A structurally invalid request envelope is refused as invalid-request rather than partially honoured.",
6
+ "profile": "studio.profile/host-baseline",
7
+ "port": "artifact",
8
+ "operation": "load",
9
+ "given": {
10
+ "artifacts": [
11
+ {
12
+ "id": "vector.blueprint",
13
+ "kind": "blueprint",
14
+ "revision": "vector.blueprint-r1"
15
+ }
16
+ ],
17
+ "permissions": ["studio.permission/publish", "studio.permission/save"],
18
+ "sessionGeneration": "session-r1"
19
+ },
20
+ "context": {
21
+ "operationId": "studio.operation/artifact.load",
22
+ "protocolVersion": "0.1.0-draft.2",
23
+ "requestId": "",
24
+ "resourceContextKey": "contexts/vector",
25
+ "sessionGeneration": "session-r1"
26
+ },
27
+ "argument": {
28
+ "id": "vector.blueprint",
29
+ "version": "1.0.0"
30
+ },
31
+ "expect": {
32
+ "outcome": "error",
33
+ "category": "invalid-request",
34
+ "retryable": false
35
+ }
36
+ }