Skip to content

future-proofing: apply session-aware risk tiers if cleanup actions are ever added to companion skills #1

@lswingrover

Description

@lswingrover

Context

A companion fix was shipped to lswingrover/MacWatch (issue #1, PR #2) that overhauled the macwatch-diagnose and macwatch-act skills to apply session-aware risk tiers before recommending /tmp/*.py file cleanup.

The core principle: idle Cowork sessions are not dead sessions. They can be dormant between polling cycles and own scripts in /tmp/ that they will attempt to execute at any time. A check for "is a Python process running this file right now" is not sufficient — you also need to ask list_sessions and evaluate file age and naming patterns before flagging anything for deletion.

NetWatch Status

The current netwatch-diagnose skill is purely diagnostic — it reads incident bundles and connector snapshots and produces a root-cause analysis. It does not currently recommend deleting local files or killing processes.

No code changes are needed today.

Why Track This

If NetWatch companion skills ever gain cleanup or remediation actions (a netwatch-act equivalent, or cleanup recommendations in netwatch-recommend), they should inherit the same session-aware risk model from day one rather than having to be patched after the fact.

If/When This Becomes Relevant

Apply the following principles to any NetWatch skill that recommends deleting or modifying local files:

  1. Call list_sessions before any cleanup recommendation
  2. Tier files by age and name pattern:
    • Auto-safe: older than 24h, no owning session
    • Review-only: modified today, live-sounding names (fetch, sync, poll, update, monitor, bg_, processor, watcher)
    • Never touch: modified in last 2h, currently executing
  3. Never say "safe to delete" about a file modified the same day
  4. Clarify disk impact — if the savings are negligible, say so

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions