Extends PATCH /admin/agents/:agentId with an optional userId to finally wire Agent.userId (added in 010-identity-auth as schema-only, never consumed by any workflow), with proactive role/duplicate-link checks mirroring UsersService.create's own pre-check style. Adds GET /agents/me/tickets and GET /admin/agents/:agentId/tickets, sharing one TicketsService.listAssignedTo method, returning a dashboard- ready summary (product, customer, priority, severity, status, SLA state) of every ticket currently assigned to an agent — no such query existed anywhere in the ticketing or orchestration modules before this. Backed by a new Assignment @@index([agentId, isCurrent]). Discovered while starting supporthub-web's 001-agent-admin-ui: its agent- dashboard user story had no backend data source without this. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3.1 KiB
3.1 KiB
Specification Quality Checklist: Agent Ticket Queue
Purpose: Validate specification completeness and quality before proceeding to planning Created: 2026-09-07 Feature: spec.md
Content Quality
- No implementation details (languages, frameworks, APIs)
- Focused on user value and business needs
- Written for non-technical stakeholders
- All mandatory sections completed
Requirement Completeness
- No [NEEDS CLARIFICATION] markers remain
- Requirements are testable and unambiguous
- Success criteria are measurable
- Success criteria are technology-agnostic (no implementation details)
- All acceptance scenarios are defined
- Edge cases are identified
- Scope is clearly bounded
- Dependencies and assumptions identified
Feature Readiness
- All functional requirements have clear acceptance criteria
- User scenarios cover primary flows
- Feature meets measurable outcomes defined in Success Criteria
- No implementation details leak into specification
Notes
- This feature was not on the original 11-phase roadmap, and wasn't anticipated by 010's own scope either — it surfaced while beginning supporthub-web's 001-agent-admin-ui planning: its User Story 1 (agent dashboard) needs to list "tickets currently assigned to me," and no route, repository method, or even a documented gap anywhere in the ticketing or orchestration modules answers that question. Numbered 011 in supporthub-api's own sequence for the same reason 010 was — a genuine, immediately-needed backend prerequisite discovered while building the consuming feature, not deferred hardening.
- User Story 1 (linking
Agent.userId) is itself a "finish the scaffold's own intended design" case, same pattern as 010: the field was added in 010-identity-auth specifically for this purpose ("schema capability only, no workflow sets it yet") and simply never got its own endpoint until now. - Deliberately narrow: this is not a general ticket search/list endpoint (Assumptions) — only the one query supporthub-web's agent dashboard actually needs, to avoid speculative scope beyond what 001-agent-admin-ui's own spec calls for.
- All items pass; no revision iterations were needed.
- Implementation-time finding: research.md's plan to add a dedicated
AgentsService.requireAgentForUserguard (rather than inlining the lookup in the ticketing controller) turned out to matter for testability, not just style — it let T007's unit test exercise the "no linked agent" rejection with a fake repository, with no real database involved, exactly the kind of isolated unit coverage tasks.md asked for. Worth defaulting to this shape (a small service method over inline controller logic) whenever a cross-module guard needs its own unit test. - No other deviations from plan.md — the two-routes-sharing-one-service-method design, the proactive existence/role/duplicate-link checks, and the new composite index all worked exactly as researched, and the full regression suite (unit + integration) stayed clean throughout.