Skip to content

feat: add MEMORY.md cleanup phase to daily memory task#705

Merged
chubes4 merged 1 commit into
mainfrom
feat/daily-memory-cleanup
Mar 7, 2026
Merged

feat: add MEMORY.md cleanup phase to daily memory task#705
chubes4 merged 1 commit into
mainfrom
feat/daily-memory-cleanup

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented Mar 7, 2026

Summary

  • Extends the daily memory task with an automatic MEMORY.md cleanup phase
  • After generating the daily activity summary, reads MEMORY.md and uses AI to split it into persistent knowledge (stays in MEMORY.md) and session-specific detail (archived to daily file)
  • Keeps MEMORY.md lean for context window budget — currently 99KB, target is under 8KB

How It Works

  1. Phase 1 (existing): Generate daily summary from DM jobs/chat sessions → append to daily file
  2. Phase 2 (new): Read MEMORY.md → AI separates persistent vs session-specific → rewrite MEMORY.md → archive extracted content to daily file

Phase 2 runs regardless of Phase 1 results — most agent work happens via Kimaki sessions which don't create DM jobs, but MEMORY.md still grows.

Safety Measures

  • Skips cleanup if MEMORY.md is already under 8KB threshold
  • Parse validation: won't write if AI output lacks ===PERSISTENT=== delimiter
  • Size ratio check: aborts if new content is <10% of original (AI too aggressive)
  • Cleanup failures are logged but never fail the overall job — the daily summary is already written
  • No information is ever dropped — everything goes to either persistent or archived

Behavioral Change

Previously, when there was no DM activity (no jobs, no chat sessions), the task returned early and did nothing. Now it still runs the cleanup phase, which is the more valuable operation since most agent work is via Kimaki.

After generating the daily summary, the task now reads MEMORY.md and
uses AI to split it into persistent knowledge (stays) and session-specific
detail (archived to daily file). This keeps MEMORY.md lean for context
window budget.

Safety measures:
- Skips cleanup if MEMORY.md is under 8KB threshold
- Parse validation prevents write if AI output lacks persistent section
- Size ratio check aborts if new content is <10% of original
- Cleanup failures are logged but don't fail the overall job
- Phase 2 runs regardless of Phase 1 (DM activity) since most agent
  work happens via Kimaki sessions not tracked as DM jobs
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 7, 2026

Homeboy Results — data-machine

Lint

Tooling versions

  • Homeboy CLI: homeboy 0.71.0
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: unknown
  • Action: Extra-Chill/homeboy-action@v1

ℹ️ PR test scope resolved to full for compatibility with installed Homeboy CLI

lint (changed files only)

  • PHPCS: LINT SUMMARY: 1 errors, 0 warnings
  • Fixable: 1 | Files with issues: 1 of 1
  • PHPStan: PHPSTAN SUMMARY: 233 errors at level 5

Test

Failure Digest

Tooling versions

  • Homeboy CLI: homeboy 0.71.0
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: unknown
  • Action: Extra-Chill/homeboy-action@v1

Test Failure Digest

Autofixability classification

  • Overall: human_needed
  • Autofix enabled: no
  • Autofix attempted this run: no
  • Human-needed failed commands:
    • test
  • Potentially auto-fixable failed commands (if autofix enabled):
    • test
  • Autofix is currently disabled. Commands with autofix support in this run: test

Machine-readable artifacts

  • homeboy-test-failures.json
  • homeboy-audit-summary.json
  • homeboy-autofixability.json

⚡ PR test scope resolved to changed

test

Audit

Tooling versions

  • Homeboy CLI: homeboy 0.71.0
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: unknown
  • Action: Extra-Chill/homeboy-action@v1

ℹ️ PR test scope resolved to full for compatibility with installed Homeboy CLI

audit (changed files only)

  • Actionable audit summary:
  • Alignment score: 0.692
  • Severity counts: unknown: 73, warning: 2
  • Drift increased: no
  • Outliers in current run: 73
  • Parsed outlier entries: 73
  • Top actionable findings:
    1. inc/Engine/AI/System/Tasks/DailyMemoryTask.php — missing_method — Missing method: supportsUndo
    2. inc/Engine/AI/System/Tasks/DailyMemoryTask.php — intra_method_duplicate — Duplicated block in cleanupMemory — 5 identical lines at line 240 and line 282
    3. tests/Unit/Abilities/SystemAbilitiesTest.php — outlier — (outlier)
    4. tests/Unit/Abilities/PermissionHelperTest.php — outlier — (outlier)
    5. tests/Unit/Abilities/ImageGenerationPromptRefinementTest.php — outlier — (outlier)

Homeboy Action v1

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Homeboy found 1 issue(s) in changed files.

'datamachine_log',
'warning',
'Memory cleanup parse failed — no persistent section found. MEMORY.md unchanged.',
array( 'date' => $date, 'ai_output_length' => strlen( $ai_output ) )
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpcs WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.

@chubes4 chubes4 merged commit 2e7e21e into main Mar 7, 2026
2 of 3 checks passed
@chubes4 chubes4 deleted the feat/daily-memory-cleanup branch March 7, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant