# Agent Memory Changelog

## 2026-03-16 (5) — Redis cache key patterns

- Added full Redis cache key patterns to `api-endpoints.md` for both graphql-knowledge (`playlistMetadataById`, 1h TTL) and graphql-analytics (10 dataloaders with TTLs: 1h / 24h / 1 week / request-scoped)
- Documented which loaders use `RedisZodDataLoader` (durable Redis cache) vs `ZodDataLoader` (request-scoped in-memory only)
- Documented `resolveStorefrontForCacheKey()` normalisation logic and `'null'` sentinel for non-Apple playlists

## 2026-03-16 (4) — Search behaviour, listeners formula, stream discrepancy, Chartmetric ingestion
- Added `sony_playlist_owners` and `SONY_OWNED_PLAYLISTS` table documentation to `data-model.md`
- Added Chartmetric ingestion table (3 mechanisms: priority/hourly/sony_playlist_owners) to `data-model.md` and agent definition
- Added playlist search direct-ID-lookup behaviour to `api-endpoints.md` and agent definition (Spotify URI, bare 22-char ID, Apple Music ID → direct lookup; else Cortex search)
- Added Cortex Search scoring profile ACCOUNTADMIN caveat to `api-endpoints.md` and agent definition
- Added listeners metric definition and caveats to `data-model.md` and agent definition (Spotify only; storeuserid_varchar reset issue)
- Added Insights vs Apollo stream discrepancy section to `data-model.md` and agent definition (video streams excluded via DDEX gap; diagnostic query included)
- Noted ows-playlist commit `2c149864a` (double-prefix V_ view fix) in `api-endpoints.md`
- Noted dbt-analytics `IN-16873` personalized playlist header metrics fix in `dbt-models.md`

## 2026-03-16 (3) — Priority playlist task graph added

- Added full priority playlist Snowflake task graph to `infrastructure.md` and agent definition — 13-task DAG, all produced tables, design patterns, deployment/diagnostics commands
- Corrected gsheets sync section to clarify it is register maintenance only (minor), not a data pipeline
- Added `runOnChange:true` incompatibility warning for gsheets sync tasks

## 2026-03-16 (2) — Agent definition fixes

- Fixed hardcoded personal memory path (`~/.claude/agent-memory/`) → collab repo path (`claude/agent-memory/playlist-pages-expert/`) so memory works for all team members
- Replaced "MEMORY.md is currently empty" placeholder in agent definition with full accumulated knowledge inline — agent no longer requires path configuration to be useful
- Memory files copied into collab repo at `claude/agent-memory/playlist-pages-expert/` for version control

## 2026-03-16 — Full knowledge refresh

All repos synced: all were already up to date with remote master.

### Added

**dbt-models.md** (new file)

- Documented the full tier-split architecture introduced in IN-16920: `priority/`, `hourly/`, `non_priority/`, and `unioned/` layers
- Documented all unioned `V_` views as the stable external interface
- Documented `_STATE_DBT` incremental state models per tier
- Documented `CLASSIFY_PLAYLIST_OWNER` UDF and owner categories
- Documented `INFERRED_COMPILATION` field in current tracklist
- Documented `FIRST_ADDED_ON_DATE` field added in IN-16847
- Noted that priority tracklist/placements are Snowflake-task managed sources, NOT dbt models
- Listed all subdirectory structures per tier
- Captured Jenkins tag changes for separate tier build jobs

**data-model.md** (new file)

- Full reference table of all V_ views with column schemas
- Documented `GSHEETS_TO_HOURLY_PLAYLISTS` and `GSHEETS_TO_AM_HOURLY_PLAYLISTS` Snowflake tasks (IN-16924)
- Documented Apple Music playlists addition to HOURLY_PLAYLISTS
- V_PLAYLIST_METADATA column reference
- V_PLAYLISTS_BY_PLAYLIST_CURRENT_TRACKLIST column reference (including new fields: FIRST_ADDED_ON_DATE, INFERRED_COMPILATION)
- Priority-only sources list from unioned/sources.yml

**api-endpoints.md** (new file)

- Full ows-playlist endpoint inventory with handler function names
- Documented the V_view migration (commit 9af87fb71) — all table references now use unioned V_ views
- graphql-analytics DataLoader inventory
- graphql-knowledge playlistMetadataById dataloader detail: storefront cache key logic, includeHourlyPlaylists param
- Key recent commits across all three services
- `inferredCompilation` / compilation art flag flow

**frontend-components.md** (new file)

- Full PlaylistPage component tree
- PoT chart metrics (STREAMS, LISTENERS, FOLLOWERS, STREAMS_LISTENER, AVG_STREAMS)
- PoT dimensions (TOTAL, MARKET, DAILY_CHANGE) and graph type logic
- Demographics integration within PoT legend
- Storefront parameter handling (IN-16755)
- Feature flags table with all playlist-related constants
- Apollo GraphQL query hooks
- Key recent commits

**feature-flags.md** (new file)

- All Split.io flags across ows-playlist, graphql-analytics, graphql-knowledge, and frontend-insights
- Flag flow for `inferredCompilation` (multi-service)
- Noted which flags are permanent (DO NOT REMOVE)

**infrastructure.md** (new file)

- Snowflake roles for gsheets sync task
- Service users for graphql-knowledge
- Task schedules and ownership
- Warehouse naming conventions
- Related terraform-infra PR numbers (#31353, #31376, #31395)

**MEMORY.md** (updated)

- Rewrote index to reflect new topic file structure
- Added tier-split architecture summary at top
- Added quick-lookup tables for feature flags, Snowflake tasks

### Deprecated

Nothing deprecated — prior MEMORY.md content was absorbed into topic files. The original MEMORY.md's streaming/demographics coverage gap section has been preserved verbatim in `data-model.md`.

### Repo Sync Status (2026-03-16)

All repos were already up to date with remote master:

- `frontend-insights` — current branch: unknown (local commits ahead); remote master in sync
- `ows-playlist` — up to date
- `graphql-analytics` — up to date
- `graphql-knowledge` — up to date
- `dbt-analytics` — up to date
- `database` — up to date
- `terraform-infra` — up to date
