Deepen destructive-action seams: confirm + destroy modules#9
Open
johnpmitsch wants to merge 2 commits into
Open
Deepen destructive-action seams: confirm + destroy modules#9johnpmitsch wants to merge 2 commits into
johnpmitsch wants to merge 2 commits into
Conversation
Eight destructive command sites were each rebuilding the same confirmation ceremony (build ConfirmCfg → decide_without_prompt → optional prompt → NeedsConfirmation/Cancelled mapping), with `kv/mod.rs` already drifting into a local `confirm_mild` helper. Six of those sites also followed an identical shape around the confirm: prompt → SDK delete call → ✓ note. Two new seams: - `confirm::mild(&ctx, prompt)` and `confirm::severe_delete_all(&ctx, singular)` absorb the cfg + prompt + cancel-mapping. The lower-level primitives (`Severity`, `ConfirmCfg`, `decide_without_prompt`, `prompt_yes_no`, `prompt_typed`) are now `pub(crate)` so future call sites can't drift back into copy-pasting the ceremony. - New `destroy` module with `single` and `all` wraps the full destructive call: confirm → SDK closure → `✓ Deleted …` note. Generic over the SDK response type so each resource passes its own delete fn. Converted: tag delete, team delete, webhook delete/delete_all, stream delete/delete_all, kv set/list delete. endpoint archive stays on `confirm::mild` (not a delete). All existing wording preserved byte-for-byte (kv keys still print quoted; webhook/stream/tag/team ids still print bare). 173 tests pass, clippy clean, fmt clean.
Per-repo Claude notes (Linear team config, triage label mapping, domain docs pointers) live in CLAUDE.local.md so they stay out of this public repository. The detail docs already live under docs/agents/ which was gitignored previously.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracks DX-5617
Summary
confirm::mild(&ctx, prompt)/confirm::severe_delete_all(&ctx, singular)absorb the cfg + prompt + cancel-mapping ceremony that was repeated across 8 destructive command sites (one of which had already drifted into a localconfirm_mildhelper inkv/mod.rs).destroymodule withsingle/allwraps the full destructive call (confirm → SDK closure → ✓ note) for 7 delete sites acrosstag,team,webhook,stream, andkv. Generic over the SDK response type.Severity,ConfirmCfg,decide_without_prompt,prompt_yes_no,prompt_typed) demoted topub(crate)so future commands can't drift back into copy-pasting the ceremony.Skipped:
endpoint archivestays onconfirm::mildonly (not a delete, sodestroy::single's wording doesn't fit).All existing prompt and note wording preserved byte-for-byte — kv keys still print quoted (
{key:?}), webhook/stream/tag/team ids still print bare.Also: gitignore
CLAUDE.local.mdfor per-repo Claude notes that shouldn't land in this public repo.Test plan
cargo test— 173 passed, 0 failed (same count asmain)cargo clippy --all-targets -- -D warnings— cleancargo fmt --check— cleancargo build --release— no warningsqn tag delete Nshows the expected y/N prompt on a TTYqn webhook delete-allrequires--yes --yeson a non-TTY, exit code 5 without it