feat: wake_briefing — felt agent continuity on wake#2567
Open
chubes4 wants to merge 2 commits into
Open
Conversation
Adds WakeBriefingTask — a deterministic system task that composes a terse rolling-window digest of recent threshold-crossing activity (repeatedly failing task types, stuck jobs, grouped error signatures) and writes it to a new always-injected agent-layer memory file, WAKE.md. A fresh session opens already holding a glance at anything red that happened recently, closing the "no proprioception across time" gap. Design (see #2557): - Stateless rolling window, NOT a shared last_wake timestamp. An agent is a fan-out of concurrent sessions; a single mutable wake clock would be a race where the first reader blinds the others. The digest is always "last N hours", recomputed each run — nothing to race because nothing is stored. - Signal discipline is the feature: identical events are GROUPED into one line with a count (213 identical errors render as one line), only items crossing a threshold appear (repeated failures >=3), and the empty state is a single quiet line, never a green-checkmark dashboard. - Deterministic: pure SQL reads + markdown formatting, no AI call. - Pure data-machine integration over existing agents-api injection rails (MemoryFileRegistry / context injection policy). No substrate changes. Wiring: - Registers the task handler, an hourly per_agent recurring schedule (default-disabled, wake_briefing_enabled), and WAKE.md as a read-only, always-injected agent-layer memory file. - requiresAgentContext() returns false — pure site-scoped maintenance, not an agent-scoped operation (avoids the data-machine-code#564 gate failure mode). Refs #2557
Contributor
Homeboy Results —
|
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
Implements the wake-briefing from #2557: a deterministic
wake_briefingsystem task that composes a terse rolling-window digest of recent threshold-crossing activity and writes it to a new always-injected agent-layer memory file,WAKE.md. A fresh agent session opens already holding a glance at anything red that happened recently — closing the "no proprioception across time" gap.Refs #2557.
What it does
On each run it reads the last N hours (default 24h, filterable) and surfaces ONLY threshold-crossing signals:
…then overwrites
WAKE.md, which is registered as a read-only, always-injected agent-memory file so it rides into session context like SOUL/MEMORY do.Design decisions (all from #2557, pressure-tested)
last_waketimestamp. An agent is a fan-out of concurrent sessions; a single mutable wake clock is a race where the first reader resets it and blinds the others. The digest is always "last N hours", recomputed each run. Nothing to race because nothing is stored.Nothing notable in the last 24h.), never a dashboard.requiresAgentContext()= false — pure site-scoped maintenance, avoids the agent-context-gate failure mode fixed in data-machine-code#564.Wiring
SystemAgentServiceProvider::getBuiltInTasks().per_agentrecurring schedule, default-disabled (wake_briefing_enabled) — each agent owns its ownWAKE.mdbecause the recent-sessions pulse is agent-scoped.WAKE.mdregistered inbootstrap.phpas read-only, protected,agent_memoryinjection context, priority 35 (just after MEMORY.md).Verification
php -lclean on all three files;phpcsclean (no violations).render()/truncate()in isolation; caught + fixed a multibyte bug (the…ellipsis is 3 bytes, so byte-strlenovershot the visible cap — switched tomb_strlen/mb_substrso the 3-second-glance length contract holds).Notes
daily_memory_generationis failing ~4×/day. Filing separately — it's exactly the kind of thing this feature is meant to catch.wake_briefing_enabled.Constraints honored
feat:).