pr_01m47d15m3e54sn21z27rpy5n9/services/work/migrations/0008_plans.sql

31 lines1,210 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Agents as a team: lifecycle, merge queue, billing and a new shell1-- Planning: an outcome someone wrote, turned by an agent into issues with
2-- the order they have to land in, which a person reads before any of it
3-- is opened.
4CREATE TABLE plans (
5 id TEXT PRIMARY KEY,
6 repo_id TEXT NOT NULL,
7 -- The outcome wanted, as written.
8 brief TEXT NOT NULL,
9 -- planning, ready, failed or applied.
10 status TEXT NOT NULL DEFAULT 'planning',
11 -- The agent's account of how it split the work.
12 summary TEXT,
13 -- JSON array of proposed issues; once applied, each carries its number.
14 issues TEXT NOT NULL DEFAULT '[]',
15 error TEXT,
16 -- SHA-256 of the token the sandbox reports with.
17 token_hash TEXT NOT NULL,
18 author_id TEXT NOT NULL,
19 author_name TEXT NOT NULL,
20 created_at TEXT NOT NULL,
21 finished_at TEXT
22);
23CREATE INDEX plans_by_repo ON plans (repo_id, id);
24
25-- The issues that have to be merged before this one is worked on: a JSON
26-- array of issue numbers.
27ALTER TABLE issues ADD COLUMN blocked_by TEXT NOT NULL DEFAULT '[]';
28-- Set when someone asked for a g1t agent to take the issue as soon as it
29-- can: JSON of who asked, on whose say-so the agent then works. Cleared
30-- when a pull request is opened for it.
31ALTER TABLE issues ADD COLUMN queued_by TEXT;