-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add uncertainty decision framework for headless workers (t176) #656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2581,13 +2581,38 @@ build_dispatch_cmd() { | |
| fi | ||
|
|
||
| # t173: Explicit worker restriction — prevents TODO.md race condition | ||
| # t176: Uncertainty decision framework for headless workers | ||
| prompt="$prompt | ||
|
|
||
| ## MANDATORY Worker Restrictions (t173) | ||
| - Do NOT edit, commit, or push TODO.md — the supervisor owns all TODO.md updates. | ||
| - Do NOT edit todo/PLANS.md or todo/tasks/* — these are supervisor-managed. | ||
| - Report status via exit code, log output, and PR creation only. | ||
| - Put task notes in commit messages or PR body, never in TODO.md." | ||
| - Put task notes in commit messages or PR body, never in TODO.md. | ||
|
|
||
| ## Uncertainty Decision Framework (t176) | ||
| You are a headless worker with no human at the terminal. Use this framework when uncertain: | ||
|
|
||
| **PROCEED autonomously when:** | ||
| - Multiple valid approaches exist but all achieve the goal (pick the simplest) | ||
| - Style/naming choices are ambiguous (follow existing conventions in the codebase) | ||
| - Task description is slightly vague but intent is clear from context | ||
| - You need to choose between equivalent libraries/patterns (match project precedent) | ||
| - Minor scope questions (e.g., should I also fix this adjacent issue?) — stay focused on the assigned task | ||
|
|
||
| **FLAG uncertainty and exit cleanly when:** | ||
| - The task description contradicts what you find in the codebase | ||
| - Completing the task would require breaking changes to public APIs or shared interfaces | ||
| - You discover the task is already done or obsolete | ||
| - Required dependencies, credentials, or services are missing and cannot be inferred | ||
| - The task requires decisions that would significantly affect architecture or other tasks | ||
| - You are unsure whether a file should be created vs modified, and getting it wrong would cause data loss | ||
|
|
||
| **When you proceed autonomously**, document your decision in the commit message: | ||
| \`feat: add retry logic (chose exponential backoff over linear — matches existing patterns in src/utils/retry.ts)\` | ||
|
|
||
| **When you exit due to uncertainty**, include a clear explanation in your final output: | ||
| \`BLOCKED: Task says 'update the auth endpoint' but there are 3 auth endpoints (JWT, OAuth, API key). Need clarification on which one.\`" | ||
|
Comment on lines
2583
to
+2615
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a deterministic “blocked” signal to avoid retry loops The prompt instructs workers to output 🔧 Suggested prompt tweak (paired with evaluator handling)-**When you exit due to uncertainty**, include a clear explanation in your final output:
-`BLOCKED: Task says 'update the auth endpoint' but there are 3 auth endpoints (JWT, OAuth, API key). Need clarification on which one.`
+**When you exit due to uncertainty**, emit a machine-readable marker (and exit non-zero) so the supervisor can block deterministically:
+`TASK_BLOCKED: Task says 'update the auth endpoint' but there are 3 auth endpoints (JWT, OAuth, API key). Need clarification on which one.`#!/bin/bash
# Verify whether any component parses BLOCKED/TASK_BLOCKED or similar markers.
rg -n "BLOCKED:|TASK_BLOCKED|uncertainty decision framework|Uncertainty Decision Framework"
rg -n "FULL_LOOP_COMPLETE|TASK_COMPLETE|EXIT:" .agents/scripts
rg -n "evaluate_worker|extract_log_metadata" .agents/scriptsAs per coding guidelines, Automation scripts - focus on: Reliability and robustness; Proper exit codes. 🤖 Prompt for AI Agents
Comment on lines
2585
to
+2615
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For better readability and maintainability, consider using a prompt+=$(cat <<-'EOF'
## MANDATORY Worker Restrictions (t173)
- Do NOT edit, commit, or push TODO.md — the supervisor owns all TODO.md updates.
- Do NOT edit todo/PLANS.md or todo/tasks/* — these are supervisor-managed.
- Report status via exit code, log output, and PR creation only.
- Put task notes in commit messages or PR body, never in TODO.md.
## Uncertainty Decision Framework (t176)
You are a headless worker with no human at the terminal. Use this framework when uncertain:
**PROCEED autonomously when:**
- Multiple valid approaches exist but all achieve the goal (pick the simplest)
- Style/naming choices are ambiguous (follow existing conventions in the codebase)
- Task description is slightly vague but intent is clear from context
- You need to choose between equivalent libraries/patterns (match project precedent)
- Minor scope questions (e.g., should I also fix this adjacent issue?) — stay focused on the assigned task
**FLAG uncertainty and exit cleanly when:**
- The task description contradicts what you find in the codebase
- Completing the task would require breaking changes to public APIs or shared interfaces
- You discover the task is already done or obsolete
- Required dependencies, credentials, or services are missing and cannot be inferred
- The task requires decisions that would significantly affect architecture or other tasks
- You are unsure whether a file should be created vs modified, and getting it wrong would cause data loss
**When you proceed autonomously**, document your decision in the commit message:
`feat: add retry logic (chose exponential backoff over linear — matches existing patterns in src/utils/retry.ts)`
**When you exit due to uncertainty**, include a clear explanation in your final output:
`BLOCKED: Task says 'update the auth endpoint' but there are 3 auth endpoints (JWT, OAuth, API key). Need clarification on which one.`
EOF
) |
||
|
|
||
| if [[ -n "$memory_context" ]]; then | ||
| prompt="$prompt | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
# Check the full-loop.md file to understand context wc -l .agents/scripts/commands/full-loop.mdRepository: marcusquinn/aidevops
Length of output: 105
🏁 Script executed:
Repository: marcusquinn/aidevops
Length of output: 14501
🏁 Script executed:
Repository: marcusquinn/aidevops
Length of output: 8918
🏁 Script executed:
Repository: marcusquinn/aidevops
Length of output: 704
Consolidate framework reference — duplicates existing content in headless-dispatch.md
This uncertainty decision framework is already fully documented as "Worker Uncertainty Framework" in
.agents/tools/ai-assistants/headless-dispatch.md, including the decision tree, proceed/exit criteria, and supervisor integration loop. Repeating the entire framework here violates the single source of truth principle.Replace the duplicate with a cross-reference:
This maintains the guidance while eliminating duplication and directing readers to the authoritative, detailed source.
🧰 Tools
🪛 LanguageTool
[style] ~194-~194: Consider using a different verb for a more formal wording.
Context: ...edent - Minor scope questions (e.g., fix adjacent issue?) — stay focused on assi...
(FIX_RESOLVE)
🤖 Prompt for AI Agents