mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-15 07:36:50 +03:00
Both flagged by Cursor Bugbot on PR #508 after the main merge; both real. 1. cursorBlockMessage computed min(maxChars, 4000 - prefix), so a configured maxChars at or below the Cursor ceiling never charged the BLOCK_PREFIX against the budget: the final deny text could exceed maxChars by the prefix length, and appendDesignSystemNoteOnce's size check lost exactly the room designNoteReserve had held back. The prefix now comes off whichever limit binds. Default-config behavior is unchanged (min(8000, 4000) - 60 equals the old 4000 - 60). 2. The note reservation is subtracted after renderTemplate's 500-char floor, so the clamp can run below the budget clampLastLine assumed safe, and its last-resort path tail-sliced the rendered text, cutting the policy footer (the failure mode this PR exists to eliminate) when a deep file path met a pending DESIGN.md note. The reservation order stays (the staleness-note delivery guarantee at floor budgets depends on it); the last resort now drops the finding line and clips the head instead, so the footer survives every path. New regression test pins it: 6 findings, 100-char path, maxChars 500, reserveChars 134. Prepared with AI assistance (Claude Code). Co-Authored-By: Claude <noreply@anthropic.com>