[Phase 2.1] Ephemeral worker instance lifecycle in ledger #39

Closed
opened 2026-03-16 19:07:24 +00:00 by Mark · 0 comments
Owner

Deliverables

Add/normalize lifecycle states for ephemeral worker instances:

Lifecycle States

spawn_requested -> spawned -> claimed -> executing -> completed|failed|timed_out -> exited

Ledger Schema

CREATE TABLE worker_instances (
    instance_id TEXT PRIMARY KEY,
    worker_id TEXT,              -- ephemeral identifier
    node_pointer TEXT,           -- where spawned
    capability_id TEXT,
    intent_id TEXT,              -- triggering provision intent
    contract_id TEXT,
    state TEXT,                  -- lifecycle state
    spawned_at TEXT,
    claimed_at TEXT,
    completed_at TEXT,
    exit_code TEXT,              -- success|failed|timed_out
    result_hash TEXT             -- committed result reference
);

Acceptance

  • Every provisioning execution produces complete terminal lifecycle
  • No persistent "active worker" assumption required
  • Worker instance records are queryable by intent_id, capability_id, node_pointer
  • Cleanup policy for old instance records (configurable retention)
## Deliverables Add/normalize lifecycle states for ephemeral worker instances: ### Lifecycle States ``` spawn_requested -> spawned -> claimed -> executing -> completed|failed|timed_out -> exited ``` ### Ledger Schema ```sql CREATE TABLE worker_instances ( instance_id TEXT PRIMARY KEY, worker_id TEXT, -- ephemeral identifier node_pointer TEXT, -- where spawned capability_id TEXT, intent_id TEXT, -- triggering provision intent contract_id TEXT, state TEXT, -- lifecycle state spawned_at TEXT, claimed_at TEXT, completed_at TEXT, exit_code TEXT, -- success|failed|timed_out result_hash TEXT -- committed result reference ); ``` ### Acceptance - [ ] Every provisioning execution produces complete terminal lifecycle - [ ] No persistent "active worker" assumption required - [ ] Worker instance records are queryable by intent_id, capability_id, node_pointer - [ ] Cleanup policy for old instance records (configurable retention)
Mark closed this issue 2026-07-27 00:30:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/mesh-seed#39
No description provided.