ARIA: smart truncation for Recent days/weeks summaries#353
Open
holoduke wants to merge 1 commit into
Open
Conversation
Daily and weekly summaries in working-memory previously cut off at a hard char count, often mid-word. Replace with smartTruncate(): prefer the last sentence boundary (. ! ?) within the budget, fall back to last whitespace, then hard cap. Boundary must lie within 60% of the budget to avoid losing most of the content to a stray early period. Same char budgets (200 daily / 300 weekly) — just smarter cutoff. Intent-summary: Recent-days/Recent-weeks summaries truncated mid-word, costing parse-effort on every reflect tick. Intent-tokens: truncation, midword, summary, boundary, readability, temporal Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
updateDailySummaryandcompileWeeklySummaryinbackend/memory/working-memory.tspreviously truncated with a hard.slice(0, N), often cutting mid-word.smartTruncate(text, maxLen)helper that prefers the last sentence terminator (.,!,?) within the budget, falls back to the last whitespace, then to a hard cap.Why
Reflect/think ticks render these summaries via
brain-prompt.ts(Recent days:/Recent weeks:). Mid-word cutoffs like…Ilse oudjes DM door Gillis(trail-off) cost a beat of parse-effort every tick and occasionally hide the actually-relevant trailing clause.Test plan
npx tsc --noEmitpassesRecent days:entries should end on./!/?or a word boundary, not mid-word