@mostra/conformance 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{runner-DcOgbosK.js → runner-DzRxvmyR.js} +142 -13
- package/dist/runner-DzRxvmyR.js.map +1 -0
- package/package.json +4 -4
- package/src/scenarios/index.ts +2 -0
- package/src/scenarios/team.ts +161 -0
- package/dist/runner-DcOgbosK.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as SCENARIOS, t as runConformance, y as readBaseline } from "./runner-
|
|
2
|
+
import { n as SCENARIOS, t as runConformance, y as readBaseline } from "./runner-DzRxvmyR.js";
|
|
3
3
|
import { parseArgs } from "node:util";
|
|
4
4
|
//#region src/cli.ts
|
|
5
5
|
/**
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/baseline.ts","../src/fixtures.ts","../src/harness/client.ts","../src/harness/serve.ts","../src/viewer.ts","../src/scenario.ts","../src/runner.ts","../src/scenarios/index.ts"],"mappings":";;;;UAciB;;WAEN;;WAEA,kBAAkB,SAAS;;;qBASzB,aAAa;;;;;wBAMV,aAAa,cAAc,2BAA2B;;;;;;;;;KC1B1D,UAAU,SAAS;;qBA2ElB,UAAU,SAAS,eAAe;;;;qBCtClC,sBAAsB;;WAExB;;WAEA;;WAEA,MAAM;EAEf,YAAY,gBAAgB,OAAO;;;qBAUxB;;;EAMX,MAAM;UAEE;;SA4CK,MACX,iBACA,MAAK,SAAS,0BACb,QAAQ;;MAgBP;;EAKJ,OAAO;;EAIP,SAAS;;EAST,cAAoB,QAAQ,cAAc,QAAQ;;EAKlD,QAAc,gBAAgB,iBAAiB,qBAAqB,QAAQ;;EAW5E,KAA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ACA,iBAAiB,QAAQ,yBAAyB,uBAClD,qBACC,QAAQ;;EAWX,YAAY;;EAKZ,eAAe;;EAMf;;EAYA,MAAM,eAAe;;EAKrB,SAAe;;;;;KCpSL;;UAaK;;WAEN;;WAEA;;WAEA;;WAEA,QAAQ;;WAER;;WAEA;;;UAIM;;WAEN,MAAM;;WAEN,mBAAmB;;WAEnB;;;UAIM;;WAEN;;WAEA,UAAU,SAAS;;WAEnB;;WAEA,WAAW;;WAEX;;WAEA;;WAEA;;WAEA,aAAa,SAAS;;WAEtB,qBAAqB;;;wBAqDV,eAAe,SAAS,aAAa,QAAQ;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/baseline.ts","../src/fixtures.ts","../src/harness/client.ts","../src/harness/serve.ts","../src/viewer.ts","../src/scenario.ts","../src/runner.ts","../src/scenarios/index.ts"],"mappings":";;;;UAciB;;WAEN;;WAEA,kBAAkB,SAAS;;;qBASzB,aAAa;;;;;wBAMV,aAAa,cAAc,2BAA2B;;;;;;;;;KC1B1D,UAAU,SAAS;;qBA2ElB,UAAU,SAAS,eAAe;;;;qBCtClC,sBAAsB;;WAExB;;WAEA;;WAEA,MAAM;EAEf,YAAY,gBAAgB,OAAO;;;qBAUxB;;;EAMX,MAAM;UAEE;;SA4CK,MACX,iBACA,MAAK,SAAS,0BACb,QAAQ;;MAgBP;;EAKJ,OAAO;;EAIP,SAAS;;EAST,cAAoB,QAAQ,cAAc,QAAQ;;EAKlD,QAAc,gBAAgB,iBAAiB,qBAAqB,QAAQ;;EAW5E,KAAW,IAAI,yBACb,gBACA,iBACA,qBACC,QAAQ;;EAOX,gBAAsB;;EAKtB,SAAe,QAAQ;;EAKvB,OAAa,QAAQ,eAAe;;EAKpC,OAAa,QAAQ,eAAe,QAAQ;;;;;;;;EAa5C,SAAe;;;wBAwCD,OAAO;;;;UCrNN;;EAEf,cAAc,KAAK,gCAAgC,QAAQ,KAAK;;EAEhE,MAAM,QAAQ,cAAc,cAAc,QA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;WAEnB;;WAEA,WAAW;;WAEX;;WAEA;;WAEA;;WAEA,aAAa,SAAS;;WAEtB,qBAAqB;;;wBAqDV,eAAe,SAAS,aAAa,QAAQ;;;;qBC5GtD,oBAAoB"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as FIXTURES, a as ScenarioFailure, c as Browser, d as parseLink, f as resultOf, g as codeOf, h as InstanceError, i as ScenarioContext, l as OpenError, m as HostUnderTest, n as SCENARIOS, o as check, p as send, r as NotApplicable, s as same, t as runConformance, u as Viewer, v as NO_BASELINE, y as readBaseline } from "./runner-
|
|
1
|
+
import { _ as FIXTURES, a as ScenarioFailure, c as Browser, d as parseLink, f as resultOf, g as codeOf, h as InstanceError, i as ScenarioContext, l as OpenError, m as HostUnderTest, n as SCENARIOS, o as check, p as send, r as NotApplicable, s as same, t as runConformance, u as Viewer, v as NO_BASELINE, y as readBaseline } from "./runner-DzRxvmyR.js";
|
|
2
2
|
import { a as HARNESS_METHODS, o as HARNESS_REVISIONS } from "./protocol-Bi4gZzsu.js";
|
|
3
3
|
import { i as serveHarness, n as ReferenceStore, r as runReferenceHost, t as REFERENCE_FAULTS } from "./reference-host-BAAxMabg.js";
|
|
4
4
|
export { Browser, FIXTURES, HARNESS_METHODS, HARNESS_REVISIONS, HostUnderTest, InstanceError, NO_BASELINE, NotApplicable, OpenError, REFERENCE_FAULTS, ReferenceStore, SCENARIOS, ScenarioContext, ScenarioFailure, Viewer, check, codeOf, parseLink, readBaseline, resultOf, runConformance, runReferenceHost, same, send, serveHarness };
|
|
@@ -1225,7 +1225,7 @@ const DELIVERY_SCENARIOS = [
|
|
|
1225
1225
|
* restarts (IN-07 to IN-10, LL-02, H-02, H-03, H-06 to H-10).
|
|
1226
1226
|
*/
|
|
1227
1227
|
/** Answers and submits on whichever channel the view allows. */
|
|
1228
|
-
async function answerAndSubmit(viewer, fields) {
|
|
1228
|
+
async function answerAndSubmit$1(viewer, fields) {
|
|
1229
1229
|
return viewer.answer(fields, viewer.ticket.submitChannels.includes("artifact") ? "artifact" : "shell");
|
|
1230
1230
|
}
|
|
1231
1231
|
async function code(answer) {
|
|
@@ -1245,9 +1245,9 @@ const INTERACTION_SCENARIOS = [
|
|
|
1245
1245
|
async run(context) {
|
|
1246
1246
|
await context.start();
|
|
1247
1247
|
const once = await context.published(FORM, { policy: { policy: "once" } });
|
|
1248
|
-
const accepted = await answerAndSubmit(await context.viewer(once.artifactId), { name: "Ada" });
|
|
1248
|
+
const accepted = await answerAndSubmit$1(await context.viewer(once.artifactId), { name: "Ada" });
|
|
1249
1249
|
same(accepted.status, 200, "the first submit under once");
|
|
1250
|
-
const conflict = await answerAndSubmit(await context.viewer(once.artifactId), { name: "Grace" });
|
|
1250
|
+
const conflict = await answerAndSubmit$1(await context.viewer(once.artifactId), { name: "Grace" });
|
|
1251
1251
|
check(conflict.status === 409, `a second submit under once answered ${conflict.status}`);
|
|
1252
1252
|
same(await code(conflict), "MOSTRA_SUBMIT_ALREADY", "a second submit's code");
|
|
1253
1253
|
same(conflict.json().submission?.id, accepted.json().id, "the existing submission carried beside the conflict");
|
|
@@ -1255,11 +1255,11 @@ const INTERACTION_SCENARIOS = [
|
|
|
1255
1255
|
policy: "once",
|
|
1256
1256
|
scope: "per-viewer"
|
|
1257
1257
|
} });
|
|
1258
|
-
for (const ref of ["ada@example.com", "grace@example.com"]) same((await answerAndSubmit(await context.viewer(survey.artifactId, { link: { viewer: { ref } } }), { name: ref })).status, 200, `${ref}'s submit`);
|
|
1259
|
-
same(await code(await answerAndSubmit(await context.viewer(survey.artifactId, { link: { viewer: { ref: "ada@example.com" } } }), { name: "again" })), "MOSTRA_SUBMIT_ALREADY", "a person's second submit");
|
|
1258
|
+
for (const ref of ["ada@example.com", "grace@example.com"]) same((await answerAndSubmit$1(await context.viewer(survey.artifactId, { link: { viewer: { ref } } }), { name: ref })).status, 200, `${ref}'s submit`);
|
|
1259
|
+
same(await code(await answerAndSubmit$1(await context.viewer(survey.artifactId, { link: { viewer: { ref: "ada@example.com" } } }), { name: "again" })), "MOSTRA_SUBMIT_ALREADY", "a person's second submit");
|
|
1260
1260
|
const rounds = await context.published(FORM, { policy: { policy: "epochs" } });
|
|
1261
1261
|
const person = await context.viewer(rounds.artifactId, { link: { viewer: { ref: "ada" } } });
|
|
1262
|
-
const one = (await answerAndSubmit(person, { name: "round 1" })).json();
|
|
1262
|
+
const one = (await answerAndSubmit$1(person, { name: "round 1" })).json();
|
|
1263
1263
|
const revision = (await person.write({ name: "round 2" }, { baseRevision: "1" })).json().revision;
|
|
1264
1264
|
const twoAnswer = await (person.ticket.submitChannels.includes("artifact") ? person.submit(revision) : person.shellSubmit(revision));
|
|
1265
1265
|
same(twoAnswer.status, 200, "the second round's submit");
|
|
@@ -1269,7 +1269,7 @@ const INTERACTION_SCENARIOS = [
|
|
|
1269
1269
|
const board = await context.published(FORM, { policy: { policy: "none" } });
|
|
1270
1270
|
const viewer = await context.viewer(board.artifactId);
|
|
1271
1271
|
same(viewer.ticket.policy.policy, "none", "the view's policy");
|
|
1272
|
-
same(await code(await answerAndSubmit(viewer, { name: "x" })), "MOSTRA_SUBMIT_POLICY_NONE", "a submit under none");
|
|
1272
|
+
same(await code(await answerAndSubmit$1(viewer, { name: "x" })), "MOSTRA_SUBMIT_POLICY_NONE", "a submit under none");
|
|
1273
1273
|
same(await context.host.call("wait", {
|
|
1274
1274
|
artifact: { artifactId: board.artifactId },
|
|
1275
1275
|
until: "submitted",
|
|
@@ -1299,7 +1299,7 @@ const INTERACTION_SCENARIOS = [
|
|
|
1299
1299
|
})).pages.length, 0, "pages for a new name");
|
|
1300
1300
|
const submit = async (who) => {
|
|
1301
1301
|
const receipt = await context.published(FORM);
|
|
1302
|
-
return (await answerAndSubmit(await context.viewer(receipt.artifactId), { name: who })).json().id;
|
|
1302
|
+
return (await answerAndSubmit$1(await context.viewer(receipt.artifactId), { name: who })).json().id;
|
|
1303
1303
|
};
|
|
1304
1304
|
const first = await submit("Ada");
|
|
1305
1305
|
const events = (await context.host.events({
|
|
@@ -1347,7 +1347,7 @@ const INTERACTION_SCENARIOS = [
|
|
|
1347
1347
|
const after = await context.store();
|
|
1348
1348
|
same(after.deliveries.length, before.deliveries.length, "deliveries a signal caused");
|
|
1349
1349
|
same(after.drafts.length, before.drafts.length, "draft mirrors a signal caused");
|
|
1350
|
-
same((await answerAndSubmit(viewer, { name: "Ada" })).status, 200, "the submit");
|
|
1350
|
+
same((await answerAndSubmit$1(viewer, { name: "Ada" })).status, 200, "the submit");
|
|
1351
1351
|
check((await context.events({
|
|
1352
1352
|
artifacts: [receipt.artifactId],
|
|
1353
1353
|
types: ["signal.*"]
|
|
@@ -1399,7 +1399,7 @@ const INTERACTION_SCENARIOS = [
|
|
|
1399
1399
|
as: "host"
|
|
1400
1400
|
});
|
|
1401
1401
|
same((await state).status, "satisfied", "a state wait when the host sets the field");
|
|
1402
|
-
await answerAndSubmit(viewer, { name: "Ada" });
|
|
1402
|
+
await answerAndSubmit$1(viewer, { name: "Ada" });
|
|
1403
1403
|
const level = await context.host.call("wait", {
|
|
1404
1404
|
artifact,
|
|
1405
1405
|
until: "submitted",
|
|
@@ -1561,7 +1561,7 @@ const INTERACTION_SCENARIOS = [
|
|
|
1561
1561
|
mutationId: "mut_01JB8Z3QF6S7W3N8D5K2C4V9XG",
|
|
1562
1562
|
as: "host"
|
|
1563
1563
|
});
|
|
1564
|
-
same((await answerAndSubmit(await context.viewer(receipt.artifactId, { link: { viewer: { ref: "ada" } } }), { name: "Ada" })).status, 200, "the submit");
|
|
1564
|
+
same((await answerAndSubmit$1(await context.viewer(receipt.artifactId, { link: { viewer: { ref: "ada" } } }), { name: "Ada" })).status, 200, "the submit");
|
|
1565
1565
|
const before = await context.results(receipt.artifactId);
|
|
1566
1566
|
const eventsBefore = await context.events({ artifacts: [receipt.artifactId] });
|
|
1567
1567
|
await context.restart();
|
|
@@ -2380,6 +2380,134 @@ const SESSION_SCENARIOS = [
|
|
|
2380
2380
|
}
|
|
2381
2381
|
}
|
|
2382
2382
|
];
|
|
2383
|
+
//#endregion
|
|
2384
|
+
//#region src/scenarios/team.ts
|
|
2385
|
+
/**
|
|
2386
|
+
* Teams (WP-31, D168): expected respondents with personal links through the host's own client,
|
|
2387
|
+
* each respondent's status, the roster's durable events, and the `submitted:all` and
|
|
2388
|
+
* `submitted:<N>` waits under `once` per viewer and `epochs`, with each answer delivered to the
|
|
2389
|
+
* host (CO-01, CO-02, CO-03).
|
|
2390
|
+
*/
|
|
2391
|
+
const PEOPLE = [
|
|
2392
|
+
{
|
|
2393
|
+
ref: "ada@example.com",
|
|
2394
|
+
name: "Ada"
|
|
2395
|
+
},
|
|
2396
|
+
{
|
|
2397
|
+
ref: "grace@example.com",
|
|
2398
|
+
name: "Grace"
|
|
2399
|
+
},
|
|
2400
|
+
{
|
|
2401
|
+
ref: "alan@example.com",
|
|
2402
|
+
name: "Alan"
|
|
2403
|
+
}
|
|
2404
|
+
];
|
|
2405
|
+
/** Answers and submits on whichever channel the view allows. */
|
|
2406
|
+
async function answerAndSubmit(viewer, fields) {
|
|
2407
|
+
return viewer.answer(fields, viewer.ticket.submitChannels.includes("artifact") ? "artifact" : "shell");
|
|
2408
|
+
}
|
|
2409
|
+
/** The team scenarios. */
|
|
2410
|
+
const TEAM_SCENARIOS = [{
|
|
2411
|
+
id: "team.roster",
|
|
2412
|
+
title: "roster/add gives each expected respondent a personal link that acts as them, again keeps it; roster/get reports each one's status; roster changes are durable events",
|
|
2413
|
+
covers: [
|
|
2414
|
+
"HO-05",
|
|
2415
|
+
"CO-01",
|
|
2416
|
+
"CO-03"
|
|
2417
|
+
],
|
|
2418
|
+
async run(context) {
|
|
2419
|
+
await context.start();
|
|
2420
|
+
const receipt = await context.published(FORM, { policy: {
|
|
2421
|
+
policy: "once",
|
|
2422
|
+
scope: "per-viewer"
|
|
2423
|
+
} });
|
|
2424
|
+
const artifact = { artifactId: receipt.artifactId };
|
|
2425
|
+
const added = await context.host.call("roster/add", {
|
|
2426
|
+
artifact,
|
|
2427
|
+
respondents: PEOPLE
|
|
2428
|
+
});
|
|
2429
|
+
same(added.links.length, 3, "the personal links roster/add gives three respondents");
|
|
2430
|
+
same((await context.host.call("roster/add", {
|
|
2431
|
+
artifact,
|
|
2432
|
+
respondents: PEOPLE
|
|
2433
|
+
})).links.map((entry) => entry.link.url).join(" "), added.links.map((entry) => entry.link.url).join(" "), "the links adding the same respondents again gives");
|
|
2434
|
+
const viewers = [];
|
|
2435
|
+
for (const entry of added.links) viewers.push(await Viewer.open(entry.link.url));
|
|
2436
|
+
const [ada] = viewers;
|
|
2437
|
+
same((await answerAndSubmit(ada, { name: "Ada" })).status, 200, "Ada's submit");
|
|
2438
|
+
same((await context.host.call("roster/get", { artifact })).respondents.map((one) => `${one.ref}=${one.status}`).join(" "), "ada@example.com=submitted grace@example.com=drafting alan@example.com=drafting", "each respondent's status: Ada submitted, the others opened their links");
|
|
2439
|
+
same((await context.results(receipt.artifactId)).submission.viewer.name, "Ada", "the submission's viewer is the respondent");
|
|
2440
|
+
same((await context.events({
|
|
2441
|
+
artifacts: [receipt.artifactId],
|
|
2442
|
+
types: ["roster.*"]
|
|
2443
|
+
})).events.map((event) => event.type).join(" "), "roster.changed", "the roster's events: one change, adding again changed nothing");
|
|
2444
|
+
}
|
|
2445
|
+
}, {
|
|
2446
|
+
id: "team.waits",
|
|
2447
|
+
title: "submitted:all holds exactly when the last expected respondent submits (roster.completed), once per round under epochs; submitted:<N> at the N-th; every answer reaches the host",
|
|
2448
|
+
covers: [
|
|
2449
|
+
"HO-05",
|
|
2450
|
+
"CO-02",
|
|
2451
|
+
"IN-12"
|
|
2452
|
+
],
|
|
2453
|
+
async run(context) {
|
|
2454
|
+
await context.start();
|
|
2455
|
+
for (const policy of [{
|
|
2456
|
+
policy: "once",
|
|
2457
|
+
scope: "per-viewer"
|
|
2458
|
+
}, { policy: "epochs" }]) {
|
|
2459
|
+
const artifact = { artifactId: (await context.published(FORM, { policy })).artifactId };
|
|
2460
|
+
const added = await context.host.call("roster/add", {
|
|
2461
|
+
artifact,
|
|
2462
|
+
respondents: PEOPLE
|
|
2463
|
+
});
|
|
2464
|
+
const viewers = [];
|
|
2465
|
+
for (const entry of added.links) viewers.push(await Viewer.open(entry.link.url));
|
|
2466
|
+
const start = await context.host.call("wait", {
|
|
2467
|
+
artifact,
|
|
2468
|
+
until: "submitted:all",
|
|
2469
|
+
timeoutMs: 0
|
|
2470
|
+
});
|
|
2471
|
+
same(start.status, "still_waiting", `${policy.policy}: before anyone`);
|
|
2472
|
+
const all = context.host.call("wait", {
|
|
2473
|
+
artifact,
|
|
2474
|
+
until: "submitted:all",
|
|
2475
|
+
after: start.cursor,
|
|
2476
|
+
timeoutMs: 6e4
|
|
2477
|
+
});
|
|
2478
|
+
for (const [index, viewer] of viewers.entries()) {
|
|
2479
|
+
same((await answerAndSubmit(viewer, { name: PEOPLE[index]?.name })).status, 200, `${policy.policy}: ${PEOPLE[index]?.name}'s submit`);
|
|
2480
|
+
if (index === 1) {
|
|
2481
|
+
same((await context.host.call("wait", {
|
|
2482
|
+
artifact,
|
|
2483
|
+
until: "submitted:2",
|
|
2484
|
+
after: start.cursor,
|
|
2485
|
+
timeoutMs: 0
|
|
2486
|
+
})).status, "satisfied", `${policy.policy}: submitted:2 at the second answer`);
|
|
2487
|
+
same((await context.host.call("wait", {
|
|
2488
|
+
artifact,
|
|
2489
|
+
until: "submitted:all",
|
|
2490
|
+
after: start.cursor,
|
|
2491
|
+
timeoutMs: 0
|
|
2492
|
+
})).status, "still_waiting", `${policy.policy}: submitted:all before the last`);
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
const done = await all;
|
|
2496
|
+
same(done.status, "satisfied", `${policy.policy}: submitted:all at the last answer`);
|
|
2497
|
+
same(done.event.type, "roster.completed", `${policy.policy}: the event that satisfies it`);
|
|
2498
|
+
if (policy.policy === "epochs") {
|
|
2499
|
+
same((await context.host.call("wait", {
|
|
2500
|
+
artifact,
|
|
2501
|
+
until: "submitted:all",
|
|
2502
|
+
after: done.cursor,
|
|
2503
|
+
timeoutMs: 0
|
|
2504
|
+
})).status, "still_waiting", "epochs: the next round waits for everyone again");
|
|
2505
|
+
same((await context.host.call("roster/get", { artifact })).round, 2, "epochs: the roster's round after everyone answered");
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
if (context.host.serves("submissions")) await context.eventually("every answer of both rosters in the host's store", async () => (await context.store()).deliveries.length >= 6);
|
|
2509
|
+
}
|
|
2510
|
+
}];
|
|
2383
2511
|
/** The viewing scenarios. */
|
|
2384
2512
|
const VIEWING_SCENARIOS = [
|
|
2385
2513
|
{
|
|
@@ -2530,7 +2658,8 @@ const SCENARIOS = [
|
|
|
2530
2658
|
...INTERACTION_SCENARIOS,
|
|
2531
2659
|
...PORT_SCENARIOS,
|
|
2532
2660
|
...VIEWING_SCENARIOS,
|
|
2533
|
-
...REMOTE_SCENARIOS
|
|
2661
|
+
...REMOTE_SCENARIOS,
|
|
2662
|
+
...TEAM_SCENARIOS
|
|
2534
2663
|
];
|
|
2535
2664
|
//#endregion
|
|
2536
2665
|
//#region src/runner.ts
|
|
@@ -2628,4 +2757,4 @@ async function runConformance(options) {
|
|
|
2628
2757
|
//#endregion
|
|
2629
2758
|
export { FIXTURES as _, ScenarioFailure as a, Browser as c, parseLink as d, resultOf as f, codeOf as g, InstanceError as h, ScenarioContext as i, OpenError as l, HostUnderTest as m, SCENARIOS as n, check as o, send as p, NotApplicable as r, same as s, runConformance as t, Viewer as u, NO_BASELINE as v, readBaseline as y };
|
|
2630
2759
|
|
|
2631
|
-
//# sourceMappingURL=runner-
|
|
2760
|
+
//# sourceMappingURL=runner-DzRxvmyR.js.map
|