@openwop/openwop-conformance 1.0.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 (175) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +241 -0
  3. package/api/asyncapi.yaml +481 -0
  4. package/api/openapi.yaml +830 -0
  5. package/api/redocly.yaml +8 -0
  6. package/coverage.md +80 -0
  7. package/dist/cli.js +161 -0
  8. package/fixtures/conformance-a2a-task-roundtrip.json +27 -0
  9. package/fixtures/conformance-agent-identity.json +27 -0
  10. package/fixtures/conformance-agent-low-confidence.json +29 -0
  11. package/fixtures/conformance-agent-memory-cross-tenant.json +28 -0
  12. package/fixtures/conformance-agent-memory-redaction.json +32 -0
  13. package/fixtures/conformance-agent-memory-roundtrip.json +32 -0
  14. package/fixtures/conformance-agent-memory-ttl.json +31 -0
  15. package/fixtures/conformance-agent-pack-export.json +26 -0
  16. package/fixtures/conformance-agent-pack-install.json +26 -0
  17. package/fixtures/conformance-agent-pack-provenance.json +31 -0
  18. package/fixtures/conformance-agent-reasoning.json +29 -0
  19. package/fixtures/conformance-approval.json +27 -0
  20. package/fixtures/conformance-cancellable.json +33 -0
  21. package/fixtures/conformance-cap-breach.json +27 -0
  22. package/fixtures/conformance-capability-missing.json +23 -0
  23. package/fixtures/conformance-channel-ttl.json +60 -0
  24. package/fixtures/conformance-clarification.json +30 -0
  25. package/fixtures/conformance-conversation-capability-negotiation.json +23 -0
  26. package/fixtures/conformance-conversation-lifecycle.json +32 -0
  27. package/fixtures/conformance-conversation-replay.json +33 -0
  28. package/fixtures/conformance-conversation-vs-clarification.json +26 -0
  29. package/fixtures/conformance-delay.json +33 -0
  30. package/fixtures/conformance-dispatch-loop.json +38 -0
  31. package/fixtures/conformance-failure.json +23 -0
  32. package/fixtures/conformance-idempotent.json +30 -0
  33. package/fixtures/conformance-identity.json +32 -0
  34. package/fixtures/conformance-interrupt-auth-required.json +28 -0
  35. package/fixtures/conformance-interrupt-external-event.json +33 -0
  36. package/fixtures/conformance-interrupt-parent-child-cancel-child.json +27 -0
  37. package/fixtures/conformance-interrupt-parent-child-cancel.json +26 -0
  38. package/fixtures/conformance-interrupt-quorum.json +30 -0
  39. package/fixtures/conformance-mcp-tool-roundtrip.json +32 -0
  40. package/fixtures/conformance-message-reducer.json +31 -0
  41. package/fixtures/conformance-multi-node.json +21 -0
  42. package/fixtures/conformance-noop.json +23 -0
  43. package/fixtures/conformance-orchestrator-dispatch.json +47 -0
  44. package/fixtures/conformance-orchestrator-low-confidence.json +41 -0
  45. package/fixtures/conformance-orchestrator-terminate.json +44 -0
  46. package/fixtures/conformance-stream-text.json +26 -0
  47. package/fixtures/conformance-subworkflow-child.json +21 -0
  48. package/fixtures/conformance-subworkflow-parent.json +49 -0
  49. package/fixtures/conformance-version-fold.json +23 -0
  50. package/fixtures/conformance-wasm-pack-roundtrip.json +25 -0
  51. package/fixtures/pack-manifests/pack-private-example.json +26 -0
  52. package/fixtures.md +404 -0
  53. package/package.json +48 -0
  54. package/schemas/README.md +75 -0
  55. package/schemas/agent-manifest.schema.json +107 -0
  56. package/schemas/agent-ref.schema.json +53 -0
  57. package/schemas/capabilities.schema.json +287 -0
  58. package/schemas/channel-written-payload.schema.json +55 -0
  59. package/schemas/conversation-event.schema.json +120 -0
  60. package/schemas/conversation-turn.schema.json +72 -0
  61. package/schemas/debug-bundle.schema.json +196 -0
  62. package/schemas/dispatch-config.schema.json +46 -0
  63. package/schemas/error-envelope.schema.json +25 -0
  64. package/schemas/memory-entry.schema.json +36 -0
  65. package/schemas/memory-list-options.schema.json +21 -0
  66. package/schemas/node-pack-manifest.schema.json +235 -0
  67. package/schemas/orchestrator-decision.schema.json +60 -0
  68. package/schemas/run-event-payloads.schema.json +663 -0
  69. package/schemas/run-event.schema.json +116 -0
  70. package/schemas/run-options.schema.json +81 -0
  71. package/schemas/run-orchestrator-decided-event.schema.json +20 -0
  72. package/schemas/run-snapshot.schema.json +121 -0
  73. package/schemas/suspend-request.schema.json +182 -0
  74. package/schemas/workflow-definition.schema.json +430 -0
  75. package/src/cli.ts +187 -0
  76. package/src/lib/a2a-fake-peer.ts +233 -0
  77. package/src/lib/canaries.ts +186 -0
  78. package/src/lib/driver.ts +96 -0
  79. package/src/lib/env.ts +49 -0
  80. package/src/lib/fixtures.ts +93 -0
  81. package/src/lib/mcp-fake-server.ts +185 -0
  82. package/src/lib/multi-agent-capabilities.ts +155 -0
  83. package/src/lib/multiProcess.ts +141 -0
  84. package/src/lib/otel-collector.ts +312 -0
  85. package/src/lib/paths.ts +198 -0
  86. package/src/lib/polling.ts +81 -0
  87. package/src/lib/profiles.ts +258 -0
  88. package/src/lib/sse.ts +172 -0
  89. package/src/scenarios/a2a-task-roundtrip.test.ts +149 -0
  90. package/src/scenarios/agentConfidenceEscalation.test.ts +61 -0
  91. package/src/scenarios/agentMemoryCrossTenantIsolation.test.ts +54 -0
  92. package/src/scenarios/agentMemoryRedactionContract.test.ts +46 -0
  93. package/src/scenarios/agentMemoryRoundTrip.test.ts +52 -0
  94. package/src/scenarios/agentMemoryTtlExpiry.test.ts +47 -0
  95. package/src/scenarios/agentMessageReducer.test.ts +57 -0
  96. package/src/scenarios/agentMetadata.test.ts +56 -0
  97. package/src/scenarios/agentPackExport.test.ts +45 -0
  98. package/src/scenarios/agentPackInstall.test.ts +50 -0
  99. package/src/scenarios/agentPackProvenance.test.ts +53 -0
  100. package/src/scenarios/agentReasoningEvents.test.ts +72 -0
  101. package/src/scenarios/append-ordering.test.ts +91 -0
  102. package/src/scenarios/approval-payload.test.ts +120 -0
  103. package/src/scenarios/audit-log-integrity.test.ts +106 -0
  104. package/src/scenarios/auth.test.ts +55 -0
  105. package/src/scenarios/byok-roundtrip.test.ts +166 -0
  106. package/src/scenarios/cancellation.test.ts +68 -0
  107. package/src/scenarios/cap-breach.test.ts +149 -0
  108. package/src/scenarios/channel-ttl.test.ts +70 -0
  109. package/src/scenarios/configurable-schema.test.ts +76 -0
  110. package/src/scenarios/conversationCapabilityNegotiation.test.ts +39 -0
  111. package/src/scenarios/conversationLifecycle.test.ts +64 -0
  112. package/src/scenarios/conversationReplayDeterminism.test.ts +52 -0
  113. package/src/scenarios/conversationVsLegacySuspend.test.ts +46 -0
  114. package/src/scenarios/cost-attribution.test.ts +207 -0
  115. package/src/scenarios/debugBundle.test.ts +222 -0
  116. package/src/scenarios/discovery.test.ts +147 -0
  117. package/src/scenarios/dispatchLoop.test.ts +52 -0
  118. package/src/scenarios/errors.test.ts +144 -0
  119. package/src/scenarios/eventOrdering.test.ts +144 -0
  120. package/src/scenarios/failure-path.test.ts +46 -0
  121. package/src/scenarios/fixtures-gating.test.ts +137 -0
  122. package/src/scenarios/fixtures-valid.test.ts +140 -0
  123. package/src/scenarios/highConcurrency.test.ts +263 -0
  124. package/src/scenarios/idempotency.test.ts +83 -0
  125. package/src/scenarios/idempotencyRetry.test.ts +130 -0
  126. package/src/scenarios/identity-passthrough.test.ts +54 -0
  127. package/src/scenarios/interrupt-approval.test.ts +97 -0
  128. package/src/scenarios/interrupt-auth-required-resume.test.ts +88 -0
  129. package/src/scenarios/interrupt-clarification.test.ts +45 -0
  130. package/src/scenarios/interrupt-external-event-correlation.test.ts +113 -0
  131. package/src/scenarios/interrupt-parent-child-cascade.test.ts +102 -0
  132. package/src/scenarios/interrupt-quorum-resolution.test.ts +97 -0
  133. package/src/scenarios/interruptRace.test.ts +176 -0
  134. package/src/scenarios/maliciousManifest.test.ts +154 -0
  135. package/src/scenarios/mcp-discoverability.test.ts +129 -0
  136. package/src/scenarios/mcp-tool-roundtrip.test.ts +149 -0
  137. package/src/scenarios/multi-node-ordering.test.ts +60 -0
  138. package/src/scenarios/multi-region-idempotency.test.ts +52 -0
  139. package/src/scenarios/orchestratorConservativePath.test.ts +63 -0
  140. package/src/scenarios/orchestratorDispatch.test.ts +66 -0
  141. package/src/scenarios/orchestratorTermination.test.ts +54 -0
  142. package/src/scenarios/otel-emission.test.ts +113 -0
  143. package/src/scenarios/otel-trace-propagation.test.ts +90 -0
  144. package/src/scenarios/pack-registry-publish.test.ts +93 -0
  145. package/src/scenarios/pack-registry.test.ts +328 -0
  146. package/src/scenarios/pause-resume.test.ts +109 -0
  147. package/src/scenarios/policies.test.ts +162 -0
  148. package/src/scenarios/profileDerivation.test.ts +335 -0
  149. package/src/scenarios/providerPolicyEnforcement.test.ts +132 -0
  150. package/src/scenarios/rate-limit-envelope.test.ts +97 -0
  151. package/src/scenarios/redaction.test.ts +254 -0
  152. package/src/scenarios/redactionAdversarial.test.ts +162 -0
  153. package/src/scenarios/replay-fork-arbitrary.test.ts +347 -0
  154. package/src/scenarios/replay-fork.test.ts +216 -0
  155. package/src/scenarios/replayDeterminism.test.ts +171 -0
  156. package/src/scenarios/route-coverage.test.ts +129 -0
  157. package/src/scenarios/runs-lifecycle.test.ts +65 -0
  158. package/src/scenarios/runtime-capabilities.test.ts +118 -0
  159. package/src/scenarios/spec-corpus-validity.test.ts +1257 -0
  160. package/src/scenarios/staleClaim.test.ts +223 -0
  161. package/src/scenarios/stream-modes-buffer.test.ts +148 -0
  162. package/src/scenarios/stream-modes-mixed.test.ts +149 -0
  163. package/src/scenarios/stream-modes.test.ts +139 -0
  164. package/src/scenarios/streamReconnect.test.ts +162 -0
  165. package/src/scenarios/subworkflow.test.ts +126 -0
  166. package/src/scenarios/version-negotiation.test.ts +157 -0
  167. package/src/scenarios/wasm-pack-abi-version-rejection.test.ts +47 -0
  168. package/src/scenarios/wasm-pack-invoke-completed.test.ts +69 -0
  169. package/src/scenarios/wasm-pack-invoke-suspended.test.ts +74 -0
  170. package/src/scenarios/wasm-pack-load.test.ts +75 -0
  171. package/src/scenarios/wasm-pack-memory-cap.test.ts +43 -0
  172. package/src/scenarios/wasm-pack-replay-determinism.test.ts +61 -0
  173. package/src/scenarios/webhook-sig-algorithm.test.ts +61 -0
  174. package/src/setup.ts +173 -0
  175. package/vitest.config.ts +17 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 David Tufts and openwop contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
