Files
streamline/drizzle/0005_unrepro_digests.sql
2026-11-16 17:26:44 -08:00

30 lines
1.1 KiB
SQL

-- 无法复现的产出化 — the reporter-facing write-back for an unreproducible run.
--
-- Keyed on target_id (one row per task) rather than an autonomous id: a ticket
-- receives exactly ONE such comment, and making that a primary key is what
-- prevents a double-post at the storage layer instead of relying on a check in
-- application code that a retry could race past.
--
-- posted_at is the irreversibility marker: once set, the body on this row is
-- what a human on another team actually read, so regeneration and editing are
-- both refused past that point (see unrepro_digest.ts).
CREATE TABLE IF NOT EXISTS "unrepro_digests" (
"target_id" text PRIMARY KEY NOT NULL,
"category" text NOT NULL,
"suggested_category" text NOT NULL,
"signals" text,
"body" text NOT NULL,
"attempts" bigint,
"condition_count" bigint,
"evidence_count" bigint,
"generated_at" bigint NOT NULL,
"posted_at" bigint,
"posted_by" text,
"post_error" text
);
-- The console's "which unrepro tasks still owe the reporter an answer?" query.
CREATE INDEX IF NOT EXISTS "unrepro_digests_posted_idx"
ON "unrepro_digests" ("posted_at");