Skip to content

fix(bin): create captain-hold rows when Beads requires due - #4854

Merged
kunchenguid merged 1 commit into
kunchenguid:mainfrom
RooseveltAdvisors:fm/fm-captain-hold-regfix
Sep 18, 2026
Merged

kunchenguid merged 1 commit into
kunchenguid:mainfrom
RooseveltAdvisors:fm/fm-captain-hold-regfix

Conversation

@RooseveltAdvisors

Copy link
Copy Markdown
Contributor

Intent

Captain-hold registration is broken in the shared beads workspace: an investigation that discovers a captain decision can silently fail to record it. bin/fm-captain-hold.sh hold cannot create the task row it offers to create, because (a) .beads/config.yaml sets due.required: true and the tasks-axi path never passes --due, and (b) type captain is rejected as an invalid issue type since the config carries no types.custom registration, even though 135 existing rows read as kind captain. Fix it at the source so the completion gate can always register a captain call.

What Changed

  • hold in bin/fm-captain-hold.sh now waives Beads due.required via BD_DUE_REQUIRED=false when creating a missing captain row, since the tasks-axi create path never passes --due and captain holds have no due semantics.
  • Keeps --kind captain as backlog metadata mapping to Beads' native task issue type instead of registering a types.custom captain issue type, and documents this in docs/configuration.md.
  • Adds a lifecycle test covering captain-row creation in a Beads workspace with due.required: true and no custom captain type.

Risk Assessment

✅ Low: A two-line, narrowly scoped env-var waiver at the single create path, verified to work against the real bd/tasks-axi toolchain and covered by a behavioral regression test with fixture-validity probes.

Testing

Exercised the fix end-to-end: the new focused Beads-backend regression test passes on the fixed tree and provably fails against the pre-fix script, and a manual CLI run of bin/fm-captain-hold.sh hold against a fleet-shaped Beads workspace (due.required: true, no custom captain type) created and captain-held the row with native issue_type task and no synthetic due date, matching the user intent.

Evidence: End-to-end CLI transcript: captain-hold create under Beads due.required without types.custom

Source: End-to-end CLI transcript: captain-hold create under Beads due.required without types.custom

== Fixture: bd refuses a due-less create and rejects type captain == bd refused 'create --type task' without --due (due.required in force) bd rejected '--type captain' (no types.custom registration) == End-to-end: bin/fm-captain-hold.sh hold on a fresh investigation id == fm-manual-call hold exit: 0 == Persisted state: tasks-axi show fm-manual-call == task: id: fm-manual-call title: Choose the sample route state: queued held: yes hold_kind: captain kind: captain == Persisted state: bd show fm-manual-call (native issue_type) == {"id":"fm-manual-call","issue_type":"task","status":"open","title":"Choose the sample route","due":null}

== Fixture: bd refuses a due-less create and rejects type captain ==
bd refused 'create --type task' without --due (due.required in force)
bd rejected '--type captain' (no types.custom registration)

== End-to-end: bin/fm-captain-hold.sh hold on a fresh investigation id ==
fm-manual-call
hold exit: 0

== Persisted state: tasks-axi show fm-manual-call ==
task:
  id: fm-manual-call
  title: Choose the sample route
  state: queued
  blocked: no
  blocked_by: none
  held: yes
  hold_reason: captain must decide
  hold_kind: captain
  hold_until: "-"
  kind: captain
  repo: sample
  priority: 2
  priority_why: "-"
  created: 2026-09-18
  closed: "-"
  deps: none
  links: none
  body: "Captain hold set: 2026-09-18T17:06:17Z\n"

== Persisted state: bd show fm-manual-call (native issue_type) ==
{
  "id": "fm-manual-call",
  "issue_type": "task",
  "status": "open",
  "title": "Choose the sample route",
  "due": null
}

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • fm-test-run.sh-style focused run of test_hold_creates_a_captain_row_when_beads_requires_due_without_custom_type and test_captain_hold_mutations_address_the_beads_backend from tests/fm-captain-hold-lifecycle.test.sh (real bd 1.2.2 + beads-capable tasks-axi) — both pass on the fixed tree
  • Regression check: restored pre-fix bin/fm-captain-hold.sh (commit 9bc051f) and re-ran the new test — it fails with could not create task fm-fresh-captain-call, reproducing the reported bug; restored the fix and the test passes
  • Manual end-to-end CLI transcript: built a fixture home whose .beads/config.yaml sets due:\n required: true with no types.custom, confirmed bd create refuses a due-less task and rejects --type captain, then ran bin/fm-captain-hold.sh hold fm-manual-call --title ... --reason ... --repo sample (exit 0) and inspected persisted state via tasks-axi show (held: yes, hold_kind: captain, kind: captain) and bd show --json (issue_type: task, due: null)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Captain holds have no due semantics and are a hold kind, not a Beads issue
type. The create path now waives due.required and maps to native type task.

