| 1 | -- Dynamic specialists slice 1 (protocol 38): Design as a data specialist. |
| 2 | -- Team records, the same for every member. Nothing an existing row holds |
| 3 | -- changes meaning: a specialist from before is the team's (project_id ""), |
| 4 | -- a task has no maker and no Design runs, a step is bound to no data |
| 5 | -- specialist, and a task file is a Research one. |
| 6 | ALTER TABLE chat_specialists ADD COLUMN project_id text NOT NULL DEFAULT ""; |
| 7 | -- One open proposal and one active row per profile and scope (the team, |
| 8 | -- or one project); declined and revoked rows are history. |
| 9 | CREATE UNIQUE INDEX chat_specialist_open ON chat_specialists(profile, project_id) WHERE state = 'proposed'; |
| 10 | CREATE UNIQUE INDEX chat_specialist_active ON chat_specialists(profile, project_id) WHERE state = 'active'; |
| 11 | -- The data specialist that makes the task's changes ("" is Engineering), |
| 12 | -- and the Design attempts since the person last acted on the task. |
| 13 | ALTER TABLE chat_tasks ADD COLUMN maker_specialist_id text NOT NULL DEFAULT ""; |
| 14 | ALTER TABLE chat_tasks ADD COLUMN design_runs integer NOT NULL DEFAULT 0; |
| 15 | -- The binding a step was dispatched under: the specialist, its revision, |
| 16 | -- its scope and its granted capabilities (JSON); "" is none. |
| 17 | ALTER TABLE chat_steps ADD COLUMN specialist_id text NOT NULL DEFAULT ""; |
| 18 | ALTER TABLE chat_steps ADD COLUMN specialist_revision integer NOT NULL DEFAULT 0; |
| 19 | ALTER TABLE chat_steps ADD COLUMN specialist_project text NOT NULL DEFAULT ""; |
| 20 | ALTER TABLE chat_steps ADD COLUMN specialist_caps text NOT NULL DEFAULT ""; |
| 21 | CREATE INDEX chat_step_specialist ON chat_steps(specialist_id); |
| 22 | -- A task file is a Research image or a Design render (of one option, at |
| 23 | -- one tree digest). |
| 24 | ALTER TABLE chat_task_files ADD COLUMN source text NOT NULL DEFAULT "research"; |
| 25 | ALTER TABLE chat_task_files ADD COLUMN option text NOT NULL DEFAULT ""; |
| 26 | ALTER TABLE chat_task_files ADD COLUMN tree_digest text NOT NULL DEFAULT ""; |
| 27 | |