Skip to content

Replace mutation plan tokens with gog-style dry-run and confirmation UX #201

Closed

Description

@KalebCole

Decision

Delete the mutation plan-token workflow and replace it with the same operator model used by gog:

  • one command performs the mutation
  • --dry-run prints the intended action without mutating
  • destructive commands prompt on an interactive terminal
  • --force skips that destructive confirmation
  • --no-input never prompts and fails when confirmation is required

There should be no --apply, --plan, plan token, five-minute expiry, or second invocation.

Why

The current workflow makes ordinary writes needlessly difficult. A caller submits the full mutation, receives a short-lived token, then submits the same mutation again with --apply --plan. Event creation is worse because the second command still needs every original flag.

That ceremony did not make the failed RSVP cleanup safer. It made the operation harder to run and harder to debug.

The CLI should validate the request, read any required remote state, show a preview when asked, and perform the approved write once. Cross-process plan storage is not needed for that.

gog behavior used as the reference

Research was done against openclaw/gogcli commit 2c636ba7dce06acf09b6ba1f0650e00cb95edecf and the installed gog v0.35.0.

This issue copies the interaction model, not gog's output casing or internal package layout.

Current affected commands

The v3 schema marks these commands as plan-required:

  • blasts.send
  • cohosts.invite
  • cohosts.link.create
  • cohosts.link.revoke
  • cohosts.remove
  • cohosts.revoke-invite
  • events.cancel
  • events.create
  • events.update
  • guests.invite
  • rsvp.set

The fix must cover the whole class. Do not ship an event-create-only exception.

Required UX

Ordinary and externally visible writes

Run once:

partiful events create --title "Example" --start "2026-09-20T18:00:00-07:00" --timezone America/Los_Angeles
partiful events update <event-id> --title "New title"
partiful rsvp set <event-id> --status not-going --display-name "Example" --party-size 1 --timezone America/Los_Angeles
partiful guests invite <event-id> --contact "Example"
partiful blasts send <event-id> --audience all-guests --message-file ./message.txt

These commands validate and dispatch in one invocation. They do not require a second confirmation token.

Preview

partiful --dry-run rsvp set <event-id> ...
partiful events create ... --dry-run

--dry-run must:

  • perform no remote mutation
  • return exit 0 for a valid preview
  • emit a stable structured preview containing the command or operation and normalized request
  • keep secrets and private IDs redacted
  • avoid auth and network work when the preview can be built locally
  • clearly label any remote reads needed to resolve contacts or bind current state

Destructive actions

Destructive commands should prompt on a real TTY. At minimum this includes:

  • events.cancel
  • cohosts.remove
  • cohosts.link.revoke
  • cohosts.revoke-invite

Behavior:

partiful events cancel <event-id>             # prompt on TTY
partiful events cancel <event-id> --force     # execute without prompt
partiful events cancel <event-id> --no-input  # fail without mutation

--force means "skip destructive confirmation." It must not disable validation, ownership checks, remote contract checks, or read-back verification.

Safety that stays

Removing plan tokens does not mean turning off validation.

Keep:

  • input normalization and validation
  • ownership and permission checks
  • read-before-write safeguards
  • exact reviewed remote request construction
  • fail-closed handling for unknown remote shapes
  • redaction of private account, guest, and contact IDs
  • one mutation attempt with no automatic retry when completion is uncertain
  • post-write read-back where the command contract supports it

Run those checks inside the single command invocation immediately before dispatch. There is no stale cross-process plan to compare.

Remove

  • --apply
  • --plan
  • mutation --confirm tokens or exact confirmation strings
  • planToken output fields
  • five-minute plan expiry
  • persisted .mutation-plans state
  • plan creation, loading, binding, consuming, and stale-token errors
  • schema/help text that teaches a two-command mutation lifecycle

Delete dead plan code rather than leaving a compatibility layer. This CLI is still pre-stable enough to make the interface coherent.

Acceptance criteria

  • All 11 current plan-required commands execute in one invocation.
  • None exposes or accepts --apply, --plan, or plan confirmation tokens.
  • --dry-run is available consistently and performs zero mutation calls.
  • Dry-run JSON is stable, redacted, and useful to an agent without a second command.
  • Destructive commands prompt only on a TTY.
  • Destructive commands fail fast under --no-input unless --force is supplied.
  • --force skips only the prompt and does not weaken validation.
  • Non-destructive and externally visible writes do not require an interactive prompt by default.
  • Existing request validation, permission checks, remote contract checks, and uncertain-completion behavior remain intact.
  • Mutation plan files and dead implementation code are removed.
  • partiful --help, command help, and partiful schema describe the new flags and no longer mention plan/apply.
  • Tests cover every affected command, dry-run zero-write behavior, TTY confirmation, noninteractive refusal, force bypass, redaction, and one-attempt dispatch.
  • go test ./..., go test -race ./..., go vet ./..., go build ./..., and go mod verify pass.

Related work

Activity

  1. added
    enhancement
    on Aug 24, 2026
  2. changed the title [-]redesign event plan tokens so apply does not require the full payload again[/-] [+]Replace mutation plan tokens with gog-style dry-run and confirmation UX[/+] on Sep 4, 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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions