chore(openspec): drop 9 superseded proposals + 11 stub archive files
Drop 9 batch proposals that are superseded by the boocode-lift-analysis (boocontext-audit, conductor upgrades, self-healing/verify-gate skills): add-3tier-memory, import-llm-evaluator, import-pregel-engine, plugin-platform, conductor-evolution, code-intelligence-upgrade, dev-workflow, ui-overhaul, agent-reliability. Delete 11 stub archive files (49-66B each, 'Status: Shipped. Archived.' only) that provide zero documentation value over the existing CHANGELOG.md + git tags.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Nav button in sidebar
|
||||
|
||||
The sidebar (`ProjectSidebar.tsx`) SHALL include a "Token Analytics" button in the bottom-pinned section, positioned above the existing Settings button.
|
||||
|
||||
#### Scenario: Button renders above Settings
|
||||
|
||||
- **WHEN** the sidebar renders
|
||||
- **THEN** a "Token Analytics" button is visible in the bottom-pinned div
|
||||
- **AND** it is positioned above the "Settings" button
|
||||
|
||||
#### Scenario: Button navigates to /analytics
|
||||
|
||||
- **WHEN** the user clicks "Token Analytics"
|
||||
- **THEN** the app navigates to `/analytics`
|
||||
- **AND** the sidebar drawer closes on mobile
|
||||
|
||||
### Requirement: Button icon
|
||||
|
||||
The nav button SHALL use a visible icon alongside its label.
|
||||
|
||||
#### Scenario: Icon renders
|
||||
|
||||
- **WHEN** the sidebar renders
|
||||
- **THEN** the "Token Analytics" button displays an icon (use `BarChart3` or similar from lucide-react) and the label "Token Analytics"
|
||||
|
||||
### Requirement: Active route highlight
|
||||
|
||||
The nav button SHALL use the same active/hover styling as the Settings button.
|
||||
|
||||
#### Scenario: Active state
|
||||
|
||||
- **WHEN** the user is on the `/analytics` route
|
||||
- **THEN** the "Token Analytics" button has the same active background styling as other nav buttons
|
||||
|
||||
### Requirement: Mobile responsiveness
|
||||
|
||||
The nav button SHALL close the sidebar drawer on mobile after navigation, matching the Settings button behavior.
|
||||
|
||||
#### Scenario: Mobile navigation closes drawer
|
||||
|
||||
- **WHEN** the user is on mobile (sidebar is a slide-in drawer)
|
||||
- **AND** they click "Token Analytics"
|
||||
- **THEN** the sidebar drawer closes
|
||||
@@ -0,0 +1,73 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Token analytics page route
|
||||
|
||||
The web app SHALL expose a route at `/analytics` that renders the token analytics dashboard.
|
||||
|
||||
#### Scenario: Route resolves to Analytics page
|
||||
|
||||
- **WHEN** the user navigates to `/analytics`
|
||||
- **THEN** the `Analytics` component renders without crashing
|
||||
- **AND** the sidebar nav button for "Token Analytics" shows as active
|
||||
|
||||
### Requirement: Aggregate usage summary
|
||||
|
||||
The dashboard SHALL display an aggregate summary of token usage across all data sources.
|
||||
|
||||
#### Scenario: Summary cards show totals
|
||||
|
||||
- **WHEN** the analytics page loads
|
||||
- **THEN** the page displays summary cards for: total input tokens, total output tokens, total cost (USD), and total sessions tracked
|
||||
- **AND** each card shows a numeric value with a short label
|
||||
|
||||
### Requirement: Per-session token breakdown
|
||||
|
||||
The dashboard SHALL display a list or table of recent sessions with per-session token and cost data.
|
||||
|
||||
#### Scenario: Session list renders
|
||||
|
||||
- **WHEN** `GET /api/coder/sessions/:id/agent-sessions` returns data
|
||||
- **THEN** the page renders a table with columns: session name, agent/provider, input tokens, output tokens, cost, last active
|
||||
|
||||
### Requirement: Per-tool cost breakdown
|
||||
|
||||
The dashboard SHALL display per-tool token consumption stats.
|
||||
|
||||
#### Scenario: Tool stats table renders
|
||||
|
||||
- **WHEN** the analytics page loads
|
||||
- **THEN** it fetches and renders the per-tool cost stats from `/api/tools/cost_stats`
|
||||
- **AND** displays: tool name, call count, avg prompt tokens, avg completion tokens, total avg tokens
|
||||
|
||||
### Requirement: Context window utilization
|
||||
|
||||
The dashboard SHALL display context window utilization data across sessions where available.
|
||||
|
||||
#### Scenario: Context usage section renders
|
||||
|
||||
- **WHEN** session message data with `ctx_used`/`ctx_max` fields is available
|
||||
- **THEN** a section shows average context utilization percentage across sessions
|
||||
|
||||
### Requirement: Token breakdown by category
|
||||
|
||||
The dashboard SHALL display token breakdown by category (system/user/assistant/tools/reasoning) where `token_breakdown` JSONB data exists.
|
||||
|
||||
#### Scenario: Category breakdown renders
|
||||
|
||||
- **WHEN** a session has `token_breakdown` data on its tasks
|
||||
- **THEN** the dashboard shows per-category token counts and a visual breakdown (e.g., stacked bar or pie segment)
|
||||
|
||||
### Requirement: Loading and error states
|
||||
|
||||
The dashboard SHALL handle loading and error states gracefully.
|
||||
|
||||
#### Scenario: Loading state
|
||||
|
||||
- **WHEN** data is being fetched
|
||||
- **THEN** a loading indicator is shown in each section
|
||||
|
||||
#### Scenario: Error state
|
||||
|
||||
- **WHEN** an API call fails
|
||||
- **THEN** the affected section shows an error message and a retry button
|
||||
- **AND** other sections continue to render independently
|
||||
Reference in New Issue
Block a user