Skip to content

task-monitor 3/6: PM short-term queue (task-monitor next …): add task-monitor-queue - #281

Merged
martin-conur merged 3 commits into
mainfrom
task/monitor-queue
Oct 20, 2026
Merged

martin-conur merged 3 commits into
mainfrom
task/monitor-queue

Conversation

@martin-conur

@martin-conur martin-conur commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

The PM now has a one-line command, task-monitor-queue, to record what comes next in a repo; that list is the "Next" section of the task-monitor board. task-work takes an item off the list when it dispatches it, so the PM never has to tidy the board. Every PM prompt learns when to use it, in one short paragraph.

Closes #275

What changed

  • bin/task-monitor-queue (new, canonical, bash 3.2): set <ref>... [--note <ref>=<text>], add, rm [--quiet], clear, and show (the default); --repo DIR on all. Each write prints one line (queue: 267 266 180). It writes $TASK_FORCE_HOME/monitor/<repo>/queue in exactly the format task-monitor-snapshot already reads, and now owns it. Named task-monitor-queue per the PM's naming note (the user-facing task-monitor is task-monitor 4/6: ratatui front end (repo view + all-repos overview, real-time) #276's front end).
  • Ref matching by key: a leading # and any URL/path prefix are dropped, so 267, #267 and .../issues/267 are one item; tasks/012-x.md and 012-x.md likewise. set keeps the note of a ref that stays queued; --note <ref>= clears it.
  • bin/task-work: after writing the sidecar, best-effort task-monitor-queue rm --quiet of the dispatched ref. Not literally in the spec, but without it a merged item falls out of In flight and reappears in Next until the PM spends a call removing it — the token cost the spec says to avoid.
  • PM prompts: one paragraph in the four claude commands/pm.md, this repo's .claude/commands/pm.md, and the three kiro agents/pm.json, with a tracker-appropriate example ref.
  • Install: the drift-guarded shared stanza links it on all seven loadouts.
  • Docs: README subsection, all seven workflow templates plus .claude/gh-workflow.md, schema doc, snapshot comment, CHANGELOG (with upgrading note: re-run install.sh and task-init <loadout>).

Tests

  • New tests/task_monitor_queue.bats: 24 tests under /bin/bash — each subcommand, key matching, notes, refusals, linked-worktree and --repo resolution, a round trip through task-monitor-snapshot --local, task-work's drop, and the PM prompts. Mutation-checked: disabling task-work's drop, key matching, note carry-over and note cleaning each turn the matching tests red.
  • tests/install_symlinks.bats: link test.
  • ./run_tests.sh: 1460/1460 ok. tools/check-drift.sh and shellcheck -x clean.

Not covered

  • A local task queued by slug alone (fix-auth) does not match the dispatched tasks/012-fix-auth.md; the PM prompts say to queue it in the form passed to task-work.
  • The queue's read-modify-write is unlocked; a PM set racing a task-work rm can lose one update (accepted, commented in the code).

Review round 1

Leading #s all stripped (##5 no longer vanishes), -- ends options, URL query string and fragment ignored when keying (Notion ?pvs=4), =-in-ref note limit documented, race comment added. Three new tests, mutation-checked; queue suite now 24, full suite 1460/1460.

🤖 Generated with Claude Code

@martin-conur

Copy link
Copy Markdown
Owner Author

Spec compliance

