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

Agent: Repo tip belief-state divergence detection at finalization

Aperta
#513 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
agent-runtime enhancement
Lingua principale
TypeScript
Stelle
143
Fork
46
Merge medio
3g 10h
PR unite (30g)
24

Descrizione

> **Roadmap:** Agent swarm (foundation); Shared program state RFC
> **Priority:** P3

## Component

Agent (Python runtime)

## Describe the feature

At task finalization (and optionally on long-running checkpoint), compare the **base SHA recorded at plan/hydration time** to the current branch tip. Emit a `state_divergence` TaskEvent when the branch advanced unexpectedly (new commits, force-push, concurrent human edits).

Implements a lightweight version of SyncMind-style belief-state divergence (arXiv:2605.18747 §4.4, §5.1.1) without full multi-agent coordination.

## Use case

- **Operators** see warnings when verification ran against a different commit than planned.
- **HarnessState RFC** uses divergence events as the first consumer of `base_sha`.
- **Evaluation** categorizes "verified stale tree" failures separately from agent errors.

## Proposed solution

1. Record `base_sha` at clone/setup in task record (or HarnessState when RFC lands).

2. At finalization in `agent/src/post_hooks.py` or pipeline:
- `git rev-parse HEAD` vs stored `base_sha`
- If differ: emit `state_divergence` event with `{ base_sha, head_sha, commits_ahead }`

3. Blueprint policy:
- `divergence_policy: warn` (default) | `fail`

4. Surface in `bgagent status`, verification report, and replay bundle.

### Acceptance criteria

- [ ] `base_sha` captured at repo setup for coding workflows
- [ ] `state_divergence` event type documented in TaskEvents schema
- [ ] Configurable warn vs fail; default warn
- [ ] Unit tests with mocked git SHAs
- [ ] Documented in `ORCHESTRATOR.md` or observability docs

## Other information

- **Companion:** Shared program state RFC
- **Paper:** arXiv:2605.18747 SyncMind, transactional shared state §5.2.4
- **Not in scope:** Auto-rebase or merge conflict resolution

## Acknowledgements

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia tracciando la configurazione e la finalizzazione del repository in agent/src/post_hooks.py, incluso il modo in cui il record dell’attività o HarnessState memorizza base_sha e il modo in cui sono definiti TaskEvents. Controlla gli entry point di bgagent status e verification-report, quindi usa SHA Git simulati per verificare il comportamento di warn e fail; completato significa che tutti i criteri di accettazione elencati sono coperti e che il comportamento è documentato in ORCHESTRATOR.md o nella documentazione sull’osservabilità.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
git, python
Ambito
devtools, observability-sre
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
52/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.