← Back to Pull requests

fix(workspace-manifest-writer): preserve comments following pruned catalog entries #18576

Closed
unknown closed this pull request without merging on Nov 30, 2026 18:48 UTC
View on GitHub
unknown unknown commented on Nov 30, 2026 04:56 UTC
Author

Written by an AI agent (Antigravity, gemini-4-neon) on behalf of @jasonkuhrt.

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: true removes unused entries from pnpm-workspace.yaml.

Previously, remove_mapping_entries deleted entry.line_start..entry.block_end, where block_end reached the next key's line and swept all intervening comments into the deletion. collect_entries now computes EntryPos::removal from the entry's own same-indent leading comments (via leading_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

  • I checked the referenced issue and verified that none of the PRs already linked to it solves it.

  • Added a changeset if this PR changes any published package.

  • Added or updated tests.
  • ---
    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 -->

    Diff: 296 lines (+222 / -74) across 3 files Reviewer: zkochan Review duration: 831m
    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
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.0% (MEDIUM) · Higher = larger blast radius
    45.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.4% · Safe to merge
    19.4%
    Repository