Skip to content

[audit] SAFETY: destructive-verb --yes gate misses hyphenated compound verbs (workspace-remove, remove-schedule do irreversible deletes with no confirmation) #285

Closed

Description

@scttfrdmn

Filed from the 2026-07-11 spawn audit. Full report: docs/spawn-audit-2026-07-11.md. Assessment-only — no code changed yet.

Phase: Phase 0 — do now (safety)

Evidence

  • cmd/flag_conventions_test.go:45-53 — isDestructive() switches on exact cobra c.Name()
  • cobra Name() returns the first whitespace token of Use, so Use:"workspace-remove" (cmd/bot.go:583) → Name()="workspace-remove", never matches "remove"
  • cmd/bot.go:583→599-604 workspace-remove performs a DynamoDB delete with no --yes and no prompt
  • cmd/autoscale.go:172→1230 remove-schedule deletes a scheduler entry with no --yes and no prompt
  • workspace-destroy IS already gated (dry-run/--confirm) — not part of this bug

Recommendation
Fix isDestructive() to match the last hyphen-segment of the verb (or regroup so leaf Name() becomes remove/destroy), then ADD --yes + interactive prompt to both workspace-remove and remove-schedule. The gate fix + adding --yes is NOT a rename.

User-facing / SemVer: Not user-facing (gate + prompt only). No SemVer bump. The subgroup-rename option, if chosen, is user-facing — track under the grouping issues.

Adversarially verified during the audit (62/62 findings survived verification; severities/scope adjusted where the first pass was wrong).

Activity

  1. added
    bug
    area:lifecycle
    audit:2026-07
    on Jul 11, 2026
  2. added a commit that references this issue on Jul 12, 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

    area:lifecycleaudit:2026-07bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions