chore(comments): drop epic, sprint and review-round ids from the code
The code cited its plan instead of saying why: `E28 review J4`, `(R6 S3b)`, `S1 justified…`,
`deep-review round 5`. That plan lives in the private ops repo, so for every reader of this one the
citation was noise, and a sentence whose subject was the plan step ("round 2 showed…") hid its
lesson behind an id. Each one is gone and the "why" kept: a bare citation is deleted, a sentence
carrying a lesson is reworded around it ("a later attempt showed…").
Measured (`scripts/audit_metrics.py`, product code): 652 lines in 270 files carried an epic code by
the definition the next commit holds (507 / 241 by the old, two-digit-only one) -> 0. Across all
code, tests, scripts and configs: ~1100 epic-code lines plus ~320 sprint/round ids.
Behaviour unchanged, checked mechanically: every changed .py file has the same AST once docstrings
are blanked; css/sh/toml/yml/json files are identical once comments are stripped; the only
non-comment changes in TS/JS are test titles, one description string in a contract table, and five
ESLint messages, whose text is all the gates snapshot diff holds. Not touched: Markdown (docs and
the changelog keep their history), Alembic migrations, TV episode notation (`S2 · E5`), DESIGN.md
ids (`C1`, `B4`, `S3h`), tracker ids (`SEC-16`, `DX-17`).
One stale claim fixed on the way: test_hls_reaper's docstring said the player checkpoints "every
10 s whether or not it is playing", which plex/stream.py calls wrong; it now says what the code does.
This commit is contained in:
@@ -2,19 +2,18 @@ import type { FeedFilters } from "./api";
|
||||
|
||||
// Single source of truth for React Query keys. Every key root lives here exactly once, so a typo
|
||||
// at one of the ~200 call sites can no longer mint an orphan key that silently never invalidates
|
||||
// (the R7 driver: `["feed"]` was hand-written in 15+ files). CONTRACT: each function returns the
|
||||
// (the motive: `["feed"]` was hand-written in 15+ files). CONTRACT: each function returns the
|
||||
// SAME array shape the call sites used before, so TanStack's partial (prefix) matching is
|
||||
// unchanged — `qk.feed()` (`["feed"]`) still invalidates `qk.feed(filters)` (`["feed", filters]`).
|
||||
// Deliberately NOT bundling co-invalidations into helpers here: the clusters differ per call site
|
||||
// (some invalidate `feed` alone, others `feed` + `feed-summary`), so collapsing them would change
|
||||
// which queries refetch. Grouped invalidation stays opt-in per domain (see `invalidateDownloads`).
|
||||
// Extended per domain as R7 S2 migrates each area (S2a: feed/channels/playlists + shared roots).
|
||||
export const qk = {
|
||||
// --- shared roots (invalidated from more than one domain) ---
|
||||
me: () => ["me"] as const,
|
||||
myStatus: () => ["my-status"] as const,
|
||||
tags: () => ["tags"] as const,
|
||||
// Per-channel suggested user tags, learned from the manual-tag pattern (E8·S4). Separate root so
|
||||
// Per-channel suggested user tags, learned from the manual-tag pattern. Separate root so
|
||||
// accepting a suggestion can invalidate it without touching the whole tag catalog.
|
||||
tagSuggestions: () => ["tag-suggestions"] as const,
|
||||
|
||||
@@ -49,7 +48,7 @@ export const qk = {
|
||||
// arg) stays a prefix for a cross-source invalidation.
|
||||
savedViews: (...rest: unknown[]) => ["saved-views", ...rest],
|
||||
|
||||
// --- account / misc (R7 S2b) --- (me/myStatus/tags already declared as shared roots above)
|
||||
// --- account / misc --- (me/myStatus/tags already declared as shared roots above)
|
||||
accounts: () => ["accounts"] as const,
|
||||
version: () => ["version"] as const,
|
||||
// Static text bundled with the app (lib/releaseNotes), one file per language: never stale.
|
||||
@@ -88,7 +87,7 @@ export const qk = {
|
||||
adminLogs: (filters: object) => ["admin-logs", filters] as const,
|
||||
adminLogFacets: (filters: object) => ["admin-log-facets", filters] as const,
|
||||
adminStorage: () => ["admin-storage"] as const,
|
||||
// --- debug sessions (E16) ---
|
||||
// --- debug sessions ---
|
||||
debugSessions: () => ["debug-sessions"] as const,
|
||||
debugSession: (id: string) => ["debug-sessions", id] as const,
|
||||
debugSessionEvents: (id: string) => ["debug-sessions", id, "events"] as const,
|
||||
@@ -107,7 +106,7 @@ export const qk = {
|
||||
// array, a "union"/"group"/"contains" discriminator), so they take a variadic pass-through:
|
||||
// the value this factory centralizes is the ROOT string, and TanStack keys are `unknown[]`
|
||||
// anyway. Single-id plex keys stay precisely typed.
|
||||
// The Home surface (E24). `discover()` with no args is the prefix every mutation invalidates —
|
||||
// The Home surface. `discover()` with no args is the prefix every mutation invalidates —
|
||||
// pinning something changes the shelf AND can change the hero, so the two are never invalidated
|
||||
// separately. The reroll has its own key so pressing "Mást kérek" does not refetch the rails —
|
||||
// but it sits UNDER the same root, because a sibling root ("discover-pick") is not matched by
|
||||
@@ -119,7 +118,7 @@ export const qk = {
|
||||
plex: () => ["plex"] as const,
|
||||
plexWatchLink: () => ["plex-watch-link"] as const,
|
||||
plexLibrary: (...rest: unknown[]) => ["plex-library", ...rest],
|
||||
// Discover surface (E5 S4): the rail payload keyed by scope+lang; `plexDiscover()` (no args) matches
|
||||
// Discover surface: the rail payload keyed by scope+lang; `plexDiscover()` (no args) matches
|
||||
// both for a prefix invalidation after a watched-toggle. Surprise is its own key so the ↻ reshuffle
|
||||
// refetches it alone.
|
||||
plexDiscover: (...rest: unknown[]) => ["plex-discover", ...rest],
|
||||
@@ -129,7 +128,7 @@ export const qk = {
|
||||
// card in place (and reverts it on a failure) rather than reshuffle the rail under the viewer.
|
||||
plexSurprise: (...rest: unknown[]) => ["plex-surprise", ...rest],
|
||||
plexSuggest: (...rest: unknown[]) => ["plex-suggest", ...rest],
|
||||
// Optional trailing `lang` (E5 S6): a language switch remounts the detail with a new key so HU/EN
|
||||
// Optional trailing `lang`: a language switch remounts the detail with a new key so HU/EN
|
||||
// metadata is cached separately. Omitting it (e.g. for a prefix invalidation) still matches both.
|
||||
plexShow: (showId?: string, lang?: string) =>
|
||||
showId !== undefined
|
||||
@@ -155,7 +154,7 @@ export const qk = {
|
||||
/** The lists the SERVER puts in the reader's alphabet from the language stored in their preferences
|
||||
* (backend `lang_for_user` → `app/collation.py`), so their keys carry no language. Once a language
|
||||
* switch has been saved they are asked for again (App's `changeLanguage`): they re-sort, and a
|
||||
* title-sorted feed never reads its next page under the other alphabet's cursor (E30 review). */
|
||||
* title-sorted feed never reads its next page under the other alphabet's cursor. */
|
||||
export const LANGUAGE_ORDERED = [
|
||||
qk.feed(),
|
||||
qk.channels(),
|
||||
|
||||
Reference in New Issue
Block a user