Skip to content

No tests for confirm gate on piReboot, backupRun, volumeBackup #95

Closed

Description

@TMHSDigital

Summary

Three of the nine confirm-gated tools have no test showing that the gate blocks execution, and no gated tool has a test for its confirm: true path. piReboot, the most disruptive tool, is one of the untested three.

Where

  • mcp-server/src/tools/__tests__/integration.test.ts:100-163 (gate tests cover only backupRestore, certRenew, nodeExec, serviceRestart, composeUp, composeDown)
  • Untested gates: piReboot.ts:17, backupRun.ts, volumeBackup.ts:19

Impact

A regression that removes or inverts the gate on piReboot, backupRun, or volumeBackup would ship unnoticed.

Suggested fix

Turn the gate tests into one table over all nine tools listed in the CLAUDE.md Security section:

  • confirm: false returns the cancelled message and execSSH is not called
  • confirm: true calls execSSH with the expected command (for piReboot, the pre-checks and then the reboot)
  • A guard test asserts that the table matches the CLAUDE.md list

Acceptance criteria

  • All nine gated tools are covered in both directions

Getting started

  • Relevant files: mcp-server/src/tools/__tests__/integration.test.ts (reuse its captureHandler and mocked execSSH), mcp-server/src/utils/confirm-param.ts
  • How to run tests: cd mcp-server && npm test

Filed by repo-audit/full-audit at 9cfe5e3. Severity: medium. Effort: S. audit-key: testing|mcp-server/src/tools/__tests__/integration.test.ts|confirm-gate

Activity

  1. added
    good first issue
    testing
    severity: medium
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueseverity: mediumtesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions