HOK-1571: Surface project-context compaction suggestion in mill dashboard#573
Merged
timogilvie merged 3 commits intoauto/integrationfrom May 8, 2026
Merged
Conversation
77fca6c to
699f5e0
Compare
Owner
Author
Wavemill Merge failed |
- Restore SKIP_BACKLOG_SELECTION variable reference (was accidentally replaced with empty string literal) - Show 'c to compact context' prompt only when PROJECT_CONTEXT_OVERSIZED is set - Fix date -r portability: try GNU stat/date first, fall back to BSD date -r - Fix dry-run skip logic in compactor: return skipped=true for under-threshold files regardless of dryRun flag
Replace |$ with |(?![\s\S]) in the entry lookahead to use end-of-string semantics instead of end-of-line, preventing the lazy quantifier from stopping after the heading line and silently dropping entry bodies. Add tests for dry-run under-threshold skip and heading-format body preservation.
699f5e0 to
8dde554
Compare
Owner
Author
Wavemill Merge failed |
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
.wavemill/project-context.mdexceeds the configured threshold (default 100KB) at mill startup and surfaces a warning with a compact option in the task-selection panecompact-project-contexttool andproject-context-compactorlibrary module that archives old "Recent Work" entries to a monthly archive file and rewrites the context file below the threshold'c'key in the mill task-selection loop to trigger compaction in-place, only shown when the file is actually oversizedChanges
shared/lib/project-context-compactor.ts— new module: threshold check, entry parsing, archive-and-rewrite logicshared/lib/project-context-compactor.test.ts— unit tests including regression test for heading-format body preservationtools/compact-project-context.ts— thin CLI wrapper calling the compactorshared/lib/wavemill-common.sh—check_project_context_size()andproject_context_suggestion_clear()functions; portable mtime detection (GNUstat/datewith BSDdate -rfallback)shared/lib/wavemill-mill.sh— startup call tocheck_project_context_size; conditional 'c' prompt and handler in task-selection loop; restoredSKIP_BACKLOG_SELECTIONvariable reference (was accidentally hardcoded to empty string)shared/lib/wavemill-context.sh—project_context_suggestion_set/clearfor status displayshared/lib/wavemill-status.sh— readsproject_context_suggestionfrom state to surface in status outputshared/lib/config.ts/wavemill-config.schema.json—projectContext.compactionThresholdKbandkeepRecentconfig fieldsTest plan
npx tsx --test shared/lib/project-context-compactor.test.ts— 8 tests covering threshold skip, dry-run, archive naming, header preservation, entry body preservation, and heading/separator format parsingbash tests/project-context-suggestion.test.sh— shell integration tests forcheck_project_context_sizeandproject_context_suggestion_clearwavemill millagainst a repo with a >100KB project-context.md and verify the warning and 'c' prompt appear; verify 'c' compacts and clears the warningSelf-review
SKIP_BACKLOG_SELECTIONvariable reference accidentally replaced with empty string; conditionalized 'c to compact context' prompt to only show whenPROJECT_CONTEXT_OVERSIZEDis set; fixeddate -rportability for Linux; fixeddryRunguard in threshold-skip pathparseRecentEntriesregex —|$with/gmflag matched end-of-line causing the lazy quantifier to capture only heading lines and silently drop entry bodies; replaced with|(?![\s\S])(end-of-string); added tests