@agenticprimitives/orchestration 0.0.0-alpha.3 → 0.0.0-alpha.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +7 -0
  2. package/dist/adapter-policy.d.ts +29 -0
  3. package/dist/adapter-policy.d.ts.map +1 -0
  4. package/dist/adapter-policy.js +33 -0
  5. package/dist/adapter-policy.js.map +1 -0
  6. package/dist/admission.d.ts +75 -10
  7. package/dist/admission.d.ts.map +1 -1
  8. package/dist/admission.js +203 -8
  9. package/dist/admission.js.map +1 -1
  10. package/dist/answer-quality.d.ts +129 -0
  11. package/dist/answer-quality.d.ts.map +1 -0
  12. package/dist/answer-quality.js +197 -0
  13. package/dist/answer-quality.js.map +1 -0
  14. package/dist/approval.d.ts +73 -0
  15. package/dist/approval.d.ts.map +1 -0
  16. package/dist/approval.js +263 -0
  17. package/dist/approval.js.map +1 -0
  18. package/dist/artifacts.d.ts +9 -1
  19. package/dist/artifacts.d.ts.map +1 -1
  20. package/dist/artifacts.js +119 -2
  21. package/dist/artifacts.js.map +1 -1
  22. package/dist/authority.d.ts +321 -2
  23. package/dist/authority.d.ts.map +1 -1
  24. package/dist/authority.js +11 -1
  25. package/dist/authority.js.map +1 -1
  26. package/dist/conformance.d.ts +80 -0
  27. package/dist/conformance.d.ts.map +1 -0
  28. package/dist/conformance.js +264 -0
  29. package/dist/conformance.js.map +1 -0
  30. package/dist/derivation.d.ts +40 -0
  31. package/dist/derivation.d.ts.map +1 -0
  32. package/dist/derivation.js +158 -0
  33. package/dist/derivation.js.map +1 -0
  34. package/dist/digest.d.ts +10 -0
  35. package/dist/digest.d.ts.map +1 -0
  36. package/dist/digest.js +45 -0
  37. package/dist/digest.js.map +1 -0
  38. package/dist/evidence.d.ts +77 -0
  39. package/dist/evidence.d.ts.map +1 -0
  40. package/dist/evidence.js +101 -0
  41. package/dist/evidence.js.map +1 -0
  42. package/dist/export-port.d.ts +13 -0
  43. package/dist/export-port.d.ts.map +1 -0
  44. package/dist/export-port.js +2 -0
  45. package/dist/export-port.js.map +1 -0
  46. package/dist/index.d.ts +35 -11
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +42 -6
  49. package/dist/index.js.map +1 -1
  50. package/dist/input.d.ts +52 -0
  51. package/dist/input.d.ts.map +1 -1
  52. package/dist/input.js +15 -0
  53. package/dist/input.js.map +1 -1
  54. package/dist/intent.d.ts +37 -0
  55. package/dist/intent.d.ts.map +1 -0
  56. package/dist/intent.js +46 -0
  57. package/dist/intent.js.map +1 -0
  58. package/dist/judgment.d.ts +131 -0
  59. package/dist/judgment.d.ts.map +1 -0
  60. package/dist/judgment.js +249 -0
  61. package/dist/judgment.js.map +1 -0
  62. package/dist/loop.d.ts +79 -9
  63. package/dist/loop.d.ts.map +1 -1
  64. package/dist/loop.js +1070 -178
  65. package/dist/loop.js.map +1 -1
  66. package/dist/metrics.js +8 -8
  67. package/dist/metrics.js.map +1 -1
  68. package/dist/outcome.d.ts +223 -0
  69. package/dist/outcome.d.ts.map +1 -0
  70. package/dist/outcome.js +326 -0
  71. package/dist/outcome.js.map +1 -0
  72. package/dist/plan-digest.d.ts +16 -0
  73. package/dist/plan-digest.d.ts.map +1 -0
  74. package/dist/plan-digest.js +45 -0
  75. package/dist/plan-digest.js.map +1 -0
  76. package/dist/planner.d.ts +43 -0
  77. package/dist/planner.d.ts.map +1 -1
  78. package/dist/planner.js +132 -0
  79. package/dist/planner.js.map +1 -1
  80. package/dist/provenance.d.ts +37 -0
  81. package/dist/provenance.d.ts.map +1 -0
  82. package/dist/provenance.js +127 -0
  83. package/dist/provenance.js.map +1 -0
  84. package/dist/reconcile.d.ts +48 -0
  85. package/dist/reconcile.d.ts.map +1 -0
  86. package/dist/reconcile.js +20 -0
  87. package/dist/reconcile.js.map +1 -0
  88. package/dist/record.d.ts +129 -22
  89. package/dist/record.d.ts.map +1 -1
  90. package/dist/record.js +53 -1
  91. package/dist/record.js.map +1 -1
  92. package/dist/regression.d.ts +130 -0
  93. package/dist/regression.d.ts.map +1 -0
  94. package/dist/regression.js +113 -0
  95. package/dist/regression.js.map +1 -0
  96. package/dist/rollup.d.ts +72 -0
  97. package/dist/rollup.d.ts.map +1 -0
  98. package/dist/rollup.js +117 -0
  99. package/dist/rollup.js.map +1 -0
  100. package/dist/selection.d.ts +334 -0
  101. package/dist/selection.d.ts.map +1 -0
  102. package/dist/selection.js +481 -0
  103. package/dist/selection.js.map +1 -0
  104. package/dist/spans.d.ts +77 -2
  105. package/dist/spans.d.ts.map +1 -1
  106. package/dist/spans.js +98 -25
  107. package/dist/spans.js.map +1 -1
  108. package/dist/step-lifecycle.d.ts +303 -0
  109. package/dist/step-lifecycle.d.ts.map +1 -0
  110. package/dist/step-lifecycle.js +304 -0
  111. package/dist/step-lifecycle.js.map +1 -0
  112. package/dist/tool-invoker.d.ts +58 -3
  113. package/dist/tool-invoker.d.ts.map +1 -1
  114. package/dist/tool-invoker.js +26 -1
  115. package/dist/tool-invoker.js.map +1 -1
  116. package/dist/trace-facts.d.ts +93 -0
  117. package/dist/trace-facts.d.ts.map +1 -0
  118. package/dist/trace-facts.js +82 -0
  119. package/dist/trace-facts.js.map +1 -0
  120. package/dist/types.d.ts +223 -1
  121. package/dist/types.d.ts.map +1 -1
  122. package/dist/types.js +8 -0
  123. package/dist/types.js.map +1 -1
  124. package/package.json +17 -8
