feat(orchestrator): budget-pressure steering + non-destructive cutoff (IDE-210) - #71
Merged
mattias-ident merged 2 commits intoJun 17, 2026
Conversation
… (IDE-210) Add two adapter-agnostic mechanisms so converging agent work is not lost when a run approaches its continuation cap (IDE-189): - Mechanism A (steering): inject a budget-pressure directive into the continuation prompt within `agent.budget_pressure_turns` of `max_turns`, telling the agent to commit now via the `commit` skill. Best-effort. - Mechanism B (cutoff): new `SymphonyElixir.Git.preserve_uncommitted_work/4` snapshots a dirty tree (modified + staged + untracked) to a `refs/symphony/wip/<id>` commit via temp-index `commit-tree`, without touching HEAD, the branch, or the working tree. Fired before every session stop and on the `max_turns_reached` cutoff. This is the correctness guarantee; preservation is gated on `agent.preserve_uncommitted_work`. New config: `agent.budget_pressure_turns`, `preserve_uncommitted_work`, `preserve_uncommitted_work_branch`, `cutoff_timeout_ms`. Docs updated in SPEC.md (§6, §9.4.1), README.md, elixir/README.md, WORKFLOW.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…-0-budget-pressure-steering-non-destructive-cutoff-ide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
IDE-189: a near-cap run was stopped with converging work that was never committed, so the fresh restart lost it (a brand-new untracked file). This adds steering + a non-destructive safety net.
TL;DR
Steer the agent to commit near the turn cap, and snapshot any dirty tree to a WIP ref before stopping a session.
Summary
SymphonyElixir.Git.preserve_uncommitted_work/4: temp-indexcommit-treesnapshot torefs/symphony/wip/<id>(captures modified + staged + untracked); non-destructive (no HEAD/branch/worktree mutation); no-op on clean tree; local + SSH paths.append_budget_pressure_directive/2seam inagent_runner.ex, injected on continuation turns withinagent.budget_pressure_turnsof the cap, never on the final turn.terminate_running_issue(terminal/Backlog/non-active/stall/dependency/shutdown) and on the:max_turns_reachedDOWN path, before any workspace reclaim.agent.*config:budget_pressure_turns(2),preserve_uncommitted_work(true),preserve_uncommitted_work_branch(false),cutoff_timeout_ms(60000) +Configaccessors.Alternatives
git stash createrejected: it silently drops untracked files — exactly the IDE-189 stranded work.before_removehook rejected: only fires on workspace deletion; the max_turns/Backlog stops keep the workspace, so it would never run.Test Plan
make -C elixir allmix test test/symphony_elixir/git_test.exs(non-destructive capture, clean no-op, non-git, branch, HEAD-less, ref sanitization):max_turns_reachedDOWN + Backlog/non-active stop both preserve a dirty workspace to a WIP ref (IDE-189 regression)