fix(nap): account for separator newlines in decision archival budget#131
fix(nap): account for separator newlines in decision archival budget#131
Conversation
🏗️ Flight (Lead) — Review — PR #131Verdict: ✅ Approve Architecture ReviewSurgical fix to the budget calculation. The reassemblyOverhead constant and per-entry separator accounting are correct. No architecture concerns. Approve. ✅ |
🧪 FIDO (Quality Owner) — Review — PR #131Verdict: ✅ Approve Quality ReviewAll 42 nap tests pass with no changes needed. The fix tightens the constraint correctly. The 1-byte overestimate is a safe margin. Approve. ✅ |
🔧 EECOM (Core Dev) — Review — PR #131Verdict: ✅ Approve Implementation ReviewBuffer.byteLength +1 accounting is correct for join separators. reassemblyOverhead = 2 covers header newline + trailing newline. Clean fix. Approve. ✅ |
👩💻 CONTROL (TypeScript Engineer) — Review — PR #131Verdict: ✅ Approve Type System ReviewNo type changes. Numeric arithmetic is correct. Strict mode compliant. Approve. ✅ |
⚙️ Booster (CI/CD Engineer) — Review — PR #131Verdict: ✅ Approve CI ReviewNo workflow changes. 42/42 tests pass. No new dependencies. Approve. ✅ |
🔒 RETRO (Security) — Review — PR #131Verdict: ✅ Approve Security ReviewNo security implications. Budget calculation is internal to nap archival. Approve. ✅ |
🧠 Procedures (Prompt Engineer) — Review — PR #131Verdict: ✅ Approve Prompt ImpactThis fix ensures nap correctly reduces context window pressure — critical for agent performance. Approve. ✅ |
🖥️ DSKY (TUI Engineer) — Review — PR #131Verdict: ✅ Approve UX ReviewNo user-facing changes. Nap output unchanged. Approve. ✅ |
📣 PAO (DevRel) — Review — PR #131Verdict: ✅ Approve Documentation ImpactBug fix only — no docs needed. Approve. ✅ |
🕵️ CAPCOM (SDK Expert) — Review — PR #131Verdict: ✅ Approve SDK ReviewNo SDK changes. Approve. ✅ |
⚡ GNC (Node.js Runtime) — Review — PR #131Verdict: ✅ Approve Runtime ReviewBuffer.byteLength calls unchanged. No perf impact. Approve. ✅ |
🚢 Surgeon (Release Manager) — Review — PR #131Verdict: ✅ Approve Release ImpactBug fix — patch version bump. Ready for release. Approve. ✅ |
📦 Network (Distribution) — Review — PR #131Verdict: ✅ Approve DistributionNo packaging impact. Approve. ✅ |
🎨 INCO (CLI UX) — Review — PR #131Verdict: ✅ Approve UXNo CLI output changes. Approve. ✅ |
🔌 GUIDO (VS Code Extension) — Review — PR #131Verdict: ✅ Approve VS CodeNo extension impact. Approve. ✅ |
🔭 Telemetry (Observability) — Review — PR #131Verdict: ✅ Approve ObservabilityNo telemetry impact. Approve. ✅ |
🖥️ VOX (REPL) — Review — PR #131Verdict: ✅ Approve REPLNo shell impact. Approve. ✅ |
🧪 Sims (E2E Testing) — Review — PR #131Verdict: ✅ Approve E2E42 unit tests cover all scenarios. No E2E regressions. Approve. ✅ |
📖 Handbook (SDK Usability) — Review — PR #131Verdict: ✅ Approve API SurfaceNo API changes. Approve. ✅ |
Ralph Status UpdateCompleted all pipeline steps for PR #131:
Branch: squad/123-fix-nap-size-calc | Files: 1 | +9/-4 |
0dcae09 to
42a601f
Compare
42a601f to
386e74b
Compare
|
🤖 Ralph — Pipeline Status Stage: \squad:pr-needs-preparation\ → \squad:pr-needs-review\ ✅ Preparation checklist:
Next: Full team + Copilot review required before advancing to \squad:pr-reviewed. |
386e74b to
8967018
Compare
386e74b to
69cc665
Compare
The budget calculation in archiveDecisions() did not account for the
newline separators added during content reassembly (header + '\n' +
entries.join('\n') + '\n'). This caused the final recentContent to
exceed DECISION_THRESHOLD even after archival, so the size limitation
kept being reapplied on subsequent nap runs.
Fix: add reassemblyOverhead (2 bytes for header/trailing newlines)
and +1 byte per entry for join separators to the budget calculation.
Closes #123
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
69cc665 to
cc23cc5
Compare
🤖 Ralph — Preparation CompleteStage: \squad:pr-needs-preparation\ → \squad:pr-needs-review\ Checks completed:
Next round: Team + Copilot code review at \squad:pr-needs-review\ stage. |
🤖 Ralph Pipeline — Preparation CompleteStage: Preparation checklist:
Next: Team + Copilot code review |
|
Upstream PR opened: bradygaster#726 This fork PR has been promoted to upstream. Closing this staging PR. |
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).
Preflight
Closes #123
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com