Repository navigation
Description
Part of #247. Implements spec §6 (the description sync, describe, file mode, the primitive-change reminder) and §8 (the lifecycle verbs); decisions The patch lifecycle, Admin authority (the ownership refusal as the agent reads it) and Patch metadata.
What to build
- The reminder: at
refresh,devstart andpublish, for every table or store whose executed definition (columns, indexes,shared) differs frompatchy/_generated/manifest.jsonwhile its description is byte-identical, print "Tableorderschanged since its last generation; check that its description still holds: '…'". Notice only; the command proceeds; under--jsonit is awarningsentry;patchy-loopmentions it. - Verbs:
patchy retire [<file>] [--patch <id>] [--force],patchy delete … [--yes] [--force](interactive confirmation unless--yes; non-interactive without it is local exit 1),patchy restore … [--force](refused withpatch_deletedpastpurgeAt),patchy rollback <n> …(live only),patchy describe "<text>" | <file> "<text>" | --clear,patchy publish … [--force]for an unshare with dependants, each with theshare/deletetarget rules,--jsonand the ladder:has_dependantsandsources_offprint the list and end with "Ask the person you are working for before forcing.";wrong_state,not_owner(naming the owner, never suggesting a new patch),patch_retired,patch_deleted(with the reclaim date) arerejectedwith their fields in the failure document. A file-cache entry is forgotten only after a successful delete. - The description in
patchy.json:{ instance, patch?, description, descriptionSyncedAt? };init --purposewritesdescription(refusing an over-long purpose with the count and the bound; interactive re-prompt); a repo without one isinvalid_manifestat publish. The manifest carries it; publish records the returneddescriptionUpdatedAtasdescriptionSyncedAt. Pull-down atrefresh,devstart andpublish: when the cloud'sdescriptionUpdatedAtis later thandescriptionSyncedAt, write the cloud text intopatchy.json, print "The description was changed in the portal to '…'; check it" quoting the replaced local text when it differed, record the stamp, and (for publish) send the pulled text.describein a repo updates the cloud and rewritespatchy.jsonin one run. File mode:publish <file> --description "…"; the flag in repo mode is a local refusal pointing atpatchy.json. - Publish's new refusals as the agent reads them:
not_owner,patch_retiredandpatch_deletedare definitive (the attempt is cleared), keep the id inpatchy.json, and say restore it or ask an admin; only the 404 of a reclaimed patch still says to removepatchfrompatchy.json.
Admitted at merge
The owner's whole lifecycle from the CLI; a retired or deleted address still answers 404 until ticket 11. Admin acts wait for the portal.
Done when
- Each verb's text and
--jsondocument is tested with the refusals above;describerewritespatchy.json; the pull-down notice fires onrefreshafter a cloud edit and not after a local one;--forceand--yesbehave; the reminder fires only when the definition changed and the text did not, in all three commands;initrefuses a 501-code-point purpose; the packed e2e retires (refused, then forced), restores, rolls back to 1 and describes, then sees the pull-down onrefresh.
Surfaces
The CLI (packages/patchy/README.md, ADR-0004's command table, definitive refusals and patchy.json fields, the global skill for retire/delete/restore/rollback/describe and the description, skills-lock.json, patchy-loop for the sync notice, the starter AGENTS.md saying which file holds which text), docs/product.md § Building a patch and § Describing a patch from decided to built, the Publishing glossary (Description sync).
Activity
feat(patchy): add lifecycle commands and description sync
feat(patchy): add lifecycle commands and description sync