ADR-0016: Admin: a console first, then an add-on with storage
- Status: Accepted.
onTranscriptshipped in the core in 0.6, ahead of stage 2; deleting its transcripts with a conversation stays with the stage 2AdminStore(decided 2026-11-25, see "As of 0.6"). Extended by ADR-0032 (accepted 2026-11-27): theAdminStoreport, delete and sweep reaching it, and how the console is served and signed into. The console's test questions per bot are not built in 0.7 (ADR-0032, "As built in 0.7"). ADR-0035 (accepted 2026-11-30) makes themaskdare eval's test cases. - Date: 2026-11-11
Context
Once a bot is live, its owner wants to see it from the inside: which configuration is running, whether OpenAI accepts it, what the model is really told, what a turn costs, how visitors rate the answers and what went wrong in the badly rated conversations.
What exists today:
askdare doctorchecks every bot live (model, vector store, transcription model) through/doctor, behind a token derived fromCHAT_SECRET. It prints to a terminal.onUsageandonFeedback(ADR-0012) hand each turn's cost and each rating to the app, without message content. askdare stores neither.- No database (ADR-0003). The OpenAI Conversations API can't list conversations, so askdare can't browse them either.
- No content or PII in logs, no cookies (ADR-0004), and the server configuration (model, instructions, tools, vector stores) never reaches a browser (ADR-0008).
Some of what owners want needs no storage at all (configuration, checks, a playground). Dashboards and reviews over time do. This ADR fixes the shape of both, so the core work in 0.3 doesn't close doors. Implementation comes later.
Decision
Stage 1: a console without a database
A console route served by the chat handler, off by default.
-
What it shows:
- each bot's configuration as the server resolved it, secrets masked, with its texts per language (ADR-0014);
- the
doctorresults, run from the page; - a playground: send a message as a test visitor and see the resolved instructions (with the per-request context filled in), the tools offered on each step (the reserved
suggest_repliesincluded, ADR-0015), the steps taken and the turn's cost from the same reportonUsagegets; - a set of test questions per bot, run one by one or all at once, with the answers side by side for a manual check.
-
The test questions come from configuration (
defineBotor the console's options), never from files read at runtime. -
Nothing is stored. Results live in the page until it's closed.
-
Access: the console shows what ADR-0008 keeps from browsers, so it is protected by either:
- a secret, as
/doctoris today (a token derived fromCHAT_SECRETor a separate admin secret), entered in the page and kept in memory; or - the site's identity (ADR-0009): a signed-in user whose ID is on an allowlist in the server configuration.
No cookies, as everywhere else: the console sends a Bearer token on each request. Its pages are
no-storeandframe-ancestors 'none'. - a secret, as
-
Playground turns are real turns. They cost money, so they go through the bot's budgets and limits like any other turn, and appear in
onUsage.
Stage 2: @boldare/askdare-admin
An add-on for owners who want history: dashboards and reviews.
- An
AdminStoreport, shaped likeRateLimitStore: a small interface, a contract test suite every implementation runs, and official implementations for Postgres and Upstash. The core keeps no database. - It is fed by server hooks:
onUsagefor cost, latency and tool calls (ADR-0012);onFeedbackfor ratings and comments (ADR-0012);- a new
onTranscripthook in the core: opt-in, called after each turn with the visitor's text and the answer, plus the same identifiersonFeedbackgets. It is the only hook that carries content, and nothing calls it unless the app sets it.
- What it shows:
- cost per bot, per day and per model, and the most expensive conversations (by pseudonym);
- ratings over time, and the 馃憥 answers with their comments;
- a review of a 馃憥 conversation: the stored transcript, or, without
onTranscript, the conversation fetched from OpenAI by the IDonFeedbackreceived.
AdminStoreis not a conversation store. It holds reports, ratings and optional transcripts for the owner. Conversation state stays behindConversationStore(ADR-0003); a Postgres conversation store remains a separate add-on.
Rules for both stages
- Admin access is checked by askdare on every request, on top of whatever the app's own auth does. The app can mount the admin behind its own sign-in, but askdare doesn't rely on it.
- GDPR:
- retention is configured, with a default, and older records are deleted;
- deleting a conversation (
DELETE <basePath>/conversation, ADR-0003) also deletes its transcript and ratings from theAdminStore; - records are keyed by pseudonyms (HMACs, ADR-0012), never by IP addresses or raw visitor IDs;
docs/privacy.mdcovers what the add-on stores, and the app's privacy notice must too.
- No content in logs. Transcripts are stored data, never logged. The store implementations log nothing about the values they write.
As of 0.6 (2026-11-25)
onTranscriptis in the core (task t1):createChatHandler({ onTranscript })withChatTranscriptReportandChatTranscriptCitation, called after the answer has streamed and the conversation is free, with the input afteronInputand the answer the visitor saw. A throw reachesonError(ADR-0012, amended).- Deleting a conversation calls no hook in 0.6. Neither
DELETE <basePath>/conversationnor a store'ssweeptells the app, so transcripts it keeps outlive the conversation until its own retention removes them. The GDPR rule above ("deleting a conversation also deletes its transcript") is met by the stage 2AdminStore, which core calls on delete, not by a separateonConversationDeletedhook in 0.6: that hook would be a second public way to do the same thing once the admin store exists, and the apps that keep transcripts today already sweep them by age and key them by conversation and visitor (Own your data, Privacy). If the admin store slips past 0.7, the hook is the fallback, as an additive change.
Consequences
- The core stays database-free. Stage 1 needs only
CHAT_SECRET; stage 2 is opt-in, with its own package and storage. - New public API, when built (ADR-0006):
- the console option and its access settings (stage 1);
onTranscriptand its report type in the core (stage 2);- the
AdminStoreport and the add-on (stage 2).
- The console is the first page that shows server configuration in a browser. It gets a security review before it ships, and
THREAT_MODEL.mda section. onTranscriptmoves content out of OpenAI into storage the owner runs. That is the point (retention, export, independence from OpenAI, as ADR-0003 promised for own storage), and also why it's opt-in.- Reviews without transcripts depend on OpenAI keeping the conversation, so they end when the visitor deletes it.
Alternatives considered
- A hosted dashboard run by Boldare. Conversations and costs would leave the owner's infrastructure, and askdare would need accounts and a backend of its own.
- Admin in the core, with a database. It breaks ADR-0003's promise that two environment variables are enough.
- Only the OpenAI dashboard. It shows cost per project and key, not per bot or conversation, has no ratings, and can't list conversations.
- Only the OpenTelemetry add-on (ADR-0012). Good for cost and latency in tools teams already use, and it stays; it has no ratings or transcripts and no place to review a conversation.
- Ratings and notes in OpenAI conversation metadata. 16 keys per conversation, and it can't be queried (ADR-0012).
- Stage 2 only. The console answers the first questions after launch (what is running, does it work, what does it cost) without any storage, so it comes first.