Skip to content

refactor(session): finish sessionless runtime cutover#29

Open
LichKing-2234 wants to merge 3 commits into
pr/sessionless-4-runtime-retirefrom
pr/sessionless-5-final
Open

refactor(session): finish sessionless runtime cutover#29
LichKing-2234 wants to merge 3 commits into
pr/sessionless-4-runtime-retirefrom
pr/sessionless-5-final

Conversation

@LichKing-2234
Copy link
Copy Markdown
Owner

Summary

  • switch git-hook checkpoint flow to a true sessionless workspace-based path
  • stop wiring retired legacy session bootstrap services into backend runtime and drop dead internal services
  • align dashboard/runtime docs and frontend copy with tracked workflows and the sessionless model

Test Plan

  • cd ae-cli && go test ./... -count=1
  • cd backend && AE_TEST_POSTGRES_DSN='postgres://postgres:postgres@127.0.0.1:15432/postgres?sslmode=disable' go test ./internal/toolusage ./internal/checkpoint ./internal/handler ./cmd/server -count=1
  • cd frontend && pnpm test

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Completes the cutover to the sessionless attribution runtime: the backend stops wiring/serving legacy session bootstrap and session-event/usage services, the git-hook queue and post-commit/post-rewrite paths derive a workspace_id (instead of requiring a session marker) and emit unbound checkpoints, and the dashboard/repo-detail copy is realigned to "Tracked Workflows" and ae-cli attribution sync. Docs (architecture, staged-cutover spec, plan) are updated to reflect the landed state.

Changes:

  • Delete sessionbootstrap, sessionusage, sessionevent services/tests, the SessionUsageHandler, and the session bootstrap wiring + stale-session sweeper in cmd/server/main.go; update router signature and all handler tests accordingly.
  • Replace dashboard active_sessions with tracked_workflows (distinct workspace_id over tool_usage_events) end-to-end (Go handler, Vue dashboard/types, unit/e2e tests).
  • Rework ae-cli/internal/hooks queue + handler to be workspace-keyed (NewWorkspaceQueue, PendingWorkspaceIDs, workspace-derived binding_source, workspace collector cache) while keeping a legacy session queue path.

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/src/views/repos/RepoDetailView.vue Update unbound-repo copy to reference ae-cli attribution sync.
frontend/src/views/DashboardView.vue Show tracked_workflows metric instead of active_sessions.
frontend/src/types/index.ts Rename DashboardData.active_sessions to tracked_workflows.
frontend/src/tests/repo-detail-view.test.ts Assert new attribution-sync copy.
frontend/src/tests/dashboard-view.test.ts Use tracked_workflows in mocked dashboard payload.
frontend/e2e_test.py Update Playwright assertion to "Tracked Workflows".
docs/superpowers/specs/2026-05-14-legacy-session-staged-cutover-design.md Rewrite to describe landed cutover and remaining footprint.
docs/superpowers/plans/2026-05-14-legacy-session-staged-cutover.md Mark plan completed and refresh remaining gaps.
docs/architecture.md Drop proxy/session bootstrap from diagrams and component table.
backend/internal/sessionusage/{service,service_test}.go Delete legacy session-usage service.
backend/internal/sessionevent/{service,service_test}.go Delete legacy session-event service.
backend/internal/sessionbootstrap/{service,service_test,key_selection,key_selection_test}.go Delete legacy session bootstrap package.
backend/internal/handler/session_usage.go Remove session-usage handler.
backend/internal/handler/router.go Drop sessionBootstrapSvc parameter and import.
backend/internal/handler/efficiency.go Compute tracked_workflows from distinct tool_usage_events.workspace_id.
backend/internal/handler/handler_*_test.go Update SetupRouter arg counts and dashboard test data to tool-usage events / tracked_workflows.
backend/cmd/server/main.go Remove session bootstrap construction, stale-session sweeper, and unused constants/import.
ae-cli/internal/hooks/queue.go Add NewWorkspaceQueue/PendingWorkspaceIDs; reroute legacy queue under attributionlocal root.
ae-cli/internal/hooks/queue_test.go Re-key queue tests to workspace IDs.
ae-cli/internal/hooks/handler.go Derive workspace_id, emit unbound checkpoints when no marker, flush by workspace, persist workspace collector cache.
ae-cli/internal/hooks/handler_test.go Switch tests to workspace markers, add unbound checkpoint test, update cache path assertions.
ae-cli/internal/collector/collector.go Add WriteWorkspaceCache.
ae-cli/cmd/{test_helpers_test,hook_test}.go Configure origin remote and derive workspace_id in cmd hook tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ae-cli/internal/hooks/handler.go Outdated
Comment on lines +32 to +36
workspaceIDs, _ := h.entClient.ToolUsageEvent.Query().
Unique(true).
Select("workspace_id").
Strings(ctx)
trackedWorkflows := len(workspaceIDs)
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not change this in the current PR. The metric rename here is intentional and the value is currently defined as accumulated distinct workflow identities, not a recency-window activity gauge. Changing it to a time-windowed count-distinct would alter the product metric semantics and should be handled as a separate follow-up rather than folded into this runtime-cutover slice.

Comment thread ae-cli/internal/hooks/queue.go Outdated
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.

2 participants