Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/nightly-todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,18 @@ jobs:
if: steps.preflight.outcome == 'success'
run: |
set -euo pipefail
# **tee ではなくリダイレクトにする (ADR-072 決定 14、post-merge feedback #369)。**
# tee は exe の全出力を Actions ログへも出すが、そこには生の自由記述
# (summary / target_files / caution) が含まれる。**step ログも public repo では
# 第三者に可視**なので、tee は決定 14 の screening を迂回する公開面になっていた。
# 生の出力はファイルに留め ($GITHUB_OUTPUT 経由でのみ使う)、ログへは安全な行だけを出す。
master-ref/target/release/cli-nightly-task-select \
--ledger master-ref/docs/claude-code-web-tasks.md \
--exclude-ranks "${{ steps.inflight.outputs.exclude_ranks }}" \
| tee "$RUNNER_TEMP/selected.txt"
> "$RUNNER_TEMP/selected.txt"
# 可観測性: マーカー行 (rank/branch/ledger のみ = 構造的に安全) と screening 済みの
# summary_display だけをログへ出す。生の summary/target_files/caution は出さない。
grep -E '^\[NIGHTLY_TASK\]|^summary_display=' "$RUNNER_TEMP/selected.txt"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

出力契約の検証失敗を no-op として扱わないでください。

set -euo pipefail により、Line 164 の grep[NIGHTLY_TASK] または summary_display= を見つけられない場合、Select task step は失敗します。しかし、この step の continue-on-error: true と後続の steps.select.outcome != 'success' により、出力契約違反や $RUNNER_TEMP/selected.txt の読み取り失敗が no-op 経路へ入ります。後続 step が 0 で終了するため、夜間処理の異常が green run に見えます。

選択 CLI の実行と出力検証を別 step に分け、出力検証 step には continue-on-error を付けずに失敗させてください。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/nightly-todo.yml around lines 162 - 164, Split the
task-selection CLI execution and the selected.txt output validation into
separate workflow steps. Keep continue-on-error only on the CLI execution step,
and remove it from the validation step containing the grep so missing markers,
summary_display, or unreadable selected.txt fail the job instead of entering the
no-op path controlled by steps.select.outcome.

# 許可リスト方式 — exe が出す key のうち、ここに列挙したものだけを転送する。
# 想定外の key 注入を防ぐ fail-closed だが、**exe 側に出力を足したらここも足す**
# 必要がある (片方だけ変えると新しい出力が黙って捨てられ、参照側は空文字になる)。
Expand Down
4 changes: 3 additions & 1 deletion docs/adr/adr-072-nightly-todo-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ pre-push simplicity review はここを「他の停止点と同様に graceful d

**draft PR でも public repository では第三者に可視**であり、台帳の自由記述がそのまま公開面へ出ていた (順位 381)。

公開面の棚卸し結果、台帳由来で外部可視になるのは **PR 本文の `内容` だけ**だった。`RANK` は `u32` にパース済み、ブランチ名は `format!("claude/nightly-{rank}")` で、どちらも**構造的に安全**である。
公開面の棚卸し結果、台帳由来で外部可視になるのは **PR 本文の `内容`** と **step ログ**の 2 つだった。`RANK` は `u32` にパース済み、ブランチ名は `format!("claude/nightly-{rank}")` で、どちらも**構造的に安全**である。

**初版は「公開面 = PR 本文」と狭く見ており、step ログを見落としていた** (#369 post-merge feedback が指摘)。`Select task` step は exe 出力を `tee` で `selected.txt` と**画面 (= Actions ログ) の両方**へ出しており、そこに生の `summary` / `target_files` / `caution` 行が含まれていた。**public repo では step ログも第三者に可視**なので、これは screening を迂回する 2 つ目の公開面だった。`tee` をリダイレクト (`> selected.txt`) に変え、ログへはマーカー行 (rank/branch/ledger のみ = 安全) と screening 済みの `summary_display` だけを `grep` で出す形にした。生の出力はファイルに留まり `$GITHUB_OUTPUT` 経由でのみ使われる。**「公開面」は出力先を 1 つ塞ぐたびに次が見つかる**ので、棚卸しは「PR 本文」で止めず経路単位で行う。
Comment on lines +284 to +286

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

step ログと PR 本文の保護方法を分けて記述してください。

.github/workflows/nightly-todo.yml の Lines 162-164 は summary_displaysummary_display= の後ろに直接ログ出力します。インラインコードスパンは同ファイルの Lines 486-490 の PR 本文でのみ使用します。

したがって、続く説明では、step ログは制御文字除去・1 行化・固定プレフィックスで保護し、PR 本文はインラインコードスパンで保護すると公開面ごとに明記してください。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/adr/adr-072-nightly-todo-loop.md` around lines 284 - 286,
ADR-072のstepログとPR本文の保護方法を分けて記述してください。stepログについては、summary_displayを制御文字除去・1行化したうえで固定プレフィックス付きで出力する方法を明記し、PR本文についてはインラインコードスパンで保護する方法を明記してください。


`cli-nightly-task-select` に `summary_display` 出力を足し、workflow はそれを**インラインコードスパンで囲んで**出す。コードスパンの内側では markdown が描画されず `@mention` の通知も飛ばないため、注入の効果がそこで消える。したがって screening の主眼は **「コードスパンから抜け出せる文字を残さないこと」**に絞り、バッククォートの置換・制御文字の除去・200 文字での切り詰めだけを行う。`@` は書き換えない — 無害化はコードスパンの役目で、`@` を潰すと正当なタスク記述が読めなくなる。

Expand Down
Loading