O personagem de algodão sorridente do logotipo original do Cotton, sem fundo nem letras

Cotton

Translation workflow

Um app web que traduz diálogos de RPG para 12 idiomas, fiel ao glossário do jogo.

Uma semente escondida no bolso pode aquecer o inverno de um bairro inteiro.

2026.05.06 — 2026.05.26

pinxlab AI R&D, como freelancer · processamento de traduções, julgamento e caminho de revisão

  • App webImplementado · desenvolvimento

Cotton vocabulary

Prompt Layers: SYSTEM_PROMPT_L0 · buildTranslateUserMessage · L1 CONTRACT · L3 SPEAKER · L6 SOURCE · L7 INSTRUCTION · ICU PLACEHOLDER · INLINE TAG · TARGET TEXT ONLY · FORCED MAPPING · L2 GLOSSARY · speaker_keyGlossary: glossary_term · fetchGlossaryHits · canonical_form · forbidden_translations · SUBSTRING MATCH · FORCED MAPPING · FORBIDDEN ALTERNATIVE · L2 GLOSSARY · glossary_hits · glossary_complianceGeneration: AdapterRegistry · anthropic-sdk · openai-sdk · claude-local · codex-local · llm_plan · PIVOT_VIA · shouldPivot · COTTON_ADAPTER_CONCURRENCY · NODE_OPTIONS · pivot_register_carry · translation.refinedRevision: buildTranslateUserMessage · L7 INSTRUCTION · runRefinementLoop · priorAttempt · priorCritique · REJECTED BY THE JUDGE · maxTurns · willRetry · RefinementHooks · HOOK ABORT · turn_count_to_final · critique_for_retry · failingDimensions · cost_ceiling_usd · needs_reviewJudge: glossary_hits · runJudge · JUDGE_SYSTEM_PROMPT · judgeModel · TEMPERATURE 0 · parseJudgeResponse · FOUR-SECTION XML · VERBATIM CHUNKS · severity · critique_for_retry · judge_citation · missingHardGates · TRIGGER ABSENT = PASS · judge.scoredHard Gate: ICU PLACEHOLDER · INLINE TAG · FORBIDDEN ALTERNATIVE · hard_gate_fail · hardGatePassed · glossary_compliance · cps_budget_compliant · icu_validity · inline_tag_preserved · length_constraint · HARD GATE FIRST · missingHardGates · TRIGGER ABSENT = PASSScore: HARD GATE FIRST · computeVerdict · cottonEvalScore · WEIGHTED AVERAGE · tone_register · personality_consistent · emotional_state_match · cultural_marker_preserved · accuracy · pivot_register_carry · auto_approve_threshold · failingDimensions · approval_gate · judge.scoredIntake: processXlsxBytes · classifySheetName · parseGoogleSheetsUrl · source_file · content_sha256 · extractStageDirection · speaker_key · ingest_session · segment.ingested · github.push.receivedCheckpoint: translation_progress · last_completed_step · turn_translated · turn_judged · finalized · jobEntryGuard · SELECT FOR UPDATE · attempt_count · DEFAULT_MAX_RESUME_ATTEMPTS · TWO-TX SPLIT · ON CONFLICT DO NOTHINGSpend Control: llm_plan · costCap · cost_ceiling_usd · rateLimit · FailoverDispatcher · haltOnQuota · detectQuotaFromStream · quota_daily_exhausted · auth_revoked · NO AUTO-SWAP · needs_credential · POST /:id/resumeStale Sweep: COTTON_ADAPTER_CONCURRENCY · NODE_OPTIONS · attempt_count · runStaleSweep · STALE_THRESHOLD_INTERVAL · DLQ_ATTEMPT_CAP · LIMIT 200 · re_enqueued · dead_lettered · ORPHAN RE-ENQUEUE · IN-FLIGHT SET · /health/queues · maxStalledCount · needs_reviewApproval: auto_approve_threshold · ingest_session · SELECT FOR UPDATE · needs_credential · POST /:id/resume · POST /:id/approve · POST /:id/unapprove · POST /:id/reject · APPROVE_FROM · REJECT_FROM · needs_review · reviewer_id · HITL · approval_gate · translation.approved · EDIT & APPROVE · actor_idCorrection: POST /:id/correct · corrected_text · CORRECT_FROM · EDIT & APPROVE · human_corrected_segments · human-corrected-after-mt · translation.human_corrected · supersedes · NEW REVISION · IMMUTABLE HISTORYAudit Trail: turn_count_to_final · severity · judge_citation · content_sha256 · segment.ingested · github.push.received · translation.approved · human_corrected_segments · translation.human_corrected · IMMUTABLE HISTORY · event_log · appendNextEvent · ULID · AGGREGATE VERSION · translation_state_log · actor_id · llm_call_log · telemetryHook · judge.scored · translation.refined

Stack

A API Hono grava um roteiro enviado no PostgreSQL e o coloca na fila do BullMQ sobre o Redis; um worker adiciona o glossário, chama a geração e depois o juiz por um único adaptador (SDK da Anthropic ou da OpenAI, Claude Code ou Codex CLI), registra via Drizzle ORM, passa para a revisão humana ao atingir o limite ou para uma verificação de credenciais diante de um sinal de cota ou de autenticação, e um stale sweep devolve os rascunhos travados.

  1. Stack
  2. Network
A API Hono grava um roteiro enviado no PostgreSQL e o coloca na fila do BullMQ sobre o Redis; um worker adiciona o glossário, chama a geração e depois o juiz por um único adaptador (SDK da Anthropic ou da OpenAI, Claude Code ou Codex CLI), registra via Drizzle ORM, passa para a revisão humana ao atingir o limite ou para uma verificação de credenciais diante de um sinal de cota ou de autenticação, e um stale sweep devolve os rascunhos travados. (ampliar)
NetworkEm um único Mac de desenvolvimento, o navegador chega ao Next.js na porta 3000 e à API Hono na porta 4000 por HTTP; a API e o worker do BullMQ se conectam por TCP ao Redis (6379) e ao PostgreSQL (5432) no Docker Compose, e o worker chama a Anthropic e a OpenAI por HTTPS por meio de seus SDKs ou executa Claude Code e Codex CLI como processos filhos via stdin e stdout. O repositório não configura nenhuma entrada pública para o webhook do GitHub.
Network (ampliar)