Skip to content

feat(sessions): session activity trail — objects a run opened, with live status (v0.221.0)#368

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/session-trail
Jul 16, 2026
Merged

feat(sessions): session activity trail — objects a run opened, with live status (v0.221.0)#368
vikasprogrammer merged 1 commit into
mainfrom
feat/session-trail

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

What

Turns the per-session activity panel into a clear trail of everything a session opened, with each object's live status — so you can track what a run is doing/done at a glance. Phase 1 of the design discussed with @vikasprogrammer.

The insight: every agent side effect already flows through the gateway into audit_events tagged with the session id, so the trail is a projection over data we already have — no new tables, no migration. The only thing audit alone can't give is current status (task.created ≠ "task is now done"), so the route joins each entry back to its live object.

Changes

  1. Coveragesrc/state/session-activity.ts gains secrets / skills / policy categories. secret.put/secret.get/secret.requested, skill.proposed/skill.requested, and policy.proposed now surface as first-class trail entries instead of falling into other.
  2. Live status — each object-bearing descriptor carries an ActivityTarget {kind,id}. GET /api/sessions/:id/activity resolves that target's current state from its live store and returns status + statusTone:
    • task → todo/doing/done/blocked · KB page → rev N · secret → stored · approval/proposal card → pending→approved/rejected
    • resolution is cached per target and proposal-card statuses are batch-loaded from messages once.
  3. UISessionActivity becomes a right-docked side panel with an Objects | Timeline toggle. Objects collapses the trail to one row per live object (outstanding — open/blocked — first) with a status chip; Timeline is the full chronological feed. Polls while the run is alive, so a task's doing→done updates in place.

Adding a new plane later = one classifier case + one resolver branch. (Phase 2 — optional created_by_session columns on KB/secrets/goals for cross-session queries — is deferred.)

Verification

  • New end-to-end test scripts/session-trail-test.cjs — boots a real in-process HTTP server + registry, seeds one session's audit stream + the live objects, hits the endpoint and asserts both coverage and resolved statuses: 13/13 pass.
  • npm run typecheck clean · cd web && npm run build clean · npm run test:governance 68/68.

🤖 Generated with Claude Code

https://claude.ai/code/session_014fS9mHadnGxa2VKhEKn7a7

…ith live status (v0.221.0)

The per-session activity panel now answers "what is this session doing/done?",
not just "which primitives did it touch".

- Coverage: the classifier (src/state/session-activity.ts) gains secrets/skills/
  policy categories, so secret.put/get/requested, skill.proposed/requested and
  policy.proposed surface as first-class entries instead of falling to 'other'.
- Live status: each object-bearing entry carries an ActivityTarget {kind,id};
  the /api/sessions/:id/activity route resolves that target's CURRENT state from
  its live store (task todo→doing→done, KB rev N, secret stored, proposal card
  pending→approved/rejected) and returns status/statusTone.
- UI: SessionActivity is now a right-docked side panel with an Objects | Timeline
  toggle; Objects collapses to one row per live object (outstanding first) with a
  status chip; polls while the run is alive so status updates in place.

Audit stays the single spine — no new tables, no migration; adding a plane is one
classifier case + one resolver. Verified end-to-end via scripts/session-trail-test.cjs
(13/13, real in-process HTTP server) and governance suite (68/68).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014fS9mHadnGxa2VKhEKn7a7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant