Merge dev to main#1361
Merged
Merged
Conversation
`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>
…-checklist-idempotency
Codecov Report❌ Patch coverage is 📢 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.
Routine dev → main promotion.
Commits
d6142445make inline checklist retries idempotent (initial)665863b1preserve non-checkbox prose from duplicate checklist sectionsb4773796insert merged checklist rows after trailing detail linesee50f582extract findMissingItemsInsertionIndex to reduce complexitybcfd7bf5docs(pm): align linear checklist retry docs682c9557review feedback — detail-line travel and cross-process sidecar2172030fkeep duplicate-section detail attached and respect human edits in Linear sidecarc2c879c1chore(ci): rerun codeql analysis🤖 Generated with Claude Code