200
+ implied. See the License for the specific language governing permissions
201
+ and limitations under the License.
package/README.md ADDED
@@ -0,0 +1,241 @@
1
+ # `@openwop/openwop-conformance` — Conformance Suite for the Multi-Agent Workflow Orchestration Protocol
2
+
3
+ **openwop is an open, wire-level protocol for multi-agent workflow orchestration** — a single contract for runs in which LLM agents, deterministic tools, sub-workflows, and human reviewers collaborate, with durable suspend / resume, replay, version negotiation, and observability owned by the protocol itself. This package is the black-box conformance suite: point it at any OpenWOP-compliant server (your own or a third party's) and it issues real HTTP requests against the spec'd endpoints and asserts that responses match.
4
+
5
+ ```bash
6
+ npm install @openwop/openwop-conformance
7
+ # or run without install:
8
+ npx @openwop/openwop-conformance --base-url https://api.example.com --api-key hk_test_...
9
+ ```
10
+
11
+ > **Spec:** [github.com/openwop/openwop](https://github.com/openwop/openwop) · See `CHANGELOG.md` below for release history.
12
+
13
+ The suite is intentionally self-contained — it does NOT depend on the reference implementation. A spec-compliant server written in any language can run this suite against itself by spinning up its server, exporting the env vars, and running `npx vitest run`.
14
+
15
+ > **Status:** Tracks the FINAL v1 protocol contract. The suite version evolves independently as new scenarios ship (vendor-neutral redaction, cost attribution, post-v1 ecosystem triggers); see [`CHANGELOG.md`](./CHANGELOG.md) for the current release.
16
+
17
+ ---
18
+
19
+ ## Quickstart
20
+
21
+ Two ways to run: the friendly `openwop-conformance` CLI (recommended for
22
+ operators) or `vitest` directly (recommended for CI).
23
+
24
+ ### CLI
25
+
26
+ ```bash
27
+ cd conformance
28
+ npm install
29
+
30
+ # Build the CLI binary
31
+ npm run build:cli
32
+
33
+ # Server-free subset (no deployment target needed)
34
+ ./dist/cli.js --offline
35
+
36
+ # Full suite against a deployed server
37
+ ./dist/cli.js \
38
+ --base-url https://api.example.com \
39
+ --api-key hk_test_abc123 \
40
+ --impl acme-openwop-server --impl-version 1.0
41
+
42
+ # Filter by test-name pattern
43
+ ./dist/cli.js --base-url ... --api-key ... --filter "discovery|errors"
44
+ ```
45
+
46
+ `./dist/cli.js --help` for the full flag reference. Env vars
47
+ (`OPENWOP_BASE_URL`, `OPENWOP_API_KEY`, `OPENWOP_IMPLEMENTATION_*`) override CLI
48
+ flags only when the flag is unset.
49
+
50
+ ### Direct vitest
51
+
52
+ ```bash
53
+ cd conformance
54
+ npm install
55
+
56
+ export OPENWOP_BASE_URL="https://api.example.com"
57
+ export OPENWOP_API_KEY="hk_test_..."
58
+
59
+ npx vitest run # full suite
60
+ npx vitest run src/scenarios/discovery.test.ts # single file
61
+ ```
62
+
63
+ Exit code is non-zero on any failed assertion.
64
+
65
+ ---
66
+
67
+ ## What's Covered
68
+
69
+ The current suite has 85 scenario files under `src/scenarios/`. This includes 18 Multi-Agent Shift scenarios (Phases 1-5) added 2026-05-10. The maintained scenario-to-spec map lives in [`coverage.md`](./coverage.md); this README keeps the operator quickstart and the historical scenario notes below.
70
+
71
+ High-level coverage includes:
72
+
73
+ - Server-free corpus checks for fixtures, JSON Schema, OpenAPI, AsyncAPI, and prose status metadata.
74
+ - Server-required checks for discovery, auth, error envelopes, run lifecycle, idempotency, cancellation, interrupts, streaming, replay/fork, version negotiation, storage failover, redaction, cost attribution, node-pack registry behavior, and optional profile derivation.
75
+ - Fixture-gated checks that skip cleanly unless the host advertises the corresponding fixture IDs.
76
+
77
+ ## Historical Coverage Notes
78
+
79
+ Server-free (run anywhere, including CI without a deployment target):
80
+
81
+ | Category | Spec doc | Coverage |
82
+ |---|---|---|
83
+ | **Fixtures** | [`fixtures.md`](./fixtures.md) | Every fixture JSON in `fixtures/*.json` validates against `../schemas/workflow-definition.schema.json`; `id` matches filename; manual trigger present. (12 assertions) |
84
+ | **Spec corpus** | the whole `` tree | JSON Schemas compile under Ajv2020; OpenAPI 3.1 + AsyncAPI 3.1 YAMLs structurally valid + their `$ref`s resolve; every prose `.md` carries a `Status:` legend tag; `fixtures.md` ↔ `fixtures/*.json` round-trip is consistent. (24 assertions) |
85
+
86
+ Server-required (requires `OPENWOP_BASE_URL` + `OPENWOP_API_KEY` + seeded fixtures):
87
+
88
+ | Category | Spec doc | Coverage |
89
+ |---|---|---|
90
+ | **Discovery** | [`capabilities.md`](../spec/v1/capabilities.md) | `/.well-known/openwop` returns valid Capabilities shape with required fields; `Cache-Control` present; non-zero limits. |
91
+ | **Discovery** | [`rest-endpoints.md`](../spec/v1/rest-endpoints.md) | `/v1/openapi.json` returns a parseable OpenAPI 3.1 document. |
92
+ | **Auth** | [`auth.md`](../spec/v1/auth.md) | Missing/invalid API key returns `401` with canonical error envelope. |
93
+ | **Errors** | [`rest-endpoints.md`](../spec/v1/rest-endpoints.md) | All error responses share the `{error, message, details?}` envelope. |
94
+ | **Run lifecycle** | [`rest-endpoints.md`](../spec/v1/rest-endpoints.md) + [`fixtures.md`](./fixtures.md) | `POST /v1/runs` with `conformance-noop` fixture reaches terminal `completed` within bounded time. |
95
+ | **Idempotency** | [`idempotency.md`](../spec/v1/idempotency.md) | Same `Idempotency-Key` + same body replays (carries `openwop-Idempotent-Replay` header, returns same runId); same key + different body returns 409. |
96
+ | **Cancellation** | [`rest-endpoints.md`](../spec/v1/rest-endpoints.md) | `POST /v1/runs/{runId}/cancel` mid-flight on `conformance-cancellable` reaches terminal `cancelled` within 5s. |
97
+ | **HITL approval** | [`interrupt.md`](../spec/v1/interrupt.md) | `conformance-approval` suspends at `waiting-approval`; `{action: 'accept'}` resolve drives terminal `completed`. Invalid action and unknown nodeId return 400/422 and 404. |
98
+ | **HITL clarification** | [`interrupt.md`](../spec/v1/interrupt.md) | `conformance-clarification` suspends at `waiting-input`; `{answers: {q1: ...}}` resolve drives terminal `completed`. |
99
+ | **Failure path** | [`rest-endpoints.md`](../spec/v1/rest-endpoints.md) | `conformance-failure` reaches terminal `failed`; `RunSnapshot.error` is `{code: string, message: string}`. |
100
+ | **Identity passthrough** | [`fixtures.md`](./fixtures.md) | `conformance-identity` deep-equals nested JSON input through `inputs.payload` → `variables.payload`. |
101
+ | **Multi-node ordering** | [`fixtures.md`](./fixtures.md) | `conformance-multi-node` emits `node.completed` events for nodeIds a, b, c in topological order via `event.sequence`. Exercises `GET /v1/runs/{runId}/events/poll`. |
102
+ | **Stream modes** | [`stream-modes.md`](../spec/v1/stream-modes.md) | `updates` mode emits `run.started` + `run.completed` and the server closes on terminal; unsupported `streamMode` returns 400 with `supported` array; `debug` mode event count ≥ `updates` mode. Uses `conformance-delay` and a hand-rolled SSE client. |
103
+ | **Replay / fork** | [`replay.md`](../spec/v1/replay.md) | `POST /v1/runs/{runId}:fork` from a finished `conformance-noop` run reaches terminal `completed` in both `replay` and `branch` modes. Validation: negative `fromSeq` → 400; `fromSeq` past source log → 422; `replay` + non-empty overlay → 400; fork on unknown run → 404. |
104
+ | **Version negotiation** | [`version-negotiation.md`](../spec/v1/version-negotiation.md) + [`run-event.schema.json`](../schemas/run-event.schema.json) | `Capabilities.protocolVersion` advertised; every persisted event carries the 6 required `RunEventDoc` fields (`eventId`, `runId`, `type`, `payload`, `timestamp`, `sequence`); per-run sequence is strictly monotonic; `events/poll?lastSequence=` past end returns 200+empty (not 4xx). Cross-version compat scenarios deferred — need server-controllable `engineVersion` releases. |
105
+
106
+ Server-required (added in 1):
107
+
108
+ | Category | Spec doc | Coverage |
109
+ |---|---|---|
110
+ | **Cap breach (recursion limit)** | [`run-options.md`](../spec/v1/run-options.md) §recursionLimit + [`observability.md`](../spec/v1/observability.md) §cap.breached | `conformance-cap-breach` with `configurable.recursionLimit: 3`: terminal `failed` with `error.code = "recursion_limit_exceeded"`; `cap.breached {kind: "node-executions", limit, observed, nodeId}` payload; cap.breached precedes run.failed in sequence; exactly `limit` `node.started` events emitted (over-limit node MUST NOT receive node.started). |
111
+
112
+ Server-required (added in 1.2.0):
113
+
114
+ | Category | Spec doc | Coverage |
115
+ |---|---|---|
116
+ | **Sub-workflow dispatch** | [`node-packs.md`](../spec/v1/node-packs.md) §Reserved Core openwop typeIds + [`fixtures.md`](./fixtures.md) §F2 | `conformance-subworkflow-parent` invokes `conformance-subworkflow-child` via `core.subWorkflow` with blocking dispatch + outputMapping. Asserts: parent reaches terminal `completed`; child variable propagates via outputMapping (`childOutcome === "child-completed"`); child run snapshot carries `parentRunId` + `parentNodeId` linkage; child reaches terminal `completed`. |
117
+
118
+ Server-required (added in 1.3.0):
119
+
120
+ | Category | Spec doc | Coverage |
121
+ |---|---|---|
122
+ | **Channel TTL** | [`channels-and-reducers.md`](../spec/v1/channels-and-reducers.md) §append + §TTL | `conformance-channel-ttl` writes 3 entries with `ttlMs: 200`, waits 300ms via `core.delay`, writes a 4th. Asserts: final `variables.events.length === 1`; surviving entry value `"d"`; entry carries numeric `_ts`. Validates the write-time TTL filter drops priors. |
123
+
124
+ Server-required (added in 1.4.0):
125
+
126
+ | Category | Spec doc | Coverage |
127
+ |---|---|---|
128
+ | **SSE buffering** | [`stream-modes.md`](../spec/v1/stream-modes.md) §Aggregation hint | `?bufferMs=` query parameter. Reuses `conformance-delay` fixture. Asserts: server accepts in-range value (0..5000) and emits `event: batch` SSE frames with array data; out-of-range `99999` returns 400 `validation_error`; force-flush on terminal events (run.completed bundled BEFORE the timer would fire); `bufferMs=0` behaves identically to omitting (per-event mode). |
129
+
130
+ Server-required (added in 1.5.0):
131
+
132
+ | Category | Spec doc | Coverage |
133
+ |---|---|---|
134
+ | **SSE mixed mode** | [`stream-modes.md`](../spec/v1/stream-modes.md) §Mixed mode | Comma-separated `?streamMode=` query. Reuses `conformance-delay` fixture. Asserts: server accepts `updates,messages` and emits server-closed stream containing run.completed; `values,updates` returns 400 `unsupported_stream_mode` (values is exclusive); `updates,bogus` returns 400 (partial-unknown lists fail wholesale); union semantics — `updates,debug` includes every event type `updates`-only includes. |
135
+
136
+ Placeholder (added in 1.6.0, gated on observable-span access):
137
+
138
+ | Category | Spec doc | Coverage |
139
+ |---|---|---|
140
+ | **Cost attribution** | [`observability.md`](../spec/v1/observability.md) §Cost attribution attributes | 5 `it.todo()` scenarios documenting the contract for `openwop.cost.*` OTel attributes (allowlist of 6 — provider, model, tokens.input, tokens.output, usd, duration_ms; redaction enforcement). Runs when a deployed reference exposes OTel spans or surfaces cost via the run snapshot. Runtime side + redaction unit tests are shipped. |
141
+
142
+ Server-required (added in 1.7.0):
143
+
144
+ | Category | Spec doc | Coverage |
145
+ |---|---|---|
146
+ | **Redaction** | [`capabilities.md`](../spec/v1/capabilities.md) §"Secrets" + NFR-7 + §"aiProviders" | Vendor-neutral assertions that the server doesn't leak secret material. Three scenario groups: (a) discovery shape contract — `secrets` + `aiProviders` advertisements are well-formed regardless of `secrets.supported`; when `supported === true`, scopes MUST be non-empty + `resolution === 'host-managed'`; `byok ⊆ supported`. (b) bearer-token redaction — invalid Bearer canary in `Authorization` header is not echoed in the 401 response body. (c) credentialRef echo control — gated on `secrets.supported === true`; canary planted in `configurable.ai.credentialRef` MUST NOT appear in any RunEvent payload (poll-based capture; transport-agnostic). Uses runtime-built canary fixtures (`lib/canaries.ts`) that defeat static secret scanners. 6 scenarios. |
147
+
148
+ Current source tree: 85 scenario files. Use [`coverage.md`](./coverage.md) for current grade/gap tracking.
149
+
150
+ ## Remaining Gaps
151
+
152
+ | Gap | Why it remains |
153
+ |---|---|
154
+ | `values` mode `state.snapshot` payload | Schema is implementation-shaped per spec gap S1 (`stream-modes.md`); cross-impl assertions blocked until schema firms up. |
155
+ | `messages` mode AI chunks | Needs server-side AI provider mock (fixture spec gap F1 in `fixtures.md`). |
156
+ | Cross-version compat | Needs server-controllable `engineVersion` cycle to test forward-fold-best-effort. |
157
+ | Capability-limit fixtures | Needs fixtures that deliberately exceed `clarificationRounds` / `schemaRounds` / `envelopesPerTurn` to assert `cap.breached` shape beyond the shipped node-execution cap case. |
158
+ | Auth profiles | Needs API-key rotation, OAuth2 client-credentials, and mTLS scenarios for hosts that claim those profiles. |
159
+ | Interrupt profiles | Needs quorum approval, auth-required resume, external-event correlation, and parent/child cancel cascade scenarios. |
160
+ | Production profile | Needs backpressure envelope, restart durability, retention, and debug-bundle truncation scenarios. |
161
+
162
+ ---
163
+
164
+ ## Repo layout
165
+
166
+ ```
167
+ conformance/
168
+ README.md — this file
169
+ fixtures.md — standardized fixture-workflow contract
170
+ fixtures/ — canonical WorkflowDefinition JSONs (servers seed verbatim)
171
+ conformance-noop.json
172
+ conformance-identity.json
173
+ conformance-delay.json
174
+ conformance-failure.json
175
+ conformance-approval.json
176
+ conformance-clarification.json
177
+ conformance-multi-node.json
178
+ conformance-idempotent.json
179
+ conformance-cancellable.json
180
+ package.json — @openwop/openwop-conformance package manifest
181
+ vitest.config.ts — test runner config
182
+ tsconfig.json — strict TypeScript
183
+ src/
184
+ lib/
185
+ driver.ts — OpenWOP driver class (auth, request helpers, response asserts)
186
+ env.ts — env-var validation + defaults
187
+ polling.ts — pollUntil/pollUntilStatus/pollUntilTerminal helpers
188
+ sse.ts — minimal native-fetch SSE client (no eventsource dep)
189
+ scenarios/
190
+ fixtures-valid.test.ts — fixture JSONs validate against workflow-definition schema (no server)
191
+ discovery.test.ts — /.well-known/openwop + /v1/openapi.json
192
+ auth.test.ts — 401 / 403 envelopes
193
+ errors.test.ts — error envelope shape
194
+ runs-lifecycle.test.ts — POST /v1/runs + terminal status (uses conformance-noop)
195
+ idempotency.test.ts — same key replay + body-mismatch 409 (uses conformance-idempotent)
196
+ cancellation.test.ts — :cancel mid-flight (uses conformance-cancellable)
197
+ interrupt-approval.test.ts — accept/reject + invalid action + unknown node (uses conformance-approval)
198
+ interrupt-clarification.test.ts — answers payload resume (uses conformance-clarification)
199
+ failure-path.test.ts — terminal `failed` + RunSnapshot.error shape (uses conformance-failure)
200
+ identity-passthrough.test.ts — nested JSON round-trip (uses conformance-identity)
201
+ multi-node-ordering.test.ts — node.completed sequence in DAG order (uses conformance-multi-node + events/poll)
202
+ stream-modes.test.ts — updates termination + 400 unsupported-mode + debug ⊇ updates (uses conformance-delay + SSE)
203
+ replay-fork.test.ts — :fork in replay + branch modes + 4 validation paths (uses conformance-noop)
204
+ version-negotiation.test.ts — protocolVersion + RunEventDoc shape + monotonic sequence + events/poll forward-compat
205
+ spec-corpus-validity.test.ts — server-free meta-check that the whole spec corpus is internally consistent
206
+ ```
207
+
208
+ ---
209
+
210
+ ## How to extend
211
+
212
+ Add a new scenario file under `src/scenarios/<category>.test.ts`:
213
+
214
+ ```typescript
215
+ import { describe, it, expect } from 'vitest';
216
+ import { driver } from '../lib/driver';
217
+
218
+ describe('my-spec-category', () => {
219
+ it('does the thing per spec section 4.2', async () => {
220
+ const res = await driver.get('/v1/some-endpoint');
221
+ expect(res.status).toBe(200);
222
+ // ... spec-derived assertions
223
+ });
224
+ });
225
+ ```
226
+
227
+ Each `expect(...)` should have a corresponding spec quote in the assertion message so failures cite the requirement, not just "expected X got Y".
228
+
229
+ ---
230
+
231
+ ## Future: publishable npm package
232
+
233
+ Once the suite stabilizes, this directory will be extracted to its own repo and published as `@openwop/openwop-conformance`. Until then, `npm install` is run from this subdirectory only — it is intentionally NOT a workspace member of the parent monorepo so its deps don't pollute the impl's lockfile.
234
+
235
+ ## References
236
+
237
+
238
+ - Spec corpus: `../README.md`
239
+ - OpenAPI: `../api/openapi.yaml`
240
+ - AsyncAPI: `../api/asyncapi.yaml`
241
+ - JSON Schemas: `../schemas/`