Repository navigation
Conversation
Both views read Flair's office-wide Presence roster instead of the viewer's OrgEvent catch-up feed, and label the columns for what they show: the dashboard's activity column becomes Last Seen (presence status and the age of the agent's last heartbeat), and office status shows the same plus the agent's current task or activity. An agent with no presence record reads "never seen"; a read that fails reads "unavailable". The catch-up reader and its fake go with the reads.
Sweep — PR for cli#622 (every sentence the PR adds or changes)Checked against the code on PR body / changelog fragment
Code comments
Test titles (claims too)
Operator strings
Result: one sentence fixed (the presence-read module doc's "every agent"); the rest stand on the code and the named tests. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Resolve the #629 (cli#624) / #639 (cli#622) conflicts so both hold: - utils/org-event-read.ts: keep main's reader. FlairClient.getEventsSince (the task loop, tps agent logs, tps status) now reads through it. Only the dashboard/office-status helpers activityState, orgEventReadNotice and ActivityState go, since nothing else calls them, and the module docs now name the remaining callers. - test/office-status.test.ts: keep #639's Presence tests and drop the cli#620 catch-up describe, including #629's position fix to its malformed-cursor case, because office status no longer reads the feed. Keep #629's cli#624 cursor-format describe, re-keyed to the agent-a/agent-b fixture. - test/helpers/stub-flair.ts and test/flair-catchup-fake.test.ts: restore them from main. #629's flair-task-loop.test.ts and agent-logs.test.ts use orgEventCatchupRoute, and the fake's own test covers that route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #622
What changed
tps roster dashboardandtps office statusshowed per-agent activity from theviewer's OrgEvent catch-up feed — the events addressed to the viewer or
broadcast, from the viewer's acknowledged position — which is not office-wide
recent activity: an agent's work addressed to someone else never appeared, and an
event the viewer acknowledged dropped out. Both now read Flair's office-wide
Presence roster (
GET /Presence), the per-agent state each agent pushes, andlabel the columns for what they show.
Last Seen: the agent's presence status(
active/idle/offline) and the age of its last heartbeat. In--jsoneach agent carries
presence(the record, or null),lastSeen, andpresenceState.LAST SEEN(the same presencestatus and heartbeat age) and the task column is
ACTIVITY: the agent'spresence
currentTask, else its activity label, prefixedwas:once therecord has gone stale. In
--jsoneach agent carriespresence,lastSeen,doing, andpresenceState. The blocker line, which was read from thecatch-up feed, goes with the read.
An agent with no Presence record reads
never seen, never a guess. A Presenceread that fails is reported (the Flair URL and a bounded reason) and reads
unavailable, never an empty column.utils/presence-read.tsperforms the read: it signs oneGET /Presencewith thecommand's own signer, validates the body is an array of records carrying the
fields the commands read, and returns
okorunavailablewith a boundedreason — the HTTP status, a fixed note naming the malformed part of the response,
or the code or class of the error a rejected request raised; the reason never
includes the response body or an error message. The two commands no longer
call
utils/org-event-read.ts. The reader stays because, since #629, it is whatFlairClient.getEventsSinceuses for the task loop,tps agent logsandtps status. Only its dashboard and office-status helpers (activityState,orgEventReadNotice) are removed. The catch-up route fake intest/helpers/stub-flair.tsand its testflair-catchup-fake.test.tsalso stay,because #629's task-loop and agent-logs tests use that route.
Evidence
Measured on f6b7d08 (main a509aa0).
verifying stub (
test/helpers/stub-flair.ts) against a Presence fixture,exercising the real
readPresencereader and its validator, not a fake of theclient. Both files cover a roster with a record plus an agent with none
(
never seen), a stale record (offline,was: …), a refused read (HTTP 403;the column reads
unavailable, notnever seen), a rejected request reportedby code and never its message, malformed bodies (not an array, a record missing
a field, not JSON), and the JSON fields.
then restored by copying the file back (clean
git status): dashboardlast-seen ignoring Presence (3 fail); a missing record guessed (3 fail); a
failed read labelled
never seen(5 fail); the record validator disabled(1 fail); office status ignoring the current task (3 fail); office status
guessing a missing record (1 fail).
node scripts/test-suite.mjs):90 pass, 0 fail, across
flair-signer-commands.test.ts,office-status.test.ts,flair-signer-inventory.test.tsandno-identity-defaults-486.test.ts.unmodified origin/main (a509aa0): 3258 pass, 7 skip, 0 fail (209 files); the
20-test, one-file difference is the deleted catch-up fake and the replaced
feed tests.
bun run build(tsc, strict) exit 0;bun run lint:ciexit 0;node scripts/changelog-fragments.mjs checkok.org-event-read.tsmodify/delete conflict by keeping main's reader andremoving only the two helpers that only the dashboard and office status used.
In
office-status.test.ts, the Presence tests stay, and so does fix(cli): the task loop and getEventsSince read Flair's catch-up envelope #629'scli#624cursor-format describe (either{position}or legacy{since},cursorSincein JSON,cursor: Nm agoin the table), now keyed to theagent-a/agent-b fixture. I dropped the
cli#620catch-up cases. I restoredthe catch-up fake and its test. Full cli suite on rockit: merge 3305 pass,
4 skip, 8 fail (3317 tests, 211 files); main 529e99f 3314 pass, 4 skip, 8 fail
(3326, 211). The same 8 tests fail on both, all in files this merge does not
touch (
facts-verify,facts-commands,nono,launch-attestation-real-nonoand
office-supervision, measured on rockit, not CI). The 9 fewer tests arethis PR's replacements:
office-status.test.ts24 to 18 andflair-signer-commands.test.ts15 to 12. Agent package 240/240 on both.tsc(cli and agent),lint:ciand the changelog check all exit 0.Deliberately not changed
FlairClientandutils/flair-task-loop.tskeep reading the OrgEvent catch-upfeed through
readOrgEvents; fix(cli): the task loop and getEventsSince read Flair's catch-up envelope #629 moved them to the envelope, and this PRleaves them alone.