@@ -1,3 +1,4 @@
1
+ import type { ToolObservationV1 } from './tool-invoker.js';
1
2
  import type { Intent, PlanStep, ToolSpec } from './types.js';
2
3
  import type { StepRiskClass } from '@agenticprimitives/tool-policy';
3
4
  /** What the caller presented as its authority. OPAQUE to the loop — it is handed to the verifier and
@@ -7,6 +8,18 @@ export interface MandatePresentation {
7
8
  ref: string;
8
9
  /** The wire itself. The loop passes it through untouched. */
9
10
  wire: unknown;
11
+ /** Spec 448 rule 4 (hand-off under a plan-bound parent) — the step this run executes is ONE STEP OF A PLAN its parent
12
+ * mandate was signed over, handed to this agent: the parent's plan as written and the step's index in it
13
+ * (`planMembershipOf`). The verifier recomputes the digest, requires the executed step to be that member exactly, judges
14
+ * every plan binding against the parent plan's digest, and counts the use under the parent's step. Evidence, never
15
+ * authority: a membership the verifier cannot reproduce is refused. */
16
+ planMember?: PlanMembershipV1;
17
+ }
18
+ /** A step's membership of a signed plan: the plan as written, its digest, and which step. */
19
+ export interface PlanMembershipV1 {
20
+ planDigest: string;
21
+ steps: import('./types.js').PlanStep[];
22
+ index: number;
10
23
  }
11
24
  /** A step as the authority layer sees it: the plan's step joined to its tool's DECLARATION. Capability and
12
25
  * risk come from the tool, not the plan — a planner cannot lower a risk by describing a step differently. */
@@ -38,14 +51,24 @@ export interface StepAuthorityRequest {
38
51
  step: ResolvedStep;
39
52
  /** Whether this check follows an approval. A verifier may not need to know; a receipt does. */
40
53
  afterApproval: boolean;
54
+ /** Spec 408 §2.3 — the digest of the plan this run is executing (`planDigest`), computed by the loop
55
+ * once per admitted plan. A mandate that binds a plan is judged against it on every step. */
56
+ planDigest?: string;
57
+ /** Spec 448 rule 6 — on the re-check after an approval: the approvals the loop VERIFIED (by `ApprovalVerifier`) and
58
+ * counted against each obligation. Absent on the first check. */
59
+ approvals?: VerifiedApprovalV1[];
41
60
  }
42
61
  /** An UNSATISFIED condition attached to the authority. Not a UI prompt. */
