Skip to content

Version crypto stores and align the SAS dependency floor - #30

Merged
TroyHernandez merged 6 commits into
mainfrom
fix/matrix-store-schema
Sep 11, 2026
Merged

TroyHernandez merged 6 commits into
mainfrom
fix/matrix-store-schema

Conversation

@TroyHernandez

@TroyHernandez TroyHernandez commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • Write schema version 1 in sessions.json while continuing to read unversioned legacy and four-map session stores.
  • Validate explicit versions in all 3 crypto-store loaders, including cross-signing.json and supported JSON account envelopes. Unknown/malformed versions are rejected before unpickling; errors identify the full file path.
  • Keep account.pickle writes in the existing raw encrypted format. The version-1 envelope reader remains available, but loading never rewrites the file. Envelope writes are deferred to a later release.
  • Raise the optional mx.crypto floor from 0.2.1.1 to the released 0.2.2, which includes the SAS primitives. No mx.crypto code changes.
  • Include the checked Unix-only permission assertion correction in its own commit; cryptographic tests still run on Windows.
  • Version 0.2.0.11 has its own DESCRIPTION/NEWS bump commit. CI ordering and its released-crypto gate have separate follow-up commits, without rewriting review history.

Compatibility

Account files saved by this PR remain readable by older mx.client versions. There is no account-file format migration. Session stores add a version field without changing the existing session maps; cross-signing files retain their existing versioned format.

The reader also accepts version-1 JSON account envelopes without rewriting them on load. A later explicit save writes the raw form, preserving the current account state. Unknown envelope versions are refused.

Validation

  • Fresh isolated 0.2.0.11 installation with released mx.crypto 0.2.2 and mx.api 0.3.1.
  • Full source test directory: 792/792, including 109 schema/persistence assertions using real encrypted state.
  • tinypkgr::check(args = "--no-manual"): 0 errors, 0 warnings, 0 notes, including tests and vignette rebuild.
  • Independent-process compatibility probe: the previous envelope writer fails to load in mx.client 0.2.0.10; the corrected writer loads successfully in that same older build after one-time-key replenishment, with matching identity and key-ID/value maps.
  • Regression coverage retains malformed/future versions across all 3 files, checksum-preserved refusal, legacy/four-map sessions, and no key creation before schema rejection. New assertions cover raw writes, envelope reads followed by raw writes, full-path errors, and order-independent key-map comparison.
  • CI source installs run after generic dependencies so stale binary mirrors cannot downgrade them. The installer control verifies source repositories, immutable crypto pin, and actual test-double invocation.
  • No new Windows submission for this follow-up. Platform CI runs on this PR.

This PR remains open for review. Drat separately serves mx.client 0.2.0.10; the 0.2.0.11 changes have not been published there or deployed.

@TroyHernandez

Copy link
Copy Markdown
Contributor Author

The initial macOS run installed mx.api 0.3.0.2 successfully, then the general dependency step tried to upgrade it to the newly published 0.3.1 but downloaded the stale 0.3.0 macOS binary. Package checking correctly rejected the resulting version below DESCRIPTION's floor.

The follow-up CI commit moves the version-controlled source installs after general dependencies and lets mx.api resolve from CRAN source, with drat as a fallback. The crypto commit remains pinned to 0.2.2. Local checks confirm the ordering, repository list, immutable pin, and actual invocation of the test double; no package code changed in this follow-up.

@TroyHernandez

Copy link
Copy Markdown
Contributor Author

Applied the requested revision in 6ba54ce:

  • Account saves again write the raw encrypted pickle. Envelope read support and named-version refusal remain.
  • Refusal errors include the complete supplied store-file path.
  • DESCRIPTION now requires the released optional mx.crypto >= 0.2.2; documentation matches.
  • Tests assert raw format after account creation, one-time-key replenishment, raw reload/save, and envelope read/save.

The actual mx.client 0.2.0.10 build was exercised in a separate process against temporary state. It rejects the previous envelope writer (negative control) and accepts the corrected writer with unchanged identity and matching one-time-key maps. No live store or console installation was changed.

The source suite now passes 792/792; local package check reports 0 errors, 0 warnings, 0 notes. 8df0299 separately aligns CI's crypto gate to 0.2.2. The earlier CI ordering correction is already its own commit, 6d2ef87. Version remains 0.2.0.11 on this existing PR.

@TroyHernandez
TroyHernandez merged commit 20801a2 into main Sep 11, 2026
2 checks passed
@TroyHernandez
TroyHernandez deleted the fix/matrix-store-schema branch September 11, 2026 15:41
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