aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
agent: Add Workflow-Id and Workflow-Step git commit trailers
- Lenguaje dominante
- TypeScript
- Estrellas
- 146
- Forks
- 46
- Merge medio
- 3 d 10 h
- PR fusionados (30 d)
- 24
Descripción
## 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
Guía de contribución
Línea de trabajo
Comience con agent/src/workflow/runner.py, agent/prepare-commit-msg.sh y pipeline.py para rastrear los límites de los pasos, los commits del agente y los commits posteriores al hook. Después, inspeccione el manejo existente de Task-Id y Prompt-Version y añada cobertura de pruebas unitarias y de integración para los trailers solicitados. La tarea estará completa cuando los commits del workflow incluyan la atribución esperada y el conjunto completo de trailers esté documentado en agent/README.md y docs/design/OBSERVABILITY.md.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- git, python, shell
- Área
- backend, documentation, observability, testing
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 55/100