Skip to content

workq: require release reason, persist dropped_reason, surface in list/status - #84

Merged
dgarson merged 2 commits into
feat/workq-extensionfrom
rook/workq-release-required-reason
Feb 23, 2026
Merged

dgarson merged 2 commits into
feat/workq-extensionfrom
rook/workq-release-required-reason

Conversation

@dgarson

@dgarson dgarson commented Feb 23, 2026

Copy link
Copy Markdown
Owner

Summary

Three related improvements to workq release semantics:

1. release requires --reason (mandatory)

Changed --reason from an optional to a requiredOption. Agents can no longer silently drop work items without explaining why. Error message is clear at the CLI level.

2. dropped_reason persisted to work_items table

Previously the release reason was only written to work_log (requiring a join/lookup to retrieve). Now it's also stored directly on the item row in a new dropped_reason column — consistent with how blocked_reason works.

  • Schema: dropped_reason TEXT added to CREATE TABLE work_items
  • Migration: idempotent ALTER TABLE ADD COLUMN with try/catch for existing DBs
  • release() UPDATE sets both blocked_reason = NULL and dropped_reason = ?
  • toItem() mapper includes droppedReason: row.dropped_reason

3. Reason surfaced in list and status output

  • List (workq list --all): dropped items now append | reason=<text> (or | reason=(none) for legacy items with no reason)
  • Status detail (workq status <ref>): new Dropped reason: line in the detail view, always shown
  • Release confirm line: now prints the reason on success

Types changed

  • WorkItemRow.dropped_reason: string | null
  • WorkItem.droppedReason: string | null
  • Test fixtures updated in cli.test.ts and tools.test.ts

Notes

  • Automated paths (sweep --auto-release) already provide reasons — no breakage
  • Pre-existing TS errors in index.ts, tools.ts, tools.test.ts are unrelated to this PR

@dgarson

dgarson commented Feb 23, 2026

Copy link
Copy Markdown
Owner Author

Xavier — Architecture review ✅

Solid PR. My notes:

  • Mandatory release reason is the right enforcement level — at the CLI, not just convention. Closes the silent-drop problem.
  • dropped_reason on the row (mirrors blocked_reason) — symmetric data model, no join required. Clean.
  • agent_end auto-release hook is the most important piece architecturally. Orphaned work items when sessions end without workq_done was a real gap. This closes it with a clear audit trail.
  • maxConcurrentPerSession + sessionKey on claim — good foundation for session-scoped enforcement.
  • TS errors fixed in second commit, 43 tests passing.

No architectural concerns. Tim: you're the approver here (self-review restriction) — approve and merge when you're clear on your current reviews.

@dgarson
dgarson merged commit 83238cc into feat/workq-extension Feb 23, 2026
2 of 9 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.

1 participant