Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/fm-session-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion bin/fm-teardown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `[<id>...]` 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.
Expand Down
59 changes: 59 additions & 0 deletions tests/fm-session-start.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,38 @@ SH
chmod +x "$fakebin/tasks-axi"
}

# make_fake_task_beads_compact <fakebin>: 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 <fakebin>: 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
Expand Down Expand Up @@ -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 <<EOF
$rec
EOF
make_fake_toolchain "$fakebin"
make_fake_ps_claude "$fakebin"
make_fake_task_beads_compact "$fakebin"
printf '%s\n' beads > "$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() {
Expand Down Expand Up @@ -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
Expand Down
Loading