Co-authored-by: Cursor <[email protected]>
@RooseveltAdvisors

Copy link
Copy Markdown
Contributor Author

Retriggering flaky CI on the same head; reopening immediately.

@RooseveltAdvisors

Copy link
Copy Markdown
Contributor Author

Second CI run hit the same known flake in tests/fm-pi-branch-extension.test.sh; reopening to retrigger.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: triage of this PR.

Outcome: waiting-ci (attestation MATCH; CI in progress on HEAD; prior flake reopens noted)

contract-class: restore — fm-captain-hold.sh hold already promised to create a captain row via tasks-axi add when none exists; Beads due.required broke that create. Fix waives BD_DUE_REQUIRED for that create only and keeps --kind captain as backlog metadata → native Beads task. Unconfigured markdown homes unchanged.

Beads policy: Not a close. No BEADS_ACTOR, no second task-tracking path — tasks-axi remains the verb surface; this is configured-backend create compatibility (type specimen close is #3712 always-on BEADS_ACTOR / second path).

VISION.md

  • One captain, one interface: pass — restores ability to register captain decisions.
  • Authority explicit never inferred: pass — hold still requires explicit captain path; no synthetic due invented as consent.
  • Scripts own mechanics: pass — one-line env waiver at create; test pins fixture.
  • Restart non-event: pass — durable captain-hold row can be created again.
  • Delegation with spine: pass — completion gate can register the call.
  • Fleet outlives vendor: pass — adapter-shaped fix behind tasks-axi.
  • Scope: pass — captain-hold/backlog, not workshop merge.

Attestation: MATCH 7b180224b7d44e12779915fc5c8a499275385794 · CI: in progress 35380342098 · NM: SUCCESS (body compliance) · Mergeable: MERGEABLE/UNSTABLE · workflow-zero: yes · Firstmate-flag: no · security-fyi: no · 14d-stale: no

@kunchenguid
kunchenguid merged commit daaffdb into kunchenguid:main Sep 18, 2026
53 of 57 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @RooseveltAdvisors — really appreciate you taking the time on this.

Authentis added a commit to Authentis/firstmate-upstream that referenced this pull request Sep 19, 2026
Absorbs:
- daaffdb fix(bin): create captain-hold rows when Beads requires due (kunchenguid#4854)
- 1bb72cc fix: disable compact adviser for spawned agents (kunchenguid#4877)
mlim1972 added a commit to mlim1972/firstmate that referenced this pull request Sep 19, 2026
* fix(bin): create captain-hold rows when Beads requires due (kunchenguid#4854)

Captain holds have no due semantics and are a hold kind, not a Beads issue
type. The create path now waives due.required and maps to native type task.

Co-authored-by: Cursor <[email protected]>

* fix: disable compact adviser for spawned agents (kunchenguid#4877)

* feat(bin): launch every spawned agent with the compact adviser disabled

Every crewmate, scout, and secondmate Firstmate launches now starts with
COMPACT_ADVISER_DISABLE=1, on a fresh spawn and on a relaunch alike, so an
unattended session never activates the compact adviser.
The value is unconditional: no configuration file gates it and there is no
override, unlike the trace carrier beside it.

Three carriers deliver it, because no single one covers every launch shape.
The pane shell receives an export beside GOTMPDIR, so the agent's own children
inherit it too.
The launch command carries an explicit assignment, prepended outermost so it
wins over any ambient value the pane already held.
The cleared launch environment sets it again at the `env -i` boundary and keeps
COMPACT_ADVISER_DISABLE in the fixed operational floor, which is what preserves
the switch when config/launch-env-allowlist empties the environment, and what
delivers it on a remote host that never had the value.

bin/fm-control.sh relaunch, the bootstrap secondmate relaunch, and the remote
secondmate transport all rebuild their launch through bin/fm-spawn.sh, so they
inherit the same floor.
The captain's own primary session is untouched.

The two new suites drive the real spawn and then execute the launch command the
pane actually received, with the harness replaced by a probe that prints its own
environment, rather than matching script text.
They cover ship and secondmate launches with the allowlist absent and enabled,
the pane export and its ordering, fm-control.sh relaunch, and the full parent to
remote-host chain.

* no-mistakes(review): Export compact-adviser disable across compound launches

* no-mistakes(document): Document spawned-agent compact-adviser environment guarantee

* no-mistakes(document): Add missing due.required test case to captain-hold coverage list

---------

Co-authored-by: Jon Roosevelt <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Kun Chen <[email protected]>
Ye1806431561 pushed a commit to Ye1806431561/firstmate that referenced this pull request Sep 20, 2026
…id#4854)

Captain holds have no due semantics and are a hold kind, not a Beads issue
type. The create path now waives due.required and maps to native type task.

Co-authored-by: Cursor <[email protected]>
ionnich added a commit to ionnich/firstmate that referenced this pull request Sep 22, 2026