fix(bin): read the configured tasks-axi backlog in the fleet snapshot - #6349
Open
KhalilouKarl wants to merge 9 commits into
Open
KhalilouKarl wants to merge 9 commits into
KhalilouKarl wants to merge 9 commits into
Conversation
…acklog owner Add fm_backlog_rows_json beside fm_backlog_row_list: one bounded list read with a count-driven re-read, a strict table decoder and the tasks-axi link grammar, returning an error object instead of an empty inventory.
…view and bearings A home whose tasks-axi backend is not markdown had its backlog read from the empty data/backlog.md next to it, so the snapshot reported no work and a valid inventory. The snapshot now reads the adapter through the shared reader, and an unavailable, malformed or incomplete read is present:false with a diagnostic that main_inventory reports instead of an empty valid backlog.
…r and captured output
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
…mpty response, escape pipes - fm_backlog_rows_list_once runs tasks-axi list with TASKS_AXI_FILE cleared, like bin/fm-tasks-axi.sh. - The count: 0 branch accepts only the full captured empty response (tasks line plus help block). - Fixture helpers unset TASKS_AXI_FILE so fixtures stay isolated. - The fleet view escapes | in the raw ambiguous link value. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tasks-axi done --pr links a PR without checking merge state, so a closed row with a PR link proves closure and an artifact, not a merge. Keep the row, link and close date; leave the completion verb unset so it is not reported as landed. Explicit Markdown merged metadata is unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
yes do it and make sure our self-improvement worker looks at such things and optimizes them until we get the best solution
are we not using beads? I see the same beads open and in progress and blocked since a few days?
also go through every blocked bead and see if we still need it if its still blocked or if we can resolve it. also how is our selfimprovement system working give me an honest answer
The fleet-friction finding selected from that audit is that this Firstmate home uses Beads through tasks-axi, but the fleet overview reads a Markdown file instead and presents an empty, valid backlog while the configured queue contains real work. This slice repairs that misleading overview as part of the standing self-improvement order.
Decisions and constraints already made for this slice (so they are not mistaken for surprises in the diff): the structured fleet snapshot reads the configured backend through the existing shared backlog owner (bin/fm-backlog-transition-lib.sh, fm_backlog_rows_json) with exactly one bounded
tasks-axi listand at most one count-driven re-read, no per-row show reads, no direct Beads command and no new dependency or general TOON framework; the strict table decoder accepts only the observed tasks-axi 0.2.5 envelope and treats an absent, unreadable, malformed or incomplete adapter output as a "Backlog unavailable" diagnostic through the existing main_inventory consumer, never as a valid empty inventory; links are read with the installed adapter's own first-match grammar with strict full consumption, and a cell that cannot be consumed keeps links_raw, withholds parsed artifacts and is disclosed through main_inventory; truncated titles keep the raw cell and render with an ellipsis; markdown and manual backends keep their existing behavior byte for byte. Local evidence includes the real installed tasks-axi and Beads adapter in isolated fixture homes with a guarded br and refusing endpoint stubs (tests/fm-fleet-snapshot-view.test.sh), captured real adapter output as a supplement, and red-on-base then green evidence. The session-start digest has a separate backlog path that is deliberately not changed here. tests/fm-contributions.test.sh already fails identically on the unmodified base (watcher did not surface the new contribution signal) and is not part of this change. Test and fixture homes must be isolated throwaway FM_HOME values, never the inherited live fleet home. Deliver through the mandatory no-mistakes fork workflow; upstream merge authority stays off.What Changed
bin/fm-fleet-snapshot.sh) now reads a non-markdown tasks-axi/Beads backlog through the shared backlog owner (fm_backlog_rows_jsoninbin/fm-backlog-transition-lib.sh) instead of an empty Markdown file. A strict decoder accepts only the observed tasks-axi 0.2.5 table envelope. Absent, unreadable, malformed or incomplete adapter output is reported as a "Backlog unavailable" diagnostic throughmain_inventory, never as a valid empty backlog. Rows that carry links the adapter grammar cannot fully consume keeplinks_raw, withhold parsed artifacts and are disclosed throughmain_inventory. Truncated titles keep the raw cell and render with an ellipsis. Markdown and manual backends are unchanged.bin/fm-fleet-view.shrenders "Backlog unavailable: …" in the Queued and Done sections and showslinks ambiguous: <raw>in the Artifact column.bin/fm-bearings-snapshot.shsurfaces a count of backlog rows with ambiguous artifact links.docs/architecture.mdanddocs/documentation-audiences.jsondescribe the configured backlog backend.tests/fm-fleet-snapshot-view.test.shadds coverage in isolated throwaway fixture homes, running against the installed tasks-axi/Beads adapter with a guardedbrand refusing endpoint stubs. It also covers hold-reason decode parity. Real captured tasks-axi 0.2.5 output is added undertests/captures/tasks-axi-0.2.5/as a supplement.Risk Assessment
✅ Low: The rebase resolution keeps upstream's markdown hold-reason decode and pipefail unchanged, and the adapter path is bounded and fails loudly as a "Backlog unavailable" diagnostic rather than an empty inventory. The new tests drive the real adapter and captured output, so I found no concrete defect or intent violation. I only read the diff and call sites and did not run any tests.
Testing
I re-drove the round-1 failure against the real installed tasks-axi 0.2.5 and Beads (br) in an isolated throwaway home. The Beads snapshot's
hold_reasonis nowPick (A) or (B)\n100% sure?, matching the markdown home's decoded value.tests/fm-fleet-snapshot-view.test.shpasses in full, including the new adapter-path decode assertion.tests/fm-captain-hold-lifecycle.test.shcould not run here: the installed tasks-axi 0.2.5 is below the 0.2.6 floor inbin/fm-tasks-axi-lib.sh, sobin/fm-captain-hold.shrefuses. This branch touches neither file, and the markdown hold-reason path is covered by the markdown probe instead.Evidence: Encoded hold reason after fix (Beads home)
Source: Encoded hold reason after fix (Beads home)
Evidence: Markdown parity probe after fix
Source: Markdown parity probe after fix
Evidence: Targeted test run
Source: Targeted test run
Evidence: Round-1 failing probe output (before fix)
Source: Round-1 failing probe output (before fix)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 1 issue found → auto-fixed ✅
bin/fm-fleet-snapshot.sh- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Review** - passed
✅ No issues found.
🔧 **Test** - 2 issues found → auto-fixed ✅
bin/fm-fleet-snapshot.sh:497- The rebase resolution assumed hold reasons fromtasks-axi listare already plain decoded text, so the adapter path skipsfm_hold_reason_decode_stream. That premise is false for real Beads.bin/fm-captain-hold.shstores reasons encoded asfm-hold-v1:<base64>, andtasks-axi list --fields hold_reasonreturns that string unchanged. On a real Beads home with a held captain row, the snapshot's.backlog.records[].hold_reasonand the fleet view both showfm-hold-v1:UGljayAoQSkgb3IgKEIpCjEwMCUgc3VyZT8=. The same reason in a markdown home decodes toPick (A) or (B)\n100% sure?. The captain therefore sees an opaque string for the very case fix(bin): preserve hold reasons and reject invalid completion inventories #6331 introduced the encoding for: reasons containing parentheses, line breaks or percent signs.tests/fm-fleet-snapshot-view.test.shonly covers a plain reason with a comma, so it passes. This conflicts with the recorded rebase decision (3), which says not to decode adapter records. The decision rests on that wrong premise. A single decode of the adapter records'hold_reasonis idempotent for plain text (decode_reasonreturns unmarked values unchanged), so decoding does not corrupt plain reasons. Decide whether to applyfm_hold_reason_decode_stream jsonto the adapter output as well, or accept the encoded display. Reproduce withevidence/.../probe-encoded-hold.sh.test_hold_reason_round_trips_awkward_characters) still passes with the merged codebash tests/fm-fleet-snapshot-view.test.sh(22 ok, 0 failures: real tasks-axi/Beads adapter reaches snapshot, view and bearings; unavailable, unreadable and empty adapter backlogs are told apart; link cells; bounded reads; markdown homes untouched)bash evidence/.../probe-encoded-hold.sh: live probe on an isolated throwaway real Beads home (brandtasks-axi0.2.5) with anfm-hold-v1-encoded captain-hold reason; snapshot and fleet view show the raw encoded textbash evidence/.../probe-markdown-hold.sh: live probe on an isolated markdown home; the snapshot decodes the same encoded reason correctly (markdown behaviour kept)Trimmed copy oftest_hold_reason_round_trips_awkward_charactersfromtests/fm-captain-hold-lifecycle.test.sh: could not run, because upstream requires tasks-axi >= 0.2.6 and 0.2.5 is installed (fm-captain-hold: compatible tasks-axi is required). Not caused by this change; the temporary copy was removed.🔧 Fix applied.
✅ Re-checked - no issues remain.
bash evidence/.../probe-encoded-hold.sh: isolated real Beads home,tasks-axi holdwith an fm-hold-v1 reason, thenbin/fm-fleet-snapshot.sh --jsonandbin/fm-fleet-view.shbash evidence/.../probe-markdown-hold.sh: the same reason in a markdown home, as the parity baselinebash tests/fm-fleet-snapshot-view.test.sh: all cases pass, including the new encoded-hold assertion, the real tasks-axi/Beads backlog case, the unavailable/unreadable/empty cases and the link-cell casebash tests/fm-captain-hold-lifecycle.test.sh: fails on this host withfm-captain-hold: compatible tasks-axi is required✅ **Document** - passed
✅ No issues found.
🔧 No changes applied.
1 warning still open:
🔧 No changes applied.
1 warning still open:
🔧 Fix applied.
1 warning still open:
✅ **Push** - passed
✅ No issues found.
Author notes: manual evidence and limitations (added after PR open)
These notes are the author's, not output of the no-mistakes pipeline. Each result names the head it was run on.
fm-lint.sh: ShellCheck not found). That finding was approved (no--yes, no skip) on the strength of a manual run, which is separate evidence and not the pipeline's verdict. At971194e5, in a clean clone,PATH=<pinned linters>:$PATH bin/fm-lint.shexited 0 (ShellCheck 0.11.0, actionlint 1.7.12, 3 workflow files) and--list-filesselectedbin/fm-backlog-transition-lib.sh,bin/fm-bearings-snapshot.sh,bin/fm-fleet-snapshot.sh,bin/fm-fleet-view.shandtests/fm-fleet-snapshot-view.test.sh. The same manual run exited 0 at339cf840and at the current headcacf2272.bin/fm-captain-hold.shCLI. The installed tasks-axi is 0.2.5, belowFM_TASKS_AXI_MIN0.2.6, sofm-captain-hold.shrefuses to run.test_adapter_hold_reasons_decode_like_markdownstores the reason with the owner encoder (fm_hold_reason_encode) and the realtasks-axi holdon a real Beads home (it printsowner: encoder). The real owner route and the full real-owner hold lifecycle are untested on this host.tests/fm-captain-hold-lifecycle.test.shfails on this host. At971194e5: exit 1,not ok - hold refused the reason for sample-reason-call,fm-captain-hold: compatible tasks-axi is required. The identical failure occurs on the unmodified upstream base6af83310. That is baseline evidence only; it does not show the absence of a coexisting regression, because the suite cannot exercise this change here. Likewisetests/fm-contributions.test.shfails on the base and on this change; its cause is not established by these notes.971194e5:fm-fleet-snapshot-viewexit 0 (23 ok),fm-bearings-snapshotexit 0 (58 ok).339cf840:fm-fleet-snapshot-viewexit 0 (27 ok).cacf2272:fm-fleet-snapshot-viewexit 0 (27 ok).fm-bearings-snapshotwas not re-run after971194e5.339cf840fixed the inheritedTASKS_AXI_FILE(adapter read and test fixtures), the incomplete empty response and|in an ambiguous link value, each with a regression test that fails on the previous code.cacf2272fixes the "PR link mistaken for merge" finding: tasks-axi records no merge state (done --prlinks a PR without checking it), so an adapter row closed with a PR link keeps its closed state, close date, PR link and raw data but is no longer labelledmerged. The regressiontest_adapter_backlog_reaches_snapshot_view_and_bearingsfails on339cf840code and passes oncacf2272; the Markdown control still reports an explicitly merged row asmerged.cacf2272("Shipped PRs disappear"). Because the landed selector requires amergedverb for rows with a PR link, ordinary adapter-backed shipped work (closed byfm-teardownwithdone --pr) does not appear in Recently Landed in the fleet snapshot and Bearings. This is the deliberate trade of limited truthful coverage over a false merge claim. A verified-merge signal for adapter rows (a tasks-axi field or a merge check at teardown) is not part of this change.CIandRequire no-mistakesworkflow runs showaction_required(fork-PR workflow approval by a maintainer); they have not run. No upstream merge is requested or implied.