fix: fix: revert dispatch-idle-formulas step and implement strategic dispatch instead (reverts #546/PR#549) (#550)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-22 12:36:19 +00:00
parent 8aa26b4d54
commit b8e5e1ab65
2 changed files with 17 additions and 83 deletions

View file

@ -5,8 +5,7 @@
# this formula as context. Claude executes all steps autonomously. # this formula as context. Claude executes all steps autonomously.
# #
# Steps: preflight → prediction-triage → update-prerequisite-tree # Steps: preflight → prediction-triage → update-prerequisite-tree
# → file-at-constraints → dispatch-idle-formulas # → file-at-constraints → journal-and-memory → commit-and-pr
# → journal-and-memory → commit-and-pr
# #
# Core change from v2: replaces gap-analysis-and-spray with a constraint- # Core change from v2: replaces gap-analysis-and-spray with a constraint-
# focused executive using a Prerequisite Tree (Theory of Constraints). # focused executive using a Prerequisite Tree (Theory of Constraints).
@ -250,12 +249,6 @@ Update the tree by applying these operations:
were not present last run. If a new resource appears, mark the were not present last run. If a new resource appears, mark the
corresponding prerequisite as resolved. corresponding prerequisite as resolved.
8. **Check resource utilization**: Read RESOURCES.md for available compute and
formulas. If evidence-generating formulas exist but haven't run recently
(check evidence/ timestamps or recent action issues), note this as an
underutilized resource. The dispatch-idle-formulas step will use this
information to dispatch idle formulas as action issues.
Write the updated tree to: $PROJECT_REPO_ROOT/planner/prerequisite-tree.md Write the updated tree to: $PROJECT_REPO_ROOT/planner/prerequisite-tree.md
Use this format: Use this format:
@ -298,15 +291,18 @@ downstream objectives. To find them:
When filing issues at constraints, choose the right agent type: When filing issues at constraints, choose the right agent type:
- **backlog issue** (label: backlog): requires code changes dev-agent picks it up, - **backlog issue** (label: backlog): requires code changes dev-agent
writes code, creates PR, goes through CI + review. - **action issue** (label: action): runs an existing formula action-agent
- **action issue** (label: action): runs an existing formula action-agent picks it up,
executes the formula, reports results. Use for evidence generation (red-team,
evolution, holdout), metrics collection (resources, protocol), or any task that
has an existing formula.
Prefer action dispatch when a formula already exists for the task. Keep compute Prefer action dispatch when:
resources invested idle VPS time is wasted capacity. - A formula exists that would produce data needed to RESOLVE or VALIDATE
a constraint
- Evidence is required before a constraint can be marked done
- A decision is blocked on data that a formula can provide
Action issues count toward the 3-issue constraint budget they are
strategic investments, not maintenance. The planner decides what data
matters based on current constraints, not what formulas exist.
Filing gate for each constraint: Filing gate for each constraint:
@ -401,64 +397,6 @@ No new items needed.
""" """
needs = ["update-prerequisite-tree"] needs = ["update-prerequisite-tree"]
[[steps]]
id = "dispatch-idle-formulas"
title = "Dispatch idle formulas independently of constraint budget"
description = """
Data collection should be continuous, not gated by the constraint budget.
Action issues consume compute time (abundant when idle), not dev-agent time.
What you don't measure, you can't manage keep the measurement pipeline running.
These dispatches do NOT count toward the 3-issue constraint budget from
file-at-constraints. They use different resources (compute, not dev-agent time)
and produce data that informs future planning.
1. Read available formulas:
- Factory formulas: $FACTORY_ROOT/formulas/*.toml
- Project formulas: $PROJECT_REPO_ROOT/formulas/*.toml
2. Fetch recently closed action issues to determine last run times:
curl -sf -H "Authorization: token $CODEBERG_TOKEN" \
"$CODEBERG_API/issues?state=closed&type=issues&labels=action&limit=50&sort=updated&direction=desc"
3. For each formula, determine if it is idle (needs dispatch):
a. Check if an open action issue already references this formula
if so, skip (already dispatched).
b. Check the most recent closed action issue referencing this formula.
If it closed within the last 7 days, skip (recently run).
c. Check evidence/ directory timestamps in the project repo for
outputs associated with this formula. If fresh, skip.
d. If none of the above, the formula is idle.
4. For each idle formula, file an action issue to dispatch it:
curl -sf -X POST \
-H "Authorization: token $CODEBERG_TOKEN" \
-H "Content-Type: application/json" \
"$CODEBERG_API/issues" \
-d '{"title":"action: run <formula-name>","body":"...","labels":[<action_label_id>]}'
Issue body format:
## Formula\n<formula-name> from <factory|project> formulas\n\n## Why\nIdle formula dispatch — data is stale or missing. Continuous measurement\nkeeps the planning and prediction pipeline informed.\n\n## Affected files\n- formulas/<formula-name>.toml\n- evidence/ (output destination)\n\n## Acceptance criteria\n- [ ] Formula executed successfully\n- [ ] Evidence or output produced
Verify the action label was applied (re-apply if needed):
curl -sf -X POST -H "Authorization: token $CODEBERG_TOKEN" \
-H "Content-Type: application/json" \
"$CODEBERG_API/issues/<new_issue_num>/labels" \
-d '{"labels":[<action_label_id>]}'
5. Skip formulas that are nervous-system formulas (run-planner, run-gardener,
run-supervisor, run-predictor, review-pr) these run from cron directly
per AD-001 and must not be dispatched as action issues.
Rules:
- No limit on the number of action issues filed here this is separate
from the 3-issue constraint budget
- Only dispatch formulas that actually exist on disk
- Do not dispatch if an open action issue already references the formula
- Respect AD-001: nervous-system formulas run from cron, not action issues
"""
needs = ["file-at-constraints"]
[[steps]] [[steps]]
id = "journal-and-memory" id = "journal-and-memory"
title = "Write prerequisite tree, journal entry, and periodic memory update" title = "Write prerequisite tree, journal entry, and periodic memory update"
@ -504,10 +442,6 @@ Format:
- #NNN: title — why (constraint for objectives X, Y) - #NNN: title — why (constraint for objectives X, Y)
(or "No new issues — constraints already have open issues" if none) (or "No new issues — constraints already have open issues" if none)
## Idle formulas dispatched
- <formula-name>: dispatched as #NNN — data was stale/missing since <date>
(or "No idle formulas" or "All formulas recently run")
## Observations ## Observations
- Key patterns, resource state, metric trends noticed during this run - Key patterns, resource state, metric trends noticed during this run
@ -552,7 +486,7 @@ Rules:
Format: simple markdown with dated sections. Format: simple markdown with dated sections.
""" """
needs = ["dispatch-idle-formulas"] needs = ["file-at-constraints"]
[[steps]] [[steps]]
id = "commit-and-pr" id = "commit-and-pr"

View file

@ -15,11 +15,11 @@ prerequisites, discover new ones, update the tree. Phase 3
(file-at-constraints): identify the top 3 unresolved prerequisites that block (file-at-constraints): identify the top 3 unresolved prerequisites that block
the most downstream objectives — file issues at these constraints as either the most downstream objectives — file issues at these constraints as either
`backlog` (code changes, dev-agent) or `action` (run existing formula, `backlog` (code changes, dev-agent) or `action` (run existing formula,
action-agent). Phase 4 (dispatch-idle-formulas): dispatch formulas that have not action-agent). Action issues count toward the 3-issue constraint budget — they
run in 7+ days as action issues — runs independently of the constraint budget. are strategic investments, not maintenance.
Phase 5 (journal-and-memory): write updated prerequisite tree + daily journal Phase 4 (journal-and-memory): write updated prerequisite tree + daily journal
entry (committed to git) and update `planner/MEMORY.md` (committed to git). entry (committed to git) and update `planner/MEMORY.md` (committed to git).
Phase 6 (commit-and-pr): one commit with all file changes, push, create PR. Phase 5 (commit-and-pr): one commit with all file changes, push, create PR.
AGENTS.md maintenance is handled by the Gardener. AGENTS.md maintenance is handled by the Gardener.
**Artifacts use `$PROJECT_REPO_ROOT`**: All planner artifacts (journal, **Artifacts use `$PROJECT_REPO_ROOT`**: All planner artifacts (journal,