diff --git a/bin/fm-session-start.sh b/bin/fm-session-start.sh index 76d901e5af..bc73dcca57 100755 --- a/bin/fm-session-start.sh +++ b/bin/fm-session-start.sh @@ -209,7 +209,7 @@ print_backlog_tasks_axi_compact() { print_backlog_beads_compact() { local path=$1 out rc printf 'compact backlog listing (beads task store; max %s item(s))\n' "$BACKLOG_LIMIT" - out=$(task list --label "status:ready" --limit "$BACKLOG_LIMIT" 2>&1) + out=$(task list --ready --limit "$BACKLOG_LIMIT" 2>&1) rc=$? if [ "$rc" -eq 0 ]; then printf '%s\n' "$out" diff --git a/bin/fm-teardown.sh b/bin/fm-teardown.sh index dfcf4afab3..38bb35196e 100755 --- a/bin/fm-teardown.sh +++ b/bin/fm-teardown.sh @@ -585,7 +585,7 @@ backlog_refresh_reminder() { esac printf '%s\n' "Backlog: $ID just finished. Run $done_cmd, then run tasks-axi ready for dependency-cleared candidates, check date gates, and dispatch only work whose blockers are gone and date is due." elif [ "$(fm_backlog_backend_value "$CONFIG")" = beads ]; then - printf '%s\n' "Backlog: $ID just finished. The beads store has been updated with the completion status. Scan for items with status:ready and dispatch only work whose blockers are gone and date is due." + printf '%s\n' "Backlog: $ID just finished. The beads store has been updated with the completion status. Run task list --ready for dependency-cleared candidates, check date gates, and dispatch only work whose blockers are gone and date is due." else printf '%s\n' "Backlog: $ID just finished. Update data/backlog.md - move $ID to Done, keep Done to the 10 most recent, then re-scan Queued and dispatch only work whose blockers are gone and date is due." fi diff --git a/docs/configuration.md b/docs/configuration.md index 5801d11eaf..903112b97f 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -43,7 +43,7 @@ Because bootstrap requires `tasks-axi` on `PATH` on every profile, that delegati Compatible means the shared bootstrap probe accepts `tasks-axi --version` as 0.1.1 or newer, `tasks-axi update --help` exposes `--archive-body`, and `tasks-axi mv --help` exposes `[...]` for the atomic multi-ID move introduced in 0.2.2 and required by handoff delegation. That sentence is the single owner of the tasks-axi compatibility definition; every other document points here instead of restating the version gates. Bootstrap requires compatible `tasks-axi` on every profile; see "Toolchain" below for missing-tool reporting and silent default-backend behavior. -Set the local, gitignored `config/backlog-backend` file to `beads` to use the beads federated `task` store as the queue source; session-start's digest will list items with `status:ready` label from the beads store instead of `data/backlog.md`. +Set the local, gitignored `config/backlog-backend` file to `beads` to use the beads federated `task` store as the queue source; session-start's digest will list the store's native ready set (via `task list --ready`, bd's dependency-derived readiness with no manual tagging) instead of `data/backlog.md`. Beads requires the `task` CLI on `PATH` and access to the active beads store. Bootstrap validates the beads backend and reports a `MISSING:` line if the CLI is absent or the store is unreachable. Set the local, gitignored `config/backlog-backend` file to `manual` to force manual backlog editing and suppress the verbose `BOOTSTRAP_INFO: tasks-axi available` fact, not missing-tool reporting. diff --git a/tests/fm-session-start.test.sh b/tests/fm-session-start.test.sh index 9bcf04eddb..4c79e7da1a 100755 --- a/tests/fm-session-start.test.sh +++ b/tests/fm-session-start.test.sh @@ -136,6 +136,38 @@ SH chmod +x "$fakebin/tasks-axi" } +# make_fake_task_beads_compact : a fake `task` (beads) CLI whose +# `list --limit 1` (availability probe) and `list --ready` (compact listing) +# both succeed, so a regression back to the empty `--label "status:ready"` +# query is caught by asserting the exact --ready invocation and its output. +make_fake_task_beads_compact() { + local fakebin=$1 + cat > "$fakebin/task" <<'SH' +#!/usr/bin/env bash +set -u +log=${FM_FAKE_TASK_LOG:-} +[ -n "$log" ] && printf '%s\n' "$*" >> "$log" +case "$*" in + 'list --limit 1') + printf '%s\n' 'fake-ready-1' + exit 0 + ;; + *'--label '*'status:ready'*) + printf '%s\n' 'No issues found' + exit 0 + ;; + *'--ready'*) + case "$*" in *'--limit 80'*) : ;; *) printf '%s\n' 'missing compact limit' >&2; exit 9 ;; esac + printf '%s\n' 'ready-task-1' + printf '%s\n' 'ready-task-2' + exit 0 + ;; +esac +exit 1 +SH + chmod +x "$fakebin/task" +} + # make_fake_ps_claude : harness_pid()/holder_alive() (fm-lock.sh) walk # `ps` output looking for a harness command name; this fake reports EVERY # queried pid as a live `claude` harness, so the very first ancestry check @@ -1171,6 +1203,32 @@ EOF pass "unavailable or incompatible tasks-axi falls back to compact manual backlog rendering" } +test_backlog_compact_beads_uses_ready_filter_not_empty_label() { + local rec root home fakebin out log + rec=$(new_world backlog-compact-beads) + IFS='|' read -r root home fakebin < "$home/config/backlog-backend" + log="$home/task.log" + + out=$(FM_FAKE_TASK_LOG="$log" run_session_start "$home" "$root" "$fakebin:$BASE_PATH") + + assert_contains "$out" "compact backlog listing (beads task store; max 80 item(s))" \ + "beads backend did not render the compact backlog listing" + assert_contains "$out" "ready-task-1" "beads compact listing omitted a ready item from bd's native --ready filter" + assert_contains "$out" "ready-task-2" "beads compact listing omitted a second ready item" + assert_not_contains "$out" "No issues found" \ + "beads backend queried the empty status:ready label instead of bd's native --ready filter" + assert_grep "list --ready --limit 80" "$log" \ + "session start did not ask beads for its native --ready set with the bounded limit" + + pass "beads backend lists bd's native ready set, not the empty status:ready label query" +} + # --- fleet-state digest: no in-flight tasks ---------------------------------- test_fleet_digest_empty_fleet() { @@ -1404,6 +1462,7 @@ test_composition_invokes_real_scripts test_backlog_compact_tasks_axi_omits_bodies_and_keeps_metadata test_backlog_compact_manual_backend_skips_indented_bodies test_backlog_compact_tasks_axi_unavailable_uses_manual_fallback +test_backlog_compact_beads_uses_ready_filter_not_empty_label test_fleet_digest_empty_fleet test_next_step_sources_x_mode_cadence test_next_step_afk_delegates_to_daemon