Skip to content

test(e2ee-core): independent Python cloud-machines v1 base format vectors (3R-1) - #3890

Merged
zxch3n merged 5 commits into
mainfrom
test/e2ee-cloud-machines-v1-vectors
Dec 5, 2026
Merged

zxch3n merged 5 commits into
mainfrom
test/e2ee-cloud-machines-v1-vectors

Conversation

@zxch3n

@zxch3n zxch3n commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Independent Python test vector for 3R-1 Cloud Machines v1 Base Format against specs/e2ee/formats-v1.md on main (post-feat(e2ee): cloud-machine registry in the v1 base ledger (tags 14–16) #3859):
    • packages/e2ee-core/test/generate-cloud-machines-v1-vector.py
    • packages/e2ee-core/test/cloud-machines-v1-vector.json (SHA-256: d56bbe7f28fe259786d0de7d043230b8d6c9740a38a905df1c0b3fc41bf3de2e, reproducible byte-for-byte)
    • packages/e2ee-core/test/ledger/cloud-machines-v1-vector.test.ts (TS byte-for-byte verifier against @lody/e2ee-core)

Coverage

  • Positive chain (positions 0..10):
    • Genesis, tag 9 [1, 2], tag 1 Bob, tag 3 Bob→Admin, tag 4 personal machine machine/é.
    • Tag 14 initial admission (cloud/alpha-é) with possess-cloud/v1 evidence, tag 14 in-place rekey by Admin Bob preserving generationId, tag 15 revoke (cloud/beta, setting rotationRequired = true), and tag 16 atomic revoke + epoch 1 publication (cloud/gamma, clearing rotationRequired, with XChaCha20-Poly1305 historyPacket and staging recipients excluding cloud machines).
    • Canonical 12-element stateDigestInput (with cloudMachinesRoot) and 23-element SnapshotV7 + SnapshotManifestV7 at pos 0 (empty cloudMachines) and pos 10.
  • Quota boundaries (derived from full signed histories, storing seed scheme + final SnapshotV7):
    • 64 active cloud machines (66-record signed history from genesis, pos 0..65): in-place rekey allowed, 65th initial rejected (device-quota-exceeded).
    • 512 lifetime cloud machines (518-record signed history from genesis, pos 0..517: 1 initial tag 14 + 511 in-place rekeys sharing one machineId and generationId + 4 real tag 13 checkpoints at 129, 258, 387, 516): both initial and in-place rekey rejected (device-quota-exceeded).
  • Negative counterexamples (15 cases):
    • Bidirectional machineId conflicts (devices ↔ cloudMachines), 4 cross-table component key reuse cases (replay), cloud machine signing tag 13 with the exact pos-128 stateDigest (44d083d9…, rejected solely as unauthorized), tag 15/16 nonexistent/already-revoked/regular-device targets (invalid-operation), non-personal machine signing tag 14 (unauthorized), rekey machineId mismatch (invalid-operation), and possess-cloud/v1 digest mismatch (bad-proof).

Spec Note

  • specs/e2ee/formats-v1.md §5 does not specify a concrete error code for off-ledger possession evidence digest mismatch; possess-cloud-digest-mismatch adopts @lody/e2ee-core's bad-proof and the TS test reads expectedError directly from the vector.

… vectors (3R-1)

Add independent Python generator and deterministic JSON vectors for the
v1 cloud-machine registry (specs/e2ee/formats-v1.md from PR #3859,
feat/e2ee-cloud-machines-v1-base @ 64d3fef), leaving existing
non-cloud-machine ledger vectors untouched:

- Positive 11-record chain (pos 0..10): genesis, cap [1,2], member/admin,
  personal machine, tag 14 initial admission + possess-cloud/v1, tag 14
  in-place rekey preserving generationId, tag 15 revoke, and tag 16
  revoke + epoch 1 rotation (with real XChaCha20-Poly1305 historyPacket).
- 12-element stateDigestInput with cloudMachinesRoot and 23-element
  SnapshotV7 ([18..22]) + SnapshotManifestV7 at pos 0 (empty) and pos 10.
- Quota boundary SnapshotV7 scenarios: 64 active (in-place rekey allowed,
  65th initial rejected) and 512 lifetime (both initial and rekey rejected).
- 15 additional negative cases: bidirectional machineId conflicts,
  cross-table component key reuse (ML-DSA-65, P-384, retired X-Wing,
  active Ed25519 transport), cloud machine signing tag 13, nonexistent /
  already-revoked / regular-device targets for tags 15 & 16, unauthorized
  machine signer, rekey machineId mismatch, and possess-cloud/v1 digest
  mismatch.

Model: gemini-4-neon
…vector

Verify all 11 records, state digests, SnapshotV7/ManifestV7, possess-cloud/v1
evidence, 64/512 quota boundaries, and all 15 counterexamples against main's
@lody/e2ee-core implementation. Also adjust synthetic quota base snapshot
positions (128 -> 130, 515 -> 517) so appended test records do not land on
mandatory 129*k tag-13 checkpoint positions, and update specRevision to main.

Model: gemini-4-neon
@zxch3n
zxch3n marked this pull request as ready for review December 5, 2026 12:44
… vector

- Unify possess-cloud-digest-mismatch expectedError to bad-proof (matching
  @lody/e2ee-core since formats-v1 §5 does not mandate an error code) and
  read expectedError from the vector in the TS test.
- Compute the true position-128 stateDigest (44d083d9...) for the
  cloud-machine-signs-tag-13 counterexample so it fails solely on unauthorized.
- Build the lifetime512 base snapshot from a legal 511-step in-place rekey
  chain sharing one machineId and generationId.

Model: gemini-4-neon
…ries

Replace synthetic cloud-machine rows and heads in quotaScenarios with full
signed ledger replays from genesis (real ML-DSA-65/P-384/X-Wing/Ed25519 key
bundles, real possess-cloud/v1 evidences, and real tag-13 checkpoints at
positions 129, 258, 387, 516 for lifetime512; 66 records for active64). Store
seed scheme, checkpoint summaries, and final snapshots in JSON and verify the
final head, state digest, and 512-row rekey chain in the TS test.

Model: gemini-4-neon
@zxch3n
zxch3n added this pull request to the merge queue Dec 5, 2026
Merged via the queue into main with commit 74b11bb Dec 5, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant