fix(workspace-manifest-writer): preserve comments following pruned catalog entries #18576
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.45) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 296 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.341
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #18576"
general
weight: 0.35
zkochan
Summary
Preserve comments following a pruned catalog entry (including leading comments on the next kept entry, leading comments on the next named catalog, comments separated by blank lines, and mixed-indent section comments) when
catalogPrune: trueremoves unused entries frompnpm-workspace.yaml.Previously,
remove_mapping_entriesdeletedentry.line_start..entry.block_end, whereblock_endreached the next key's line and swept all intervening comments into the deletion.collect_entriesnow computesEntryPos::removalfrom the entry's own same-indent leading comments (vialeading_comment_start) through the end of the entry's last owned structural line, leaving trailing comments intact. Blank lines left without a role are dropped with the entry: the run below it when it sat under a blank line or the mapping key (or when a keep-chomped scalar above would absorb it), and the run above it when it ended the document.Closes pnpm/pnpm#18574
Checklist
---
Written by an agent (Antigravity, gemini-4-neon).
<!-- codesmith:footer -->
---
<sup><a href="https://app.blacksmith.sh/pnpm/codesmith/pnpm/pr/18576?autoLogin=true&ref=codesmith_pr_footer">Open in [code]smith</a> · Need help on this PR? Tag <code>@codesmith-bot</code> with what you need.</sup>
<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Pruning unused catalog entries now preserves comments associated with retained entries, comments following catalogs, and detached or differently indented comments.
Removing an override with a block-style value now removes its full content, including scalar-body comment lines, while preserving sibling comments and valid YAML.
Kept block-scalar content remains intact when neighboring fields are removed. Trailing blank lines and CRLF line endings are preserved, along with surrounding YAML structure.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->