T-KMPU-pr-subject-lease-for-sessions-with-no-task-behind-them
State: closed/superseded · Impact: medium · Complexity: medium
The Router’s Subject type is {kind:'task'} or {kind:'pr'}, but only the task
lease (refs/sdlc/tasks/<id>) exists today. A PR with no task behind it — a
hand-opened PR, or one whose task already closed — has nowhere for the Router to
record or reserve a serving session. simple-dispatch-interfaces.html’s Session
lifecycle section proposes a refs/sdlc/prs/<n> lease as the second subject kind.
Approach
Section titled “Approach”- Extend the lease subject kind alongside the existing task lease
(
lib/services/lease/) with aprkind atrefs/sdlc/prs/<repo>/<n>, reusing the same CAS/heartbeat/steal-on-expired machinery. - Make the Router acquire this lease itself when a PR subject has no task lease, per the “Fresh open” step in simple-dispatch-interfaces.html’s Router section.
- Keep the lease system pluggable by subject kind so a third kind can be added later with no Router change.
| Area | Note |
|---|---|
solutions/ontological/lib/services/lease/ | New pr subject kind |
solutions/ontological/lib/services/dispatch/ | Router’s fresh-open step acquires it |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: A PR lease can be claimed, heartbeated and released through the same ops as a task lease.
- AC-2: The Router acquires a PR lease automatically on first delivery to a task-less PR.
- AC-3: Two Router instances racing the same task-less PR resolve to one lease holder.
Out of scope
Section titled “Out of scope”- UI/CLI surface for listing PR leases (leave to
session list/attach,T-QMGC)
Dependencies
Section titled “Dependencies”T-BT9H
Depends on
Section titled “Depends on”T-BT9H