Editable analysis prompts on the admin page
CI / test (push) Successful in 44s
CI / build (push) Successful in 4m13s
CI / deploy (push) Skipped

The system prompts of the free summary and the paid detailed analysis can be
edited per language under /admin/promptok. Every save is a new row in
prompt_revisions (NULL = built-in text); new analyses record the revision in
prompt_version (v2-r<id>) and the worker uses exactly that text. Existing
analyses stay; the cross-user cache only copies results of the same revision.

The prompt code moves to the shared analysis-prompt crate so the backend can
show the built-in text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-17 14:25:08 +00:00
co-authored by Claude Opus 5.5
parent 0ba80abb47
commit 86d5dc5503
25 changed files with 1051 additions and 347 deletions
@@ -0,0 +1,14 @@
-- Admin-edited system prompts of the analyses. The newest row of a
-- (kind, language) is in force; system NULL means the built-in default.
-- An analysis records the revision it was written with in prompt_version
-- ("v2-r<id>"), so the worker uses exactly that text.
CREATE TABLE prompt_revisions (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
kind text NOT NULL CHECK (kind IN ('summary', 'natal', 'synastry')),
language text NOT NULL,
system text CHECK (system IS NULL OR length(system) BETWEEN 1 AND 50000),
created_by uuid REFERENCES users ON DELETE SET NULL,
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE INDEX prompt_revisions_current ON prompt_revisions (kind, language, id DESC);