Repository navigation
feat: wire --fields opt-in extra fields into commands - #41
Closed
seraph-pixelperfect wants to merge 1 commit into
Closed
seraph-pixelperfect wants to merge 1 commit into
seraph-pixelperfect wants to merge 1 commit into
Conversation
parseFields (src/fields.ts) was built and unit-tested but wired into no command. Add the opt-in --fields <a,b,c> flag to `issues` and `issue view` (#23): per-command available field maps select extra GraphQL scalar keys that are appended to the selection set and the rendered TOON schema. - issues: url, estimate, dueDate, createdAt (extra columns) - issue view: dueDate, estimate, archivedAt, branchName (extra rows) - Field shapes verified against the generated Issue type in @linear/sdk v90.0.0; only fields absent from each command's default output are offered, so defaults stay byte-identical without the flag - fetchIssues/fetchIssue gain an optional extraFields param; a new withExtraFields helper appends keys, returning the base string unchanged when no extras are requested. Extras apply to the searchIssues document too - Unknown names fail loud (AxiError VALIDATION_ERROR) with the valid set listed, before any network request; blank values select nothing - Help (ISSUES_HELP/ISSUE_HELP), KNOWN_FLAGS/VIEW_FLAGS, and SKILL.md updated; new test/fields-wiring.test.ts (13 tests) covers document + output wiring, filter/search composition, unknown-field failure, and default-schema invariance
This was referenced Aug 19, 2026
Collaborator
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.
Closes #23. Depends on #40.
parseFieldsinsrc/fields.tswas built and unit-tested (#20) but wired into no command. This PR adds the opt-in--fields <a,b,c>flag toissuesandissue view: per-commandavailablefield maps select extra GraphQL scalar keys that are appended to the selection set and to the rendered TOON schema. Default documents and default output are byte-identical without the flag.What changed
src/linear.ts— newwithExtraFields(base, extraKeys)helper appends opt-in keys to a base selection, returning the base string unchanged when no extras are requested;fetchIssues/fetchIssuegain an optionalextraFieldsparam (extras apply to thesearchIssuesdocument too, sincefetchIssuesalso serves--search).LinearIssuedocuments the new optional fields.src/commands/issues.ts—ISSUE_LIST_EXTRA_FIELDSmap (url,estimate,dueDate,createdAt),--fieldsparsed viaparseFields, extras passed tofetchIssuesand appended tolistSchemaas extra columns. Added toKNOWN_FLAGSandISSUES_HELP.src/commands/issue.ts—VIEW_EXTRA_FIELDSmap (dueDate,estimate,archivedAt,branchName), same wiring inviewIssue(extra detail rows). Added toVIEW_FLAGSandISSUE_HELP.src/skill.ts+ regenskills/linear-axi/SKILL.md— new tip documenting--fields.test/fields-wiring.test.ts— 13 new tests (network-free, stubbedfetch, asserting on the captured GraphQL document, variables, and rendered output).Field maps and schema source
Each map offers only fields not already in that command's default output, all scalars on Linear's
Issuetype — verified against the generated documents in@linear/sdkv90.0.0 (npm pack @linear/sdk,Issuetype indist/index-zxW4m1xd.d.mts):issuesurlurl: Stringissuesestimateestimate: Float(nullable)issuesdueDatedueDate: TimelessDate(serializedYYYY-MM-DD, nullable)issuescreatedAtcreatedAt: DateTime(rendered as relative time, likeupdated)issue viewdueDate/estimateissue viewarchivedAtarchivedAt: DateTime(nullable; rendered as relative time,archived)issue viewbranchNamebranchName: StringNote: the issue mentions
subIssueCountas a possible view field — it does not exist onIssuein @linear/sdk v90.0.0 (onlychildren: IssueConnection/subIssueSortOrder), so it was not mapped.url/createdAtare intentionally absent from the view map (already inISSUE_DETAIL_FIELDS);priorityis intentionally absent from the issues map (already inISSUE_LIST_FIELDS, and not a column add candidate without duplicating the selection).Demo (real output, stubbed fetch — no network)
Default vs
--fields url— the acceptance example, plus multi-field and the loud unknown-field failure:Extra columns append after the default columns in the list CSV header; extra fields append after the default rows in detail view.
Local gates (real output)
Baseline on the parent branch was 97 tests in 10 files; +13 new tests, no existing test weakened.
pnpm run format:checkremains RED pre-existing (19 files incl. this PR's touched tracked files, which were already flagged before this branch); the newtest/fields-wiring.test.tspassesprettier --checkand no previously-clean file is newly flagged.Stacked PR note
Stacked on #40 (stack: #37 → #38 → #39 → #40). No CI checks appear —
ci.ymlonly triggers on PRs targetingmain. CI runs when retargeted tomainafter the stack merges; local gates below are the evidence. Not retargeting.CI quota-block caveat: if checks appear and fail with billing/spending-limit rejections, that looks like a check failure — check
gh run view <run-id>or the jobs API for a billing annotation (or emptystepswith ~3-4s duration). If quota-blocked, rely on the local gate output above; do not retry.Ambiguities flagged
issues --fields url. I mapped 4 list fields (url, estimate, dueDate, createdAt) and 4 view fields (dueDate, estimate, archivedAt, branchName) — all schema-verified scalars absent from each command's defaults.subIssueCountfrom the issue discussion does not exist onIssuein the current SDK.createdAt,archivedAt) render as relative times consistent with existingcreated/updatedcolumns;dueDaterenders rawYYYY-MM-DD(TimelessDate is already compact);estimaterenders the raw number (null when unset). In the list, extras append as trailing CSV columns; in detail, as trailing key rows.--fieldsvalue (e.g.--fields=or empty names) selects nothing and keeps default output — this isparseFields' tested, pre-existing behavior (splits/filters blanks), preserved rather than made a hard error, unlike value-requiring filters like--search.Identity note
Automated agent dispatch authenticated as
seraph-pixelperfect, submitted for human review — not self-approved. Merge is a human decision.