43
62
  export interface Obligation {
44
63
  kind: 'second-party-approval' | 'quorum' | 'fresh-authorization' | 'disclosure' | (string & {});
64
+ /** `distinctParty` (spec 448 §0, N-1) — a DECLARED approval policy requires a party distinct from the mandate's
65
+ * accountability root: the principal's own voice never discharges it. Absent ⇒ no such declaration, and a
66
+ * Person-class root may discharge a second-party approval in her own voice (`judgeApprovals`). */
45
67
  dischargeableBy: {
46
68
  role?: string;
47
69
  agents?: string[];
48
70
  threshold?: number;
71
+ distinctParty?: boolean;
49
72
  };
50
73
  /** What imposed it, by reference — the caveat, the policy, the risk class. */
51
74
  imposedBy: string;
@@ -65,6 +88,16 @@ export interface DecisionEvidence {
65
88
  allowed: boolean;
66
89
  reason?: string;
67
90
  }>;
91
+ /** Spec 448 rule 4 — what bound the act: the plan digest, an on-chain redemption, a per-request challenge, or
92
+ * (only under a verifier's named opt-out) the intent alone. Absent on evidence a verifier did not classify. */
93
+ binding?: 'plan' | 'intent-only' | 'on-chain' | 'per-challenge';
94
+ /** Spec 448 rule 8 (audit H-8) — for a self-acting step, WHO ASKED: the caller's standing as the host admitted it
95
+ * (`self`, `party`, `pairwise`, `anonymous`) and its reference. The session the receipt names as authority is this
96
+ * caller's, never only the agent's. */
97
+ caller?: {
98
+ kind: string;
99
+ ref?: string;
100
+ };
68
101
  /** Spec 383 — the authority chain the leaf descends from, verified whole by the verifier (structural mirror
69
102
  * of `delegation.AuthorityChainV1`): every grant by reference, leaf first; the accountability root; the
70
103
  * acting agent. A receipt three hops away names each actor and grant from this, never from the last link. */
@@ -81,6 +114,24 @@ export interface DecisionEvidence {
81
114
  depth: number;
82
115
  chainDigest: string;
83
116
  };
117
+ /** Spec 450 §15 (Q1-A) — the chain reads the decision rested on (structural mirror of `delegation.DecisionObservationV1`):
118
+ * each revocation and signature read, exactly as the verifier's checks port returned it, block and custody epoch as
119
+ * decimal strings. A verifier that judged nothing on chain sets none. Carried to the receipt unchanged. */
120
+ observations?: Array<{
121
+ kind: 'signature' | 'revocation' | 'session-acceptance' | 'custody-epoch';
122
+ subject: string;
123
+ digest: string;
124
+ chainId: number;
125
+ blockNumber: string;
126
+ blockHash: string;
127
+ observedAt: number;
128
+ source: string;
129
+ codeClass: string | null;
130
+ custodyEpoch: string | null;
131
+ epochObservedAt: number;
132
+ notAfter: number;
133
+ derivation: 'chain' | 'derived';
134
+ }>;
84
135
  }
85
136
  export type MandateDecision = {
86
137
  decision: 'allow';
@@ -95,8 +146,53 @@ export type MandateDecision = {
95
146
  reasons: DecisionReason[];
96
147
  evidence: DecisionEvidence;
97
148
  };
149
+ /** What `MandateVerifier.begin` answers — the use ledger's word for this step (spec 448 rule 4). */
150
+ export type AttemptBeginV1 =
151
+ /** `slot: 'none'` — this step's use is counted elsewhere (on chain, by the venue's challenge); the verifier stored no
152
+ * slot. The loop then never parks it as effect-uncertain and never re-invokes it on an answer. */
153
+ {
154
+ status: 'begun';
155
+ slot?: 'none';
156
+ }
157
+ /** `operationId` / `holder`: the key the held attempt gave the downstream and the run that began it, when the ledger
158
+ * records them. A ledger that does not is never handed an automatic retry (`step-lifecycle.ts`). */
159
+ | {
160
+ status: 'held';
161
+ attempt: string;
162
+ retried: boolean;
163
+ operationId?: string;
164
+ holder?: string;
165
+ } | {
166
+ status: 'done';
167
+ };
98
168
  export interface MandateVerifier {
99
169
  verify(req: StepAuthorityRequest): Promise<MandateDecision>;
170
+ /**
171
+ * Spec 448 rule 4 (audit H-4 fix-ups 1–3) — VERIFYING AGAIN IS NOT PERFORMING AGAIN, AND NOTHING IS PERFORMED TWICE. The
172
+ * loop calls this once per attempt to perform an allowed step, immediately before the effect, with a token naming the
173
+ * attempt. `begun`: this attempt holds the step and may act. `held`: an earlier attempt began and recorded no completion
174
+ * (it may have acted, may still be acting) — never taken over on a timer. `done`: the effect is recorded. `retryOf` names
175
+ * a held attempt to hand the step over from; the loop passes it only when the effect is known absent and the tool dedups
176
+ * by operation id (once), or when the principal said the effect does not exist. A verifier that counts uses must
177
+ * implement `begin`, `complete` and `release`; one that does not count (a test double) may leave them out.
178
+ */
179
+ begin?(req: StepAuthorityRequest & {
180
+ decision: MandateDecision;
181
+ attempt: string;
182
+ retryOf?: string;
183
+ operationId?: string;
184
+ }): Promise<AttemptBeginV1>;
185
+ /** The effect of this step exists (the tool returned, or reconcile found it): no later attempt begins. */
186
+ complete?(req: StepAuthorityRequest & {
187
+ decision: MandateDecision;
188
+ attempt: string;
189
+ }): Promise<void>;
190
+ /** The attempt named by `attempt` performed nothing (a question asked first, or `NotPerformed`); the next may begin.
191
+ * Called only by the runner that began that attempt. */
192
+ release?(req: StepAuthorityRequest & {
193
+ decision: MandateDecision;
194
+ attempt: string;
195
+ }): Promise<void>;
100
196
  }
101
197
  /** Policy: WHAT RULES govern exercising authority the mandate grants. Distinct from the mandate (what was
102
198
  * granted) and from approval (what remains unsatisfied). Returns obligations to ADD; it never removes one
@@ -116,10 +212,181 @@ export interface ApprovalRequest {
116
212
  obligations: Obligation[];
117
213
  /** The evidence the verifier produced — so the approver sees the EFFECTIVE authority, never a summary. */
118
214
  evidence: DecisionEvidence;
215
+ /** Spec 448 rule 6 — the digest of the plan the step was checked under (`planDigest`), which every approval's
216
+ * `ApprovalBindingV1.planDigest` must equal. An approver signs this, never a digest it recomputed from a plan it
217
+ * guessed. */
218
+ planDigest: string;
119
219
  }
