Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(core): initialize person enrollment with device schema [H15]
Corey Olsond3f88473561d
diff --git a/relay/device-store.js b/relay/device-store.jsindex e6be3089..a69c852e 100644--- a/relay/device-store.js+++ b/relay/device-store.js@@ -21,6 +21,10 @@ export function createDeviceStore({ directory, now = Date.now }) {CREATE TABLE IF NOT EXISTS device_session (account TEXT NOT NULL, session TEXT NOT NULL, device TEXT NOT NULL, expires INTEGER NOT NULL, PRIMARY KEY(account,session,device));CREATE TABLE IF NOT EXISTS wrapped_key (account TEXT NOT NULL, device TEXT NOT NULL, board TEXT NOT NULL, engine INTEGER NOT NULL, wrapped TEXT NOT NULL, PRIMARY KEY(account,device,board));CREATE TABLE IF NOT EXISTS enrollment (account TEXT NOT NULL, locator TEXT NOT NULL, expires INTEGER NOT NULL, payload TEXT, PRIMARY KEY(account,locator));+ CREATE TABLE IF NOT EXISTS person_enrollment (+ account TEXT NOT NULL, nonce TEXT NOT NULL, device TEXT NOT NULL, expires INTEGER NOT NULL,+ payload TEXT NOT NULL, used INTEGER NOT NULL DEFAULT 0, wrapped TEXT,+ PRIMARY KEY(account,nonce));CREATE TABLE IF NOT EXISTS phone_approval (id TEXT PRIMARY KEY, account TEXT NOT NULL, publisher TEXT NOT NULL,board TEXT NOT NULL, device TEXT NOT NULL, action TEXT NOT NULL, machine TEXT NOT NULL, expires INTEGER NOT NULL,context TEXT NOT NULL, sealed TEXT NOT NULL, state TEXT NOT NULL DEFAULT 'waiting', response TEXT);diff --git a/relay/person-enrollment-store.js b/relay/person-enrollment-store.jsindex 90bc0725..2bac7073 100644--- a/relay/person-enrollment-store.js+++ b/relay/person-enrollment-store.js@@ -6,12 +6,7 @@ import { personEnrollmentBody } from '../src/person-enrollment.js';export function createPersonEnrollmentStore({ database, now }) {/** Keep spent nonces permanently spent; expiry never makes an old request reusable. */function db() {- const opened = database();- opened.exec(`CREATE TABLE IF NOT EXISTS person_enrollment (- account TEXT NOT NULL, nonce TEXT NOT NULL, device TEXT NOT NULL, expires INTEGER NOT NULL,- payload TEXT NOT NULL, used INTEGER NOT NULL DEFAULT 0, wrapped TEXT,- PRIMARY KEY(account,nonce));`);- return opened;+ return database();}/** Hide other accounts and reject revocation or an expired pending challenge. */function entry(account, nonce) {