Skip to content

fix(backlog-manager): fix false "Backlog Blocked" when dependencies are already merged#1028

Merged
zbigniewsobiecki merged 1 commit intodevfrom
fix/backlog-manager-blocked-false-positive
Mar 24, 2026
Merged

fix(backlog-manager): fix false "Backlog Blocked" when dependencies are already merged#1028
zbigniewsobiecki merged 1 commit intodevfrom
fix/backlog-manager-blocked-false-positive

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

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)

  • Explicitly warn that (not yet merged) in descriptions is always stale — the MERGED list is the only authority
  • Replace vague MERGED-check guidance with concrete substring matching: if the dependency name appears anywhere in a MERGED title it is resolved
  • Scope the conservative rule: conservative on detecting dependencies, but generous on resolving them against MERGED

Pipeline snapshot (contextSteps.ts)

  • Include URL in parentheses for DONE/MERGED items — enables exact URL matching when descriptions reference PM links
  • Guard empty URL (no () 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 indefinitely

Agent definition (backlog-manager.yaml)

  • Remove misleading targetStatus select parameter that implied independent control over backlog vs. merged firing (both always fire when the trigger is enabled)
  • Update label/description to accurately document dual-list behaviour

Tests

  • New merged-status-changed.test.ts with full parallel coverage to backlog-status-changed.test.ts (8 cases: matches, non-matches, create-in-list, missing-config, wrong-source, disabled trigger, handle result, missing card ID)
  • Updated pipeline snapshot test: renamed "title-only" → "title-and-url", assert URL presence, added empty-URL edge-case test
  • Added missing triggerEvent assertion to backlog trigger test for consistency

🤖 Generated with Claude Code

…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>
@zbigniewsobiecki zbigniewsobiecki merged commit 4a50b74 into dev Mar 24, 2026
8 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the fix/backlog-manager-blocked-false-positive branch March 24, 2026 12:03
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant