Repository navigation
fix(docs): prevent placeholder expansion from stalling translations - #134934
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 2:59 AM ET / 06:59 UTC. ClawSweeper reviewWhat this changesThe PR isolates documentation translation rules as Codex developer instructions, disables project instruction loading, strengthens placeholder guidance, and adds opt-in rejected-chunk diagnostics. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer handling. The introduced change moves the translation contract to Codex’s supported developer-message configuration, preserves the existing validation/fallback owner, and has no actionable correctness finding; exact-head CI is still incomplete. Priority: P2 Review scores
Verification
How this fits togetherThe docs i18n tool sends masked documentation chunks to the Codex CLI, validates returned placeholders and document structure, then writes locale output in the separate publish repository. This change alters the instruction boundary before model execution while retaining the downstream validator and fallback flow. flowchart LR
A[English documentation chunk] --> B[Translation prompt boundary]
B --> C[Codex CLI]
C --> D[Placeholder and structure validation]
D --> E[Localized publish output]
D --> F[Opt-in rejected-body diagnostics]
Before merge
Agent review detailsSecurityNone. PR surfaceDocs +7, Other +82. Total +89 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the developer-instruction and zero-project-document boundary, retain exact-count validation as the acceptance authority, and merge only after the remaining exact-head checks complete successfully. Do we have a high-confidence way to reproduce the issue? Yes, source reproducibly shows current main concatenating the translation contract into stdin user text while the PR moves it to the Codex developer-message configuration. The supplied PR evidence also records the affected placeholder duplication on real Codex calls. Is this the best way to solve the issue? Yes. Establishing instruction roles at the Codex invocation boundary and retaining the existing exact-count validator is cleaner than compensating with retries or downstream placeholder repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 437ef6160e16. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready review for head Exact-head CI run 33479396092 completed successfully with no failed jobs. This resolves the CI-completion item in ClawSweeper's review; the PR is proceeding through the maintainer-authorized native prepare/merge flow. ClawSweeper identified no actionable correctness or security finding, and fresh Codex autoreview was scoped-clean at its default P0 threshold. The review's generic stored-data alert does not apply: these paths add conditional diagnostics and instruction delivery changes, not vector/embedding metadata, SQLite schema, migration, retention, or persistent-store behavior. Exact-count validation and The final candidate passed six fresh live leaf calls—Korean 3/3, Japanese 2/2, German 1/1—with each protected marker present exactly once and structure validation passing. All six response texts were checked for precedence, default-account restriction, the 24-hour bot-identity cache, restart lookup, and token-change invalidation. The authorized ten-call canary cap included intermediate-candidate failures and was not exceeded. The original baseline had two separately authorized failing captures. Local proof on the reviewed code: go -C scripts/docs-i18n test -count=1 ./...go -C scripts/docs-i18n build -o /tmp/docs-i18n-c2b941node scripts/check-changed.mjs -- scripts/docs-i18n/prompt.go scripts/docs-i18n/prompt_test.go scripts/docs-i18n/translator.go scripts/docs-i18n/translator_test.go scripts/docs-i18n/doc_chunked_raw.go scripts/docs-i18n/doc_chunk_diagnostics_test.go docs/.i18n/README.mdgit diff --checkThe instruction-role and diagnostic regressions failed before the repair and pass after it. Actual pinned-Codex loopback payload capture independently verified developer-role delivery and removal of repository instructions. Production/tooling is net +8 lines: six for missing diagnostics and two for the corrected instruction boundary; tests are net +74, docs +7. Proof limits remain explicit: the live run covered the exact leaf, not full-page/shard regeneration; it used macOS arm64/Go 1.27.0 and the original Codex 0.146.1/model/effort settings. No Full/Incremental workflow was dispatched or cancelled, no generated docs/TM were edited, and temporary provider credentials were removed. A stale local native-wrapper bootstrap was resolved by using current-main tooling; the PR head and its green CI were unchanged. |
|
Merged via squash.
|
…arnings (#1341) Preserve dependency repository and full commit identity through review evidence, saved reports, and public comments. Keep dependency docs and VISION references pinned to their own repository; leave conflicting or unresolved locations unlinked instead of guessing. Stop treating generic diagnostic IDs and metadata as standalone vector-storage evidence. Recognize Go test files through the shared role owner while retaining real storage, migration, rename, and incomplete-evidence warnings. Add pinned before/after production replay and regression coverage. Tighten the Markdown destination assertions that CodeQL flagged, rather than suppressing those alerts. Current-head CI and CodeQL are green; ClawSweeper rates the repair 5/6 with sufficient proof and no remaining findings. Reproduction: openclaw/openclaw#134934 (comment) Clarification: openclaw/openclaw#134934 (comment) CI: https://github.com/openclaw/clawsweeper/actions/runs/33561412301
What Problem This Solves
Resolves a problem where docs translation workers repeatedly failed on prose containing masked precedence chains, leaving affected locale shards without publishable output. The Korean Telegram page in Translate Full run 33290320562, shard 0/7, reached the same 365-byte leaf and rejected a duplicated placeholder across ten executions within five outer attempts.
Why This Change Was Made
The translation contract was being prepended to ordinary user input, while Codex also loaded unrelated repository instructions. Send the shared rules/glossary through Codex's developer-instruction contract, disable project-document injection for these translation calls, and explicitly preserve each placeholder's occurrence count by expressing precedence chains as an inline priority order. The old duplicate user-level contract is removed rather than retained as a fallback.
Keep exact-count validation, normalization, model selection, timeouts, and retries unchanged. Extend the existing opt-in rejected-body diagnostic to capture the raw chunk's input/output and the previously discarded leaf-fallback error. No new public OpenClaw configuration option, generated docs/TM edit, workflow change, or locale-specific workaround is introduced.
User Impact
Translation rules now take the intended application-instruction role instead of competing with repository guidance. Invalid translations remain rejected, and operators can retain the facts needed to diagnose failures. Previously valid locale output remains current:
promptVersionintentionally stays unchanged because its accepted-output contract is unchanged, avoiding a blanket locale refresh.Release-note context: improve docs translation reliability for protected placeholders in comparisons/references and retain opt-in chunk/fallback diagnostics. This does not retroactively change the historical workflow's pinned core source or publish regenerated pages.
Evidence
Before and producer proof
4bc25d7a7001c67dadc80835619b200406fe5cb1; workflow scripts6d2d18b111d84d0cfb90f3b01ba621d841add64e; publish inputff82b6d040ff1487e73c273538df00638e6ee8de.gpt-5.6/xhighreturned each of900021and900022twice although every input marker appeared once. Exact output-last-message files establish that duplication precedes Go normalization/validation. The fallback received identical input and failed the same exact-count check.79b4f03d35962b005b007a015113b38930711665: exec-policy flag handling, project-document zero-budget behavior, and developer-instruction message construction.Final canary and validation
The final candidate passed all six fresh live calls in 295.58 seconds (2026-09-01 06:37:48–06:42:43 UTC), each with exactly one prompt invocation and no fallback. The operator-approved ten-call cap includes four intermediate-candidate calls; it was not exceeded.
Inspected all six response texts: precedence order, the default-account-only condition, the 24-hour bot-identity cache, skipped extra identity lookup on restart, and invalidation after token changes/removal remain present. Exact argv confirms developer-instruction delivery and disabled project docs. The masked source bytes are unchanged. This is evidence for the tested leaf—not a claim that every future model response is infallible.
Codex autoreview completed
scoped-clean, with no accepted/actionable findings at the skill's default P0 threshold. Parent review additionally inspected the complete producer/callee boundary, exact upstream contracts, all six final translations, and the validation results.go -C scripts/docs-i18n test -count=1 ./...node scripts/check-changed.mjs -- scripts/docs-i18n/prompt.go scripts/docs-i18n/prompt_test.go scripts/docs-i18n/translator.go scripts/docs-i18n/translator_test.go scripts/docs-i18n/doc_chunked_raw.go scripts/docs-i18n/doc_chunk_diagnostics_test.go docs/.i18n/README.mdgit diff --checkProof scope: exact leaf and three locales, not a full-page/shard/Full rerun. Live capture ran on macOS arm64 with Go 1.27.0 rather than the original Ubuntu/Go 1.26 runner. The pinned Codex CLI warned that this model lacks catalog metadata and omitted its unadvertised priority tier; model/effort and CLI were kept identical across the live comparisons. No workflow was cancelled or dispatched, Incremental remained untouched, and no generated docs/TM were edited. Temporary provider credentials were removed and captures checked before use.
Production/tooling LOC: +13/-5 (net +8): six lines retain missing diagnostic facts, and net two lines establish the developer/project-document boundary. Tests and docs are counted separately; no provider, channel, or token IDs are hardcoded in production.