2.9 KiB
2.9 KiB
H1b — tmux pane idle signal wiring
Objective
Feed classifyReadiness() a real idle signal on tmux 3.4 by deriving idleSeconds from the first available tmux timestamp source: pane activity, then window activity, then session activity.
Scope
packages/mosaic/src/commands/fleet.ts- Extend
buildTmuxListPanesCommand()format to include#{window_activity}and#{session_activity}after the existing fields. - Update
parseTmuxListPanes()to choose the first non-empty finite positive timestamp and clamp future idle values to 0.
- Extend
packages/mosaic/src/commands/fleet.spec.ts- Cover pane/window/session activity parsing behavior, empty-field index alignment, null idle, future clamping, math correctness, and exact tmux format.
Out of Scope
- No changes to
classifyReadiness(), thresholds,AgentPsRow, orfleet psrendering. - No merge by worker; orchestrator routes review/merge.
- Workers do not modify
docs/TASKS.md.
PRD Alignment
Aligned with docs/fleet/PRD.md FR-1 and acceptance criteria for truthful mosaic fleet ps pane/pid/idle observability.
Plan
- Sync branch from latest
origin/mainand install dependencies with required pnpm env. - Add/confirm reproducer tests for tmux 3.4 empty
pane_activityand new fallback behavior. - Implement the focused parser/format change only.
- Run required build, baseline gates, fleet vitest, and independent review.
- Run pre-push queue guard, push branch, and open PR to
mainwith Mosaic wrapper.
Progress
- 2026-06-24: Branch
fix/fleet-pane-idle-activitycreated fromorigin/main@ec8dd7cafter fetching. - 2026-06-24: Session-start generated local
.mosaic/orchestrator/*changes on the previous release branch; stashed ascoder1 session-start state before H1bto keep this branch clean. - 2026-06-24: Added TDD coverage for the tmux 3.4 production case (
pane_activityempty,window_activitypopulated), exact new list-panes format, null/future/multiple-source behavior. - 2026-06-24: Implemented parser fallback without changing readiness classifier thresholds or render shape.
Verification Evidence
pnpm install --store-dir "$HOME/.pnpm-store"— pass.- Reproducer before implementation:
pnpm --filter @mosaicstack/mosaic exec vitest run src/commands/fleet.spec.ts— failed as expected (old format, no fallback, negative future idle). npx turbo build --filter=@mosaicstack/mosaic^...— pass, 12/12 tasks successful.pnpm typecheck— pass, 41/41 tasks successful.pnpm lint— pass, 23/23 tasks successful.pnpm format:check— pass, all matched files use Prettier style.pnpm --filter @mosaicstack/mosaic exec vitest run src/commands/fleet.spec.ts— pass, 176 tests.~/.config/mosaic/tools/codex/codex-code-review.sh --uncommitted— approve, 0 findings (reviewed supplied diff; sandbox file-inspection limitation noted by tool).
Risks / Blockers
- No current blocker.