refactor(state): move device identity into canonical SQLite state (#110392)

* refactor: store device identities in SQLite

* style: satisfy Swift identity lint limits

* test: harden device identity migration fixtures

* fix: harden SQLite device identity recovery

* chore: remove stale identity helper

* refactor: isolate device identity repair

* chore: remove stale migration import

* test: validate migrated identity key types

* fix: harden device identity repair

* style: format device identity assertion

* fix: derive repaired identity key from PEM

* style: remove redundant PEM conversions

* fix: align native identity store with schema v4

* fix(state): satisfy SQLite identity CI gates

* fix(state): coordinate native identity migration

* test(doctor): include native identity claim path

* fix(infra): preserve coordinator release error

* fix(state): clear identity validation gates

* refactor(apple): remove identity test-only APIs

* refactor(apple): remove dead identity error type

* test(apple): use canonical identity test seam

* test(macos): isolate gateway readiness identity
This commit is contained in:
Peter Steinberger
2026-07-18 17:43:56 +01:00
committed by GitHub
parent d022b1f560
commit 98410d986e
73 changed files with 5515 additions and 1291 deletions
+3 -3
View File
@@ -54,11 +54,11 @@ describe("runNodeIdentityShow", () => {
runNodeIdentityShow({});
expect(errorSpy).toHaveBeenCalledOnce();
expect(exitSpy).toHaveBeenCalledWith(1);
expect(fs.existsSync(path.join(stateDir, "identity", "device.json"))).toBe(false);
expect(fs.existsSync(path.join(stateDir, "state", "openclaw.sqlite"))).toBe(false);
});
it("writes deviceId and raw public key JSON to stdout", () => {
const identity = loadOrCreateDeviceIdentity(path.join(stateDir, "identity", "device.json"));
const identity = loadOrCreateDeviceIdentity();
runNodeIdentityShow({ json: true });
expect(exitSpy).not.toHaveBeenCalled();
expect(logSpy).not.toHaveBeenCalled();
@@ -75,7 +75,7 @@ describe("runNodeIdentityShow", () => {
});
it("prints human-readable lines without --json", () => {
const identity = loadOrCreateDeviceIdentity(path.join(stateDir, "identity", "device.json"));
const identity = loadOrCreateDeviceIdentity();
runNodeIdentityShow({});
expect(exitSpy).not.toHaveBeenCalled();
const output = logSpy.mock.calls.map((call: unknown[]) => String(call[0])).join("\n");