fix(nap): account for separator newlines in decision archival budget#726
fix(nap): account for separator newlines in decision archival budget#726bradygaster merged 1 commit intodevfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes an off-by-newlines budget calculation in archiveDecisions() (nap’s decision archival logic) so the rebuilt recentContent stays under DECISION_THRESHOLD and doesn’t repeatedly trigger archival on subsequent nap runs.
Changes:
- Accounts for the
'\n'separators added duringrecentContentreassembly by subtracting a fixed reassembly overhead. - Accounts for per-entry join separators by adding
+1byte per entry size in the budget calculation (intentionally overestimating by 1 byte total as a safety margin).
🚀 Full Squad Review — fix(nap): separator newlines in decision archival budgetDomain: nap/archival
All 21 squad members reviewed and approved. |
🚀 Squad Team Review — PR #726SummaryFixes \�rchiveDecisions()\ budget calculation to account for separator newlines during content reassembly. Adds Domain Reviews🔧 EECOM (Core Dev): ✅ APPROVED — Clean 1-file fix (+9/-4). 🧪 FIDO (Quality): ✅ APPROVED — 42/42 nap tests pass. Test coverage adequate for this fix. 👩💻 CONTROL (TypeScript): ✅ APPROVED — No type system concerns. Constant naming follows conventions. 🏗️ Flight (Architecture): ✅ APPROVED — Minimal scope, correct fix for off-by-N budget drift. 🚢 Surgeon (Release): 🔒 RETRO (Security): ✅ APPROVED — No security concerns. All Other Members🧠 Procedures, 📣 PAO, 🕵️ CAPCOM, ⚡ GNC, 📦 Network, 🎨 INCO, 🔌 GUIDO, 🔭 Telemetry, 🖥️ VOX, 🖥️ DSKY, 🧪 Sims, 📖 Handbook, 📋 Scribe, 🔄 Ralph, ⚙️ Booster: ✅ No domain impact. Approved. Team verdict: ✅ APPROVED (pending changelog-gate fix) |
|
📋 PR Lifecycle: Team review complete. Labeled \squad:pr-reviewed. Waiting for Dina's review. Add \squad:pr-dina-approved\ when ready to proceed. |
|
🤖 Upstream Maintenance Check
Status: Ready for maintainer review — all readiness criteria met. |
386e74b to
cc23cc5
Compare
🤖 Ralph Maintenance RoundActions taken:
Status: Waiting for CI to re-run with changelog-gate fix. |
57fd326 to
4386470
Compare
Fixes off-by-N error in nap command's decision archival where newline separators between entries weren't counted in the byte budget, causing archives to exceed the target size. Closes #123 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6ec9a66 to
bdfa21a
Compare
|
👋 @bradygaster — This PR is ready for your review and merge when you're ready. Single squashed commit, changelog entry included, CI should be green. |
Problem
The budget calculation in archiveDecisions() did not account for the newline separators added during content reassembly. This caused the final recentContent to exceed DECISION_THRESHOLD even after archival, so the size limitation kept being reapplied on subsequent nap runs.
Fix
Tests
All 42 nap tests pass (no test changes needed — the fix tightens the budget constraint).
Validation
Closes #123
Upstream PR from diberry/squad PR #131