Checked against #275 (scope bullets):

  • Subcommand with set/add/rm/clear, optional one-line notes, per-repo file under $TASK_FORCE_HOME — delivered (bin/task-monitor-queue, plus show). The file format matches what task-monitor-snapshot already reads, and the snapshot comment now names the new owner. I exercised set/add/show/notes by hand under a scratch TASK_FORCE_HOME; behaviour matches the description.
  • PM prompts on every loadout, a handful of tokens, no context growth — delivered: claude pm.md ×5 (including this repo's) and kiro pm.json ×3. One paragraph each, one-line replies, and the prompt tells the PM not to read the queue back.
  • No describe — respected.
  • bats tests, docs, CHANGELOG with upgrading note — present (21 new tests, install-symlink test, README, 7 workflow templates, schema doc, CHANGELOG).
  • Beyond spec, the task-work auto-drop is well justified in the body and best-effort (|| true), so it cannot block a launch.
  • CI: a run exists for head e2b7310 (drift and shellcheck pass; bats ubuntu/macos were still pending when I looked). Please confirm they finish green before merge.
  • PR body opens with ## Summary ✔.

Code-review findings

No blockers. Two small nits, both fixable in this PR:

  1. A ref starting with ## is silently lost. _check_ref accepts ##5, the write path strips one # and stores #5, and the reader treats any line starting with # as a comment. Reproduced: task-monitor-queue set '##5' prints queue: #5, then show prints queue: (empty). Strip all leading #s, or reject a ref whose stored form starts with # in _check_ref.
  2. -- is rejected as an unknown option (add -- 9 → usage, rc=2), so a ref that begins with - cannot be passed. Probably irrelevant for tracker refs; either handle -- in the arg loop or accept it as is.

Not blocking, noting for awareness: --note <ref>=<text> splits on the first =, so a URL ref containing = (e.g. a Notion ?pvs=4 URL) cannot take a note. The "Not covered" section already mentions the Notion query-string case. Also the read-modify-write on the queue file has no lock, so a PM set racing a task-work rm could lose one update; the window is tiny and the PM is the only writer in practice.

Verdict

clean-with-nits — nit 1 is worth the one-line fix; nothing blocks merge.

martin-conur and others added 3 commits October 20, 2026 16:01
…-monitor-queue

New canonical root binary `bin/task-monitor-queue` (named by the PM: the
user-facing `task-monitor` is the #276 front end). The PM writes the board's
Next section with `set <ref>... [--note <ref>=<text>]`, `add`, `rm`,
`clear`, or no subcommand to show it. Each write answers with one line, so
the PM's board cost is one short call. It owns the queue file format that
`task-monitor-snapshot` already reads:
`$TASK_FORCE_HOME/monitor/<repo>/queue`, one ref per line with an optional
tab-separated note.

Refs are compared by their last path segment, so `267`, `#267` and an issue
URL are one item. `task-work` uses that to drop the ref it dispatches, best
effort, so a dispatched item never returns as next once it leaves In flight.

Every PM prompt (four claude `commands/pm.md`, this repo's copy, three kiro
`agents/pm.json`) gains one paragraph on when to call it. All seven
installers link it; README, workflow templates, schema doc and CHANGELOG
updated. New tests/task_monitor_queue.bats (21 tests under /bin/bash,
mutation-checked) and a symlink test.

Closes #275

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…review round 1

- Every leading `#` of a ref is stripped, so `##5` is stored as `5`
  instead of `#5`, which the reader skipped as a comment.
- `--` ends the options, so a ref starting with `-` can be passed.
- A URL ref's query string and fragment are dropped from its key: a Notion
  page URL with and without `?pvs=4` is one item.
- Documented that `--note` splits on the first `=`, so a ref containing
  `=` cannot take a note.
- One comment naming the accepted race between a PM `set` and the
  task-work `rm`.

Three new tests, each mutation-checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k-monitor-queue in the task-monitor docs

After rebasing onto #282: the README's snapshot and `task-monitor`
sections and the `task-monitor` block in all seven workflow templates and
this repo's workflow doc now say the Next section is the queue the PM
writes with `task-monitor-queue`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@martin-conur
martin-conur merged commit f8b1059 into main Oct 20, 2026
7 checks passed
@martin-conur
martin-conur deleted the task/monitor-queue branch October 20, 2026 19:49
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.

task-monitor 3/6: PM short-term queue (task-monitor next …)

1 participant