8000 Add `aloop budget contract`: the harness writes the task contract by adeelahmad · Pull Request #48 · adeelahmad/aloop · GitHub
[go: up one dir, main page]

Skip to content

Add aloop budget contract: the harness writes the task contract - #48

Merged
adeelahmad merged 1 commit into
masterfrom
claude/project-thread-qerfr9
Oct 18, 2026
Merged

adeelahmad merged 1 commit into
masterfrom
claude/project-thread-qerfr9

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

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 with BASE_REF=HEAD and the resolved budget (the story's tasks.md budget: 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_contract in plugin/bin/budget reuses resolve() and the _paths layout. scripts/test/budget-contract.test.py (5 checks) covers the keys, the tasks.md override, a whole-sprint role, gate-dispatch accepting the written contract, and the refusals. make test-hosts is green locally. To measure: supervisor output tokens and cost in the next live run.


Generated by Claude Code

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
@adeelahmad
adeelahmad merged commit 06b2a76 into master Oct 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0