Open source CapCut alternative.
TypeScript
docs: keep tunables as constants beside their code
David Le3524f89f859b
diff --git a/AGENTS.md b/AGENTS.mdindex 1f4b2503..33ac8ff7 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -71,7 +71,7 @@ Every Donkey Cut change has to hold on every surface, and the plan for it says h- Prefer deleting over documenting what was removed. Guides describe what is supported now, not what used to be.- Build forward by default. Prefer updating callers and contracts to the new supported shape instead of preserving old compatibility paths; ask before adding or keeping backwards-compatibility shims.- GPT and Claude model updates include retirement. Verify provider availability and lifecycle in official docs; retire superseded picker entries when a supported successor covers their role, retaining distinct capability or cost tiers. Distinguish Donkey retirement from provider deprecation. Update callers and defaults, migrate saved selections to explicit replacements within the same provider, and preserve chat history. Verify new selections and resumed chats in the same change.-- Configuration is code with a runtime override. Tunables, switches and thresholds are declared in the settings registry (`site/src/lib/config/registry.ts`) with a default and a schema, overridden in the database, and read through it everywhere; env is for secrets. An experiment is variants over settings, drawn by an audience; a feature that people might tune ships its setting in the same change.+- Configuration is code; env is for secrets. Thresholds and tunables are named constants beside their code. The settings registry (`site/src/lib/config/registry.ts`) holds only the levers su runs: offers, credits, plan limits and server operations.- Fail hard. One provider, one model, one code path per job; a missing API key, service, or capability is an error surfaced to the caller. No secondary providers, no retry-on-another-model paths, no `env.X || default` softening. A fallback exists only when it is absolutely necessary — a surface that genuinely cannot carry the feature — and the summary and the guide say so.- After finishing a task, summarize what you did. Ground the summary in the actual code changes — name the files and behavior that changed, not the intent you set out with. If nothing changed, say so. When the change has a shape worth seeing — a system flow or a UI layout — include a small ASCII diagram of it.- This is an open source project. Stay alert for security concerns, and never commit PII, API keys, tokens, credentials, private config, or other secrets.diff --git a/CLAUDE.md b/CLAUDE.mdindex 1f4b2503..33ac8ff7 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -71,7 +71,7 @@ Every Donkey Cut change has to hold on every surface, and the plan for it says h- Prefer deleting over documenting what was removed. Guides describe what is supported now, not what used to be.- Build forward by default. Prefer updating callers and contracts to the new supported shape instead of preserving old compatibility paths; ask before adding or keeping backwards-compatibility shims.- GPT and Claude model updates include retirement. Verify provider availability and lifecycle in official docs; retire superseded picker entries when a supported successor covers their role, retaining distinct capability or cost tiers. Distinguish Donkey retirement from provider deprecation. Update callers and defaults, migrate saved selections to explicit replacements within the same provider, and preserve chat history. Verify new selections and resumed chats in the same change.-- Configuration is code with a runtime override. Tunables, switches and thresholds are declared in the settings registry (`site/src/lib/config/registry.ts`) with a default and a schema, overridden in the database, and read through it everywhere; env is for secrets. An experiment is variants over settings, drawn by an audience; a feature that people might tune ships its setting in the same change.+- Configuration is code; env is for secrets. Thresholds and tunables are named constants beside their code. The settings registry (`site/src/lib/config/registry.ts`) holds only the levers su runs: offers, credits, plan limits and server operations.- Fail hard. One provider, one model, one code path per job; a missing API key, service, or capability is an error surfaced to the caller. No secondary providers, no retry-on-another-model paths, no `env.X || default` softening. A fallback exists only when it is absolutely necessary — a surface that genuinely cannot carry the feature — and the summary and the guide say so.- After finishing a task, summarize what you did. Ground the summary in the actual code changes — name the files and behavior that changed, not the intent you set out with. If nothing changed, say so. When the change has a shape worth seeing — a system flow or a UI layout — include a small ASCII diagram of it.- This is an open source project. Stay alert for security concerns, and never commit PII, API keys, tokens, credentials, private config, or other secrets.diff --git a/docs/guides/backend-apis.md b/docs/guides/backend-apis.mdindex 3f5f82fd..621f521d 100644--- a/docs/guides/backend-apis.md+++ b/docs/guides/backend-apis.md@@ -55,9 +55,8 @@ challenge. OAuth tokens authorize only the tools exposed by that adapter.module reads files from the public folder, keep those bytes out of every otherfunction with `outputFileTracingExcludes` in the Next config.- `process.env` holds secrets only: API keys, credentials, and other sensitive- deploy values. Configuration is code: a constant where one value fits every- install, or a settings registry entry with a default and a schema when- operators tune it at runtime (see the configuration guide). An env-var+ deploy values. Configuration is code: a constant, or a settings registry+ entry for a lever su runs. An env-varfallback like `process.env.SOME_MODEL ?? "default"` ships the feature dormantand hides the real value from readers.diff --git a/docs/guides/cut/ai-assistant.md b/docs/guides/cut/ai-assistant.mdindex 92a7e35e..b1e541ff 100644--- a/docs/guides/cut/ai-assistant.md+++ b/docs/guides/cut/ai-assistant.md@@ -39,7 +39,7 @@ A turn the page lost resumes itself when the thread next opens, replaying the enThe Gemini path skips the engine entirely — the same carve-out as AI media generation. The loop runs on the pi agent harness (the `@earendil-works` packages) in the browser: a custom transport speaks Donkey's hosted responses route with the user's session, tools execute directly against the store, and each thread's conversation persists as the harness's own structured history — past tool calls replay as real tool records, so no bookkeeping rides as prose the model could imitate. Gemini's quirks live in that transport: thought signatures replay exactly with each call, tool media returns as its own following turn, and an empty round retries before it surfaces as an error.-The turn's route is one typed judgment: a System One judge scores the ask's size, the skill to open first, and the tool areas it needs, and code applies the thresholds in the `cutJudge` setting. The first round waits a bounded moment for it, then runs the light chat model with only the routed areas' tools; a simple verdict keeps the run, chat or complex restarts it routed, and a `request_tools` call widens the catalog for the next round. With credits, Claude and Codex turns take the same judgment, which narrows the engine's MCP listing; Codex reads tools once per run, so a widening resumes it.+The turn's route is one typed judgment: a System One judge scores the ask's size, the skill to open first, and the tool areas it needs, and code applies its thresholds. The first round waits a bounded moment for it, then runs the light chat model with only the routed areas' tools; a simple verdict keeps the run, chat or complex restarts it routed, and a `request_tools` call widens the catalog for the next round. With credits, Claude and Codex turns take the same judgment, which narrows the engine's MCP listing; Codex reads tools once per run, so a widening resumes it.The same loop code runs with no browser at all. A headless session opens a project doc into the editor store, binds both transports at an explicit origin with auth headers, and runs the production chat loop against it — which is how a chat turn becomes a durable job. The page or an API caller posts a thread's messages to the cloud project's turns route; the row is the project's agent write lease (one turn at a time per project); the worker container claims it, runs the turn under a runner grant that spends that user's credits and writes that user's project, pushes the doc back through the versioned PUT, and appends the finished exchange to the stored thread.