Repository navigation
fix(plan): fill task issue numbers at apply time instead of predicting them - #12
Open
matthewtsmith wants to merge 1 commit into
Open
matthewtsmith wants to merge 1 commit into
matthewtsmith wants to merge 1 commit into
Conversation
…g them
The planner had to guess the issue numbers its new tasks would get and wrote
those guesses into every `Depends on` line and e2e file name. Any issue or PR
opened between drafting and approval shifted the real numbers, so tasks
pointed at the wrong, already-closed issues and were dispatched before their
dependencies existed (litart phase 9: off by two after two builder PRs).
Plan task bodies now write `{{task:K}}` for the plan's K-th task and
`{{issue}}` for their own number. apply_plan creates or reuses every issue
first, then fills both with the real numbers before arming a task. A
`{{task:K}}` outside the plan refuses the whole plan before any write.
Plans without placeholders apply exactly as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JrFSqr3eJsNihHcgYph1hB
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.
Problem
The planner had to predict the issue numbers its new tasks would get, because
.issues.jsonhad no way for one new task to name another. Those predictions went into everyDepends online and e2e file name. Any issue or PR opened between drafting and approval shifted the real numbers.In litart phase 9 the plan predicted that task N would be #N+279. Two builder PRs (#280, #281) opened while the plan waited for approval, so the tasks landed on #N+281. Every new-to-new dependency then pointed two numbers too low, mostly at closed issues. #288 and #289 were dispatched before their real dependencies existed, and both builders blocked.
Fix
.issues.jsonwrite{{task:K}}for the plan's K-th task (1-based, so a dependency reads#{{task:3}}) and{{issue}}for the task's own number (for examplee2e/{{issue}}-<slug>.spec.ts).applyPlancreates or reuses every issue first, then fills the placeholders with the real numbers. Each task getsagent-readyonly after its own body is filled.{{task:K}}outside the plan refuses the whole plan before any write. The error names the file and the task, and the tick fails the same way a schema error does today.ghcalls as before.roles/planner.mdexplains the placeholders and tells the planner never to predict numbers. Its JSON example uses the placeholders. The README documents them and adds a troubleshooting entry for the new error.Tests
src/phase.test.ts: filling, detection, and out-of-range errors.src/loop.test.ts:apply_planfills created and existing tasks with the numbers they actually got, and does not re-edit a created task that has nothing to fill. Each task's body is filled before it is armed. A bad placeholder throws with noghwrites.src/roles.test.ts:{{issue}}is allowed inplanner.mdas a placeholder thatapply_planfills, not the prompt composer.pnpm lint,pnpm typecheck,pnpm test(714 passed) andpnpm buildare clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01JrFSqr3eJsNihHcgYph1hB