From b8e5e1ab65d9db482169c3070e7795d57131d3da Mon Sep 17 00:00:00 2001 From: openhands Date: Sun, 22 Mar 2026 12:36:19 +0000 Subject: [PATCH] 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) --- formulas/run-planner.toml | 92 ++++++--------------------------------- planner/AGENTS.md | 8 ++-- 2 files changed, 17 insertions(+), 83 deletions(-) diff --git a/formulas/run-planner.toml b/formulas/run-planner.toml index 0262fc1..7d40cf2 100644 --- a/formulas/run-planner.toml +++ b/formulas/run-planner.toml @@ -5,8 +5,7 @@ # this formula as context. Claude executes all steps autonomously. # # Steps: preflight → prediction-triage → update-prerequisite-tree -# → file-at-constraints → dispatch-idle-formulas -# → journal-and-memory → commit-and-pr +# → file-at-constraints → journal-and-memory → commit-and-pr # # Core change from v2: replaces gap-analysis-and-spray with a constraint- # 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 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 Use this format: @@ -298,15 +291,18 @@ downstream objectives. To find them: When filing issues at constraints, choose the right agent type: -- **backlog issue** (label: backlog): requires code changes — dev-agent picks it up, - writes code, creates PR, goes through CI + review. -- **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. +- **backlog issue** (label: backlog): requires code changes — dev-agent +- **action issue** (label: action): runs an existing formula — action-agent -Prefer action dispatch when a formula already exists for the task. Keep compute -resources invested — idle VPS time is wasted capacity. +Prefer action dispatch when: +- 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: @@ -401,64 +397,6 @@ No new items needed. """ 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 ","body":"...","labels":[]}' - - Issue body format: - ## Formula\n from 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/.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//labels" \ - -d '{"labels":[]}' - -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]] id = "journal-and-memory" title = "Write prerequisite tree, journal entry, and periodic memory update" @@ -504,10 +442,6 @@ Format: - #NNN: title — why (constraint for objectives X, Y) (or "No new issues — constraints already have open issues" if none) - ## Idle formulas dispatched - - : dispatched as #NNN — data was stale/missing since - (or "No idle formulas" or "All formulas recently run") - ## Observations - Key patterns, resource state, metric trends noticed during this run @@ -552,7 +486,7 @@ Rules: Format: simple markdown with dated sections. """ -needs = ["dispatch-idle-formulas"] +needs = ["file-at-constraints"] [[steps]] id = "commit-and-pr" diff --git a/planner/AGENTS.md b/planner/AGENTS.md index 6bd46cf..0b84fd5 100644 --- a/planner/AGENTS.md +++ b/planner/AGENTS.md @@ -15,11 +15,11 @@ prerequisites, discover new ones, update the tree. Phase 3 (file-at-constraints): identify the top 3 unresolved prerequisites that block the most downstream objectives — file issues at these constraints as either `backlog` (code changes, dev-agent) or `action` (run existing formula, -action-agent). Phase 4 (dispatch-idle-formulas): dispatch formulas that have not -run in 7+ days as action issues — runs independently of the constraint budget. -Phase 5 (journal-and-memory): write updated prerequisite tree + daily journal +action-agent). Action issues count toward the 3-issue constraint budget — they +are strategic investments, not maintenance. +Phase 4 (journal-and-memory): write updated prerequisite tree + daily journal 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. **Artifacts use `$PROJECT_REPO_ROOT`**: All planner artifacts (journal,