feat(tugasna): sawala tugasna canvas — project documents as markdown (TUG-176 M9) - #103
Merged
Conversation
…(TUG-176, M9)
Completes the loop the storage format was chosen for: a canvas can be pulled to
a .md file, edited with ordinary tools or read by a coding agent as a
specification, and pushed back.
sawala tugasna canvas pull <canvasId> -o spec.md
sawala tugasna canvas push <canvasId> -f spec.md
`pull` and `push` are the only commands in this file whose payload is RAW TEXT
rather than JSON — deliberately not resolveInputPayload, which parses JSON.
`pull` writes only the document to stdout and puts id/revision/title on stderr,
so `canvas pull <id> > spec.md` is safe in a pipeline.
`push` reads the current revision first and sends it as expectedRevision, so an
unattended push is still guarded against a concurrent edit rather than silently
clobbering it. `--force` skips both the read and the guard.
Also: list (tri-state --folder), create, get, move, link, unlink, links,
history, restore, delete, and a folder sub-group over the three-level tree.
Two prompts carry the distinction the whole design rests on: `unlink` says the
document stays in the project, and `delete` reports how many references will be
removed with it.
12 new tests (165/165 suite green), skill docs updated with a references/canvas.md
covering the pull/edit/push loop, and a changeset — without one this ships
nothing.
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.
Completes the loop the canvas storage format was chosen for.
Plan:
sawala-cloud/docs/plan/tugasna/PLAN-tugasna-canvas.md· Tracks TUG-176. Backend: core#486 (merged + deployed). Dashboard: ui#554, ui#555.The point of it
A canvas is a long-form markdown document belonging to a project, not a task. Storing it as markdown only pays off if you can get it out and back:
That makes a canvas a machine-readable specification attached to a work item — point an agent at a ticket's document and it can implement against the acceptance criteria the ticket is actually judged on.
Two things done deliberately
pull/pushtake raw text, not JSON. They're the only commands intugasna.tsthat don't go throughresolveInputPayload(which parses JSON).pullwrites only the document to stdout and puts id/revision/title on stderr, socanvas pull <id> > spec.mdyields a clean file.pushis guarded by default. It reads the current revision and sends it asexpectedRevision, so an unattended push is refused rather than silently clobbering a concurrent edit.--forceskips both the read and the guard — one round trip, and you mean it.The full surface
list(tri-state--folder: omit = whole project,root= unfiled, id = that folder),create,get,pull,push,move,link,unlink,links,history,restore,delete, plus afoldersub-group (create,rename,move,delete) over the three-level tree.Two prompts carry the distinction the whole design rests on:
unlink— "The document stays in the project."delete— reports how many references will be removed with it, read fromlinksfirst.Verification
pullwriting to a file while keeping stdout clean,pushreading and sending the current revision,push --forceomitting it and skipping the extra round trip,--dry-runissuing no write,unlinkrefusing without--yeson a non-TTY, and folder nesting.tsc --noEmitclean, lint clean.SKILL.mdplus a newreferences/canvas.mdcovering the pull/edit/push loop, many-to-many referencing, history semantics and folders.Not verified
No command has been run against the live API from this branch. The endpoints are deployed and exercised by the dashboard, but the CLI paths themselves are covered by mocked-fetch tests only. Worth one real
pull→ edit →pushafter publish.