Repository navigation
feat(platform): let the REST door archive and restore a task - #3438
Merged
Merged
Conversation
A mirror that opens a task per delivery had no way to retire the task a
re-delivery or a cancellation superseded: the door could read a task's
`archivedAt` but never set it, so the old task stayed live on the board
next to its replacement.
Add `PATCH /api/v1/projects/{id}/tasks/{taskId}` taking exactly
`{ archived: boolean }`. It runs the board's own archive/restore
(`archiveTask` / `restoreTask`) inside the serializable transaction,
after the project write check (so `PROJECT_ARCHIVED` and `RBAC_FORBIDDEN`
refuse first) and the project-scoped task lookup (so another project's
task answers the opaque `TASK_NOT_FOUND`). Both directions are
idempotent, and the answer is the task as it now stands.
Contract 1.20.0; the OpenAPI document, the fingerprint and the three
API references carry the new verb.
The PATCH landed with contract 1.20.0, but the `Task.archivedAt` schema description (and the payload comment behind it) still said the door had no verb for archiving, so the published document contradicted its own operation. Descriptions sit outside the contract fingerprint, which is why no guard caught it. Rewrite the sentence to name the toggle, retire the "cannot be archived" half of the repo ledger entry (only the DELETE twin remains open, gated the way the PATCH is so an archived task stays deletable), and register the verb's owning specs in the manual layer's automation map.
larryro
added a commit
that referenced
this pull request
Sep 20, 2026
The CLI workflow on main (run 35525098046, after #3438) failed its Windows build in config-source.test.ts: "a self-consistent changed archive still cannot claim the original Git pack tree" took 5.7 s and bun test's 5 s default killed it. The test builds the git release fixture; Windows runners stall on git for seconds at a time, and Linux and macOS finish the same test in well under a second. 1d1c532 raised the budget per file with `setDefaultTimeout(30_000)`, but twelve test files that build the same fixture never got it, and three of the four tests in this file carried a per-test 30 s while the fourth did not. One rule instead of a per-file convention: the package `test` script runs `bun test --timeout 30000`, and the workflow's unit and smoke steps go through the script, so no test file has to remember the budget and the local run matches CI. Linux, tools/cli: 1218 pass, 19 skip, 1 fail — provision.test.ts binding port 3005 against a running dev stack, the documented environmental red.
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.
Why
A mirror that opens a task per delivery (vatplus's desk worker does) had no way to retire the task a re-delivery or a cancellation superseded: the REST door could read a task's
archivedAtbut never set it, so the old task stayed live on the board next to its replacement, with its run still going.What
PATCH /api/v1/projects/{id}/tasks/{taskId}with exactly{ "archived": boolean }— the board's ownarchiveTask/restoreTask, run inside the serializable transaction after the project write check and the project-scoped task lookup. Idempotent both ways; answers the task as it now stands.setTaskArchived, regeneratedopenapi.json+ fingerprint.Proof
bunx vitest --run --project server backend/rest/v1-tasks.test.ts scripts/openapi/spec.test.ts— 195 passed (9 new door cases: archive in tx, restore, idempotent, archived project 403, member 403, other project 404, three invalid bodies 400).bunx tsc --noEmit,bunx oxlint --type-awareon the touched files — clean.bun run --filter @tale/docs test— 166 passed.