Skip to content

Merge dev to main#1361

Merged
zbigniewsobiecki merged 9 commits into
mainfrom
dev
May 12, 2026
Merged

Merge dev to main#1361
zbigniewsobiecki merged 9 commits into
mainfrom
dev

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Routine dev → main promotion.

Commits

  • fix(pm): make inline checklist retries idempotent #1360 — fix(pm): make inline checklist retries idempotent (MNG-741, alternative/complementary to fix(linear): replace visibility-poll with in-process cache (MNG-741) #1357)
    • d6142445 make inline checklist retries idempotent (initial)
    • 665863b1 preserve non-checkbox prose from duplicate checklist sections
    • b4773796 insert merged checklist rows after trailing detail lines
    • ee50f582 extract findMissingItemsInsertionIndex to reduce complexity
    • bcfd7bf5 docs(pm): align linear checklist retry docs
    • 682c9557 review feedback — detail-line travel and cross-process sidecar
    • 2172030f keep duplicate-section detail attached and respect human edits in Linear sidecar
    • c2c879c1 chore(ci): rerun codeql analysis

🤖 Generated with Claude Code

Cascade Bot and others added 9 commits May 12, 2026 12:31
`removeDuplicateChecklistSections()` previously skipped the entire
span of a duplicate section, silently dropping any non-checkbox prose
a user had added inside it (e.g. detail notes interleaved with items).

Fix: before skipping a duplicate section, collect its non-checkbox
lines (excluding the heading and blank lines), strip leading/trailing
whitespace, and emit the preserved prose after the merged section
content — keeping user-edited text while still converging duplicate
checkbox rows into the first matching section.

Adds a regression test pinning the data-loss path reported in review
#3226378053 (MNG-741 follow-up).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
`insertMissingChecklistItemLines()` was inserting at `lastCheckboxIdx + 1`,
which placed newly-merged rows *before* any non-blank detail/prose lines that
followed the last checkbox in the first section. The result was that those
detail lines were visually re-attributed to the wrong (newly-inserted) item.

Example: `### AC\n- [ ] First\n  Detail for First\n\n### AC\n- [ ] Second`
produced `- [ ] First\n- [ ] Second\n  Detail for First` instead of
`- [ ] First\n  Detail for First\n- [ ] Second`.

Fix: scan forward from `lastCheckboxIdx + 1` through non-blank lines before
setting the splice point, stopping at the first blank line (to avoid crossing
section boundaries). This mirrors the semantics already used by
`findChecklistInsertionIndex()` / `addItemToChecklist()`.

Adds a focused regression test for the exact data-corruption scenario reported
in review comment #3226513749.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…xity

Extract the trailing-detail-line scan from insertMissingChecklistItemLines
into its own named helper to bring cognitive complexity below the biome
threshold (was 18, max is 15).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ss sidecar

Inline-checklist fix (review comment #3226669603): detail lines in a
duplicate section now travel WITH their checkbox into the first section
rather than being orphaned after a blank gap. `skipRemovedDuplicateSection`
now distinguishes "new" items (detail is skipped — it's emitted in section 1)
vs "existing" items (detail preserved as prose). `insertMissingChecklistItemLines`
emits detail lines immediately after each newly-inserted checkbox.

Cross-process sidecar fix (review comment #3226669608): replaced the
in-process-only `recentDescriptions` cache with a dual-layer approach.
After every successful `linearClient.updateIssue` call, the fresh
description is written to a JSON sidecar file while the filesystem lock
is held. The next process to acquire the lock reads the sidecar first,
providing a durable cross-process fresh base even when Linear's GET still
returns stale data.

Adds regression tests for both scenarios.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ts in Linear sidecar

Two data-corruption paths remain from the previous round:

1. **inline-checklist**: When section 1 had item "First" with no detail but
   the duplicate section had "First" with trailing detail, the detail was
   emitted as orphaned prose after a blank-line separator instead of being
   attached to the retained item.  Fix: pre-scan section 1 to identify which
   items already carry their own detail; for items that do NOT have detail in
   section 1 but do have it in mergedItems (collected from a duplicate
   section), emit the detail immediately after the checkbox in the section-1
   rewrite.  Track the emitted items in `detailEmittedForItems` so
   `skipRemovedDuplicateSection` doesn't re-emit them as orphaned prose.

2. **Linear adapter**: The cross-process sidecar was preferred
   unconditionally over the provider read, so a human edit added to the
   Linear description after cascade's last write was silently dropped when a
   second cascade process ran.  Fix: prefer the provider read when it contains
   the sidecar content (provider is current + has extra edits); fall back to
   the sidecar only when the provider read does NOT contain the sidecar
   (demonstrably stale Linear GET).

Regression tests added for both scenarios.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 6570d7c into main May 12, 2026
7 of 8 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

❌ Patch coverage is 91.70507% with 36 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pm/_shared/inline-checklist.ts 92.16% 21 Missing and 8 partials ⚠️
src/pm/_shared/description-mutation-lock.ts 86.84% 5 Missing ⚠️
src/pm/linear/adapter.ts 91.30% 2 Missing ⚠️

📢 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