This repository was archived by the owner on Sep 2, 2026. It is now read-only.
Repository navigation
[Spec #94] Classify spec / ticket / idea ghosts from the issue body - #102
Merged
64ix merged 8 commits intoAug 27, 2026
Merged
Conversation
Red first: new tests fail because spec-ticket-shape.ts does not exist yet, GhostCandidateIssue/GitHubWorkItem lack specShape/parentIssueNumber, and GhostCandidate lacks childTicketCount. Covers title-convention + body-heading shape derivation, ## Parent number parsing, ghost routing/exclusion/counting, mapIssueWorkItem stamping, and the ghost card's child-ticket badge. Refs #94
…body New src/shared/spec-ticket-shape.ts (provider-neutral) derives spec/ticket shape from title conventions ([Spec]/Spec:/Spec —/Spec -/[PRD]/PRD:) and body headings (## Success Criteria, ## Parent), and parses the first #N under ## Parent, reusing the referenced-issue #N/URL/anchor rule. GitHubWorkItem gains optional specShape/parentIssueNumber; mapIssueWorkItem stamps them from the search payload's body (never itself carried onto the item). Both fields are optional so an older host's payload — missing them entirely — falls back to today's title-only [Spec] classification, per remote-wire-compatibility.md Rule 1. buildFeatureBoardGhostCandidates routes specShape==='spec' to the spec column (falling back to isOrphanSpecIssue when the field is absent), unconditionally excludes any issue with a parentIssueNumber from ghost candidacy, and computes GhostCandidate.childTicketCount over the repo's open issues before any exclusion so a dismissed/linked sub-ticket still counts. FeatureBoardGhostCard renders a "N tickets" badge when childTicketCount > 0 (components.featureBoard.ghost.childTicketCount, en.json), following the existing outline-badge pattern; the card stays non-expandable. Test change: FeatureBoardColumn.test.tsx, use-feature-board-ghost-candidates.test.tsx — existing GhostCandidate literals now include childTicketCount: 0 (type-only addition; the new required field, not a behavior change). Refs #94
…ding A [Spec]-titled issue whose body also has a ## Parent heading gets stamped with both specShape:'spec' and parentIssueNumber by mapIssueWorkItem, even though deriveSpecTicketShape's own title-vs-body precedence says a spec is never a sub-ticket. The unconditional parentIssueNumber exclusion in buildFeatureBoardGhostCandidates then drops the issue from every column. - work-item.test.ts: mapIssueWorkItem stamps parentIssueNumber (bug) - feature-board-ghost-candidates.test.ts: mapper/derivation parity — the mapped issue vanishes instead of routing to the spec column (bug) Refs #94, #102
deriveSpecTicketShape's title-vs-body precedence says a spec is never a sub-ticket, but mapIssueWorkItem called deriveSpecTicketShape and parseParentIssueNumber independently, so a [Spec]-titled issue whose body also had a ## Parent heading got stamped with both specShape:'spec' and parentIssueNumber. buildFeatureBoardGhostCandidates' unconditional sub-ticket exclusion (which must stay unconditional) then dropped the issue from every board column instead of routing it to Spec. Add deriveSpecTicketFields as the single source of both derived fields: parentIssueNumber is only ever set alongside specShape:'ticket'. mapIssueWorkItem now spreads its result instead of computing the two fields separately. deriveSpecTicketShape and parseParentIssueNumber stay exported and unchanged, per the spec's own tests. Also repoints the ghost-candidates parity test at deriveSpecTicketFields (shared) instead of the main-process mapper: src/main/github/client/map is not on the tc.web/node tsconfig project allowlists, so importing it from a renderer test broke pnpm run typecheck. Fixes review finding on PR #102, refs #94
64ix
marked this pull request as ready for review
August 27, 2026 17:43
…ec lookup Four gaps found while implementing #94 independently, ported onto this branch. The linked-spec lookup still tested the title for `[Spec]`, so a worktree linked to a `Spec — …` issue resolved no body and excluded none of the tickets that spec covers — they all resurfaced in Idea, which is the mixing #94 exists to stop. Extract `isSpecShapedIssue` so the hook and the candidate derivation agree. Also: accept `PRD —` / `Spec- ` / `Spec :` in the title convention, read a parent named on the heading line (`## Parent: #25`), and give the counter badge a singular form so one ticket no longer reads "1 tickets".
14 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
The feature board's Idea column was a dumping ground: every open base-remote issue whose title didn't start with
[Spec]landed there, so a spec's sixTicket — …children sat next to genuine ideas with nothing telling them apart.This classifies each issue as spec / ticket / idea in the main process, from the title and the
search/issuespayload'sbody— which was already being fetched and thrown away. Zero extra API calls, works retroactively on existing issues, and the body itself never crosses the wire: only two derived fields do./implement-specrecognises, not just[Spec].## Parentheading naming an issue is a sub-ticket and never becomes a ghost — unconditionally, whether or not its parent is open, visible, or in the selected repos.6 ticketsbadge, so the covered set stays visible without expanding anything.Spec & Tickets
Closes #94
No child tickets — the spec is autosufficient and was implemented as a single unit.
Acceptance criteria
src/shared/spec-ticket-shape.tsexportsderiveSpecTicketShape({ title, body })src/shared/spec-ticket-shape.ts:52—SPEC_TITLE_PATTERN(line 6) covers[Spec],Spec:,Spec —,Spec -,[PRD],PRD:case-insensitively;## Success Criteria→ spec;## Parentnaming an issue → ticket; elseundefinedparseParentIssueNumber(body), reusing theparseReferencedIssueNumbersrulesspec-ticket-shape.ts:39, over the sharedparseIssueReferenceNumbers(line 14) thatparseReferencedIssueNumbersnow delegates toGitHubWorkItemgains optionalspecShape/parentIssueNumber;mapIssueWorkItemstamps them,bodyis not carriedsrc/shared/github/work-item-types.ts:34,src/main/github/client/map/work-item.ts:26+:58; test assertsbodyis absent from the item[Spec]and excludes nothing newfeature-board-ghost-candidates.ts:130guards onspecShape === undefined;feature-board-ghost-candidates.test.ts:168. The RPC layer validates params only and returns the result unserialized through a schema, so a new host's fields reach the client intactbuildFeatureBoardGhostCandidatesroutesspecShape === 'spec'to spec, legacy title match still routes therefeature-board-ghost-candidates.ts:130; tests at:161parentIssueNumbernever becomes a ghost candidate, unconditionallyfeature-board-ghost-candidates.ts:124; test at:196uses a parent number absent fromopenIssuesentirely. The exclusion stayed literally unconditional through the review fix below — a spec simply never carries the fieldreferencedIssueNumbers/ dismissal / wayfinder / linked-issue / cross-repo exclusions unchangedfeature-board-ghost-candidates.test.tspass unmodifiedGhostCandidategainschildTicketCount, counted before candidate filtering so excluded tickets still countfeature-board-ghost-candidates.ts:87builds the count map ahead of the candidate loop; tests at:209, including the dismissed-ticket-still-counts caseFeatureBoardGhostCardrenders a6 ticketsbadge whenchildTicketCount > 0, i18n key +en.json, not expandableFeatureBoardGhostCard.tsx:94reuses the existingBadge variant="outline"chip;components.featureBoard.ghost.childTicketCountinen.jsonTicket —with no## Parent, routing / exclusion / counting, card render presence + absencespec-ticket-shape.test.ts(26 cases),feature-board-ghost-candidates.test.ts:157-256,work-item.test.ts:38-79,FeatureBoardGhostCard.test.tsxChanges
Classification (shared, provider-neutral) — new
src/shared/spec-ticket-shape.ts:deriveSpecTicketShape,parseParentIssueNumber, and the#Nreference scanner both it and the renderer'sparseReferencedIssueNumbersnow share.Main process —
mapIssueWorkItemparsesitem.bodyto stampspecShape/parentIssueNumbervia conditional spreads, so an unclassified issue carries neither key.GitHubWorkItemgains the two optional fields.Ghost derivation —
buildFeatureBoardGhostCandidatescounts child tickets per parent before any exclusion runs, drops every issue carrying aparentIssueNumber, and prefersspecShapeover the legacy title match while falling back to it when the field is absent.Card — the count renders as an outline badge in the existing badge row.
Review fix —
deriveSpecTicketFieldsinsrc/shared/spec-ticket-shape.ts:64is now the single source for both fields, andmapIssueWorkItemspreads it rather than calling the two derivations independently. See below.Code review
/code-reviewon the branch found one real bug, reproduced before it was fixed:A spec whose body also carried a
## Parentheading — a spec nested under an epic, or one with both## Success Criteriaand## Parent— disappeared from the board entirely: not in Idea, not in Spec.deriveSpecTicketShapedeliberately lets a spec title win over a## Parentheading, butmapIssueWorkItemcalledparseParentIssueNumberindependently, so the issue was stamped with bothspecShape: 'spec'andparentIssueNumber. The unconditional sub-ticket exclusion then fired before the spec routing and dropped it. Probe confirmed it: the mapper yielded both fields and the derivation returned[].The fix goes in the derivation layer, not the board: a spec is never a sub-ticket, so
deriveSpecTicketFieldsonly setsparentIssueNumberalongsidespecShape: 'ticket', and it is now the only thing callers spread. That keeps the board's exclusion literally unconditional as the criterion requires, and puts the precedence in one place so the two cannot drift apart again.buildFeatureBoardGhostCandidateswas not touched.Verified by mutation rather than on trust: removing the
specShape === 'ticket'guard turns exactly 3 tests red across the mapper, the shared module, and the ghost derivation; restoring it returns 59/59.Test changes rather than additions
Two existing test files were edited, both type-level only, because
GhostCandidate.childTicketCountis required rather than optional:FeatureBoardColumn.test.tsx— addedchildTicketCount: 0to asatisfies GhostCandidate<…>literal.use-feature-board-ghost-candidates.test.tsx— same, in theghostEntry()helper.No pre-existing assertion was changed, weakened, or removed anywhere; no skips, no tolerances, no regenerated snapshots. One test added in this PR was rewritten while the review fix landed: the mapper/derivation parity test in
feature-board-ghost-candidates.test.tsoriginally importedmapIssueWorkItem, which broketypecheckbecause main-process modules aren't on the renderer tsconfig project allowlist; it was repointed atderiveSpecTicketFields— the value the mapper spreads — and the mapper itself stays directly covered bywork-item.test.ts's'parentIssueNumber' in itemassertion.Both units landed test-first: commit
2b8c47fis test-only and runs 13 of the new tests red before099c8b0makes them green;e21c8b9is test-only for the review fix and fails withexpected 1 to be undefinedbeforec78a407.Decisions taken without asking
parseReferencedIssueNumbersrules, but that function lives in a renderer component file thatsrc/shared/must not import. Resolution: the regex moved into the shared module asparseIssueReferenceNumbers, and the renderer's function delegates to it — identical behavior, existing tests untouched, no cross-layer dependency.## Parentheading. Resolution: title wins — a spec that catalogues its own parent stays a spec. Covered by a test.^#{1,6}\s+<text>\s*$), not a substring.{{value0}} tickets), matching the existing count badges on this surface.linkedIssuesstill uses the title-onlyisOrphanSpecIssueto decide whose body to fetch forreferencedIssueNumbers, so a worktree-linkedSpec — …doesn't contribute#Nexclusions. The new unconditionalparentIssueNumberexclusion already covers its sub-tickets, and the criterion asks for that path to stay unchanged. GitLab's work item type is untouched — the board only consumesGitHubWorkItemtoday, and the new module is provider-neutral so a future wiring reuses it as-is.QA plan
Spec — …issue and itsTicket — …children: the spec sits in Spec, and none of the children appear in Idea.N ticketsbadge matching the number of open children; the card does not expand when clicked (it grabs the issue).## Parent, no## Success Criteria— still appears in Idea with its capture badges.[Spec] …issue still routes to Spec.## Success Criteriaand## Parentappears in Spec — it does not vanish from the board (the review finding).[Spec]-titled issues route to Spec, no issue disappears from Idea, and no badge shows.