Skip to content

fix(routine): localize agent-authored prose in pipeline routine (#376)#379

Merged
ozzy-3 merged 1 commit into
mainfrom
fix/routine-pipeline-locale-prose
May 25, 2026
Merged

fix(routine): localize agent-authored prose in pipeline routine (#376)#379
ozzy-3 merged 1 commit into
mainfrom
fix/routine-pipeline-locale-prose

Conversation

@ozzy-3
Copy link
Copy Markdown
Contributor

@ozzy-3 ozzy-3 commented May 25, 2026

概要

Closes #376.

radar routine generate pipeline --lang ja(locale != en)で生成した pipeline routine を実行すると、research/review レポート本文(#358 で locale 追従)は日本語になるが、agent が手順 8/9 で自由文として綴る PR タイトル/本文・実行サマリー・commit message body が英語になっていた。bootstrap プロンプトは設計上言語ニュートラル(#365 / ADR-0021)で、生成 instructions: に「user-facing 出力を locale 言語で綴れ」という指示が無いのが原因。

変更

  • buildLocaleOutputDirective(locale, t) を新設。locale != en のとき、## Hard constraints ブロックに「agent 自身が綴る user-facing 出力(PR タイトル/本文・実行サマリー・commit message body)を設定 locale の言語で綴る」よう指示する bullet を 1 行追加する。Conventional Commits の subject 行(型)は英語のままでよい点も明記。
  • en では directive を出さない(英語が既定)。テンプレートの placeholder 行ごと strip するため、余計な空行は残らない。
  • 新規 i18n キー cli.routine.localeOutputDirectiveen / ja 両カタログに追加(parity 維持)。en 値はカタログ parity 用で emit されない。
  • テンプレート src/templates/{en,ja}/routines/pipeline.yaml.tmpl{{localeOutputDirective}} placeholder を追加。

スコープ判断

  • issue タイトルどおり pipeline を主とした。watch routine は detection のみで自由文比重が低く、issue も pipeline を主としているため、過剰拡張を避け watch には directive を追加していない
  • 並列 sibling fix(routine): --emit-bootstrap-prompt の出力に行頭インデント(7スペース)が混入する #377 の担当領域(bootstrapPromptLine* キー・generate-watch.ts の emit ロジック)には一切触れていない。新規キー追加 + generate-pipeline.ts 中心に留めた。

テスト

  • buildLocaleOutputDirective の単体テスト(en は空文字 / ja は localized bullet・subject 英語維持)。
  • 生成 instructions に対し --lang ja で directive が含まれ、--lang en では含まれず空行も残らないことを assert。
  • i18n parity テスト・routines-contract(validate.py)テストを含む全 1622 テスト green。biome・typecheck・build いずれも clean。

🤖 Generated with Claude Code

A `pipeline` routine generated with `--lang ja` (locale != en) emitted
Japanese report bodies (#358) but the agent's own free-form user-facing
output — PR title/body, run summary (step 9), commit message body — came
out in English: the language-neutral bootstrap prompt (#365 / ADR-0021)
and the report-body locale directive (#358) never told the agent to
author that prose in the configured locale.

Add a `buildLocaleOutputDirective` builder that, for locale != en, emits a
hard-constraint bullet (new i18n key `cli.routine.localeOutputDirective`,
en/ja parity) instructing the agent to write its free-form user-facing
prose in the workspace locale, while keeping the Conventional Commits
subject line in English. For `en` the directive is empty and the
placeholder line is stripped (no spurious blank line). Scope is pipeline
only per the issue; watch is left untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ozzy-3 ozzy-3 merged commit df76dc2 into main May 25, 2026
4 checks passed
@ozzy-3 ozzy-3 deleted the fix/routine-pipeline-locale-prose branch May 25, 2026 16:18
ozzy-3 pushed a commit that referenced this pull request May 25, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.2.6](v0.2.5...v0.2.6)
(2026-05-25)


### Bug Fixes

* **routine:** left-align --emit-bootstrap-prompt output
([#377](#377))
([#378](#378))
([38c9a73](38c9a73))
* **routine:** localize agent-authored prose in pipeline routine
([#376](#376))
([#379](#379))
([df76dc2](df76dc2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant