Repository navigation
Review fixes, batch 2: output fields, threads, archived keys, clearing fields, help, key echo, doctor - #14
Open
CorySchulz wants to merge 15 commits into
Open
CorySchulz wants to merge 15 commits into
CorySchulz wants to merge 15 commits into
Conversation
…output Hydration dropped seven fields the server sends on every task row (model.Task). A list row now carries `priority` and `due_date`, the two fields work is picked by; `task get` adds `start_date`, `estimate_hours`, `completed_at`, `guest_visible` and `created_at`. Values are copied through as sent, so null stays null (a guest's estimate is always null). The test fixture is the server's own model.Task shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`comment list` returns roots and replies in one flat page, and hydration dropped `parent_id`, so a reply could not be told from a root comment. A reply now carries `parent_id` (the root it answers); a root has no such key. The server allows one level of replies, so `thread_root_id` adds nothing and is not copied. The test fixture is the server's model.Comment shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hable
A key like WEB-42 was turned into a task through full-text search, and
search skips archived tasks (search.sql), so `task archive WEB-42
--unarchive` failed with task_not_found. A key is an exact identifier: its
prefix names the project (from the resolver's cached project list) and
GET /projects/{id}/tasks/by-number/{n} reads the task, archived or not.
This replaces the search call; there is no fallback beside it.
An unknown prefix is still task not_found. The lookup shares the project
list's reach with `--project`: the first page of live projects.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`magic pyramid task update WEB-42 --owner null` sent the string "null" (then user_not_found) and `--description null` stored the text "null", though MCP clears both with JSON null. argv's one coercion step now turns the literal `null` into JSON null for any field whose zod schema is nullable, in both `--flag null` and `--flag=null`. It holds for every nullable field of every operation; elsewhere `null` stays text. `task update`'s `estimate` becomes nullable: the server's PATCH clears estimate_hours on `"estimate": null` (task_requests.go, UpdateTask SQL), as it does description, due_date, start_date, owner_id and reviewer_id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Help was recognised only as the first token after the product. After a command, `--help` was an unknown flag and `-h` became a positional: `magic pyramid task comment WEB-42 -h` posted a comment reading "-h" and `task create -h --project web` created a task titled "-h". The existing check now also matches `--help` / `-h` anywhere in the arguments: it prints the product help to stderr, exits 0 and runs nothing. `help` still counts only as the first word. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A key typed as an argument (`magic login <key>`, `--product <key>`) was echoed whole in the usage error. renderError, the one error exit, now masks every key-shaped token in what it prints, JSON and text alike, with the rule maskKey uses: `<product>_<public id>_` kept, a secret of 32+ letters and digits cut to its last four. Ordinary typos are still quoted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…each `magic doctor` failed with exit 10 whenever any product's API was out of reach, even one never used. Each product now resolves its credential once, first; whether it is in use (has a key, even one that does not resolve yet) sets both checks: an unreachable API fails a product in use and warns for one that is not, and a missing key warns while anything else is signed in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
listProjects read the first page only (50 projects, the server default), so a member of more projects could not reach the rest by `--project`, by `project list` or, since keys resolve through the project list, by task key. It now asks for pages of 100, the server's maximum, and follows the keyset cursor until it is null. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comments come back flat, each reply with `parent_id`; no response carries a `replies` array. So every root printed `replies: []` beside its own reply. The property, `hydrateReply` and `TaskComment.replies` are gone: `parent_id` is the one thread truth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Output and `task create` say `estimate_hours`, but `task update` took `estimate`, so an MCP call with `estimate_hours: null` was stripped by the schema and reported success. The update input is now `estimate_hours`, sent as the `estimate` the PATCH reads; `--estimate` still reaches it. The summary now says null clears any nullable field, not only owner/reviewer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UpdateTaskInput, CreateTaskInput, CreateTasksBulkInput, MoveTaskInput, AddCommentInput, ReplyCommentInput and CustomFieldValue mirrored the zod schemas by hand and had already drifted (UpdateTaskInput still said `estimate`). No module imports them; the zod schemas are the truth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hydrateTaskDetail set `description` again after the summary had set it the same way. The CLI test's `GET /v1/search/tasks` stub stayed behind when task keys stopped resolving through search; nothing requests it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
resolveTaskRef reads the whole task and kept three fields. `task get` without --expand then read the same task again, and currentStageId read it a third time on `task comment` and `comment list`. The ref now carries the row: `task get` returns it, and the current stage comes from its status. The unused `stage_id` fallback goes too (model.Task has none). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A resolved task's row always carries `project_id` (a uuid.UUID, never null), so the `ref.projectId ? getWorkflow(…) : EMPTY_WORKFLOW` guards in task comment, comment list, task timeline and hydrateDetailFor never took their fallback. In task comment and comment list the default-stage path had already called getWorkflow(ref.projectId) unguarded before them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s fast Page 1 of the fake's project list was served by the path-only fallback, so a client sending the wrong paging parameters got page 1 forever and the test died as a timeout. Page 1 is now `GET /v1/projects?limit=100`, and both paging tests check stderr first: a wrong query fails at once, naming the fake's "no route /v1/projects". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Task output fields
List rows now carry
priorityanddue_date.task getaddsstart_date,estimate_hours,completed_at,guest_visibleandcreated_at, all from themodel.Taskthe server already sends. A null value stays null.estimate_hoursis always null for a guest, because the server withholds it.Comment threads
A reply carries
parent_id, the root comment it answers. Therepliesarray is gone: the server never sends one, so each root printedreplies: []beside its own reply.parent_idis now the only record of a thread.Task keys resolve exactly
A key such as
WEB-42resolves in two steps. The prefix finds the project in the cached project list, thenGET /v1/projects/{id}/tasks/by-number/42reads the task. This replaces full-text search, which skipped archived tasks, and there is no fallback.An unknown prefix or number is
not_found(kindtask), exit 5. The task row read to resolve the key is kept:task getwithout--expandreturns it, and the default stage fortask commentandcomment listcomes from its status. Neither reads the task a second time.Every page of the project list
listProjectsasks for pages of 100, the server's maximum, and follows the keyset cursor until it is null. Before, it read only the first 50 projects (the server default). A member of more projects could not reach the rest through--project,project listor a task key.nullclears a fieldOn the command line, the literal
nullbecomes JSON null for any field whose schema is nullable. This happens incoerce, the one place argv values are coerced. Thetask updatesummary now says this.One name for the estimate
The
task updateinput is nowestimate_hours, as on output and ontask create, and it is sent as theestimatethe PATCH reads.--estimatestill reaches it on the command line. Before, an MCP call withestimate_hours: nullwas stripped by the schema and still reported success.Help anywhere
-hor--helpanywhere inmagic <product> …prints the product help and runs nothing.Keys masked in errors
renderError, the single error exit, masks every key-shaped token in what it prints, in JSON and in text. A key-shaped token is<product>_<public id>_followed by 32 or more letters and digits. It keeps the public part and the last four characters.maskKeyuses the same rule, and ordinary typos are still quoted.Doctor and unused products
Each product resolves its credential once, first. The product is in use if it has a key, even one that does not resolve yet, and that sets the severity of both checks:
Doctor still has two "has a key" checks:
anyCredentialfor the whole machine, andinUsefor each product. They are not folded into one. Folding means movingproductConfigandresolveCredentialinto a first pass, which costs about as much as the nine lines it would save. The two checks also differ only in odd store states: an index entry whose session item is missing, or a stored item with an empty value.Cleanup
types.tsthat nothing imports (UpdateTaskInputand six others). They had already drifted from the zod schemas, which are the truth.descriptionassignment inhydrateTaskDetail.GET /v1/search/taskstest route.ref.projectId ? getWorkflow(…) : EMPTY_WORKFLOWguards in task comment, comment list, task timeline andhydrateDetailFor. A resolved task's row always carriesproject_id, so the fallback never ran.?limit=100). A client that asks for a page wrongly now fails at once with the fake's 404, not after a timeout.Behaviour changes
priorityanddue_dateon list rows, and five more fields ontask get.parent_id, and comments no longer carryreplies.project list,--projectand task keys reach every project, not only the first 50. A member of more than 100 projects costs one extra request per 100.task getwithout--expandmakes one request fewer.task commentandcomment listmake one fewer when no stage is given.nullclears a nullable field on the command line.task updateestimate isestimate_hours. An MCP caller that sendsestimatenow has it ignored.--estimatestill works on the command line.-hor--helpafter a command shows the product help, so a value of exactly-hor--helpcan no longer be passed.maskKeyon a key whose secret is shorter than 32 characters shows only the prefix; no product mints such a key.magic doctorwarns, instead of failing with exit 10, when a product with no key is out of reach.Measurements
cd73c84669fed4Per commit:
parent_idnullclears a fieldrepliesestimate_hoursThe key-masking commit is −1 raw byte. Its gzip rise is chunk order, not code: render now imports credentials, so esbuild places render, operation, argv and cli after credentials in the shared chunk. The bundle is not minified, so JSDoc counts toward these sizes.
🤖 Generated with Claude Code