Skip to content

docs: update issue service PRD for workspace addressing and nightshift - #25

Merged
mickume merged 1 commit into
mainfrom
claude/issue-service-prd-refinement-65sc27
Sep 8, 2026
Merged

mickume merged 1 commit into
mainfrom
claude/issue-service-prd-refinement-65sc27

Conversation

@mickume

@mickume mickume commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Update the issue service PRD to reflect the final design decisions: workspace-addressed endpoints (not project-based), single consumer (nightshift), and integration with hub's existing workspace and capability model.

Key Changes

  • Addressing model: Changed from /projects/{project}/ to /workspaces/{slug}/ endpoints, aligning with hub's existing workspace sub-resource pattern (patches, merges, secrets, runs)
  • Consumer scope: Clarified that nightshift is the sole consumer; removed references to hypothetical future consumers (af-issue skill, af-spec, hub web UI)
  • Capability model: Expanded §7 to distinguish between issue-specific capabilities (gating endpoints in this contract) and workspace-wide capabilities (advertisement only, enforced by their own endpoints)
  • Workspace lifecycle: Added explicit handling of archived workspaces (409 workspace_archived on writes) and clarified that clone_status/sync_status do not gate issue operations
  • Workspace-scoped tokens: Added REQ-IS-1.2a defining workspace_mismatch error when a workspace-scoped PAT addresses a different workspace
  • Error codes: Updated all error codes to use workspace terminology (workspace_not_found, workspace_archived, workspace_mismatch)
  • Implementation details: Added REQ-IS-5.2a specifying hub module structure (internal/issues package, RegisterIssueRoutes, IssuesPermissions)
  • Capabilities endpoint: Moved to workspace module (REQ-IS-5.2b), returns both workspace state and issue-specific capabilities in one call
  • Open questions: Updated Q-2 (event stream), Q-3 (cross-workspace relationships), Q-5 (spec drift), and added Q-6 (idempotency mechanism), Q-7 (error envelope), Q-8 (capability endpoint ownership)
  • Conformance suite: Updated test cases to cover workspace-scoped PAT mismatch, archived workspace writes, and capability model validation
  • Appendix B: Clarified that GitLab "project" is a tracker concept, not a hub concept; issue numbers are tracker-scoped, not globally unique

Notable Details

  • Version bumped to 1.3.0 with subtitle "workspace-addressed, nightshift-only"
  • Deployment shape section added explaining workspace-scoped PAT binding and {slug} immutability
  • Capability model now explicitly separates gating (issue capabilities) from advertisement (workspace capabilities)
  • Idempotency-Key header introduced as hub's first such convention; Q-6 flags this as a design decision needing Phase 2 confirmation
  • All references to "Night Shift" or "Night Shift daemon" changed to "nightshift" for consistency

https://claude.ai/code/session_01CGbu4pJZBZshA5QdMhiRwY

Refine the issue service proposal so it can be built against hub as it
actually exists.

Consumers (§4): nightshift is the only consumer. Drop the af-issue skill,
af-spec and the hub web UI here and everywhere else in the document, and
record nightshift's real deployment shape -- one agent per workspace,
authenticating with a workspace-scoped PAT that gains issues:read and
issues:write alongside its existing audit:write and sessions:write.

Concepts (§5): hub has no "project". Replace it with the workspace, hub's
single central entity, addressed by its globally unique immutable slug.
Issue collections become a workspace sub-resource rather than a new
addressable entity, and workspace lifecycle (active/archived) is stated
against issue reads and writes.

API specification (§6): every path moves from /projects/{project} to
/workspaces/{slug}, served at /api/v1/workspaces/{slug}/... alongside
patches, merges, secrets and runs. Drop the proposed project listing in
favour of hub's existing GET /api/v1/workspaces. Rename project_not_found
to workspace_not_found and add workspace_mismatch and workspace_archived,
matching hub's existing error_type vocabulary.

Capability model (§7): split into issue capabilities, which gate endpoints
in this contract, and workspace capabilities, which advertise the rest of
the workspace -- carry_patch, merge_queue, upstream_sync, git_hosting,
secrets, variables, sessions, audit. Each is derived from state hub already
keeps (carry_patch from workspace_mode, upstream_sync from sync_mode,
git_hosting from hub_url) rather than from a new stored flag, and narrowed
by the caller's scopes. The map is open so adding a capability is not a
breaking change.

Record three conflicts with hub's implemented conventions as open questions
rather than silently resolving them: the Idempotency-Key header (Q-6), the
error envelope shape (Q-7), and whether the capability endpoint belongs in
this contract at all (Q-8).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CGbu4pJZBZshA5QdMhiRwY
@mickume
mickume merged commit cd73924 into main Sep 8, 2026
3 checks passed
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