@serene-pub/conformance 0.6.0-pr-7 β 0.6.0-pr-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/dist/index.d.ts +6 -0
- package/dist/index.js +87 -15
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ import { type ComponentView } from './components.js';
|
|
|
35
35
|
import { type NodeHandler, type SwapEvidence } from './packages.js';
|
|
36
36
|
import type { Descriptor } from '@serene-pub/sdk';
|
|
37
37
|
import { type RulesetDecl, type RulesetTemplate } from '@serene-pub/sdk';
|
|
38
|
+
import { type StoredTurnOrderOption } from '@serene-pub/sdk';
|
|
38
39
|
export * from './components.js';
|
|
39
40
|
export * from './packages.js';
|
|
40
41
|
/**
|
|
@@ -226,6 +227,11 @@ export interface ShippedCatalogue {
|
|
|
226
227
|
rulesets?: readonly RulesetDecl[];
|
|
227
228
|
/** π§ The ruleset templates it ships (`rulesetTemplates()`), for C38. */
|
|
228
229
|
rulesetTemplates?: readonly RulesetTemplate[];
|
|
230
|
+
/**
|
|
231
|
+
* π§ The turn order options the catalogue adds to genres it names (genre as
|
|
232
|
+
* id), for C42.
|
|
233
|
+
*/
|
|
234
|
+
turnOrderOptions?: readonly StoredTurnOrderOption[];
|
|
229
235
|
}
|
|
230
236
|
/** @experimental C29's evidence: one genre's event map and the termination policy of each node that has one. */
|
|
231
237
|
export interface EventMapEvidence extends EventGraph {
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,9 @@ import { hookCtxGrants, hookCtxKeysFor, HOOK_CTX_KINDS } from '@serene-pub/sdk/t
|
|
|
34
34
|
import { COMPONENT_PROTOCOL_FIXTURE, componentMountCase, componentParityCase, componentParitySections, componentProtocolCase, judgeComponentModule, } from './components.js';
|
|
35
35
|
import { probeSampleFor } from './packages.js';
|
|
36
36
|
import { swapFitFinding } from '@serene-pub/sdk';
|
|
37
|
+
import { declaredNodeParams } from '@serene-pub/sdk';
|
|
37
38
|
import { rulesetCatalogueFindings } from '@serene-pub/sdk';
|
|
39
|
+
import { turnOrderOptionFindings } from '@serene-pub/sdk';
|
|
38
40
|
import { probeBinding, probeCtxFor } from '@serene-pub/sdk/testing';
|
|
39
41
|
export * from './components.js';
|
|
40
42
|
export * from './packages.js';
|
|
@@ -1274,7 +1276,7 @@ export const REQUIREMENTS = [
|
|
|
1274
1276
|
}
|
|
1275
1277
|
const pinned = await host.pinnedDefinition(s.spec, s.node);
|
|
1276
1278
|
if (!pinned) {
|
|
1277
|
-
failed.push(`${at}: this host seats nothing at '${s.node}' of '${s.spec}' β name
|
|
1279
|
+
failed.push(`${at}: this host seats nothing at '${s.node}' of '${s.spec}' β name a node that offers swaps (its expose.swaps), never assume a key`);
|
|
1278
1280
|
continue;
|
|
1279
1281
|
}
|
|
1280
1282
|
const misfit = swapFitFinding(s.node, pinned, s.definition);
|
|
@@ -1426,6 +1428,53 @@ export const REQUIREMENTS = [
|
|
|
1426
1428
|
must(!failures.length, failures.join('\n'));
|
|
1427
1429
|
},
|
|
1428
1430
|
},
|
|
1431
|
+
{
|
|
1432
|
+
id: 'C40',
|
|
1433
|
+
law: 'scenes first (owner ruling 2026-11-10)',
|
|
1434
|
+
title: 'no pipeline a catalogue ships writes a history entry directly β history is compiled from scenes',
|
|
1435
|
+
consequence: 'A pipeline that files history itself goes around scenes and Compile: its entries land beside the dayβs one entry, and a person never reviews them as a scene.',
|
|
1436
|
+
async check(host, fx, report) {
|
|
1437
|
+
const shipped = await host.shipped?.();
|
|
1438
|
+
if (!shipped)
|
|
1439
|
+
return report.skip('the host declares no catalogue β supply `shipped()` for its history writes to be judged');
|
|
1440
|
+
if (!shipped.pipelines?.length)
|
|
1441
|
+
return report.skip('the catalogue ships no pipelines β supply `shipped().pipelines` for its history writes to be judged');
|
|
1442
|
+
const failures = shipped.pipelines.flatMap((d) => historyWriteFindings(d));
|
|
1443
|
+
must(!failures.length, failures.join('\n'));
|
|
1444
|
+
},
|
|
1445
|
+
},
|
|
1446
|
+
{
|
|
1447
|
+
id: 'C41',
|
|
1448
|
+
law: 'programme 2.3, TC2 (owner 2026-11-18)',
|
|
1449
|
+
title: 'on an event where one registration runs, every shipped genreβs defaults and every preset mark at most one registration default',
|
|
1450
|
+
consequence: 'Two defaults leave which turn order a new session runs to the order the rows were read in, and nobody can tell from the session which one plays.',
|
|
1451
|
+
async check(host, fx, report) {
|
|
1452
|
+
const shipped = await host.shipped?.();
|
|
1453
|
+
if (!shipped)
|
|
1454
|
+
return report.skip('the host declares no catalogue β supply `shipped()` for its defaults to be judged');
|
|
1455
|
+
const failures = new Set();
|
|
1456
|
+
for (const { layer, decls } of shippedDefaultMarks(shipped))
|
|
1457
|
+
for (const m of doorFindings(shipped, decls, layer, 'registration default'))
|
|
1458
|
+
failures.add(m);
|
|
1459
|
+
must(!failures.size, [...failures].join('\n'));
|
|
1460
|
+
},
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
id: 'C42',
|
|
1464
|
+
law: 'TQ1, TQ2, TQ4 (owner 2026-11-19)',
|
|
1465
|
+
title: 'every turn order option a catalogue adds to a genre it names registers on Turn order asked, is labelled, marks no default and runs a pipeline the catalogue ships',
|
|
1466
|
+
consequence: 'An option that marks a default changes a genre it does not own, one without a label is offered to a person as an id, and one that runs a pipeline nobody ships fails on the first turn it is picked.',
|
|
1467
|
+
async check(host, fx, report) {
|
|
1468
|
+
const shipped = await host.shipped?.();
|
|
1469
|
+
if (!shipped?.turnOrderOptions)
|
|
1470
|
+
return report.skip('the catalogue adds no turn order options β supply `shipped().turnOrderOptions` for them to be judged');
|
|
1471
|
+
const { errors } = turnOrderOptionFindings(shipped.turnOrderOptions, {
|
|
1472
|
+
pipelines: new Map((shipped.pipelines ?? []).map((d) => [d.id, d])),
|
|
1473
|
+
genres: new Set(shipped.genres.map((g) => g.id)),
|
|
1474
|
+
});
|
|
1475
|
+
must(!errors.length, errors.join('\n'));
|
|
1476
|
+
},
|
|
1477
|
+
},
|
|
1429
1478
|
];
|
|
1430
1479
|
// ββ C39: lore writes ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
1431
1480
|
const LORE_CREATE = 'core:outlet/create-lore-entry';
|
|
@@ -1436,26 +1485,13 @@ const LORE_WRITES = [
|
|
|
1436
1485
|
'core:outlet/graph-proposal',
|
|
1437
1486
|
];
|
|
1438
1487
|
const SPAN_READS = ['core:query/summarize-source', 'core:query/graph-scenes'];
|
|
1439
|
-
/** The param values a document declares for `nodeKey` β its default presets' `params` rows, over the node's own. */
|
|
1440
|
-
function declaredParams(d, nodeKey) {
|
|
1441
|
-
const out = {};
|
|
1442
|
-
const own = d.nodes.find((n) => n.key === nodeKey)?.config?.params;
|
|
1443
|
-
if (own && typeof own === 'object')
|
|
1444
|
-
Object.assign(out, own);
|
|
1445
|
-
for (const p of d.presets ?? [])
|
|
1446
|
-
if (p.default)
|
|
1447
|
-
for (const v of p.values)
|
|
1448
|
-
if (v.nodeKey === nodeKey && v.slot === 'params' && v.value && typeof v.value === 'object')
|
|
1449
|
-
Object.assign(out, v.value);
|
|
1450
|
-
return out;
|
|
1451
|
-
}
|
|
1452
1488
|
/** C39's judgement of one shipped document. */
|
|
1453
1489
|
function loreWriteFindings(d) {
|
|
1454
1490
|
const out = [];
|
|
1455
1491
|
const reads = d.nodes.some((n) => SPAN_READS.includes(n.definitionId));
|
|
1456
1492
|
for (const n of d.nodes) {
|
|
1457
1493
|
if (n.definitionId === LORE_CREATE) {
|
|
1458
|
-
const t =
|
|
1494
|
+
const t = declaredNodeParams(d, n.key).entryType;
|
|
1459
1495
|
if (t === undefined || t === null || t === '')
|
|
1460
1496
|
out.push(`${d.id} ${n.key}: files lore without naming its entry type.`);
|
|
1461
1497
|
}
|
|
@@ -1468,6 +1504,25 @@ function loreWriteFindings(d) {
|
|
|
1468
1504
|
}
|
|
1469
1505
|
return out;
|
|
1470
1506
|
}
|
|
1507
|
+
// ββ C40: history writes βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
1508
|
+
/**
|
|
1509
|
+
* C40's judgement of one shipped document: a `create-lore-entry` whose entry type is
|
|
1510
|
+
* `core:entry/history` (the packager's `W_WRITES_HISTORY` predicate). A pipeline with a
|
|
1511
|
+
* `summarize-request` inlet is exempt: its save is previewed.
|
|
1512
|
+
*/
|
|
1513
|
+
function historyWriteFindings(d) {
|
|
1514
|
+
if (d.nodes.some((n) => n.definitionId === 'core:inlet/summarize-request'))
|
|
1515
|
+
return [];
|
|
1516
|
+
const out = [];
|
|
1517
|
+
for (const n of d.nodes) {
|
|
1518
|
+
if (n.definitionId !== 'core:outlet/create-lore-entry')
|
|
1519
|
+
continue;
|
|
1520
|
+
const t = declaredNodeParams(d, n.key).entryType;
|
|
1521
|
+
if (typeof t === 'string' && t.replace(/@\d+$/, '') === 'core:entry/history')
|
|
1522
|
+
out.push(`${d.id} ${n.key}: writes a history entry directly β put the event in a scene (note-scene@1 or a story line); Compile files it under the day's entry.`);
|
|
1523
|
+
}
|
|
1524
|
+
return out;
|
|
1525
|
+
}
|
|
1471
1526
|
// ββ C35 Β· C36: the registrations a catalogue ships, at the one door βββββββββ
|
|
1472
1527
|
/** The genres' defaults and each preset's own registrations, with the layer each was declared in. */
|
|
1473
1528
|
function shippedRegistrations(shipped) {
|
|
@@ -1485,6 +1540,23 @@ function shippedRegistrations(shipped) {
|
|
|
1485
1540
|
}
|
|
1486
1541
|
return out;
|
|
1487
1542
|
}
|
|
1543
|
+
/** C41's read: each genre's defaults, and each preset's effective registrations over them. */
|
|
1544
|
+
function shippedDefaultMarks(shipped) {
|
|
1545
|
+
const out = [];
|
|
1546
|
+
for (const g of shipped.genres) {
|
|
1547
|
+
const decls = genreDefaultsOf(g)?.registrations;
|
|
1548
|
+
if (decls?.length)
|
|
1549
|
+
out.push({ layer: `the defaults of '${g.id}'`, decls });
|
|
1550
|
+
}
|
|
1551
|
+
for (const p of shipped.presets) {
|
|
1552
|
+
const g = shipped.genres.find((x) => x.id === p.genre);
|
|
1553
|
+
const defaults = genreDefaultsOf(g)?.registrations;
|
|
1554
|
+
const decls = effectiveRegistrations(defaults, presetChangesOf(p, defaults));
|
|
1555
|
+
if (decls.length)
|
|
1556
|
+
out.push({ layer: `preset '${p.slug}'`, decls });
|
|
1557
|
+
}
|
|
1558
|
+
return out;
|
|
1559
|
+
}
|
|
1488
1560
|
/**
|
|
1489
1561
|
* One law's findings from the registration door (`registrationFindings`) β
|
|
1490
1562
|
* the same verdict a package build and a host's install give, quoted (01 Β§13).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serene-pub/conformance",
|
|
3
|
-
"version": "0.6.0-pr-
|
|
3
|
+
"version": "0.6.0-pr-9",
|
|
4
4
|
"description": "The host conformance kit: thirty-three executable requirements a Serene Pub executor must satisfy. Run by Serene Pub and by any alternate host; its package cases (C28βC33) by plugin authors over a built package.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/SerenePub/serene-pub-sdk/tree/main/conformance#readme",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"./package.json": "./package.json"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@serene-pub/sdk": "^0.6.0-pr-
|
|
36
|
+
"@serene-pub/sdk": "^0.6.0-pr-9"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsc -p tsconfig.build.json"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@serene-pub/sdk": "0.6.0-pr-
|
|
42
|
+
"@serene-pub/sdk": "0.6.0-pr-9"
|
|
43
43
|
},
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public",
|