@runeditrun/rer 0.2.85 → 0.2.87
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/README.md +138 -29
- package/cli/README.md +61 -1
- package/cli/agent-bindings.mjs +25 -0
- package/cli/agent-door.mjs +145 -0
- package/cli/agent-fixtures.mjs +16 -0
- package/cli/agent-journey-fixtures.mjs +17 -0
- package/cli/agent-mail.mjs +54 -0
- package/cli/agent-network.mjs +64 -0
- package/cli/agent-reviewers.mjs +110 -0
- package/cli/agent-rpc.mjs +23 -0
- package/cli/agent-secrets.mjs +23 -0
- package/cli/agent-sponsors.mjs +43 -0
- package/cli/agent-surface.mjs +34 -0
- package/cli/agent-verifier.mjs +31 -0
- package/cli/agent-webhooks.mjs +19 -0
- package/cli/authoring.mjs +2 -1
- package/cli/business/archive-task.mjs +32 -0
- package/cli/business/carry.mjs +3 -1
- package/cli/business/catchup-task.mjs +42 -0
- package/cli/business/choices.mjs +97 -0
- package/cli/business/command.mjs +23 -5
- package/cli/business/connect.mjs +19 -7
- package/cli/business/detector.mjs +4 -1
- package/cli/business/device.mjs +13 -0
- package/cli/business/export-inputs.mjs +69 -0
- package/cli/business/export-task.mjs +17 -0
- package/cli/business/invocation.mjs +8 -1
- package/cli/business/keychain.mjs +8 -1
- package/cli/business/lease.mjs +11 -1
- package/cli/business/local-commands.mjs +79 -31
- package/cli/business/outbound.mjs +9 -4
- package/cli/business/parsers-config.mjs +8 -7
- package/cli/business/parsers-syntax.mjs +7 -3
- package/cli/business/permissions.mjs +2 -0
- package/cli/business/questions.mjs +89 -9
- package/cli/business/setup-command.mjs +49 -0
- package/cli/business/setup-company.json +15 -0
- package/cli/business/setup-demo.mjs +95 -0
- package/cli/business/state.mjs +44 -10
- package/cli/business/supervisor.mjs +94 -35
- package/cli/business/vendor-door.mjs +230 -0
- package/cli/business/vendors/README.md +29 -3
- package/cli/business/vendors/common.mjs +8 -6
- package/cli/business/vendors/index.mjs +22 -11
- package/cli/business/vendors/sorry.mjs +106 -0
- package/cli/contract.mjs +2 -2
- package/cli/demo-deploy-error.mjs +14 -0
- package/cli/demo-native.mjs +4 -1
- package/cli/deploy-config.mjs +1 -1
- package/cli/deploy-owner-input.mjs +3 -1
- package/cli/deploy-variables.mjs +89 -0
- package/cli/door-clauses.mjs +157 -0
- package/cli/export.mjs +17 -4
- package/cli/hosted-output.mjs +31 -8
- package/cli/inspect.mjs +4 -0
- package/cli/jsonc.mjs +8 -4
- package/cli/lifecycle.mjs +3 -1
- package/cli/main.mjs +1 -0
- package/cli/managed-data-schema.mjs +14 -1
- package/cli/managed-data.mjs +8 -4
- package/cli/portability-empty.mjs +6 -0
- package/cli/portability-migrations.mjs +26 -4
- package/cli/portability-worker.mjs +2 -1
- package/cli/portability.mjs +1 -0
- package/cli/production-auth.mjs +2 -2
- package/cli/production-mail.mjs +19 -3
- package/cli/server-registry.mjs +2 -0
- package/edition-authoring/archive-source.mjs +65 -0
- package/edition-authoring/base-copies.mjs +108 -21
- package/edition-authoring/cli.mjs +1 -1
- package/edition-authoring/copy-namespaces.mjs +28 -0
- package/edition-authoring/edition-migrations.mjs +7 -3
- package/edition-authoring/files.mjs +2 -1
- package/edition-authoring/module-closure.mjs +58 -27
- package/edition-authoring/module-edges.mjs +13 -2
- package/edition-authoring/workflow-copies.mjs +1 -1
- package/edition-authoring/workflow-scripts.mjs +12 -3
- package/foundation/runtime/contract-docs.mjs +220 -32
- package/foundation/runtime/contract-prose-patterns.mjs +14 -0
- package/foundation/runtime/contract-prose.mjs +88 -0
- package/global/CHANGELOG.md +151 -0
- package/global/README.md +138 -29
- package/global/door/command.mjs +3 -1
- package/global/main.mjs +1 -1
- package/modules/agent-door/CLAUSES.md +215 -0
- package/modules/agent-door/conformance/audit-pages.mjs +11 -0
- package/modules/agent-door/conformance/audit-rows.mjs +20 -0
- package/modules/agent-door/conformance/audit.mjs +63 -0
- package/modules/agent-door/conformance/authority.d.mts +2 -0
- package/modules/agent-door/conformance/authority.mjs +17 -0
- package/modules/agent-door/conformance/crypto.mjs +36 -0
- package/modules/agent-door/conformance/discovery.mjs +61 -0
- package/modules/agent-door/conformance/fixtures.mjs +41 -0
- package/modules/agent-door/conformance/index.mjs +41 -0
- package/modules/agent-door/conformance/injection.mjs +24 -0
- package/modules/agent-door/conformance/invocation.mjs +33 -0
- package/modules/agent-door/conformance/journey.mjs +117 -0
- package/modules/agent-door/conformance/narrowing.d.mts +2 -0
- package/modules/agent-door/conformance/narrowing.mjs +29 -0
- package/modules/agent-door/conformance/negative.mjs +48 -0
- package/modules/agent-door/conformance/network-modules.mjs +86 -0
- package/modules/agent-door/conformance/network-runtime.mjs +46 -0
- package/modules/agent-door/conformance/policy-phases.mjs +83 -0
- package/modules/agent-door/conformance/protocol.mjs +153 -0
- package/modules/agent-door/conformance/replay.mjs +39 -0
- package/modules/agent-door/conformance/schema.mjs +71 -0
- package/modules/agent-door/conformance/security.mjs +34 -0
- package/modules/agent-door/conformance/sponsors.mjs +68 -0
- package/modules/agent-door/conformance/step-hooks.mjs +4 -0
- package/modules/agent-door/conformance/surface.mjs +92 -0
- package/modules/agent-door/conformance/target.mjs +19 -0
- package/modules/agent-door/conformance/tool-name.d.mts +1 -0
- package/modules/agent-door/conformance/tool-name.mjs +7 -0
- package/modules/agent-door/conformance/webhooks.mjs +31 -0
- package/modules/container/image-variables.mjs +8 -2
- package/modules/delivery-producer/mail.mjs +20 -0
- package/modules/demo-host/README.md +6 -0
- package/modules/demo-host/ownership.mjs +39 -0
- package/modules/demo-host/plan.mjs +2 -1
- package/modules/demo-host/remove.mjs +6 -1
- package/modules/import-kit/schema/importer-verification-receipt.schema.json +171 -0
- package/modules/import-kit/schema/importers.schema.json +107 -0
- package/modules/import-kit/src/door/ADOPTING.md +20 -0
- package/modules/import-kit/src/door/README.md +2 -1
- package/modules/import-kit/src/door/admission.ts +5 -3
- package/modules/import-kit/src/door/archive.ts +5 -2
- package/modules/import-kit/src/door/authority.ts +1 -0
- package/modules/import-kit/src/door/grants.ts +1 -1
- package/modules/import-kit/src/door/handler.ts +14 -8
- package/modules/import-kit/src/door/index.ts +1 -1
- package/modules/import-kit/src/door/jobs.ts +40 -0
- package/modules/import-kit/src/door/operator.ts +3 -3
- package/modules/import-kit/src/door/planning.ts +10 -6
- package/modules/import-kit/src/door/protocol.ts +2 -2
- package/modules/import-kit/src/door/raw.ts +25 -0
- package/modules/import-kit/src/door/refusals.ts +1 -0
- package/modules/import-kit/src/door/types.ts +26 -6
- package/modules/import-kit/src/receipt/encoding.ts +37 -0
- package/modules/import-kit/src/receipt/index.ts +69 -0
- package/modules/import-kit/src/receipt/policy.ts +24 -0
- package/modules/import-kit/src/receipt/types.ts +64 -0
- package/modules/import-kit/src/receipt/uri.ts +45 -0
- package/modules/import-kit/src/receipt/validation.ts +87 -0
- package/modules/import-kit/src/status/encoding.ts +13 -0
- package/modules/import-kit/src/status/evidence.ts +218 -0
- package/modules/import-kit/src/status/index.ts +56 -0
- package/modules/import-kit/src/status/schema.ts +208 -0
- package/modules/import-kit/src/status/types.ts +86 -0
- package/modules/operator-auth/accounts/delegated.mjs +48 -0
- package/modules/operator-auth/index.d.mts +7 -0
- package/modules/operator-auth/service.mjs +2 -0
- package/modules/portability/README.md +37 -13
- package/modules/portability/bridge.mjs +22 -2
- package/modules/portability/catalogue.mjs +12 -2
- package/modules/portability/copies.mjs +8 -1
- package/modules/portability/derived.mjs +33 -0
- package/modules/portability/http-errors.mjs +1 -1
- package/modules/portability/import.mjs +14 -7
- package/package.json +4 -2
- package/scripts/publish-check/copy_identities.py +3 -1
- package/scripts/publish-check/github_refs.py +32 -13
- package/cli/business/opt-ins.mjs +0 -37
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Base-delivered agent clauses
|
|
2
|
+
|
|
3
|
+
This is the canonical acceptance text for BASE-AGENT-001 through BASE-AGENT-013.
|
|
4
|
+
`rer door clauses --write` synchronizes these clauses into a seed's CONTRACT.md.
|
|
5
|
+
The seed owns its SURFACE- and AGENT- clauses and its judgments: adding these
|
|
6
|
+
requirements proves no implementation. New Status rows start missing; later
|
|
7
|
+
syncs retain the seed's status, evidence and gap, including a newer judgment.
|
|
8
|
+
MCP method names below use spaced slashes; wire names omit those spaces.
|
|
9
|
+
|
|
10
|
+
## Target clauses
|
|
11
|
+
|
|
12
|
+
### Agent surface (Base-delivered)
|
|
13
|
+
|
|
14
|
+
#### BASE-AGENT-001 — One MCP door per seed
|
|
15
|
+
|
|
16
|
+
*Tier:* Agent surface
|
|
17
|
+
|
|
18
|
+
**Requirement.** Every seed, hosted or self-hosted, serves one remote MCP endpoint at `/mcp` over Streamable HTTP. It speaks the current revision (2026-07-28) and accepts 2025-11-25 clients through the twelve-month deprecation window. It implements `server / discover`, tools, resources and prompts. Lists are deterministic and carry `ttlMs` and `cacheScope: "private"`. Roots, Sampling and Logging are not served.
|
|
19
|
+
|
|
20
|
+
**Acceptance.**
|
|
21
|
+
1. `server / discover` returns the supported versions, capabilities, `serverInfo` and instructions.
|
|
22
|
+
2. A 2026-07-28 request works with no handshake, and a 2025-11-25 client completes `initialize` and lists the same tools.
|
|
23
|
+
3. An unsupported version returns `UnsupportedProtocolVersion`.
|
|
24
|
+
4. Two `tools / list` calls return the same order, with cache fields.
|
|
25
|
+
5. A foreign Origin returns 403, and a header and body method mismatch returns `HeaderMismatch`.
|
|
26
|
+
6. An oversized body returns 413 with no effect.
|
|
27
|
+
|
|
28
|
+
#### BASE-AGENT-002 — The seed's jobs are tools, through the UI's own actions
|
|
29
|
+
|
|
30
|
+
*Tier:* Agent surface
|
|
31
|
+
|
|
32
|
+
**Requirement.** Each Core job a person does in the product is a tool. Where one is not, the Agent surface says why: it runs on a device, it is a person's interactive screen, it belongs to a connector or the import door, or it is an installation fact. Risk is never the reason: a risky job is a tool with its class (BASE-AGENT-006). Tools are named `<seed>.<area>.<verb>` and declare input and output schemas and truthful annotations. Each calls the same server action as the UI, so validation and authorization are written once, and the seed's embedded agents use the same registry. A business refusal returns `isError` with the seed's stable error code.
|
|
33
|
+
|
|
34
|
+
**Acceptance.**
|
|
35
|
+
1. The Core clause ids in each tool's `_meta`, with the not-a-tool reasons that `server / discover` serves, cover every Core clause in the contract, and no reason is risk; the harness and `rer check` fail on a gap.
|
|
36
|
+
2. Each tool's fixture result validates against its `outputSchema`.
|
|
37
|
+
3. Read tools declare `readOnlyHint`; tools that can carry destructive declare `destructiveHint`, and tools that can carry external declare `openWorldHint`.
|
|
38
|
+
4. A refusal returns the same error code the UI gets for the same action.
|
|
39
|
+
5. The UI action and its tool, on the same fixture, give the same record state and the same audit event type.
|
|
40
|
+
6. The seed's embedded agents appear in the audit as calls to the same tools.
|
|
41
|
+
|
|
42
|
+
#### BASE-AGENT-003 — Records are resources
|
|
43
|
+
|
|
44
|
+
*Tier:* Agent surface
|
|
45
|
+
|
|
46
|
+
**Requirement.** Each primary record type has a URI template, and tools return `resource_link`s to the records they touch. A read returns exactly the fields the caller's role sees in the UI. File bytes count against any byte budget on the grant. A record the caller cannot open reads as not found, identical to a missing id. Text from customers, imports or files carries an untrusted marker in `_meta`.
|
|
47
|
+
|
|
48
|
+
**Acceptance.**
|
|
49
|
+
1. `resources / templates / list` names every record type in the Agent surface.
|
|
50
|
+
2. Reads as two roles return exactly what the UI shows each.
|
|
51
|
+
3. An out-of-scope id and a missing id give identical responses.
|
|
52
|
+
4. A write's `resource_link` reads back the new state.
|
|
53
|
+
5. Bytes over budget return `budget_exhausted` and no partial content.
|
|
54
|
+
6. Customer-sourced text carries the untrusted marker.
|
|
55
|
+
|
|
56
|
+
#### BASE-AGENT-004 — Business identity and short-lived, audience-bound tokens
|
|
57
|
+
|
|
58
|
+
*Tier:* Agent surface
|
|
59
|
+
|
|
60
|
+
**Requirement.** The door is an OAuth 2.1 resource server. Its RFC 9728 metadata names the authorization servers this installation trusts. That is the paired Business when Business provisioned it, verified with the owner-claim trust the installation already holds for its import door; otherwise it is the seed's own sign-in. Access tokens are RFC 9068 JWTs with `aud` set to the seed's canonical MCP URI, `sub` the sponsoring person, `act` the agent (RFC 8693) with its specialist, scopes per tool family, and a lifetime of 15 minutes or less (5 by default). The policy scopes rules on the sponsor, agent and specialist the token names. The consent behind the tokens can last longer and is revocable. Tokens travel only in the Authorization header, and there is no passthrough.
|
|
61
|
+
|
|
62
|
+
**Acceptance.**
|
|
63
|
+
1. An unauthenticated call returns 401 with `resource_metadata`, and the metadata names the trusted servers and scopes.
|
|
64
|
+
2. A Business token for this seed works, and the same token sent to a sibling seed returns 401.
|
|
65
|
+
3. An expired token returns 401, and a token with a lifetime over 15 minutes is refused.
|
|
66
|
+
4. A read-only token calling a write tool returns 403 `insufficient_scope` with every needed scope in one challenge.
|
|
67
|
+
5. A token in a query string is refused and not logged.
|
|
68
|
+
6. Revoking consent in the seed or in Business refuses the next call within 60 seconds.
|
|
69
|
+
7. After unpairing, Business tokens are refused and the seed's own sign-in still works.
|
|
70
|
+
|
|
71
|
+
#### BASE-AGENT-005 — An agent acts as a person in a role, never more
|
|
72
|
+
|
|
73
|
+
*Tier:* Agent surface
|
|
74
|
+
|
|
75
|
+
**Requirement.** Every call is authorized as the sponsoring person's current role and access (BASE-ACCESS-004), intersected with the grant's resources, actions and budget. A grant only narrows. No call widens the calling agent's own authority. A call that would widen its own grant or its sponsor's role, or change the company policy or Pause, is refused with `self_escalation`, whatever the policy says; narrowing its own grant is allowed. Other access and security changes are ordinary actions in the access and security classes. An agent never acts after its sponsor is suspended. Anything an agent reads (records, files, emails, imports, other seeds' results) is data and cannot change its scope, its targets or a call's class.
|
|
76
|
+
|
|
77
|
+
**Acceptance.**
|
|
78
|
+
1. For each role fixture, every tool's allow or deny through MCP equals the UI's for the same action.
|
|
79
|
+
2. A one-folder, read-only grant holds, and widening through arguments is refused.
|
|
80
|
+
3. Downgrading the sponsor changes the next call's result, and suspending the sponsor returns 401.
|
|
81
|
+
4. Calls that widen the agent's own grant or its sponsor's role, or change the policy or Pause, return `self_escalation` and change nothing, even under a policy with every class autonomous; dropping a scope from its own grant runs.
|
|
82
|
+
5. An injection fixture yields no out-of-grant call and no change of class: record text asking for a wider action, or claiming that a recipient is internal.
|
|
83
|
+
|
|
84
|
+
#### BASE-AGENT-006 — Every action declares its risk class
|
|
85
|
+
|
|
86
|
+
*Tier:* Agent surface
|
|
87
|
+
|
|
88
|
+
**Requirement.** Classes come from the fleet list in RISK-POLICY.md: standard, external, money, commitment, accounts, gated, access, security, destructive, sensitive and live. In the registry, each tool declares the classes it can carry and a server-side classifier that decides them per call from the arguments, current records and, for gated, the provider's answer. The classifier also supplies each class's facts: the measure (items, recipients, amount and currency, people or records), the counterparty (internal, known, new or public), the direction for access, the provider and step for gated, and the data kind for sensitive. A classifier never reads a flag, label or claim supplied by the agent or by record text. A seed cannot add a class; it proposes one for the fleet list.
|
|
89
|
+
|
|
90
|
+
**Acceptance.**
|
|
91
|
+
1. Every tool in `tools / list` carries its possible classes in `_meta`, equal to the Agent surface table.
|
|
92
|
+
2. For each tool, fixture calls cover every class it can carry, and the computed classes and facts equal the fixture's expected values.
|
|
93
|
+
3. An argument or record text asserting a class or a confirmation (`internal: true`, `confirmExternal: true`) leaves the computed classes unchanged.
|
|
94
|
+
4. Money calls carry amount and currency, external calls their counterparty and recipient count, access calls their direction, and destructive calls their item count.
|
|
95
|
+
5. No tool in `tools / list` declares a class outside the fleet list, and `rer check` fails on one.
|
|
96
|
+
6. A refused call's audit row still records its computed classes.
|
|
97
|
+
|
|
98
|
+
#### BASE-AGENT-007 — The company's policy decides, at one chokepoint
|
|
99
|
+
|
|
100
|
+
*Tier:* Agent surface
|
|
101
|
+
|
|
102
|
+
**Requirement.** Every agent door calls one decision function: MCP, the integration API with agent tokens, and the seed's embedded agents. It evaluates the call's classes against the company's policy, as above. The seed ships no dispositions and fills no gap with one: agent access opens only under a complete policy that setup has asked for (RISK-POLICY.md), and before then every agent call returns `policy_unset` with the setup link and changes nothing. *Autonomous* runs the call. *Review* runs it and adds it to the review feed. *Approval* saves a pending action with server-computed facts and returns `input_required`, with a URL-mode elicitation to the seed's approval page and a pending handle. Each person the rule names approves the exact saved revision in a signed-in browser, and changed inputs need a new approval. The retried call returns the result and a receipt. A rejection returns `approval_rejected`, and a lapse past the wait the rule sets returns `approval_expired`. *Blocked* returns `policy_blocked`, naming the class, rule and revision.
|
|
103
|
+
|
|
104
|
+
**Acceptance.**
|
|
105
|
+
1. The Base harness runs each tool under each disposition for every class it can carry, and sees it run, run and enter the review feed, wait with no effect, or be refused.
|
|
106
|
+
2. Before setup is complete, the setup page lists every class the seed's tools carry with examples and no answer pre-selected, an agent call returns `policy_unset` with the setup link and changes nothing, and an incomplete revision cannot be confirmed; a `*` rule completes it, and a tool an upgrade adds with an unanswered class appears in `tools / list` once that class is answered, while the other tools keep running.
|
|
107
|
+
3. Under "money autonomous up to $500, approval up to $10,000, blocked above", calls of $400, $600 and $20,000 run, wait and are refused; a per-day cap sends the call that crosses it to the next rule.
|
|
108
|
+
4. A call carrying two classes takes the stricter disposition.
|
|
109
|
+
5. An approval shows server-computed facts and an expiry, returns the URL elicitation and a handle, and completes once after the named approver approves; a changed input needs a new approval, and a rejection or lapse leaves no effect.
|
|
110
|
+
6. The same call through MCP, the integration API and an embedded agent gets the same decision.
|
|
111
|
+
7. A policy change applies to the next call within 60 seconds, and the audit cites the new revision.
|
|
112
|
+
8. A policy document with a bad signature or another Business's id is rejected, and the door keeps the last valid revision.
|
|
113
|
+
|
|
114
|
+
#### BASE-AGENT-008 — Truthful attribution
|
|
115
|
+
|
|
116
|
+
*Tier:* Agent surface
|
|
117
|
+
|
|
118
|
+
**Requirement.** Every agent act is recorded and shown as `"<agent> for <person>"`, and mail and messages an agent sends outside name it that way as their sender. An approval, a review mark, a confirmation (a warning dialog, a typed-field confirmation, a delivery confirmation), a decision or a signature attributed to a person comes only from that person's signed-in session. When an agent does the equivalent act, the record names the agent, and the act carries its own class; a binding decision or a signature is commitment. Agent doors ignore arguments that stand for a person's confirmation. No tool solves a bot check, or enters a person's own password or 2FA code at an outside service. A provider step that demands a person goes to a person, whatever the policy says; the gated class marks such steps before they run.
|
|
119
|
+
|
|
120
|
+
**Acceptance.**
|
|
121
|
+
1. An agent call carrying a person-confirmation flag is classified and decided exactly as without it.
|
|
122
|
+
2. Approving, marking reviewed or answering a policy question with an agent or device token returns 403 and changes nothing.
|
|
123
|
+
3. A form-mode elicitation "accept" never completes an approval.
|
|
124
|
+
4. Where an agent's decision, signature or field confirmation runs without a person, it reads `"<agent> for <person>"` in the record, the activity view, exports and any certificate, never as the person's own act.
|
|
125
|
+
5. After a person approves an agent's prepared action, the record shows the person as approver and the agent as preparer.
|
|
126
|
+
6. Activity and exports at 1440 and 390 show `"<agent> for <person>"` for every agent act.
|
|
127
|
+
7. Mail an agent sends to an outside address names `"<agent> for <person>"` as its sender.
|
|
128
|
+
|
|
129
|
+
#### BASE-AGENT-009 — Every agent action is audited with its class and decision
|
|
130
|
+
|
|
131
|
+
*Tier:* Agent surface
|
|
132
|
+
|
|
133
|
+
**Requirement.** Extending BASE-OPS-005, each call that reads private data or changes anything records the agent client, name and specialist, and the run or task id (`traceparent` when sent); the sponsoring person, the grant, the tool and the targets; the classes and their facts, and the policy revision and rule; the decision (autonomous, review, approval, blocked, unset or self_escalation) and the outcome (done, refused, pending or failed); the approval or review id and person, and the idempotency key. For a period, the seed's Agents page shows actions by class and decision with the notable ones, the review feed (Mark reviewed, Flag, and Undo where reversible), pending approvals, steps waiting for a person and setup questions. Business shows the same across seeds.
|
|
134
|
+
|
|
135
|
+
**Acceptance.**
|
|
136
|
+
1. One write leaves a complete audit row.
|
|
137
|
+
2. Refused, pending, unset and self-escalation calls are audited.
|
|
138
|
+
3. The Agents page's counts by class and decision equal the audit rows on a fixture week.
|
|
139
|
+
4. The review feed lists exactly the calls decided as review; Mark reviewed records the person, and Undo restores a reversible one.
|
|
140
|
+
5. Filtering by agent or class lists only those rows, and export includes every field.
|
|
141
|
+
6. Removing the agent keeps its rows and its name.
|
|
142
|
+
7. The Agents page works at 1440 and 390 with no serious or critical axe findings.
|
|
143
|
+
|
|
144
|
+
#### BASE-AGENT-010 — Agents can follow changes
|
|
145
|
+
|
|
146
|
+
*Tier:* Agent surface
|
|
147
|
+
|
|
148
|
+
**Requirement.** The seed emits a typed event for every record change and for every approval, review and policy decision. Each event carries a stable id, a type, the record URI, the actor (a person, or an agent acting for a person) and a time. Events never carry secrets or more than the subscriber may read. Agents can read events three ways: `subscriptions / listen`, an `events.list` tool with a cursor, and signed webhooks from Base `integrations` using the same ids. Every channel delivers at least once and filters by access at delivery.
|
|
149
|
+
|
|
150
|
+
**Acceptance.**
|
|
151
|
+
1. A subscribed record changed in the UI produces a notification within 10 seconds.
|
|
152
|
+
2. `events.list` returns the same event id the webhook carries.
|
|
153
|
+
3. Replaying from a cursor returns the same ids in order.
|
|
154
|
+
4. After access is revoked, no channel delivers events about that record.
|
|
155
|
+
5. A failed webhook is visible and replays without duplicate effects.
|
|
156
|
+
6. `approval.pending`, `approval.decided`, `review.flagged` and `policy.adopted` carry the class and decision and nothing the subscriber may not read.
|
|
157
|
+
|
|
158
|
+
#### BASE-AGENT-011 — Limits are policy, and Pause stops everything
|
|
159
|
+
|
|
160
|
+
*Tier:* Agent surface
|
|
161
|
+
|
|
162
|
+
**Requirement.** Business limits are rules in the company's policy: per-call and per-day thresholds on any class's measure, such as money moved, outside recipients or items destroyed; spend caps on provider cost (models, SMS, email) per seed, specialist or agent, which setup asks with the classes; "no cap" is an answer. Tools with provider cost declare an estimate before they run, and an exhausted cap returns `budget_exhausted` before any partial effect. The seed's capacity limits (request rate, body and byte sizes) protect the installation: they bound rate and size, never daily business volume, are documented and are not policy. A grant carries budgets only when the person granting it sets them. A **Pause agents** control in the seed, and Pause all agents in Business when paired, refuses every agent token within 60 seconds until a person resumes; browser sessions and devices keep working.
|
|
163
|
+
|
|
164
|
+
**Acceptance.**
|
|
165
|
+
1. A rate overrun returns 429 with `Retry-After`.
|
|
166
|
+
2. A per-day cap of three outside recipients sends the fourth to the rule that applies past the cap.
|
|
167
|
+
3. An exhausted spend cap returns `budget_exhausted` with no partial effect and shows the spend.
|
|
168
|
+
4. Under the answer "no cap", a spending call runs and its spend shows in usage; a call that spends nothing is unaffected by any cap.
|
|
169
|
+
5. The usage view shows calls, decisions by class, money moved and provider spend per agent.
|
|
170
|
+
6. Pause and Pause all agents each stop the next call within 60 seconds, and resume restores access.
|
|
171
|
+
7. An agent token cannot resume.
|
|
172
|
+
|
|
173
|
+
#### BASE-AGENT-012 — Writes are idempotent and conflict-safe
|
|
174
|
+
|
|
175
|
+
*Tier:* Agent surface
|
|
176
|
+
|
|
177
|
+
**Requirement.** Every mutating tool requires an idempotency key and takes an optional expected revision. The same key with the same arguments returns the first outcome for at least 24 hours; the same key with different arguments returns `idempotency_conflict`; a stale revision returns `revision_conflict` with the current revision. Long work returns a job handle and a status tool, with no dependence on the Tasks extension.
|
|
178
|
+
|
|
179
|
+
**Acceptance.**
|
|
180
|
+
1. Two calls with one key give one effect and equal results.
|
|
181
|
+
2. A retry with a new JSON-RPC id and the same key, after a dropped stream, returns the recorded outcome.
|
|
182
|
+
3. The same key with different arguments returns a conflict and no effect.
|
|
183
|
+
4. A stale revision returns a conflict naming the current revision.
|
|
184
|
+
5. A job handle used by another person's token reads as not found.
|
|
185
|
+
|
|
186
|
+
#### BASE-AGENT-013 — Manifest, docs and the conformance journey
|
|
187
|
+
|
|
188
|
+
*Tier:* Agent surface
|
|
189
|
+
|
|
190
|
+
**Requirement.** `server / discover` instructions and an on-site `/docs/agents` page are generated from the action registry. The page lists tools by job, with each tool's classes, the test that adds each computed class, its scopes, resource templates, event types, capacity limits and error codes, and the specialist role. `prompts / list` carries the specialist's jobs. Base ships the conformance journey, a harness that `rer verify` runs against `rer dev` and seeds run in CI. It is an MCP client; a signed-in test person takes a person's steps (setup answers, approvals, review marks, resume) through the URLs the door returns, and the same browser leg runs the UI-parity actions and the page checks at 1440 and 390. It runs every acceptance point of BASE-AGENT-001 to 012 and of the seed's SURFACE clauses under two company policies: *all autonomous* (`*`), and *held* (standard review, every other class the seed declares approval, which the test person grants), plus the single-class variants a point names. A point that names no disposition passes under both.
|
|
191
|
+
|
|
192
|
+
**Acceptance.**
|
|
193
|
+
1. The docs list exactly the names in `tools / list` and `resources / templates / list`.
|
|
194
|
+
2. Each tool's classes, and the test behind each computed one, are documented.
|
|
195
|
+
3. The harness fails on any of: a tool without a schema; an effect under approval or blocked, or before setup is complete; a computed class that differs from its fixture; a flag that changes a class or completes a person's step; a role-parity mismatch; a wrong-audience token being accepted; a duplicate effect on retry.
|
|
196
|
+
4. Every acceptance point runs under both policies, every decision matches the policy in force, and under all autonomous no call waits for a person or is refused by policy.
|
|
197
|
+
5. A stranger agent given only the seed URL completes the specialist journey through MCP.
|
|
198
|
+
|
|
199
|
+
## Status
|
|
200
|
+
|
|
201
|
+
| Clause | Title | Kind | Status | Evidence | Gap |
|
|
202
|
+
| --- | --- | --- | --- | --- | --- |
|
|
203
|
+
| `BASE-AGENT-001` | One MCP door per seed | target | missing | | Not yet judged through this seed's own doors. |
|
|
204
|
+
| `BASE-AGENT-002` | The seed's jobs are tools, through the UI's own actions | target | missing | | Not yet judged through this seed's own doors. |
|
|
205
|
+
| `BASE-AGENT-003` | Records are resources | target | missing | | Not yet judged through this seed's own doors. |
|
|
206
|
+
| `BASE-AGENT-004` | Business identity and short-lived, audience-bound tokens | target | missing | | Not yet judged through this seed's own doors. |
|
|
207
|
+
| `BASE-AGENT-005` | An agent acts as a person in a role, never more | target | missing | | Not yet judged through this seed's own doors. |
|
|
208
|
+
| `BASE-AGENT-006` | Every action declares its risk class | target | missing | | Not yet judged through this seed's own doors. |
|
|
209
|
+
| `BASE-AGENT-007` | The company's policy decides, at one chokepoint | target | missing | | Not yet judged through this seed's own doors. |
|
|
210
|
+
| `BASE-AGENT-008` | Truthful attribution | target | missing | | Not yet judged through this seed's own doors. |
|
|
211
|
+
| `BASE-AGENT-009` | Every agent action is audited with its class and decision | target | missing | | Not yet judged through this seed's own doors. |
|
|
212
|
+
| `BASE-AGENT-010` | Agents can follow changes | target | missing | | Not yet judged through this seed's own doors. |
|
|
213
|
+
| `BASE-AGENT-011` | Limits are policy, and Pause stops everything | target | missing | | Not yet judged through this seed's own doors. |
|
|
214
|
+
| `BASE-AGENT-012` | Writes are idempotent and conflict-safe | target | missing | | Not yet judged through this seed's own doors. |
|
|
215
|
+
| `BASE-AGENT-013` | Manifest, docs and the conformance journey | target | missing | | Not yet judged through this seed's own doors. |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export async function auditRows(c) {
|
|
2
|
+
const rows = []; let cursor = null, differs = 0;
|
|
3
|
+
for (let page = 0; page < 100; page++) {
|
|
4
|
+
const result = await c.personJson(`/agents/api/audit?agent=${encodeURIComponent(c.agentId)}${cursor ? `&after=${encodeURIComponent(cursor)}` : ''}`);
|
|
5
|
+
if (!Array.isArray(result.rows) || !Number.isInteger(result.differs_from_policy)) throw new Error('Audit API must return rows and differs_from_policy');
|
|
6
|
+
rows.push(...result.rows); differs += result.differs_from_policy;
|
|
7
|
+
if (result.cursor == null || result.cursor === cursor) return { rows, differs };
|
|
8
|
+
cursor = result.cursor;
|
|
9
|
+
}
|
|
10
|
+
throw new Error('Audit pagination exceeded 100 pages');
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Read each tested principal independently, retaining its native row order. */
|
|
2
|
+
export async function auditRows(c, { agents = [c.agentId, ...c.nativeAgents ?? []], includeFixtures = false } = {}) {
|
|
3
|
+
const rows = []; let differs = 0;
|
|
4
|
+
for (const agentId of new Set(agents)) {
|
|
5
|
+
let cursor = null;
|
|
6
|
+
for (let page = 0; ; page++) {
|
|
7
|
+
if (page === 100) throw new Error('Audit pagination exceeded 100 pages');
|
|
8
|
+
const query = new URLSearchParams();
|
|
9
|
+
if (agentId !== null) query.set('agent', agentId);
|
|
10
|
+
if (cursor) query.set('after', cursor);
|
|
11
|
+
const result = await c.personJson(`/agents/api/audit?${query}`);
|
|
12
|
+
if (!Array.isArray(result.rows) || !Number.isInteger(result.differs_from_policy)) throw new Error('Audit API must return rows and differs_from_policy');
|
|
13
|
+
rows.push(...result.rows.filter(row => includeFixtures || !c.fixtureAuditIds?.has(row.id)));
|
|
14
|
+
differs += result.differs_from_policy;
|
|
15
|
+
if (result.cursor == null || result.cursor === cursor) break;
|
|
16
|
+
cursor = result.cursor;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return { rows, differs };
|
|
20
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
2
|
+
import { classIds } from './protocol.mjs';
|
|
3
|
+
import { AGENT_CLASSES } from './surface.mjs';
|
|
4
|
+
import { targetIdentity } from './target.mjs';
|
|
5
|
+
import { auditRows } from './audit-rows.mjs';
|
|
6
|
+
|
|
7
|
+
export { auditRows } from './audit-rows.mjs';
|
|
8
|
+
export async function auditPhase(c) {
|
|
9
|
+
const { rows, differs } = await auditRows(c), expected = [...c.calls];
|
|
10
|
+
c.add('BASE-AGENT-009.1.count', rows.length === expected.length, `Expected exactly ${expected.length} audit rows for tool calls, resource reads and approval executions, found ${rows.length}.`);
|
|
11
|
+
c.add('BASE-AGENT-009.1.unique', new Set(rows.map(row => row.id)).size === rows.length, 'Every tool call, resource read and approval execution must have its own audit ID.');
|
|
12
|
+
const perAgent = new Map();
|
|
13
|
+
for (const row of rows) {
|
|
14
|
+
if (!perAgent.has(row.agent?.id)) perAgent.set(row.agent?.id, []);
|
|
15
|
+
perAgent.get(row.agent?.id).push(row);
|
|
16
|
+
}
|
|
17
|
+
for (const [index, call] of expected.entries()) {
|
|
18
|
+
const principal = call.principal ?? { agent: { id: c.agentId, specialist: c.surface.specialist }, consent: c.consent, sponsor: c.sponsor.id };
|
|
19
|
+
const row = perAgent.get(principal.agent.id)?.shift(), decision = call.decision;
|
|
20
|
+
c.add(`BASE-AGENT-009.1.call.${index}`, Boolean(row) && row.tool === call.name && row.consent === principal.consent && row.agent?.id === principal.agent.id && row.agent?.specialist === principal.agent.specialist && row.sponsor?.id === principal.sponsor && (!call.principal || row.client_id === principal.clientId && row.agent?.name === principal.agent.name) && typeof row.label === 'string' && row.label.includes(' for ') && Number.isFinite(Date.parse(row.at)) && row.door === (call.kind === 'embedded' ? 'embedded' : 'mcp'), `${call.name} lacks its complete ordered audit row.`);
|
|
21
|
+
if (!row) continue;
|
|
22
|
+
if (call.code === 'native_proof_required') c.add(`BASE-AGENT-004.native-proof.audit.${index}`, row.outcome === 'refused' && row.code === call.code, `${call.name} native proof challenge must retain its refused audit outcome.`);
|
|
23
|
+
c.add(`BASE-AGENT-009.1.resource.${index}`, call.kind === 'resources/read' ? row.resource === call.args.uri : row.resource === null || targetIdentity(row.resource), `${call.name} audit resource must identify the requested URI or the seed-resolved native kind and id.`);
|
|
24
|
+
c.add(`BASE-AGENT-009.2.link.${index}`, call.kind === 'approval/execute' ? row.id !== decision?.id && row.decision_id === decision?.id : row.decision_id === null, `${call.name} must ${call.kind === 'approval/execute' ? 'link its own execution row to the pending decision' : 'have its own call row without an approval execution link'}.`);
|
|
25
|
+
const validClasses = Array.isArray(row.classes) && new Set(classIds(row.classes)).size === row.classes.length && row.classes.every(item => AGENT_CLASSES.includes(item.class) && item.facts && typeof item.facts === 'object');
|
|
26
|
+
c.add(`BASE-AGENT-006.6.audit.${index}`, validClasses && (decision ? isDeepStrictEqual(classIds(row.classes), classIds(decision.classes)) && decision.classes.every(item => row.classes.some(actual => actual.class === item.class && isDeepStrictEqual(actual.facts, item.facts))) : call.kind === 'resources/read' || row.classes.length === 0), `${call.name} audit classes/facts differ from its computed decision.`);
|
|
27
|
+
if (decision) c.add(`BASE-AGENT-009.2.decision.${index}`, (call.kind === 'approval/execute' || row.id === decision.id) && row.decision === decision.disposition && row.revision === decision.revision && isDeepStrictEqual(row.rules, decision.classes.map(({ class: cls, rule, do: disposition }) => ({ class: cls, rule, do: disposition }))), `${call.name} audit decision or revision differs from the response.`);
|
|
28
|
+
else if (call.kind === 'resources/read') c.add(`BASE-AGENT-009.2.resource-rules.${index}`, Array.isArray(row.rules) && isDeepStrictEqual(classIds(row.rules), classIds(row.classes)) && row.rules.every(rule => typeof rule.rule === 'string' && ['autonomous', 'review', 'approval', 'blocked', 'unset'].includes(rule.do)), 'Resource audit classes must each carry the applied policy rule and disposition.');
|
|
29
|
+
if (decision?.disposition === 'review') c.add(`BASE-AGENT-009.4.review.${index}`, Boolean(row.review?.id), `${call.name} was decided review without a review row.`);
|
|
30
|
+
if (call.pending) c.add(`BASE-AGENT-009.2.pending.${index}`, row.outcome === 'pending' && Boolean(call.approval?.id) && row.approval?.id === call.approval.id, `${call.name} must retain its original pending audit outcome and approval handle after the approval executes.`);
|
|
31
|
+
if (call.kind === 'approval/execute') c.add(`BASE-AGENT-008.5.execution.${index}`, row.approval?.id === call.approvalId && row.approval.by?.includes(c.sponsor.id) && row.outcome === 'done', `${call.name} approved execution lacks its completed row and named sponsor approval.`);
|
|
32
|
+
if (call.result?._meta?.['com.runeditrun/receipt']) c.add(`BASE-AGENT-008.5.audit.${index}`, Boolean(row.approval?.id) && row.approval.by?.includes(row.sponsor.id), `${call.name} approval receipt lacks the signed-in sponsor as approver.`);
|
|
33
|
+
}
|
|
34
|
+
c.add('BASE-AGENT-007.7.differs-from-policy', differs === 0, `Audit evidence has ${differs} decisions that differ from the policy in force.`);
|
|
35
|
+
// Audit is read before the events tool: its own call is audited as well, but
|
|
36
|
+
// cannot occur in a snapshot taken before it was made.
|
|
37
|
+
const events = []; let after;
|
|
38
|
+
for (let page = 0; page < 100; page++) {
|
|
39
|
+
const result = await c.tool(`${c.surface.seed}.events.list`, { ...(after ? { after } : {}), limit: 200 });
|
|
40
|
+
const content = result.result?.structuredContent;
|
|
41
|
+
if (!Array.isArray(content?.events)) throw new Error('events.list did not return {events,cursor}');
|
|
42
|
+
events.push(...content.events);
|
|
43
|
+
if (content.events.length < 200 || content.cursor === after) break;
|
|
44
|
+
after = content.cursor;
|
|
45
|
+
}
|
|
46
|
+
c.add('BASE-AGENT-010.2.events', events.length > 0 && new Set(events.map(event => event.id)).size === events.length && events.every(event => typeof event.id === 'string' && typeof event.type === 'string' && typeof event.uri === 'string' && event.actor && Number.isFinite(Date.parse(event.at))), 'Events must have stable unique ids, type, URI, actor and time.');
|
|
47
|
+
for (const type of ['policy.adopted', 'approval.pending', 'approval.decided']) {
|
|
48
|
+
const applicable = type === 'policy.adopted' || rows.some(row => row.approval);
|
|
49
|
+
if (applicable) c.add(`BASE-AGENT-010.6.${type}`, events.some(event => event.type === type), `Missing ${type} event.`);
|
|
50
|
+
}
|
|
51
|
+
const writeTools = new Set(rows.filter(row => row.tool !== 'resources/read' && ['done', 'replayed'].includes(row.outcome) && c.surface.tools.find(tool => tool.name === row.tool)?.readOnly === false).map(row => row.tool));
|
|
52
|
+
c.add('BASE-AGENT-010.1.effects', !writeTools.size || [...events, ...c.effectEvents ?? []].some(event => event.actor?.kind === 'agent' && !['policy.decision', 'approval.pending', 'approval.decided'].includes(event.type)), 'Completed writes must produce record-change events attributed to the agent while their native resources are readable.');
|
|
53
|
+
if (events.length > 1) {
|
|
54
|
+
const cursor = events[0].id;
|
|
55
|
+
const replay1 = await c.tool(`${c.surface.seed}.events.list`, { after: cursor, limit: 200 });
|
|
56
|
+
const replay2 = await c.tool(`${c.surface.seed}.events.list`, { after: cursor, limit: 200 });
|
|
57
|
+
const ids = result => result.result?.structuredContent?.events?.map(event => event.id) ?? [];
|
|
58
|
+
const first = ids(replay1), second = ids(replay2);
|
|
59
|
+
c.add('BASE-AGENT-010.3.cursor', first.length > 0 && isDeepStrictEqual(first, second.slice(0, first.length)) && first[0] === events[1].id, 'Replaying one cursor must return the same retained event ids in order.');
|
|
60
|
+
}
|
|
61
|
+
const final = await auditRows(c);
|
|
62
|
+
c.add('BASE-AGENT-009.1.events-audited', final.rows.length === c.calls.length && final.differs === 0, `events.list audit calls mismatch: ${final.rows.length} audit rows for ${c.calls.length} calls.`);
|
|
63
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// A no-subject security tool may change a record, but its declared input must
|
|
2
|
+
// have no place to carry an authority subject, role or grant. Fail closed on
|
|
3
|
+
// open objects, opaque schemas, references and unbounded schema composition.
|
|
4
|
+
const subject = /(?:^|_)(?:person|people|user|member|owner|sponsor|agent|role|scope|grant|credential|permission|authorit(?:y|ies)|principal|privilege|entitlement|capabilit(?:y|ies)|authorization|identity|consent|token)(?:s|id|ids)?(?:_|$)/;
|
|
5
|
+
const field = name => name.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase().replace(/[^a-z0-9]+/g, '_');
|
|
6
|
+
export function recordOnlySchema(schema, depth = 0) {
|
|
7
|
+
if (!schema || typeof schema !== 'object' || Array.isArray(schema) || depth > 32
|
|
8
|
+
|| Object.keys(schema).some(key => ['$ref', '$dynamicRef', 'allOf', 'anyOf', 'oneOf', 'not', 'if', 'then', 'else', 'patternProperties', 'dependentSchemas', 'unevaluatedProperties'].includes(key))) return false;
|
|
9
|
+
if (schema.type === 'object') return schema.additionalProperties === false && schema.properties !== null && typeof schema.properties === 'object' && !Array.isArray(schema.properties)
|
|
10
|
+
&& Object.entries(schema.properties).every(([name, value]) => !subject.test(field(name)) && recordOnlySchema(value, depth + 1));
|
|
11
|
+
if (schema.type === 'array') return recordOnlySchema(schema.items, depth + 1);
|
|
12
|
+
return ['string', 'boolean', 'number', 'integer', 'null'].includes(schema.type);
|
|
13
|
+
}
|
|
14
|
+
export const recordOnlyAuthority = tool => tool?.authority === 'none' && tool.readOnly === false
|
|
15
|
+
&& Array.isArray(tool.classes) && tool.classes.includes('security') && !tool.classes.includes('access')
|
|
16
|
+
&& tool.effect?.kind === 'record' && typeof tool.effect.justification === 'string' && tool.effect.justification.trim().length > 0
|
|
17
|
+
&& recordOnlySchema(tool.inputSchema);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createHash, randomUUID, webcrypto } from 'node:crypto';
|
|
2
|
+
|
|
3
|
+
export const CATALOGUE = 'rer-agent-classes/1';
|
|
4
|
+
export function canonical(value) {
|
|
5
|
+
if (Array.isArray(value)) return `[${value.map(canonical).join(',')}]`;
|
|
6
|
+
if (value && typeof value === 'object') return `{${Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, item]) => `${JSON.stringify(key)}:${canonical(item)}`).join(',')}}`;
|
|
7
|
+
return JSON.stringify(value);
|
|
8
|
+
}
|
|
9
|
+
export async function signJws(privateKey, kid, typ, payload) {
|
|
10
|
+
const input = [Buffer.from(JSON.stringify({ alg: 'ES256', typ, kid })).toString('base64url'), Buffer.from(JSON.stringify(payload)).toString('base64url')].join('.');
|
|
11
|
+
const signature = await webcrypto.subtle.sign({ name: 'ECDSA', hash: 'SHA-256' }, privateKey, new TextEncoder().encode(input));
|
|
12
|
+
return `${input}.${Buffer.from(signature).toString('base64url')}`;
|
|
13
|
+
}
|
|
14
|
+
export function seconds(now) {
|
|
15
|
+
const value = typeof now === 'function' ? now() : now ?? Date.now();
|
|
16
|
+
return Math.floor((value instanceof Date ? value.getTime() : typeof value === 'string' ? Date.parse(value) : value) / 1000);
|
|
17
|
+
}
|
|
18
|
+
export async function accessToken(context, overrides = {}) {
|
|
19
|
+
const iat = seconds(context.now);
|
|
20
|
+
return signJws(context.signer.privateKey, context.signer.kid, 'at+jwt', {
|
|
21
|
+
iss: context.signer.issuer, aud: `${context.origin}/mcp`, sub: context.person.sub, email: context.person.email.toLowerCase(),
|
|
22
|
+
act: { sub: context.agentId, name: 'Agent door conformance', specialist: context.surface.specialist }, client_id: 'rer-agent-conformance',
|
|
23
|
+
scope: [...new Set([...context.surface.tools.map(tool => tool.scope), ...(context.resourceScopes ?? []), 'events:read'])].join(' '), business: context.business,
|
|
24
|
+
consent: context.consent, jti: randomUUID(), iat, exp: iat + 300, ...overrides,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export const autonomousPolicy = () => ({ schema: 'rer-agent-policy/1', catalogue: CATALOGUE, rules: [{ id: 'all', class: '*', do: 'autonomous' }], spend: { none: true } });
|
|
28
|
+
export const heldPolicy = () => ({ schema: 'rer-agent-policy/1', catalogue: CATALOGUE, rules: [{ id: 'all', class: '*', do: 'approval', approver: ['sponsor'], wait: 'PT1H' }, { id: 'standard', class: 'standard', do: 'review' }], reviewers: ['sponsor'], spend: { none: true } });
|
|
29
|
+
export async function policyEnvelope(context, document, { paused = false, revoked, revision = context.revision + 1, seq = context.seq + 1, ...overrides } = {}) {
|
|
30
|
+
const iat = seconds(context.now);
|
|
31
|
+
const revision_signature = document === null ? null : await signJws(context.signer.privateKey, context.signer.kid, 'rer-agent-policy-revision+jwt', {
|
|
32
|
+
business: context.business, revision, document_sha256: createHash('sha256').update(canonical(document)).digest('hex'),
|
|
33
|
+
});
|
|
34
|
+
const payload = { v: 1, iss: context.signer.issuer, aud: context.origin, sub: context.signer.installationId, business: context.business, seq, revision, paused, catalogue: CATALOGUE, document, revision_signature, iat, exp: iat + 300, ...(revoked === undefined ? {} : { revoked }), ...overrides };
|
|
35
|
+
return { payload, policy: await signJws(context.signer.privateKey, context.signer.kid, 'rer-agent-policy+jwt', payload) };
|
|
36
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
2
|
+
import { accessToken } from './crypto.mjs';
|
|
3
|
+
import { narrowingContract } from './narrowing.mjs';
|
|
4
|
+
import { VERSION } from './protocol.mjs';
|
|
5
|
+
|
|
6
|
+
export async function discoverDoor(c) {
|
|
7
|
+
const discover = await c.mcp('server/discover');
|
|
8
|
+
c.add('BASE-AGENT-001.1', discover.status === 200 && discover.result && Array.isArray(discover.result.supportedVersions) && discover.result.supportedVersions.includes(VERSION) && discover.result.supportedVersions.includes('2025-11-25') && discover.result.capabilities && discover.result._meta?.['io.modelcontextprotocol/serverInfo'] && typeof discover.result.instructions === 'string', 'server/discover must identify versions, capabilities, serverInfo and instructions.');
|
|
9
|
+
const limits = discover.result?._meta?.['com.runeditrun/limits'];
|
|
10
|
+
c.add('BASE-AGENT-001.6.limits', Number.isSafeInteger(limits?.requestsPerMinute) && limits.requestsPerMinute > 0 && Number.isSafeInteger(limits?.maxBodyBytes) && limits.maxBodyBytes > 0 && discover.result.instructions.includes(c.surface.specialist), 'Discovery must name the specialist and the capacity limits in force.');
|
|
11
|
+
const foreign = await c.mcp('server/discover', {}, { headers: { Origin: 'https://foreign.invalid' } });
|
|
12
|
+
c.add('BASE-AGENT-001.5.origin', foreign.status === 403, `Foreign Origin returned ${foreign.status}.`);
|
|
13
|
+
const mismatch = await c.mcp('server/discover', {}, { headers: { 'Mcp-Method': 'tools/list' } });
|
|
14
|
+
c.add('BASE-AGENT-001.5.method', mismatch.status === 400 && mismatch.message?.error?.code === -32020, 'A header/body method mismatch must return HeaderMismatch.');
|
|
15
|
+
const unsupported = await c.mcp('server/discover', {}, { version: '2099-01-01' });
|
|
16
|
+
c.add('BASE-AGENT-001.3', unsupported.status === 400 && unsupported.message?.error?.code === -32022 && unsupported.message.error.data?.supported?.includes(VERSION), 'An unsupported version must return UnsupportedProtocolVersion.');
|
|
17
|
+
const metadata = await c.request('/.well-known/oauth-protected-resource/mcp');
|
|
18
|
+
let oauth; try { oauth = await metadata.json(); } catch {}
|
|
19
|
+
c.resourceScopes = Array.isArray(oauth?.scopes_supported) ? oauth.scopes_supported.filter(scope => typeof scope === 'string') : [];
|
|
20
|
+
c.add('BASE-AGENT-004.1.metadata', metadata.ok && oauth?.resource === `${c.origin}/mcp` && oauth.authorization_servers?.includes(c.signer.issuer) && c.surface.tools.every(tool => oauth.scopes_supported?.includes(tool.scope)), 'Resource metadata must identify the canonical MCP resource, trusted issuer and all declared scopes.');
|
|
21
|
+
const oversize = await c.request('/mcp', { method: 'POST', headers: { Authorization: `Bearer ${await accessToken(c)}`, Origin: c.origin, 'Content-Type': 'application/json', 'MCP-Protocol-Version': VERSION, 'Mcp-Method': 'tools/call', 'Mcp-Name': c.surface.witness.tool }, body: JSON.stringify({ jsonrpc: '2.0', id: 9999, method: 'tools/call', params: { name: c.surface.witness.tool, arguments: { oversized: 'x'.repeat(limits?.maxBodyBytes + 1 || 2 * 1024 * 1024) } } }) });
|
|
22
|
+
c.add('BASE-AGENT-001.6', oversize.status === 413, `Oversized body returned ${oversize.status}.`);
|
|
23
|
+
await oversize.body?.cancel();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function listedDoor(c) {
|
|
27
|
+
const first = await c.mcp('tools/list'), second = await c.mcp('tools/list');
|
|
28
|
+
const tools = first.result?.tools ?? [], names = tools.map(tool => tool.name), expected = c.surface.tools.map(tool => tool.name).sort();
|
|
29
|
+
c.listed = new Map(tools.map(tool => [tool.name, tool]));
|
|
30
|
+
c.add('BASE-AGENT-002.1.registry', isDeepStrictEqual(names, expected), `tools/list differs from surface: actual ${names.join(', ')}, expected ${expected.join(', ')}.`);
|
|
31
|
+
c.add('BASE-AGENT-001.4', isDeepStrictEqual(first.result, second.result) && typeof first.result?.ttlMs === 'number' && first.result.ttlMs >= 0 && first.result.cacheScope === 'private', 'Repeated tools/list results must have deterministic order, ttlMs and private cache scope.');
|
|
32
|
+
for (const declared of c.surface.tools) {
|
|
33
|
+
const tool = c.listed.get(declared.name);
|
|
34
|
+
if (declared.proof) c.add(`BASE-AGENT-004.proof.${declared.name}.declaration`, tool?._meta?.['com.runeditrun/proof'] === declared.proof && tool?._meta?.['com.runeditrun/proof-kind'] === declared.proofKind, `${declared.name} must expose its native proof requirement.`);
|
|
35
|
+
if (declared.widens === false) {
|
|
36
|
+
const { idempotency_key: _key, expected_revision: _revision, ...properties } = tool?.inputSchema?.properties ?? {};
|
|
37
|
+
const schema = { ...tool?.inputSchema, properties, required: tool?.inputSchema?.required?.filter(key => !['idempotency_key', 'expected_revision'].includes(key)) };
|
|
38
|
+
c.add(`BASE-AGENT-005.narrowing.${declared.name}.schema`, narrowingContract({ ...declared, inputSchema: schema }) && tool?._meta?.['com.runeditrun/widens'] === false && isDeepStrictEqual(tool?._meta?.['com.runeditrun/narrowing'], declared.narrowing) && isDeepStrictEqual(schema, declared.inputSchema), `${declared.name} narrowing check requires the runtime's exact closed target-only schema and effect.`);
|
|
39
|
+
}
|
|
40
|
+
if (declared.authority === 'none') c.add(`BASE-AGENT-005.no-subject.schema.${declared.name}`, tool?._meta?.['com.runeditrun/authority'] === 'none' && isDeepStrictEqual(tool?._meta?.['com.runeditrun/effect'], declared.effect) && isDeepStrictEqual(Object.fromEntries(Object.entries(tool?.inputSchema?.properties ?? {}).filter(([key]) => !['idempotency_key', 'expected_revision'].includes(key))), declared.inputSchema.properties), 'No-subject declarations must match the actual runtime schema and record effect.');
|
|
41
|
+
c.add(`BASE-AGENT-002.2.schema.${declared.name}`, tool?.inputSchema?.type === 'object' && tool.outputSchema !== undefined, `${declared.name} must carry input and output schemas.`);
|
|
42
|
+
c.add(`BASE-AGENT-002.3.${declared.name}`, tool?.annotations?.readOnlyHint === declared.readOnly && tool?.annotations?.destructiveHint === declared.classes.includes('destructive') && tool?.annotations?.openWorldHint === declared.classes.includes('external'), `${declared.name} annotations differ from its declared behavior.`);
|
|
43
|
+
c.add(`BASE-AGENT-006.1.${declared.name}`, isDeepStrictEqual([...(tool?._meta?.['com.runeditrun/classes'] ?? [])].sort(), [...declared.classes].sort()) && tool?._meta?.['com.runeditrun/scope'] === declared.scope && isDeepStrictEqual([...(tool?._meta?.['com.runeditrun/clauses'] ?? [])].sort(), [...declared.clauses].sort()), `${declared.name} classes, scope or clauses differ from the Agent surface.`);
|
|
44
|
+
}
|
|
45
|
+
for (const version of [VERSION, '2025-11-25']) {
|
|
46
|
+
const initialized = await c.mcp('initialize', { protocolVersion: version, capabilities: {}, clientInfo: { name: 'rer-agent-conformance', version: '1' } }, { version });
|
|
47
|
+
const listed = await c.mcp('tools/list', {}, { version });
|
|
48
|
+
c.add(`BASE-AGENT-001.2.${version}`, !initialized.headers.has('mcp-session-id') && initialized.result?.protocolVersion === version && isDeepStrictEqual(listed.result?.tools?.map(tool => tool.name), names), `${version} must negotiate and expose the same tools.`);
|
|
49
|
+
}
|
|
50
|
+
const march = await c.mcp('initialize', { protocolVersion: '2025-03-26', capabilities: {} }, { version: '2025-03-26' });
|
|
51
|
+
c.add('BASE-AGENT-001.3.2025-03-26', march.status === 400 && march.message?.error?.code === -32022 && march.message.error.message === 'UnsupportedProtocolVersion', 'March 2025 batching is not implemented; refuse its negotiation explicitly.');
|
|
52
|
+
const templates = await c.mcp('resources/templates/list');
|
|
53
|
+
c.add('BASE-AGENT-003.1', isDeepStrictEqual((templates.result?.resourceTemplates ?? []).map(item => item.uriTemplate).sort(), [...c.surface.resources].sort()), 'resources/templates/list must match the Agent surface.');
|
|
54
|
+
const prompts = await c.mcp('prompts/list');
|
|
55
|
+
c.add('BASE-AGENT-013.5.prompts', Array.isArray(prompts.result?.prompts), 'prompts/list must list the declared specialist prompts.');
|
|
56
|
+
if (prompts.result?.prompts?.length) {
|
|
57
|
+
const prompt = await c.mcp('prompts/get', { name: prompts.result.prompts[0].name });
|
|
58
|
+
c.add('BASE-AGENT-001.1.prompts', Array.isArray(prompt.result?.messages) && prompt.result.messages.length > 0, 'A specialist prompt must be retrievable with Mcp-Name.');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { auditRows } from './audit-rows.mjs';
|
|
2
|
+
|
|
3
|
+
const object = value => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
4
|
+
const text = value => typeof value === 'string' && value.trim().length > 0;
|
|
5
|
+
|
|
6
|
+
/** Each round gets new native state, never a previous round's consumed values. */
|
|
7
|
+
export function phaseFixtures(c, prepare) {
|
|
8
|
+
c.fixtureValues = {};
|
|
9
|
+
c.clients = new Map();
|
|
10
|
+
c.nativeAgents = new Set();
|
|
11
|
+
c.fixtureAuditIds = new Set();
|
|
12
|
+
c.prepare = async phase => {
|
|
13
|
+
c.fixtureValues = {};
|
|
14
|
+
c.clients.clear();
|
|
15
|
+
if (!prepare) return;
|
|
16
|
+
try {
|
|
17
|
+
const before = new Set((await auditRows(c, { agents: [null], includeFixtures: true })).rows.map(row => row.id));
|
|
18
|
+
const result = await prepare({ phase, tool: c.tool });
|
|
19
|
+
if (!object(result) || Object.keys(result).some(key => !['values', 'clients'].includes(key)) || !object(result.values ?? {}) || !object(result.clients ?? {})) throw new Error('Native phase preparation must return {values,clients}.');
|
|
20
|
+
for (const [label, client] of Object.entries(result.clients ?? {})) {
|
|
21
|
+
if (!text(label) || !object(client) || Object.keys(client).sort().join(',') !== 'agent,clientId,token'
|
|
22
|
+
|| !text(client.token) || !text(client.clientId) || !object(client.agent) || !text(client.agent.id) || !text(client.agent.name)
|
|
23
|
+
|| Object.keys(client.agent).some(key => !['id', 'name', 'specialist'].includes(key))
|
|
24
|
+
|| client.agent.specialist !== c.surface.specialist || client.agent.id === c.agentId) throw new Error('Native fixture clients require a credential, clientId and distinct agent {id,name,specialist}.');
|
|
25
|
+
c.clients.set(label, structuredClone(client));
|
|
26
|
+
c.nativeAgents.add(client.agent.id);
|
|
27
|
+
}
|
|
28
|
+
c.fixtureValues = structuredClone(result.values ?? {});
|
|
29
|
+
const setup = await auditRows(c, { agents: [...c.clients.values()].map(client => client.agent.id), includeFixtures: true });
|
|
30
|
+
for (const row of setup.rows) if (!before.has(row.id)) {
|
|
31
|
+
const client = [...c.clients.values()].find(client => client.agent.id === row.agent?.id);
|
|
32
|
+
if (row.sponsor?.id !== c.sponsor.id || row.client_id !== client.clientId || row.agent?.name !== client.agent.name || row.agent?.specialist !== client.agent.specialist || row.consent !== null) throw new Error('Native fixture preparation identity differs from its declared client.');
|
|
33
|
+
c.fixtureAuditIds.add(row.id);
|
|
34
|
+
}
|
|
35
|
+
} catch {
|
|
36
|
+
c.clients.clear();
|
|
37
|
+
throw new Error('Native phase preparation failed; fixture values are not logged.');
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
c.stepTool = (step, args, options = {}) => c.tool(step.tool, args, { ...(step.client === undefined ? {} : { client: step.client }), ...options });
|
|
41
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { validateAgentSurface } from './surface.mjs';
|
|
3
|
+
import { createProtocol } from './protocol.mjs';
|
|
4
|
+
import { autonomousPolicy, heldPolicy } from './crypto.mjs';
|
|
5
|
+
import { discoverDoor, listedDoor } from './discovery.mjs';
|
|
6
|
+
import { runJourney } from './journey.mjs';
|
|
7
|
+
import { unsetPolicy, removalPhase, blockedPhases, pausePhase, consentRevocationPhase } from './policy-phases.mjs';
|
|
8
|
+
import { negativePhase } from './negative.mjs';
|
|
9
|
+
import { replayAdmissionPhase } from './replay.mjs';
|
|
10
|
+
import { webhookPhase } from './webhooks.mjs';
|
|
11
|
+
import { recordSecurityPhase } from './security.mjs';
|
|
12
|
+
import { crossSponsorPhase } from './sponsors.mjs';
|
|
13
|
+
import { auditPhase } from './audit.mjs';
|
|
14
|
+
import { invocationPhase } from './invocation.mjs';
|
|
15
|
+
|
|
16
|
+
export { validateAgentSurface } from './surface.mjs';
|
|
17
|
+
|
|
18
|
+
/** Run against a fresh, real installation using its HTTP and person doors. */
|
|
19
|
+
export async function runAgentDoorConformance({ fetch, invoke, origin, surface, signer, person, sponsors = [person], webhooks, business = 'rer-agent-conformance', consent = randomUUID(), now, prove, nativeJourney, nativeStep, prepare }) {
|
|
20
|
+
const validation = validateAgentSurface(surface), points = [...validation.points];
|
|
21
|
+
if (!validation.ok) return { ok: false, points };
|
|
22
|
+
if (typeof fetch !== 'function' || !signer?.privateKey || !signer.issuer || !signer.installationId || !signer.kid || !person?.email || !person.cookie || typeof person.sub !== 'string' || !person.sub.trim() || typeof consent !== 'string' || !consent.trim() || new URL(origin).origin !== origin) throw new TypeError('Conformance requires fetch, canonical origin, signer, consent and signed-in person {email,cookie,sub}');
|
|
23
|
+
const c = createProtocol({ fetch, origin, surface, signer, person, business, consent, now, prove, nativeStep, prepare, points, agentId: `rer-conformance-${randomUUID()}`, seq: 0, revision: 0, listed: new Map() });
|
|
24
|
+
await c.phase('BASE-AGENT-001.transport', () => discoverDoor(c));
|
|
25
|
+
await c.phase('BASE-AGENT-007.phase0', () => unsetPolicy(c, true));
|
|
26
|
+
await c.phase('BASE-AGENT-007.phase1', () => removalPhase(c));
|
|
27
|
+
await c.phase('BASE-AGENT-013.phase2', async () => { await c.adopt(autonomousPolicy()); await c.prepare('autonomous'); await listedDoor(c); await runJourney(c, 'autonomous', { injections: true, replay: true }); });
|
|
28
|
+
await c.phase('BASE-AGENT-013.phase3', async () => { await c.prepare('held'); await c.adopt(heldPolicy()); await runJourney(c, 'held', { held: true }); });
|
|
29
|
+
await c.phase('BASE-AGENT-007.phase4', () => blockedPhases(c));
|
|
30
|
+
await c.phase('BASE-AGENT-011.phase5', () => pausePhase(c));
|
|
31
|
+
await c.phase('BASE-AGENT-004.phase6', () => negativePhase(c));
|
|
32
|
+
await c.phase('BASE-AGENT-004.consent', () => consentRevocationPhase(c));
|
|
33
|
+
if (invoke) await c.phase('BASE-AGENT-012.invocation', () => invocationPhase(c, invoke));
|
|
34
|
+
if (nativeJourney) await c.phase('BASE-AGENT-013.native-journey', async () => { await nativeJourney({ tool: c.tool }); c.add('BASE-AGENT-013.native-journey', true); });
|
|
35
|
+
if (surface.tools.some(tool => tool.authority === 'none')) await c.phase('BASE-AGENT-005.no-subject', () => recordSecurityPhase(c));
|
|
36
|
+
if (surface.verification?.replayAdmission) await c.phase('BASE-AGENT-012.replay', () => replayAdmissionPhase(c, surface.verification.replayAdmission));
|
|
37
|
+
if (webhooks) await c.phase('BASE-AGENT-006.webhook', () => webhookPhase(c, webhooks));
|
|
38
|
+
await c.phase('BASE-AGENT-009.phase7', () => auditPhase(c));
|
|
39
|
+
if (sponsors.length > 1) await c.phase('BASE-AGENT-004.cross-sponsor', () => crossSponsorPhase(c, sponsors));
|
|
40
|
+
return { ok: points.every(point => point.ok), points };
|
|
41
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { errorCode } from './protocol.mjs';
|
|
2
|
+
|
|
3
|
+
// Refresh read dependencies only. Repeating a write here would create another
|
|
4
|
+
// effect, and resolving its old output cannot provide a current native revision.
|
|
5
|
+
export async function injectionArgs(c, step, outputs) {
|
|
6
|
+
const fresh = new Map(outputs), refreshed = new Set();
|
|
7
|
+
async function visit(value) {
|
|
8
|
+
if (!value || typeof value !== 'object') return;
|
|
9
|
+
if (typeof value.$from === 'string') {
|
|
10
|
+
const source = c.surface.journey.find(item => item.id === value.$from);
|
|
11
|
+
if (!source || refreshed.has(source.id) || !c.surface.tools.find(tool => tool.name === source.tool)?.readOnly) return;
|
|
12
|
+
refreshed.add(source.id);
|
|
13
|
+
await visit(source.args);
|
|
14
|
+
const args = c.args(source, fresh), proof = await c.proof(source.tool, args);
|
|
15
|
+
const answer = await c.tool(source.tool, args, proof);
|
|
16
|
+
if (answer.result?.isError || answer.result?.structuredContent === undefined) throw new Error(`Injection prerequisite ${source.id} failed (${errorCode(answer) ?? answer.status})`);
|
|
17
|
+
fresh.set(source.id, answer.result.structuredContent);
|
|
18
|
+
} else for (const item of Object.values(value)) await visit(item);
|
|
19
|
+
}
|
|
20
|
+
await visit(step.args);
|
|
21
|
+
const args = c.args(step, fresh);
|
|
22
|
+
const write = !c.surface.tools.find(tool => tool.name === step.tool)?.readOnly;
|
|
23
|
+
return { ...args, ...c.resolve(step.inject, fresh), ...(write ? { idempotency_key: args.idempotency_key } : {}) };
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
2
|
+
import { autonomousPolicy } from './crypto.mjs';
|
|
3
|
+
import { auditRows } from './audit.mjs';
|
|
4
|
+
|
|
5
|
+
/** The adapter drains serialized job input through the edition's real invoke door. */
|
|
6
|
+
export async function invocationPhase(c, invoke) {
|
|
7
|
+
const step = c.surface.journey.find(item => !c.surface.tools.find(tool => tool.name === item.tool)?.readOnly);
|
|
8
|
+
if (!step) throw new Error('Durable invocation conformance requires a mutating journey step.');
|
|
9
|
+
await c.adopt(autonomousPolicy());
|
|
10
|
+
await c.prepare('invocation');
|
|
11
|
+
const who = { person: { id: c.sponsor.id }, agent: { id: c.agentId, name: 'Agent door conformance', specialist: c.surface.specialist }, consent: c.consent, scopes: [c.surface.tools.find(tool => tool.name === step.tool).scope] };
|
|
12
|
+
const schedule = () => JSON.stringify({ name: step.tool, args: c.args(step, new Map(), { unresolved: true }), who });
|
|
13
|
+
const run = async saved => {
|
|
14
|
+
const job = JSON.parse(saved), result = await invoke(job.name, job.args, job.who);
|
|
15
|
+
c.calls.push({ kind: 'embedded', name: job.name, args: job.args, decision: result.decision, code: result.code });
|
|
16
|
+
return { job, result };
|
|
17
|
+
};
|
|
18
|
+
const before = await c.witness(), first = await run(schedule()), after = await c.witness();
|
|
19
|
+
c.add('BASE-AGENT-012.invocation-effect', first.result.outcome === 'done' && !isDeepStrictEqual(before, after), 'A serialized invocation under live consent must complete its native effect.');
|
|
20
|
+
const saved = schedule();
|
|
21
|
+
await c.adopt(autonomousPolicy(), { revoked: { agents: [], consents: [c.consent] } });
|
|
22
|
+
const second = await run(saved);
|
|
23
|
+
c.add('BASE-AGENT-012.invocation-revoked', second.result.outcome === 'refused' && second.result.code === 'consent_revoked', 'Final worker admission must refuse the saved originating consent with consent_revoked.');
|
|
24
|
+
const { rows } = await auditRows(c);
|
|
25
|
+
for (const [label, { job, result }] of [['done', first], ['refused', second]]) {
|
|
26
|
+
const row = rows.find(item => item.door === 'embedded' && item.idempotency_key === job.args.idempotency_key);
|
|
27
|
+
c.add(`BASE-AGENT-012.invocation-audit.${label}`, row?.consent === c.consent && row.agent?.id === who.agent.id && row.sponsor?.id === who.person.id
|
|
28
|
+
&& row.tool === job.name && row.outcome === result.outcome && row.code === (result.code ?? null) && Number.isFinite(Date.parse(row.at)) && Boolean(row.id)
|
|
29
|
+
&& (label !== 'refused' || row.revision === c.revision), 'Durable invocation audit must retain consent, agent, sponsor, tool, time, revision and outcome.');
|
|
30
|
+
}
|
|
31
|
+
await c.adopt(autonomousPolicy());
|
|
32
|
+
c.add('BASE-AGENT-012.invocation-no-effect', isDeepStrictEqual(after, await c.witness()), 'A saved job under revoked consent changed native state.');
|
|
33
|
+
}
|