@openwop/openwop-conformance 1.136.8 → 1.136.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openwop/openwop-conformance",
3
- "version": "1.136.8",
3
+ "version": "1.136.9",
4
4
  "description": "Production-ready black-box conformance suite for OpenWOP v1.0 compliant servers.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "_comment": "Provenance of this vendored schemas/ copy. See conformance/README.md \u00a7\"Resolving the contract\". Compare against the stamp in your installed @openwop/openwop-conformance to detect a stale hand-copied contract.",
3
- "suiteVersion": "1.136.8",
4
- "corpusCommit": "b8114f3d820af7f377c332c977d5cac93fe7bb05"
3
+ "suiteVersion": "1.136.9",
4
+ "corpusCommit": "6d2c33ba0be0e4d6934f5f9471600c66e8c5c183"
5
5
  }
@@ -40,6 +40,7 @@
40
40
  */
41
41
 
42
42
  import { describe, it, expect } from 'vitest';
43
+ import { softSkip } from '../lib/soft-skip.js';
43
44
  import { driver } from '../lib/driver.js';
44
45
  import { behaviorGate } from '../lib/behavior-gate.js';
45
46
  import { capabilityFamily } from '../lib/discovery-capabilities.js';
@@ -224,4 +225,74 @@ describe('RFC 0151 §C — compensation lifecycle (capability-gated behavior)',
224
225
  }
225
226
  }
226
227
  });
228
+
229
+ it('a healthy run that DECLARES a compensator reports compensationStatus `none` (SP-11a)', async () => {
230
+ if (!behaviorGate(PROFILE, await advertised())) return;
231
+
232
+ // The rollup folds over the PLAN, and no plan exists until a trigger fires
233
+ // (`compensation.md` §"Run rollup"). So a run that completes successfully while
234
+ // declaring compensable nodes reads `none` — it has nothing to unwind.
235
+ //
236
+ // Nothing observed this. Every other leg of the §21 seam drives a FAILURE, so a
237
+ // host that derived the rollup from the existence of obligation rows — minted per
238
+ // compensable node, healthy or not — reported `pending` on every successful run
239
+ // that declared a compensator and passed all of them. A tier-1 host shipped exactly
240
+ // that (SP-11a / their AP-03). This leg is the healthy case, and it needs no failure:
241
+ // `fail: false` on the unwind seam runs the same compensator-declaring workflow to
242
+ // completion.
243
+ const seam = await driver.post('/v1/host/sample/test/compensation/unwind', { fail: false });
244
+ if (seam.status === 404) {
245
+ return softSkip('blocked', 'the §21 unwind seam is not wired — the healthy-run rollup has no black-box witness');
246
+ }
247
+ if (seam.status >= 400) {
248
+ // The host mounts the seam but rejects `fail: false`. That is the pre-extension
249
+ // shape, not a pass: without it the healthy-run rollup stays unobservable.
250
+ return softSkip(
251
+ 'blocked',
252
+ `the §21 unwind seam does not honour \`fail: false\` (HTTP ${seam.status}) — the healthy-run ` +
253
+ 'rollup is unobservable until it does (host-sample-test-seams.md §21)',
254
+ );
255
+ }
256
+
257
+ const body = seam.json as { runId?: string; events?: { type: string }[] };
258
+ expect(
259
+ typeof body.runId === 'string' && body.runId.length > 0,
260
+ driver.describe('host-sample-test-seams.md §21', '`fail: false` MUST still return the runId it created'),
261
+ ).toBe(true);
262
+
263
+ // Positive control: the seam really did run a healthy compensator-declaring
264
+ // workflow. If it emitted a `compensation.requested`, it failed the node anyway and
265
+ // this is not the healthy case — say so rather than assert `none` against a run
266
+ // that legitimately has a plan.
267
+ const types = (body.events ?? []).map((e) => e.type);
268
+ if (types.includes('compensation.requested')) {
269
+ return softSkip(
270
+ 'blocked',
271
+ `the seam emitted ${JSON.stringify(types)} under \`fail: false\` — a trigger fired, so this run ` +
272
+ 'is not the healthy case the leg needs',
273
+ );
274
+ }
275
+
276
+ const snap = await driver.get(`/v1/runs/${encodeURIComponent(body.runId ?? '')}`);
277
+ expect(snap.status, driver.describe('rest-endpoints.md', 'GET /v1/runs/{runId} for the healthy seam run')).toBe(200);
278
+ const snapshot = snap.json as { status?: unknown; compensationStatus?: unknown };
279
+
280
+ expect(
281
+ snapshot.compensationStatus,
282
+ driver.describe(
283
+ 'compensation.md §"Run rollup: compensationStatus"',
284
+ 'a host advertising `compensation` MUST carry the field on EVERY snapshot — presence is the wire witness of the advert',
285
+ ),
286
+ ).toBeDefined();
287
+
288
+ expect(
289
+ snapshot.compensationStatus,
290
+ driver.describe(
291
+ 'compensation.md §"Run rollup: compensationStatus"',
292
+ 'a run that completed while declaring compensable nodes has nothing to unwind: no `compensation.requested` ' +
293
+ 'was recorded, so the fold is `none`. `pending` here means the rollup was derived from obligation ROWS ' +
294
+ `rather than from plan state — got \`${String(snapshot.compensationStatus)}\``,
295
+ ),
296
+ ).toBe('none');
297
+ });
227
298
  });