
Cotton
Translation workflow
RPG 대사를 용어집에 맞춰 12개 언어로 번역해 주는 웹 앱입니다.
주머니에 몰래 넣어 온 씨앗 하나가, 온 동네의 겨울을 따뜻하게 바꿉니다.
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
리뷰가 찾은 경쟁 조건, 원인별로 되돌린 정체 작업
Claude 구현·Codex 리뷰로 경쟁 조건을 수정한 사례와, 정체 작업의 원인을 추적한 사례입니다.
2026.05.19
할당량이 바닥나면 멈추게 한 변경을, 리뷰가 찾은 경쟁 조건까지 같은 PR에서 고쳤습니다
사람사람
행동할당량이 바닥나면 지출 중단 · 자동 fallback 없음
- 전달구현 제약→ checkpoint · halt · 수동 재개 구현 (Claude)
코딩 에이전트Claude
행동checkpoint · halt · 수동 재개 구현
- 전달같은 PR 리뷰→ 지적: 경쟁 조건 · 중복 상태 전이 (Codex)
리뷰 · 검증Codex
관측 · 지적지적: 경쟁 조건 · 중복 상태 전이
- 되돌린 지적race · idempotency→ 같은 PR에서: row lock · 고유 점수 키 · 원자적 전이 (같은 PR)
산출물같은 PR
산출물같은 PR에서: row lock · 고유 점수 키 · 원자적 전이
- 전달→ 로컬 fixture · DB 통합 검사 기록 (같은 PR)
산출물같은 PR
산출물로컬 fixture · DB 통합 검사 기록
- 기록된 실행 아님확인한 범위→ 새 CI · 운영 배포 결과는 수집 안 함 (같은 PR)
산출물같은 PR
지침 · 미확인새 CI · 운영 배포 결과는 수집 안 함
- 배경
- 할당량 소진 시 지출을 멈추고 자동 fallback을 금지했습니다.
- 결과
- 진입·재개를 잠금 안에서 처리하고 트랜잭션 경계를 정했습니다.
- 한계
- commit에는 검사 140개, 이후 통합 CHANGELOG에는 160개가 적혀 있어 하나의 실행 수로 합치지 않았습니다.
근거와 남은 한계
- 지침은 Claude 구현, 프로젝트 MCP를 통한 Codex 로컬 리뷰, PR에 리뷰 첨부, 의견이 다르면 Claude의 리뷰 에이전트와 함께 조사하는 순서를 적어 둡니다. CI에서 자동으로 Codex 리뷰를 다는 것은 미뤄 둔 상태였습니다.
- 개발 검사는 fixture와 mock을 쓰고, 실제 모델 호출은 범위를 따로 정해야 합니다. 리뷰 지적은 같은 PR에 접어 넣고 feature → main으로 squash 병합합니다.
2026.05.26
멈춘 작업을 진단할 수 있게 만들고, 원인별로 되돌렸습니다
개발 대상번역 worker · 큐
관측 · 지적draft에 남은 작업 · 시도 소진
- 전달관측값→ failedReason · 종료 코드 · draft 상태 대조 (개발자)
사람개발자
행동failedReason · 종료 코드 · draft 상태 대조
- 전달→ 원인: 상속된 NODE_OPTIONS가 하위 프로세스에서 충돌 (개발자)
사람개발자
관측 · 지적원인: 상속된 NODE_OPTIONS가 하위 프로세스에서 충돌
- 되돌린 지적상속된 옵션 충돌→ NODE_OPTIONS 제거 · 프로세스 단위 동시 실행 상한 (코드 변경)
작업 세션코드 변경
행동NODE_OPTIONS 제거 · 프로세스 단위 동시 실행 상한
- 전달→ 큐 상태: waiting · active · failed · stale (코드 변경)
작업 세션코드 변경
행동큐 상태: waiting · active · failed · stale
- 전달→ stale sweep: 큐에 없음 vs 시도 소진, 결과 유무로 분기 (코드 변경)
작업 세션코드 변경
행동stale sweep: 큐에 없음 vs 시도 소진, 결과 유무로 분기
- 전달한 사이클→ 개발 환경 sweep: 후보 200 → 전이 106 · 재등록 2 · 오류 0 (산출물)
산출물산출물
산출물개발 환경 sweep: 후보 200 → 전이 106 · 재등록 2 · 오류 0
- 기록된 실행 아님해석의 경계→ 106건은 번역 성공이 아님 (산출물)
산출물산출물
지침 · 미확인106건은 번역 성공이 아님
- 배경
- failedReason·하위 프로세스 종료 코드·draft 상태를 대조해 NODE_OPTIONS 상속 충돌을 찾았습니다.
- 결과
- 정체 작업을 큐 누락과 시도 소진으로 나눴습니다.
- 한계
- 동시 실행 상한은 프로세스 단위입니다.
근거와 남은 한계
- CHANGELOG에 병렬 adapter 브랜치를 제안한 기록은 있지만, 실제 병렬 실행의 기록으로 바꾸지 않았습니다.
- 200건 중 나머지는 이 기록에서 세부 분류하지 않았습니다.