fix(backlog-manager): fix false "Backlog Blocked" when dependencies are already merged#1028
Merged
zbigniewsobiecki merged 1 commit intodevfrom Mar 24, 2026
Merged
Conversation
…re already merged
## Root cause
The backlog-manager declared the backlog blocked in two situations:
1. **LLM matching failure**: haiku couldn't match a short dependency reference
("SCMIntegration") in a backlog card's description to the full user-story
title in the MERGED list ("As a developer, I want SCMIntegration and
GitHubSCMIntegration…"). Stale "(not yet merged)" annotations in
descriptions further anchored it toward "blocked".
2. **Missing re-trigger**: when blocking dependency cards were manually moved
to MERGED in Trello (outside CASCADE's PR flow), no trigger fired, leaving
the backlog incorrectly blocked indefinitely.
## Changes
**Prompt improvements** (`backlog-manager.eta`):
- Add explicit warning that "(not yet merged)" text is always stale — the
MERGED list is the only source of truth
- Replace vague MERGED-check guidance with concrete substring/keyword matching
instructions: if the dependency name appears anywhere in a MERGED title it
is resolved
- Scope the conservative rule: be conservative when *detecting* dependencies,
but generous when *resolving* them against MERGED
**Pipeline snapshot** (`contextSteps.ts`):
- Include URL in parentheses for DONE/MERGED items so the agent can do exact
URL matching when descriptions reference PM links
- Guard against empty URL (render nothing rather than empty `()`)
**New trigger** (`status-changed.ts`, `register.ts`):
- Add `TrelloStatusChangedMergedTrigger`: re-triggers backlog-manager whenever
any card is moved to the MERGED list, catching manually resolved dependencies
that would otherwise leave the backlog stuck
**Agent definition** (`backlog-manager.yaml`):
- Remove misleading `targetStatus` parameter that implied independent control
over backlog vs. merged firing (both always fire when enabled)
- Update label and description to accurately describe dual-list behaviour
**Tests**:
- Add `merged-status-changed.test.ts` with full parallel coverage to
`backlog-status-changed.test.ts` (matches, non-matches, disabled trigger,
handle result)
- Update pipeline snapshot test: rename "title-only" → "title-and-url",
assert URL present, add empty-URL edge-case test
- Add missing `triggerEvent` assertion to backlog trigger test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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 backlog-manager was incorrectly declaring the backlog blocked in two distinct situations:
1. LLM matching failure (immediate bug)
The agent (haiku) couldn't match short dependency references in backlog card descriptions (e.g., "SCMIntegration") to full user-story titles in the MERGED list ("As a developer, I want SCMIntegration and GitHubSCMIntegration…"). Stale "(not yet merged)" annotations written at card-creation time further anchored it toward "blocked". The prompt also said "when unsure, treat as blocked" with no distinction between detecting a dependency vs. resolving it.
2. Missing re-trigger (systemic bug)
When blocking dependency cards were moved to MERGED manually in Trello (outside CASCADE's PR flow), no trigger fired. The backlog would stay incorrectly blocked until the next unrelated PR merged.
Changes
Prompt (
backlog-manager.eta)(not yet merged)in descriptions is always stale — the MERGED list is the only authorityPipeline snapshot (
contextSteps.ts)()noise when url is"")New trigger (
status-changed.ts,register.ts)TrelloStatusChangedMergedTrigger: re-triggers backlog-manager whenever any card is moved to the Trello MERGED list, catching manually-resolved dependencies that would otherwise leave the backlog stuck indefinitelyAgent definition (
backlog-manager.yaml)targetStatusselect parameter that implied independent control over backlog vs. merged firing (both always fire when the trigger is enabled)Tests
merged-status-changed.test.tswith full parallel coverage tobacklog-status-changed.test.ts(8 cases: matches, non-matches, create-in-list, missing-config, wrong-source, disabled trigger, handle result, missing card ID)triggerEventassertion to backlog trigger test for consistency🤖 Generated with Claude Code