Repository navigation
Add aloop budget contract: the harness writes the task contract - #48
Merged
Merged
Conversation
The supervisor hand-wrote every task contract as a heredoc (run 26: 9 per run, about 400 characters each), model output re-read on every later turn. One command now writes the keys, BASE_REF=HEAD and the resolved budget, and refuses a run-data or missing story dir, an unknown role or a bad id. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015QxyVf3NgwsgRyYpBgDDTC
This was referenced Oct 18, 2026
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.
Requested by Adeel · project thread
Before: the supervisor hand-wrote every task contract (
.aladdin/state/tasks/<TASK_ID>.env) as a shell heredoc: TASK_ID, ATTEMPT, AGENT_ROLE, STORY_DIR, SCOPE_GLOBS, BASE_REF and five BUDGET_* lines. Live run 26 did this 9 times, about 400 characters of model output each, all of it re-read on every later supervisor turn.After:
aloop budget contract <TASK_ID> --role R --story DIR [--scope G] [--attempt N] [--symbols S]writes the contract withBASE_REF=HEADand the resolved budget (the story's tasks.mdbudget:line for the id's Tn wins) and prints one line. It refuses a missing or run-data story dir, an unknown role, a bad id or attempt (exit 64, nothing written). SKILL.md points the supervisor at it, and is 245 bytes shorter.How:
write_contractinplugin/bin/budgetreusesresolve()and the_pathslayout.scripts/test/budget-contract.test.py(5 checks) covers the keys, the tasks.md override, a whole-sprint role,gate-dispatchaccepting the written contract, and the refusals.make test-hostsis green locally. To measure: supervisor output tokens and cost in the next live run.Generated by Claude Code