The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
The PM's wake reads only what changed, and agents' posts to it come in its digest (task #3387) Plan
Worked by the Engineer, test first (superpowers test-driven-development): each task's failing test is committed and seen red before the code that passes it.
Goal: Each PM wake stops re-reading its whole instructions, and agents' posts to the PM arrive together in its 5-minute notice digest instead of one terminal paste each. A person's message still reaches the PM at once.
Architecture: Two backend changes in backend/src/superTabs/. (1) pmSchedule.ts drops the REREAD line from
every wake and the "Every wake: reread the instructions whole" line from the built-in section (#3151, merged 11-05
18:08), restoring "read only what people sent you … Don't reread the whole instructions for it". The CLI already tells
every agent, the PM included, when its instructions change and names the file to read again
(cli/src/lib/swarmInstructionsSkill.ts noticeOf), so a wake reads only what changed. (2) noticeDigest.ts gains
gatheredMessage(state, draft), which store.ts writeMessages calls in place of gatheredNotice(source): what was
gathered before, plus an agent's post that is not a Buddy's and attaches no file. message.send marks its draft post
(never stored), since the server also writes notices under an agent's name with no source (a confirmed stop) and those
keep going at once. The digest line of a post names who wrote it. The digest's
release, cancels, 30-minute settle and other-account marks already work per delivery and take these rows unchanged.
Tech Stack: TypeScript, Prisma on MongoDB, vitest (unit), vitest with a loopback replica set (integration).
Spec: task #3387 brief (anh Dee's Swarm redesign, step 1); docs/plans/2026-11-02-pm-notice-digest-design.md, whose non-goal "Gathering agents' or people's posts" this task reverses for agents' posts.
Global Constraints
- Backend only. The CLI needs no change: its instruction-change notice is the "re-read what changed" path. No Swarm code
in
cli/src/core. - A person's message to the PM is never gathered. Nor is a Buddy's post (it carries its person's words), a status row that needs a person (Needs a human, Stuck), or any kind already sent at once.
- An agent's post with attachments goes at once: a digest line carries no files, and its host fetches them only for a delivery it lists.
- Numbers stay as they are (
NOTICE_DIGEST_MS5 minutes,NOTICE_DIGEST_MAX50, 200-character lines). - PR body starts "Requested by dee through Harness."
Design
- growth: no new record; each gathered delivery ends
digested,cancelled, or back toqueuedafter 30 minutes, as now. - concurrency: unchanged; a delivery is written gathered in its message's transaction, and digested by status.
- read cost: unchanged; the coordinator's poll already reads its gathered rows by index, at most 50.
- scale: at 10x agent posts the digest's "And N more" line warns first; 50 lines a digest.
- compatibility: server-side only. Old CLIs and apps never list a gathered row (no host lists one) and see the message as ever.
- migration + rollback: none. An older server releases any gathered row it finds, whatever its kind.
- audience: the digest runs the same recipient, sender and other-account checks per row as a listed delivery.
- identity: N/A because nothing here signs in or acts as a person.
- failure: a gathered row not digested within 30 minutes goes back to queued and is delivered alone.
- platforms: N/A because nothing here runs on a client.
Review Focus
- A person replying to an agent in the PM's chat: still at once (author kind person, test in Task 2).
- An agent's post answering the PM's own question: gathered too; the PM reads it in at most 5 minutes (accepted by the brief).
- An agent of another account posting to the PM: its digest line carries the other-account mark (test in Task 2).
- An agent's post to an agent that is not the PM: queued at once as before (test in Task 2).
- A Buddy's post to the PM: at once (test in Task 2).
Task 1: A wake re-reads nothing unchanged
Files:
Modify:
backend/src/superTabs/pmSchedule.ts(built-in section lines 28-29,JOB_LINES.heard,REREAD,scheduleText)Test:
backend/src/superTabs/pmSchedule.test.tsStep 1: Failing test — replace "tells the coordinator in every wake to reread the whole instructions" with "a wake rereads nothing that did not change (anh Dee, 11-05, #3387)": for a sweep wake and a heard wake, the text has no
reread your project's instructions wholeand noinstructions command; the heard line containsread only what people sent you since the last wake;PM_SCHEDULE_TEXThas noEvery wake: rereadand containsDon't reread the whole instructions for it.Step 2:
npx vitest run src/superTabs/pmSchedule.test.tsfails on those lines. Commit (red).Step 3: Remove
REREADand its use; restore the two lines as before #3151.Step 4: Same command passes. Commit.
Task 2: Agents' posts to the PM arrive in one digest; a person's message is immediate
Files:
- Modify:
backend/src/superTabs/noticeDigest.ts,backend/src/superTabs/store.ts(writeMessages, releasableNotices),backend/src/superTabs/model.ts(MessageDraft.post),backend/src/superTabs/commands.ts(message.send) - Test:
backend/src/superTabs/noticeDigest.test.ts,backend/integration/superTabNoticeDigest.test.ts, and the existing integration tests named in Step 5
Interfaces:
Produces:
gatheredMessage(state: Pick<SuperTabState, 'agents'>, message: Pick<MessageDraft, 'author' | 'source' | 'attachments' | 'post'>): booleanandagentPost(state, row)(a stored row by a non-Buddy agent with no source, for the line's author) innoticeDigest.ts;MessageDraft.post?: true;noticeLine(..., otherAccount, from?: string).gatheredNotice(source)stays.Step 1: Failing unit tests in
noticeDigest.test.ts:gatheredMessageis true for an agent's plain post, false for a person's, a Buddy's, an agent's with attachments, and an agent'sagent-onlyrow; true for every sourcegatheredNoticetakes.Step 2: Failing integration tests in
superTabNoticeDigest.test.ts: replace "an agent's post … go at once" with: two workers'message.sendto the lead aregathered; after 5 minutes one poll writes one digest naming both message ids and both rows enddigested; a person'smessage.sendin the lead chat isqueuedat once; an agent's post to another agent isqueued; a status row written before rows said their status ({ kind: 'system' }) still goes at once.Step 3: Run both files; they fail. Commit (red).
Step 4: Add
gatheredMessage; call it inwriteMessages; name a post's author inreleasableNotices.Step 5: Existing tests that claimed or counted an agent's post to the coordinator one by one point at an agent that is not the coordinator (Team audit M3 marks, claim concurrency, Tidy, Liveness); the digest test of another account's worker also marks a post.
Step 6: Both files pass, with
pmSchedule.test.ts,superTabPmSchedule.test.ts,superTabLiveness.test.ts,superTabTeam.test.ts,superTabTidy.test.tsandsuperTabs.test.ts. Commit.