Skip to content

fix(routine): left-align --emit-bootstrap-prompt output (#377)#378

Merged
ozzy-3 merged 1 commit into
mainfrom
fix/emit-bootstrap-prompt-dedent
May 25, 2026
Merged

fix(routine): left-align --emit-bootstrap-prompt output (#377)#378
ozzy-3 merged 1 commit into
mainfrom
fix/emit-bootstrap-prompt-dedent

Conversation

@ozzy-3
Copy link
Copy Markdown
Contributor

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

概要

radar routine generate <type> --prompt-mode bootstrap --emit-bootstrap-prompt の出力各行に均一な 7 スペースの行頭インデントが乗る問題 (#377) を修正する。--emit-bootstrap-prompt は機械消費(routine 登録の message.content)向けなので、行頭空白ゼロの左寄せで出力すべきである。

原因

bootstrap プロンプト本文 (cli.routine.bootstrapPromptLine1-4) が i18n に 7 スペース込みで格納され、buildBootstrapPrompt 経由で emit と Web UI 貼付表示の両方に共有されていた。貼付表示用の整形が emit にも漏れていた。

修正方針

役割を分離する:

  • 正本の i18n プロンプト行を**左寄せ(行頭インデントなし)**にする(buildBootstrapPrompt が dedent 済み本文を返す)
  • Web UI 貼付表示 (printPromptModePaste の bootstrap モード) 側で表示用インデント BOOTSTRAP_PASTE_INDENT(7 スペース)を付与する

これにより emit=左寄せ、貼付表示=従来どおり番号付き手順下にインデント、と分離される。watch / pipeline 両ジェネレーターが同一ヘルパーを共有するため両方カバーされる。

テスト

  • feat(routine): bootstrap プロンプトを単一ソース化し --emit-bootstrap-prompt を追加 #365 の byte-for-byte 一致テスト 2 箇所(watch + pipeline)を新セマンティクスに合わせて更新(比較前に貼付側の表示インデントを strip)
  • emit 出力が行頭空白を持たないことを assert する新テストを watch / pipeline 両方に追加
  • buildBootstrapPrompt が左寄せ本文を返すユニットテストを追加
  • en/ja parity 維持。biome / typecheck / 全 1623 test / build すべて green

検証

$ radar routine generate pipeline ... --emit-bootstrap-prompt | cat -A
You are the `feedradar-pipeline` routine.$
Read `.claude/routines/feedradar-pipeline.yaml` in this repository and faithfully execute its top-level$
`instructions:` block. Run autonomously: AskUserQuestion is NOT available,$
and local MCP servers are NOT available in this environment.$

paste view は従来どおり 7 スペースインデントを維持。

Closes #377

🤖 Generated with Claude Code

The bootstrap prompt body (cli.routine.bootstrapPromptLine1-4) carried a
baked-in 7-space leading indent meant for the Web UI paste view, but it
leaked into --emit-bootstrap-prompt, whose output is machine-consumed
verbatim as a routine's message.content. Move the canonical i18n lines to
left-aligned (zero leading indent) and re-add the display indent in the
paste view (printPromptModePaste via BOOTSTRAP_PASTE_INDENT). emit is now
left-aligned; the paste block keeps its indent under the numbered steps.

Reconciled the #365 "paste == emit" byte-for-byte tests (watch + pipeline)
to strip the display indent before comparing, and added tests asserting the
emit output has zero leading whitespace on every line.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ozzy-3 ozzy-3 merged commit 38c9a73 into main May 25, 2026
4 checks passed
@ozzy-3 ozzy-3 deleted the fix/emit-bootstrap-prompt-dedent branch May 25, 2026 16:19
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

Development

Successfully merging this pull request may close these issues.

fix(routine): --emit-bootstrap-prompt の出力に行頭インデント(7スペース)が混入する

1 participant