Goal Setting and Monitoring¶
Summary¶
An agent needs a defined end state and a way to tell whether it has reached it. In this pattern you state the objective in measurable terms, break it into steps, and keep checking progress against the objective while the agent works. If the agent drifts, it corrects course or replans, and it escalates when it can't succeed. The chapter's example is a coding agent that writes code, judges it against a list of goals, and revises, capped at a fixed number of iterations. The book is candid about the weak spots. An LLM can misread a goal or wrongly decide it has succeeded. A model that judges its own work struggles to see when it has gone wrong. A naive loop can run forever. So the book recommends a separate reviewer role, real tests, and hard stop conditions (ch. 11, "Caveats and Considerations"). In the book's words, the pattern turns reactive agents into "proactive, goal-oriented systems" by closing a feedback loop.
When to use / not¶
Terms: § numbers refer to sections of the fleet's constitution (docs/constitution.md), its written governance rules. Tier 1-3 are the issue pipeline's stages (intake, implement, complete), each run by a separate agent job. agent:* and human-review are GitHub labels the pipeline uses as state. JEV is the fleet's agent logic engine (tools/jev); its loop module is on the unmerged PR #525.
- Use: multi-step, unattended work where "done" can be stated and checked, such as issue → PR, a release, or a budgeted loop.
- Avoid: one-shot Q&A, or goals that can't be measured, where a judge loop only adds cost.
Failure modes¶
- The same model acts as author and judge.
- The goal is vague, so success is self-declared.
- There is no iteration or budget cap (a runaway loop).
- Something is monitored but nothing acts on it.
Fleet evidence (bamr87/bamr87@2321b3a, bamr87/bamr87@80c6cee (PR #525 head))¶
| Behavior | Permalink |
|---|---|
| Goal must be stated before work: readiness gaps (what is missing before an issue is ready to work) for missing acceptance criteria, scope or evidence, scored 0-100 | issue_pipeline.py L200-L202, L311-L374 |
| Readiness threshold: below 70, intake must not pass an item on | _data/fleet.yml L319-L320 |
| Explicit definition of done (every check green, every acceptance criterion verified, tests fail without the change); iterate until green or genuinely stuck | issue-pipeline.yml L915-L926 |
Escalation instead of self-approval: human-review keeps the PR a draft; never_merge: true |
issue-pipeline.yml L928-L935, _data/fleet.yml L327 |
Goal state on the board: agent:queued → Ready … agent:done → Done, with a fixed lifecycle |
templates/projects/framework.yml L37-L63 |
| Staleness monitor: an in-progress spec (a written feature specification) with no commit for 30+ days, or a P0/P1 issue idle for 30+ days | specs/WORK.contract.yml L268-L277 |
Stop conditions for loops: budget.loops monthly ceiling ($25) with a scheduled stop at 80%, checked before each model call (open PR #525, head 80c6ceec91fc925b3bb31c6bce0540e5d19d7a52) |
fleet.yml L580-L582, tools/jev/loop.py L1020-L1040 |
Reproduce¶
gh repo clone bamr87/bamr87 /tmp/hub && cd /tmp/hub && git checkout 2321b3a7c1199688042339d68b628f9d08bb46eb
python3 -m pytest -q .github/scripts/dash-gen/test_issue_pipeline.py .github/scripts/dash-gen/test_work_board.py tools/test_conformance_work.py tools/test_governance_lint.py
# loop budget stop (unmerged PR #525):
git fetch origin pull/525/head:pr525 && git checkout pr525
python3 -m pytest -q tools/test_jev_loop.py .github/scripts/dash-gen/test_ai_budget.py
Expected (run 2026-10-31): 56 passed, then 84 passed. Live runs: issue-pipeline run 41181601564 (success, 2026-10-31 01:41 MDT); Python tests run 41256758330 (success, main).
Gaps¶
- The goal check is the agent's own prose. Tier 3 judges whether the acceptance criteria are met, but nothing machine-checks that judgment before
agent:done. This is the book's author-as-judge caveat. → #537 (agent:queued). Related: an independent reviewer bot, #492. budget.loopsstop conditions exist only on unmerged PRs #523–#525. The status stayspartialuntil they merge.
Cross-links¶
ADP-19 (evaluation and monitoring), ADP-12 (exception handling), ADP-16 (resource-aware: budget stops), ADP-20 (prioritization); constitution §15 (testing evidence), #528 (kill switches).