@agenticprimitives/agent-resolution 0.0.0-alpha.21 → 0.0.0-alpha.23
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 +15 -9
- package/dist/compose.d.ts +58 -7
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +116 -62
- package/dist/compose.js.map +1 -1
- package/dist/endpoint-control.d.ts +120 -13
- package/dist/endpoint-control.d.ts.map +1 -1
- package/dist/endpoint-control.js +215 -51
- package/dist/endpoint-control.js.map +1 -1
- package/dist/errors.d.ts +16 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +6 -0
- package/dist/errors.js.map +1 -1
- package/dist/freshness.d.ts +79 -5
- package/dist/freshness.d.ts.map +1 -1
- package/dist/freshness.js +149 -35
- package/dist/freshness.js.map +1 -1
- package/dist/index.d.ts +9 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/projection.d.ts +17 -3
- package/dist/projection.d.ts.map +1 -1
- package/dist/projection.js +20 -2
- package/dist/projection.js.map +1 -1
- package/dist/proof.d.ts +120 -18
- package/dist/proof.d.ts.map +1 -1
- package/dist/proof.js +279 -73
- package/dist/proof.js.map +1 -1
- package/dist/publication.d.ts +62 -6
- package/dist/publication.d.ts.map +1 -1
- package/dist/publication.js +28 -1
- package/dist/publication.js.map +1 -1
- package/dist/records.d.ts +3 -0
- package/dist/records.d.ts.map +1 -1
- package/dist/records.js.map +1 -1
- package/package.json +3 -3
- package/spec.md +5 -2
package/README.md
CHANGED
|
@@ -195,7 +195,7 @@ import {
|
|
|
195
195
|
} from '@agenticprimitives/agent-resolution';
|
|
196
196
|
|
|
197
197
|
// Ring-1: map DNTLS Service Record → AgentServicePublicationV1
|
|
198
|
-
// (agentId, channelId, sequence, surfaces[].uri/protocol, transportKeyBinding,
|
|
198
|
+
// (agentId, channelId, per-channel sequence, keyEpoch, surfaces[].uri/protocol, transportKeyBinding,
|
|
199
199
|
// publishedBy, publicationAuthorityRef, digest, proofs[] — then ERC-1271 sign)
|
|
200
200
|
declare function mapDntlsRecord(record: unknown): AgentServicePublicationV1;
|
|
201
201
|
declare const externalDntlsClient: { resolve(id: string): Promise<{ record: unknown; proof: unknown }> };
|
|
@@ -220,7 +220,9 @@ const resolve = createComposedResolver({
|
|
|
220
220
|
providers: [dntlsProvider],
|
|
221
221
|
verifier: publicClient,
|
|
222
222
|
// authorityCheck should also require AP facet → DNTLS commitment (bidirectional)
|
|
223
|
-
authorityCheck,
|
|
223
|
+
authorityCheck, // REQUIRED — no check, no resolution
|
|
224
|
+
continuity, // REQUIRED — a ContinuityStore, or 'stateless'
|
|
225
|
+
expectedChannelId, // REQUIRED — publicChannelFor(agent) | expectedChannelForGrant(grant)
|
|
224
226
|
minAssurance: 'signed-publication',
|
|
225
227
|
});
|
|
226
228
|
|
|
@@ -229,7 +231,7 @@ const result = await resolve(
|
|
|
229
231
|
{ requester: 'eip155:84532:0xaaa…', now: new Date().toISOString() },
|
|
230
232
|
'eip155:84532:0xbbb…',
|
|
231
233
|
);
|
|
232
|
-
// result.ok ⇒ VerifiedAgentResolutionV1 —
|
|
234
|
+
// result.ok ⇒ VerifiedAgentResolutionV1 — no spend / tool permission. 'stateless' ⇒ 'unanchored', never ok.
|
|
233
235
|
```
|
|
234
236
|
|
|
235
237
|
Full audit: [`dntls-comparison.md`](../../docs/architecture/dntls-comparison.md).
|
|
@@ -237,9 +239,9 @@ Full audit: [`dntls-comparison.md`](../../docs/architecture/dntls-comparison.md)
|
|
|
237
239
|
## A hash proves *unmodified*. It does not prove *current*.
|
|
238
240
|
|
|
239
241
|
A signed card proves nobody tampered with a snapshot — not that it is still in force. So every
|
|
240
|
-
publication carries a
|
|
241
|
-
Verification is fail-closed (
|
|
242
|
-
|
|
242
|
+
publication carries a per-channel `sequence`, `previousDigest`, `status`, `expiresAt`, and an
|
|
243
|
+
agent-wide `keyEpoch`. Verification is fail-closed (wrong channel, rollback, retired key epoch or
|
|
244
|
+
format, tombstones, equivocation, expiry, unauthorized publisher, undialled endpoint, stale keys):
|
|
243
245
|
|
|
244
246
|
```ts
|
|
245
247
|
import { verifyPublication } from '@agenticprimitives/agent-resolution';
|
|
@@ -248,12 +250,16 @@ const result = await verifyPublication(publication, {
|
|
|
248
250
|
expectedAgentId: 'eip155:84532:0xacme…',
|
|
249
251
|
now: new Date().toISOString(),
|
|
250
252
|
verifier: publicClient, // any { verifyHash } — a viem PublicClient fits
|
|
251
|
-
authorityCheck, //
|
|
252
|
-
|
|
253
|
+
authorityCheck, // REQUIRED: may this publisher publish for this agent?
|
|
254
|
+
expectedChannelId, // REQUIRED: from your grant, never the object
|
|
255
|
+
continuity: { kind: 'known', state, agent }, // REQUIRED | 'first-contact' | 'stateless'
|
|
253
256
|
requireEndpointProof: true,
|
|
257
|
+
endpointControl: { dial, nonces }, // the verifier dials
|
|
254
258
|
maxExposure: 'private',
|
|
255
259
|
});
|
|
256
260
|
|
|
261
|
+
if (result.nextContinuity) await store.put(result.nextContinuity); // also on a refused tombstone
|
|
262
|
+
// first contact: ok with channelRollbackExcluded: false
|
|
257
263
|
if (!result.ok) {
|
|
258
264
|
// Precise codes for YOUR logs; result.failures[].wireCode for anything you return to a caller.
|
|
259
265
|
if (result.freshness.conflict) escalate('publisher equivocation — possible key compromise');
|
|
@@ -266,7 +272,7 @@ rejected. It is evidence of publisher-key compromise, not a transient error.
|
|
|
266
272
|
### Rotation is cheap; identity never moves
|
|
267
273
|
|
|
268
274
|
Endpoint change, transport-key rotation, regional failover, protocol bump, and provider migration
|
|
269
|
-
all republish at `sequence + 1
|
|
275
|
+
all republish at `sequence + 1` per channel (key rotation also raises `keyEpoch`). **No grant is reissued and the canonical agent id does not change.**
|
|
270
276
|
|
|
271
277
|
## Private resolution grants, not private names
|
|
272
278
|
|
package/dist/compose.d.ts
CHANGED
|
@@ -1,24 +1,56 @@
|
|
|
1
1
|
import type { CanonicalAgentId, VerifiedPeerContextV1 } from '@agenticprimitives/types';
|
|
2
2
|
import { type ResolvedPeerPolicy } from './peer-gate.js';
|
|
3
3
|
import { type ResolutionFailure } from './errors.js';
|
|
4
|
-
import {
|
|
4
|
+
import type { AgentKeyEpochState, ChannelContinuityState, PublicationContinuity } from './freshness.js';
|
|
5
5
|
import { type Erc1271Verifier, type PublicationAuthorityCheck, type VerifyPublicationOptions } from './proof.js';
|
|
6
6
|
import type { AgentResolutionReference, ResolutionContextV1 } from './references.js';
|
|
7
7
|
import type { AgentResolutionProvider } from './ports.js';
|
|
8
8
|
import { type ResolutionAssurance, type VerifiedAgentResolutionV1 } from './results.js';
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Reads/writes what a client already accepted (NAME-3). Injected — this package holds no state.
|
|
11
|
+
*
|
|
12
|
+
* TWO records, two keys, neither taken from a publication:
|
|
13
|
+
* - `channel` — keyed by (agent, the channel the resolver EXPECTED): the sequence floor.
|
|
14
|
+
* - `agent` — keyed by the agent alone: the key-epoch floor + retired publishers. `get` returns it
|
|
15
|
+
* whenever it exists, INCLUDING for a channel the client has never read — that is how
|
|
16
|
+
* a first contact on a new channel still refuses a retired key epoch.
|
|
17
|
+
*
|
|
18
|
+
* `put` MUST be monotonic on both (compare-and-advance on `latestAcceptedSequence` and on
|
|
19
|
+
* `keyEpoch`; `compromisedPublishers` only grows): two resolutions racing must not let the older one
|
|
20
|
+
* overwrite a newer floor. A store that throws on either call fails the resolution — an unreadable
|
|
21
|
+
* floor is not "first contact".
|
|
22
|
+
*/
|
|
10
23
|
export interface ContinuityStore {
|
|
11
|
-
get(
|
|
12
|
-
|
|
24
|
+
get(agentId: CanonicalAgentId, expectedChannelId: string): Promise<{
|
|
25
|
+
channel?: ChannelContinuityState;
|
|
26
|
+
agent?: AgentKeyEpochState;
|
|
27
|
+
} | undefined>;
|
|
28
|
+
put(next: PublicationContinuity): Promise<void>;
|
|
13
29
|
}
|
|
14
30
|
export interface ComposedResolverOptions {
|
|
15
31
|
providers: readonly AgentResolutionProvider[];
|
|
16
32
|
verifier: Erc1271Verifier;
|
|
17
|
-
/**
|
|
18
|
-
authorityCheck
|
|
33
|
+
/** REQUIRED (NAME-4). No check ⇒ every resolution is refused. Use `selfPublishedOnly` for self-only. */
|
|
34
|
+
authorityCheck: PublicationAuthorityCheck;
|
|
19
35
|
/** Minimum assurance the caller will accept. A weaker result is a failure, never a silent pass. */
|
|
20
36
|
minAssurance?: ResolutionAssurance;
|
|
21
|
-
|
|
37
|
+
/**
|
|
38
|
+
* REQUIRED (NAME-3). A store, or the literal `'stateless'` — said out loud. A stateless resolver
|
|
39
|
+
* cannot detect a rollback, so it never returns `ok: true`: its best verdict is `unanchored`.
|
|
40
|
+
*/
|
|
41
|
+
continuity: ContinuityStore | 'stateless';
|
|
42
|
+
/**
|
|
43
|
+
* REQUIRED (NAME-3). The channel this resolver is entitled to read for a request — derived from
|
|
44
|
+
* what the CALLER holds (`publicChannelFor(expectedAgentId)` for public resolution;
|
|
45
|
+
* `expectedChannelForGrant(grant)` for a grant the caller was issued). It is never shown the
|
|
46
|
+
* publication. No function, or one that returns no channel, refuses the resolution; a publication
|
|
47
|
+
* on any other channel is refused whatever its sequence.
|
|
48
|
+
*/
|
|
49
|
+
expectedChannelId: (input: {
|
|
50
|
+
reference: AgentResolutionReference;
|
|
51
|
+
context: ResolutionContextV1;
|
|
52
|
+
expectedAgentId: CanonicalAgentId;
|
|
53
|
+
}) => string | undefined;
|
|
22
54
|
endpointControl?: VerifyPublicationOptions['endpointControl'];
|
|
23
55
|
minEndpointAssurance?: VerifyPublicationOptions['minEndpointAssurance'];
|
|
24
56
|
maxExposure?: VerifyPublicationOptions['maxExposure'];
|
|
@@ -50,9 +82,28 @@ export interface ComposedResolverOptions {
|
|
|
50
82
|
}
|
|
51
83
|
export type ComposedResolutionResult = {
|
|
52
84
|
ok: true;
|
|
85
|
+
verdict: 'current';
|
|
53
86
|
resolution: VerifiedAgentResolutionV1;
|
|
87
|
+
/**
|
|
88
|
+
* `false` on a first contact with this channel: a replay of an older publication on it could
|
|
89
|
+
* not have been excluded (bounded by the publication's expiry). `true` once a floor is stored.
|
|
90
|
+
*/
|
|
91
|
+
channelRollbackExcluded: boolean;
|
|
54
92
|
} | {
|
|
55
93
|
ok: false;
|
|
94
|
+
verdict: 'refused';
|
|
95
|
+
failures: readonly ResolutionFailure[];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Everything verified EXCEPT continuity: the resolver is stateless, so this is "current as far as
|
|
99
|
+
* this publication proves" and a replayed older publication would look the same. Not `ok`.
|
|
100
|
+
* `failures` carries one `publication_continuity_unanchored` so a caller that only reads
|
|
101
|
+
* `ok`/`failures` fails closed.
|
|
102
|
+
*/
|
|
103
|
+
| {
|
|
104
|
+
ok: false;
|
|
105
|
+
verdict: 'unanchored';
|
|
106
|
+
unanchored: VerifiedAgentResolutionV1;
|
|
56
107
|
failures: readonly ResolutionFailure[];
|
|
57
108
|
};
|
|
58
109
|
/**
|
package/dist/compose.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAA4C,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACnG,OAAO,EAAiC,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,
|
|
1
|
+
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAA4C,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACnG,OAAO,EAAiC,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,KAAK,EAAE,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,CAuNrC"}
|
package/dist/compose.js
CHANGED
|
@@ -15,9 +15,12 @@
|
|
|
15
15
|
// state a minimum assurance once and have it enforced regardless of how the agent was found.
|
|
16
16
|
import { checkResolvedPeer, peerAuthenticatedFrom } from './peer-gate.js';
|
|
17
17
|
import { AgentResolutionError, failure } from './errors.js';
|
|
18
|
-
import {
|
|
18
|
+
import { isEndpointControl } from './endpoint-control.js';
|
|
19
19
|
import { verifyPublication, } from './proof.js';
|
|
20
20
|
import { meetsAssurance, } from './results.js';
|
|
21
|
+
function refused(failures) {
|
|
22
|
+
return { ok: false, verdict: 'refused', failures };
|
|
23
|
+
}
|
|
21
24
|
/**
|
|
22
25
|
* The assurance a verification result earned.
|
|
23
26
|
*
|
|
@@ -52,7 +55,9 @@ function isPublication(v) {
|
|
|
52
55
|
if (!v || typeof v !== 'object')
|
|
53
56
|
return false;
|
|
54
57
|
const p = v;
|
|
55
|
-
return (
|
|
58
|
+
return (
|
|
59
|
+
// The FORMAT is judged by `verifyPublication`, which refuses a retired one by name.
|
|
60
|
+
typeof p.specVersion === 'string' &&
|
|
56
61
|
typeof p.agentId === 'string' &&
|
|
57
62
|
typeof p.channelId === 'string' &&
|
|
58
63
|
typeof p.digest === 'string' &&
|
|
@@ -80,17 +85,14 @@ export function createComposedResolver(opts) {
|
|
|
80
85
|
// 1. Dispatch — exactly one provider, no fallback.
|
|
81
86
|
const matching = opts.providers.filter((p) => p.supports(reference));
|
|
82
87
|
if (matching.length === 0) {
|
|
83
|
-
return
|
|
88
|
+
return refused([failure('reference_unsupported', `no provider supports reference kind "${reference.kind}"`)]);
|
|
84
89
|
}
|
|
85
90
|
if (matching.length > 1) {
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}),
|
|
92
|
-
],
|
|
93
|
-
};
|
|
91
|
+
return refused([
|
|
92
|
+
failure('malformed', `ambiguous reference: ${matching.length} providers claim it`, {
|
|
93
|
+
methods: matching.map((p) => p.method),
|
|
94
|
+
}),
|
|
95
|
+
]);
|
|
94
96
|
}
|
|
95
97
|
const provider = matching[0];
|
|
96
98
|
// 2. Fetch. A provider that throws produced no answer — it does NOT hand off to another.
|
|
@@ -99,44 +101,87 @@ export function createComposedResolver(opts) {
|
|
|
99
101
|
bundle = await provider.resolve(reference, context);
|
|
100
102
|
}
|
|
101
103
|
catch {
|
|
102
|
-
return
|
|
104
|
+
return refused([failure('malformed', `provider "${provider.method}" failed to resolve`)]);
|
|
103
105
|
}
|
|
104
106
|
if (!isPublication(bundle.publication)) {
|
|
105
|
-
return
|
|
107
|
+
return refused([failure('malformed', 'provider returned no well-formed publication')]);
|
|
106
108
|
}
|
|
107
109
|
const publication = bundle.publication;
|
|
108
110
|
// 3. Which agent did we expect? The reference wins; otherwise the caller must say.
|
|
109
111
|
const expected = expectedAgentOf(reference) ?? expectedAgentId;
|
|
110
112
|
if (!expected) {
|
|
111
|
-
return
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
failure('malformed', 'expectedAgentId is required for a reference that does not name its target — otherwise the resolver decides who you reached'),
|
|
115
|
-
],
|
|
116
|
-
};
|
|
113
|
+
return refused([
|
|
114
|
+
failure('malformed', 'expectedAgentId is required for a reference that does not name its target — otherwise the resolver decides who you reached'),
|
|
115
|
+
]);
|
|
117
116
|
}
|
|
118
117
|
// 4. Verify — the SAME path for every method. This is what composition is for.
|
|
119
|
-
|
|
118
|
+
// Continuity is looked up by the EXPECTED AGENT and the EXPECTED CHANNEL (what the caller is
|
|
119
|
+
// entitled to read), never by a field of the publication the provider handed back.
|
|
120
|
+
let expectedChannelId;
|
|
121
|
+
try {
|
|
122
|
+
expectedChannelId = typeof opts.expectedChannelId === 'function' ? opts.expectedChannelId({ reference, context, expectedAgentId: expected }) : undefined;
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
expectedChannelId = undefined;
|
|
126
|
+
}
|
|
127
|
+
if (typeof expectedChannelId !== 'string' || expectedChannelId.length === 0) {
|
|
128
|
+
return refused([
|
|
129
|
+
failure('publication_channel_mismatch', 'no expected channel — the resolver must state which channel it is entitled to read'),
|
|
130
|
+
]);
|
|
131
|
+
}
|
|
132
|
+
const store = opts.continuity === 'stateless' ? undefined : opts.continuity;
|
|
133
|
+
if (opts.continuity !== 'stateless' && (typeof store?.get !== 'function' || typeof store?.put !== 'function')) {
|
|
134
|
+
return refused([failure('publication_continuity_unanchored', 'no continuity store — pass one, or the literal "stateless"')]);
|
|
135
|
+
}
|
|
136
|
+
let known;
|
|
137
|
+
if (store) {
|
|
138
|
+
try {
|
|
139
|
+
known = await store.get(expected, expectedChannelId);
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
return refused([failure('publication_continuity_broken', 'continuity state could not be read — not treated as first contact')]);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
120
145
|
const verified = await verifyPublication(publication, {
|
|
121
146
|
expectedAgentId: expected,
|
|
122
147
|
now: context.now,
|
|
123
148
|
verifier: opts.verifier,
|
|
124
149
|
authorityCheck: opts.authorityCheck,
|
|
125
|
-
|
|
150
|
+
continuity: !store
|
|
151
|
+
? { kind: 'stateless' }
|
|
152
|
+
: known?.channel
|
|
153
|
+
? // A channel floor with no agent record is a corrupt store: `verifyPublication` refuses it.
|
|
154
|
+
{ kind: 'known', state: known.channel, agent: known.agent }
|
|
155
|
+
: { kind: 'first-contact', agent: known?.agent },
|
|
156
|
+
expectedChannelId,
|
|
126
157
|
requireEndpointProof: opts.requireEndpointProof,
|
|
127
158
|
endpointControl: opts.endpointControl,
|
|
128
159
|
minEndpointAssurance: opts.minEndpointAssurance,
|
|
129
160
|
maxExposure: opts.maxExposure,
|
|
130
161
|
});
|
|
131
|
-
if (
|
|
132
|
-
|
|
162
|
+
if (verified.verdict === 'refused') {
|
|
163
|
+
// A refused TOMBSTONE still moves the floor (NAME-3): without this the client's mark stays at
|
|
164
|
+
// the last active sequence and the publication the agent just withdrew verifies again.
|
|
165
|
+
if (store && verified.nextContinuity) {
|
|
166
|
+
try {
|
|
167
|
+
await store.put(verified.nextContinuity);
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
return refused([
|
|
171
|
+
...verified.failures,
|
|
172
|
+
failure('publication_continuity_broken', 'the tombstone could not be recorded in the continuity store'),
|
|
173
|
+
]);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return refused(verified.failures);
|
|
177
|
+
}
|
|
133
178
|
// 5. Assurance ladder — enforced, not advisory.
|
|
134
179
|
const endpointVerified = opts.requireEndpointProof === true &&
|
|
135
180
|
opts.endpointControl !== undefined &&
|
|
136
181
|
publication.surfaces.length > 0 &&
|
|
137
182
|
publication.surfaces.every((s) => {
|
|
138
|
-
|
|
139
|
-
return
|
|
183
|
+
// `agent-asserted` is not control (NAME-5).
|
|
184
|
+
return isEndpointControl(verified.endpointAssurance[s.surfaceId]);
|
|
140
185
|
});
|
|
141
186
|
// ── The post-resolve peer gate ───────────────────────────────────────
|
|
142
187
|
// Runs AFTER the publication verified (we need to know which agent to expect) and BEFORE the
|
|
@@ -162,10 +207,7 @@ export function createComposedResolver(opts) {
|
|
|
162
207
|
policy: opts.peer.policy,
|
|
163
208
|
});
|
|
164
209
|
if (!gate.ok) {
|
|
165
|
-
return {
|
|
166
|
-
ok: false,
|
|
167
|
-
failures: gate.failures.map((f) => failure('peer_gate_refused', f.detail, { code: f.code })),
|
|
168
|
-
};
|
|
210
|
+
return refused(gate.failures.map((f) => failure('peer_gate_refused', f.detail, { code: f.code })));
|
|
169
211
|
}
|
|
170
212
|
peerAuthenticated = peerAuthenticatedFrom(gate);
|
|
171
213
|
}
|
|
@@ -176,24 +218,28 @@ export function createComposedResolver(opts) {
|
|
|
176
218
|
peerAuthenticated,
|
|
177
219
|
});
|
|
178
220
|
if (opts.minAssurance && !meetsAssurance(assurance, opts.minAssurance)) {
|
|
179
|
-
return
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}),
|
|
186
|
-
],
|
|
187
|
-
};
|
|
221
|
+
return refused([
|
|
222
|
+
failure('publication_signature_invalid', `resolution assurance "${assurance}" is weaker than the required "${opts.minAssurance}"`, {
|
|
223
|
+
assurance,
|
|
224
|
+
required: opts.minAssurance,
|
|
225
|
+
}),
|
|
226
|
+
]);
|
|
188
227
|
}
|
|
189
|
-
// 6. Only now advance continuity — a rejected
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
228
|
+
// 6. Only now advance continuity — a publication rejected by the peer gate or the assurance
|
|
229
|
+
// floor must not move the mark. If the floor cannot be recorded the resolution is refused:
|
|
230
|
+
// handing back an answer we could not anchor is how a later rollback goes unnoticed.
|
|
231
|
+
if (store) {
|
|
232
|
+
if (!verified.nextContinuity) {
|
|
233
|
+
return refused([failure('publication_continuity_broken', 'verification produced no continuity state to record')]);
|
|
234
|
+
}
|
|
235
|
+
try {
|
|
236
|
+
await store.put(verified.nextContinuity);
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
return refused([failure('publication_continuity_broken', 'continuity state could not be recorded')]);
|
|
240
|
+
}
|
|
196
241
|
}
|
|
242
|
+
const surfaces = verified.verdict === 'current' ? verified.acceptedSurfaces : verified.unanchoredSurfaces;
|
|
197
243
|
const identityEvidence = [
|
|
198
244
|
{ kind: 'publication-signature', source: provider.method, digest: publication.digest, observedAt: context.now },
|
|
199
245
|
];
|
|
@@ -211,25 +257,33 @@ export function createComposedResolver(opts) {
|
|
|
211
257
|
source: s.endpointControlProof.evidenceRef,
|
|
212
258
|
observedAt: s.endpointControlProof.verifiedAt,
|
|
213
259
|
}));
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
disclosedFields: verified.acceptedSurfaces.map((s) => s.surfaceId),
|
|
228
|
-
audienceBound: verified.acceptedSurfaces.some((s) => s.exposure === 'private'),
|
|
229
|
-
},
|
|
230
|
-
verifiedAt: context.now,
|
|
260
|
+
const resolution = {
|
|
261
|
+
canonicalAgentId: publication.agentId,
|
|
262
|
+
method: bundle.method,
|
|
263
|
+
referenceKind: reference.kind,
|
|
264
|
+
publication,
|
|
265
|
+
identityEvidence,
|
|
266
|
+
endpointEvidence,
|
|
267
|
+
assurance,
|
|
268
|
+
freshness: verified.freshness,
|
|
269
|
+
disclosure: {
|
|
270
|
+
projectionProfile: context.requestedProjection ?? 'public',
|
|
271
|
+
disclosedFields: surfaces.map((s) => s.surfaceId),
|
|
272
|
+
audienceBound: surfaces.some((s) => s.exposure === 'private'),
|
|
231
273
|
},
|
|
274
|
+
verifiedAt: context.now,
|
|
232
275
|
};
|
|
276
|
+
if (verified.verdict === 'unanchored') {
|
|
277
|
+
return {
|
|
278
|
+
ok: false,
|
|
279
|
+
verdict: 'unanchored',
|
|
280
|
+
unanchored: resolution,
|
|
281
|
+
failures: [
|
|
282
|
+
failure('publication_continuity_unanchored', 'verified with no continuity state — current only as far as this publication proves'),
|
|
283
|
+
],
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
return { ok: true, verdict: 'current', resolution, channelRollbackExcluded: verified.channelRollbackExcluded };
|
|
233
287
|
};
|
|
234
288
|
}
|
|
235
289
|
//# sourceMappingURL=compose.js.map
|
package/dist/compose.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,EAAE;AACF,mGAAmG;AACnG,oGAAoG;AACpG,oGAAoG;AACpG,mGAAmG;AACnG,6FAA6F;AAC7F,EAAE;AACF,mGAAmG;AACnG,oGAAoG;AACpG,0EAA0E;AAC1E,EAAE;AACF,iGAAiG;AACjG,qGAAqG;AACrG,6FAA6F;AAG7F,OAAO,EAAE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