Repository navigation
fix(bin): resolve blockers archived as Done in the fleet snapshot - #6451
karotkriss wants to merge 5 commits into
Conversation
|
|
Speaking as Kun's firstmate: first stamp this fetch vs tip HEAD contract-class: restore — concrete existing fleet-snapshot VISION: all align (honest holds; scripts own archive parse; restart from disk; no consent widen; scope = snapshot + hold-lifecycle docs + test count). Waiting-author: Greptile P1 on Overlap: preferred over sibling #6123 for the same #5816 (this tip has config-path + quote/# + global fallback). When this lands, #6123 will be closed as leftover. Merge note: tip edits |
| } | ||
| done_archive_path() { | ||
| local root archive | ||
| root=$(fm_backlog_root "$DATA") || return 0 |
There was a problem hiding this comment.
If Perl is unavailable, fm_backlog_root fails and this line returns without an archive path. The snapshot then reads /dev/null instead of the Done archive. A captain hold whose blocker is Done only in that archive remains incorrectly blocked, even though the snapshot otherwise supports hosts without Perl.
There was a problem hiding this comment.
Addressed in 876ccf7: done_archive_path now checks for perl up front and the snapshot exits 1 with fm-fleet-snapshot: perl not found (needed to resolve the Done archive) instead of silently reading an empty archive. The path resolution runs after argument parsing, so --help still works without perl. test_missing_perl_stops_with_a_clear_archive_error covers the failure (exit code, no JSON, exact message), --help without perl, and the same home resolving its archived blocker once perl is present.
Separately, the Behavior portable serial 2 job was cancelled by the runner (not a test failure; every other check passes). A maintainer re-run of that job would be appreciated.
|
Speaking as Kun's firstmate: restamp vs tip HEAD contract-class: restore — concrete existing fleet-snapshot VISION (per rule):
Waiting-author: please address Greptile P1 on Perl-unavailable |
|
Without Perl the snapshot already fails before the archive path is used: backlog_json pipes the backlog through fm_hold_reason_decode_stream, which calls perl, on the base commit as well. A Perl-less archive fallback would be dead code, so no change is made for this finding. |
|
Speaking as Kun's firstmate: RELOOK vs tip Contract-class: restore — concrete existing fleet-snapshot VISION (per /workspace/VISION.md):
Attestation MATCH HEAD Author rebuttal (2026-10-04T01:34Z): without Perl, snapshot already fails earlier via Still waiting-author: Greptile Review remains FAILURE with open P1 (Perl/archive). Charter keeps Greptile P1s as waiting-author; cannot auto-merge while that check fails / merge=BLOCKED. Please get Greptile to clear/retract the P1 (retrigger or resolve the thread) — no further code change required per the verified rebuttal. Firstmate-flag=no. |
…or the Done archive in the same directory tasks-axi does, even when `data` is a symlink. The new symlink test fails on the old code and passes now. **What was wrong:** tasks-axi reads `.tasks.toml` and resolves the archive path from the parent of the resolved (`pwd -P`) data directory. `done_archive_path` in `bin/fm-fleet-snapshot.sh` used `dirname "$DATA"` instead. With `home/data -> home/storage/data`, tasks-axi uses `home/storage` but the snapshot used `home`. That made it read the wrong `.tasks.toml` and archive, so a blocker archived as Done stayed blocked. `DONE_ARCHIVE` is computed once and is the only input `backlog_json` uses for archived Done ids. Fixing it there covers every place the snapshot reads the archive. **Fix (no new helper, as you asked):** - `bin/fm-fleet-snapshot.sh` now sources `bin/fm-backlog-transition-lib.sh` with its other libraries. I checked first that its function and variable names don't clash with the snapshot's. - `done_archive_path` now gets its root from `fm_backlog_root "$DATA"`, the same function tasks-axi callers use, which resolves symlinks with `pwd -P`. - If the data directory can't be resolved, it returns an empty path. `backlog_json` already treats that as an empty archive, and with no data directory there is no backlog to check anyway. - `DONE_ARCHIVE` is now set after the library is sourced. The comment above the function now names the resolved root. **Test:** added `test_symlinked_data_dir_resolves_archive_from_target_root` to `tests/fm-fleet-snapshot-view.test.sh`. It builds `data -> storage/data` and puts an archive at both `home/records/done.md` and `home/storage/records/done.md`. It checks two things: - A blocker archived under `storage` counts as resolved, so that hold shows as "live". - A blocker that only appears in the archive under `home` stays unresolved, so that hold shows as "blocked". I updated the expected test count in `.github/workflows/ci.yml` from 22 to 23. **Verification:** - With the old `dirname` line put back, the new test fails. - With the fix, `tests/fm-fleet-snapshot-view.test.sh` passes all 23 tests. - `shellcheck -x` passes on the changed script and test. - The other snapshot-related test suites all pass: `fm-bearings-snapshot` (60), `fm-fleet-ledger` (10), `fm-bearings-board` (18) and `fm-fleet-sync` (27). Nothing is committed yet. The diff covers only `bin/fm-fleet-snapshot.sh`, `tests/fm-fleet-snapshot-view.test.sh` and `.github/workflows/ci.yml`
…sing for the Done archive lookup
884c448 to
876ccf7
Compare
|
Speaking as Kun's firstmate: re-look at head Thanks @karotkriss. The Perl finding is handled: contract-class: restore. Fleet-snapshot VISION: one captain, one interface: aligns (holds show honestly) · authority: aligns (read-only, no new autonomy) · scripts/agents: aligns (scripts parse the archive) · restart: aligns (disk records) · delegation: n/a · vendor: n/a · scope: aligns (snapshot, docs, tests; the ci.yml change only bumps the test count 18→24). CI: every job passed except |
|
CI status on head 876ccf7, which is unchanged across three CI runs: every job has passed on it at least once.
The only non-green results are runner cancellations of Could a maintainer re-run the cancelled |
|
Speaking as Kun's firstmate: thanks @karotkriss for the clear CI rundown, and sorry this has bounced off runner timeouts for so long. The head is unchanged at Contract-class: restore, as before. Fleet-snapshot Waiting on CI, not on you. If a re-run comes back green, this squash-merges, and the sibling #6123 gets closed as the leftover. |
Intent
Fixes #5816
Bearings and the fleet snapshot keep a captain-held item blocked after its blocker is done, once backlog retention moves that Done blocker into the Done archive.
bin/fm-fleet-snapshot.shresolves ablocked-by:edge only from structured Done rows indata/backlog.mdand never readsdata/done-archive.md, so the dependent shows as blocked whiletasks-axialready treats it as unblocked.The snapshot should also treat a blocker id recorded as Done in the configured Done archive as resolved.
A
blocked-by:id that exists in neither the backlog nor the archive stays unresolved, as today.What Changed
bin/fm-fleet-snapshot.shnow treats ablocked-by:id as resolved if it is a structured Done record in the backlog or a checked- [x] <id> - ...row in the Done archive. A held item no longer shows as blocked after its blocker is moved into the archive. Ids that appear in neither place still stay unresolved.archivekey under[markdown]in the home's.tasks.toml, then in~/.tasks-axi/config.toml, and otherwise falls back todata/done-archive.md. Relative paths are resolved from the parent of the resolved data directory (fm_backlog_root, now sourced frombin/fm-backlog-transition-lib.sh), so a symlinkeddatadirectory works. Ifperlis missing, the snapshot stops with a clear error instead of quietly reading the archive as empty.tests/fm-fleet-snapshot-view.test.sh. They cover archived, live and dangling blockers, archive paths set in.tasks.tomland in the global config, quoted paths that contain#, a symlinked data directory, and the missing-perlerror. The CI test count goes from 18 to 24, anddocs/captain-hold-lifecycle.mdnow describes the archive lookup.Risk Assessment
✅ Low: The change adds a narrowly scoped, read-only lookup of the Done archive that has a single caller and behavioral tests for the default, configured, quoted, global-config and symlinked archive paths, and dangling ids stay unresolved as the intent requires. The only remaining concern is that the snapshot now fails outright without perl, which the author chose deliberately and the user has capped as a theme.
Testing
I built two disposable lab homes with fm-lab-home.sh and filled them using the real tasks-axi through fm-tasks-axi.sh: mark a blocker Done, then prune it into the archive. I ran the base and target fleet snapshot and bearings snapshot against those homes. On base, the hold whose blocker was archived stayed in gates as blocked; this reproduces #5816. On target it moves to decisions_open with hold_bucket "live", which matches tasks-axi. The same result holds with a configured .tasks.toml archive path and a symlinked data directory. Adversarial cases stay blocked as intended: a dangling id, a blocker archived unfinished, and an archived id re-filed as live work. The targeted snapshot-view test file also passes, but that is a unit-level suite, so it is recorded as untested for live validation. The evidence is CLI transcripts; there is no UI to screenshot because bearings output is text. The lab homes and the base copy were removed, and the worktree is clean.
Evidence: Bearings on base 4735ddc - archived-blocker hold wrongly in gates (blocked)
Source: Bearings on base 4735ddc6 - archived-blocker hold wrongly in gates (blocked)
Evidence: Bearings on target 876ccf7 - archived-blocker hold in decisions_open, dangling hold still gated
Source: Bearings on target 876ccf7 - archived-blocker hold in decisions_open, dangling hold still gated
Evidence: Lab fixture written by real tasks-axi (backlog, done-archive.md, tasks-axi ready)
Source: Lab fixture written by real tasks-axi (backlog, done-archive.md, tasks-axi ready)
Evidence: Configured .tasks.toml archive + symlinked data dir, base vs target
Source: Configured .tasks.toml archive + symlinked data dir, base vs target
Evidence: Adversarial: re-filed archived id, archived-unfinished blocker, dangling id
Source: Adversarial: re-filed archived id, archived-unfinished blocker, dangling id
Evidence: Snapshot hold records, base vs target
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-fleet-snapshot.sh:175- Reported under the archive-root cap, not as a new fix round.done_archive_pathnow requires perl, andDONE_ARCHIVE=$(done_archive_path) || exit 1(line 353) makes the whole snapshot exit 1 when perl is missing. That happens before any backlog is read, even for homes with no archive, no.tasks.toml, and noblocked-by:edges. Every snapshot consumer (bearings, fleet view) therefore loses its output on a perl-less host. Before this change only the archive lookup degraded, and the rest of the snapshot already treats perl as optional (line 1692 guards it). This is wider than the round-2 instruction, which was to fall back to(cd "$DATA" && pwd -P)whenfm_backlog_rootfails. It is also a deliberate, tested choice in 876ccf7, and round 3 declined further work on this theme. Recording it so a human can confirm that the hard failure across the whole snapshot is intended.✅ **Test** - passed
✅ No issues found.
bin/fm-lab-home.sh createx2 to make disposable FM_HOMEs; seeded both throughbin/fm-tasks-axi.sh add/block/hold/start/done/prune --keep 0(real tasks-axi)bin/fm-tasks-axi.sh ready --include-held: checked that tasks-axi already treats the archived-blocker hold as unblockedBase (git archive 4735ddc6 bin) vs targetbin/fm-fleet-snapshot.sh --json, jq projection of the held records' unresolved_blocker_ids, hold_bucket and captain_actionableBase vs targetbin/fm-bearings-snapshot.sh(captain-facing view): decisions_open vs gatesLab withdata -> storage/datasymlink andstorage/.tasks.toml[markdown] archive = "records/done.md", plus a decoyrecords/done.mdat the unresolved rootAdversarial: archived-Done id re-filed as queued in the backlog; blocker archived unfinished viatasks-axi prune --state queued; dangling id with its row hand-removedbash tests/fm-fleet-snapshot-view.test.sh(targeted suite incl. new archive tests, 0 failures)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.