@ouispec/testing 0.0.0-stage → 0.2.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 (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +8 -2
  3. package/dist/app.d.ts +18 -0
  4. package/dist/app.d.ts.map +1 -0
  5. package/dist/app.js +71 -0
  6. package/dist/app.js.map +1 -0
  7. package/dist/budgets.d.ts +17 -0
  8. package/dist/budgets.d.ts.map +1 -0
  9. package/dist/budgets.js +22 -0
  10. package/dist/budgets.js.map +1 -0
  11. package/dist/design-system.d.ts +23 -0
  12. package/dist/design-system.d.ts.map +1 -0
  13. package/dist/design-system.js +191 -0
  14. package/dist/design-system.js.map +1 -0
  15. package/dist/exports.d.ts +14 -0
  16. package/dist/exports.d.ts.map +1 -0
  17. package/dist/exports.js +76 -0
  18. package/dist/exports.js.map +1 -0
  19. package/dist/harness.d.ts +71 -0
  20. package/dist/harness.d.ts.map +1 -0
  21. package/dist/harness.js +102 -0
  22. package/dist/harness.js.map +1 -0
  23. package/dist/index.d.ts +37 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +37 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/package.d.ts +9 -0
  28. package/dist/package.d.ts.map +1 -0
  29. package/dist/package.js +23 -0
  30. package/dist/package.js.map +1 -0
  31. package/dist/report.d.ts +52 -0
  32. package/dist/report.d.ts.map +1 -0
  33. package/dist/report.js +71 -0
  34. package/dist/report.js.map +1 -0
  35. package/dist/room.d.ts +20 -0
  36. package/dist/room.d.ts.map +1 -0
  37. package/dist/room.js +68 -0
  38. package/dist/room.js.map +1 -0
  39. package/dist/sample.d.ts +9 -0
  40. package/dist/sample.d.ts.map +1 -0
  41. package/dist/sample.js +113 -0
  42. package/dist/sample.js.map +1 -0
  43. package/dist/tier2.d.ts +27 -0
  44. package/dist/tier2.d.ts.map +1 -0
  45. package/dist/tier2.js +98 -0
  46. package/dist/tier2.js.map +1 -0
  47. package/package.json +57 -3
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Mounting an example under a binding registry, in whatever test runner and
3
+ * DOM the integrator uses (jsdom, happy-dom, a browser), and the context an
4
+ * example is written against: the bindings to pass, and the callbacks whose
5
+ * calls and results the kit watches.
6
+ */
7
+ import { act, createElement } from 'react';
8
+ import { createRoot } from 'react-dom/client';
9
+ import { createBindingRegistry } from '@ouispec/bindings';
10
+ import { AgentBindingProvider } from '@ouispec/bindings/react';
11
+ /** The binding id the kit gives a control's part: `kit.<export>.<part>`, lower-kebab. */
12
+ export function kitBindingId(exportName, part) {
13
+ return `kit.${kebab(exportName)}.${kebab(part)}`;
14
+ }
15
+ function kebab(name) {
16
+ return name
17
+ .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
18
+ .replace(/[^A-Za-z0-9]+/g, '-')
19
+ .toLowerCase()
20
+ .replace(/^-+|-+$/g, '');
21
+ }
22
+ export function exampleContext(exportName, slotNames) {
23
+ const calls = new Map();
24
+ let planned = undefined;
25
+ const agent = (part = 'self') => ({
26
+ id: kitBindingId(exportName, part),
27
+ description: `The conformance kit's binding of ${exportName}${part === 'self' ? '' : `'s ${part}`}`,
28
+ });
29
+ return {
30
+ ctx: {
31
+ agent,
32
+ slots: () => Object.fromEntries(slotNames.map(slot => [slot, agent(slot)])),
33
+ on: callback => (...args) => {
34
+ const list = calls.get(callback) ?? [];
35
+ list.push(args);
36
+ calls.set(callback, list);
37
+ return planned;
38
+ },
39
+ },
40
+ calls,
41
+ plan: result => {
42
+ planned = result;
43
+ },
44
+ };
45
+ }
46
+ export function exampleRender(example) {
47
+ return typeof example === 'function' ? example : example.render;
48
+ }
49
+ export function exampleValue(example, part) {
50
+ if (typeof example === 'function' || !example.values || !(part in example.values))
51
+ return { given: false };
52
+ return { given: true, value: example.values[part] };
53
+ }
54
+ /** Mount `element` under a fresh registry and the integrator's providers, and let it settle. */
55
+ export async function mount(element, wrapper) {
56
+ globalThis.IS_REACT_ACT_ENVIRONMENT = true;
57
+ if (typeof document === 'undefined') {
58
+ throw new Error('The OUI conformance kit renders controls: run it in a DOM environment (jsdom, happy-dom or a browser)');
59
+ }
60
+ const registry = createBindingRegistry();
61
+ const container = document.createElement('div');
62
+ document.body.appendChild(container);
63
+ const root = createRoot(container);
64
+ const inner = wrapper ? createElement(wrapper, null, element) : element;
65
+ await act(async () => {
66
+ root.render(createElement(AgentBindingProvider, { registry }, inner));
67
+ });
68
+ await act(async () => { });
69
+ return {
70
+ registry,
71
+ unmount: async () => {
72
+ await act(async () => root.unmount());
73
+ container.remove();
74
+ },
75
+ };
76
+ }
77
+ /** Run a registration as the assistant would, inside `act`, and return what it returned. */
78
+ export async function runRegistration(registration, value) {
79
+ let result = { ok: false, code: 'NOT_RUN', message: 'did not run' };
80
+ await act(async () => {
81
+ result = await registration.run(value === undefined ? {} : { value });
82
+ });
83
+ return result;
84
+ }
85
+ /** Deep equality of JSON-like values. */
86
+ export function sameValue(a, b) {
87
+ if (Object.is(a, b))
88
+ return true;
89
+ if (typeof a !== 'object' || typeof b !== 'object' || !a || !b)
90
+ return false;
91
+ if (Array.isArray(a) !== Array.isArray(b))
92
+ return false;
93
+ const ka = Object.keys(a).filter(k => a[k] !== undefined);
94
+ const kb = Object.keys(b).filter(k => b[k] !== undefined);
95
+ if (ka.length !== kb.length)
96
+ return false;
97
+ return ka.every(k => sameValue(a[k], b[k]));
98
+ }
99
+ export function describeError(err) {
100
+ return err instanceof Error ? err.message : String(err);
101
+ }
102
+ //# sourceMappingURL=harness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"harness.js","sourceRoot":"","sources":["../src/harness.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,GAAG,EAAE,aAAa,EAAyD,MAAM,OAAO,CAAC;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAsF,MAAM,mBAAmB,CAAC;AAC9I,OAAO,EAAE,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AAO,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACxD,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAE,CAA6B,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;IACjG,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAE,CAA6B,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;IACjG,IAAI,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1C,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAE,CAA6B,CAAC,CAAC,CAAC,EAAG,CAA6B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxG,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAY;IACxC,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @ouispec/testing — the OUI conformance kit (ADR-0226 §3.2).
3
+ *
4
+ * It runs in the integrator's own test runner, in any DOM environment, and
5
+ * reports against the published contract (`@ouispec/contract`):
6
+ *
7
+ * - `checkDesignSystem`: a tier 1 design system — its table and declaration
8
+ * match the schemas, every entry registers with the kind it declares, every
9
+ * export that takes a callback is accounted for, and every binding's `run`
10
+ * returns its callback's result (a job's `pending.jobId` too);
11
+ * - `checkApp`: every action of a generated manifest has a handler mounted on
12
+ * the page that offers it;
13
+ * - `checkTier2`: every tier 2 wrapper forwards `valueFrom` correctly, and
14
+ * every uncontrolled use of a mapped control is reported.
15
+ * - `checkRoom`: a tier 3 room — its catalog matches the schema, every list it
16
+ * reports is declared, and its `query` and `inspect` return what it holds.
17
+ *
18
+ * Each returns a `ConformanceReport`; `assertConformant` throws with every
19
+ * violation listed, so any runner fails with the whole report.
20
+ *
21
+ * ```ts
22
+ * it('passes the OUI conformance kit', async () => {
23
+ * assertConformant(await checkDesignSystem({ name: '@acme/ui', packageJson, table, exports: ui, examples, excluded, source }));
24
+ * });
25
+ * ```
26
+ */
27
+ export { checkDesignSystem, type DesignSystemSpec } from './design-system.js';
28
+ export { checkApp, type AppSpec } from './app.js';
29
+ export { checkTier2, type Tier2Spec, type Tier2Use } from './tier2.js';
30
+ export { checkRoom, type RoomSpec } from './room.js';
31
+ export { checkBudgets, type BudgetSpec } from './budgets.js';
32
+ export { readShippedPackage, type ShippedPackage } from './package.js';
33
+ export { exportedComponents, type ExportedComponent, type SourceEntry } from './exports.js';
34
+ export { kitBindingId, type ControlExample, type ExampleContext, type ExampleElements, type Wrapper } from './harness.js';
35
+ export { sampleValue } from './sample.js';
36
+ export { assertConformant, CONFORMANCE_RULES, ConformanceError, formatReport, type ConformanceReport, type ConformanceRule, type Violation, } from './report.js';
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAC1H,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,SAAS,GACf,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @ouispec/testing — the OUI conformance kit (ADR-0226 §3.2).
3
+ *
4
+ * It runs in the integrator's own test runner, in any DOM environment, and
5
+ * reports against the published contract (`@ouispec/contract`):
6
+ *
7
+ * - `checkDesignSystem`: a tier 1 design system — its table and declaration
8
+ * match the schemas, every entry registers with the kind it declares, every
9
+ * export that takes a callback is accounted for, and every binding's `run`
10
+ * returns its callback's result (a job's `pending.jobId` too);
11
+ * - `checkApp`: every action of a generated manifest has a handler mounted on
12
+ * the page that offers it;
13
+ * - `checkTier2`: every tier 2 wrapper forwards `valueFrom` correctly, and
14
+ * every uncontrolled use of a mapped control is reported.
15
+ * - `checkRoom`: a tier 3 room — its catalog matches the schema, every list it
16
+ * reports is declared, and its `query` and `inspect` return what it holds.
17
+ *
18
+ * Each returns a `ConformanceReport`; `assertConformant` throws with every
19
+ * violation listed, so any runner fails with the whole report.
20
+ *
21
+ * ```ts
22
+ * it('passes the OUI conformance kit', async () => {
23
+ * assertConformant(await checkDesignSystem({ name: '@acme/ui', packageJson, table, exports: ui, examples, excluded, source }));
24
+ * });
25
+ * ```
26
+ */
27
+ export { checkDesignSystem } from './design-system.js';
28
+ export { checkApp } from './app.js';
29
+ export { checkTier2 } from './tier2.js';
30
+ export { checkRoom } from './room.js';
31
+ export { checkBudgets } from './budgets.js';
32
+ export { readShippedPackage } from './package.js';
33
+ export { exportedComponents } from './exports.js';
34
+ export { kitBindingId } from './harness.js';
35
+ export { sampleValue } from './sample.js';
36
+ export { assertConformant, CONFORMANCE_RULES, ConformanceError, formatReport, } from './report.js';
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,iBAAiB,EAAyB,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAgB,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,UAAU,EAAiC,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,SAAS,EAAiB,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAuB,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAA4C,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAgF,MAAM,cAAc,CAAC;AAC1H,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GAIb,MAAM,aAAa,CAAC"}
@@ -0,0 +1,9 @@
1
+ export interface ShippedPackage {
2
+ name: string;
3
+ packageJson: Readonly<Record<string, unknown>>;
4
+ /** The control table file's contents; `undefined` when the declaration names none, or a file that is not there. */
5
+ table: unknown;
6
+ }
7
+ /** Read a built package's `package.json` and the control table it declares. Build the package first. */
8
+ export declare function readShippedPackage(dir: string): ShippedPackage;
9
+ //# sourceMappingURL=package.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../src/package.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC/C,mHAAmH;IACnH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wGAAwG;AACxG,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAW9D"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * A design-system package as it ships: its `package.json`, and the control
3
+ * table its declaration names (`oui.agentControls`, or `closure.agentControls`
4
+ * during the transition), read from disk exactly as an app's generator reads it.
5
+ */
6
+ import { existsSync, readFileSync } from 'node:fs';
7
+ import { join, resolve } from 'node:path';
8
+ import { agentDeclaration } from '@ouispec/bindings';
9
+ /** Read a built package's `package.json` and the control table it declares. Build the package first. */
10
+ export function readShippedPackage(dir) {
11
+ const packageJson = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8'));
12
+ const name = typeof packageJson.name === 'string' ? packageJson.name : dir;
13
+ const declared = agentDeclaration(name, packageJson, 'agentControls');
14
+ let table;
15
+ if (typeof declared.value === 'string') {
16
+ const file = resolve(dir, declared.value);
17
+ if (!existsSync(file))
18
+ throw new Error(`${name} names ${declared.value} as its ${declared.source}, but it is not there: build the package first`);
19
+ table = JSON.parse(readFileSync(file, 'utf8'));
20
+ }
21
+ return { name, packageJson, table };
22
+ }
23
+ //# sourceMappingURL=package.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.js","sourceRoot":"","sources":["../src/package.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AASrD,wGAAwG;AACxG,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAA4B,CAAC;IAC3G,MAAM,IAAI,GAAG,OAAO,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;IAC3E,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;IACtE,IAAI,KAAc,CAAC;IACnB,IAAI,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,UAAU,QAAQ,CAAC,KAAK,WAAW,QAAQ,CAAC,MAAM,gDAAgD,CAAC,CAAC;QAClJ,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AACtC,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * What the conformance kit checks (ADR-0226 §3.2), and what it reports.
3
+ *
4
+ * Each rule has an id an integrator's test can name, the ADR's wording, and
5
+ * the checks that ran under it, so a passing report shows that every rule was
6
+ * exercised and not merely that nothing was found.
7
+ */
8
+ /** The kit's rules, in the order ADR-0226 §3.2 lists them, after the schemas they rest on. */
9
+ export declare const CONFORMANCE_RULES: {
10
+ readonly 'matches-contract': "What the package ships and declares matches the published schemas: its control table, its `oui` (or, during the transition, `closure`) declaration in package.json, a manifest, a mapping.";
11
+ readonly 'registers-declared-kind': "Every table entry registers at runtime with the kind it declares.";
12
+ readonly 'callbacks-accounted': "Every export that takes a callback is in the table, or excluded with a reason.";
13
+ readonly 'run-returns-result': "Every binding’s `run` returns its callback’s result, and a job control reports `pending.jobId`.";
14
+ readonly 'actions-mounted': "Every generated manifest action has a mounted handler on the page that offers it.";
15
+ readonly 'lists-readable': "Every list a room reports is declared with how its rows are addressed, and its `query` and `inspect` return what the room holds (ADR-0244 §2.2).";
16
+ readonly 'within-budgets': "Every action’s index entry and definition, and every surface’s index, is within the size the assistant’s transport carries (ADR-0245 §2.6).";
17
+ readonly 'tier2-forwards-value': "Every tier 2 wrapper forwards `valueFrom` correctly.";
18
+ readonly 'tier2-reports-uncontrolled': "Every use of a mapped control that does not pass its `controlled` prop is reported.";
19
+ };
20
+ export type ConformanceRule = keyof typeof CONFORMANCE_RULES;
21
+ export interface Violation {
22
+ rule: ConformanceRule;
23
+ /** What broke it: an export, a slot of one, a manifest action, a use. */
24
+ subject: string;
25
+ message: string;
26
+ }
27
+ export interface ConformanceReport {
28
+ /** Who was checked: a design system's package, an app, a mapping. */
29
+ target: string;
30
+ violations: Violation[];
31
+ /** How many checks ran under each rule. */
32
+ checked: Partial<Record<ConformanceRule, number>>;
33
+ }
34
+ /** A report being written. */
35
+ export declare class ReportBuilder {
36
+ private readonly target;
37
+ private readonly violations;
38
+ private readonly checked;
39
+ constructor(target: string);
40
+ /** One check ran under `rule`; when `problem` is given, it failed. */
41
+ check(rule: ConformanceRule, subject: string, problem?: string | null): boolean;
42
+ report(): ConformanceReport;
43
+ }
44
+ /** A report as text: one line per violation, under its rule. */
45
+ export declare function formatReport(report: ConformanceReport): string;
46
+ export declare class ConformanceError extends Error {
47
+ readonly report: ConformanceReport;
48
+ constructor(report: ConformanceReport);
49
+ }
50
+ /** Throw a `ConformanceError` listing every violation, so any test runner fails with the full report. */
51
+ export declare function assertConformant(report: ConformanceReport): void;
52
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 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ance kit checks (ADR-0226 §3.2), and what it reports.
3
+ *
4
+ * Each rule has an id an integrator's test can name, the ADR's wording, and
5
+ * the checks that ran under it, so a passing report shows that every rule was
6
+ * exercised and not merely that nothing was found.
7
+ */
8
+ /** The kit's rules, in the order ADR-0226 §3.2 lists them, after the schemas they rest on. */
9
+ export const CONFORMANCE_RULES = {
10
+ 'matches-contract': 'What the package ships and declares matches the published schemas: its control table, its `oui` (or, during the transition, `closure`) declaration in package.json, a manifest, a mapping.',
11
+ 'registers-declared-kind': 'Every table entry registers at runtime with the kind it declares.',
12
+ 'callbacks-accounted': 'Every export that takes a callback is in the table, or excluded with a reason.',
13
+ 'run-returns-result': 'Every binding’s `run` returns its callback’s result, and a job control reports `pending.jobId`.',
14
+ 'actions-mounted': 'Every generated manifest action has a mounted handler on the page that offers it.',
15
+ 'lists-readable': 'Every list a room reports is declared with how its rows are addressed, and its `query` and `inspect` return what the room holds (ADR-0244 §2.2).',
16
+ 'within-budgets': 'Every action’s index entry and definition, and every surface’s index, is within the size the assistant’s transport carries (ADR-0245 §2.6).',
17
+ 'tier2-forwards-value': 'Every tier 2 wrapper forwards `valueFrom` correctly.',
18
+ 'tier2-reports-uncontrolled': 'Every use of a mapped control that does not pass its `controlled` prop is reported.',
19
+ };
20
+ /** A report being written. */
21
+ export class ReportBuilder {
22
+ target;
23
+ violations = [];
24
+ checked = {};
25
+ constructor(target) {
26
+ this.target = target;
27
+ }
28
+ /** One check ran under `rule`; when `problem` is given, it failed. */
29
+ check(rule, subject, problem) {
30
+ this.checked[rule] = (this.checked[rule] ?? 0) + 1;
31
+ if (problem)
32
+ this.violations.push({ rule, subject, message: problem });
33
+ return !problem;
34
+ }
35
+ report() {
36
+ return { target: this.target, violations: [...this.violations], checked: { ...this.checked } };
37
+ }
38
+ }
39
+ /** A report as text: one line per violation, under its rule. */
40
+ export function formatReport(report) {
41
+ if (!report.violations.length) {
42
+ const ran = Object.entries(report.checked)
43
+ .map(([rule, n]) => `${rule} ${n}`)
44
+ .join(', ');
45
+ return `${report.target} conforms to the OUI contract (${ran || 'no checks ran'}).`;
46
+ }
47
+ const lines = [`${report.target} breaks the OUI contract in ${report.violations.length} place(s):`];
48
+ for (const rule of Object.keys(CONFORMANCE_RULES)) {
49
+ const mine = report.violations.filter(v => v.rule === rule);
50
+ if (!mine.length)
51
+ continue;
52
+ lines.push(` ${rule}: ${CONFORMANCE_RULES[rule]}`);
53
+ for (const v of mine)
54
+ lines.push(` - ${v.subject}: ${v.message}`);
55
+ }
56
+ return lines.join('\n');
57
+ }
58
+ export class ConformanceError extends Error {
59
+ report;
60
+ constructor(report) {
61
+ super(formatReport(report));
62
+ this.report = report;
63
+ this.name = 'ConformanceError';
64
+ }
65
+ }
66
+ /** Throw a `ConformanceError` listing every violation, so any test runner fails with the full report. */
67
+ export function assertConformant(report) {
68
+ if (report.violations.length)
69
+ throw new ConformanceError(report);
70
+ }
71
+ //# sourceMappingURL=report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.js","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,8FAA8F;AAC9F,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,kBAAkB,EAChB,4LAA4L;IAC9L,yBAAyB,EAAE,mEAAmE;IAC9F,qBAAqB,EAAE,gFAAgF;IACvG,oBAAoB,EAAE,iGAAiG;IACvH,iBAAiB,EAAE,mFAAmF;IACtG,gBAAgB,EACd,kJAAkJ;IACpJ,gBAAgB,EACd,6IAA6I;IAC/I,sBAAsB,EAAE,sDAAsD;IAC9E,4BAA4B,EAAE,qFAAqF;CAC3G,CAAC;AAmBX,8BAA8B;AAC9B,MAAM,OAAO,aAAa;IAIK;IAHZ,UAAU,GAAgB,EAAE,CAAC;IAC7B,OAAO,GAA6C,EAAE,CAAC;IAExE,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,sEAAsE;IACtE,KAAK,CAAC,IAAqB,EAA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CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,SAAS;QAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpD,KAAK,MAAM,CAAC,IAAI,IAAI;YAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACpB;IAArB,YAAqB,MAAyB;QAC5C,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;QADT,WAAM,GAAN,MAAM,CAAmB;QAE5C,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAED,yGAAyG;AACzG,MAAM,UAAU,gBAAgB,CAAC,MAAyB;IACxD,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM;QAAE,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACnE,CAAC"}
package/dist/room.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A tier 3 room against the contract (ADR-0244 §2.8): its catalog matches the
3
+ * published schema, and whatever it lists can be read. A room that reports a
4
+ * list of things with ids and gives the assistant no way to read one of them
5
+ * is a room the assistant can act in only by guessing.
6
+ */
7
+ import { type RoomResult } from '@ouispec/bindings';
8
+ import { type ConformanceReport } from './report.js';
9
+ export interface RoomSpec {
10
+ /** The room, for the report. */
11
+ name: string;
12
+ /** The room's catalog as data (`agent-catalog.json`, or `catalogData(catalog)`). */
13
+ catalog: unknown;
14
+ /** Runs one of the catalog's actions against a room holding something to read, as its host does. */
15
+ run(actionId: string, input: Record<string, unknown>): RoomResult | Promise<RoomResult>;
16
+ /** What the room reports now, by observation id: the same room `run` reads. */
17
+ observations: Readonly<Record<string, unknown>>;
18
+ }
19
+ export declare function checkRoom(spec: RoomSpec): Promise<ConformanceReport>;
20
+ //# sourceMappingURL=room.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"room.d.ts","sourceRoot":"","sources":["../src/room.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAOL,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEpE,MAAM,WAAW,QAAQ;IACvB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,OAAO,EAAE,OAAO,CAAC;IACjB,oGAAoG;IACpG,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACxF,+EAA+E;IAC/E,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACjD;AAcD,wBAAsB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAuD1E"}
package/dist/room.js ADDED
@@ -0,0 +1,68 @@
1
+ /**
2
+ * A tier 3 room against the contract (ADR-0244 §2.8): its catalog matches the
3
+ * published schema, and whatever it lists can be read. A room that reports a
4
+ * list of things with ids and gives the assistant no way to read one of them
5
+ * is a room the assistant can act in only by guessing.
6
+ */
7
+ import { ROOM_INSPECT_ID, ROOM_QUERY_ID, declaredLists, roomListProblems, } from '@ouispec/bindings';
8
+ import { contractProblems } from '@ouispec/contract/validate';
9
+ import { describeError } from './harness.js';
10
+ import { ReportBuilder } from './report.js';
11
+ /** The rows a list holds in what the room reports, and how they are addressed. */
12
+ function reportedRows(catalog, observations, list) {
13
+ const [observationId, property] = list.split('/');
14
+ const observation = catalog.observations.find(o => o.id === observationId);
15
+ const schema = (property ? observation.schema.properties?.[property] : observation.schema);
16
+ const reported = observations[observationId];
17
+ const value = property ? reported?.[property] : reported;
18
+ return { rows: schema['x-rows'], value: Array.isArray(value) ? value : null };
19
+ }
20
+ export async function checkRoom(spec) {
21
+ const out = new ReportBuilder(spec.name);
22
+ const problems = contractProblems('room-catalog-data.json', spec.catalog);
23
+ if (!out.check('matches-contract', 'catalog', problems.length ? problems.join('; ') : null))
24
+ return out.report();
25
+ const catalog = spec.catalog;
26
+ const declared = roomListProblems(catalog);
27
+ out.check('lists-readable', 'declarations', declared.length ? declared.join('; ') : null);
28
+ if (declared.length)
29
+ return out.report();
30
+ const run = async (id, input) => {
31
+ try {
32
+ return await spec.run(id, input);
33
+ }
34
+ catch (err) {
35
+ return { ok: false, code: 'THREW', message: describeError(err) };
36
+ }
37
+ };
38
+ for (const list of declaredLists(catalog)) {
39
+ const { rows, value } = reportedRows(catalog, spec.observations, list);
40
+ if (!out.check('lists-readable', list, value === null ? 'is declared, and the room reports no such list' : null))
41
+ continue;
42
+ if (!out.check('lists-readable', list, value.length === 0 ? 'is empty: check the room with something in it to read' : null))
43
+ continue;
44
+ const queried = await run(ROOM_QUERY_ID, { list, limit: value.length });
45
+ const listed = queried.ok ? (queried.data?.rows ?? []) : [];
46
+ out.check('lists-readable', `${list} › ${ROOM_QUERY_ID}`, !queried.ok
47
+ ? `failed: ${queried.message}`
48
+ : listed.length !== value.length
49
+ ? `lists ${listed.length} row(s), and the room reports ${value.length}`
50
+ : listed.some(row => typeof row[rows.ref] !== 'string' || row[rows.title] === undefined)
51
+ ? `returns a row without its ${rows.ref} or its ${rows.title}`
52
+ : listed.some((row, i) => row[rows.ref] !== value[i][rows.ref])
53
+ ? 'lists rows in another order than the room reports them'
54
+ : null);
55
+ const ref = String(value[0][rows.ref]);
56
+ const inspected = await run(ROOM_INSPECT_ID, { refs: [ref] });
57
+ const item = inspected.ok ? inspected.data?.items?.[0] : undefined;
58
+ out.check('lists-readable', `${list} › ${ROOM_INSPECT_ID}`, !inspected.ok
59
+ ? `failed for ${ref}: ${inspected.message}`
60
+ : !item || item.ref !== ref || item.list !== list
61
+ ? `did not return ${ref} as a row of ${list}`
62
+ : !item.detail || Object.keys(item.detail).length === 0
63
+ ? `returned nothing about ${ref}`
64
+ : null);
65
+ }
66
+ return out.report();
67
+ }
68
+ //# sourceMappingURL=room.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"room.js","sourceRoot":"","sources":["../src/room.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,GAIjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AAepE,kFAAkF;AAClF,SAAS,YAAY,CAAC,OAAwB,EAAE,YAA+C,EAAE,IAAY;IAC3G,MAAM,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,aAAa,CAAE,CAAC;IAC5E,MAAM,MAAM,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAe,CAAC;IACzG,MAAM,QAAQ,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAE,QAA4B,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,Q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ACT,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC,MAAM,EAAE,CAAC;AACtB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A value the assistant could set a control to: valid against the control's
3
+ * live schema, and different from what it shows now where the schema allows,
4
+ * so running it is a change the control's callback must see.
5
+ */
6
+ import { type JsonSchema } from '@ouispec/bindings';
7
+ /** A valid value for `schema` other than `current` when there is one; `undefined` when the kit cannot make one. */
8
+ export declare function sampleValue(schema: JsonSchema, current?: unknown): unknown;
9
+ //# sourceMappingURL=sample.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sample.d.ts","sourceRoot":"","sources":["../src/sample.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAInE,mHAAmH;AACnH,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAK1E"}
package/dist/sample.js ADDED
@@ -0,0 +1,113 @@
1
+ /**
2
+ * A value the assistant could set a control to: valid against the control's
3
+ * live schema, and different from what it shows now where the schema allows,
4
+ * so running it is a change the control's callback must see.
5
+ */
6
+ import { validateValue } from '@ouispec/bindings';
7
+ const SAMPLE_TEXT = 'Set by the OUI conformance kit';
8
+ /** A valid value for `schema` other than `current` when there is one; `undefined` when the kit cannot make one. */
9
+ export function sampleValue(schema, current) {
10
+ for (const candidate of candidates(schema, current)) {
11
+ if (candidate !== undefined && !validateValue(schema, candidate))
12
+ return candidate;
13
+ }
14
+ return undefined;
15
+ }
16
+ function candidates(schema, current) {
17
+ const alternatives = schema.anyOf ?? schema.oneOf;
18
+ if (alternatives) {
19
+ const nonNull = alternatives.filter(a => a.type !== 'null');
20
+ return [...nonNull, ...alternatives].flatMap(a => candidates(a, current));
21
+ }
22
+ if (schema.const !== undefined)
23
+ return [schema.const];
24
+ if (schema.enum) {
25
+ const values = schema.enum.filter(v => v !== null);
26
+ return [...values.filter(v => v !== current), ...values, ...(schema.enum.includes(null) ? [null] : [])];
27
+ }
28
+ const types = schema.type === undefined ? [] : typeof schema.type === 'string' ? [schema.type] : [...schema.type];
29
+ const ordered = [...types.filter(t => t !== 'null'), ...types.filter(t => t === 'null')];
30
+ if (!ordered.length)
31
+ return [SAMPLE_TEXT];
32
+ return ordered.flatMap(type => byType(type, schema, current));
33
+ }
34
+ function byType(type, schema, current) {
35
+ switch (type) {
36
+ case 'boolean':
37
+ return typeof current === 'boolean' ? [!current] : [true, false];
38
+ case 'number':
39
+ case 'integer':
40
+ return numbers(schema, current, type === 'integer');
41
+ case 'string':
42
+ return strings(schema, current);
43
+ case 'array':
44
+ return [array(schema, current)];
45
+ case 'object':
46
+ return [object(schema)];
47
+ case 'null':
48
+ return [null];
49
+ default:
50
+ return [];
51
+ }
52
+ }
53
+ function numbers(schema, current, integer) {
54
+ const min = schema.minimum;
55
+ const max = schema.maximum;
56
+ const step = schema.multipleOf ?? (integer ? 1 : undefined);
57
+ const snap = (n) => (step ? Math.round(n / step) * step : n);
58
+ const picks = [
59
+ min !== undefined && max !== undefined ? snap(min + (max - min) / 2) : undefined,
60
+ min !== undefined ? snap(min + (step ?? 1)) : undefined,
61
+ max !== undefined ? snap(max - (step ?? 1)) : undefined,
62
+ min,
63
+ max,
64
+ 1,
65
+ 0,
66
+ 2,
67
+ ].filter((n) => typeof n === 'number' && Number.isFinite(n));
68
+ return [...picks.filter(n => n !== current), ...picks];
69
+ }
70
+ function strings(schema, current) {
71
+ switch (schema.format) {
72
+ case 'date':
73
+ return current === '2026-10-02' ? ['2026-10-03'] : ['2026-10-02'];
74
+ case 'uri':
75
+ return ['https://example.com/oui-conformance-kit'];
76
+ case 'email':
77
+ return ['kit@example.com'];
78
+ case 'time':
79
+ return ['12:30'];
80
+ }
81
+ // A colour control's value is a CSS colour (`deriveValueSchema`'s `color` kind says so).
82
+ if (/colou?r/i.test(schema.description ?? ''))
83
+ return current === '#336699' ? ['#993366'] : ['#336699'];
84
+ let text = current === SAMPLE_TEXT ? `${SAMPLE_TEXT}, again` : SAMPLE_TEXT;
85
+ if (schema.maxLength !== undefined)
86
+ text = text.slice(0, schema.maxLength);
87
+ if (schema.minLength !== undefined && text.length < schema.minLength)
88
+ text = text.padEnd(schema.minLength, 'k');
89
+ return [text, 'kit'];
90
+ }
91
+ function array(schema, current) {
92
+ const items = schema.items ?? {};
93
+ const want = Math.max(1, schema.minItems ?? 1);
94
+ if (items.enum) {
95
+ const values = items.enum.filter(v => v !== null);
96
+ const now = Array.isArray(current) ? current : [];
97
+ const fresh = values.filter(v => !now.includes(v));
98
+ return [...fresh, ...values].slice(0, Math.min(want, values.length) || 1);
99
+ }
100
+ const out = [];
101
+ for (let i = 0; i < want; i++)
102
+ out.push(sampleValue(items));
103
+ return out;
104
+ }
105
+ function object(schema) {
106
+ const out = {};
107
+ for (const key of schema.required ?? []) {
108
+ const prop = schema.properties?.[key];
109
+ out[key] = prop ? sampleValue(prop) : SAMPLE_TEXT;
110
+ }
111
+ return out;
112
+ }
113
+ //# sourceMappingURL=sample.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sample.js","sourceRoot":"","sources":["../src/sample.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAmB,MAAM,mBAAmB,CAAC;AAEnE,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAErD,mHAAmH;AACnH,MAAM,UAAU,WAAW,CAAC,MAAkB,EAAE,OAAiB;IAC/D,KAAK,MAAM,SAAS,IAAI,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QACpD,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;IACrF,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,UAAU,CAAC,MAAkB,EAAE,OAAgB;IACtD,MAAM,YAAY,GAAG,MAA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