feat(sessions): handoff requests and admin force-release with approval workflow #167
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Sub-issue of #125 (Context-Aware Part Subscription System).
When a user holds an edit session and another user needs access, the system should support negotiated handoff and administrative override. These actions integrate with the existing approval workflow system.
1. Handoff Request
Endpoint
Auth: editor
Request:
Server processing:
edit.handoff_requestedSSE event targeted to the holder's workstationhandoff_requeststable or just fire-and-forget via SSE)SSE event:
edit.handoff_requestedDelivered via
PublishToWorkstation()to the holder's workstation.The holder can then:
2. Admin Force-Release
Endpoint
Auth: admin
Request:
Server processing:
edit.force_releasedwith admin, reason, original holderedit.force_releasedSSE event to the holder's workstationedit.session_releasedSSE event to item watchersSSE event:
edit.force_released3. Approval Workflow Integration
Force-release should optionally require an approval workflow rather than allowing any admin to unilaterally release. This integrates with the existing
workflows/YAML system.New Workflow:
session-override.yamlFlow
When
force-releaserequires approval:session-overrideworkflowPOST /approvals/{id}/signapproval.completedwithstate: approved), the session is auto-releasedThis is optional — configurable per deployment. Simple deployments can allow direct admin force-release without approval.
Config
4. Routes
5. Audit Trail
Both handoff requests and force-releases write to the existing
audit_logtable:edit.handoff_requestededit_sessionedit.force_releasededit_sessionAcceptance Criteria
POST /request-handoffsends SSE notification to holder's workstationDELETE /force-releasereleases session (admin only)edit.handoff_requestedSSE event delivered to holderedit.force_releasedSSE event delivered to holdersession-override.yamlworkflow definition includedDepends On
internal/api/approval_handlers.go)Part Of
#125