Spaces:
Sleeping
Sleeping
File size: 1,145 Bytes
8511813 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | -- federation-node/schema.sql
-- The Vault: Phase 2 Persistent Storage for C-FED-NODE-001
-- Tracks known entities and their trust tier mappings
CREATE TABLE IF NOT EXISTS trust_registry (
seal TEXT PRIMARY KEY,
alias TEXT,
tier TEXT NOT NULL DEFAULT 'QUARANTINE',
first_seen_at DATETIME DEFAULT CURRENT_TIMESTAMP,
last_seen_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
-- The physical envelope store
CREATE TABLE IF NOT EXISTS envelopes (
envelope_id TEXT PRIMARY KEY,
protocol_version TEXT NOT NULL,
message_class TEXT NOT NULL,
sender_seal TEXT NOT NULL,
recipient_seal TEXT NOT NULL,
payload_body TEXT,
status TEXT NOT NULL DEFAULT 'RECEIVED',
received_at DATETIME DEFAULT CURRENT_TIMESTAMP,
expires_at DATETIME,
priority TEXT DEFAULT 'normal'
);
-- Immutable audit log of envelope state transitions
CREATE TABLE IF NOT EXISTS status_history (
id INTEGER PRIMARY KEY AUTOINCREMENT,
envelope_id TEXT NOT NULL,
status TEXT NOT NULL,
transitioned_at DATETIME DEFAULT CURRENT_TIMESTAMP,
reason TEXT,
FOREIGN KEY(envelope_id) REFERENCES envelopes(envelope_id)
);
|