Repository navigation
[3471 by Claude Opus 5.5] Sync plan dependencies to GitHub as "blocked by" links when a plan is published - #3504
Conversation
… has prerequisites is now linked on GitHub as "blocked by" them. Both publication paths do it through one shared helper. The new tests and the publication suites pass, apart from one environment failure in `mcpWorkflows`, explained below.
How the GitHub API works (checked against the current docs): the add call is `POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by` with `{ issue_id }`. That is the blocking issue's internal REST `id`, not its number. It needs repository Issues: write, which the GitHub App already requests, and it accepts both installation and user tokens. The docs don't say what happens if you add a link that already exists, so the code never relies on it.
What the helper does (`packages/core/src/services/planDependencyLinks.ts`):
- Second pass: it runs only after every issue exists, so a prerequisite created after its dependant is still linked.
- No duplicates: for each dependant it first lists the existing blockers and adds only the missing ones. If an add returns 422, it lists again and counts the link as existing when it is now there. A resumed or repeated publication therefore never duplicates a link.
- Issue ids: taken from the issue creation response where available, otherwise looked up with `GET /repos/{owner}/{repo}/issues/{n}`. Nothing new has to be stored, so plans published earlier and resumed publications work.
- Best effort: it never throws. Each link is recorded as `created`, `existing` or `failed` (with the error), and failures are logged.
- No dependencies, no calls: a plan without dependencies makes no extra GitHub calls.
REST finalize (`taskExecutionService.ts`, `githubIssueService.ts`): runs the helper with the installation credential and stores the result in the draft's `context_config.dependencyLinks`. A linking error never fails finalize.
MCP `publish_plan` (`toolsPlanning.ts`, `planItems.ts`, `planPublication.ts`):
- Runs the helper with the caller's credential after the prerequisites are recorded and before the final write. The issue id comes from the creation response, or from the marker lookup on resume.
- Each link request stays inside the publication lease, and the claim is renewed before each dependant issue. The only thing in this step that can stop a publication is losing or failing to renew the claim; a GitHub failure on a link cannot, and it leaves no partial state.
- The publish result includes `dependencyLinks.links`, and `get_plan` shows `dependencyLinks` with the created and existing counts and the list of failed links.
Not done: sub-issue links. Plans have no parent tracking issue, as the issue anticipated; this is documented.
Docs: `docs/mcp.md`, `docs/docs/features/planning.md` and the permission table in `docs/docs/operations/github-auth.md` now cover the behaviour, the Issues: write permission, and what happens without it.
Tests:
- Core helper (new): a small graph, a forward reference with id lookup, repeat runs, the 422 race, failures recorded per link, and no calls without dependencies.
- REST (`executeDraftDependencies`, extended): links created; a 403 still leaves the publication `executed`; no link calls for a plan without dependencies.
- MCP (`mcpPublishPlanDependencyLinks`, new): a graph with a forward reference, resume after a partial publication, resume finding links already on GitHub, a 403 that leaves the publication successful with `get_plan` listing the failed links, and no extra calls for a plan without dependencies.
Results:
- 9/9 core tests and 5/5 new MCP tests pass. The existing `mcpPublishPlan` (21) and `planRevisions` (21) suites still pass.
- `mcpWorkflows` fails in this container because there's no Redis: it stops at the follow-up dispatch on line 250, after its `publish_plan` check on line 233 has passed.
- The API node test runs pass but hang at exit, which is a known pattern in this package.
- Typecheck is clean for core and api, and `eslint --max-warnings 0` is clean on the touched files.
There's nothing visual to show, so I made no preview.
|
/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 implements dependency linking through a shared second pass, with useful failure reporting and coverage across both publication paths. It needs a localized correctness fix before merge. ✅ Forward references handled — Both callers link dependencies after issue creation, allowing prerequisites to appear later in the plan. ✅ Failures remain visible — GitHub failures are recorded per link, and MCP exposes a summary through ✅ Focused coverage — Tests cover resumed publication, missing REST IDs, duplicate links, permission failures, and dependency-free plans. The supplied current-head checks show no failures and five pending checks. This review is based on static inspection; no commands or tests were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Compare blockers by global issue ID
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Exercise dependency lease recoveryAdd focused MCP tests for claim renewal failure and request cancellation during the dependency pass, followed by resume. Existing lease tests exercise issue creation; the new tests exercise immediate dependency responses. This is optional coverage for the newly connected lease path, rather than a demonstrated additional defect. ScoreThe shared implementation and focused tests are strong, but incorrect blocker identity can silently omit a required dependency while reporting success. Pending checks alone do not lower the score. 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 0b535a5
Summary of ChangesI fixed F1. When the helper decides a "blocked by" link already exists, it now compares the prerequisite issue's GitHub REST What changed (
New tests:
Results:
There's nothing visual to show, so I made no preview. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…eady exists, it now compares the prerequisite issue's GitHub REST `id`, not its issue number. A blocker from another repository that happens to have the same number no longer stops the link from being created or reported as in place.
I fixed F1. When the helper decides a "blocked by" link already exists, it now compares the prerequisite issue's GitHub REST `id`, not its issue number. A blocker from another repository that happens to have the same number no longer stops the link from being created or reported as in place.
**What changed** (`packages/core/src/services/planDependencyLinks.ts`):
- **Listing:** the existing blockers are now kept as their REST ids. Paging still counts every entry returned, including any without an id.
- **The check:** the helper uses the prerequisite's REST id, either captured when the issue was created or looked up with `GET /repos/{owner}/{repo}/issues/{n}`, both to skip existing links and to make the add call. If that lookup fails, the link is recorded as `failed`, as before.
- **The 422 path:** an add that GitHub rejects with 422 now counts as `existing` only if the prerequisite's own id shows up on the second list. An unrelated blocker no longer counts as confirmation.
- **One trade-off:** on a resume where the creation responses aren't available, the helper now makes one id lookup for each prerequisite that was already linked. Before, it skipped those by number alone.
- **Callers:** both publication paths (REST finalize and MCP `publish_plan`) use this one helper, and neither filters blockers by repository anywhere else, so neither caller needed a change.
**New tests:**
- **Core:** an issue blocked by `other/elsewhere#70` (a different id) still gets linked to the plan's own #70, and a second run then recognises that link. A second test covers a 422 where the only listed blocker is the cross-repository #70: the link is now recorded as `failed` instead of `existing`.
- **MCP:** a publication is interrupted, then a cross-repository blocker #201 appears on issue 202 before the resume. The resume still creates the link to the plan's #201.
- **Fake GitHub:** both test fakes can now list extra blockers from other repositories.
**Results:**
- **Core helper:** 8/8 pass. Run against the helper as it was before this fix, the two new core tests fail and the other six pass.
- **REST (`executeDraftDependencies`):** 3/3 pass.
- **MCP (`mcpPublishPlanDependencyLinks`):** 6/6 pass, including the new one. The run then hangs at exit, a known pattern in this package. I didn't run the new MCP test against the old code.
- **Typecheck:** clean for core and api.
- **Lint:** `eslint --max-warnings 0` is clean on the changed source file and the API test. The core test files are outside the lint config, already the case before this PR.
There's nothing visual to show, so I made no preview.
PR: #3504
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
|
CI failed: Full Test Suite Shard 2/4 Please investigate and fix this CI failure.
Failure evidence
|
|
CI failed: Run Full Test Suite Please investigate and fix this CI failure.
Failure evidence
|
Full Test Suite ResultsValidation failed during: Test shard (shard 2).
View shard 2/4 outputDetails truncated; see the uploaded artifacts for complete failure rows and logs. |
|
✅ Applied the requested follow-up changes in commit 9e1da55 Summary of ChangesI fixed the Shard 2/4 failure; the test now passes locally. Cause: Fix: I added Checks:
There's nothing visual to show, so I made no preview. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed the Shard 2/4 failure; the test now passes locally. **Cause:** `packages/api/test/mcpObservableSurface.test.ts` checks every backticked word in `docs/mcp.md`. Each one has to be either an MCP tool name or listed in the test's `nonToolTokens` allowlist. This PR added a line to the docs saying each blocked-by link is recorded as `created`, `existing` or `failed`. `created` and `failed` were already on the list; `existing` wasn't, so the test failed with: ``` docs/mcp.md names existing, but it is neither an admin-visible tool nor an explicit non-tool token ``` **Fix:** I added `existing` to `nonToolTokens`, with a comment saying it is a dependency-link status that `publish_plan` reports. The change is two lines in that test file; no product code changed. **Checks:** - The test fails with that same message on the current commit and passes with the fix. - `eslint --max-warnings 0` is clean on the file. - The test needs to be run from the repo root. Run from `packages/api`, it fails earlier with "Documentation is unavailable", because it looks for the docs relative to the current directory. There's nothing visual to show, so I made no preview. PR: #3504 Comment by: @propr-dev[bot] (ID: 6832595938) Model: Claude Opus 5.5
|
ℹ️ Analyzed the follow-up request by @propr-dev[bot], @github-actions[bot] Analysis SummaryI made no new changes: the branch already has the fix for this failure. Why CI failed: the failing run was on commit The fix: the next commit on the branch, Check: I ran the test from the repo root on the current head and it passed (1/1). The next CI run should show whether Shard 2/4 now passes. There's nothing visual to show, so I made no preview. No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationReady to merge within scope. The PR implements dependency linking through a shared helper used by both publication paths, with appropriate best-effort failure handling. ✅ Correct dependency identity — Links use GitHub REST issue IDs, including lookup fallback and protection against unrelated cross-repository issues sharing a number. ✅ Safe publication integration — Linking runs after issue creation. MCP requests remain bounded by the publication lease, and completion retains the existing ownership predicate. ✅ Recovery coverage — Tests cover forward references, resumed publication, existing links, 422 reconciliation, permission failures, and plans without dependencies. All authoritative current-head checks passed or were skipped. This review used static tracing of the supplied code; no commands or tests were run. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Test dependency-phase lease boundariesAdd focused MCP tests for cancellation during a dependency request and claim loss before the next dependant’s renewal. The existing lease test covers issue creation, while the new dependency tests cover normal responses and GitHub failures. These tests would strengthen confidence in the new integration; the supplied code already bounds requests and guards final persistence, so this is optional. ScoreThe implementation satisfies the objective with shared logic, meaningful recovery tests, and passing current-head checks. No merge-blocking defect was identified. Score: 9/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
a06618b
into
3470-epic-scheduler-primitives-nrj
AI Implementation Summary
Closes #3471
Branch:
3471/claude-opus-5-5-sync-plan-dependencies-to-20261112-1727-c57Commits: ✅ Changes committed (2096f29)
AI Processing Completed
Execution Details:
Summary:
I've implemented the issue: when a plan is published, each issue that has prerequisites is now linked on GitHub as "blocked by" them. Both publication paths do it through one shared helper. The new tests and the publication suites pass, apart from one environment failure in
mcpWorkflows, explained below.How the GitHub API works (checked against the current docs): the add call is
POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_bywith{ issue_id }. That is the blocking issue's internal RESTid, not its number. It needs repository Issues: write, which the GitHub App already requests, and it accepts both installation and user tokens. The docs don't say what happens if you add a link that already exists, so the code never relies on it.What the helper does (
packages/core/src/services/planDependencyLinks.ts):GET /repos/{owner}/{repo}/issues/{n}. Nothing new has to be stored, so plans published earlier and resumed publications work.created,existingorfailed(with the error), and failures are logged.REST finalize (
taskExecutionService.ts,githubIssueService.ts): runs the helper with the installation credential and stores the result in the draft'scontext_config.dependencyLinks. A linking error never fails finalize.MCP
publish_plan(toolsPlanning.ts,planItems.ts,planPublication.ts):dependencyLinks.links, andget_planshowsdependencyLinkswith the created and existing counts and the list of failed links.Not done: sub-issue links. Plans have no parent tracking issue, as the issue anticipated; this is documented.
Docs:
docs/mcp.md,docs/docs/features/planning.mdand the permission table indocs/docs/operations/github-auth.mdnow cover the behaviour, the Issues: write permission, and what happens without it.Tests:
executeDraftDependencies, extended): links created; a 403 still leaves the publicationexecuted; no link calls for a plan without dependencies.mcpPublishPlanDependencyLinks, new): a graph with a forward reference, resume after a partial publication, resume finding links already on GitHub, a 403 that leaves the publication successful withget_planlisting the failed links, and no extra calls for a plan without dependencies.Results:
mcpPublishPlan(21) andplanRevisions(21) suites still pass.mcpWorkflowsfails in this container because there's no Redis: it stops at the follow-up dispatch on line 250, after itspublish_plancheck on line 233 has passed.eslint --max-warnings 0is clean on the touched files.There's nothing visual to show, so I made no preview.
Detailed Logs:
6a1f56e7-0ca4-4f62-a31d-9b9fc7684f90Log files stored at:
/usr/src/app/logs/executions/issue-3471-2026-11-12T17-59-03-657Z-conversation.json/usr/src/app/logs/executions/issue-3471-2026-11-12T17-59-03-657Z-output.txtLatest Conversation Messages
This PR was created automatically by ProPR after processing issue #3471.
💡 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!