Skip to content

fix: scope Raycast frecency storage - #583

Closed
JustYannicc wants to merge 115 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-wave4-frecency-scoped-storage
Closed

fix: scope Raycast frecency storage#583
JustYannicc wants to merge 115 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-wave4-frecency-scoped-storage

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

What changed

  • Added extension-scoped frecency storage keys: sc-frecency:<extensionName>:<namespace>.
  • Reused the existing scoped JSON migration path so legacy sc-frecency-<namespace> rankings are copied into the scoped key on first read.
  • Extended the focused frecency hook test harness to load the real storage-scope/context runtime and verify scoped-key behavior.

Why

  • The old sc-frecency-<namespace> key could collide across Raycast extensions that reused the same namespace.
  • Keeping legacy migration preserves existing learned rankings while moving future writes to extension-scoped storage.

Compatibility impact

  • Public useFrecencySorting API behavior is unchanged.
  • Existing legacy rankings are migrated without deletion or ranking loss.
  • No pruning is implemented: dropping retained entries would change semantics for items that disappear and later reappear, because those items are expected to keep their previous ranking data.

How tested

  • node --test scripts/test-use-frecency-sorting.mjs
  • npm run typecheck:renderer
  • Codex LSP diagnostics on src/renderer/src/raycast-api/hooks/use-frecency-sorting.ts and src/renderer/src/raycast-api/hooks/storage-scope.ts.

Performance evidence

  • Focused test fixture starts with the legacy key retaining 2 entries / 102 serialized bytes.
  • Legacy migration copies the full payload to each extension scoped key without mutating the legacy payload.
  • After an alpha-extension visit, the alpha scoped key retains 3 entries / 150 serialized bytes while bravo-extension remains isolated.
  • After a bravo-extension visit to an existing migrated entry, the bravo scoped key retains 2 entries / 102 serialized bytes.

Stack validation

  • Started from required base commit 206eab8280a2eb91a57e4e74ea6df99e45a55cb4 on branch codex/perf-wave3-integration-stack-20260704 equivalence, then created codex/perf-wave4-frecency-scoped-storage.
  • Verified the base commit is an ancestor of this branch before implementation.

Replaces

  • Nothing; this is the wave 4 frecency scoped-storage child implementation.

…perf-wave2-integration-stack-20260704

# Conflicts:
#	src/renderer/src/raycast-api/hooks/use-cached-promise.ts
…perf-wave2-integration-stack-20260704

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime-renderers.tsx
#	src/renderer/src/raycast-api/list-runtime.tsx
…perf-wave2-integration-stack-20260704

# Conflicts:
#	src/renderer/src/CameraExtension.tsx
…perf-wave2-integration-stack-20260704

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime.tsx
…perf-wave2-integration-stack-20260704

# Conflicts:
#	scripts/bench-script-command-discovery.mjs
#	scripts/benchmark-file-search-delete-batch.mjs
#	scripts/lib/script-command-runner-harness.mjs
#	scripts/lib/ts-import.mjs
#	scripts/test-file-search-delete-batch.mjs
#	scripts/test-script-command-runner.mjs
#	src/main/file-search-index.ts
#	src/main/main.ts
…perf-wave2-integration-stack-20260704

# Conflicts:
#	scripts/lib/script-command-runner-harness.mjs
#	scripts/lib/ts-import.mjs
#	scripts/test-extension-lifecycle-sandbox.mjs
#	scripts/test-script-command-runner.mjs
#	src/main/main.ts
#	src/renderer/src/ExtensionView.tsx
…perf-wave2-integration-stack-20260704

# Conflicts:
#	.github/workflows/project-checks.yml
#	scripts/test-root-search-perf.mjs
#	src/renderer/src/CameraExtension.tsx
#	src/renderer/src/raycast-api/list-runtime.tsx
…erf-wave3-integration-stack-20260704

# Conflicts:
#	package.json
#	scripts/measure-extension-bundle-cache.mjs
#	scripts/test-icon-runtime-file-icon-cache.mjs
#	src/main/extension-runner.ts
#	src/renderer/src/components/HiddenExtensionRunners.tsx
#	src/renderer/src/raycast-api/icon-runtime-render.tsx
…/perf-wave3-integration-stack-20260704

# Conflicts:
#	scripts/test-browser-search-performance.mjs
#	scripts/test-root-search-perf.mjs
@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by the clean consolidated wave4 renderer/Raycast PR: #599. That branch contains this PR's covered change on current main without the inherited broad-stack noise.

@JustYannicc JustYannicc closed this Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant