Repository navigation
[3470 by Claude Opus 5.5] Add stable item ids and dependsOn edges to the plan schema and persist them on plan issues - #3490
Conversation
…y finished, so it means nothing new. The results stand as reported: 99 of 101 passed, and the other two pass after the test updates.
|
/ultrafix goal=8 max=10 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds shared graph validation, dependency display, and publication metadata with substantial focused coverage. It needs changes before merge because refinement, deletion restoration, and legacy publication recovery can violate the new preservation guarantees. ✅ Shared validation — REST and MCP storage reject duplicate IDs, unknown prerequisites, self-references, and cycles through the same helper. ✅ Forward-reference support — Publication resolves prerequisite issue numbers after all issues exist, supporting dependencies on later plan items. ✅ Scoped scheduling behavior — Documentation correctly states that execution order remains unchanged. This review used static tracing only; no commands or tests were run. The supplied current checks show 18 passed, five pending, and no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Preserve omitted dependencies during refinement
F2: 🔴 Restoring deleted tasks can invalidate the plan
F3: 🔴 Legacy publication changes IDs on resume
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Normalize update responses consistentlyThe issue-list handler now parses ScoreThe implementation has useful shared helpers and broad targeted coverage, but three preservation failures remain in the changed behavior. Current checks report no failures, with five still pending. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit a9119c3
Summary of ChangesI fixed F1, F2 and F3, and each now has a regression test. All new and existing tests in the touched suites pass. F1: dependencies dropped when a refinement omits them
F2: restoring a deleted task could make the plan unsaveableNew helper
F3: item ids changed when a legacy publication resumedIn
Verification
Separate observation (not changed)Core 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
|
Please make two changes:
Tests: chain (C: [A, B] with B: [A] becomes C: [B]); diamond (D: [B, C] with B: [A], C: [A] is unchanged); a task listing all predecessors of a 5-step chain is reduced to its immediate predecessor; an already minimal graph is returned unchanged; user-authored plans are not reduced. Update the docs sentence that describes |
…All new and existing tests in the touched suites pass. I fixed F1, F2 and F3, and each now has a regression test. All new and existing tests in the touched suites pass. ## F1: dependencies dropped when a refinement omits them `packages/core/src/services/taskPlanning/refinementOutput.ts`: `restoreDroppedIds` is now `restoreOmittedIdentity`. When the model returns a complete plan, each item matched to an existing task (by id, or by the existing single-title match that recovers a dropped id) keeps that task's `dependsOn` if the response leaves the field out (or sends `null`). An explicit `dependsOn: []` still removes them all. References to tasks the refinement deleted are still pruned by `preparePlanItemsFromModel` when the plan is stored. - The refinement prompt in `plannerPrompts.ts` now says that leaving `dependsOn` out keeps the current prerequisites, and that `[]` removes them. - The edit-operation path (update/replace/extend) already kept dependencies, because it merges into the current task. Both callers of `normalizeRefinedPlan` (core refinement and the API's `resolveRefinementOutcome`) get the fix. - New tests: a body-only complete refinement where one task drops `dependsOn` and one drops both its id and `dependsOn`; an explicit `[]`; and pruning of a kept dependency on a task the refinement removed. ## F2: restoring a deleted task could make the plan unsaveable New helper `propr-ui/src/hooks/planTaskDependencies.ts` (`restoreDeletedTask`), used by `restoreTask`: - The restored task's own prerequisites are checked against the tasks currently in the plan. - If a relationship's other task is still deleted, the link is set aside in a ref inside the hook and reconnected when that task is restored. This works in both orders: dependent deleted first or prerequisite deleted first. - A final prune drops any link that edits made in the meantime turned into a cycle, so the saved plan always passes the server's graph validation. - New tests: the exact sequence from the finding (delete `api`, delete `schema`, restore `api`, check the saved plan is valid, then restore `schema`), plus the reverse deletion order. ## F3: item ids changed when a legacy publication resumed In `packages/api/mcp/toolsPlanning.ts`, the publication claim now also writes `plan_json` with the generated ids when the stored draft lacked some. This happens before any issue is created or recorded, so a partial publication's stored plan names the items its `plan_issues` rows record, and a resume reads the same ids. Drafts that already have ids are not rewritten. - New test: an id-less draft, failure on the second issue, then resume. It checks that the partial plan's ids match the first row's `plan_item_id`, and that the final rows and stored plan keep those same ids. With the claim write temporarily removed, this test fails. - One side effect: for legacy drafts only, plan history now gets a snapshot at the claim as well as at completion. ## Verification - **UI:** the hook and TaskPlanner tests pass (47 files, 293 tests); `tsc` and eslint are clean. - **Core:** `refinementOutput` (11 tests) and `executeDraftDependencies` pass, and core `tsc` is clean. - **API:** all 12 tests in `planItemDependencies` pass, and eslint is clean on the changed files. - The API test process never exits after its tests finish, so runs end on the timeout. That also happens for a test that doesn't reach any changed code, so it comes from the container, not this change. - I didn't run the companion `planProvenanceUpdates` suite: I queued it behind `planItemDependencies`, and that run hit the exit hang and was killed first. - No visual preview: these are data and state fixes with no new UI. ## Separate observation (not changed) Core `executeDraft` (REST finalize) also generates ids in memory for id-less drafts and saves them only at the end. That path has no resume, and re-finalizing deletes the old `plan_issues` rows, so ids can't change across a recovery the way F3 did. But if the process crashes mid-run, rows are left naming item ids that aren't in the stored plan, until the next re-finalize. PR: #3490 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
|
✅ Applied the requested follow-up changes in commit 3ffbf74 Summary of ChangesBoth changes are in: the planner prompts now ask for direct prerequisites only, and plans the model writes are reduced to their direct prerequisites before they're stored. Plans users save are left alone. The new and touched tests all pass, and lint and typecheck are clean. 1. Prompts. I put the rule in one constant,
2. Reduction. The new pure helper is
One side effect: a refinement that returns a user-written plan also gets reduced, because refinement output always goes through Tests
Results: shared 11/11, Docs. There are no preview images, since nothing in the UI itself changed. The "Depends on" row will just show fewer entries for generated plans. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
… prerequisites only, and plans the model writes are reduced to their direct prerequisites before they're stored. Plans users save are left alone. The new and touched tests all pass, and lint and typecheck are clean. Both changes are in: the planner prompts now ask for direct prerequisites only, and plans the model writes are reduced to their direct prerequisites before they're stored. Plans users save are left alone. The new and touched tests all pass, and lint and typecheck are clean. **1. Prompts.** I put the rule in one constant, `DEPENDS_ON_DIRECT_PREREQUISITES_RULE`, in `plannerPrompts.ts`. It says `dependsOn` lists direct prerequisites only, and a task must not list one that is already a prerequisite, directly or indirectly, of another task it lists. It gives the example "for a chain A → B → C, C lists only B, not A", and says order in the plan implies nothing, so a task with no `dependsOn` is independent. The constant is added to three places: - the generation prompt. - the refinement rules. - the per-file task instructions. These are actually in `packages/core/src/services/taskPlanning/planFileGeneration.ts`, not `plannerPrompts.ts`, so that file imports the constant. **2. Reduction.** The new pure helper is `reducePlanItemDependencies` in `packages/shared/src/planItemGraph.ts`: - It drops a `dependsOn` entry when that entry can be reached through another entry of the same task. - The remaining entries keep their order, and the field is deleted when nothing is left (via `withDependencies`). - Tasks it doesn't change come back as the same objects. `preparePlanItemsFromModel` runs it last, after the existing clean-up that removes cycles, so it only ever sees an acyclic graph. Generation and refinement both go through this. REST draft update, MCP `create_plan` / `update_plan` and restore don't call it. One side effect: a refinement that returns a user-written plan also gets reduced, because refinement output always goes through `preparePlanItemsFromModel`. So if a user saved a plan with extra indirect entries and then refines it, those entries go away. **Tests** - **Shared:** chain (C: [A, B] becomes [B], whatever the order of the entries); diamond unchanged; a 5-step chain reduced to the immediate predecessor, both for the last task alone and for every task listing all earlier ones; a minimal graph returned unchanged, object for object; `preparePlanItemsFromModel` reduces while `normalizePlanItems` doesn't. - **API:** a chain with an extra indirect entry is stored as written through `create_plan`, `update_plan` and the REST draft update. The test compares parsed content rather than the raw string, because the MCP input schema already reorders object keys (that was true before this change). Entries and their order are kept exactly. - **Prompts:** a test checks the rule appears in all three prompts. Results: shared 11/11, `planItemDependencies` 13/13, `refinementOutput` and `planFileGeneration` 51/51, and the docs, `mcpDocs` and `mcpIntegration` suites all pass. ESLint passes for core and api, and `tsc` for shared, core and api. Shared has no ESLint config, so its files weren't linted. **Docs.** `docs/docs/features/planning.md` and `docs/mcp.md` now say `dependsOn` holds direct prerequisites. I also added that plan order implies no dependency, and that only generated and refined plans have indirect entries removed. There are no preview images, since nothing in the UI itself changed. The "Depends on" row will just show fewer entries for generated plans. PR: #3490 Comment by: @integry (ID: 6824696181) Model: Claude Opus 5.5
|
CI failed: Full Test Suite Shard 1/4 Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit a0096ca Summary of ChangesI fixed the CI failure. Shard 1/4 had one failing test, Cause: this branch deliberately gives item ids to older drafts that have none, at the moment
The test's plan has no ids, so it went through this path. Drafts created on this branch already have ids, so they get no extra revision; it only happens once, for older drafts. Fix (test only, no production code changed): the test now runs twice:
Verification: all 21 tests in There are no visual previews because nothing in the UI changed. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…P publication after recent edits preserves the complete pre-publication plan` in `packages/api/test/planRevisions.test.ts`, which expected 2 plan revisions and got 3. All 247 other units in the shard passed. The other three shards were cancelled by CI after this one failed; they didn't fail themselves. I fixed the CI failure. Shard 1/4 had one failing test, `MCP publication after recent edits preserves the complete pre-publication plan` in `packages/api/test/planRevisions.test.ts`, which expected 2 plan revisions and got 3. All 247 other units in the shard passed. The other three shards were cancelled by CI after this one failed; they didn't fail themselves. **Cause:** this branch deliberately gives item ids to older drafts that have none, at the moment `publish_plan` claims the plan. Another test on the branch already covers that. Storing those ids changes the plan, which has two effects: 1. The claim saves the plan as it was before publication, as intended. 2. The first issue-link write then saves the same plan with the new ids added. That's the extra third revision. The later issue-link writes still merge into it. The test's plan has no ids, so it went through this path. Drafts created on this branch already have ids, so they get no extra revision; it only happens once, for older drafts. **Fix (test only, no production code changed):** the test now runs twice: - **With item ids:** it checks the original behaviour — 2 revisions, and the newest one is exactly the plan from before publication. - **Without item ids:** it checks 3 revisions. The middle one is exactly the plan from before publication, and the newest is the same plan with every item given an id. **Verification:** all 21 tests in `planRevisions.test.ts` pass locally, and ESLint with zero warnings allowed is clean. I had to shorten a few lines, because the file is at the lint rule's 400-line limit. The test process hangs after the last test, which is a known issue in this package's tests and not a failure. A one-off typecheck of the file reports a single error, a missing type declaration for the migration it imports on line 6. That line isn't part of this change. There are no visual previews because nothing in the UI changed. PR: #3490 Comment by: @propr-dev[bot] (ID: 6825699035) Model: Claude Opus 5.5
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationNeeds minor changes before merge. The PR adds shared dependency handling, publication metadata, and UI display, but one refinement storage branch bypasses the requested transitive reduction. ✅ Shared graph handling — Validation rejects duplicate IDs, missing prerequisites, self-references, and cycles while preserving user-authored dependency lists. ✅ Publication recovery coverage — Added tests cover forward references, resumed MCP publication, and stable IDs for legacy drafts. ✅ Direct-prerequisite coverage — Prompts explicitly describe direct prerequisites, and helper tests cover chains, diamonds, and already-minimal graphs. Review was static; no commands were run. Supplied checks show 23 passed, none failed, and one pending. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F4: 🔴 Persist reductions for otherwise unchanged refinements
SuggestionsThese are optional follow-ups and are not sent to No suggestions. ScoreThe implementation and coverage are substantial, but the refinement persistence bypass leaves an explicit follow-up requirement unsatisfied. The correction is localized; current checks report no failures. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 9bbc9f7
Summary of ChangesI fixed F4. A refinement that returns the stored plan unchanged now still saves the plan with only direct prerequisites when that plan has redundant ones. Cause: Fix: the helper now checks whether preparing the plan changed any item's
Both callers, the background refinement path and the HTTP handler in Regression tests in
Verification:
I made no previews because nothing visible changed. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…nged now still saves the plan with only direct prerequisites when that plan has redundant ones. I fixed F4. A refinement that returns the stored plan unchanged now still saves the plan with only direct prerequisites when that plan has redundant ones. **Cause:** `refinementPlanUpdates` (`packages/api/routes/plannerHelpers/planRevisions.ts`) kept the stored plan whenever the model's output was byte-identical to it. That threw away the reduction from `preparePlanItemsFromModel`. So with B depending on A and C depending on `[A, B]`, C kept the redundant A. **Fix:** the helper now checks whether preparing the plan changed any item's `dependsOn`: - **If it did,** the reduced plan is always written. `plan_cause` becomes `refinement`, unless the stored plan already matches the reduced one. The outgoing plan goes into revision history with its original cause. - **If it didn't,** the old shortcut still applies. An identical result changes nothing and keeps its provenance. This also covers plans saved before item ids existed: adding ids alone still doesn't count as a refinement. Both callers, the background refinement path and the HTTP handler in `generationHandlers.ts`, go through this helper, so both get the fix. Generation (`taskPlanningService.ts`) always stores the prepared plan and has no such shortcut, so it wasn't affected. **Regression tests** in `packages/api/test/planItemDependencies.test.ts`, run end to end through a real refinement against SQLite: - A user-saved chain with a redundant edge, returned unchanged as `modified`, is stored as `ui → [api]`. `plan_cause` becomes `refinement` and the user's plan is kept in history as `manual_edit`. I swapped in the HEAD version of the helper and this test fails there, so it catches the bug. - An already-reduced plan returned unchanged stays the same, keeps `manual_edit`, and creates no revision. **Verification:** - **Passing:** `planItemDependencies` (15 tests), `planProvenanceUpdates` (9/9) and `plannerBackgroundLifecycle` (21/21) all pass. ESLint (`--max-warnings 0`) and `tsc --noEmit` are clean. - **One failure, not from this change:** `planRevisions` passed 20 of 21. The failing test is "HTTP handlers check ownership and input and refuse restoring a busy plan", which got 200 where it expected 403. It fails the same way with the HEAD helper, so it comes from how I ran it: these suites need `PROPR_DEMO_MODE=true` here, and the ownership check probably behaves differently in that mode. I made no previews because nothing visible changed. PR: #3490 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements stable task identities, dependency validation and persistence, and model-only transitive reduction. It needs a localized API response correction before merge. ✅ Scoped reduction — Generated and refined plans remove indirect prerequisites, while REST and MCP user saves retain them. ✅ Publication recovery — MCP publication persists assigned IDs before creating issues and guards dependency writes with the publication claim. ✅ Focused coverage — Tests cover chains, diamonds, forward references, deletion/restoration, and resumed publication. Current checks report 24 passed and no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F5: 🔴 Normalize dependencies in issue-update responses
SuggestionsThese are optional follow-ups and are not sent to No suggestions. ScoreThe implementation and supplied coverage address the effective objective well, and current checks pass. One localized response-contract defect remains before merge; this review used static analysis only, as requested. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 0f66fab
Summary of ChangesF5 is fixed: the issue-update response now returns What changed
Same-defect check
There was no other occurrence to fix. Tests
There's no visible UI change, so I didn't capture previews. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…_on_issues` as an array of issue numbers, the same as the issues list. F5 is fixed: the issue-update response now returns `depends_on_issues` as an array of issue numbers, the same as the issues list. **What changed** - `resolveIssueForResponse` in `packages/api/routes/planIssueRouteUtils.ts` is the one function both REST issue handlers use to format their responses. It now also runs `withPlanIssueDependencies`, so `createUpdateIssueHandler` returns `plan_item_id` as a string or `null` and `depends_on_issues` as a `number[]`. A stored `'[42]'` comes back as `[42]`, and older rows with `null` come back as `[]`. - The two list responses in `createGetIssuesHandler` (paged and unpaged) used to call `withPlanIssueDependencies` themselves. They now rely on the same function, so all three responses are formatted in one place. **Same-defect check** I looked at every other API path that returns plan issue rows: - The MCP `get_plan` tool already converts the rows the same way. - The epic-queue, MCP dispatch, issue-summary and dashboard queries only read a few columns or use the rows internally; none of them return `depends_on_issues`. There was no other occurrence to fix. **Tests** - I added two cases to `test/planIssueHandlers.followup.test.ts`. Each updates an issue's status, then checks the response: one starts from a stored `'[42]'` and expects `[42]`, the other starts from a legacy row with `null` and expects `[]` and `plan_item_id: null`. All 11 tests in that file pass. With the fix taken back out, both new cases fail. - `test/planRefinementSettlement.test.ts`, which covers the list handler, passes (25 of 25), as does `packages/api/test/planItemDependencies.test.ts` (15 of 15). The `packages/api` typecheck and lint on the changed route files are clean. - `packages/api/test/mcpEpicDispatch.test.ts` has 57 failing tests here, all with "GitHub auth not configured" because this container has no GitHub app credentials. I ran it again with the HEAD versions of the two route files and the same tests failed in the same way, so the failures don't come from this change. There's no visible UI change, so I didn't capture previews. PR: #3490 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements stable task IDs, dependency validation and persistence, UI prerequisite labels, and model-only transitive reduction. It is merge-ready within the supplied scope, conditional on the pending Validate Changes check completing successfully. This review used static inspection; no commands or tests were run. ✅ Model-only reduction — Generated and modified plans remove redundant prerequisites, while REST and MCP saves retain user-authored dependency lists. ✅ Publication recovery — MCP publication persists assigned IDs before issue creation and guards dependency writes with the publication claim. ✅ Focused coverage — Added tests cover chains, diamonds, forward references, resumed publication, revision restoration, and deletion/restoration of dependent tasks. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Harden omitted identity restorationIn ScoreThe implementation addresses the effective objective with substantial targeted coverage and no verified merge blocker. The supplied current-head status reports 23 passing checks, no failures, and one pending check. Score: 9/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
AI Implementation Summary
Closes #3470
Branch:
3470/claude-opus-5-5-add-stable-item-ids-and-d-20261112-1213-okqCommits: ✅ Changes committed (a4f80ae)
AI Processing Completed
Execution Details:
Summary:
That notice is from a watcher on the regression run, which had already finished, so it means nothing new. The results stand as reported: 99 of 101 passed, and the other two pass after the test updates.
Detailed Logs:
4d75b5cd-8967-421a-a05e-80780719820dLog files stored at:
/usr/src/app/logs/executions/issue-3470-2026-11-12T13-05-15-472Z-conversation.json/usr/src/app/logs/executions/issue-3470-2026-11-12T13-05-15-472Z-output.txtLatest Conversation Messages
This PR was created automatically by ProPR after processing issue #3470.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!
Visual preview
Task card dependencies (desktop)
Planner Studio at 1440px: step 2 shows a read-only "Depends on" chip naming step 1, resolved from the item's dependsOn ids.
Connect sign-in required. Original retained until 2027-02-10T13:05:20.557Z.
View the full-resolution original in ProPR Connect
Task card dependencies (mobile)
Planner Studio at 390px: step 3 lists both prerequisite steps, in plan order, under its title.
Connect sign-in required. Original retained until 2027-02-10T13:05:21.977Z.
View the full-resolution original in ProPR Connect