Skip to content

fix: make dispatch holds real across the fleet - #606

Closed
LuckyB-UF wants to merge 4 commits into
kunchenguid:mainfrom
LuckyB-UF:fm/hold-support
Closed

LuckyB-UF wants to merge 4 commits into
kunchenguid:mainfrom
LuckyB-UF:fm/hold-support

Conversation

@LuckyB-UF

Copy link
Copy Markdown

What and why

AGENTS.md has prescribed tasks-axi hold <id> --reason "..." --kind captain for a captain-gated thread since holds were documented, but nothing else in firstmate knew holds existed. Held items have been mishandled ever since.

This is a proposal, opened from a fork for you to review. Nothing here is urgent and nothing is merged.

The bug

Reproduced on a clean main checkout before any fix, with a held item in a scratch backlog:

held-item -> title: 'gated work (repo: demo) (since 2026-07-15) (hold: captain decision pending) (hold-kind: captain)'
             held field: absent

Four surfaces were hold-blind:

  • The standing queue rule and its three restatements dispatch on blocker plus date gate, never mentioning holds. The tasks-axi path is saved by tasks-axi ready, which excludes held work by default. The manual hand-edit path had nothing to save it.
  • fm-teardown.sh's manual-backend reminder is what firstmate reads at the exact moment it re-scans Queued, and it was hold-blind for the same reason.
  • fm-fleet-snapshot.sh stripped only repo|kind|priority|since|merged|reported|done, so a held item baked its hold markers into its title. Because that strip is end-anchored, the trailing hold paren also blocked the since and repo parens, and no held field was exposed at all. fm-fleet-view could not tell a held item from dispatchable work.
  • fm-bearings-snapshot.sh's gates projection built rows from blocked_by only, so a held item with no blocker read as ungated next work in the captain's morning brief.

Section 10's verb map also had no hold/unhold entry and no hand-edit marker form.

Design notes worth your eye

Hold detection fails closed. tasks-axi hold --reason forbids ), so the paren form carries a comma-bearing reason verbatim. The comma metadata form is hand-written only and is inherently ambiguous for free text. Rather than guess, detection keys on the hold: key in either form and reason extraction is separate, so an unreadable reason can never downgrade an item to dispatchable. Reporting a held item as dispatchable is the one error this must not make.

tasks-axi start does not refuse a held item. It moves it to In flight carrying the hold marker, so the checks are stated where the reader acts rather than left to the verb.

The compatibility contract is corrected at its declared owner. docs/configuration.md claimed a 0.1.1 floor while, in the same sentence, requiring the multi-ID mv probe introduced in 0.2.2. That probe is mandatory, so the effective floor has always been 0.2.2. AGENTS.md and fm-tasks-axi-lib.sh now point at the owner instead of restating a number that drifts. Probe behavior is unchanged; only its description, plus the previously undocumented fail-closed version-parse precondition.

Known gaps, deliberately not fixed here

This is not a clean sweep, and I would rather say so than imply otherwise.

  • Held in-flight items are not rendered. tasks-axi start carries a hold marker into In flight and the snapshot records it correctly, but both fm-fleet-view's In Flight table and bearings' in_flight projection read task metadata rather than backlog records, so the hold shows in --json only.
  • An expired hold-until still reports held. --until means "inactive on and after that date", but the parser does not compare dates. This fails closed: it over-reports a hold rather than dispatching held work.

Testing

tests/fm-fleet-snapshot-view.test.sh covers hold parsing, comma preservation, fail-closed comma-form detection, and hold-until. Each assertion was verified to fail without its fix. Snapshot suite 14 ok, bearings suite 31 ok; CI's pinned counts updated to match.

AGENTS.md section 10 has prescribed `tasks-axi hold <id> --kind captain` for
a captain-gated thread since holds were documented, but firstmate's own rules
and tooling never caught up, so a held item has been mishandled ever since:

- The standing queue rule and its three restatements said a queued item gets
  dispatched once its blocker is gone and its date gate has arrived, with no
  mention of holds. The tasks-axi path is saved by `tasks-axi ready`, which
  excludes held work, but the manual hand-edit path had nothing to save it.
- fm-teardown.sh's manual-backend reminder is what firstmate reads at the exact
  moment it re-scans Queued, and it was hold-blind for the same reason.
- fm-fleet-snapshot.sh stripped only repo/kind/priority/since/merged/reported/
  done, so a held item baked its hold markers into its title. Because the strip
  is anchored at end of line, the trailing hold paren also blocked the since and
  repo parens, and no held field was exposed at all. fm-fleet-view could not
  tell a held item from dispatchable work.
- Section 10's verb map had no hold/unhold entry and no hand-edit marker form.

`tasks-axi start` moves a held item anyway and carries its marker into In
flight, so the checks are stated where the reader acts rather than left to the
verb to refuse.

Also corrects the tasks-axi compatibility contract at its declared owner.
docs/configuration.md said the floor was 0.1.1 while, in the same sentence,
requiring the multi-ID `mv` probe introduced in 0.2.2. That probe is mandatory,
so the effective floor has always been 0.2.2. AGENTS.md and fm-tasks-axi-lib.sh
now point at the owner instead of restating a number that can drift, and
fm-bootstrap.sh's header drops the same stale claim. Probe behavior is
unchanged; the fail-closed version-parse precondition is now documented rather
than dropped.

Snapshot behavior is covered by a test that fails without the parser fix.
Three defects in the hold parsing, two of them introduced by this branch's
own earlier rounds.

The dedicated comma-preserving hold_reason capture only matched the paren
form, so a hand-written comma-form hold parsed as held: false and rendered a
Gate of "-", i.e. dispatchable. That is the one direction this must never
fail, and it regressed a case that worked earlier on the branch. Hold
detection is now separate from reason extraction and keys on the hold: key in
either form, so an unreadable reason can no longer downgrade an item to
dispatchable. The reason still prefers the paren form, which carries commas
verbatim because tasks-axi forbids ")" in --reason; the comma form is
hand-written only and inherently ambiguous for free text, so it truncates at
the first comma rather than guessing.

tasks-axi hold also accepts --until, whose (hold-until: DATE) marker was
unhandled: because the metadata strip is end-anchored, an unstripped trailing
marker also stranded the earlier repo and since parens in the title.

Known gap, deliberately not fixed here: --until means "inactive on and after
that date", but an expired hold is still reported held. That fails closed, so
it over-reports rather than dispatching held work.
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