Cover the pin-shortcut run path and the job self-improvement footer - #962
Merged
Merged
Conversation
Three zero-coverage surfaces, all reached through the queued next_focus: - useRunPinShortcut had no unit coverage at all. It is a write into a live agent session — the server resolves the pin's prompt and types it into the terminal — so the request it builds and the toast each outcome produces are worth pinning. The E2E suite proves the button reaches the endpoint once; the URL shape, the POST, and the label/error branches are only checkable here. - resolvePinShortcutIcon was covered for its name allowlist (by the existing server-side lockstep test) but not for resolution. The lookup is an own-property check specifically so inherited keys fall through to the fallback; without it "constructor" resolves to something that is not a component and throws during render. - buildSelfImprovementGuidance's job branch had no assertions anywhere. jobs/service.ts builds its prompt in a module-private function, so nothing else in the repo checks that a self-improving job is told to call update_job with its own name and directory. The template branch already reaches three suites through its caller and is not duplicated here. Mutation battery: 21 mutants, 19 killed. Two recorded survivors, neither a test gap — the `name &&` guard in resolvePinShortcutIcon is unobservable (Object.hasOwn already rejects undefined and ""), and splitting the update instruction across two lines changes guidance formatting rather than any contract, which is not worth pinning the copy to protect. Co-Authored-By: Claude Opus 5 (1M context) <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.
Recurring test-health run. Local suite was green on the first pass (28th consecutive), so the whole run went to the queued
next_focuscoverage gap.Suite status
pnpm run checkpnpm run format.prettierignorefix still holding)pnpm run testpnpm run test:e2epnpm run test:e2e:livee2e-*tmux sessions (19th consecutive)pnpm run finalize:webCI scan (
gh run list --limit 50): 49 success / 1 failure. The failure is the Release workflow's ownorigin/main advanced after smoke testsmerge-race guard on v0.33.12 from 2026-08-13 — already triaged in a prior run, not a test failure and not a flake. No new flakes; the brain flake list stays empty (6th consecutive run).Coverage added
Three zero-coverage surfaces, all reached through the queued focus area:
useRunPinShortcut(apps/web/src/hooks/use-pin-shortcuts.ts) had no unit coverage at all. It is a write into a live agent session — the server resolves the pin's prompt and types it into the terminal. The E2E suite proves the button reaches the endpoint once; the URL shape, thePOST, and the label/error toast branches are only checkable at this level.resolvePinShortcutIcon(apps/web/src/lib/pin-shortcut-icons.ts) was covered for its name allowlist by the existing server-side lockstep test, but not for resolution. The lookup is an own-property check specifically so inherited keys fall through to the fallback — without it, an agent passing"constructor"resolves to something that is not a component and throws during render.buildSelfImprovementGuidance's job branch (apps/server/src/shared/self-improvement-prompt.ts) had no assertions anywhere.jobs/service.tsbuilds its prompt in a module-private function, so nothing else in the repo checks that a self-improving job is told to callupdate_jobwith its own name and directory. The template branch already reaches three suites through its caller and is deliberately not duplicated here.No product code changed. No product bugs found, no Linear tickets filed.
Mutation battery
21 mutants, 19 killed. Two survivors, neither a test gap:
resolvePinShortcutIcon'sname &&truthiness guard is unobservable —Object.hasOwnalready rejectsundefined(coerced to the absent key"undefined") and"". Recorded as product cleanup, not missing coverage.Review round
One general review agent inspected this run's diff and returned five actionable items, all applied:
resolvePinShortcutIcon(k) === PIN_SHORTCUT_ICONS[k]for every own key — that restates the implementation, and thetypeofcompanion was already guaranteed by thesatisfies Record<string, LucideIcon>annotation.template-launch-prompt.test.ts,templates/service.test.ts, andmcp-handlers.test.ts. Re-running the battery confirmed nothing was lost: thetemplateIdmutant is still killed by the existing suites.toHaveBeenCalledTimes(1)after a singlemutate, and the two "the other toast didn't fire" cross-checks).apps/webpins vitest 2.1.9, andrestoreAllMockshas never reset module-factoryvi.fn()s in either major, so the justification now names the actual reason rather than a version.🤖 Generated with Claude Code