220
+ /**
221
+ * Spec 448 rule 6 (audit H-9) — ONE APPROVAL, as the approval port returns it. The loop does not believe it: it hands
222
+ * each record to the `ApprovalVerifier` with the binding below and counts only what the verifier confirms, against the
223
+ * obligation's declared approvers (`agents`), role and threshold.
224
+ */
225
+ export interface ApprovalRecordV1 {
226
+ /** A stable reference for the receipt (the signed record's id or hash). */
227
+ ref: string;
228
+ /** The party the record says approved. The verifier's answer, not this, is what is counted. */
229
+ approver: string;
230
+ /** Which obligation of the request (its index in `ApprovalRequest.obligations`) this record discharges. */
231
+ obligationIndex: number;
232
+ /** What the verifier judges — a signature over `approvalDigest(binding)`, a decision record's reference… Opaque here. */
233
+ evidence: unknown;
234
+ }
235
+ /** What an approval must be bound to: THIS mandate, THIS run, THIS step, THESE arguments, THIS plan, THIS obligation.
236
+ * Built only by `approvalBindingFor` (spec 448 §0, N-1 review R2-2): under a plan-bound, single-use mandate the run is
237
+ * named BY THAT MANDATE (`runRef` = `mandate:<ref>`), never by a presenter's field; otherwise it is the host's run
238
+ * reference, which a new run may use only once (`OrchestrationPorts.runRefs`). */
239
+ export interface ApprovalBindingV1 {
240
+ /** The mandate the step runs under: the plan-bound grant its use is counted under (`evidence.countedUnder`; for a
241
+ * hand-off, the parent's), else the presented mandate's reference (`self` for a self-acting step). */
242
+ mandateRef: string;
243
+ runRef: string;
244
+ stepRef: string;
245
+ toolId: string;
246
+ capabilityId: string;
247
+ /** `valueDigest(step.args)` — the arguments the step will run with. */
248
+ argsDigest: string;
249
+ /** The plan the run is executing (`planDigest`), or '' when the loop has none yet. */
250
+ planDigest: string;
251
+ obligationKind: string;
252
+ obligationIndex: number;
253
+ approver: string;
254
+ }
255
+ /**
256
+ * Spec 448 §0 (approvals, N-1) — HOW the verifier established the approver's voice. Only a verdict that states one of
257
+ * these may count as the PRINCIPAL'S OWN VOICE (`judgeApprovals`): a wire is authority to act, never approval of this act,
258
+ * so a verifier that confirms anything else (the delegation itself, a session, an assertion) states no voice.
259
+ * - `step-signature`: a signature by the approver's own account over `approvalDigest(binding)` — this run, this step,
260
+ * this tool, these arguments, this plan, this obligation.
261
+ * - `standing-approval`: a `StandingApprovalV1` the approver signed for ONE standing wire (`wireRef`), its act and its
262
+ * bounds, checked against that wire (capability, payment bounds, expiry, revocation). It counts only when the step
263
+ * runs under that wire (a link of the verified chain).
264
+ */
265
+ export type ApprovalVoiceV1 = {
266
+ form: 'step-signature';
267
+ } | {
268
+ form: 'standing-approval';
269
+ wireRef: string;
270
+ /** The verifier held the record's payment bounds (payee, asset, cap) equal to the wire's — a value act. */
271
+ payment?: boolean;
272
+ /** The argument bounds the record was SIGNED with (argument → allowed values), for an act whose tool declares
273
+ * `standingApprovalBounds`. A standing approval of a non-value act is admissible only with these (spec 448 §0, L-1). */
274
+ bounds?: Record<string, string[]>;
275
+ };
276
+ /** The verifier's verdict on one record. `roles` are the roles the approver HOLDS, read by the verifier (a chain read,
277
+ * a governance record) — never taken from the record. `voice`: how the signature was established (above). */
278
+ export type ApprovalVerdict = {
279
+ valid: true;
280
+ approver: string;
281
+ roles: string[];
282
+ voice?: ApprovalVoiceV1;
283
+ } | {
284
+ valid: false;
285
+ reason: string;
286
+ };
287
+ /**
288
+ * Spec 448 §0 (approvals, N-1 + review M-2) — the approval policy the principal DECLARED, read from its signed record. A
289
+ * positive `{ declared: false }` is the only "no policy"; anything else unreadable or malformed refuses. `declaredBy` must
290
+ * be the principal the policy is read for.
291
+ * - `threshold`: DISTINCT accepted voices the second-party approval needs (one approver counts once).
292
+ * - `distinctParty: true`: the principal's own voice never discharges it (a two-party rule).
293
+ * - `principalCounts`: whether the principal's own voice counts toward `threshold`. Absent ⇒ YES for a person's own
294
+ * resources (`distinctParty` absent); an organization, treasury or service root's own voice never counts anyway.
295
+ */
296
+ export type DeclaredApprovalPolicyV1 = {
297
+ declared: false;
298
+ } | {
299
+ declared: true;
300
+ recordDigest: string;
301
+ declaredBy: string;
302
+ threshold?: number;
303
+ distinctParty?: boolean;
304
+ principalCounts?: boolean;
305
+ };
306
+ /**
307
+ * Spec 448 §0 (approvals, N-1 + review H-1) — SOURCED FACTS about an account, each read from the record of authority by
308
+ * the host's port (`harness.chainPrincipalFacts`), never asserted by a caller. "She is a Person" needs ALL of them, and
309
+ * each one alone can refuse — `atl:agentType` alone is writable by the account itself, so it is never enough:
310
+ * - `agentType` `person` (ADR-0046 / ADR-0061 `atl:agentType` on the SA subject);
311
+ * - `codeClass` `contract` (a Smart Agent; an EIP-7702 designator or a bare EOA is not her account here);
312
+ * - `charteredUnder` EMPTY — no `ap:charteredUnder` edge in ANY status (proposed, active, revoked: a revoked edge stays
313
+ * recorded) names this account as its subject, read COMPLETELY (a service, treasury or coordinator is chartered under
314
+ * its owner; a person is chartered under nobody — and a subject that revoked its own charter was still chartered);
315
+ * - `names`: the primary typed name, if any, carries the person suffix, and no name carries a non-person typed suffix
316
+ * (names held in the past are not in storage — ADR-0012 forbids a log scan — a stated residual);
317
+ * - `custody`: not an organization's custody shape (`mode` 3), at least one custodian, at least one passkey.
318
+ * RESIDUAL until `atl:agentType` is write-once (spec 448 §P): EVERY account that was never chartered — every organization
319
+ * included, since organizations are not chartered — can relabel itself `person`. The charter edge is the only fact here
320
+ * beyond the account's own control; its custody can clear the rest: give away or clear its typed names, leave custody
321
+ * mode 3 (`ChangeMode`, its T4 quorum), add a passkey (`addPasskey`). A mode-3 organization needs its T4 quorum; any
322
+ * other never-chartered account needs only its controller, in a few visible transactions.
323
+ * And `approvalPolicy` — the declared approval policy (above).
324
+ */
325
+ export interface PrincipalFactsV1 {
326
+ agentType: string | null;
327
+ codeClass: 'none' | 'eip7702-designator' | 'contract' | null;
328
+ /** Owners of ACTIVE `ap:charteredUnder` edges whose subject is this account. `[]` = none. */
329
+ charteredUnder: string[];
330
+ /** Every typed name the account holds, with the class its suffix names: `person`, `other`, or null (an untyped name). */
331
+ names: Array<{
332
+ name: string;
333
+ primary: boolean;
334
+ suffixClass: 'person' | 'other' | null;
335
+ }>;
336
+ /** The account's custody as storage records it (R2-1): the CustodyPolicy `custodyMode` (0 none, 1 hybrid, 2 threshold,
337
+ * 3 organization — changed only by its T4 custody quorum), `custodianCount` (external custodians + passkeys) and
338
+ * `passkeyCount` (P-256 credentials). An agent account can never be another's custodian (ERC-165 marker check), so a
339
+ * custodian is a key. Storage cannot tell an authenticator from a P-256 key a runtime holds: a passkey is a custody
340
+ * fact, not proof of a person. */
341
+ custody: {
342
+ mode: number;
343
+ custodianCount: number;
344
+ passkeyCount: number;
345
+ };
346
+ approvalPolicy: DeclaredApprovalPolicyV1;
347
+ }
348
+ /** Spec 448 §0 (N-1 review R2-2) — begins a run reference once, durably and atomically; a second begin answers false. */
349
+ export interface RunRefLedger {
350
+ begin(runRef: string): Promise<boolean>;
351
+ }
352
+ export interface PrincipalFactsPort {
353
+ factsOf(agent: string): Promise<PrincipalFactsV1>;
354
+ }
355
+ /** Judges one approval record against its binding. REQUIRED whenever a step carries an obligation: a loop with an
356
+ * approval port and no approval verifier refuses the step (`no_approval_verifier`). */
357
+ export interface ApprovalVerifier {
358
+ verify(input: {
359
+ record: ApprovalRecordV1;
360
+ obligation: Obligation;
361
+ binding: ApprovalBindingV1;
362
+ }): Promise<ApprovalVerdict>;
363
+ }
364
+ /** An approval the loop verified and counted — what the re-check receives and the receipt names. */
365
+ export interface VerifiedApprovalV1 {
366
+ ref: string;
367
+ approver: string;
368
+ obligationKind: string;
369
+ obligationIndex: number;
370
+ /** Spec 448 §0 (N-1) — present when this approval counted as the PRINCIPAL'S OWN VOICE (the chain's Person-class root,
371
+ * no declared second-party policy): the form of the evidence that carried it. */
372
+ ownVoice?: ApprovalVoiceV1['form'];
373
+ /** With `ownVoice`: how strong the "she is a Person" fact was (`PERSON_FACT_STRENGTH`) — the residual on the receipt. */
374
+ personFact?: typeof PERSON_FACT_STRENGTH;
375
+ }
376
+ /**
377
+ * Spec 448 §0 / §P (N-1 review R2-1) — THE STATED RESIDUAL of the own-voice rule's Person fact, recorded on every receipt
378
+ * an own voice discharged. Until `atl:agentType` is write-once in a contract generation (§P), the Person fact is as strong
379
+ * as the STORAGE it is read from: the account's own type record (writable by itself), no charter edge in any status, no
380
+ * non-person typed name held now (names held in the past are not in storage), and custody that is not an organization's
381
+ * (`custodyMode` ≠ 3) with at least one passkey. Only the charter edge is beyond the account's own control: names can be
382
+ * given away or cleared, mode 3 left by the T4 quorum, a passkey added by custody. So EVERY never-chartered account —
383
+ * every organization included — can relabel itself `person`: a mode-3 organization with its T4 quorum, any other with its
384
+ * controller alone, in a few visible transactions. Closed only by the write-once `atl:agentType` (§P).
385
+ */
386
+ export declare const PERSON_FACT_STRENGTH: "storage-facts.v1:self-writable-type";
120
387
  export type ApprovalOutcome = {
121
388
  status: 'discharged';
122
- records: string[];
389
+ records: ApprovalRecordV1[];
123
390
  } | {
124
391
  status: 'refused';
125
392
  by?: string;
@@ -195,11 +462,20 @@ export interface ExecutionBindingV1 {
195
462
  rootPrincipal?: string;
196
463
  originatingAgent?: string;
197
464
  actingAgent: string;
465
+ /** Spec 397 — the hop came THROUGH A HOST as the person: the registered client and the template whose wire
466
+ * admitted it (`ask-as-me`), or whose standing wire the step's mandate was derived from (`act-as-me`). Ids only. */
467
+ via?: {
468
+ client: string;
469
+ template: string;
470
+ };
198
471
  };
199
472
  }
