Files
buryan-infra/ops/agents/night_queue.sql
T
architect 42ad47296b
lint / hygiene (push) Failing after 18s
lint / hygiene (pull_request) Failing after 17s
standard / check (push) Successful in 8s
standard / check (pull_request) Successful in 12s
[T4/T6/T5] Budget + approvals bans + night DDL/runner + eval harness
2026-11-30 23:44:05 +03:00

36 lines
1.2 KiB
PL/PgSQL

-- T6 night queue / journal (runbook v2.0)
-- Schema: hub_core.agents.night_queue, night_journal
BEGIN;
CREATE TABLE IF NOT EXISTS hub_core.agents.night_queue (
id bigserial PRIMARY KEY,
dedup_key text NOT NULL UNIQUE,
task_id text,
class text NOT NULL,
payload jsonb NOT NULL DEFAULT '{}'::jsonb,
status text NOT NULL DEFAULT 'pending'
CHECK (status IN ('pending','running','done','blocked','failed')),
budget_rub numeric(10,4) NOT NULL CHECK (budget_rub > 0),
approved_by text,
approved_at timestamptz,
created_at timestamptz NOT NULL DEFAULT now(),
started_at timestamptz,
finished_at timestamptz
);
CREATE TABLE IF NOT EXISTS hub_core.agents.night_journal (
id bigserial PRIMARY KEY,
queue_id bigint,
task_id text,
class text NOT NULL,
status text NOT NULL,
tokens bigint DEFAULT 0,
cost_rub numeric(10,4) DEFAULT 0,
write_actions integer DEFAULT 0,
secret_reads integer DEFAULT 0,
error text,
created_at timestamptz NOT NULL DEFAULT now()
);
COMMIT;