Skip to content

fix(command-ops): add freshness gate before reusing captain workspace - #38

Merged
tu11aa merged 1 commit into
developfrom
fix/command-ops-freshness-check
May 4, 2026
Merged

fix(command-ops): add freshness gate before reusing captain workspace#38
tu11aa merged 1 commit into
developfrom
fix/command-ops-freshness-check

Conversation

@tu11aa

@tu11aa tu11aa commented May 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Inserts an explicit freshness-check step into the command-ops delegation workflow so a name-matched captain workspace isn't reused on a new day.
  • The check reads ~/.config/cockpit/sessions.json and compares lastLaunched to today; on stale, command closes the workspace and respawns via spawn-workspace.sh (which already logs ↻ new day — starting fresh session).
  • Renumbers the trailing "Report back" step from 5 → 6 to accommodate the new gate.

spawn-workspace.sh already handled new-day freshness correctly; the bug was that command-ops/SKILL.md could bypass it whenever step 2 (list-workspaces) found a matching name. This PR closes that gap by making the freshness check part of the delegation contract.

Fixes #37

Test plan

  • On a new day with a captain workspace left over from a previous session, run delegation and confirm the freshness gate produces stale and triggers a respawn.
  • Same-day reuse case: confirm the gate produces fresh and the existing workspace is reused without respawn.
  • No sessions.json entry for the captain (first-ever launch path): confirm the gate treats it as stale so step 4 spawns cleanly.

A name-matched cmux workspace was treated as sufficient to send work
into, which caused command to resume a stale captain session on a new
day. spawn-workspace.sh already handles new-day freshness, but the
delegation workflow could bypass it whenever an existing workspace
matched by name.

Insert an explicit step 3 freshness gate that compares
sessions.json[captainName].lastLaunched to today, and require a
close + respawn when stale so spawn-workspace.sh's "new day" path runs.

Fixes #37
@tu11aa
tu11aa merged commit ceb30d6 into develop May 4, 2026
@tu11aa
tu11aa deleted the fix/command-ops-freshness-check branch May 4, 2026 03:06
@tu11aa tu11aa mentioned this pull request May 5, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

command-ops skill missing freshness check — stale captain sessions get reused on new day

1 participant