mirror of
https://github.com/bitbaum/substrata.git
synced 2026-12-05 00:18:23 +01:00
* feat(desk): make the desk controllable — filters, marks, rails, sweep settings Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(desk): reconcile with Ask — one railsOf, lead reads in sweep-queue Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(desk): whole-word rail matching; split review queue; size ratchet baseline Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(desk): trace every number to a constant; no 'analyst' wording; rebaseline sizes Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
27 lines
1.1 KiB
PL/PgSQL
27 lines
1.1 KiB
PL/PgSQL
BEGIN;
|
|
|
|
-- What a reader has done with a row on their desk: read it, saved it, hidden
|
|
-- it. Keyed by 'event:<id>' or 'lead:<id>', so both kinds of row share one
|
|
-- table and a lead that later becomes an event keeps nothing it should not.
|
|
CREATE TABLE IF NOT EXISTS research_desk_marks (
|
|
actor_id text NOT NULL,
|
|
item_key text NOT NULL,
|
|
state text NOT NULL CHECK (state IN ('read', 'saved', 'hidden')),
|
|
marked_at timestamptz NOT NULL DEFAULT now(),
|
|
PRIMARY KEY (actor_id, item_key, state)
|
|
);
|
|
|
|
-- How the scheduled sweep behaves, editable by a reviewer from the desk
|
|
-- rather than by a deploy. One row. An absent key means the code's default.
|
|
CREATE TABLE IF NOT EXISTS research_sweep_settings (
|
|
id boolean PRIMARY KEY DEFAULT true CHECK (id),
|
|
settings jsonb NOT NULL DEFAULT '{}'::jsonb,
|
|
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
updated_by text
|
|
);
|
|
|
|
COMMENT ON TABLE research_desk_marks IS 'Per-reader read/saved/hidden marks on desk rows. Private to the reader.';
|
|
COMMENT ON TABLE research_sweep_settings IS 'Operator settings for the scheduled sweep: cadence, batch size, extra blocked hosts and event words.';
|
|
|
|
COMMIT;
|