@ibgib/space-gib 0.0.5 → 0.0.7
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 +20 -0
- package/dist/client/bootstrap.mjs +31 -31
- package/dist/client/bootstrap.mjs.map +3 -3
- package/dist/client/chunk-RXFIBFRK.mjs +42 -0
- package/dist/client/chunk-RXFIBFRK.mjs.map +7 -0
- package/dist/client/chunk-ULFNE26Y.mjs +2216 -0
- package/dist/client/chunk-ULFNE26Y.mjs.map +7 -0
- package/dist/client/index.html +35 -14
- package/dist/client/index.mjs +1 -1
- package/dist/client/script.mjs +1 -1
- package/dist/client/style.css +29 -5
- package/dist/server/server.mjs +1447 -270
- package/dist/server/server.mjs.map +4 -4
- package/package.json +5 -5
- package/space-gib.localhost-1783713259760.log +45 -0
- package/src/client/AUTO-GENERATED-version.mts +1 -1
- package/src/client/bootstrap.mts +9 -0
- package/src/client/components/identity-header/identity-header.css +40 -2
- package/src/client/components/identity-header/identity-header.html +3 -2
- package/src/client/components/identity-header/identity-header.mts +127 -49
- package/src/client/components/identity-manager/identity-manager.css +57 -353
- package/src/client/components/identity-manager/identity-manager.html +0 -94
- package/src/client/components/identity-manager/identity-manager.mts +356 -484
- package/src/client/components/keystone-creator/keystone-creator.mts +90 -13
- package/src/client/components/keystone-details/keystone-details.css +472 -0
- package/src/client/components/keystone-details/keystone-details.html +99 -0
- package/src/client/components/keystone-details/keystone-details.mts +821 -0
- package/src/client/components/keystone-scrubber/SCRUBBER_IMPLEMENTATION.md +33 -0
- package/src/client/components/keystone-scrubber/keystone-scrubber.css +46 -0
- package/src/client/components/keystone-scrubber/keystone-scrubber.html +15 -0
- package/src/client/components/keystone-scrubber/keystone-scrubber.mts +356 -0
- package/src/client/dev-tools/common.mts +505 -10
- package/src/client/dev-tools/phase-4-1.mts +19 -4
- package/src/client/dev-tools/phase-4-10.mts +77 -305
- package/src/client/dev-tools/phase-4-2.mts +46 -212
- package/src/client/dev-tools/phase-4-3.mts +57 -198
- package/src/client/dev-tools/phase-4-4.mts +57 -170
- package/src/client/dev-tools/phase-4-5.mts +48 -204
- package/src/client/dev-tools/phase-4-6.mts +37 -103
- package/src/client/dev-tools/phase-4-7.mts +44 -228
- package/src/client/dev-tools/phase-4-8.mts +33 -136
- package/src/client/dev-tools/phase-4-9.mts +33 -137
- package/src/client/dev-tools/phase-4.mts +30 -6
- package/src/client/dev-tools.mts +18 -0
- package/src/client/index.html +35 -14
- package/src/client/style.css +29 -5
- package/src/client/types.mts +4 -1
- package/src/client/ui/shell/space-gib-shell-service.mts +4 -0
- package/src/server/path-constants.mts +12 -0
- package/src/server/serve-gib/handlers/api/keystone/sso-config.handler.mts +66 -0
- package/src/server/serve-gib/handlers/api/keystone/sso-link.handler.mts +119 -0
- package/src/server/serve-gib/handlers/api/keystone/sso-login.handler.mts +189 -0
- package/src/server/server.mts +6 -0
- package/dist/client/chunk-ANGVYAEK.mjs +0 -42
- package/dist/client/chunk-ANGVYAEK.mjs.map +0 -7
- package/dist/client/chunk-IRGFDQRD.mjs +0 -1920
- package/dist/client/chunk-IRGFDQRD.mjs.map +0 -7
- package/dist/respec-gib.node.mjs +0 -5
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { extractErrorMsg
|
|
1
|
+
import { extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
2
2
|
import { Factory_V1 as factory } from '@ibgib/ts-gib/dist/V1/factory.mjs';
|
|
3
3
|
import { ROOT } from '@ibgib/ts-gib/dist/V1/constants.mjs';
|
|
4
4
|
import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
|
|
5
5
|
import { KeystoneIbGib_V1 } from '@ibgib/core-gib/dist/keystone/keystone-types.mjs';
|
|
6
|
-
import { KeystoneService_V1 } from '@ibgib/core-gib/dist/keystone/keystone-service-v1.mjs';
|
|
7
6
|
import { getGlobalMetaspace_waitIfNeeded } from "@ibgib/web-gib/dist/helpers.mjs";
|
|
8
7
|
import { mut8Timeline } from '@ibgib/core-gib/dist/timeline/timeline-api.mjs';
|
|
9
8
|
import { graphsAreEquivalent } from '@ibgib/core-gib/dist/common/other/graph-helper.mjs';
|
|
10
|
-
import { SyncPeerWebSocketSender_V1 } from '@ibgib/core-gib/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-sender/sync-peer-websocket-sender-v1.mjs';
|
|
11
|
-
import { SyncSagaCoordinator } from '@ibgib/core-gib/dist/sync/sync-saga-coordinator.mjs';
|
|
12
|
-
import { SyncConflictStrategy } from '@ibgib/core-gib/dist/sync/sync-constants.mjs';
|
|
13
|
-
import { SESSION_KEYSTONE_POLICY, getSpaceGibPoolConfig } from "../../common/keystone-policies.mjs";
|
|
14
9
|
import { SpaceGibApiBridge } from '../api/space-gib-api-bridge.mjs';
|
|
15
10
|
|
|
16
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
debugState, devLog, lc,
|
|
13
|
+
setupDomainAndDelegateIdentities, runSyncPass, verifyIdentitiesOnServer
|
|
14
|
+
} from './common.mjs';
|
|
17
15
|
|
|
18
16
|
export function init4_3bSetupButton(): void {
|
|
19
17
|
const btn = document.getElementById('btn-4-3b-setup') as HTMLButtonElement | null;
|
|
@@ -27,32 +25,18 @@ export function init4_3bSetupButton(): void {
|
|
|
27
25
|
const space = await metaspace.getLocalUserSpace({});
|
|
28
26
|
if (!space) { throw new Error("No default space."); }
|
|
29
27
|
|
|
30
|
-
const
|
|
28
|
+
const apiBridge = new SpaceGibApiBridge();
|
|
31
29
|
|
|
32
|
-
|
|
30
|
+
// Create domain + delegate identities (DRY helper)
|
|
31
|
+
await setupDomainAndDelegateIdentities({
|
|
33
32
|
masterSecret: 'test-sender-secret-phase4-3',
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
metaspace,
|
|
39
|
-
space,
|
|
40
|
-
frameDetails: { client: 'space-gib-web-dev', timestamp: getTimestamp() }
|
|
33
|
+
syncSalt: 'senderidentitysyncsaltphase4-3',
|
|
34
|
+
manageSalt: 'senderidentitymanagesaltphase4-3',
|
|
35
|
+
metaspace, space, apiBridge,
|
|
36
|
+
phaseText: '4.3B'
|
|
41
37
|
});
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
debugState.domainIMasterSecret = 'test-sender-secret-phase4-3';
|
|
45
|
-
|
|
46
|
-
devLog(`4.3B Setup: ✓ Domain Keystone (I) created locally: ${getIbGibAddr({ ibGib: domainI })}`);
|
|
47
|
-
|
|
48
|
-
const apiBridge = new SpaceGibApiBridge();
|
|
49
|
-
const resGenesis = await apiBridge.postGenesisKeystone(domainI);
|
|
50
|
-
if (resGenesis.success) {
|
|
51
|
-
devLog(`4.3B Setup: ✓ Domain Keystone registered on server.`);
|
|
52
|
-
} else {
|
|
53
|
-
throw new Error(`Server rejected genesis domain keystone: ${resGenesis.message}`);
|
|
54
|
-
}
|
|
55
|
-
|
|
39
|
+
// Create timeline V0 → V1
|
|
56
40
|
const resV0 = await factory.firstGen({
|
|
57
41
|
parentIbGib: ROOT,
|
|
58
42
|
ib: 'timeline_root_partial_4_3b',
|
|
@@ -68,8 +52,7 @@ export function init4_3bSetupButton(): void {
|
|
|
68
52
|
const r1_v1 = await mut8Timeline({
|
|
69
53
|
timeline: r1_v0,
|
|
70
54
|
mut8Opts: { dataToAddOrPatch: { type: 'comment', label: 'V1_4_3b' } },
|
|
71
|
-
metaspace,
|
|
72
|
-
space,
|
|
55
|
+
metaspace, space,
|
|
73
56
|
});
|
|
74
57
|
|
|
75
58
|
debugState.targetC1 = r1_v1;
|
|
@@ -97,106 +80,36 @@ async function performPhaseSync4_3b(): Promise<void> {
|
|
|
97
80
|
|
|
98
81
|
try {
|
|
99
82
|
btn.disabled = true;
|
|
100
|
-
devLog(`4.3B Sync: Starting Pass 1 (Sync V1 to server)...`);
|
|
101
83
|
|
|
102
|
-
const domainI = debugState.domainI;
|
|
103
84
|
const targetV1 = debugState.targetX;
|
|
104
|
-
if (!domainI || !targetV1) {
|
|
85
|
+
if (!debugState.domainI || !targetV1) {
|
|
105
86
|
devLog(`⚠ 4.3B Sync: Missing setup state. Please run Setup first.`);
|
|
106
87
|
btn.disabled = false;
|
|
107
88
|
return;
|
|
108
89
|
}
|
|
109
90
|
|
|
110
|
-
const domainAddr = getIbGibAddr({ ibGib: domainI });
|
|
111
91
|
const metaspace = await getGlobalMetaspace_waitIfNeeded();
|
|
112
92
|
const space = await metaspace.getLocalUserSpace({});
|
|
113
93
|
if (!space) { throw new Error("No default space."); }
|
|
114
94
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
classname: 'SyncPeerWebSocketSender_V1',
|
|
119
|
-
httpEvolveUrl: `${location.protocol}//${location.host}/api/keystone/evolve/${encodeURIComponent(domainAddr)}`,
|
|
120
|
-
wsUrl: `${protocol}//${location.host}/api/sync/ws/${encodeURIComponent(domainAddr)}`
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
let coordinator = new SyncSagaCoordinator();
|
|
124
|
-
let sagaId = await getUUID();
|
|
125
|
-
debugState.sagaId = sagaId;
|
|
126
|
-
debugState.senderPeer = senderPeer;
|
|
127
|
-
|
|
128
|
-
await senderPeer.initializeOpts({
|
|
129
|
-
localMetaspace: metaspace,
|
|
130
|
-
localSpace: space,
|
|
131
|
-
senderIdentity: domainI,
|
|
132
|
-
fnSenderSecret: async () => debugState.domainIMasterSecret!,
|
|
133
|
-
sagaId,
|
|
134
|
-
sessionConnectPoolConfig: SESSION_KEYSTONE_POLICY.CONNECT_POOL as any,
|
|
135
|
-
sessionSyncPoolConfig: SESSION_KEYSTONE_POLICY.DEFAULT_POOL as any,
|
|
136
|
-
targetAddrs: [domainAddr]
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
let syncSaga = await coordinator.sync({
|
|
140
|
-
domainIbGibs: [targetV1],
|
|
141
|
-
senderIdentity: domainI,
|
|
142
|
-
fnSenderSecret: async () => debugState.domainIMasterSecret!,
|
|
143
|
-
peer: senderPeer,
|
|
144
|
-
localSpace: space,
|
|
145
|
-
metaspace,
|
|
146
|
-
conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
147
|
-
});
|
|
148
|
-
await syncSaga.done;
|
|
95
|
+
// Pass 1: Sync V1
|
|
96
|
+
devLog(`4.3B Sync: Starting Pass 1 (Sync V1 to server)...`);
|
|
97
|
+
await runSyncPass({ domainIbGibs: [targetV1], passLabel: 'Pass 1 (Sync V1)', metaspace, space });
|
|
149
98
|
devLog(`4.3B Sync: ✓ Pass 1 Complete (V1 synced).`);
|
|
150
99
|
|
|
151
|
-
|
|
152
|
-
addr: getIbGibAddr({ ibGib: domainI }),
|
|
153
|
-
space,
|
|
154
|
-
});
|
|
155
|
-
const resGetLatestI1 = await metaspace.get({ addrs: [latestSenderAddr1!], space });
|
|
156
|
-
const senderIdentityEvolved1 = resGetLatestI1.ibGibs![0] as KeystoneIbGib_V1;
|
|
157
|
-
|
|
100
|
+
// Mutate V1 → V2
|
|
158
101
|
devLog(`4.3B Sync: Mutating V1 to V2 locally...`);
|
|
159
102
|
const r1_v2 = await mut8Timeline({
|
|
160
103
|
timeline: targetV1,
|
|
161
104
|
mut8Opts: { dataToAddOrPatch: { type: 'comment', label: 'V2_4_3b' } },
|
|
162
|
-
metaspace,
|
|
163
|
-
space,
|
|
105
|
+
metaspace, space,
|
|
164
106
|
});
|
|
165
107
|
debugState.targetX = r1_v2;
|
|
166
108
|
devLog(`4.3B Sync: ✓ V2 created locally: ${getIbGibAddr({ ibGib: r1_v2 })}`);
|
|
167
109
|
|
|
110
|
+
// Pass 2: Sync V2
|
|
168
111
|
devLog(`4.3B Sync: Starting Pass 2 (Sync V2 delta to server)...`);
|
|
169
|
-
|
|
170
|
-
classname: 'SyncPeerWebSocketSender_V1',
|
|
171
|
-
httpEvolveUrl: `${location.protocol}//${location.host}/api/keystone/evolve/${encodeURIComponent(domainAddr)}`,
|
|
172
|
-
wsUrl: `${protocol}//${location.host}/api/sync/ws/${encodeURIComponent(domainAddr)}`
|
|
173
|
-
});
|
|
174
|
-
coordinator = new SyncSagaCoordinator();
|
|
175
|
-
sagaId = await getUUID();
|
|
176
|
-
debugState.sagaId = sagaId;
|
|
177
|
-
debugState.senderPeer = senderPeer;
|
|
178
|
-
|
|
179
|
-
await senderPeer.initializeOpts({
|
|
180
|
-
localMetaspace: metaspace,
|
|
181
|
-
localSpace: space,
|
|
182
|
-
senderIdentity: senderIdentityEvolved1,
|
|
183
|
-
fnSenderSecret: async () => debugState.domainIMasterSecret!,
|
|
184
|
-
sagaId,
|
|
185
|
-
sessionConnectPoolConfig: SESSION_KEYSTONE_POLICY.CONNECT_POOL as any,
|
|
186
|
-
sessionSyncPoolConfig: SESSION_KEYSTONE_POLICY.DEFAULT_POOL as any,
|
|
187
|
-
targetAddrs: [domainAddr]
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
syncSaga = await coordinator.sync({
|
|
191
|
-
domainIbGibs: [r1_v2],
|
|
192
|
-
senderIdentity: senderIdentityEvolved1,
|
|
193
|
-
fnSenderSecret: async () => debugState.domainIMasterSecret!,
|
|
194
|
-
peer: senderPeer,
|
|
195
|
-
localSpace: space,
|
|
196
|
-
metaspace,
|
|
197
|
-
conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
198
|
-
});
|
|
199
|
-
await syncSaga.done;
|
|
112
|
+
await runSyncPass({ domainIbGibs: [r1_v2], passLabel: 'Pass 2 (Sync V2)', metaspace, space });
|
|
200
113
|
devLog(`4.3B Sync: ✓ Pass 2 Complete (V2 synced).`);
|
|
201
114
|
|
|
202
115
|
devLog(`✓ 4.3B Sync Sequence Complete! Ready for State Checks.`);
|
|
@@ -215,9 +128,7 @@ async function performPhaseSync4_3b(): Promise<void> {
|
|
|
215
128
|
export function init4_3bSyncButton(): void {
|
|
216
129
|
const btn = document.getElementById('btn-4-3b-sync') as HTMLButtonElement | null;
|
|
217
130
|
if (!btn) { return; }
|
|
218
|
-
btn.addEventListener('click', () => {
|
|
219
|
-
performPhaseSync4_3b();
|
|
220
|
-
});
|
|
131
|
+
btn.addEventListener('click', () => { performPhaseSync4_3b(); });
|
|
221
132
|
}
|
|
222
133
|
|
|
223
134
|
export function init4_3bCheckButton(): void {
|
|
@@ -239,146 +150,94 @@ export function init4_3bCheckButton(): void {
|
|
|
239
150
|
const v1Addr = getIbGibAddr({ ibGib: targetV1 });
|
|
240
151
|
const v2Addr = getIbGibAddr({ ibGib: targetV2 });
|
|
241
152
|
const domainAddr = getIbGibAddr({ ibGib: domainI });
|
|
153
|
+
const apiBridge = new SpaceGibApiBridge();
|
|
242
154
|
|
|
243
155
|
// 1. Verify V1 and V2 exist locally
|
|
244
156
|
const localV1Res = await metaspace.get({ addrs: [v1Addr], space });
|
|
245
157
|
const localV2Res = await metaspace.get({ addrs: [v2Addr], space });
|
|
246
158
|
if (!localV1Res.success || !localV1Res.ibGibs?.[0]) {
|
|
247
|
-
devLog('✗ Check: Timeline frame V1 NOT found locally.');
|
|
248
|
-
return;
|
|
159
|
+
devLog('✗ Check: Timeline frame V1 NOT found locally.'); return;
|
|
249
160
|
}
|
|
250
161
|
if (!localV2Res.success || !localV2Res.ibGibs?.[0]) {
|
|
251
|
-
devLog('✗ Check: Timeline frame V2 NOT found locally.');
|
|
252
|
-
return;
|
|
162
|
+
devLog('✗ Check: Timeline frame V2 NOT found locally.'); return;
|
|
253
163
|
}
|
|
254
164
|
devLog(`✓ Check: Timeline frames V1 and V2 exist locally.`);
|
|
255
165
|
|
|
256
|
-
// 2.
|
|
257
|
-
const apiBridge = new SpaceGibApiBridge();
|
|
166
|
+
// 2. Verify V2 on server with correct past ref and matching graph
|
|
258
167
|
const serverV2Res = await apiBridge.getIbGib(domainAddr, v2Addr);
|
|
259
168
|
if (!serverV2Res.success || !serverV2Res.ibGib) {
|
|
260
|
-
devLog(`✗ Check: Timeline frame V2 NOT found on server: ${serverV2Res.message}`);
|
|
261
|
-
return;
|
|
169
|
+
devLog(`✗ Check: Timeline frame V2 NOT found on server: ${serverV2Res.message}`); return;
|
|
262
170
|
}
|
|
263
171
|
devLog(`✓ Check: Timeline frame V2 exists on server.`);
|
|
264
172
|
|
|
265
|
-
const
|
|
266
|
-
const pastAddr = serverV2IbGib.rel8ns?.past?.at(-1);
|
|
173
|
+
const pastAddr = serverV2Res.ibGib.rel8ns?.past?.at(-1);
|
|
267
174
|
if (pastAddr === v1Addr) {
|
|
268
175
|
devLog('✓ Check: Server V2 correctly references V1 in its past relation.');
|
|
269
176
|
} else {
|
|
270
|
-
devLog(`✗ Check: Server V2 does not reference V1 in past relation! got: ${pastAddr}`);
|
|
271
|
-
return;
|
|
177
|
+
devLog(`✗ Check: Server V2 does not reference V1 in past relation! got: ${pastAddr}`); return;
|
|
272
178
|
}
|
|
273
179
|
|
|
274
|
-
const localV2Graph = await metaspace.getDependencyGraph({
|
|
275
|
-
ibGibAddr: v2Addr,
|
|
276
|
-
space
|
|
277
|
-
});
|
|
180
|
+
const localV2Graph = await metaspace.getDependencyGraph({ ibGibAddr: v2Addr, space });
|
|
278
181
|
const serverV2GetGraphRes = await apiBridge.getIbGibGraph(domainAddr, v2Addr, true);
|
|
279
182
|
if (!serverV2GetGraphRes.success || !serverV2GetGraphRes.graph) {
|
|
280
|
-
devLog(`✗ Check: Failed to fetch V2 graph from server: ${serverV2GetGraphRes.message}`);
|
|
281
|
-
return;
|
|
183
|
+
devLog(`✗ Check: Failed to fetch V2 graph from server: ${serverV2GetGraphRes.message}`); return;
|
|
282
184
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
const v2GraphsEqual = graphsAreEquivalent({ graphA: localV2Graph, graphB: serverV2Graph });
|
|
286
|
-
if (v2GraphsEqual) {
|
|
287
|
-
devLog('✓ Check: V2 timeline dependency graphs are equivalent on client and server.');
|
|
288
|
-
} else {
|
|
289
|
-
devLog('✗ Check: V2 timeline dependency graphs mismatch between client and server!');
|
|
290
|
-
return;
|
|
185
|
+
if (!graphsAreEquivalent({ graphA: localV2Graph, graphB: serverV2GetGraphRes.graph })) {
|
|
186
|
+
devLog('✗ Check: V2 timeline dependency graphs mismatch between client and server!'); return;
|
|
291
187
|
}
|
|
188
|
+
devLog('✓ Check: V2 timeline dependency graphs are equivalent on client and server.');
|
|
292
189
|
|
|
293
|
-
// 3. Verify
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
if (!latestLocalIAddr) {
|
|
299
|
-
devLog('✗ Check: Evolved domain keystone tip NOT found in local space!');
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
190
|
+
// 3. Verify domain keystone n=1, then verify domain/delegate/session on server.
|
|
191
|
+
// I only evolves once (delegate registration during setup).
|
|
192
|
+
// The delegate is the sync sender and evolves during sync passes, not I.
|
|
193
|
+
const latestLocalIAddr = await metaspace.getLatestAddr({ addr: domainAddr, space });
|
|
194
|
+
if (!latestLocalIAddr) { devLog('✗ Check: Domain keystone tip not found locally!'); return; }
|
|
302
195
|
const localIRes = await metaspace.get({ addrs: [latestLocalIAddr], space });
|
|
303
196
|
const localI = localIRes.ibGibs?.[0] as KeystoneIbGib_V1 | undefined;
|
|
304
|
-
if (!localI) {
|
|
305
|
-
devLog('✗ Check: Failed to load evolved I from local space.');
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
devLog(`✓ Check: Evolved Domain Keystone exists locally: ${latestLocalIAddr}`);
|
|
197
|
+
if (!localI) { devLog('✗ Check: Failed to load domain keystone!'); return; }
|
|
309
198
|
|
|
310
199
|
const nI = localI.data?.n;
|
|
311
200
|
devLog(`✓ Check: Evolved I tip is at n = ${nI}.`);
|
|
312
|
-
if (nI !==
|
|
313
|
-
devLog(`✗ Check: Expected I to evolve to n =
|
|
314
|
-
return;
|
|
201
|
+
if (nI !== 1) {
|
|
202
|
+
devLog(`✗ Check: Expected I to evolve to n = 1 (delegate registration only), got n = ${nI}.`); return;
|
|
315
203
|
}
|
|
316
204
|
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
devLog(`✗ Check: Evolved Domain Keystone tip NOT found on server!`);
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
devLog(`✓ Check: Evolved Domain Keystone tip exists on server.`);
|
|
323
|
-
|
|
324
|
-
// 4. Verify session identity S tip exists locally and on server, n = 3
|
|
325
|
-
const syncProof = localI.data?.proofs?.find(p => p.claim?.verb === 'sync');
|
|
326
|
-
const sessionIdentityTjpAddr = syncProof?.claim?.target;
|
|
327
|
-
if (!sessionIdentityTjpAddr) {
|
|
328
|
-
devLog('✗ Check: Evolved I sync claim does not target a session keystone.');
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
const latestLocalSAddr = await metaspace.getLatestAddr({
|
|
333
|
-
addr: sessionIdentityTjpAddr,
|
|
334
|
-
space
|
|
205
|
+
const { sessionIdentityTjpAddr } = await verifyIdentitiesOnServer({
|
|
206
|
+
localI, metaspace, space, apiBridge, domainAddr
|
|
335
207
|
});
|
|
208
|
+
|
|
209
|
+
// 4. Verify session keystone S n=3 and graph matches
|
|
210
|
+
const latestLocalSAddr = await metaspace.getLatestAddr({ addr: sessionIdentityTjpAddr, space });
|
|
336
211
|
if (!latestLocalSAddr) {
|
|
337
|
-
devLog('✗ Check: Latest Session Keystone (S) NOT found in local space.');
|
|
338
|
-
return;
|
|
212
|
+
devLog('✗ Check: Latest Session Keystone (S) NOT found in local space.'); return;
|
|
339
213
|
}
|
|
340
214
|
devLog(`✓ Check: Found latest session keystone (S) locally: ${latestLocalSAddr}`);
|
|
341
215
|
|
|
342
216
|
const localSRes = await metaspace.get({ addrs: [latestLocalSAddr], space });
|
|
343
217
|
const sessionS = localSRes.ibGibs?.[0] as KeystoneIbGib_V1 | undefined;
|
|
344
|
-
if (!sessionS) {
|
|
345
|
-
devLog('✗ Check: Failed to load latest Session Keystone (S) locally.');
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
218
|
+
if (!sessionS) { devLog('✗ Check: Failed to load Session Keystone (S) locally.'); return; }
|
|
348
219
|
|
|
349
220
|
const nS = sessionS.data?.n;
|
|
350
221
|
devLog(`✓ Check: Latest session S tip evolved to n = ${nS}.`);
|
|
351
222
|
if (nS !== 3) {
|
|
352
|
-
devLog(`✗ Check: Expected latest session S to evolve to n = 3, got n = ${nS}.`);
|
|
353
|
-
return;
|
|
223
|
+
devLog(`✗ Check: Expected latest session S to evolve to n = 3, got n = ${nS}.`); return;
|
|
354
224
|
}
|
|
355
225
|
|
|
356
226
|
const serverSGetRes = await apiBridge.getIbGib(domainAddr, latestLocalSAddr);
|
|
357
227
|
if (!serverSGetRes.success || !serverSGetRes.ibGib) {
|
|
358
|
-
devLog(`✗ Check: Latest Session Keystone (S) NOT found on server!`);
|
|
359
|
-
return;
|
|
228
|
+
devLog(`✗ Check: Latest Session Keystone (S) NOT found on server!`); return;
|
|
360
229
|
}
|
|
361
230
|
devLog(`✓ Check: Latest Session Keystone (S) exists on server.`);
|
|
362
231
|
|
|
363
|
-
|
|
364
|
-
const localSGraph = await metaspace.getDependencyGraph({
|
|
365
|
-
ibGibAddr: latestLocalSAddr,
|
|
366
|
-
space
|
|
367
|
-
});
|
|
232
|
+
const localSGraph = await metaspace.getDependencyGraph({ ibGibAddr: latestLocalSAddr, space });
|
|
368
233
|
const serverSGetGraphRes = await apiBridge.getIbGibGraph(domainAddr, sessionIdentityTjpAddr, true);
|
|
369
234
|
if (!serverSGetGraphRes.success || !serverSGetGraphRes.graph) {
|
|
370
|
-
devLog(`✗ Check: Failed to fetch session S graph from server: ${serverSGetGraphRes.message}`);
|
|
371
|
-
return;
|
|
235
|
+
devLog(`✗ Check: Failed to fetch session S graph from server: ${serverSGetGraphRes.message}`); return;
|
|
372
236
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
const sGraphsEqual = graphsAreEquivalent({ graphA: localSGraph, graphB: serverSGraph });
|
|
376
|
-
if (sGraphsEqual) {
|
|
377
|
-
devLog('✓ Check: Session Keystone (S) dependency graphs are equivalent on client and server.');
|
|
378
|
-
} else {
|
|
379
|
-
devLog('✗ Check: Session Keystone (S) dependency graphs mismatch between client and server!');
|
|
380
|
-
return;
|
|
237
|
+
if (!graphsAreEquivalent({ graphA: localSGraph, graphB: serverSGetGraphRes.graph })) {
|
|
238
|
+
devLog('✗ Check: Session Keystone (S) dependency graphs mismatch between client and server!'); return;
|
|
381
239
|
}
|
|
240
|
+
devLog('✓ Check: Session Keystone (S) dependency graphs are equivalent on client and server.');
|
|
382
241
|
|
|
383
242
|
devLog('🎉 ALL PHASE 4.3B TRANSACTION SYNC CHECKS PASSED FLAWLESSLY! ✓');
|
|
384
243
|
btn.textContent = '✓ 4.3B All Passed';
|