@ibgib/core-gib 0.1.59 → 0.1.61
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/CHANGELOG.md +12 -1
- package/dist/common/other/graph-helper.d.mts.map +1 -1
- package/dist/common/other/graph-helper.mjs +7 -6
- package/dist/common/other/graph-helper.mjs.map +1 -1
- package/dist/keystone/keystone-config-builder.d.mts +1 -2
- package/dist/keystone/keystone-config-builder.d.mts.map +1 -1
- package/dist/keystone/keystone-config-builder.mjs +4 -19
- package/dist/keystone/keystone-config-builder.mjs.map +1 -1
- package/dist/keystone/keystone-constants.d.mts +2 -0
- package/dist/keystone/keystone-constants.d.mts.map +1 -1
- package/dist/keystone/keystone-constants.mjs +2 -0
- package/dist/keystone/keystone-constants.mjs.map +1 -1
- package/dist/keystone/keystone-helpers.d.mts +5 -15
- package/dist/keystone/keystone-helpers.d.mts.map +1 -1
- package/dist/keystone/keystone-helpers.mjs +59 -73
- package/dist/keystone/keystone-helpers.mjs.map +1 -1
- package/dist/keystone/keystone-policy-types.d.mts +6 -4
- package/dist/keystone/keystone-policy-types.d.mts.map +1 -1
- package/dist/keystone/keystone-service-v1.d.mts.map +1 -1
- package/dist/keystone/keystone-service-v1.mjs +4 -8
- package/dist/keystone/keystone-service-v1.mjs.map +1 -1
- package/dist/keystone/keystone-service-v1.respec.mjs +182 -33
- package/dist/keystone/keystone-service-v1.respec.mjs.map +1 -1
- package/dist/keystone/keystone-types.d.mts +4 -11
- package/dist/keystone/keystone-types.d.mts.map +1 -1
- package/dist/keystone/policy/keystone-profile-builder.d.mts +25 -0
- package/dist/keystone/policy/keystone-profile-builder.d.mts.map +1 -0
- package/dist/keystone/policy/keystone-profile-builder.mjs +117 -0
- package/dist/keystone/policy/keystone-profile-builder.mjs.map +1 -0
- package/dist/keystone/policy/profiles/profile-high.json +84 -0
- package/dist/keystone/policy/profiles/profile-low.json +84 -0
- package/dist/keystone/policy/profiles/profile-medium.json +84 -0
- package/dist/keystone/policy/profiles/profile-session.json +84 -0
- package/dist/keystone/policy/profiles/profile-test.json +84 -0
- package/dist/keystone/policy/schemas/connect-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/connect-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/connect-pool.medium.schema.json +23 -0
- package/dist/keystone/policy/schemas/keystone.high.schema.json +26 -0
- package/dist/keystone/policy/schemas/keystone.low.schema.json +26 -0
- package/dist/keystone/policy/schemas/keystone.medium.schema.json +26 -0
- package/dist/keystone/policy/schemas/manage-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/manage-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/manage-pool.medium.schema.json +23 -0
- package/dist/keystone/policy/schemas/revoke-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/revoke-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/revoke-pool.medium.schema.json +23 -0
- package/dist/keystone/policy/schemas/sign-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/sign-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/sign-pool.medium.schema.json +23 -0
- package/dist/keystone/policy/schemas/sync-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/sync-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/sync-pool.medium.schema.json +23 -0
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.d.mts +8 -0
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.mjs +582 -0
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.d.mts +7 -0
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.mjs +274 -0
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.d.mts +8 -0
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.mjs +322 -0
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-conflict-text-merge.withid.respec.d.mts +7 -0
- package/dist/sync/sync-conflict-text-merge.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-conflict-text-merge.withid.respec.mjs +307 -0
- package/dist/sync/sync-conflict-text-merge.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-constants.withid.respec.d.mts +8 -0
- package/dist/sync/sync-innerspace-constants.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-constants.withid.respec.mjs +233 -0
- package/dist/sync/sync-innerspace-constants.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.d.mts +7 -0
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.mjs +233 -0
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.d.mts +7 -0
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.mjs +225 -0
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-multiple-timelines.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.d.mts +7 -0
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.mjs +235 -0
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-partial-update.withid.respec.d.mts +7 -0
- package/dist/sync/sync-innerspace-partial-update.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-partial-update.withid.respec.mjs +211 -0
- package/dist/sync/sync-innerspace-partial-update.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace.withid.respec.d.mts +8 -0
- package/dist/sync/sync-innerspace.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace.withid.respec.mjs +260 -0
- package/dist/sync/sync-innerspace.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mjs +1 -1
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-types.d.mts +12 -1
- package/dist/sync/sync-peer/sync-peer-types.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.d.mts +7 -0
- package/dist/sync/sync-peer/sync-peer-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.mjs +43 -1
- package/dist/sync/sync-peer/sync-peer-v1.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.d.mts +2 -0
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.mjs +28 -9
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.d.mts +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mjs +5 -3
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-sender/sync-peer-websocket-sender-v1.d.mts +16 -0
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-sender/sync-peer-websocket-sender-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-sender/sync-peer-websocket-sender-v1.mjs +223 -79
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-sender/sync-peer-websocket-sender-v1.mjs.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.d.mts.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs +41 -2
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-types.d.mts +4 -0
- package/dist/sync/sync-saga-context/sync-saga-context-types.d.mts.map +1 -1
- package/dist/sync/sync-saga-coordinator.d.mts +6 -0
- package/dist/sync/sync-saga-coordinator.d.mts.map +1 -1
- package/dist/sync/sync-saga-coordinator.mjs +213 -137
- package/dist/sync/sync-saga-coordinator.mjs.map +1 -1
- package/dist/sync/sync-withid.pingpong.respec.mjs +70 -2
- package/dist/sync/sync-withid.pingpong.respec.mjs.map +1 -1
- package/dist/timeline/timeline-api.d.mts.map +1 -1
- package/dist/timeline/timeline-api.mjs +1 -14
- package/dist/timeline/timeline-api.mjs.map +1 -1
- package/dist/witness/space/reconciliation-space/reconciliation-space-base.d.mts.map +1 -1
- package/dist/witness/space/reconciliation-space/reconciliation-space-base.mjs +0 -40
- package/dist/witness/space/reconciliation-space/reconciliation-space-base.mjs.map +1 -1
- package/dist/witness/space/reconciliation-space/reconciliation-space-helper.d.mts.map +1 -1
- package/dist/witness/space/reconciliation-space/reconciliation-space-helper.mjs +6 -6
- package/dist/witness/space/reconciliation-space/reconciliation-space-helper.mjs.map +1 -1
- package/ibgib-foundations.md +2 -1
- package/package.json +1 -1
- package/src/common/other/graph-helper.mts +7 -6
- package/src/keystone/README.md +19 -15
- package/src/keystone/docs/CRYPTANALYSIS.md +185 -0
- package/src/keystone/docs/architecture.md +24 -1
- package/src/keystone/docs/profiles.md +124 -0
- package/src/keystone/keystone-config-builder.mts +3 -21
- package/src/keystone/keystone-constants.mts +2 -0
- package/src/keystone/keystone-helpers.mts +74 -77
- package/src/keystone/keystone-policy-types.mts +6 -4
- package/src/keystone/keystone-service-v1.mts +4 -9
- package/src/keystone/keystone-service-v1.respec.mts +214 -32
- package/src/keystone/keystone-types.mts +5 -9
- package/src/keystone/policy/IMPLEMENTATION.md +60 -0
- package/src/keystone/policy/README.md +94 -0
- package/src/keystone/policy/keystone-profile-builder.mts +131 -0
- package/src/keystone/policy/profiles/profile-high.json +84 -0
- package/src/keystone/policy/profiles/profile-low.json +84 -0
- package/src/keystone/policy/profiles/profile-medium.json +84 -0
- package/src/keystone/policy/profiles/profile-session.json +84 -0
- package/src/keystone/policy/profiles/profile-test.json +84 -0
- package/src/keystone/policy/schemas/connect-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/connect-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/connect-pool.medium.schema.json +23 -0
- package/src/keystone/policy/schemas/keystone.high.schema.json +26 -0
- package/src/keystone/policy/schemas/keystone.low.schema.json +26 -0
- package/src/keystone/policy/schemas/keystone.medium.schema.json +26 -0
- package/src/keystone/policy/schemas/manage-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/manage-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/manage-pool.medium.schema.json +23 -0
- package/src/keystone/policy/schemas/revoke-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/revoke-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/revoke-pool.medium.schema.json +23 -0
- package/src/keystone/policy/schemas/sign-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/sign-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/sign-pool.medium.schema.json +23 -0
- package/src/keystone/policy/schemas/sync-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/sync-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/sync-pool.medium.schema.json +23 -0
- package/src/sync/docs/security-3b.md +92 -0
- package/src/sync/docs/security.md +139 -38
- package/src/sync/sync-conflict-adv-multitimelines.withid.respec.mts +706 -0
- package/src/sync/sync-conflict-basic-divergence.withid.respec.mts +321 -0
- package/src/sync/sync-conflict-basic-multitimelines.withid.respec.mts +374 -0
- package/src/sync/sync-conflict-text-merge.withid.respec.mts +347 -0
- package/src/sync/sync-innerspace-constants.withid.respec.mts +264 -0
- package/src/sync/sync-innerspace-deep-updates.withid.respec.mts +272 -0
- package/src/sync/sync-innerspace-dest-ahead.withid.respec.mts +266 -0
- package/src/sync/sync-innerspace-multiple-timelines.respec.mts +0 -1
- package/src/sync/sync-innerspace-multiple-timelines.withid.respec.mts +273 -0
- package/src/sync/sync-innerspace-partial-update.withid.respec.mts +249 -0
- package/src/sync/sync-innerspace.withid.respec.mts +265 -0
- package/src/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mts +1 -1
- package/src/sync/sync-peer/sync-peer-types.mts +11 -1
- package/src/sync/sync-peer/sync-peer-v1.mts +47 -1
- package/src/sync/sync-peer/sync-peer-websocket/README.md +42 -0
- package/src/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.mts +26 -9
- package/src/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mts +5 -3
- package/src/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-sender/sync-peer-websocket-sender-v1.mts +242 -78
- package/src/sync/sync-saga-context/sync-saga-context-helpers.mts +46 -4
- package/src/sync/sync-saga-context/sync-saga-context-types.mts +5 -0
- package/src/sync/sync-saga-coordinator.mts +221 -137
- package/src/sync/sync-withid.pingpong.respec.mts +76 -3
- package/src/timeline/timeline-api.mts +1 -15
- package/src/timeline/timeline-api.respec.mts +3 -3
- package/src/witness/space/reconciliation-space/reconciliation-space-base.mts +0 -46
- package/src/witness/space/reconciliation-space/reconciliation-space-helper.mts +6 -5
- package/tsconfig.json +6 -1
- package/src/keystone/keystone-policy.schema.json +0 -51
- package/src/sync/docs/ping_pong_plan.md +0 -147
- package/src/witness/space/reconciliation-space/reconciliation-space-base.mts.OLD.md +0 -884
- package/src/witness/space/reconciliation-space/reconciliation-space-helper.mts.OLD.md +0 -125
|
@@ -184,6 +184,27 @@ Context ibgib now has a clean, consistent pair:
|
|
|
184
184
|
|
|
185
185
|
---
|
|
186
186
|
|
|
187
|
+
## respec-gib Testing Framework
|
|
188
|
+
|
|
189
|
+
Because `ibgib` has unique execution environments and a high need for custom asynchronous block handling, it uses a custom testing framework located in `@ibgib/helper-gib/dist/respec-gib`.
|
|
190
|
+
|
|
191
|
+
### Key Framework APIs
|
|
192
|
+
* **`respecfully`**: The equivalent of `describe` or an outer test suite block. It is async and MUST be awaited.
|
|
193
|
+
* **`ifWe`**: The equivalent of `it`, used for defining a specific test case block. It is async and MUST be awaited. It cannot be nested.
|
|
194
|
+
* **`ifWeMight`**: A focused test case (equivalent to `fit` or `it.only`). It is async, MUST be awaited, and cannot be nested.
|
|
195
|
+
* **`iReckon`**: The assertion fluent API (equivalent to `expect`). It is synchronous and should NOT be awaited. Available assertions include: `willEqual(expected)`, `isGonnaBe(expected)`, `isGonnaBeTruthy()`, `isGonnaBeFalsy()`, `isGonnaBeTrue()`, `isGonnaBeFalse()`, `isGonnaBeUndefined()`, and `includes(expected)`. You can modify assertions using `.not` and `.asTo(label)`.
|
|
196
|
+
|
|
197
|
+
### Crucial Execution & Logging Nuances
|
|
198
|
+
> [!IMPORTANT]
|
|
199
|
+
> **File Focus vs. Code Execution**:
|
|
200
|
+
> The test runner scans all test files for the presence of `ifWeMight` (or `respecfullyDear`) to determine which *files* get selected and executed. However, once a file is selected and run, **the entire file executes**.
|
|
201
|
+
>
|
|
202
|
+
> **The Logging Caveat**:
|
|
203
|
+
> The `ifWeMight` filter **only** determines which test results are ultimately *reported* in the test summary output. This means all code and `console.log` statements in any standard `ifWe` blocks within the same file will **still execute and write to the logs**.
|
|
204
|
+
> This behavior can make test logs extremely noisy and confusing. If you are focusing on a single test, you should temporarily change all other `ifWeMight` blocks to `ifWe`, and use a single `ifWeMight` block or comment out other logs/tests to keep console output readable.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
187
208
|
## Implementation Plan
|
|
188
209
|
|
|
189
210
|
Each phase below is a discrete, verifiable step. We proceed **one checkbox at a time**, **reviewing/discussing** code/results before moving to the next. Each phase has two targets: **innerspace** (automated unit test) and **space-gib** (manual/integrated e2e).
|
|
@@ -285,29 +306,29 @@ We still call `senderCoordinator.sync(...)` — the phase focus is on what `peer
|
|
|
285
306
|
|
|
286
307
|
**Goal**: With identity fully established and transport connected, sync a single ibgib `X` from source to dest. Verify S evolves correctly per turn (`sync` pool), and X's full dependency graph arrives on dest. After commit, both sender and receiver durable spaces must contain: the same evolved I, the full S dependency graph, and the full X dependency graph.
|
|
287
308
|
|
|
288
|
-
#### Phase 3A — Innerspace unit test (`sync-withid.
|
|
309
|
+
#### Phase 3A — Innerspace unit test (`sync-withid.pingpong.respec.mts`)
|
|
289
310
|
|
|
290
|
-
- [
|
|
291
|
-
- [
|
|
292
|
-
- [
|
|
293
|
-
- [
|
|
294
|
-
- [
|
|
295
|
-
- [
|
|
296
|
-
- [
|
|
297
|
-
- [
|
|
298
|
-
- [
|
|
299
|
-
- [
|
|
311
|
+
- [x] Create `sync-withid.pingpong.respec.mts`
|
|
312
|
+
- [x] Create `r1_alpha_v0_source` (represented by `xStone` test domain ibgib)
|
|
313
|
+
- [x] Call `senderCoordinator.sync({ domainIbGibs: [alpha], senderIdentity, senderSecret, ... })`
|
|
314
|
+
- [x] `ifWeMight` — `"alpha dep graph matches on source and dest"`: use `getDependencyGraph` + `graphsAreEquivalent`
|
|
315
|
+
- [x] `ifWeMight` — `"sessionIdentity evolved the expected number of times"`: assert `S.data.n` equals the known deterministic turn count
|
|
316
|
+
- [x] ☑ **TODO**: Manually inspect the full session keystone graph after a first run and count the exact number of outgoing turns (Init + Delta(s) + Commit), then hard-code that number into this assertion
|
|
317
|
+
- [x] `ifWeMight` — `"sender durable space has I (evolved frame)"`: assert I1 addr is in `sourceSpace`
|
|
318
|
+
- [x] `ifWeMight` — `"receiver durable space has I (evolved frame)"`: assert I1 addr is in `destSpace`
|
|
319
|
+
- [x] `ifWeMight` — `"sender durable space has full S dep graph"`: use `getDependencyGraph` on S in `sourceSpace`
|
|
320
|
+
- [x] `ifWeMight` — `"receiver durable space has full S dep graph"`: use `getDependencyGraph` on S in `destSpace`
|
|
300
321
|
|
|
301
322
|
#### Phase 3B — Space-Gib integrated (manual)
|
|
302
323
|
|
|
303
|
-
- [
|
|
304
|
-
- [
|
|
305
|
-
- [
|
|
306
|
-
- [
|
|
307
|
-
- [
|
|
308
|
-
- [
|
|
309
|
-
- [
|
|
310
|
-
- [
|
|
324
|
+
- [x] Trigger a sync of a known test ibgib via `dev-tools.mts` (add "sync - fullsync" button to a new row)
|
|
325
|
+
- [x] Confirm S evolves on each outgoing turn (inspect frame `data.n` in debugger)
|
|
326
|
+
- [x] Confirm X's full dependency graph is present on the client after commit
|
|
327
|
+
- [x] Confirm X's full dependency graph is present on the server after commit
|
|
328
|
+
- [x] Confirm S's full dependency graph is present on the client after commit
|
|
329
|
+
- [x] Confirm S's full dependency graph is present on the server after commit
|
|
330
|
+
- [x] Confirm I's evolved frame (I1) is present on the client after commit
|
|
331
|
+
- [x] Confirm I's evolved frame (I1) is present on the server after commit
|
|
311
332
|
|
|
312
333
|
|
|
313
334
|
---
|
|
@@ -320,14 +341,14 @@ The sync proper will not be called. The test only cares that the pre-connect ide
|
|
|
320
341
|
|
|
321
342
|
#### Phase 1A — Innerspace unit test
|
|
322
343
|
|
|
323
|
-
- [
|
|
344
|
+
- [x] Create `sync-withid.establish.respec.mts` with scaffold:
|
|
324
345
|
- `Metaspace_Innerspace` + two `InnerSpace_V1` (source/dest) + `SyncSagaCoordinator` pair + `newTestPeer()` factory
|
|
325
346
|
- A `senderSecret` constant (test-only plaintext)
|
|
326
347
|
- A `KeystoneService_V1` instance (new'd inline)
|
|
327
|
-
- [
|
|
328
|
-
- [
|
|
329
|
-
- [
|
|
330
|
-
- [
|
|
348
|
+
- [x] Add `respecfully` block: `"Phase 1: establishSessionIdentity"`
|
|
349
|
+
- [x] `ifWeMight` — `"creates sessionIdentity genesis (S) locally"`: assert `S^Stjp` was generated and exists in `sourceSpace`
|
|
350
|
+
- [x] `ifWeMight` — `"evolves senderIdentity (I → I1) with sync claim"`: assert `I1` frame has a proof whose `claim.verb === 'sync'` and `claim.target === S^Stjp`
|
|
351
|
+
- [x] `ifWeMight` — `"posts I1 and S to destSpace (receiver)"`: assert both addrs are retrievable from `destSpace`
|
|
331
352
|
|
|
332
353
|
#### Phase 1B — Space-Gib integrated (manual)
|
|
333
354
|
|
|
@@ -344,7 +365,7 @@ The sync proper will not be called. The test only cares that the pre-connect ide
|
|
|
344
365
|
|
|
345
366
|
#### Phase 2A — Innerspace unit test
|
|
346
367
|
|
|
347
|
-
- [x]
|
|
368
|
+
- [x] Create `sync-withid.connect.respec.mts` with a `respecfully` block: `"Phase 2: connect"`
|
|
348
369
|
- [x] `ifWeMight` — `"connect completes without error"`: call `peer.connect()` and assert no exception
|
|
349
370
|
- [x] `ifWeMight` — `"connect pool is depleted by exactly one challenge"`: assert `S.data.pools['connect'].used` increased by the expected count
|
|
350
371
|
|
|
@@ -362,19 +383,99 @@ The sync proper will not be called. The test only cares that the pre-connect ide
|
|
|
362
383
|
|
|
363
384
|
#### Phase 3A — Innerspace unit test
|
|
364
385
|
|
|
365
|
-
- [
|
|
366
|
-
- [
|
|
367
|
-
- [
|
|
368
|
-
- [
|
|
369
|
-
- [
|
|
386
|
+
- [x] Create `sync-withid.pingpong.respec.mts`
|
|
387
|
+
- [x] Create `r1_alpha_v0_source` via `TestTransformer` (represented by `xStone` test domain ibgib)
|
|
388
|
+
- [x] Call `senderCoordinator.sync({ domainIbGibs: [alpha], senderIdentity, senderSecret, ... })`
|
|
389
|
+
- [x] `ifWeMight` — `"alpha dep graph matches on source and dest"`: use `getDependencyGraph` + `graphsAreEquivalent`
|
|
390
|
+
- [x] `ifWeMight` — `"sessionIdentity evolved once per sync turn"`: assert `S.data.n` equals number of outgoing turns
|
|
370
391
|
|
|
371
392
|
#### Phase 3B — Space-Gib integrated (manual)
|
|
372
393
|
|
|
373
|
-
- [
|
|
374
|
-
- [
|
|
375
|
-
- [
|
|
376
|
-
- [
|
|
377
|
-
- [
|
|
378
|
-
- [
|
|
379
|
-
- [
|
|
380
|
-
- [
|
|
394
|
+
- [x] Trigger a sync of a known test ibgib via `dev-tools.mts` or equivalent UI
|
|
395
|
+
- [x] Confirm S evolves on each outgoing turn (inspect frame `data.n` in debugger)
|
|
396
|
+
- [x] Confirm X's full dependency graph is present on the client after commit
|
|
397
|
+
- [x] Confirm X's full dependency graph is present on the server after commit
|
|
398
|
+
- [x] Confirm S's full dependency graph is present on the client after commit
|
|
399
|
+
- [x] Confirm S's full dependency graph is present on the server after commit
|
|
400
|
+
- [x] Confirm I's full dependency graph is present on the client after commit
|
|
401
|
+
- [x] Confirm I's full dependency graph is present on the server after commit
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
### Phase 4 — Advanced Data and Conflict Scenarios
|
|
406
|
+
|
|
407
|
+
**Goal**: Extend the WebSocket peer and Space-Gib interface to manually execute and verify all advanced data and conflict scenarios currently covered by the InnerSpace unit tests.
|
|
408
|
+
|
|
409
|
+
> [!IMPORTANT]
|
|
410
|
+
> **Guidelines & Testing Reminders**:
|
|
411
|
+
> - Before starting the implementation of any automated test (A) or manual verification (B) in Phase 4, you **MUST** scan/re-scan the variable naming and structural guidelines in [testing.md](file:///c:/Users/billm/antigravity/ibgib/libs/core-gib/src/sync/docs/testing.md) to align the codebase structure and naming conventions.
|
|
412
|
+
> - **Manual Testing (B) Rule**: The AI assistant **MUST NOT** use the browser subagent to perform manual browser/UI testing for any "B" manual verification phases in space-gib. The user will run all B testing themselves to conserve tokens.
|
|
413
|
+
> - **Executing Focused Tests**: After changing previous test phase file's ifWeMight blocks -> ifWe to defocus that file, and after you have setup the new test file with ifWeMight blocks, use `npm run test:core-gib` to execute the new *.respec.mts file. (NOTE: If you search files for these blocks, be sure to include the open paren, e.g., "ifWeMight(", because often ifWeMight remains unused in import statements). After you have executed the tests and they pass, do NOT change it back to ifWe blocks immediately, so I can execute and look at the tests myself.
|
|
414
|
+
|
|
415
|
+
For each scenario:
|
|
416
|
+
1. **Automated Verification (A)**: Copy the grandfathered non-identity unit test file (e.g., `sync-innerspace.respec.mts`) to a new file named with `.withid.` in the filename (e.g., `sync-innerspace.withid.respec.mts`). Incorporate identity setup (referencing `sync-withid.pingpong.respec.mts` for setup pattern) and ensure the test runs and passes.
|
|
417
|
+
* **Test naming/structure convention**: The new `.withid.respec.mts` tests must follow the variable and structural naming guidelines outlined in [testing.md](file:///c:/Users/billm/antigravity/ibgib/libs/core-gib/src/sync/docs/testing.md).
|
|
418
|
+
* **Identity Verification Checks**: Each `.withid.respec.mts` test must verify that the session identity `S` evolved the expected number of times, the user identity `I` evolved the expected number of times on both spaces, and that the full dependency graphs for `S` and `I` are correctly synced to both spaces.
|
|
419
|
+
2. **Manual Verification (B)**: Create manual websocket peer tests with corresponding buttons/UI elements integrated via Dev Tools.
|
|
420
|
+
* **Dont use browser testing**: We must minimize token use, so I will do all of the manual testing in the browser. Do not do automated browser testing in B phases.
|
|
421
|
+
|
|
422
|
+
#### 1. Sync InnerSpace (Basic Push Sync)
|
|
423
|
+
- [x] Phase 4.1A — Automated InnerSpace Verification (`sync-innerspace.withid.respec.mts`)
|
|
424
|
+
- [x] Phase 4.1B — WebSocket Peer Manual Verification (integrated via Dev Tools)
|
|
425
|
+
* Tests basic push sync of a single timeline and its mutations from Source to Destination.
|
|
426
|
+
* Verifies that the target timeline tip and its dependency graph successfully arrive at the destination.
|
|
427
|
+
|
|
428
|
+
#### 2. Sync Constants (No TJP)
|
|
429
|
+
- [x] Phase 4.2A — Automated InnerSpace Verification (`sync-innerspace-constants.withid.respec.mts`)
|
|
430
|
+
- [x] Phase 4.2B — WebSocket Peer Manual Verification (integrated via Dev Tools)
|
|
431
|
+
* Tests syncing "constants" (ibGibs without timelines/TJPs) and verifies that dependencies (linked constants) are resolved.
|
|
432
|
+
* Ensures idempotency/smart diffing (payloads are not re-sent if they already exist in the destination space).
|
|
433
|
+
|
|
434
|
+
#### 3. Sync Destination with Partial History
|
|
435
|
+
- [x] Phase 4.3A — Automated InnerSpace Verification (`sync-innerspace-partial-update.withid.respec.mts`)
|
|
436
|
+
- [x] Phase 4.3B — WebSocket Peer Manual Verification (integrated via Dev Tools)
|
|
437
|
+
* Tests push synchronization when the destination already contains a partial timeline history (e.g., up to V1), but the sender has newer frames (V2).
|
|
438
|
+
* Verifies that only the delta is transmitted and correctly linked to the existing history at the destination.
|
|
439
|
+
- [x] INTERSTITIAL — Refactor `dev-tools.mts` to split it into a `dev-tools` directory containing modular sub-files to reduce file size.
|
|
440
|
+
|
|
441
|
+
#### 4. Sync Deep History Updates
|
|
442
|
+
- [x] Phase 4.4A — Automated InnerSpace Verification (`sync-innerspace-deep-updates.withid.respec.mts`)
|
|
443
|
+
- [x] Phase 4.4B — WebSocket Peer Manual Verification (integrated via Dev Tools)
|
|
444
|
+
* Tests push synchronization of a timeline tip with a deep mutation history (multiple updates).
|
|
445
|
+
* Verifies that the destination receives all intermediate frames, preserving the full timeline history and graph integrity.
|
|
446
|
+
|
|
447
|
+
#### 5. Sync Destination Ahead (Remote Newer)
|
|
448
|
+
- [x] Phase 4.5A — Automated InnerSpace Verification (`sync-innerspace-dest-ahead.withid.respec.mts`)
|
|
449
|
+
- [x] Phase 4.5B — WebSocket Peer Manual Verification (integrated via Dev Tools)
|
|
450
|
+
* Tests synchronization when the destination (remote) actually has a newer frame (V2) than the sender's local tip (V1).
|
|
451
|
+
* Verifies that the sender learns of the remote tip and pulls it down so both client and server converge to the dest-ahead tip.
|
|
452
|
+
|
|
453
|
+
#### 6. Sync Multiple Independent Timelines
|
|
454
|
+
- [x] Phase 4.6A — Automated InnerSpace Verification (`sync-innerspace-multiple-timelines.withid.respec.mts`)
|
|
455
|
+
- [x] Phase 4.6B — WebSocket Peer Manual Verification (integrated via Dev Tools)
|
|
456
|
+
* Tests synchronization of multiple independent timelines (e.g., Timeline A and Timeline B) in a single sync coordinator call.
|
|
457
|
+
* Verifies that both timeline tips and their respective dependency graphs are transferred and updated correctly.
|
|
458
|
+
|
|
459
|
+
#### 7. Basic Divergence Conflict Resolution
|
|
460
|
+
- [x] Phase 4.7A — Automated InnerSpace Verification (`sync-conflict-basic-divergence.withid.respec.mts`)
|
|
461
|
+
- [x] Phase 4.7B — WebSocket Peer Manual Verification (integrated via Dev Tools)
|
|
462
|
+
* Tests divergence when source and destination edit different fields on a shared base timeline simultaneously.
|
|
463
|
+
* Verifies that optimistic merge automatically produces a merged tip (V3) containing both edits and records the graft metadata (`graftbase`, `graftorphan`).
|
|
464
|
+
|
|
465
|
+
#### 8. Divergence with Related Timelines
|
|
466
|
+
- [x] Phase 4.8A — Automated InnerSpace Verification (`sync-conflict-basic-multitimelines.withid.respec.mts`)
|
|
467
|
+
- [x] Phase 4.8B — WebSocket Peer Manual Verification (integrated via Dev Tools)
|
|
468
|
+
* Tests advanced divergence where one of the divergent updates also references/relates a new independent timeline (Beta).
|
|
469
|
+
* Verifies that during optimistic merge, the dependent timeline is synced automatically alongside the merged tip.
|
|
470
|
+
|
|
471
|
+
#### 9. Text Field Merge (LCS) Conflict Resolution
|
|
472
|
+
- [x] Phase 4.9A — Automated InnerSpace Verification (`sync-conflict-text-merge.withid.respec.mts`)
|
|
473
|
+
- [x] Phase 4.9B — WebSocket Peer Manual Verification (integrated via Dev Tools)
|
|
474
|
+
* Tests automatic merging of conflicting string edits within the `ibgib.data.text` field using the LCS (Longest Common Subsequence) merge algorithm.
|
|
475
|
+
* Verifies merging of simple appends (beginning vs. end) and interleaved edits in different paragraphs.
|
|
476
|
+
|
|
477
|
+
#### 10. Advanced Multi-Round/Timeline Permutations
|
|
478
|
+
- [x] Phase 4.10A — Automated InnerSpace Verification (`sync-conflict-adv-multitimelines.withid.respec.mts`)
|
|
479
|
+
- [x] Phase 4.10B — WebSocket Peer Manual Verification (integrated via Dev Tools)
|
|
480
|
+
* Tests complex multi-round/timeline permutations with parallel divergent edits across multiple rounds.
|
|
481
|
+
* Verifies that nested or sequential merges resolve correctly using the optimistic graft strategy.
|