Repository navigation
feat(cli): patchy delete takes a page down with the key that published it - #111
Conversation
…d it Onboarding teaches "take that page down", but the CLI had no way to do it. `patchy delete <file> | --draft <id>` resolves the draft from the cache or the flag, deletes it with the same credential chain as upload (never minting), and forgets the cache entry on success. --json prints the wire Ok shape. Closes #41. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Code review — PR 111 / issue 41Two-axis review ( StandardsNo hard documented-standard breaches. Delete follows Effect (
|
| Surface | Applied? | Hit? |
|---|---|---|
| Wire contract | yes (existing DELETE) | yes — derived client, encodeOk(Ok), docs/API.md already documents it |
| CLI (README, ADR-0004, skill, skills-lock) | yes | mostly — leftover examples below |
| Dev loop | no | — |
| Vocabulary | yes | yes; remaining "draft" copy is the filed #92 rename |
| Migrations | no | — |
| Served pages | no | packed e2e viewer 404 is serving proof, not HTML/CSS |
| Reverse states | yes — this PR is the way out | way in / way out / way to see (CLI success, forgotten cache, re-delete rejected, e2e viewer 404). No list-of-live-pages; pre-existing |
| Repo layout | no | — |
Leftover examples, not contract holes:
- README
PATCHY_API_TOKEN: still "ordinary authenticated commands such aswhoamiandupload" - Skill
--json: still onlyupload --json; nodelete→{ "ok": true } - Skill exit-code examples: still "a missing update target"
Summary
- Standards: 3 findings, all judgement. Worst:
deleteTargeterror copy ("not both") covering neither-args. - Spec: 2 findings. Worst: same XOR message is wrong for bare
patchy delete. (The vitest 404 is the API 404 via--draft, not a viewer 404 — a reading of "then the draft 404s", not a missing Do-list item.)
I would not block on the leftover skill/README examples, the e2e seam, or the onboarding-trigger gap. The one change I would make on this PR is splitting the neither vs both errors so an agent that types patchy delete is told what to pass, not that it passed both.
- delete speaks patch: `--patch <patch-id>`, "Deleted patch", patches.json - neither-target and both-target are separate local errors - keyless message says publishing key, per the CLI glossary - vitest proves forgetPatch drops every file pointing at the patch - packed e2e delete step does its own upload instead of relying on script order - skill and README examples name delete where they listed whoami/upload Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Thanks for the review. Merged Fixed
Kept as is
Written by Claude Fable 5.1 in Claude Code. |
Onboarding teaches users to say "take that page down", and the skill promises their publishing key lets them delete pages, but the CLI had no delete command. The server already allowed an owner to delete, so this was CLI-only.
patchy delete <file> | --patch <id>resolves the patch from the cache entry the file's upload left behind, or from the flag, and deletes it with the same credential chain asupload. It never mints: a fresh key would own nothing. The cache forgets the patch only after the instance says yes, so a refusal leaves local state as it was. A missing or unowned patch is arejectedfailure (exit 2).--jsonprints the wireOkshape.One vitest covers the flow against the stub instance (upload, delete by file, cache emptied, second delete 404s, no key means no request), and the packed real-server e2e proves the viewer URL answers 404 right after the delete. README, ADR-0004, the CLI
CONTEXT.mdand thepatchyskill carry the one-line mirrors, with the skill hash refreshed inskills-lock.json.Closes #41.
Written by Claude Fable 5.1 in Claude Code.