Repository navigation
Conversation
|
…rsor The secondmate home-summary refresh re-folded every task's whole status log twice per refresh - once in fm-fleet-snapshot.sh's task assembly and once in fm-crew-state.sh's status_current_line - so a home with long secondmate logs blew the 60-second refresh deadline on every attempt, and crew-state reads that hit their own bound published those secondmates as unknown. status_open_decisions now accepts the live log (and an optional captured copy of its cursor) and starts from the wake drain's persisted open-decisions cursor when that cursor provably covers a line-aligned prefix of the same file, folding only the bytes after it. The cursor is read, never written, so the drain keeps sole ownership of its advancement. Any version, kind, identity, size, or boundary mismatch falls back to the whole-stream fold, so the published summary is unchanged for the same inputs. The snapshot captures each cursor before the status copy it covers, so the cursor can never run past the captured end, and passes both to crew-state and to its own fold. The cursor parser is shared with the incremental fold. Fixes kunchenguid#6257
…fault effective verbs while preserving default cursors; failed cursor copies fall back without blocking publication; tests assert byte-identical cursor preservation. Reproduced the verb mismatch before fixing it. Home-summary, wake-drain cursor, and decision-key suites pass, along with syntax checks and ShellCheck excluding source-resolution notices. Left ci-1/ci-2 unchanged
…r version The previous fix appended non-default resolution and captain-held verbs to the open-decisions cursor version, but status_open_decisions_cursor_offset still built the bare `<n>:<kind>` string. A home with no presentation manifest reads that cursor as its presented offset, so with configured verbs the version never matched, the offset reset to zero, and the wake drain replayed already-presented status. The legacy reader now builds its version through _fm_open_decisions_fold_version with the effective verbs, the same owner every cursor writer and reader uses.
ac12f39 to
671d922
Compare
| fold_version=$(_fm_open_decisions_fold_version "$(_fm_status_kind "$f")" \ | ||
| "${FM_CLASSIFY_RESOLVE_VERB:-$FM_CLASSIFY_RESOLVE_VERB_DEFAULT}" \ | ||
| "${FM_CLASSIFY_CAPTAIN_HELD_VERB:-$FM_CLASSIFY_CAPTAIN_HELD_VERB_DEFAULT}") |
There was a problem hiding this comment.
Presented status gets replayed If a home has an open-decisions cursor but no
.status-presentation-cursor, changing FM_CLASSIFY_RESERVED_KEY_PREFIXES makes this reader reject the old cursor version and return offset zero. The next wake drain then presents notes and pending-reply resolutions that were already delivered. Refolding decisions under the new prefixes should not also rewind the presentation offset.
Knowledge Base Used: Watch and wake workflows
|
Speaking as Kun's firstmate: thanks @luigia for this, and for the detailed cursor work and live evidence. #6257 was fixed by #7376, which landed on main today as If your change covers something #7376 does not, please reopen it and say what that is. One possible case: #7376 notes that collection cost still grows with status-log history, which is what your cursor-seeded tail fold targets. If you can show that cost on current main, I'll look again. |
Intent
Fix the home-summary refresh that keeps failing.
On this firstmate home,
bin/fm-home-summary-refresh.shhas exceeded its 60-second deadline on every attempt since 2026-10-01 (318+ recorded failures in state/.home-summary-refresh.log); a manual run with a longer bound took about 2m03s wall, 84s CPU.The bound must not simply be raised: the bootstrap-diagnostics guidance says to fix the blocked phase rather than raise this load-bearing bound.
Upstream issue #6257 reports the same failure and its measured cause:
fm-fleet-snapshot.sh --secondmate-home-summaryruns the fullstatus_open_decisionsfold over each task's whole status log on every refresh instead of the incremental cursor-backedstatus_open_decisions_incrementalpath, andprefetch_task_observationsplus per-task JSON assembly are the other large cost (42s even with status logs cut to 60 lines).The refresh should stay well under its deadline as status logs grow, with identical published output.
What Changed
Risk Assessment
✅ Low: The read-only cursor optimization preserves whole-log fallback and publication ownership, and all cursor consumers consistently validate the effective fold configuration.
Testing
Targeted checks and isolated live CLI scenarios passed. Six tasks with 20× longer histories refreshed in 2.19 seconds, preserving published output and cursor bytes. Initial fixture-location and drain-setup timeout issues were corrected before successful reruns; JSON publications, timings, and comparison evidence were saved.
Evidence: Live refresh timings and observed decisions
Source: Live refresh timings and observed decisions
Evidence: Published long-history home summary
Source: Published long-history home summary
Evidence: Publication byte comparisons
Source: Publication byte comparisons
Evidence: Reproducible live scenario driver
Source: Reproducible live scenario driver
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
bin/fm-classify-lib.sh:1217- Cursor validity omits FM_CLASSIFY_RESERVED_KEY_PREFIXES, although _fm_decision_key_transition_allowed uses it to determine the folded set. For example, drain a secondmate log containingneeds-decision [key=secret-choice]: choosewith prefixespending-reply- secret-: the cursor excludes that decision. Refresh with default prefixes and no new appends: the seeded fold accepts the same version and publishes no decision, whereas the previous whole-log fold includes secret-choice. Include the effective reserved-prefix configuration in the shared cursor version so differing configurations fall back to the whole-log fold.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-open-decisions-prefix-cursor.test.shbash tests/fm-home-summary-refresh.test.sh— passed after correcting the temporary fixture locationbash tests/fm-wake-drain-unread-status.test.shpython3 ~/.no-mistakes/evidence/01M40XNNXBW3XW8EWKNWVK61ST/live-refresh.py— real wake-drain and refresh executables, without stubsCompared saved published JSON byte-for-byte across seeded, whole-log, and invalid-cursor refreshes; removed transient worktree fixtures✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.