Web Console: Session, lease, lock, and worktree inventory API (Phase 1) #636

Open
opened 2026-07-10 14:39:03 -05:00 by jcwalker3 · 1 comment
Owner

Problem statement

Leases (#433), worktrees (#432), and runtime (#430) are separate MVP views. The console needs a unified inventory API for sessions, capabilities, leases, locks, namespaces, and worktrees so traffic-control and recovery views share one machine-readable source.

User and operational impact

Incomplete operator picture and higher collision risk; workers cannot pull one inventory for next-safe-action.

Scope

  • Versioned read-only API aggregating sessions (CP-DB when available), role/namespace, capabilities summary, issue/PR leases, locks, worktree bindings, hygiene anomalies.
  • Correlate lease owner ↔ worktree ↔ namespace when possible.
  • Fail-soft sections when a subsystem is unavailable; never invent active ownership.
  • Align with #600/#613 assignment fields where present.

Explicit non-goals

  • No lease steal/release mutations (Phase 2+).
  • No worktree delete in Phase 1.
  • Do not replace Gitea history.

Required implementation investigation

lease_loader.py, worktree_scanner.py, runtime_health.py, control_plane_db.py, issue_lock_store.py, pr_work_lease.py, #433, #432, #430, #601, #613, #631.

Proposed architecture or implementation direction

InventorySnapshot DTO from existing loaders + optional CP-DB; GET /api/v1/inventory and/or resource-split endpoints with shared schema.

Security and workflow-safety requirements

Redact sensitive paths; no session tokens; mark stale/expired leases clearly.

Acceptance criteria

  1. Inventory API returns sessions/leases/locks/worktrees/namespaces sections.
  2. Unavailable subsystems degrade with reasons.
  3. Collision signals when detectable.
  4. Tests: empty, populated, partial failure.
  5. Docs: field authority (DB vs filesystem vs Gitea).

Required tests

Aggregation unit tests; route tests; no false unowned when lease active.

Observability and audit requirements

Read-only; optional scan timing fields.

Dependencies and linkage

  • Parent: #631 · Extends: #430/#432/#433 · Related: #605, #601 · Consumed by: traffic-control, runtime/session views

Canonical issue state

STATE: ready-for-author
WHO_IS_NEXT: author
NEXT_ACTION: Implement unified inventory API + tests
NEXT_PROMPT: Author implements inventory API only; PR; stop

Required final evidence

PR with schema, tests, sample payload.

Required final response and handoff expectations

Brief PR → reviewer.

## Problem statement Leases (#433), worktrees (#432), and runtime (#430) are separate MVP views. The console needs a **unified inventory API** for sessions, capabilities, leases, locks, namespaces, and worktrees so traffic-control and recovery views share one machine-readable source. ## User and operational impact Incomplete operator picture and higher collision risk; workers cannot pull one inventory for next-safe-action. ## Scope * Versioned read-only API aggregating sessions (CP-DB when available), role/namespace, capabilities summary, issue/PR leases, locks, worktree bindings, hygiene anomalies. * Correlate lease owner ↔ worktree ↔ namespace when possible. * Fail-soft sections when a subsystem is unavailable; never invent active ownership. * Align with #600/#613 assignment fields where present. ## Explicit non-goals * No lease steal/release mutations (Phase 2+). * No worktree delete in Phase 1. * Do not replace Gitea history. ## Required implementation investigation `lease_loader.py`, `worktree_scanner.py`, `runtime_health.py`, `control_plane_db.py`, `issue_lock_store.py`, `pr_work_lease.py`, #433, #432, #430, #601, #613, #631. ## Proposed architecture or implementation direction `InventorySnapshot` DTO from existing loaders + optional CP-DB; `GET /api/v1/inventory` and/or resource-split endpoints with shared schema. ## Security and workflow-safety requirements Redact sensitive paths; no session tokens; mark stale/expired leases clearly. ## Acceptance criteria 1. Inventory API returns sessions/leases/locks/worktrees/namespaces sections. 2. Unavailable subsystems degrade with reasons. 3. Collision signals when detectable. 4. Tests: empty, populated, partial failure. 5. Docs: field authority (DB vs filesystem vs Gitea). ## Required tests Aggregation unit tests; route tests; no false unowned when lease active. ## Observability and audit requirements Read-only; optional scan timing fields. ## Dependencies and linkage * Parent: #631 · Extends: #430/#432/#433 · Related: #605, #601 · Consumed by: traffic-control, runtime/session views ## Canonical issue state ```text STATE: ready-for-author WHO_IS_NEXT: author NEXT_ACTION: Implement unified inventory API + tests NEXT_PROMPT: Author implements inventory API only; PR; stop ``` ## Required final evidence PR with schema, tests, sample payload. ## Required final response and handoff expectations Brief PR → reviewer.
jcwalker3 added the type:featurestatus:readyworkflow-hardeninganti-stompdashboard labels 2026-07-10 14:39:04 -05:00
Author
Owner

Canonical Issue State

STATE:
ready-for-author

WHO_IS_NEXT:
author

NEXT_ACTION:
Implement inventory API (sessions/leases/locks/namespaces/runtimes/worktrees); link #652 #653

NEXT_PROMPT:

AUTHOR prgs Gitea-Tools. Implement #636. Vision #652 · Roadmap #653 Phase 1 · Umbrella #631. Lock; branches/; PR; stop. Closing ≠ vision complete.

WHAT_HAPPENED:
Linked to #652/#653 Phase 1. Not recreated.

WHY:
Initial batch linkage.

RELATED_ISSUES:
#652 #653 #631 #430 #432 #433 #640 #641

RELATED_PRS:
none

BLOCKERS:
none

VALIDATION:
existing retained

LAST_UPDATED_BY:
jcwalker3 / prgs-author / author / 2026-07-10

## Canonical Issue State STATE: ready-for-author WHO_IS_NEXT: author NEXT_ACTION: Implement inventory API (sessions/leases/locks/namespaces/runtimes/worktrees); link #652 #653 NEXT_PROMPT: ```text AUTHOR prgs Gitea-Tools. Implement #636. Vision #652 · Roadmap #653 Phase 1 · Umbrella #631. Lock; branches/; PR; stop. Closing ≠ vision complete. ``` WHAT_HAPPENED: Linked to #652/#653 Phase 1. Not recreated. WHY: Initial batch linkage. RELATED_ISSUES: #652 #653 #631 #430 #432 #433 #640 #641 RELATED_PRS: none BLOCKERS: none VALIDATION: existing retained LAST_UPDATED_BY: jcwalker3 / prgs-author / author / 2026-07-10
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#636