Skip to content

feat(research): persist popularity metrics#50

Merged
hubab1 merged 1 commit into
mainfrom
33b-research-metrics-workflow
Jul 26, 2026
Merged

feat(research): persist popularity metrics#50
hubab1 merged 1 commit into
mainfrom
33b-research-metrics-workflow

Conversation

@hubab1

@hubab1 hubab1 commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • add an app-independent Apple Ads popularity workflow for pre-live research-project keywords
  • persist popularity on canonical shared queries without creating fake tracked apps, keyword tracks, or refresh statuses
  • revalidate project/keyword incarnations and exact query scalars after provider suspension before one atomic write
  • reuse the sequential Apple Ads client with 100 terms per request, a 500-keyword workflow cap, storefront grouping, a seven-day cache policy, and structured partial outcomes
  • wire the optional workflow through AppServices using the current context app and exact web-session reconnect state

Correctness and safety

  • provider fetch and SwiftData persistence are split so the workflow owns rollback and commit
  • all post-provider paths revalidate generations and read the transaction-current cache
  • concurrent newer popularity wins; difficulty-only rows do not suppress the first real popularity result
  • missing context/session, reconnect-required, expiry, unsupported storefront, rate limiting, provider failures, cancellation, configuration changes, and not-found results have explicit outcomes
  • provider messages and web-session secrets are not exposed in outcomes
  • existing tracked apps, tracks, and refresh statuses remain unchanged

This progresses #3 but does not close it.

Validation

  • focused popularity, Apple Ads, dependency-wiring, and ranking regression suites passed
  • full OpenASO suite passed: 541 tests (545 parameterized test invocations)
  • project-file lint and whitespace checks passed

Known schema boundary

KeywordDailyMetric has no Apple Ads context dimension and only one legacy row timestamp. Persisted cache outcomes therefore report context as unknown, while the requested context is exposed only for evidence fetched by the current invocation.

@hubab1
hubab1 force-pushed the 33a-research-ranking-workflow branch from 458e647 to 334b55e Compare July 26, 2026 09:41
@hubab1
hubab1 force-pushed the 33b-research-metrics-workflow branch from 2d9b584 to 91131c8 Compare July 26, 2026 09:51
@hubab1
hubab1 changed the base branch from 33a-research-ranking-workflow to main July 26, 2026 09:51
@hubab1
hubab1 marked this pull request as ready for review July 26, 2026 09:55
@hubab1
hubab1 merged commit 009a693 into main Jul 26, 2026
2 checks passed
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