@openwop/openwop-conformance 1.54.0 → 1.58.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/CHANGELOG.md +20 -0
- package/README.md +2 -2
- package/coverage.md +2 -0
- package/package.json +1 -1
- package/schemas/agent-manifest.schema.json +23 -1
- package/schemas/capabilities.schema.json +62 -3
- package/schemas/connection-pack-manifest.schema.json +5 -0
- package/schemas/frontend-plugin-manifest.schema.json +9 -3
- package/schemas/run-snapshot.schema.json +6 -1
- package/schemas/workflow-chain-pack-manifest.schema.json +89 -6
- package/schemas/workflow-definition.schema.json +4 -3
- package/src/lib/anonymousActor.ts +99 -0
- package/src/lib/workflow-chain-expansion.ts +342 -0
- package/src/scenarios/agent-manifest-role-profile.test.ts +116 -0
- package/src/scenarios/anonymous-actor-audit-opaque.test.ts +71 -0
- package/src/scenarios/anonymous-actor-default-deny.test.ts +87 -0
- package/src/scenarios/anonymous-actor-egress-guarded.test.ts +54 -0
- package/src/scenarios/anonymous-actor-no-secret-reach.test.ts +78 -0
- package/src/scenarios/anonymous-actor-shape.test.ts +173 -0
- package/src/scenarios/anonymous-actor-write-gated.test.ts +83 -0
- package/src/scenarios/chain-produced-var-roundtrip.test.ts +152 -0
- package/src/scenarios/chain-subchain-cycle-rejected.test.ts +141 -0
- package/src/scenarios/chain-subchain-fanout.test.ts +139 -0
- package/src/scenarios/chain-subchain-sibling.test.ts +147 -0
- package/src/scenarios/chain-subchain-unsupported-refused.test.ts +66 -0
- package/src/scenarios/connection-pack-manifest-valid.test.ts +33 -0
- package/src/scenarios/edge-condition-truthy-falsy.test.ts +104 -0
- package/src/scenarios/frontend-plugin-packs.test.ts +24 -0
- package/src/scenarios/workflow-chain-internal-flag.test.ts +80 -0
|
@@ -105,6 +105,30 @@ describe('frontend-plugin manifest: schema layer (always-on, server-free)', () =
|
|
|
105
105
|
const m = { ...validManifest(), uiPlugins: [] };
|
|
106
106
|
expect(validate(m), 'a frontend-plugin pack MUST declare at least one uiPlugins[] entry').toBe(false);
|
|
107
107
|
});
|
|
108
|
+
|
|
109
|
+
it('a canvas-preview entry with canvasTypes + host.announce validates (RFC 0130)', () => {
|
|
110
|
+
const m = validManifest();
|
|
111
|
+
(m.uiPlugins as Array<Record<string, unknown>>)[0] = {
|
|
112
|
+
pluginId: 'gantt-preview',
|
|
113
|
+
surface: 'canvas-preview',
|
|
114
|
+
canvasTypes: ['canvas.gantt'],
|
|
115
|
+
entry: 'ui/preview.html',
|
|
116
|
+
hostApi: ['artifact.read', 'host.announce'],
|
|
117
|
+
};
|
|
118
|
+
expect(
|
|
119
|
+
validate(m),
|
|
120
|
+
`frontend-plugin-packs.md §The pack (RFC 0130) — a canvas-preview entry MUST validate. Errors: ${JSON.stringify(validate.errors)}`,
|
|
121
|
+
).toBe(true);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('a surface outside the closed set is still rejected (RFC 0130 keeps the enum closed)', () => {
|
|
125
|
+
const m = validManifest();
|
|
126
|
+
(m.uiPlugins as Array<Record<string, unknown>>)[0].surface = 'omni-panel';
|
|
127
|
+
expect(
|
|
128
|
+
validate(m),
|
|
129
|
+
'frontend-plugin-packs.md §The pack — the surface enum stays closed; an unknown surface MUST NOT validate',
|
|
130
|
+
).toBe(false);
|
|
131
|
+
});
|
|
108
132
|
});
|
|
109
133
|
|
|
110
134
|
describe('ui-plugin/1 message: schema layer (always-on, server-free)', () => {
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow-chain gallery visibility — `internal` chains (RFC 0135).
|
|
3
|
+
*
|
|
4
|
+
* Server-free corpus legs (always-on): the manifest schema's §WorkflowChain carries
|
|
5
|
+
* a boolean `internal` property; a chain declaring `internal: true` validates; a
|
|
6
|
+
* non-boolean `internal` is rejected; the spec documents the MUST-omit-from-default-
|
|
7
|
+
* gallery rule and the not-an-authorization-boundary rule.
|
|
8
|
+
*
|
|
9
|
+
* The gallery-omission behavior itself is host-catalog presentation with no
|
|
10
|
+
* normative wire listing endpoint, so it is witnessed at the reference host (host
|
|
11
|
+
* regression test), not over the wire — see RFC 0135 §Conformance.
|
|
12
|
+
*
|
|
13
|
+
* @see spec/v1/workflow-chain-packs.md §"Chain visibility (RFC 0135)"
|
|
14
|
+
* @see schemas/workflow-chain-pack-manifest.schema.json §WorkflowChain
|
|
15
|
+
* @see RFCS/0135-workflow-chain-internal-visibility.md
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { describe, it, expect } from 'vitest';
|
|
19
|
+
import { readFileSync } from 'node:fs';
|
|
20
|
+
import { join } from 'node:path';
|
|
21
|
+
import Ajv2020 from 'ajv/dist/2020.js';
|
|
22
|
+
import addFormats from 'ajv-formats';
|
|
23
|
+
import { SCHEMAS_DIR } from '../lib/paths.js';
|
|
24
|
+
|
|
25
|
+
const cite = (section: string, requirement: string): string => `${section} — ${requirement}`;
|
|
26
|
+
const MANIFEST = join(SCHEMAS_DIR, 'workflow-chain-pack-manifest.schema.json');
|
|
27
|
+
const CHAIN_DOC = join(SCHEMAS_DIR, '..', 'spec', 'v1', 'workflow-chain-packs.md');
|
|
28
|
+
|
|
29
|
+
function packWith(internal: unknown): Record<string, unknown> {
|
|
30
|
+
return {
|
|
31
|
+
name: 'vendor.acme.factory',
|
|
32
|
+
version: '1.0.0',
|
|
33
|
+
kind: 'workflow-chain',
|
|
34
|
+
engines: { openwop: '^1' },
|
|
35
|
+
chains: [
|
|
36
|
+
{
|
|
37
|
+
chainId: 'acme.child-batch',
|
|
38
|
+
version: '1.0.0',
|
|
39
|
+
label: 'Child Batch (Factory child)',
|
|
40
|
+
description: 'Composition-only child fragment; composed by acme.factory.',
|
|
41
|
+
...(internal !== undefined ? { internal } : {}),
|
|
42
|
+
parameters: {},
|
|
43
|
+
dag: { nodes: [{ id: 'build', typeId: 'core.ai.callPrompt', config: {} }] },
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
describe('workflow-chain-internal-flag §A: corpus (RFC 0135, always-on)', () => {
|
|
50
|
+
it('the manifest §WorkflowChain declares a boolean `internal` property', () => {
|
|
51
|
+
const schema = JSON.parse(readFileSync(MANIFEST, 'utf8')) as {
|
|
52
|
+
$defs?: Record<string, { properties?: Record<string, { type?: string }> }>;
|
|
53
|
+
};
|
|
54
|
+
const internal = schema.$defs?.WorkflowChain?.properties?.internal;
|
|
55
|
+
expect(internal, cite('§WorkflowChain', 'internal property present')).toBeTruthy();
|
|
56
|
+
expect(internal?.type, cite('§WorkflowChain', 'internal is boolean')).toBe('boolean');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('a chain declaring internal: true validates; a non-boolean internal is rejected', () => {
|
|
60
|
+
const ajv = new Ajv2020({ allErrors: true, strict: false });
|
|
61
|
+
addFormats(ajv);
|
|
62
|
+
const validate = ajv.compile(JSON.parse(readFileSync(MANIFEST, 'utf8')) as Record<string, unknown>);
|
|
63
|
+
expect(validate(packWith(true)), cite('§WorkflowChain', `internal:true validates: ${ajv.errorsText(validate.errors)}`)).toBe(true);
|
|
64
|
+
expect(validate(packWith(undefined)), cite('§WorkflowChain', 'absent internal stays valid (absent ⇒ false)')).toBe(true);
|
|
65
|
+
expect(validate(packWith('yes')), cite('§WorkflowChain', 'non-boolean internal rejected')).toBe(false);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('the spec documents the MUST-omit-from-default-gallery + not-an-authz-boundary rules', () => {
|
|
69
|
+
const doc = readFileSync(CHAIN_DOC, 'utf8');
|
|
70
|
+
expect(doc.includes('Chain visibility (RFC 0135)'), cite('§Chain visibility', 'section present')).toBe(true);
|
|
71
|
+
expect(
|
|
72
|
+
/internal[\s\S]{0,600}MUST omit/i.test(doc),
|
|
73
|
+
cite('§Chain visibility', 'documents MUST omit from default listing'),
|
|
74
|
+
).toBe(true);
|
|
75
|
+
expect(
|
|
76
|
+
/NOT an authorization boundary/i.test(doc),
|
|
77
|
+
cite('§Chain visibility', 'documents internal is not an authz boundary'),
|
|
78
|
+
).toBe(true);
|
|
79
|
+
});
|
|
80
|
+
});
|