feat: carry SessionInfo.lastActivityAt (session-list ordering) - #39
Open
saucam wants to merge 3 commits into
Open
feat: carry SessionInfo.lastActivityAt (session-list ordering)#39saucam wants to merge 3 commits into
saucam wants to merge 3 commits into
Conversation
Lockstep half of the daemon's goal-blackboard slice 1. CONTRIBUTING requires
this crate to move with the daemon's packages/protocol.
- `reads` / `writes` on CollaborationRole: the artifact kinds a role may read
and write on the goal blackboard (`spec`, `research`, `adr`, `task-list`,
`diff`, `findings`, or `extra/<key>`).
`None` means "use the daemon's default profile for this role name", which is
NOT the same as an empty list ("read/write nothing") — the daemon distinguishes
them, so these stay Option<Vec<String>> rather than defaulting to an empty vec
here. Collapsing the two would silently strip every default profile.
Kept as plain strings, not an enum: the artifact vocabulary has a fixed core
plus an `extra/<key>` escape hatch, so an enum here would reject a valid kind a
newer daemon accepts.
The wire_format review role now carries populated lists rather than None, so
the recursive camelCase walker actually visits them and a future rename of
either field fails the wire test.
cargo build + clippy + test green: 354 tests; clippy warnings unchanged
(7 before, 7 after on codeoid-protocol, verified by stashing).
The daemon has carried `role` on SessionInfo since the conductor shipped; this crate never modelled it, so the TUI could not so much as badge a conductor. That was the stated prerequisite for the fleet views (codeoid docs/conductor-frontends-design.md §10-§11). Adds SessionRole and mirrors the new read+subscribe surface: ClientMessage::FleetSubscribe / FleetUnsubscribe DaemonMessage::FleetSnapshotResult / FleetUpdate FleetSnapshot, FleetTask, FleetEvent, FleetUsage, FleetDelta Every new enum — SessionRole, FleetTaskKind/Shape/Status — carries #[serde(other)] Unknown. This is a client talking to a daemon that may be NEWER than it: a role or status it has never heard of must degrade to an unrendered node, never fail deserialization of the whole SessionInfo and blank the session list. The wire tests parse JSON CAPTURED from the running TS daemon rather than hand-written fixtures. This crate is a hand-maintained mirror of a TS contract and the failure mode is silent field drop on one side, so a fixture written from the same assumption as the code proves nothing. The TUI accepts the two new frames and logs them: it never sends fleet.subscribe, so receiving one means a stray broadcast rather than a client bug, and it must not be reported as a forward-compat drop. The board UI is P5.2. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Mirrors the daemon side. The web sidebar sorted by createdAt, which is why its order looked arbitrary — when you made a session says nothing about whether it wants you now. The daemon has always tracked last-activity (it orders the resumed session list by it) and now puts it on the wire. Optional, with the same rule as the TS side: absent from an older daemon, so fall back to `created_at` rather than treating it as "never active", which would sink every session to the bottom of a relevance-sorted list. The TUI does not order by it yet — that lands with the P5.1 session-list work, so web and TUI adopt one vocabulary rather than drifting. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Companion to highflame-ai/codeoid#299.
The web sidebar sorted by
createdAt, which is why its order looked arbitrary — when you made a session says nothing about whether it wants you now. The daemon has always tracked last-activity (it orders the resumed session list by it) and now puts it on the wire.Optional, with the same rule as the TS side: absent from an older daemon, so fall back to
created_atrather than treating it as "never active" — which would sink every session to the bottom of a relevance-sorted list.The TUI does not order by it yet. That lands with the P5.1 session-list work, so web and TUI adopt one vocabulary rather than drifting apart.
cargo build,cargo test(7 suites),cargo fmt --check, clippy — clean. SixSessionInfofixtures updated for the new field; the compiler found all of them.