@xyo-network/event-kit-statement-graph 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -48
- package/dist/neutral/checkpointViewer.d.ts +5 -0
- package/dist/neutral/checkpointViewer.d.ts.map +1 -0
- package/dist/neutral/eventKitSchemaPolicy.d.ts +28 -0
- package/dist/neutral/eventKitSchemaPolicy.d.ts.map +1 -0
- package/dist/neutral/finalizedReplayController.d.ts +35 -0
- package/dist/neutral/finalizedReplayController.d.ts.map +1 -0
- package/dist/neutral/grantReadModel.d.ts +2 -2
- package/dist/neutral/handshakeCatalog.d.ts +45 -0
- package/dist/neutral/handshakeCatalog.d.ts.map +1 -0
- package/dist/neutral/handshakeReadModel.d.ts +3 -0
- package/dist/neutral/handshakeReadModel.d.ts.map +1 -0
- package/dist/neutral/handshakeReadModelTypes.d.ts +142 -0
- package/dist/neutral/handshakeReadModelTypes.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +8 -0
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +1489 -5
- package/dist/neutral/index.mjs.map +4 -4
- package/dist/neutral/publisherSubjectViewer.d.ts +9 -0
- package/dist/neutral/publisherSubjectViewer.d.ts.map +1 -0
- package/dist/neutral/replayCheckpoint.d.ts +178 -0
- package/dist/neutral/replayCheckpoint.d.ts.map +1 -0
- package/dist/neutral/subscriptionLifecycleView.d.ts +26 -0
- package/dist/neutral/subscriptionLifecycleView.d.ts.map +1 -0
- package/package.json +25 -18
package/README.md
CHANGED
|
@@ -1,59 +1,179 @@
|
|
|
1
1
|
# `@xyo-network/event-kit-statement-graph`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Finalized Statement Graph replay and Event Kit handshake read models.
|
|
4
|
+
|
|
5
|
+
The package has three public seams:
|
|
6
|
+
|
|
7
|
+
- `createFinalizedEventKitReplayController` folds the Event Kit lifecycle
|
|
8
|
+
vocabulary from finalized XL1 blocks and hash-verified bodies;
|
|
9
|
+
- `createEventKitHandshakeReadModel` derives publisher service, key,
|
|
10
|
+
subscription, grant, acceptance, replacement, and revocation views from that
|
|
11
|
+
replay; and
|
|
12
|
+
- `createStatementGraphGrantReadModel` adapts a canonical Statement Graph
|
|
13
|
+
viewer to the narrower wake-admission grant port.
|
|
14
|
+
|
|
15
|
+
## Finalized replay
|
|
5
16
|
|
|
6
17
|
```ts
|
|
7
|
-
const
|
|
8
|
-
|
|
18
|
+
const replay = await createFinalizedEventKitReplayController({
|
|
19
|
+
bodies: dataLakeViewer,
|
|
20
|
+
chain: finalizedBlockViewer,
|
|
21
|
+
chainId,
|
|
22
|
+
checkpointStore,
|
|
23
|
+
floorBlock: 0,
|
|
24
|
+
network: 'local',
|
|
25
|
+
publisher,
|
|
26
|
+
sourceId: dataLakeEndpoint,
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
await replay.sync()
|
|
30
|
+
|
|
31
|
+
const handshakes = createEventKitHandshakeReadModel({
|
|
32
|
+
body: hash => replay.body(hash),
|
|
33
|
+
viewer: replay.viewer(),
|
|
34
|
+
})
|
|
9
35
|
```
|
|
10
36
|
|
|
11
|
-
|
|
12
|
-
|
|
37
|
+
The candidate controller walks one finalized block at a time through Statement
|
|
38
|
+
Graph with the exact Event Kit object-schema allowlist. Each block is staged
|
|
39
|
+
before publication. An unresolved Statement Graph event, a missing or corrupt
|
|
40
|
+
claimed object, or a missing or corrupt challenge/response attachment records
|
|
41
|
+
an explicit blocked boundary and leaves `indexedThrough` before that block. A
|
|
42
|
+
later `sync()` retries the same block; unavailability is never interpreted as
|
|
43
|
+
absence or revocation.
|
|
44
|
+
|
|
45
|
+
Published Statement Graph `0.5.0` admits consensus-elevated, subject-bearing
|
|
46
|
+
Claims and decodes Claim bodies from finalized block carriers while resolving
|
|
47
|
+
claimed objects and acceptance attachments through the datalake. The Gate 2
|
|
48
|
+
live rerun against that release remains the acceptance boundary.
|
|
49
|
+
|
|
50
|
+
Statement Graph `0.5.0` uses fold version 4 and scan-checkpoint format 2. Event
|
|
51
|
+
Kit's publisher-scoped outer checkpoint is also format 2. Checkpoints produced
|
|
52
|
+
by the earlier pre-subject Phase 2 candidate fail closed; archive or discard
|
|
53
|
+
them and rebuild from the configured floor. Gate 2 has not accepted a durable
|
|
54
|
+
format that requires in-place migration.
|
|
55
|
+
|
|
56
|
+
`status()` exposes two distinct watermarks:
|
|
57
|
+
|
|
58
|
+
- `finalizedHead` is the latest finalized height observed from XL1; and
|
|
59
|
+
- `indexedThrough` is the highest block whose Event Kit projection was fully
|
|
60
|
+
committed, or `null` before the floor block has been indexed.
|
|
61
|
+
|
|
62
|
+
The strict `EventKitReplayCheckpointZod` checkpoint binds network, chain ID,
|
|
63
|
+
publisher, datalake source identity, floor block, Statement Graph fold version,
|
|
64
|
+
and the ordered schema policy. It retains the complete canonical
|
|
65
|
+
`AppliedEventRecord` history and verified bodies in addition to the upstream
|
|
66
|
+
slim claim checkpoint. That extra history is required to reconstruct exact
|
|
67
|
+
same-claim subscription fans after restart. A checkpoint from another dataset
|
|
68
|
+
fails closed instead of being silently reused. Restoration also recomputes
|
|
69
|
+
every persisted body hash and cross-checks progress, fold records, applied-event
|
|
70
|
+
provenance, resume watermark keys, and blocked position. Concurrent `sync()`
|
|
71
|
+
calls are serialized around durable checkpoint replacement.
|
|
72
|
+
|
|
73
|
+
`EventKitReplayCheckpointStore.save` is an atomic-persistence port. The new
|
|
74
|
+
snapshot becomes visible only after `save` resolves. This package includes a
|
|
75
|
+
memory implementation for structural tests; a filesystem or SQLite adapter is
|
|
76
|
+
not supplied here.
|
|
77
|
+
|
|
78
|
+
`createCheckpointStatementGraphViewer` restores the canonical viewer surface
|
|
79
|
+
from a checkpoint, including `claimsByObject`, `claimsBySubject`, per-source
|
|
80
|
+
applied history, and resolved objects.
|
|
81
|
+
|
|
82
|
+
## Handshake discovery
|
|
13
83
|
|
|
14
|
-
|
|
84
|
+
The handshake read model:
|
|
15
85
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
86
|
+
1. independently reports the currently selectable publisher-authored service
|
|
87
|
+
and preferred key, if one exists;
|
|
88
|
+
2. uses `claimsBySubject(publisher)` to discover candidate subscriber sources
|
|
89
|
+
without a full-chain source scan;
|
|
90
|
+
3. enumerates each candidate source's applied-event history under that same
|
|
91
|
+
publisher subject and
|
|
92
|
+
groups it by immutable `(txHash, eventHash)` evidence;
|
|
93
|
+
4. accepts only an exact same-claim fan containing one selected service, one
|
|
94
|
+
grant, and one encrypted subscription with matching publisher, chain,
|
|
95
|
+
service, key, key ID, grant, event kind, and lifetime policy;
|
|
96
|
+
5. resolves publisher-authored acceptances and their hash-bound challenge and
|
|
97
|
+
response attachments; and
|
|
98
|
+
6. applies authorized service, key, grant, subscription, and acceptance
|
|
99
|
+
revocations plus deterministic revision cutover.
|
|
19
100
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
101
|
+
The reconciliation view is intentionally separate from current advertisement
|
|
102
|
+
discovery. Under `existing-acceptances-continue`, an exact finalized acceptance
|
|
103
|
+
continues after service/key expiry, revocation, removal, or supersession; those
|
|
104
|
+
retirement events only prevent a new acceptance under that descriptor.
|
|
105
|
+
|
|
106
|
+
An accepted subscription becomes active at `acceptanceBlock + 1`. Wrong-source
|
|
107
|
+
revocations are ignored. Current-advertisement discovery fails closed on an
|
|
108
|
+
unavailable, malformed, or ambiguous selection. Reconciliation rejects stale,
|
|
109
|
+
ahead-of-finality, or unavailable projections but can still return exact
|
|
110
|
+
continuing acceptances alongside a nested advertisement-selection failure. Both
|
|
111
|
+
surfaces retain concrete block/transaction/event/hash evidence.
|
|
112
|
+
|
|
113
|
+
This read model intentionally does not hold publisher private keys, decrypt a
|
|
114
|
+
subscription, compare the grant's deployment and queue to the encrypted
|
|
115
|
+
plaintext, perform the endpoint challenge, or verify its proof. The Phase 3
|
|
116
|
+
publisher client in `@xyo-network/event-kit-node/handshake` consumes this
|
|
117
|
+
finalized candidate view, performs those private checks through protocol APIs,
|
|
118
|
+
durably records the one-time challenge decision, and publishes the exact
|
|
119
|
+
acceptance. Phase 4 adds the resident scanner and service orchestration.
|
|
120
|
+
|
|
121
|
+
## Wake-grant admission adapter
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
const readModel = createStatementGraphGrantReadModel({ viewer: replay.viewer() })
|
|
125
|
+
const grants = createStatementGraphWakeGrantAuthorizer({ viewer: readModel })
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The adapter parses branded addresses and hashes rather than casting them and
|
|
129
|
+
preserves the materializing claim evidence used by the D-002 admission gate.
|
|
130
|
+
Statement Graph owns Claim only: it provides structural
|
|
131
|
+
`{source, subject, hashes}`, no `target`, and no revoke verb. The admission
|
|
132
|
+
adapter requires Claim `subject` to equal the grant body's publisher. Event Kit
|
|
133
|
+
negation is an ordinary revocation object under that same publisher subject,
|
|
134
|
+
claimed by the authorized controller. See
|
|
23
135
|
[D-003](../../docs/decisions/D-003-STATEMENT-GRAPH-V2-GRANTS.md).
|
|
24
136
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
137
|
+
## Evidence boundary
|
|
138
|
+
|
|
139
|
+
Offline deterministic-chain specs currently cover:
|
|
140
|
+
|
|
141
|
+
- strict checkpoint round-trip and dataset-identity rejection;
|
|
142
|
+
- full applied-history persistence and equivalent viewer restoration;
|
|
143
|
+
- block-atomic retry after a missing claimed object or acceptance attachment;
|
|
144
|
+
- refusal to publish staged state after checkpoint-save failure;
|
|
145
|
+
- rejection of hash-tampered or cross-field-inconsistent restored checkpoints
|
|
146
|
+
and serialization of concurrent sync calls;
|
|
147
|
+
- publisher service/key discovery and a pending unaccepted tuple;
|
|
148
|
+
- exact same-claim reconstruction rather than assembly across separate claims;
|
|
149
|
+
- activation at `acceptanceBlock + 1`, authorized revocation, and ignored
|
|
150
|
+
wrong-source revocation;
|
|
151
|
+
- exact acceptance-revocation grouping, source-scoped tuple identity, and
|
|
152
|
+
continuity after service/key retirement;
|
|
153
|
+
- stale and ahead-of-finality rejection; and
|
|
154
|
+
- equivalent lifecycle state after replay from block zero.
|
|
155
|
+
|
|
156
|
+
The original `api-local` fold evidence used legacy unelevated Claim semantics
|
|
157
|
+
with `MemoryStatementDataLake`. It is superseded by the passing Statement Graph
|
|
158
|
+
`0.5.0` live run and these two stronger structural boundaries:
|
|
159
|
+
|
|
160
|
+
- `src/spec/node/restDataLakeProcess.spec.ts` uses real XL1 SDK REST runner and
|
|
161
|
+
viewer clients against a separate child process. The fixture stores one
|
|
162
|
+
canonical body per hash on the filesystem and proves readback, temporary
|
|
163
|
+
unavailability, restoration, process restart, and readback after restart.
|
|
164
|
+
- `src/spec/api-local/liveHandshake.spec.ts` uses two independently derived
|
|
165
|
+
accounts, the real `apiLocal` XL1 runner/viewer,
|
|
166
|
+
`publishFinalizedStatements`, and separately constructed REST writer/reader
|
|
167
|
+
clients against that process. It proves finalized service/key discovery and
|
|
168
|
+
hash verification, a pending same-claim subscription/grant, acceptance-block
|
|
169
|
+
cutover at `A + 1`, revocation, replay-from-zero equality, distinct
|
|
170
|
+
`finalizedHead`/`indexedThrough` watermarks, and retry from the exact blocked
|
|
171
|
+
block after a required body is restored.
|
|
172
|
+
|
|
173
|
+
`pnpm test:live` runs this handshake alongside the existing local-chain head,
|
|
174
|
+
admission, and Statement Graph fold specs. All 14 tests pass against xyo-chain
|
|
175
|
+
and `apiLocal` `5.3.0`, XL1 SDK/protocol `5.4.0`, and Statement Graph `0.5.0`:
|
|
176
|
+
the chain validates elevated Claims and Statement Graph reads each Claim from
|
|
177
|
+
its finalized block carrier. The REST service is a test-owned loopback fixture,
|
|
178
|
+
not the hosted shared public datalake, so this is not public-stack, Sequence,
|
|
179
|
+
Mainnet, Proxmox, multi-VM, or production qualification.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { StatementGraphViewer } from '@xyo-network/xl1-statement-graph-engine';
|
|
2
|
+
import type { EventKitReplayCheckpoint } from './replayCheckpoint.ts';
|
|
3
|
+
/** Restores the canonical Statement Graph read surface from a durable Event Kit checkpoint. */
|
|
4
|
+
export declare function createCheckpointStatementGraphViewer(checkpoint: EventKitReplayCheckpoint): StatementGraphViewer;
|
|
5
|
+
//# sourceMappingURL=checkpointViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpointViewer.d.ts","sourceRoot":"","sources":["../../src/checkpointViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,oBAAoB,EAIrB,MAAM,yCAAyC,CAAA;AAQhD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAmErE,+FAA+F;AAC/F,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,wBAAwB,GACnC,oBAAoB,CAwEtB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exact Statement Graph object vocabulary folded by the Event Kit handshake
|
|
3
|
+
* projection. Challenge and response bodies are datalake attachments named by
|
|
4
|
+
* an acceptance; they are not independently claimed lifecycle objects.
|
|
5
|
+
*/
|
|
6
|
+
export declare const EventKitClaimedObjectSchemas: readonly ["network.xyo.event.wake.publisher" & {
|
|
7
|
+
readonly __schema: true;
|
|
8
|
+
}, "network.xyo.event.wake.publisher.key" & {
|
|
9
|
+
readonly __schema: true;
|
|
10
|
+
}, "network.xyo.event.wake.publisher.revocation" & {
|
|
11
|
+
readonly __schema: true;
|
|
12
|
+
}, "network.xyo.event.wake.publisher.key.revocation" & {
|
|
13
|
+
readonly __schema: true;
|
|
14
|
+
}, "network.xyo.event.wake.subscription" & {
|
|
15
|
+
readonly __schema: true;
|
|
16
|
+
}, "network.xyo.event.wake.grant" & {
|
|
17
|
+
readonly __schema: true;
|
|
18
|
+
}, "network.xyo.event.wake.subscription.revocation" & {
|
|
19
|
+
readonly __schema: true;
|
|
20
|
+
}, "network.xyo.event.wake.grant.revocation" & {
|
|
21
|
+
readonly __schema: true;
|
|
22
|
+
}, "network.xyo.event.wake.subscription.acceptance" & {
|
|
23
|
+
readonly __schema: true;
|
|
24
|
+
}, "network.xyo.event.wake.subscription.acceptance.revocation" & {
|
|
25
|
+
readonly __schema: true;
|
|
26
|
+
}];
|
|
27
|
+
export declare const EventKitClaimedObjectSchemaSet: ReadonlySet<string>;
|
|
28
|
+
//# sourceMappingURL=eventKitSchemaPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventKitSchemaPolicy.d.ts","sourceRoot":"","sources":["../../src/eventKitSchemaPolicy.ts"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;EAW9B,CAAA;AAEX,eAAO,MAAM,8BAA8B,EAAE,WAAW,CAAC,MAAM,CAAyC,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { StatementGraphViewer } from '@xyo-network/xl1-statement-graph-engine';
|
|
2
|
+
import type { BodyReader, FinalizedBlockViewer } from '@xyo-network/xl1-statement-graph-sdk';
|
|
3
|
+
import type { EventKitReplayCheckpoint, EventKitReplayCheckpointIdentity, ReplayBlockedState } from './replayCheckpoint.ts';
|
|
4
|
+
export interface EventKitReplayCheckpointStore {
|
|
5
|
+
/** Returns durable JSON-compatible checkpoint content, if one exists. */
|
|
6
|
+
load(): Promise<unknown>;
|
|
7
|
+
/** Must atomically replace the prior checkpoint or reject without publishing it. */
|
|
8
|
+
save(checkpoint: EventKitReplayCheckpoint): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export interface FinalizedEventKitReplayOptions extends EventKitReplayCheckpointIdentity {
|
|
11
|
+
readonly bodies: BodyReader;
|
|
12
|
+
readonly chain: FinalizedBlockViewer;
|
|
13
|
+
readonly checkpointStore: EventKitReplayCheckpointStore;
|
|
14
|
+
}
|
|
15
|
+
export interface FinalizedEventKitReplayStatus {
|
|
16
|
+
readonly blocked?: ReplayBlockedState;
|
|
17
|
+
readonly finalizedHead: number;
|
|
18
|
+
readonly indexedThrough: number | null;
|
|
19
|
+
}
|
|
20
|
+
export interface FinalizedEventKitReplayController {
|
|
21
|
+
/** Resolve a verified lifecycle or acceptance-attachment body from the durable projection. */
|
|
22
|
+
body(hash: string): Readonly<Record<string, unknown>> | undefined;
|
|
23
|
+
snapshot(): Readonly<EventKitReplayCheckpoint>;
|
|
24
|
+
status(): FinalizedEventKitReplayStatus;
|
|
25
|
+
/** Walks clean finalized blocks and stops before the first unavailable body boundary. */
|
|
26
|
+
sync(): Promise<FinalizedEventKitReplayStatus>;
|
|
27
|
+
/** Snapshot viewer; request it again after `sync()` to observe the new checkpoint. */
|
|
28
|
+
viewer(): StatementGraphViewer;
|
|
29
|
+
}
|
|
30
|
+
export declare function createFinalizedEventKitReplayController(rawOptions: FinalizedEventKitReplayOptions): Promise<FinalizedEventKitReplayController>;
|
|
31
|
+
/** Simple structural fixture; production durability belongs to the storage adapter. */
|
|
32
|
+
export declare function createMemoryEventKitReplayCheckpointStore(initial?: unknown): EventKitReplayCheckpointStore & {
|
|
33
|
+
readonly saved: readonly EventKitReplayCheckpoint[];
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=finalizedReplayController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finalizedReplayController.d.ts","sourceRoot":"","sources":["../../src/fin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C,iCAAiC,CAAC,CAkB5C;AAED,uFAAuF;AACvF,wBAAgB,yCAAyC,CACvD,OAAO,CAAC,EAAE,OAAO,GAChB,6BAA6B,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,wBAAwB,EAAE,CAAA;CAAE,CAazF"}
|
|
@@ -14,8 +14,8 @@ export interface StatementGraphGrantReadModelOptions {
|
|
|
14
14
|
* This is a translation seam only. It narrows branded query and record types
|
|
15
15
|
* and preserves every field the authorizer needs as grant evidence; it makes no
|
|
16
16
|
* authorization decision, applies no freshness policy, and drops no claim.
|
|
17
|
-
* Statement Graph remains the sole owner of claim semantics
|
|
18
|
-
*
|
|
17
|
+
* Statement Graph remains the sole owner of claim semantics; Event Kit's
|
|
18
|
+
* authorizer separately interprets grant bodies and claimed negations.
|
|
19
19
|
*/
|
|
20
20
|
export declare function createStatementGraphGrantReadModel(options: StatementGraphGrantReadModelOptions): StatementGraphGrantReadModel;
|
|
21
21
|
//# sourceMappingURL=grantReadModel.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { PublisherEncryptionKeyLifecycle, PublisherServiceLifecycleRevision } from '@xyo-network/event-kit-protocol';
|
|
2
|
+
import type { PublisherEncryptionKey, PublisherService } from '@xyo-network/event-kit-schemas';
|
|
3
|
+
import type { StatementGraphViewer } from '@xyo-network/xl1-statement-graph-engine';
|
|
4
|
+
import type { AppliedEventRecord } from '@xyo-network/xl1-statement-graph-schemas';
|
|
5
|
+
import type { ClaimedHandshakeObject, EventKitHandshakeReadModelOptions, HandshakeClaimEvidence, PublisherHandshakeQuery, PublisherServiceDiscovery } from './handshakeReadModelTypes.ts';
|
|
6
|
+
export interface HandshakeCatalogs {
|
|
7
|
+
readonly keyByHash: ReadonlyMap<string, ClaimedHandshakeObject<PublisherEncryptionKey>>;
|
|
8
|
+
readonly keyLifecycles: readonly PublisherEncryptionKeyLifecycle[];
|
|
9
|
+
readonly serviceByHash: ReadonlyMap<string, ClaimedHandshakeObject<PublisherService>>;
|
|
10
|
+
readonly serviceLifecycles: readonly PublisherServiceLifecycleRevision[];
|
|
11
|
+
}
|
|
12
|
+
export interface HandshakeServiceDiscovery {
|
|
13
|
+
readonly catalogs?: HandshakeCatalogs;
|
|
14
|
+
readonly query: PublisherHandshakeQuery;
|
|
15
|
+
readonly result: PublisherServiceDiscovery;
|
|
16
|
+
}
|
|
17
|
+
export declare function handshakeEvidence(record: AppliedEventRecord): HandshakeClaimEvidence;
|
|
18
|
+
export declare function handshakeEventEvidence(record: AppliedEventRecord): Omit<HandshakeClaimEvidence, 'hashIndex' | 'objectHash'>;
|
|
19
|
+
export declare function handshakeEventKey(record: Pick<AppliedEventRecord, 'eventHash' | 'txHash'>): string;
|
|
20
|
+
export declare function verifiedHandshakeObjectBody(viewer: StatementGraphViewer, record: AppliedEventRecord): Promise<Record<string, unknown> | undefined>;
|
|
21
|
+
export declare function verifiedHandshakeAttachmentBody(resolver: EventKitHandshakeReadModelOptions['body'], hash: string): Promise<Record<string, unknown> | undefined>;
|
|
22
|
+
export declare function firstHandshakeRevocation(revocations: readonly {
|
|
23
|
+
readonly block: number;
|
|
24
|
+
readonly target: string;
|
|
25
|
+
}[], target: string): number | undefined;
|
|
26
|
+
export declare function parsedHandshakeObjects<T>(viewer: StatementGraphViewer, records: readonly AppliedEventRecord[], parse: (value: unknown) => {
|
|
27
|
+
readonly data: T;
|
|
28
|
+
readonly success: true;
|
|
29
|
+
} | {
|
|
30
|
+
readonly success: false;
|
|
31
|
+
}): Promise<ClaimedHandshakeObject<T>[]>;
|
|
32
|
+
export declare function handshakeRevocations(viewer: StatementGraphViewer, records: readonly AppliedEventRecord[], parse: (value: unknown) => {
|
|
33
|
+
readonly data: Record<string, string>;
|
|
34
|
+
readonly success: true;
|
|
35
|
+
} | {
|
|
36
|
+
readonly success: false;
|
|
37
|
+
}, field: string): Promise<{
|
|
38
|
+
block: number;
|
|
39
|
+
target: string;
|
|
40
|
+
}[]>;
|
|
41
|
+
export declare function buildHandshakeCatalogs(viewer: StatementGraphViewer, publisher: string): Promise<HandshakeCatalogs>;
|
|
42
|
+
export declare function exactHandshakeServiceAt(catalogs: HandshakeCatalogs, service: ClaimedHandshakeObject<PublisherService>, publisher: string, finalizedHead: number): boolean;
|
|
43
|
+
export declare function exactHandshakeKeyAt(catalogs: HandshakeCatalogs, service: ClaimedHandshakeObject<PublisherService>, keyHash: string, finalizedHead: number): boolean;
|
|
44
|
+
export declare function discoverHandshakeService(options: EventKitHandshakeReadModelOptions, rawQuery: PublisherHandshakeQuery): Promise<HandshakeServiceDiscovery>;
|
|
45
|
+
//# sourceMappingURL=handshakeCatalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handshakeCatalog.d.ts","sourceRoot":"","sources":["../../src/handshakeCatalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAC/B,iCAAiC,EAClC,MAAM,iCAAiC,CAAA;AAKxC,OAAO,KAAK,EACV,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,gCAAgC,CAAA;AAiBvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAA;AACnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAA;AAElF,OAAO,KAAK,EACV,sBAAsB,EACtB,iCAAiC,EACjC,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EAE1B,MAAM,8BAA8B,CAAA;AAErC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,sBAAsB,CAAC,CAAC,CAAA;IACvF,QAAQ,CAAC,aAAa,EAAE,SAAS,+BAA+B,EAAE,CAAA;IAClE,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAC,CAAA;IACrF,QAAQ,CAAC,iBAAiB,EAAE,SAAS,iCAAiC,EAA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ReadModelTypes.ts';
|
|
2
|
+
export declare function createEventKitHandshakeReadModel(options: EventKitHandshakeReadModelOptions): EventKitHandshakeReadModel;
|
|
3
|
+
//# sourceMappingURL=handshakeReadModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handshakeReadModel.d.ts","sourceRoot":"","sources":["../../src/handshakeReadModel.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAEV,0BAA0B,EAC1B,iCAAiC,EAWlC,MAAM,8BAA8B,CAAA;AA8YrC,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,iCAAiC,GACzC,0BAA0B,CA8D5B"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import type { SubscriptionActivationFailureReason } from '@xyo-network/event-kit-protocol';
|
|
2
|
+
import type { EncryptedWakeSubscription, FINALIZED_HEAD_EVENT_KIND, PublisherEncryptionKey, PublisherService, WakeGrantObject, WakeSubscriptionAcceptance } from '@xyo-network/event-kit-schemas';
|
|
3
|
+
import type { StatementGraphViewer } from '@xyo-network/xl1-statement-graph-engine';
|
|
4
|
+
export interface HandshakeClaimEvidence {
|
|
5
|
+
readonly block: number;
|
|
6
|
+
readonly eventHash: string;
|
|
7
|
+
readonly hashIndex: number;
|
|
8
|
+
readonly objectHash: string;
|
|
9
|
+
readonly ordinal: {
|
|
10
|
+
readonly event: number;
|
|
11
|
+
readonly tx: number;
|
|
12
|
+
};
|
|
13
|
+
readonly source: string;
|
|
14
|
+
readonly txHash: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ClaimedHandshakeObject<T> {
|
|
17
|
+
readonly body: T;
|
|
18
|
+
readonly evidence: HandshakeClaimEvidence;
|
|
19
|
+
readonly objectHash: string;
|
|
20
|
+
readonly revokedAtBlock?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface PublisherServiceDiscoverySuccess {
|
|
23
|
+
readonly finalizedHead: number;
|
|
24
|
+
readonly indexedThrough: number;
|
|
25
|
+
readonly key: ClaimedHandshakeObject<PublisherEncryptionKey>;
|
|
26
|
+
readonly ok: true;
|
|
27
|
+
readonly service: ClaimedHandshakeObject<PublisherService>;
|
|
28
|
+
}
|
|
29
|
+
export type PublisherServiceDiscoveryFailureReason = 'ahead-of-finality' | 'ambiguous-key' | 'ambiguous-service' | 'invalid-revision-chain' | 'preferred-key-inactive' | 'preferred-key-not-found' | 'preferred-key-not-referenced' | 'service-not-found' | 'service-pending' | 'stale-view' | 'view-unavailable';
|
|
30
|
+
export interface PublisherServiceDiscoveryFailure {
|
|
31
|
+
readonly finalizedHead: number;
|
|
32
|
+
readonly indexedThrough: number | null;
|
|
33
|
+
readonly ok: false;
|
|
34
|
+
readonly reason: PublisherServiceDiscoveryFailureReason;
|
|
35
|
+
}
|
|
36
|
+
export type PublisherServiceDiscovery = PublisherServiceDiscoveryFailure | PublisherServiceDiscoverySuccess;
|
|
37
|
+
export type SubscriptionTupleRejectionReason = 'ambiguous-fan' | 'expiry-out-of-policy' | 'grant-binding-invalid' | 'key-binding-invalid' | 'malformed-grant' | 'malformed-subscription' | 'service-inactive-at-claim' | 'subscription-binding-invalid';
|
|
38
|
+
export interface SubscriptionTupleRejection {
|
|
39
|
+
readonly evidence: Omit<HandshakeClaimEvidence, 'hashIndex' | 'objectHash'>;
|
|
40
|
+
readonly reason: SubscriptionTupleRejectionReason;
|
|
41
|
+
readonly subscriber: string;
|
|
42
|
+
}
|
|
43
|
+
export interface FinalizedSubscriptionTuple {
|
|
44
|
+
readonly grant: ClaimedHandshakeObject<WakeGrantObject>;
|
|
45
|
+
readonly service: ClaimedHandshakeObject<PublisherService>;
|
|
46
|
+
readonly subscriber: string;
|
|
47
|
+
readonly subscription: ClaimedHandshakeObject<EncryptedWakeSubscription>;
|
|
48
|
+
readonly tupleEvent: Omit<HandshakeClaimEvidence, 'hashIndex' | 'objectHash'>;
|
|
49
|
+
}
|
|
50
|
+
export type SubscriptionLifecycleState = 'active' | 'expired' | 'inactive' | 'pending' | 'rejected' | 'revoked';
|
|
51
|
+
export interface PublisherSubscriptionView {
|
|
52
|
+
readonly acceptance?: ClaimedHandshakeObject<WakeSubscriptionAcceptance>;
|
|
53
|
+
readonly activeFromBlock?: number;
|
|
54
|
+
readonly pendingReplacement?: boolean;
|
|
55
|
+
readonly reason?: SubscriptionActivationFailureReason | 'grant-revoked';
|
|
56
|
+
readonly selectedSubscription?: string;
|
|
57
|
+
readonly state: SubscriptionLifecycleState;
|
|
58
|
+
readonly subscriber: string;
|
|
59
|
+
readonly subscriptionId: string;
|
|
60
|
+
readonly tuples: readonly FinalizedSubscriptionTuple[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* One exact, finalized subscription tuple eligible to enter the publisher's
|
|
64
|
+
* decrypt, scope-validation, and endpoint-challenge workflow under the
|
|
65
|
+
* currently selected service and preferred encryption key. Presence here is
|
|
66
|
+
* not permission to publish an acceptance.
|
|
67
|
+
*
|
|
68
|
+
* Eligibility is intentionally a point-in-time statement at `finalizedHead`.
|
|
69
|
+
* A caller must resolve the view again after the endpoint challenge and before
|
|
70
|
+
* publishing an acceptance, because a later finalized lifecycle claim can
|
|
71
|
+
* retire any candidate.
|
|
72
|
+
*/
|
|
73
|
+
export interface PublisherAcceptanceCandidate {
|
|
74
|
+
readonly key: ClaimedHandshakeObject<PublisherEncryptionKey>;
|
|
75
|
+
readonly subscriber: string;
|
|
76
|
+
readonly subscriptionId: string;
|
|
77
|
+
readonly tuple: FinalizedSubscriptionTuple;
|
|
78
|
+
}
|
|
79
|
+
interface PublisherHandshakeViewSuccessBase {
|
|
80
|
+
readonly finalizedHead: number;
|
|
81
|
+
readonly indexedThrough: number;
|
|
82
|
+
readonly ok: true;
|
|
83
|
+
readonly rejections: readonly SubscriptionTupleRejection[];
|
|
84
|
+
readonly subscriptions: readonly PublisherSubscriptionView[];
|
|
85
|
+
}
|
|
86
|
+
export interface PublisherHandshakeViewWithCurrentService extends PublisherHandshakeViewSuccessBase {
|
|
87
|
+
readonly hasCurrentAdvertisement: true;
|
|
88
|
+
readonly key: ClaimedHandshakeObject<PublisherEncryptionKey>;
|
|
89
|
+
readonly service: ClaimedHandshakeObject<PublisherService>;
|
|
90
|
+
readonly serviceDiscovery: PublisherServiceDiscoverySuccess;
|
|
91
|
+
}
|
|
92
|
+
export interface PublisherHandshakeViewWithoutCurrentService extends PublisherHandshakeViewSuccessBase {
|
|
93
|
+
readonly hasCurrentAdvertisement: false;
|
|
94
|
+
readonly serviceDiscovery: PublisherServiceDiscoveryFailure;
|
|
95
|
+
}
|
|
96
|
+
export type PublisherHandshakeViewSuccess = PublisherHandshakeViewWithCurrentService | PublisherHandshakeViewWithoutCurrentService;
|
|
97
|
+
export type PublisherHandshakeView = PublisherServiceDiscoveryFailure | PublisherHandshakeViewSuccess;
|
|
98
|
+
export interface PublisherAcceptanceCandidateDiscoverySuccess extends PublisherServiceDiscoverySuccess {
|
|
99
|
+
readonly candidates: readonly PublisherAcceptanceCandidate[];
|
|
100
|
+
readonly rejections: readonly SubscriptionTupleRejection[];
|
|
101
|
+
readonly subscriptions: readonly PublisherSubscriptionView[];
|
|
102
|
+
}
|
|
103
|
+
export type PublisherAcceptanceCandidateDiscovery = PublisherAcceptanceCandidateDiscoverySuccess | PublisherServiceDiscoveryFailure;
|
|
104
|
+
export interface SubscriberSubscriptionLookupWithCurrentService extends PublisherHandshakeViewWithCurrentService {
|
|
105
|
+
readonly subscriber: string;
|
|
106
|
+
}
|
|
107
|
+
export interface SubscriberSubscriptionLookupWithoutCurrentService extends PublisherHandshakeViewWithoutCurrentService {
|
|
108
|
+
readonly subscriber: string;
|
|
109
|
+
}
|
|
110
|
+
export type SubscriberSubscriptionLookupSuccess = SubscriberSubscriptionLookupWithCurrentService | SubscriberSubscriptionLookupWithoutCurrentService;
|
|
111
|
+
export type SubscriberSubscriptionLookup = PublisherServiceDiscoveryFailure | SubscriberSubscriptionLookupSuccess;
|
|
112
|
+
export interface EventKitHandshakeReadModelOptions {
|
|
113
|
+
/** Resolves hash-verified acceptance attachments retained by the replay controller. */
|
|
114
|
+
readonly body?: (hash: string) => Readonly<Record<string, unknown>> | undefined;
|
|
115
|
+
readonly viewer: StatementGraphViewer;
|
|
116
|
+
}
|
|
117
|
+
export interface PublisherHandshakeQuery {
|
|
118
|
+
readonly chainId: string;
|
|
119
|
+
readonly eventKind?: typeof FINALIZED_HEAD_EVENT_KIND;
|
|
120
|
+
readonly finalizedHead: number;
|
|
121
|
+
readonly publisher: string;
|
|
122
|
+
readonly serviceId?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface PublisherAcceptanceCandidateQuery extends PublisherHandshakeQuery {
|
|
125
|
+
/** Restricts discovery to one finalized Statement Graph claim source. */
|
|
126
|
+
readonly subscriber?: string;
|
|
127
|
+
/** Restricts discovery to one stable subscription revision chain. */
|
|
128
|
+
readonly subscriptionId?: string;
|
|
129
|
+
}
|
|
130
|
+
export interface SubscriberSubscriptionQuery extends PublisherHandshakeQuery {
|
|
131
|
+
readonly subscriber: string;
|
|
132
|
+
/** Omit to return every subscription identity owned by `subscriber`. */
|
|
133
|
+
readonly subscriptionId?: string;
|
|
134
|
+
}
|
|
135
|
+
export interface EventKitHandshakeReadModel {
|
|
136
|
+
acceptanceCandidates(query: PublisherAcceptanceCandidateQuery): Promise<PublisherAcceptanceCandidateDiscovery>;
|
|
137
|
+
discoverPublisherService(query: PublisherHandshakeQuery): Promise<PublisherServiceDiscovery>;
|
|
138
|
+
publisher(query: PublisherHandshakeQuery): Promise<PublisherHandshakeView>;
|
|
139
|
+
subscriber(query: SubscriberSubscriptionQuery): Promise<SubscriberSubscriptionLookup>;
|
|
140
|
+
}
|
|
141
|
+
export {};
|
|
142
|
+
//# sourceMappingURL=handshakeReadModelTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handshakeReadModelTypes.d.ts","sourceRoot":"","sources":["../../src/handshakeReadModelTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM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,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,yBAAyB,CAAA;IACrD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,MAAM,WAAW,iCAAkC,SAAQ,uBAAuB;IAChF,yEAAyE;IACzE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CACjC;AAED,MAAM,WAAW,2BAA4B,SAAQ,uBAAuB;IAC1E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CACjC;AAED,MAAM,WAAW,0BAA0B;IACzC,oBAAoB,CAAC,KAAK,EAAE,iCAAiC,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAA;IAC9G,wBAAwB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;IAC5F,SAAS,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAC1E,UAAU,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAA;CACtF"}
|
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
export { createCheckpointStatementGraphViewer } from './checkpointViewer.ts';
|
|
2
|
+
export { EventKitClaimedObjectSchemas, EventKitClaimedObjectSchemaSet, } from './eventKitSchemaPolicy.ts';
|
|
3
|
+
export type { EventKitReplayCheckpointStore, FinalizedEventKitReplayController, FinalizedEventKitReplayOptions, FinalizedEventKitReplayStatus, } from './finalizedReplayController.ts';
|
|
4
|
+
export { createFinalizedEventKitReplayController, createMemoryEventKitReplayCheckpointStore, } from './finalizedReplayController.ts';
|
|
1
5
|
export type { StatementGraphGrantReadModelOptions } from './grantReadModel.ts';
|
|
2
6
|
export { createStatementGraphGrantReadModel } from './grantReadModel.ts';
|
|
7
|
+
export { createEventKitHandshakeReadModel } from './handshakeReadModel.ts';
|
|
8
|
+
export type { ClaimedHandshakeObject, EventKitHandshakeReadModel, EventKitHandshakeReadModelOptions, FinalizedSubscriptionTuple, HandshakeClaimEvidence, PublisherAcceptanceCandidate, PublisherAcceptanceCandidateDiscovery, PublisherAcceptanceCandidateDiscoverySuccess, PublisherAcceptanceCandidateQuery, PublisherHandshakeQuery, PublisherHandshakeView, PublisherHandshakeViewSuccess, PublisherHandshakeViewWithCurrentService, PublisherHandshakeViewWithoutCurrentService, PublisherServiceDiscovery, PublisherServiceDiscoveryFailure, PublisherServiceDiscoveryFailureReason, PublisherServiceDiscoverySuccess, PublisherSubscriptionView, SubscriberSubscriptionLookup, SubscriberSubscriptionLookupSuccess, SubscriberSubscriptionLookupWithCurrentService, SubscriberSubscriptionLookupWithoutCurrentService, SubscriberSubscriptionQuery, SubscriptionLifecycleState, SubscriptionTupleRejection, SubscriptionTupleRejectionReason, } from './handshakeReadModelTypes.ts';
|
|
9
|
+
export type { EventKitReplayCheckpoint, EventKitReplayCheckpointIdentity, EventKitReplayCheckpointLoad, ReplayBlockedState, ReplayCorruptBody, ResolvedReplayBody, } from './replayCheckpoint.ts';
|
|
10
|
+
export { EVENT_KIT_REPLAY_CHECKPOINT_VERSION, EventKitReplayCheckpointZod, loadEventKitReplayCheckpoint, ReplayBlockedStateZod, ReplayCorruptBodyZod, ResolvedReplayBodyZod, } from './replayCheckpoint.ts';
|
|
3
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mCAAmC,EAAE,MAAM,qBAAqB,CAAA;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