Skip to content

bug(#830): watch next-gen — P0/P1 issues found in post-merge review #834

@diberry

Description

@diberry

Post-Merge Review Findings for PR #830

PR #830 (Watch Next-Gen) merged with strong architecture but several issues that need follow-up fixes.

P0 — Must Fix

  1. CLI flags not wired to config — --notify-level, --overnight-start/end, --sentinel-file\ are parsed from args but never passed to \loadWatchConfig(). These flags have no effect at runtime. Fix: add them to the \cliOverrides\ object.

  2. \isProcessAlive()\ EPERM bug — On Unix, \process.kill(pid, 0)\ throws EPERM when the process exists but caller lacks permission. Current code treats any error as 'dead'. Fix: check \�rror.code === 'EPERM'\ → return true (alive).

P1 — Should Fix

  1. Path traversal in WorktreeBackend
    elativePath\ parameter in
    ead()/\write()\ is not validated for ..\ segments. Fix: validate or scope the FSStorageProvider.

  2. Auth status stderr parsing — \gh auth status\ writes to stderr even on success. \�xecFileSync\ only returns stdout → auth drift detection broken. Fix: use \spawnSync\ or \gh api user -q .login.

  3. *\invokeFleet()\ ignores --agent-cmd* — Fleet dispatch hardcodes 'copilot'\ instead of using \config.agentCmd. Breaks environments using wrapper commands.

  4. --state-backend\ not validated — Invalid values are saved to config and silently fall back at runtime. Fix: validate upfront against allowed values.

  5. SDK console.log — \github.ts:249\ logs directly to stdout. SDK should return status; CLI decides how to log.

P2 — Nice to Have

  1. BOM characters in cleanup.ts and cleanup-ceremony.md
  2. Changeset docs say PID in .squad/\ but implementation uses \os.tmpdir()\
  3. No integration tests for end-to-end watch flow
  4. Fleet dispatch has no tests

Copilot Comment Validity

11/12 Copilot comments were valid — very high signal-to-noise ratio on this PR.

Priority: P0 items should be fixed ASAP — users setting CLI flags will get no behavior change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions