Skip to content

Healing a branch forces the refresh through enrichBranches - #105

Merged
m4ttheweric merged 1 commit into
mainfrom
fix/enrich-heal-forces-refresh
Aug 26, 2026
Merged

Healing a branch forces the refresh through enrichBranches#105
m4ttheweric merged 1 commit into
mainfrom
fix/enrich-heal-forces-refresh

Conversation

@m4ttheweric

@m4ttheweric m4ttheweric commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #103, found by verifying it against the live daemon rather than trusting the unit test.

#103 made branch:enrich treat an entry with a resolved id and no ticket as a miss. But enrichBranches has its own short-circuit — allCached = … branches.every(b => b.branch in store.entries) — keyed on mere presence, so the heal re-entered the enricher, hit that branch, and returned the same ticket: null entry without ever reaching the Linear lookup. The heal was real and the effect was nil.

Healing now passes forceRefresh: true (the option enrichBranches already honors). The injected test seam receives the options so the behavior is pinned rather than assumed.

Unit stage green (4,230).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved branch cache healing so incomplete entries are fully refreshed instead of relying on stale presence data.
    • Ensured refreshed branch information updates the cached ticket correctly.
    • Applied consistent silent behavior during branch enrichment.
  • Tests

    • Added regression coverage for healing incomplete cached branches.

#103 taught branch:enrich to treat a ticket-less entry as a miss, but
enrichBranches carries the same short-circuit one level down -- allCached
is keyed on the branch merely being present in the store -- so the heal
re-entered the enricher and got the same incomplete entry back without
ever reaching the ticket lookup. Healing now passes forceRefresh.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 29aa8294-3268-4e72-88b8-a100ebe5c8f3

📥 Commits

Reviewing files that changed from the base of the PR and between 0827537 and 70c6c72.

📒 Files selected for processing (2)
  • lib/daemon/__tests__/branch-enrich-heal.test.ts
  • lib/daemon/handlers/cache.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The cache handler now forces enrichment when it heals incomplete cached branches. The regression test verifies the forceRefresh: true option and cached ticket update.

Changes

Branch cache healing

Layer / File(s) Summary
Forced enrichment during cache healing
lib/daemon/handlers/cache.ts, lib/daemon/__tests__/branch-enrich-heal.test.ts
The cache handler passes enrichment options through its injection seam and sets forceRefresh: true for incomplete cached entries. The regression test verifies the option and ticket resolution.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 70c6c

The change forces branch healing to bypass the cache short-circuit and adds coverage for the requested behavior; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: branch healing now forces a refresh through enrichBranches.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/enrich-heal-forces-refresh

Comment @coderabbitai help to get the list of available commands.

@m4ttheweric
m4ttheweric merged commit 0207e93 into main Aug 26, 2026
4 checks passed
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