@openwop/openwop-conformance 1.1.1 → 1.3.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 +90 -0
- package/README.md +2 -2
- package/api/redocly.yaml +15 -0
- package/coverage.md +27 -14
- package/fixtures/conformance-agent-low-confidence.json +7 -4
- package/fixtures/conformance-agent-pack-handoff-schema-validation.json +30 -0
- package/fixtures/conformance-agent-reasoning-streaming.json +37 -0
- package/fixtures/conformance-agent-reasoning.json +23 -4
- package/fixtures/conformance-dispatch-cancellable-child.json +27 -0
- package/fixtures/conformance-dispatch-cross-worker-handoff-child-a.json +27 -0
- package/fixtures/conformance-dispatch-cross-worker-handoff-child-b.json +25 -0
- package/fixtures/conformance-dispatch-cross-worker-handoff.json +60 -0
- package/fixtures/conformance-dispatch-deterministic-fail-child.json +30 -0
- package/fixtures/conformance-dispatch-input-mapping-child.json +25 -0
- package/fixtures/conformance-dispatch-input-mapping-no-default.json +49 -0
- package/fixtures/conformance-dispatch-input-mapping.json +49 -0
- package/fixtures/conformance-dispatch-output-mapping-child.json +27 -0
- package/fixtures/conformance-dispatch-output-mapping.json +49 -0
- package/fixtures/conformance-dispatch-per-worker-override.json +59 -0
- package/fixtures/conformance-subworkflow-input-mapping-child.json +27 -0
- package/fixtures/conformance-subworkflow-input-mapping-no-default.json +33 -0
- package/fixtures/conformance-subworkflow-input-mapping.json +33 -0
- package/fixtures.md +18 -2
- package/package.json +1 -1
- package/schemas/README.md +7 -0
- package/schemas/agent-ref.schema.json +1 -1
- package/schemas/ai-envelope.schema.json +106 -0
- package/schemas/capabilities.schema.json +264 -0
- package/schemas/core-conformance-mock-agent-config.schema.json +152 -0
- package/schemas/dispatch-config.schema.json +26 -0
- package/schemas/envelopes/clarification.request.schema.json +43 -0
- package/schemas/envelopes/error.schema.json +26 -0
- package/schemas/envelopes/schema.request.schema.json +22 -0
- package/schemas/envelopes/schema.response.schema.json +22 -0
- package/schemas/node-pack-manifest.schema.json +5 -0
- package/schemas/pack-lockfile.schema.json +16 -0
- package/schemas/run-event-payloads.schema.json +35 -1
- package/schemas/run-event.schema.json +2 -0
- package/schemas/workflow-chain-pack-manifest.schema.json +226 -0
- package/src/lib/driver.ts +15 -0
- package/src/lib/env.ts +51 -0
- package/src/lib/event-log-query.ts +62 -0
- package/src/lib/fixtures.ts +38 -1
- package/src/lib/host-toggle.ts +54 -0
- package/src/lib/multi-agent-capabilities.ts +10 -0
- package/src/lib/otel-scrape.ts +59 -0
- package/src/lib/webhook-receiver.ts +137 -0
- package/src/lib/workflow-chain-expansion.ts +213 -0
- package/src/scenarios/agentPackCatalog.test.ts +216 -0
- package/src/scenarios/agentPackHandoffSchemaValidation.test.ts +146 -0
- package/src/scenarios/agentReasoningEvents.test.ts +58 -7
- package/src/scenarios/agentReasoningStreaming.test.ts +193 -0
- package/src/scenarios/agents-run-tool-allowlist.test.ts +182 -0
- package/src/scenarios/ai-envelope-shape.test.ts +362 -0
- package/src/scenarios/aiEnvelope.capBreached.test.ts +261 -0
- package/src/scenarios/aiEnvelope.contractRefusal.test.ts +268 -0
- package/src/scenarios/aiEnvelope.correlationReplay.test.ts +284 -0
- package/src/scenarios/aiEnvelope.redaction.test.ts +253 -0
- package/src/scenarios/aiEnvelope.schemaDrift.test.ts +226 -0
- package/src/scenarios/aiEnvelope.trustBoundaryPropagation.test.ts +194 -0
- package/src/scenarios/aiEnvelope.universalKinds.test.ts +267 -0
- package/src/scenarios/append-ordering.test.ts +44 -0
- package/src/scenarios/artifact-auth.test.ts +58 -0
- package/src/scenarios/blob-cross-tenant-isolation.test.ts +66 -0
- package/src/scenarios/blob-presign-expiry.test.ts +99 -0
- package/src/scenarios/blob-roundtrip.test.ts +0 -0
- package/src/scenarios/cache-cross-tenant-isolation.test.ts +61 -0
- package/src/scenarios/cache-ttl-expiry.test.ts +73 -0
- package/src/scenarios/dispatch-cross-worker-handoff.test.ts +129 -0
- package/src/scenarios/dispatch-input-mapping.test.ts +163 -0
- package/src/scenarios/dispatch-output-mapping.test.ts +155 -0
- package/src/scenarios/fixtures-gating.test.ts +139 -1
- package/src/scenarios/fs-path-traversal.test.ts +124 -0
- package/src/scenarios/idempotency-key-determinism.test.ts +230 -0
- package/src/scenarios/interrupt-token-matrix.test.ts +126 -0
- package/src/scenarios/kv-atomic-increment.test.ts +74 -0
- package/src/scenarios/kv-cas.test.ts +75 -0
- package/src/scenarios/kv-cross-tenant-isolation.test.ts +85 -0
- package/src/scenarios/kv-ttl-expiry.test.ts +78 -0
- package/src/scenarios/mcp-server-elicitation-bridge.test.ts +92 -0
- package/src/scenarios/mcp-server-prompt-roundtrip.test.ts +80 -0
- package/src/scenarios/mcp-server-resource-roundtrip.test.ts +82 -0
- package/src/scenarios/mcp-server-sampling-bridge.test.ts +84 -0
- package/src/scenarios/mcp-server-tool-roundtrip.test.ts +107 -0
- package/src/scenarios/mcp-server-untrusted-args.test.ts +105 -0
- package/src/scenarios/otel-trace-propagation-subworkflow.test.ts +19 -0
- package/src/scenarios/pack-registry-publish.test.ts +231 -51
- package/src/scenarios/pause-resume.test.ts +43 -0
- package/src/scenarios/provider-usage.test.ts +185 -0
- package/src/scenarios/queue-ack-nack-dlq.test.ts +121 -0
- package/src/scenarios/queue-cross-tenant-isolation.test.ts +66 -0
- package/src/scenarios/queue-publish-consume-roundtrip.test.ts +88 -0
- package/src/scenarios/replay-llm-cache-key.test.ts +166 -25
- package/src/scenarios/search-bm25-roundtrip.test.ts +92 -0
- package/src/scenarios/spec-corpus-validity.test.ts +17 -1
- package/src/scenarios/sql-injection-rejection.test.ts +84 -0
- package/src/scenarios/sql-transaction-atomicity.test.ts +95 -0
- package/src/scenarios/stream-subscribe-from-beginning.test.ts +103 -0
- package/src/scenarios/subworkflow-input-mapping.test.ts +170 -0
- package/src/scenarios/table-cross-tenant-isolation.test.ts +65 -0
- package/src/scenarios/table-cursor-pagination.test.ts +85 -0
- package/src/scenarios/table-schema-enforcement.test.ts +84 -0
- package/src/scenarios/vector-knn-roundtrip.test.ts +88 -0
- package/src/scenarios/webhook-receiver-adversarial.test.ts +210 -0
- package/src/scenarios/workflow-chain-expansion.test.ts +366 -0
- package/src/scenarios/workflow-chain-host-expansion.test.ts +202 -0
- package/src/scenarios/workflow-chain-pack-manifest-validation.test.ts +232 -0
- package/src/scenarios/workflow-chain-pack-signature-verification.test.ts +138 -0
- package/src/scenarios/workflow-chain-unresolvable-typeid.test.ts +170 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "conformance-dispatch-deterministic-fail-child",
|
|
3
|
+
"name": "Conformance: Dispatch deterministic-fail child (RFC 0022 §B HVMAP-1b-failed)",
|
|
4
|
+
"version": "1.0",
|
|
5
|
+
"description": "RFC 0022 §B / HVMAP-1b-failed — child workflow that ALWAYS terminates `failed` via the host's `core.fail` node. Used by `conformance-dispatch-output-mapping` (parent) to verify that the parent's `outputMapping` MUST be SKIPPED when the child terminates non-completed; the parent's `parentResult` variable MUST remain at its pre-dispatch state.",
|
|
6
|
+
"nodes": [
|
|
7
|
+
{
|
|
8
|
+
"id": "fail",
|
|
9
|
+
"typeId": "core.fail",
|
|
10
|
+
"name": "Deterministic fail",
|
|
11
|
+
"position": { "x": 0, "y": 0 },
|
|
12
|
+
"config": {
|
|
13
|
+
"code": "hvmap_1b_failed_fixture",
|
|
14
|
+
"message": "intentional terminal failure for outputMapping-skip assertion"
|
|
15
|
+
},
|
|
16
|
+
"inputs": {}
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"edges": [],
|
|
20
|
+
"triggers": [
|
|
21
|
+
{ "id": "manual", "type": "manual", "enabled": true }
|
|
22
|
+
],
|
|
23
|
+
"variables": [
|
|
24
|
+
{ "name": "childOutcome", "type": "string", "defaultValue": "this-should-not-be-harvested" }
|
|
25
|
+
],
|
|
26
|
+
"metadata": {
|
|
27
|
+
"tags": ["conformance", "rfc-0022", "dispatch", "output-mapping", "hvmap-1b-failed", "child"]
|
|
28
|
+
},
|
|
29
|
+
"settings": { "timeout": 5000, "maxRetries": 0 }
|
|
30
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "conformance-dispatch-input-mapping-child",
|
|
3
|
+
"name": "Conformance: Dispatch Input Mapping (RFC 0022 §A) — child",
|
|
4
|
+
"version": "1.0",
|
|
5
|
+
"description": "Child fixture for `conformance-dispatch-input-mapping`. Noop body; the scenario reads this child's `inputs_json` (surfaced as `inputs` on `GET /v1/runs/{childRunId}`) and asserts `inputs.childGreeting === 'Alice'` per RFC 0022 §A.",
|
|
6
|
+
"nodes": [
|
|
7
|
+
{
|
|
8
|
+
"id": "noop",
|
|
9
|
+
"typeId": "core.identity",
|
|
10
|
+
"name": "Noop (asserts via inputs)",
|
|
11
|
+
"position": { "x": 0, "y": 0 },
|
|
12
|
+
"config": {},
|
|
13
|
+
"inputs": {}
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"edges": [],
|
|
17
|
+
"triggers": [
|
|
18
|
+
{ "id": "manual", "type": "manual", "enabled": true }
|
|
19
|
+
],
|
|
20
|
+
"variables": [],
|
|
21
|
+
"metadata": {
|
|
22
|
+
"tags": ["conformance", "rfc-0022", "dispatch", "input-mapping", "child"]
|
|
23
|
+
},
|
|
24
|
+
"settings": { "timeout": 5000 }
|
|
25
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "conformance-dispatch-input-mapping-no-default",
|
|
3
|
+
"name": "Conformance: Dispatch Input Mapping — parentName unset (RFC 0022 §A HVMAP-1a-null)",
|
|
4
|
+
"version": "1.0",
|
|
5
|
+
"description": "RFC 0022 §A / HVMAP-1a-null — parent variant of `conformance-dispatch-input-mapping` that DECLARES `parentName` in `variables[]` but OMITS its `defaultValue`. The dispatch's `inputMapping: { childGreeting: 'parentName' }` projects an unset parent variable. Per RFC 0022 §A normative bullet: child `inputs.childGreeting` MUST surface as `undefined` (NOT `null`, NOT omitted). Same supervisor + dispatch shape as the base fixture; only the `variables[].parentName.defaultValue` is removed. See dispatch-input-mapping.test.ts § HVMAP-1a-null.",
|
|
6
|
+
"nodes": [
|
|
7
|
+
{
|
|
8
|
+
"id": "supervisor",
|
|
9
|
+
"typeId": "core.orchestrator.supervisor",
|
|
10
|
+
"name": "Supervisor (mock plan)",
|
|
11
|
+
"position": { "x": 0, "y": 0 },
|
|
12
|
+
"config": {
|
|
13
|
+
"mockDispatchPlan": [
|
|
14
|
+
{ "kind": "next-worker", "nextWorkerIds": ["conformance-dispatch-input-mapping-child"] },
|
|
15
|
+
{ "kind": "terminate", "reason": "goal-reached" }
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"inputs": {}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "dispatch",
|
|
22
|
+
"typeId": "core.dispatch",
|
|
23
|
+
"name": "Dispatch with inputMapping (parent var unset)",
|
|
24
|
+
"position": { "x": 200, "y": 0 },
|
|
25
|
+
"config": {
|
|
26
|
+
"askUserRouting": "auto",
|
|
27
|
+
"workerDispatchModel": "child-run",
|
|
28
|
+
"fanOutPolicy": "sequential",
|
|
29
|
+
"inputMapping": { "childGreeting": "parentName" }
|
|
30
|
+
},
|
|
31
|
+
"inputs": {}
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"edges": [
|
|
35
|
+
{ "id": "e1", "sourceNodeId": "supervisor", "targetNodeId": "dispatch" },
|
|
36
|
+
{ "id": "e2", "sourceNodeId": "dispatch", "targetNodeId": "supervisor" }
|
|
37
|
+
],
|
|
38
|
+
"triggers": [
|
|
39
|
+
{ "id": "manual", "type": "manual", "enabled": true }
|
|
40
|
+
],
|
|
41
|
+
"variables": [
|
|
42
|
+
{ "name": "parentName", "type": "string" }
|
|
43
|
+
],
|
|
44
|
+
"metadata": {
|
|
45
|
+
"tags": ["conformance", "rfc-0022", "dispatch", "input-mapping", "hvmap-1a-null"],
|
|
46
|
+
"requiresCapability": "capabilities.agents.dispatchMapping"
|
|
47
|
+
},
|
|
48
|
+
"settings": { "timeout": 30000 }
|
|
49
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "conformance-dispatch-input-mapping",
|
|
3
|
+
"name": "Conformance: Dispatch Input Mapping (RFC 0022 §A)",
|
|
4
|
+
"version": "1.0",
|
|
5
|
+
"description": "RFC 0022 §A / HVMAP-1a — host honors `inputMapping` on `core.dispatch` and projects parent variables into child inputs. Supervisor uses `mockDispatchPlan` (per the supervisor-mock extension landed 2026-05-18 — see RFC 0022 §\"Unresolved questions\" #6) to emit `next-worker: ['conformance-dispatch-input-mapping-child']`, then `terminate`. Dispatch's `inputMapping` projects parent's `parentName` onto the child's `childGreeting` input. Test reads the child run's `inputs` from `GET /v1/runs/{childRunId}` and asserts `inputs.childGreeting === 'Alice'`. See dispatch-input-mapping.test.ts.",
|
|
6
|
+
"nodes": [
|
|
7
|
+
{
|
|
8
|
+
"id": "supervisor",
|
|
9
|
+
"typeId": "core.orchestrator.supervisor",
|
|
10
|
+
"name": "Supervisor (mock plan)",
|
|
11
|
+
"position": { "x": 0, "y": 0 },
|
|
12
|
+
"config": {
|
|
13
|
+
"mockDispatchPlan": [
|
|
14
|
+
{ "kind": "next-worker", "nextWorkerIds": ["conformance-dispatch-input-mapping-child"] },
|
|
15
|
+
{ "kind": "terminate", "reason": "goal-reached" }
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"inputs": {}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "dispatch",
|
|
22
|
+
"typeId": "core.dispatch",
|
|
23
|
+
"name": "Dispatch with inputMapping",
|
|
24
|
+
"position": { "x": 200, "y": 0 },
|
|
25
|
+
"config": {
|
|
26
|
+
"askUserRouting": "auto",
|
|
27
|
+
"workerDispatchModel": "child-run",
|
|
28
|
+
"fanOutPolicy": "sequential",
|
|
29
|
+
"inputMapping": { "childGreeting": "parentName" }
|
|
30
|
+
},
|
|
31
|
+
"inputs": {}
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"edges": [
|
|
35
|
+
{ "id": "e1", "sourceNodeId": "supervisor", "targetNodeId": "dispatch" },
|
|
36
|
+
{ "id": "e2", "sourceNodeId": "dispatch", "targetNodeId": "supervisor" }
|
|
37
|
+
],
|
|
38
|
+
"triggers": [
|
|
39
|
+
{ "id": "manual", "type": "manual", "enabled": true }
|
|
40
|
+
],
|
|
41
|
+
"variables": [
|
|
42
|
+
{ "name": "parentName", "type": "string", "defaultValue": "Alice" }
|
|
43
|
+
],
|
|
44
|
+
"metadata": {
|
|
45
|
+
"tags": ["conformance", "rfc-0022", "dispatch", "input-mapping"],
|
|
46
|
+
"requiresCapability": "capabilities.agents.dispatchMapping"
|
|
47
|
+
},
|
|
48
|
+
"settings": { "timeout": 30000 }
|
|
49
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "conformance-dispatch-output-mapping-child",
|
|
3
|
+
"name": "Conformance: Dispatch Output Mapping (RFC 0022 §A) — child",
|
|
4
|
+
"version": "1.0",
|
|
5
|
+
"description": "Child fixture for `conformance-dispatch-output-mapping`. Declares `childOutcome.defaultValue='done'`; the variable is folded into the child's initial `variables_json` at run-create time. On terminal `completed`, the parent's `outputMapping` harvests `childOutcome` onto the parent's `parentResult` per RFC 0022 §A.",
|
|
6
|
+
"nodes": [
|
|
7
|
+
{
|
|
8
|
+
"id": "noop",
|
|
9
|
+
"typeId": "core.identity",
|
|
10
|
+
"name": "Noop (childOutcome seeded by defaultValue)",
|
|
11
|
+
"position": { "x": 0, "y": 0 },
|
|
12
|
+
"config": {},
|
|
13
|
+
"inputs": {}
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"edges": [],
|
|
17
|
+
"triggers": [
|
|
18
|
+
{ "id": "manual", "type": "manual", "enabled": true }
|
|
19
|
+
],
|
|
20
|
+
"variables": [
|
|
21
|
+
{ "name": "childOutcome", "type": "string", "defaultValue": "done" }
|
|
22
|
+
],
|
|
23
|
+
"metadata": {
|
|
24
|
+
"tags": ["conformance", "rfc-0022", "dispatch", "output-mapping", "child"]
|
|
25
|
+
},
|
|
26
|
+
"settings": { "timeout": 5000 }
|
|
27
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "conformance-dispatch-output-mapping",
|
|
3
|
+
"name": "Conformance: Dispatch Output Mapping (RFC 0022 §A)",
|
|
4
|
+
"version": "1.0",
|
|
5
|
+
"description": "RFC 0022 §A / HVMAP-1b — host harvests child variables back into parent variables via `outputMapping` on `core.dispatch`. Supervisor plan: `next-worker: ['conformance-dispatch-output-mapping-child']` → `terminate`. Child declares `childOutcome.defaultValue='done'`; on child terminal `completed`, the parent's outputMapping projects `childOutcome` onto `parentResult`. Test reads parent's final variables, asserts `parentResult === 'done'`. See dispatch-output-mapping.test.ts.",
|
|
6
|
+
"nodes": [
|
|
7
|
+
{
|
|
8
|
+
"id": "supervisor",
|
|
9
|
+
"typeId": "core.orchestrator.supervisor",
|
|
10
|
+
"name": "Supervisor (mock plan)",
|
|
11
|
+
"position": { "x": 0, "y": 0 },
|
|
12
|
+
"config": {
|
|
13
|
+
"mockDispatchPlan": [
|
|
14
|
+
{ "kind": "next-worker", "nextWorkerIds": ["conformance-dispatch-output-mapping-child"] },
|
|
15
|
+
{ "kind": "terminate", "reason": "goal-reached" }
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"inputs": {}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "dispatch",
|
|
22
|
+
"typeId": "core.dispatch",
|
|
23
|
+
"name": "Dispatch with outputMapping",
|
|
24
|
+
"position": { "x": 200, "y": 0 },
|
|
25
|
+
"config": {
|
|
26
|
+
"askUserRouting": "auto",
|
|
27
|
+
"workerDispatchModel": "child-run",
|
|
28
|
+
"fanOutPolicy": "sequential",
|
|
29
|
+
"outputMapping": { "parentResult": "childOutcome" }
|
|
30
|
+
},
|
|
31
|
+
"inputs": {}
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"edges": [
|
|
35
|
+
{ "id": "e1", "sourceNodeId": "supervisor", "targetNodeId": "dispatch" },
|
|
36
|
+
{ "id": "e2", "sourceNodeId": "dispatch", "targetNodeId": "supervisor" }
|
|
37
|
+
],
|
|
38
|
+
"triggers": [
|
|
39
|
+
{ "id": "manual", "type": "manual", "enabled": true }
|
|
40
|
+
],
|
|
41
|
+
"variables": [
|
|
42
|
+
{ "name": "parentResult", "type": "string", "defaultValue": "" }
|
|
43
|
+
],
|
|
44
|
+
"metadata": {
|
|
45
|
+
"tags": ["conformance", "rfc-0022", "dispatch", "output-mapping"],
|
|
46
|
+
"requiresCapability": "capabilities.agents.dispatchMapping"
|
|
47
|
+
},
|
|
48
|
+
"settings": { "timeout": 30000 }
|
|
49
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "conformance-dispatch-per-worker-override",
|
|
3
|
+
"name": "Conformance: Dispatch Per-Worker Mapping Override (RFC 0022 §A HVMAP-1c-override)",
|
|
4
|
+
"version": "1.0",
|
|
5
|
+
"description": "RFC 0022 §A / HVMAP-1c-override — verifies that `perWorkerInputMappings[childId]` OVERRIDES the default `inputMapping` for the named child, while OTHER children continue to use the default. Supervisor plan: `next-worker: ['conformance-dispatch-cross-worker-handoff-child-a', 'conformance-dispatch-cross-worker-handoff-child-b']` → `terminate`. Default `inputMapping: { input: 'defaultX' }`; `perWorkerInputMappings.conformance-dispatch-cross-worker-handoff-child-b: { input: 'sharedVar' }`. child-a receives `input: <defaultX-value>`; child-b receives `input: <sharedVar-value>` (NOT defaultX) per RFC 0022 §A `effectiveInputMapping` precedence. See dispatch-cross-worker-handoff.test.ts § HVMAP-1c-override.",
|
|
6
|
+
"nodes": [
|
|
7
|
+
{
|
|
8
|
+
"id": "supervisor",
|
|
9
|
+
"typeId": "core.orchestrator.supervisor",
|
|
10
|
+
"name": "Supervisor (mock plan, multi-worker)",
|
|
11
|
+
"position": { "x": 0, "y": 0 },
|
|
12
|
+
"config": {
|
|
13
|
+
"mockDispatchPlan": [
|
|
14
|
+
{
|
|
15
|
+
"kind": "next-worker",
|
|
16
|
+
"nextWorkerIds": [
|
|
17
|
+
"conformance-dispatch-cross-worker-handoff-child-a",
|
|
18
|
+
"conformance-dispatch-cross-worker-handoff-child-b"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
{ "kind": "terminate", "reason": "goal-reached" }
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"inputs": {}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "dispatch",
|
|
28
|
+
"typeId": "core.dispatch",
|
|
29
|
+
"name": "Dispatch with default + per-worker override",
|
|
30
|
+
"position": { "x": 200, "y": 0 },
|
|
31
|
+
"config": {
|
|
32
|
+
"askUserRouting": "auto",
|
|
33
|
+
"workerDispatchModel": "child-run",
|
|
34
|
+
"fanOutPolicy": "sequential",
|
|
35
|
+
"inputMapping": { "input": "defaultX" },
|
|
36
|
+
"perWorkerInputMappings": {
|
|
37
|
+
"conformance-dispatch-cross-worker-handoff-child-b": { "input": "sharedVar" }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"inputs": {}
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"edges": [
|
|
44
|
+
{ "id": "e1", "sourceNodeId": "supervisor", "targetNodeId": "dispatch" },
|
|
45
|
+
{ "id": "e2", "sourceNodeId": "dispatch", "targetNodeId": "supervisor" }
|
|
46
|
+
],
|
|
47
|
+
"triggers": [
|
|
48
|
+
{ "id": "manual", "type": "manual", "enabled": true }
|
|
49
|
+
],
|
|
50
|
+
"variables": [
|
|
51
|
+
{ "name": "defaultX", "type": "string", "defaultValue": "default-x-value" },
|
|
52
|
+
{ "name": "sharedVar", "type": "string", "defaultValue": "shared-value" }
|
|
53
|
+
],
|
|
54
|
+
"metadata": {
|
|
55
|
+
"tags": ["conformance", "rfc-0022", "dispatch", "per-worker-mapping", "hvmap-1c-override"],
|
|
56
|
+
"requiresCapability": "capabilities.agents.dispatchMapping"
|
|
57
|
+
},
|
|
58
|
+
"settings": { "timeout": 30000 }
|
|
59
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "conformance-subworkflow-input-mapping-child",
|
|
3
|
+
"name": "Conformance: subWorkflow Input Mapping (RFC 0022 §B) — child",
|
|
4
|
+
"version": "1.0",
|
|
5
|
+
"description": "Child fixture for `conformance-subworkflow-input-mapping`. Declares a single `receivedPrdId` variable with `defaultValue: 'baked-in'` — the parent's `inputMapping: { receivedPrdId: 'currentPrdId' }` MUST override this default at child-run-create time per RFC 0022 §B. The body is a noop identity node; the assertion (the child's final `receivedPrdId` variable) is read from the child run's variables_json via `GET /v1/runs/{runId}`.",
|
|
6
|
+
"nodes": [
|
|
7
|
+
{
|
|
8
|
+
"id": "noop",
|
|
9
|
+
"typeId": "core.identity",
|
|
10
|
+
"name": "Noop (asserts via final variables)",
|
|
11
|
+
"position": { "x": 0, "y": 0 },
|
|
12
|
+
"config": {},
|
|
13
|
+
"inputs": {}
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"edges": [],
|
|
17
|
+
"triggers": [
|
|
18
|
+
{ "id": "manual", "type": "manual", "enabled": true }
|
|
19
|
+
],
|
|
20
|
+
"variables": [
|
|
21
|
+
{ "name": "receivedPrdId", "type": "string", "defaultValue": "baked-in" }
|
|
22
|
+
],
|
|
23
|
+
"metadata": {
|
|
24
|
+
"tags": ["conformance", "rfc-0022", "subworkflow", "input-mapping", "child"]
|
|
25
|
+
},
|
|
26
|
+
"settings": { "timeout": 5000 }
|
|
27
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "conformance-subworkflow-input-mapping-no-default",
|
|
3
|
+
"name": "Conformance: subWorkflow Input Mapping — currentPrdId unset (RFC 0022 §B HVMAP-2-unset)",
|
|
4
|
+
"version": "1.0",
|
|
5
|
+
"description": "RFC 0022 §B / HVMAP-2-unset — parent variant of `conformance-subworkflow-input-mapping` that DECLARES `currentPrdId` in `variables[]` but OMITS its `defaultValue`. The `core.subWorkflow` node's `inputMapping: { receivedPrdId: 'currentPrdId' }` projects an unset parent variable. Per RFC 0022 §B normative bullet: child `receivedPrdId` MUST surface as `undefined` (NOT `null`, NOT omitted) — distinct from the child's own `defaultValue` fold. Same shape as the base fixture; only `currentPrdId.defaultValue` is removed. See subworkflow-input-mapping.test.ts § HVMAP-2-unset.",
|
|
6
|
+
"nodes": [
|
|
7
|
+
{
|
|
8
|
+
"id": "subwf-call",
|
|
9
|
+
"typeId": "core.subWorkflow",
|
|
10
|
+
"name": "Invoke child with inputMapping (parent var unset)",
|
|
11
|
+
"position": { "x": 0, "y": 0 },
|
|
12
|
+
"config": {
|
|
13
|
+
"workflowId": "conformance-subworkflow-input-mapping-child",
|
|
14
|
+
"waitForCompletion": true,
|
|
15
|
+
"onChildFailure": "fail-parent",
|
|
16
|
+
"inputMapping": { "receivedPrdId": "currentPrdId" }
|
|
17
|
+
},
|
|
18
|
+
"inputs": {}
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"edges": [],
|
|
22
|
+
"triggers": [
|
|
23
|
+
{ "id": "manual", "type": "manual", "enabled": true }
|
|
24
|
+
],
|
|
25
|
+
"variables": [
|
|
26
|
+
{ "name": "currentPrdId", "type": "string" }
|
|
27
|
+
],
|
|
28
|
+
"metadata": {
|
|
29
|
+
"tags": ["conformance", "rfc-0022", "subworkflow", "input-mapping", "hvmap-2-unset"],
|
|
30
|
+
"requiresCapability": "capabilities.subWorkflow.inputMapping"
|
|
31
|
+
},
|
|
32
|
+
"settings": { "timeout": 10000 }
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "conformance-subworkflow-input-mapping",
|
|
3
|
+
"name": "Conformance: subWorkflow Input Mapping (RFC 0022 §B)",
|
|
4
|
+
"version": "1.0",
|
|
5
|
+
"description": "RFC 0022 §B — host honors `inputMapping` on `core.subWorkflow` and seeds child variables from parent-variable projections. The parent fixture sets its `currentPrdId='prd-1'`, then invokes the child fixture (`conformance-subworkflow-input-mapping-child`) via `core.subWorkflow` with `inputMapping: { receivedPrdId: 'currentPrdId' }`. The child workflow declares `receivedPrdId.defaultValue='baked-in'` — the RFC normates that `inputMapping` MUST override matching `defaultValue` declarations. The scenario inspects the child run's final variables and asserts `receivedPrdId === 'prd-1'`. See subworkflow-input-mapping.test.ts.",
|
|
6
|
+
"nodes": [
|
|
7
|
+
{
|
|
8
|
+
"id": "subwf-call",
|
|
9
|
+
"typeId": "core.subWorkflow",
|
|
10
|
+
"name": "Invoke child with inputMapping",
|
|
11
|
+
"position": { "x": 0, "y": 0 },
|
|
12
|
+
"config": {
|
|
13
|
+
"workflowId": "conformance-subworkflow-input-mapping-child",
|
|
14
|
+
"waitForCompletion": true,
|
|
15
|
+
"onChildFailure": "fail-parent",
|
|
16
|
+
"inputMapping": { "receivedPrdId": "currentPrdId" }
|
|
17
|
+
},
|
|
18
|
+
"inputs": {}
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"edges": [],
|
|
22
|
+
"triggers": [
|
|
23
|
+
{ "id": "manual", "type": "manual", "enabled": true }
|
|
24
|
+
],
|
|
25
|
+
"variables": [
|
|
26
|
+
{ "name": "currentPrdId", "type": "string", "defaultValue": "prd-1" }
|
|
27
|
+
],
|
|
28
|
+
"metadata": {
|
|
29
|
+
"tags": ["conformance", "rfc-0022", "subworkflow", "input-mapping"],
|
|
30
|
+
"requiresCapability": "capabilities.subWorkflow.inputMapping"
|
|
31
|
+
},
|
|
32
|
+
"settings": { "timeout": 10000 }
|
|
33
|
+
}
|
package/fixtures.md
CHANGED
|
@@ -58,12 +58,28 @@ All fixtures MUST advertise:
|
|
|
58
58
|
| Interrupt — Auth Required | `conformance-interrupt-auth-required` | Verifies `openwop-interrupt-auth-required` profile (bearer-token resume only) | `completed` after bearer resolve | unbounded (suspends) |
|
|
59
59
|
| Interrupt — Parent/Child Cancel | `conformance-interrupt-parent-child-cancel` + `conformance-interrupt-parent-child-cancel-child` | Verifies `openwop-interrupt-parent-child` cancel cascade | `cancelled` (both runs) | ≤ 30s |
|
|
60
60
|
| Agent Identity | `conformance-agent-identity` | Phase 1 — `RunSnapshot.agent` / `runOrchestrator` AgentRef wire-shape | `completed` | ≤ 10s |
|
|
61
|
-
| Agent Reasoning | `conformance-agent-reasoning` | Phase 1 — `agent.*` event family emission + `callId` pairing | `completed` | ≤ 15s |
|
|
62
|
-
| Agent
|
|
61
|
+
| Agent Reasoning | `conformance-agent-reasoning` | Phase 1 / RFC 0023 — `agent.*` event family emission + `callId` pairing on `core.conformance.mock-agent` | `completed` | ≤ 15s |
|
|
62
|
+
| Agent Reasoning Streaming | `conformance-agent-reasoning-streaming` | RFC 0024 — `core.conformance.mock-agent` with `mockReasoning.streamChunks` drives incremental `agent.reasoning.delta` events (sequence 0..N-1) followed by exactly one closing `agent.reasoned` whose `reasoning` equals the concatenation. Gated on `capabilities.agents.reasoning.streaming: true`. | `completed` | ≤ 15s |
|
|
63
|
+
| Agent Low-Confidence | `conformance-agent-low-confidence` | Phase 1 / CP-1 / RFC 0023 — `core.conformance.mock-agent` emits `agent.decided` with confidence < threshold; host MUST follow with `node.suspended { reason: 'low-confidence' }` | `waiting-approval` (suspends) | unbounded (suspends) |
|
|
63
64
|
| Message Reducer | `conformance-message-reducer` | Phase 1 — `message` reducer idempotency on duplicate `messageId` | `completed` | ≤ 10s |
|
|
64
65
|
| Agent Pack Install | `conformance-agent-pack-install` | Phase 2 — pack `agents[]` surface as AgentManifest at `GET /v1/packs` | `completed` | ≤ 5s |
|
|
65
66
|
| Agent Pack Export | `conformance-agent-pack-export` | Phase 2 — workspace agents project to AgentManifest at `GET /v1/packs/export` | `completed` | ≤ 5s |
|
|
66
67
|
| Agent Pack Provenance | `conformance-agent-pack-provenance` | Phase 2 — `sourceManifestId` provenance round-trip | `completed` | ≤ 10s |
|
|
68
|
+
| Agent Pack Handoff Schema Validation | `conformance-agent-pack-handoff-schema-validation` | Phase 2 / HV-1 — host validates dispatch payloads against `handoff.taskSchemaRef` AND return payloads against `handoff.returnSchemaRef` per RFC 0003 §D. Three branches: valid-task → `completed`; invalid-task → `failed` with structured violation; mock-return-violation → violation surfaced before persistence. | varies by scenario | ≤ 5s |
|
|
69
|
+
| Dispatch Input Mapping | `conformance-dispatch-input-mapping` | RFC 0022 §A / HVMAP-1a — host honors `inputMapping` on `core.dispatch`. Capability-gated on `capabilities.agents.dispatchMapping`. | `completed` | ≤ 5s |
|
|
70
|
+
| Dispatch Output Mapping | `conformance-dispatch-output-mapping` | RFC 0022 §A / HVMAP-1b — host harvests child variables via `outputMapping` on `core.dispatch`. Capability-gated on `capabilities.agents.dispatchMapping`. | `completed` | ≤ 5s |
|
|
71
|
+
| Dispatch Cross-Worker Handoff | `conformance-dispatch-cross-worker-handoff` | RFC 0022 §A / HVMAP-1c — sequential fan-out: child-a writes via `perWorkerOutputMappings`, child-b reads via `perWorkerInputMappings`. Capability-gated on `capabilities.agents.dispatchMapping`. | `completed` | ≤ 10s |
|
|
72
|
+
| subWorkflow Input Mapping | `conformance-subworkflow-input-mapping` | RFC 0022 §B / HVMAP-2 — host honors `inputMapping` on `core.subWorkflow`; overrides matching `defaultValue` declarations on the child. Capability-gated on `capabilities.subWorkflow.inputMapping`. | `completed` | ≤ 10s |
|
|
73
|
+
| subWorkflow Input Mapping (child) | `conformance-subworkflow-input-mapping-child` | RFC 0022 §B / HVMAP-2 — child workflow for the input-mapping scenario. Declares `receivedPrdId.defaultValue='baked-in'`; parent's `inputMapping` MUST override that default. Single noop node; final variables read via `GET /v1/runs/{runId}` for the assertion. | `completed` | ≤ 5s |
|
|
74
|
+
| Dispatch Input Mapping (child) | `conformance-dispatch-input-mapping-child` | RFC 0022 §A / HVMAP-1a — child workflow for the dispatch input-mapping scenario. Single noop node; the scenario reads this child's `inputs_json` via `GET /v1/runs/{childRunId}` and asserts `inputs.childGreeting === 'Alice'`. | `completed` | ≤ 5s |
|
|
75
|
+
| Dispatch Output Mapping (child) | `conformance-dispatch-output-mapping-child` | RFC 0022 §A / HVMAP-1b — child workflow for the dispatch output-mapping scenario. Declares `childOutcome.defaultValue='done'`; on terminal, parent's `outputMapping` harvests `childOutcome → parentResult`. | `completed` | ≤ 5s |
|
|
76
|
+
| Dispatch Cross-Worker Handoff (child-a) | `conformance-dispatch-cross-worker-handoff-child-a` | RFC 0022 §A / HVMAP-1c — first child of the cross-worker-handoff scenario. Declares `output.defaultValue='hello'`; on terminal, parent's `perWorkerOutputMappings.child-a` harvests `output → sharedVar`. | `completed` | ≤ 5s |
|
|
77
|
+
| Dispatch Cross-Worker Handoff (child-b) | `conformance-dispatch-cross-worker-handoff-child-b` | RFC 0022 §A + §D / HVMAP-1c — second child of the cross-worker-handoff scenario. Sequential fan-out — runs after child-a; receives parent's `sharedVar` via `perWorkerInputMappings.child-b` onto its `input` input. Scenario reads child-b's `inputs_json` to assert `inputs.input === 'hello'`. | `completed` | ≤ 5s |
|
|
78
|
+
| Dispatch Input Mapping — unset variant | `conformance-dispatch-input-mapping-no-default` | RFC 0022 §A / HVMAP-1a-null — parent variant that DECLARES `parentName` but OMITS its `defaultValue`. The dispatch's `inputMapping` projects an unset parent variable; per §A normative bullet, child `inputs.childGreeting` MUST surface as `undefined` (NOT `null`, NOT omitted). Reuses `conformance-dispatch-input-mapping-child`. | `completed` | ≤ 30s |
|
|
79
|
+
| subWorkflow Input Mapping — unset variant | `conformance-subworkflow-input-mapping-no-default` | RFC 0022 §B / HVMAP-2-unset — parent variant that DECLARES `currentPrdId` but OMITS its `defaultValue`. Per §B, the unset projection MUST surface as `undefined` (NOT `null`) — distinct from the child's own `defaultValue` fold. Reuses `conformance-subworkflow-input-mapping-child`. | `completed` | ≤ 10s |
|
|
80
|
+
| Dispatch Per-Worker Mapping Override | `conformance-dispatch-per-worker-override` | RFC 0022 §A / HVMAP-1c-override — parent with BOTH a default `inputMapping` (`{ input: 'defaultX' }`) AND `perWorkerInputMappings.child-b: { input: 'sharedVar' }`. Verifies `effectiveInputMapping` precedence per §A: child-a receives the default, child-b receives the override. Reuses `conformance-dispatch-cross-worker-handoff-child-a` + `-child-b`. | `completed` | ≤ 30s |
|
|
81
|
+
| Dispatch deterministic-fail child | `conformance-dispatch-deterministic-fail-child` | RFC 0022 §B / HVMAP-1b-failed — child workflow that ALWAYS terminates `failed` via `core.fail`. Used by `conformance-dispatch-output-mapping` to verify the parent's `outputMapping` is SKIPPED when the child fails terminally. | `failed` | ≤ 5s |
|
|
82
|
+
| Dispatch cancellable child | `conformance-dispatch-cancellable-child` | RFC 0022 §B / HVMAP-1b-cancelled — child workflow with a long `core.delay` so the test cancels it externally via `POST /v1/runs/{childRunId}/cancel`. Verifies the parent's `outputMapping` is SKIPPED when the child terminates `cancelled`. | `cancelled` | ≤ 60s |
|
|
67
83
|
| Agent Memory Round-Trip | `conformance-agent-memory-roundtrip` | Phase 3 — `MemoryAdapter.list/get` write → read | `completed` | ≤ 15s |
|
|
68
84
|
| Agent Memory Cross-Tenant | `conformance-agent-memory-cross-tenant` | Phase 3 / CTI-1 — cross-tenant probe MUST return `[]` / `null` | `completed` | ≤ 10s |
|
|
69
85
|
| Agent Memory Redaction | `conformance-agent-memory-redaction` | Phase 3 / SR-1 — BYOK plaintext surfaces as `[REDACTED:<id>]` on read | `completed` | ≤ 15s |
|
package/package.json
CHANGED
package/schemas/README.md
CHANGED
|
@@ -6,11 +6,17 @@
|
|
|
6
6
|
|---|---|---|
|
|
7
7
|
| `agent-manifest.schema.json` | `node-packs.md` + agent-pack RFCs | Agent manifest entries distributed alongside node-pack manifests |
|
|
8
8
|
| `agent-ref.schema.json` | `agent-memory.md` + agent-identity RFC | Multi-Agent Shift Phase 1 — slim runtime AgentRef projection carried on `RunSnapshot.agent` / `runOrchestrator`, `WorkflowNode.agent?`, and `agent.*` event payloads |
|
|
9
|
+
| `ai-envelope.schema.json` | `ai-envelope.md` | FINAL v1.1 — inbound LLM-emission envelope. Top-level shape (`type` / `schemaVersion` / `envelopeId` / `correlationId` / `payload` / `meta` / `partial`). Per-kind payload schemas under `envelopes/`. Distinct from `RunEventDoc` (outbound) and `error-envelope.schema.json` (host HTTP errors). |
|
|
10
|
+
| `envelopes/clarification.request.schema.json` | `ai-envelope.md` §"Universal kinds" | FINAL v1.1 — payload for the universal `clarification.request` kind; engine lifts to `kind: "clarification"` `InterruptPayload`. |
|
|
11
|
+
| `envelopes/schema.request.schema.json` | `ai-envelope.md` §"Universal kinds" | FINAL v1.1 — LLM asks the engine for a kind's JSON Schema. Counts against `Capabilities.limits.schemaRounds`. |
|
|
12
|
+
| `envelopes/schema.response.schema.json` | `ai-envelope.md` §"Universal kinds" | FINAL v1.1 — side-channel ack for `schema.request`. Never surfaces to users. |
|
|
13
|
+
| `envelopes/error.schema.json` | `ai-envelope.md` §"Universal kinds" | FINAL v1.1 — LLM's deliberate error report. Distinct from `error-envelope.schema.json` (host HTTP errors). |
|
|
9
14
|
| `audit-verify-result.schema.json` | `auth-profiles.md` §`openwop-audit-log-integrity` | Response payload from `GET /v1/audit/verify` — chain-validity verdict + checkpoints + anomalies |
|
|
10
15
|
| `capabilities.schema.json` | `capabilities.md` | `/.well-known/openwop` response — protocolVersion + supportedEnvelopes + schemaVersions + limits + optional v1 discovery surface |
|
|
11
16
|
| `channel-written-payload.schema.json` | `channels-and-reducers.md` §Channel write event | Payload of the `channel.written` RunEvent — write input + reducer name |
|
|
12
17
|
| `conversation-event.schema.json` | `channels-and-reducers.md` + conversation RFC | Multi-turn conversation event shape for orchestrator-driven HITL flows |
|
|
13
18
|
| `conversation-turn.schema.json` | `channels-and-reducers.md` + conversation RFC | Conversation turn shape for user/agent/system messages |
|
|
19
|
+
| `core-conformance-mock-agent-config.schema.json` | `node-packs.md` + RFC 0023 | Config shape for the conformance-only `core.conformance.mock-agent` typeId — drives `agent.*` event emission on cue (`mockReasoning` / `mockToolCalls` / `mockHandoff` / `mockDecision` / `mockConfidence`). Hosts MUST refuse this typeId for production tenants unless `capabilities.conformance.mockAgent` is advertised. |
|
|
14
20
|
| `debug-bundle.schema.json` | `debug-bundle.md` | Portable run diagnostic export from `GET /v1/runs/{runId}/debug-bundle` |
|
|
15
21
|
| `dispatch-config.schema.json` | `node-packs.md` + dispatch RFC | Configuration shape for `core.dispatch` / sub-workflow routing |
|
|
16
22
|
| `error-envelope.schema.json` | `rest-endpoints.md` + `auth.md` | Canonical `{error, message, details?}` shape returned on every non-2xx |
|
|
@@ -27,6 +33,7 @@
|
|
|
27
33
|
| `run-snapshot.schema.json` | `rest-endpoints.md` §RunSnapshot | Projected run state from `GET /v1/runs/{runId}` |
|
|
28
34
|
| `security-advisory.schema.json` | `registry-operations.md` + INCIDENT-RESPONSE runbook | Registry-owned CVE advisory record at `registry/security/advisories.json`. One entry per disclosed vulnerability — id, severity, affected pack-name + SemVer range, optional fixedIn/advisoryUrl/credits. Enforced by `check-advisories.mjs` in `.github/workflows/registry-publish.yml`. |
|
|
29
35
|
| `suspend-request.schema.json` | `interrupt.md` | `InterruptPayload` with 8 `kind` discriminators (approval, clarification, external-event, custom, conversation.start, conversation.exchange, conversation.close, low-confidence) |
|
|
36
|
+
| `workflow-chain-pack-manifest.schema.json` | `workflow-chain-packs.md` + RFC 0013 | Manifest for workflow-chain packs (`kind: "workflow-chain"`) — pre-configured DAG fragments expanded inline at workflow-author time. Peer to `node-pack-manifest.schema.json`; disjoint via the `kind` discriminator. |
|
|
30
37
|
| `workflow-definition.schema.json` | `channels-and-reducers.md` + `node-packs.md` | DAG of nodes + edges + triggers + variables + channels |
|
|
31
38
|
|
|
32
39
|
## Validating against the schemas
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "string",
|
|
11
11
|
"minLength": 3,
|
|
12
12
|
"maxLength": 256,
|
|
13
|
-
"description": "Globally-unique agent identifier. Naming convention mirrors `node-packs.md` §Naming — `<tier>.<org>.<pack>.<agent>` for vendor/community packs (`vendor.acme.support.tier1`); `core.<name>` for spec-canonical agents (`core.chat`, `core.research`); `host:<id>` slim-runtime form for host-internal AgentRefs that don't ship as packs. Host-internal `host:<id>` agents are valid AgentRefs at the wire level but MUST NOT be published as manifests (the `host:` namespace is reserved for runtime synthesis)."
|
|
13
|
+
"description": "Globally-unique agent identifier. Naming convention mirrors `node-packs.md` §Naming — `<tier>.<org>.<pack>.<agent>` for vendor/community packs (`vendor.acme.support.tier1`); `core.<name>` for spec-canonical agents (`core.chat`, `core.research`); `host:<id>` slim-runtime form for host-internal AgentRefs that don't ship as packs. Host-internal `host:<id>` agents are valid AgentRefs at the wire level but MUST NOT be published as manifests (the `host:` namespace is reserved for runtime synthesis). External-identity-system compatibility (STD-4): hosts MAY map an `agentId` to a W3C DID, an A2A AgentCard URL, an AGNTCY gateway identifier, or other external identity primitive via host-internal mapping tables. The external identifier MUST NOT be embedded as the wire-level `agentId` (doing so would force resolver dependencies on every consumer); carry it under vendor metadata or as the `host:<scheme>:<id>` form. See `spec/v1/agent-ref-positioning.md` §\"Composition rules\" for the recommended mapping conventions."
|
|
14
14
|
},
|
|
15
15
|
"name": {
|
|
16
16
|
"type": "string",
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://openwop.dev/spec/v1/ai-envelope.schema.json",
|
|
4
|
+
"title": "AIEnvelope",
|
|
5
|
+
"description": "Canonical inbound wire format for a typed, structured emission produced by an LLM during workflow execution. Distinct from `RunEventDoc` (which is the outbound run event log envelope). Per `spec/v1/ai-envelope.md`. The top-level shape is closed (`additionalProperties: false`); the `payload` shape is selected by the `type` discriminator and validated against a per-kind schema at `schemas/envelopes/{type}.schema.json` (universals) or a host-published vendor location. Hosts advertise the kind catalog via `Capabilities.supportedEnvelopes` and the per-kind active version via `Capabilities.schemaVersions`. Status: FINAL v1.1 (promoted 2026-05-18 via RFC 0021).",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["type", "envelopeId", "correlationId", "payload", "meta"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"type": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"minLength": 1,
|
|
12
|
+
"maxLength": 256,
|
|
13
|
+
"description": "Discriminator for payload shape, kind routing, and Envelope Contract gate. Universal kinds (always allowed): `clarification.request`, `schema.request`, `schema.response`, `error`. Vendor kinds MUST be namespaced per `spec/v1/host-extensions.md` (e.g., `vendor.myndhyve.prd.create`). Pre-v1.x unnamespaced kinds (`prd.create`, `theme.create`, `tasks.create`) MAY appear in `Capabilities.supportedEnvelopes` for backward compatibility; v1.x hosts SHOULD prefer the namespaced form."
|
|
14
|
+
},
|
|
15
|
+
"schemaVersion": {
|
|
16
|
+
"type": "integer",
|
|
17
|
+
"minimum": 0,
|
|
18
|
+
"description": "Per-kind schema version. Absent → treat as 0. Matched against `Capabilities.schemaVersions[type]`. When the emitted version is lower than the advertised floor, engines under `envelopeStrictness: 'warn'` (default) MUST attempt validation against the advertised version and log `envelope_schema_version_drift`; engines under `envelopeStrictness: 'strict'` MUST refuse with `unknown_schema_version`. When higher than advertised, engines MUST refuse regardless of strictness."
|
|
19
|
+
},
|
|
20
|
+
"envelopeId": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"maxLength": 128,
|
|
24
|
+
"description": "Globally unique envelope id. Generated by the engine if absent on receipt; consumers MUST treat as opaque. Distinct from `correlationId` (which is the dedup/replay key)."
|
|
25
|
+
},
|
|
26
|
+
"correlationId": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"minLength": 1,
|
|
29
|
+
"maxLength": 128,
|
|
30
|
+
"description": "Caller-stable identifier for dedup, replay short-circuit, and causal chaining. Two envelopes in the same run with the same `correlationId` MUST be treated as a re-emission (engine returns the cached outcome). Same-`correlationId` envelopes with different `type` values MUST be refused with `envelope_correlation_conflict`. The engine propagates `correlationId` onto resulting `RunEventDoc.causationId`. Recommended construction: `${runId}:${nodeId}:${turnIndex}:${kindHash}`."
|
|
31
|
+
},
|
|
32
|
+
"nodeId": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"minLength": 1,
|
|
35
|
+
"maxLength": 128,
|
|
36
|
+
"description": "Set when the emitting node is identifiable. Lifted to top-level for per-node projection without payload coercion (mirrors `RunEventDoc.nodeId`). Engines MAY populate from execution context when absent."
|
|
37
|
+
},
|
|
38
|
+
"payload": {
|
|
39
|
+
"description": "Discriminated payload. Shape selected by `type`. Validated against the per-kind schema at `schemas/envelopes/{type}.schema.json` (universals) or a host-published vendor schema. Top-level accepts any JSON value because per-kind schemas vary; strict validation is per-kind, not at this layer.",
|
|
40
|
+
"type": ["object", "array", "string", "number", "boolean", "null"]
|
|
41
|
+
},
|
|
42
|
+
"meta": {
|
|
43
|
+
"$ref": "#/$defs/EnvelopeMeta"
|
|
44
|
+
},
|
|
45
|
+
"partial": {
|
|
46
|
+
"$ref": "#/$defs/PartialInfo"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"additionalProperties": false,
|
|
50
|
+
"$defs": {
|
|
51
|
+
"EnvelopeMeta": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"required": ["source", "ts"],
|
|
54
|
+
"properties": {
|
|
55
|
+
"source": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"enum": ["ai-generation", "user", "system"],
|
|
58
|
+
"description": "Provenance of this emission. `ai-generation` — LLM emitted this in a node turn. `user` — relayed from a user action (form fill, approval gate). `system` — engine-synthesized (e.g., resume value normalization). Gates approval-flow re-routing per `ai-envelope.md` §\"Source attribution\" (LLM-generated mutations route through approval gates; user-supplied mutations bypass them when the user is already authenticated)."
|
|
59
|
+
},
|
|
60
|
+
"contentTrust": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"enum": ["trusted", "untrusted"],
|
|
63
|
+
"description": "Trust tag mirroring `RunEventDoc.contentTrust`. Hosts MUST set `untrusted` when the payload origin is an MCP tool result per `mcp-integration.md` or an A2A inbound message per `a2a-integration.md`. The engine MUST propagate this onto any `RunEventDoc` emitted as a consequence of the envelope. Approval gates MUST refuse to advance on `untrusted` envelopes (refusal code `untrusted_content_blocks_approval`)."
|
|
64
|
+
},
|
|
65
|
+
"ts": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"format": "date-time",
|
|
68
|
+
"description": "ISO 8601 UTC timestamp of emission."
|
|
69
|
+
},
|
|
70
|
+
"traceparent": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"description": "Optional W3C trace-context value (`traceparent` header format) for distributed tracing propagation. Engines that export OTel spans for envelope acceptance SHOULD honor this value as the parent span when present."
|
|
73
|
+
},
|
|
74
|
+
"label": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"maxLength": 256,
|
|
77
|
+
"description": "Optional human-readable label for ops dashboards (e.g., `\"Draft PRD #2\"`). Never used for routing; never persisted into event payloads in a security-relevant way. (in-flight)"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"additionalProperties": false,
|
|
81
|
+
"description": "Wire metadata. See `spec/v1/ai-envelope.md` §EnvelopeMeta."
|
|
82
|
+
},
|
|
83
|
+
"PartialInfo": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"required": ["isPartial", "index", "total"],
|
|
86
|
+
"properties": {
|
|
87
|
+
"isPartial": {
|
|
88
|
+
"type": "boolean",
|
|
89
|
+
"description": "True for all chunks of a partial emission EXCEPT the final one. The final chunk carries `isPartial: false` and signals reassembly completion. (in-flight)"
|
|
90
|
+
},
|
|
91
|
+
"index": {
|
|
92
|
+
"type": "integer",
|
|
93
|
+
"minimum": 0,
|
|
94
|
+
"description": "0-indexed chunk position. (in-flight)"
|
|
95
|
+
},
|
|
96
|
+
"total": {
|
|
97
|
+
"type": "integer",
|
|
98
|
+
"minimum": -1,
|
|
99
|
+
"description": "Total expected chunks. -1 when unknown (streaming without precount). (in-flight)"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"additionalProperties": false,
|
|
103
|
+
"description": "Present when the envelope is one fragment of a streamed emission. Cross-transport reassembly is open (see gap E1 in `ai-envelope.md`)."
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|