Changeset 780a7c6 in Klonkt for src/config/database.js
- Timestamp:
- 07/24/2026 07:44:15 PM (7 weeks ago)
- Branches:
- main
- Children:
- b5924eb
- Parents:
- c26cc18
- File:
-
- 1 edited
-
src/config/database.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/config/database.js
rc26cc18 r780a7c6 405 405 ); 406 406 CREATE INDEX IF NOT EXISTS idx_ap_blocks_target ON ap_blocks(target); 407 -- Committed guardian ↔ ward relations, one row per local side. role 408 -- 'ward' = the local slug is a ward of other_uri; 'guardian' = the local 409 -- slug guards other_uri. status is always 'accepted' here now: PENDING 410 -- offers live in ap_guardian_offers below (FEP-633c multi-party handshake). 407 411 CREATE TABLE IF NOT EXISTS ap_guardianships ( 408 412 id INTEGER PRIMARY KEY AUTOINCREMENT, … … 411 415 other_uri TEXT NOT NULL, -- the counterpart actor URI (local or remote) 412 416 other_handle TEXT, -- cached @user@host for display 413 status TEXT NOT NULL, -- 'offered' ( handshake pending) | 'accepted'417 status TEXT NOT NULL, -- 'offered' (legacy) | 'accepted' 414 418 offer_id TEXT, -- the Offer activity id (FEP-633c section 3) 415 419 created_at DATETIME DEFAULT CURRENT_TIMESTAMP, … … 417 421 ); 418 422 CREATE INDEX IF NOT EXISTS idx_ap_guardianships_slug ON ap_guardianships(slug, role, status); 423 -- The multi-party handshake (FEP-633c section 3), one row per offer this 424 -- instance is a party to. Mirrors the Shaer test daemon's Handshake: 425 -- accepts accumulate in ap_guardian_offer_accepts, and the offer commits 426 -- only when the candidate returns the handle after ward + candidate + at 427 -- least one existing guardian have accepted. 428 CREATE TABLE IF NOT EXISTS ap_guardian_offers ( 429 offer_id TEXT NOT NULL, -- the Offer activity id (minted by the candidate) 430 slug TEXT NOT NULL, -- the local site tracking this handshake (each party keeps its own copy) 431 ward_uri TEXT NOT NULL, -- the ward-to-be 432 candidate_uri TEXT NOT NULL, -- the guardian-candidate (fixed initiator) 433 existing_guardians TEXT NOT NULL DEFAULT '[]', -- JSON array of the ward's current guardian URIs 434 status TEXT NOT NULL DEFAULT 'pending', -- 'pending' | 'committed' | 'void' 435 handle TEXT, -- the escalation handle returned at commit (section 6) 436 ward_handle TEXT, -- cached @ward@host for display 437 candidate_handle TEXT, -- cached @candidate@host for display 438 created_at DATETIME DEFAULT CURRENT_TIMESTAMP, 439 PRIMARY KEY (slug, offer_id) 440 ); 441 CREATE INDEX IF NOT EXISTS idx_ap_guardian_offers_slug ON ap_guardian_offers(slug, status); 442 CREATE TABLE IF NOT EXISTS ap_guardian_offer_accepts ( 443 offer_id TEXT NOT NULL, -- FK to ap_guardian_offers 444 slug TEXT NOT NULL, -- the local site's copy of the tally 445 party_uri TEXT NOT NULL, -- the party who accepted (ward | candidate | an existing guardian) 446 created_at DATETIME DEFAULT CURRENT_TIMESTAMP, 447 PRIMARY KEY (slug, offer_id, party_uri) 448 ); 419 449 CREATE TABLE IF NOT EXISTS ap_delivery ( 420 450 id INTEGER PRIMARY KEY AUTOINCREMENT,
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)