200
473
  export interface StepReceipt {
201
474
  /** Spec 367 §5 — the admitted binding this step ran under. */
202
475
  binding?: ExecutionBindingV1;
476
+ /** Spec 421 W2 — per argument of an ACT, whether its value was in her words or only in what the run read (and whether
477
+ * that was untrusted). Evidence for audit and the signing card; no verifier reads it. */
478
+ derivation?: Record<string, import('./derivation.js').ArgDerivationV1>;
203
479
  /** Spec 360 — what followed the act, per declared effect. `ok:false` is a disclosure that failed while
204
480
  * the act stood: visible evidence, never a reason to unwind the step (the loop isolates the throw). */
205
481
  effects?: Array<{
@@ -248,14 +524,27 @@ export interface StepReceipt {
248
524
  because: string;
249
525
  }>;
250
526
  approvalRecords?: string[];
527
+ /** Spec 448 rule 6 — who discharged each obligation, as the ApprovalVerifier confirmed it. */
528
+ approvedBy?: VerifiedApprovalV1[];
251
529
  idempotencyKey?: string;
252
530
  inputDigest?: string;
531
+ /** The step's arguments AS PLANNED (resolved against earlier results only, before names became addresses). A resume
532
+ * compares a replayed step against this: a replay never re-resolves names, so it cannot reproduce `inputDigest` for a
533
+ * step whose argument was a name ("missio nexus") — and refusing it broke every resume past such a step. */
534
+ planArgsDigest?: string;
253
535
  outputDigest?: string;
536
+ /** Spec 410 §2 — WHAT THE ADAPTER SAW, beside the output digest: which end committed this and what it can
537
+ * show. `attests` is the one word a stranger reads first; only `confirmed` may be called "verified at commit". */
538
+ observation?: ToolObservationV1;
539
+ attests?: ToolObservationV1['outcome'];
540
+ /** Spec 410 §3 — this attempt found the operation already done and DID NOT ACT; the observation is the
541
+ * reconcile's. A retry after a lost response leaves this, never a second effect. */
542
+ reconciled?: true;
254
543
  error?: string;
255
544
  /** Spec 350 §3.4 — set when `status === 'suspended'` because the tool asked the person for something: the
256
545
  * kind of prompt and, for a signature, what must be signed by whom. Never the answers. */
257
546
  pendingInput?: {
258
- kind: 'data' | 'signature' | 'confirmation' | 'commitment' | 'authority';
547
+ kind: 'data' | 'signature' | 'confirmation' | 'commitment' | 'authority' | 'effect-uncertain';
259
548
  digest?: string;
260
549
  signer?: string;
261
550
  fields?: string[];
@@ -269,6 +558,13 @@ export interface StepReceipt {
269
558
  version: string;
270
559
  commitment: string;
271
560
  };
561
+ /** Spec 414 A1 — the SKILL.md contract that governed THIS step (finer than the playbook): canonical id, version
562
+ * and the contract's content digest, as the compiled definition says its tool came from. Grants nothing. */
563
+ skill?: {
564
+ id: string;
565
+ version: string;
566
+ contractDigest: string;
567
+ };
272
568
  startedAt: number;
273
569
  completedAt: number;
274
570
  }
@@ -287,6 +583,11 @@ export type RunEvent = RunEventStamp & ({
287
583
  runRef: string;
288
584
  intent: Intent;
289
585
  presentedRef: string | null;
586
+ work?: {
587
+ endeavorId: string;
588
+ commitmentId?: string;
589
+ planStepId?: string;
590
+ };
290
591
  } | {
291
592
  type: 'PlanCreated';
292
593
  runRef: string;
@@ -416,8 +717,23 @@ export interface EffectSink {
416
717
  export interface OrchestrationPorts {
417
718
  /** REQUIRED once any tool declares a capability. A run that reaches such a step without one fails closed. */
418
719
  mandateVerifier?: MandateVerifier;
720
+ /** REQUIRED for a step whose risk class carries obligations (`tool-policy.MINIMUM_AUTHORITY`: high, critical):
721
+ * absent ⇒ the loop refuses such a step (`no_policy_port`) rather than run it on the mandate alone (spec 448 rule 6). */
419
722
  policyEvaluator?: PolicyEvaluator;
420
723
  approvalPort?: ApprovalPort;
724
+ /** Spec 448 rule 6 — judges every record an `ApprovalPort` returns. REQUIRED whenever a step carries obligations. */
725
+ approvalVerifier?: ApprovalVerifier;
726
+ /** Spec 448 §0 (N-1 review R2-2) — THE RUN-REFERENCE LEDGER: a NEW run (no `resume`) that names its `runRef` begins it
727
+ * here, and a reference already begun refuses the run (`run_ref_reused`). REQUIRED WHEN USED: an approval whose binding
728
+ * rests on the run reference alone (a self-acting step) is judged only on a run this ledger began, a checkpoint resume
729
+ * of one, or a run whose reference the loop generated. `harness.runRefLedger(uses)` binds it to the durable use ledger.
730
+ * A `resume` is trusted as fresh without a `begin`, so a host MUST take `resume` only from its own run store, never
731
+ * from its caller: a caller-supplied resume would replay a run-anchored approval under a reused reference. */
732
+ runRefs?: RunRefLedger;
733
+ /** Spec 448 §0 (N-1) — sourced facts about the principal (the chain's root, or a self-acting step's principal): what
734
+ * makes her a Person, and her declared approval policy. REQUIRED WHEN USED: absent ⇒ her own voice never counts; bound
735
+ * ⇒ read for every second-party approval, and an unreadable or malformed answer refuses the approval. */
736
+ principalFacts?: PrincipalFactsPort;
421
737
  /** Every step emits a receipt; absent ⇒ receipts are kept on the RunResult only. */
422
738
  receiptSink?: ReceiptSink;
423
739
  /** Spec 360 — discharges a playbook's declared consequences after a step succeeds. Absent ⇒ declared
@@ -426,6 +742,9 @@ export interface OrchestrationPorts {
426
742
  /** Spec 367 W1 — judges the plan's SHAPE before any step runs (the verifier judges authority). Absent ⇒
427
743
  * every well-formed plan is executed, which is the behaviour every run had before the port existed. */
428
744
  planAdmission?: import('./admission.js').PlanAdmission;
745
+ /** Spec 410 §3 — asked before every non-read step whether THIS operation already happened (reconcile → verify →
746
+ * act). Absent ⇒ no reconcile, the behaviour every run had before the port existed. */
747
+ reconcile?: import('./reconcile.js').ReconcilePort;
429
748
  events?: RunEventSink;
430
749
  }
431
750
  //# sourceMappingURL=authority.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"authority.d.ts","sourceRoot":"","sources":["../src/authority.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEpE;oGACoG;AACpG,MAAM,WAAW,mBAAmB;IAClC,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,IAAI,EAAE,OAAO,CAAC;CACf;AAED;8GAC8G;AAC9G,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,E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CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,6GAA6G;IAC7G,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC;8HAC0H;IAC1H,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,qHAAqH;IACrH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;;;;mHAK+G;IAC/G,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB;;8GAE0G;IAC1G,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,oFAAoF;IACpF,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;wGACoG;IACpG,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;4GACwG;IACxG,aAAa,CAAC,EAAE,OAAO,gBAAgB,EAAE,aAAa,CAAC;IACvD;4FACwF;IACxF,SAAS,CAAC,EAAE,OAAO,gBAAgB,EAAE,aAAa,CAAC;IACnD,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB"}
package/dist/authority.js CHANGED
@@ -1,2 +1,12 @@
1
- export {};
1
+ /**
2
+ * Spec 448 §0 / §P (N-1 review R2-1) — THE STATED RESIDUAL of the own-voice rule's Person fact, recorded on every receipt
3
+ * an own voice discharged. Until `atl:agentType` is write-once in a contract generation (§P), the Person fact is as strong
4
+ * as the STORAGE it is read from: the account's own type record (writable by itself), no charter edge in any status, no
5
+ * non-person typed name held now (names held in the past are not in storage), and custody that is not an organization's
6
+ * (`custodyMode` ≠ 3) with at least one passkey. Only the charter edge is beyond the account's own control: names can be
7
+ * given away or cleared, mode 3 left by the T4 quorum, a passkey added by custody. So EVERY never-chartered account —
8
+ * every organization included — can relabel itself `person`: a mode-3 organization with its T4 quorum, any other with its
9
+ * controller alone, in a few visible transactions. Closed only by the write-once `atl:agentType` (§P).
10
+ */
11
+ export const PERSON_FACT_STRENGTH = 'storage-facts.v1:self-writable-type';
2
12
  //# sourceMappingURL=authority.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"authority.js","sourceRoot":"","sources":["../src/authority.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"authority.js","sourceRoot":"","sources":["../src/authority.ts"],"names":[],"mappings":"AAkUA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,qCAA8C,CAAC"}
@@ -0,0 +1,80 @@
1
+ import type { AdmissionRule, AdmissionViolation } from './admission.js';
2
+ import type { ToolSpec } from './types.js';
3
+ /** What the ontology says an outcome class entails — the shape `@agenticprimitives/ontology` exports. */
4
+ export interface OutcomeClassView {
5
+ class: string;
6
+ label: string;
7
+ entails: ReadonlyArray<{
8
+ capability: string;
9
+ carries?: readonly string[];
10
+ bound?: string;
11
+ }>;
12
+ bounds: Readonly<Record<string, {
13
+ arg: string;
14
+ kind: 'amount' | 'named';
15
+ }>>;
16
+ /** The words that name this outcome (the ontology's), for `classifyOpenIntent`. */
17
+ words?: readonly string[];
18
+ /** How each bound is read off a sentence (the ontology's). */
19
+ reads?: Readonly<Record<string, {
20
+ kind: 'money';
21
+ } | {
22
+ kind: 'after';
23
+ prepositions: readonly string[];
24
+ }>>;
25
+ }
26
+ export type MoneyBoundReading = {
27
+ kind: 'none';
28
+ } | {
29
+ kind: 'amount';
30
+ value: number;
31
+ } | {
32
+ kind: 'unread';
33
+ why: string;
34
+ };
35
+ /** Read the money BOUND a sentence states — see the block above. Bounded: a goal past 4,000 characters is read to there. */
36
+ export declare function readMoneyBound(input: string): MoneyBoundReading;
37
+ /**
38
+ * Spec 410 §6 — THE ASK'S CLASSIFIER, rendered from the ontology: does this sentence name an OPEN intent of a published
39
+ * outcome class? Matched on the class's own words, whole and case-insensitive; the bounds read the way the class says
40
+ * they are read. Deterministic — the same sentence classifies the same way on every run, so the stated outcome the
41
+ * mandate digests is stable across a resume. Null for every closed intent ("pay alice 10"), which is judged by nothing
42
+ * here. A sentence that names two classes is not classified: one outcome per ask.
43
+ */
44
+ export declare function classifyOpenIntent(goal: string, classes: ReadonlyArray<OutcomeClassView>): StatedOutcomeV1 | null;
45
+ /** What an open intent states: `intent.constraints.outcome`. */
46
+ export interface StatedOutcomeV1 {
47
+ /** The outcome class IRI or CURIE (`apint:OrganizedGathering`). */
48
+ class: string;
49
+ /** The bounds the sentence stated, by the class's bound keys (`{ budget: 2000, venue: 'the hall' }`). */
50
+ bounds?: Record<string, string | number>;
51
+ /** RUNC-4 — bound keys the sentence STATED but the reader could not pin to one value ("under two thousand", "$20
52
+ * each", two figures). An effect held to an unread bound is not conformant: unread is never "no bound". */
53
+ unread?: string[];
54
+ }
55
+ export declare function statedOutcomeOf(intent: {
56
+ constraints?: Record<string, unknown>;
57
+ }): StatedOutcomeV1 | null;
58
+ /**
59
+ * The rule. `lookup` resolves an outcome class IRI to what it entails (the ontology's `outcomeClassOf`); a class
60
+ * the ontology does not publish entails NOTHING, so every consequential step under it is refused — a refusal
61
+ * that names the unknown class, never a silent pass.
62
+ */
63
+ export declare function outcomeConformance(lookup: (classIri: string) => OutcomeClassView | null): AdmissionRule;
64
+ /** For a caller that wants the split the spec names: what stays offered and what was refused. */
65
+ export declare function conformEffects(input: {
66
+ intent: {
67
+ constraints?: Record<string, unknown>;
68
+ };
69
+ plan: {
70
+ steps: Array<{
71
+ toolId: string;
72
+ args: Record<string, unknown>;
73
+ }>;
74
+ };
75
+ tools: ToolSpec[];
76
+ }, lookup: (classIri: string) => OutcomeClassView | null): {
77
+ offered: number[];
78
+ refused: AdmissionViolation[];
79
+ };
80
+ //# sourceMappingURL=conformance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformance.d.ts","sourceRoot":"","sources":["../src/conformance.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,yGAAyG;AACzG,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;I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