aws-samples / aws-samples/sample-autonomous-cloud-coding-agents

agent: Add Workflow-Id and Workflow-Step git commit trailers

オープン
#560 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
agent-runtime enhancement observability
主要言語
TypeScript
スター
143
フォーク
46
平均マージ
3日 10時間
マージ済み PR(30日)
24

説明

## Component

Agent (Python runtime)

## Describe the feature

Extend the agent's `prepare-commit-msg` hook so commits carry **workflow attribution trailers** in addition to the existing `Task-Id` and `Prompt-Version` trailers.

| Trailer | Example | Purpose |
|---------|---------|---------|
| `Workflow-Id` | `coding/new-task-v1` | Which workflow executed |
| `Workflow-Step` | `implement` | Active step name when the commit was created |

Document the full trailer set in `agent/README.md` and `docs/design/OBSERVABILITY.md`.

## Use case

`Task-Id` and `Prompt-Version` link commits to a task and prompt hash, but not to **where in the workflow** the commit occurred. When a task fails at `verify_build` after multiple agent commits, reviewers cannot tell from `git log` alone which step produced which diff. Attribution and postmortems require cross-referencing TaskEvents or CloudWatch logs.

## Proposed solution

1. Set `WORKFLOW_ID` and `WORKFLOW_STEP` in the step runner at each step boundary (`agent/src/workflow/runner.py`); set before agent execution and safety-net commits.
2. Extend `agent/prepare-commit-msg.sh` to append trailers when set (idempotent, same pattern as `Task-Id`).
3. Ensure `pipeline.py` post-hook commits run through the hook or set trailers explicitly.
4. Tests: unit test hook output; integration test that a workflow run produces expected trailers on at least one commit.

## Other information

- Builds on existing `agent/prepare-commit-msg.sh`.
- Related: #245 (broader attribution), [WORKFLOWS.md](https://github.com/aws-samples/sample-autonomous-cloud-coding-agents/blob/main/docs/design/WORKFLOWS.md).

## Acknowledgements

- [ ] I may be able to implement this feature
- [ ] This might be a breaking change

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

agent/src/workflow/runner.py、agent/prepare-commit-msg.sh、pipeline.py から始めて、ステップの境界、エージェントのコミット、post-hook コミットを追跡します。次に、既存の Task-Id と Prompt-Version の処理を調べ、要求された trailer のユニットテストと統合テストのカバレッジを追加します。完了の条件は、workflow のコミットに期待される attribution が含まれ、trailer の完全なセットが agent/README.md と docs/design/OBSERVABILITY.md に記載されていることです。

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

評価

技術スタック
git, python, shell
領域
backend, documentation, observability, testing
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

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

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