feat(agentloop): Self-Reflection-Turn vor Completion (issue #152) - #229
Conversation
What ships:
- cmd/sin-code/internal/agentloop/loop.go:
- New Reflection + Reflector types (per-proposal self-critique)
- New Loop.Reflector field
- State: reflectedThisProposal (resets when worker makes tool calls)
- Logic: runs Reflector exactly once per completion proposal, BEFORE
the stop-gate. If issues non-empty, injects them as a user message
and continues (not a stop-gate reject — worker self-fixes).
- cmd/sin-code/internal/ledger/store.go: new EntryType TypeReflection.
- cmd/sin-code/internal/hooks/hooks.go: new event hooks.ReflectIssues.
- cmd/sin-code/internal/agentloop/loop_reflect_test.go: 3 tests
(disabled, forces-another-turn, no-issues-proceeds).
Acceptance criteria (from #152):
- [x] Reflector runs once per proposal (not infinite self-doubt).
- [x] Non-empty Issues force another turn via user message.
- [x] Reflector=nil preserves legacy behavior.
- [x] go test ./cmd/sin-code/internal/agentloop/... all green.
Hard mandates honored:
- M2: no new deps.
- M3: reflection is post-verify, pre-stop-gate; never short-circuits
the verify-gate.
- M7: 3/3 tests pass under go test -race -count=1.
Refs: #152
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Deployment failed with the following error: Learn More: https://vercel.com/sagamundis-1139s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/aragonheld-7756s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/ronaldokrause-9559s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/manheiler-8784s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/karstenblau45-2395s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/spriterfrau-5830s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/cristianoronalodbau-9053s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/mariobatrhs-9606s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/einskarst-2238s-projects?upgradeToPro=build-rate-limit |
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown)
|
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown) Run ID:
|
Implements issue #152. Reflector hook runs once per completion proposal, before the stop-gate. Non-empty Issues inject a user message and continue (worker self-fixes).
Closes #152