feat(dreamer): gate the memory-pool tasks on session message activity - #465
TreedsSlop wants to merge 2 commits into
Conversation
The retrospective gate tested `session_projects.updated_at > watermark`, but updated_at is written only at first project binding (and by the backfill at scan time) — it is not an activity timestamp: - under-scan: once the watermark passed a session's registration time, new messages in that session could never re-trigger a run, and a session truncated at the per-session cap never had its tail read; - over-scan: a backfilled old session is stamped with the backfill time, newer than every message it contains, so it stayed eligible forever and re-ran nightly to no effect. Derive the activity signal from the message table at query time instead: - a new MessageActivityProvider counts root sessions with a message newer than the watermark (indexed message table, sub-ms); a missing provider or an unavailable store is treated conservatively as "run" (the executor bails before any child session); - the retrospective scanner makes message activity the eligibility driver, demoting the updated_at filter to the indexless-provider fallback.
verify, verify-broad, curate, compress-cues, and classify-memories gated only on pool existence, so an untouched project still took the memory lease and ran a whole-pool LLM pass on every cron slot with nothing new to process. Require session activity since the last successful run in addition to the pool half, reusing the MessageActivityProvider introduced for the retrospective: verify / compress-cues / classify-memories: live pool AND activity verify-broad: open cycle OR (live pool AND activity) curate: raw status pool AND activity (curate owns expiry hygiene) A missing provider or an unavailable message store is treated conservatively as "run", so hosts without an indexed message store keep their previous behavior.
|
Diagnosis confirmed at source, and it is a good catch: We are not taking this shape, for the reason you already named: it is OpenCode-only and reads Your alternative (b) is the fix we want, and it is cross-harness by construction: a per-session activity high-water mark in our own store, keyed on the message time base the watermark already uses (max message We are doing it ourselves and will credit the diagnosis in the release notes; it has to hold on every harness, including the Rust transform mode where the dreamer's gates read module-owned state, so it lands with that work rather than as a standalone patch. Closing both as shaped. |
verify, verify-broad, curate, compress-cues, and classify-memories gated
only on pool existence, so an untouched project still took the memory lease
and ran a whole-pool LLM pass on every cron slot with nothing new to process.
Require session activity since the last successful run in addition to the
pool half, reusing the MessageActivityProvider introduced for the
retrospective:
verify / compress-cues / classify-memories: live pool AND activity
verify-broad: open cycle OR (live pool AND activity)
curate: raw status pool AND activity (curate owns expiry hygiene)
A missing provider or an unavailable message store is treated conservatively
as "run", so hosts without an indexed message store keep their previous
behavior.
Marking this as draft for now until I worked through the issues on the PR this is based on
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Gates the dreamer memory-pool tasks on session message activity, and switches the retrospective to measure real message timestamps instead of the registration-time
updated_atcolumn, so untouched projects stop paying for whole-pool LLM passes and stale sessions are no longer misclassified.Behavior changes
verify,compress-cues, andclassify-memoriesnow require a live memory pool and session activity since the last successful run.verify-broadruns on an open cycle, or on a closed cycle with a pool and activity.curaterequires a raw-status pool and activity, since it owns expiry hygiene.Retrospective fixes
session_projects.updated_at(which records binding/backfill time).updated_atfilter as a fallback.Written for commit 59a923f. Summary will update on new commits.