Harden /review_prs Stage-2 sketch against `args` arriving as a JSON string

オープン 初心者向け
#670 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
92/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
javascript
領域
documentation

調査の方向性

.abca/commands/review_prs.md を開き、142–164 行付近の Stage-2 スケッチと Notes の説明文を読みます。.map を使う前に、Workflow args が JSON string として届く場合でも配列として届く場合でも正規化されるよう、スケッチと説明を更新します。このファイルに 2 つの受け入れ条件が反映され、スケッチの適応可能な動作が変更されていなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement P2

Problem

The /review_prs command (.abca/commands/review_prs.md) documents Stage 2 with an illustrative Workflow sketch (lines ~142–164) that the operator regenerates per invocation. That sketch iterates the PR descriptors with args.map(...) directly.

In practice the Workflow harness may deliver args to the script as a JSON-encoded string rather than a parsed array — even when the caller passes a genuine JSON array in the Workflow tool call. When that happens the script throws immediately:

Error: args.map is not a function ('args.map' is undefined)

before any review agent spawns. Because the skill is (correctly) a sketch that gets regenerated each run, every regeneration risks re-hitting this footgun. Observed live during the carve S1–S8 stacked-PR review train (2026-07-28): the first Workflow launch died in ~7ms with agent_count: 0; a one-line defensive unpack fixed it and the resumed run proceeded normally.

Why not freeze the whole script into the skill

The sketch is intentionally adaptable — N==1 skips the Workflow, arg modes differ (explicit list vs. review-requested:@me vs. NL filter), and diff baselining differs for a stack (each PR vs its parent branch) vs. a flat batch (each vs main). Freezing a full script would bake away that variance and pull orchestration mechanics back into a skill that deliberately stays a thin orchestrator. So the fix is a doc hardening, not a canned script.

Proposed fix (small, docs-only)

In the Stage-2 sketch, unpack defensively before iterating and add a half-sentence caveat:

// Workflow may deliver `args` as a JSON string; tolerate either form.
const prs = typeof args === 'string' ? JSON.parse(args) : args
const results = await parallel(prs.map((pr) => () => agent(...)))

Add one line to the Notes / Stage-2 prose noting that Workflow args can arrive JSON-encoded, so generated scripts should normalize before .map.

Scope

  • Docs only: .abca/commands/review_prs.md.
  • No code, no CDK, no agent-runtime change.
  • Self-sufficiency bar for the skill is preserved: a competent agent regenerating the script from the prose will no longer trip on the string/array ambiguity.

Acceptance criteria

  • Stage-2 sketch normalizes args (string-or-array) before .map.
  • A one-line caveat in the prose explains why.
  • No other behavior change; the sketch remains a sketch (not a frozen script).
主要言語
TypeScript
スター
170
フォーク
52
平均マージ
2日 21時間
マージ済み PR(30日)
11

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws-samples/sample-autonomous-cloud-coding-agents のほかの issue

aws-samples/sample-autonomous-cloud-coding-agents の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。