From 4b95d7de32b87280656701a26bb206838c3d7a8a Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Tue, 19 May 2026 14:27:55 +0200 Subject: [PATCH] chore(experiments): drop plan references from code comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plans are ephemeral and get removed when the work is done. Comments that pointed readers at `.plans/experimental-models-1.md` or referenced specific plan sections now stand on their own — the relevant context (sentinel meanings, why the api key column is separate, scope of preview routing) is inlined where it matters instead of forwarded to a doc that won't exist long-term. Touched: - apps/web/src/lib/r2/experiment-prompts.ts (header) - apps/web/src/lib/ai-gateway/experiments/persist.ts (sentinel docs) - apps/web/src/lib/ai-gateway/experiments/upstream-schema.ts (api_key) - apps/web/src/app/admin/model-experiments/ModelExperimentsContent.tsx (admin UI subtitle: dropped trailing 'See .plans/...' sentence) - packages/db/src/schema.ts (three model_experiment* table headers) --- .../ModelExperimentsContent.tsx | 1 - .../ai-gateway/experiments/upstream-schema.ts | 4 ++-- packages/db/src/schema.ts | 22 +++++++++++-------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/apps/web/src/app/admin/model-experiments/ModelExperimentsContent.tsx b/apps/web/src/app/admin/model-experiments/ModelExperimentsContent.tsx index 0ca0b7ca0b6..24da8948898 100644 --- a/apps/web/src/app/admin/model-experiments/ModelExperimentsContent.tsx +++ b/apps/web/src/app/admin/model-experiments/ModelExperimentsContent.tsx @@ -165,7 +165,6 @@ function ExperimentList({ onSelect }: { onSelect: (id: string) => void }) { public_model_id {' '} and swaps the upstream checkpoint behind it. Clients keep sending the same public model id. - See .plans/experimental-models-1.md for the full design.

{isLoading ? ( diff --git a/apps/web/src/lib/ai-gateway/experiments/upstream-schema.ts b/apps/web/src/lib/ai-gateway/experiments/upstream-schema.ts index 5ec5902c087..b7eb958e7c4 100644 --- a/apps/web/src/lib/ai-gateway/experiments/upstream-schema.ts +++ b/apps/web/src/lib/ai-gateway/experiments/upstream-schema.ts @@ -10,8 +10,8 @@ import { * * - **Does not include `api_key`.** The encrypted key lives in the sibling * `model_experiment_variant_version.encrypted_api_key` JSONB column so the - * never-read invariant is enforceable at the column level. See - * `.plans/experimental-models-1.md` §"API Keys". + * never-read invariant is enforceable at the column level — admin tRPC + * responses simply omit the column from their selects. * - **Does not include `extra_headers`.** Partner checkpoint routing should * use `api_key` + `base_url` + `internal_id` + adapter settings. If a * non-secret header is required later, add an explicit allowlisted field diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 484d5b1f96e..5c323507e9e 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -6084,9 +6084,11 @@ export type NewSecurityAdvisorScan = typeof security_advisor_scans.$inferInsert; // --------------------------------------------------------------------------- // Model experiments (preview/experimental A/B testing) -// See `.plans/experimental-models-1.md` and (eventually) `.specs/model-experiments.md`. +// // Scope: opt-in dedicated preview public model ids only. Never used for -// production/general traffic. See plan for full design rationale. +// production/general traffic. Users only reach this routing path by +// explicitly selecting a dedicated preview public id (e.g. +// `kilo/preview-experiment-foo`). // --------------------------------------------------------------------------- export const model_experiment = pgTable( @@ -6155,11 +6157,10 @@ export type ModelExperimentVariant = typeof model_experiment_variant.$inferSelec export type NewModelExperimentVariant = typeof model_experiment_variant.$inferInsert; // Immutable per-variant version. New RC = new row. Never UPDATEd. -// `upstream` is validated by ExperimentUpstreamSchema in app code (see -// experimental-models-1.md Phase 1). The api key is stored separately in -// `encrypted_api_key` (same shape as byok_api_keys.encrypted_api_key) so the -// JSONB blob never holds the secret and reporting/admin views can simply omit -// the column. +// `upstream` is validated by ExperimentUpstreamSchema in app code. The +// api key is stored separately in `encrypted_api_key` (same shape as +// `byok_api_keys.encrypted_api_key`) so the JSONB blob never holds the +// secret and reporting/admin views can simply omit the column. export const model_experiment_variant_version = pgTable( 'model_experiment_variant_version', { @@ -6185,8 +6186,11 @@ export type ModelExperimentVariantVersion = typeof model_experiment_variant_vers export type NewModelExperimentVariantVersion = typeof model_experiment_variant_version.$inferInsert; // One row per experimented request, keyed on usage_id (1:1 with microdollar_usage). -// Stores attribution + R2 prompt hashes (or reserved sentinel values). -// See experimental-models-1.md "Prompt Storage (R2)" for sentinel values. +// Stores attribution + R2 prompt hashes. The two sha256 columns hold either +// a 64-char lowercase hex digest pointing at an R2 object, or one of the +// reserved sentinels: `__absent__` (system only, no leading system message), +// `__failed__` (R2 storage failed), `__deleted__` (prompt content wiped +// while retaining attribution). export const model_experiment_request = pgTable( 'model_experiment_request', {