> For the complete documentation index, see [llms.txt](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/phases/phase_24/prd_phase_24.md).

# PRD Phase 24: Trend Finder Outlier Signal Upgrade

**Status**: Complete **Sessions**: 9 (initial estimate) **Estimated Duration**: 12-18 days **Source Of Truth**: Folded Outlier Lab review source memo in this PRD

**Progress**: 9/9 sessions (100%)

***

## Overview

Phase 24 turns the Outlier Lab review into Trend Finder-native capabilities. The phase improves signal quality, enrichment cost control, operator setup, dense triage, media-safe evidence review, recurring run visibility, and static Brief delivery without copying Instagram/Reels behavior or weakening existing source compliance, browser-safety, and provenance rules.

The phase is deliberately additive. The existing Trend Finder six-factor score, reviewed-source gate, private cache boundaries, local run controls, and generated Watchlist semantics remain authoritative unless an individual session explicitly extends them with tested, browser-safe contracts.

This phase PRD and its session stubs preserve the full actionable and non-actionable content from the old ongoing-project source memo. The original ongoing-project file was deleted after this fold-in without losing the Outlier Lab findings, rejected ideas, implementation order, source references, or acceptance checks.

***

## Folded Source Memo

### Review Scope

The source review was performed on 2026-06-07 against the local `EXAMPLES/outlier-lab/` project, the current Trend Finder documentation under `docs/extensions/`, and nearby Trend Finder source contracts.

Decision: there are objective improvements worth extracting from the example. They must be adapted as Trend Finder-native capabilities. They must not be copied as an Instagram/Reels product, used to bypass reviewed-source compliance, or used to weaken browser-safety or provenance boundaries.

### Current Trend Finder Baseline

Trend Finder already has:

* Source health, provenance, runtime readiness, Engine Replay, and browser-safe evidence boundaries.
* Local run control and a scoped scheduler command path.
* Creator Lens save/rerun behavior.
* Generated Trends, Hidden Gems, Sources, Watchlist, and Brief surfaces.
* Local visibility filters for presentation-only hiding/restoring.
* Historical snapshots, movement analysis, prediction writing, retros, and script-only backtests.

The example still exposes objective gaps:

* Stronger source setup UX.
* Local target lists.
* Source-local outlier scoring.
* Cost-aware enrichment.
* Evidence media previews.
* Table-first triage.
* Schedule controls.
* Optional static Brief delivery.

### Extractable Findings Catalog

| ID | Finding                                                                | Evidence In Example                                                                                                                                                                                                    | Current Trend Finder Gap                                                                                                                                                                                                       | Trend Finder-native Extraction                                                                                                                                                                                                                                                                                                                                                                                                | Objective Value                                                                                                                                            | Session       |
| -- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| 1  | Source-local outlier normalization                                     | `build.py` computes plays divided by the creator account's own median and labels Normal, Working, Replicable, and Breakout bands.                                                                                      | `trend-finder-scoring.md` has log-scaled public metrics and source quality caps, but no per-source-entity baseline. Raw views, stars, points, downloads, or upvotes can favor already-large sources.                           | Add optional source-local baseline signals for sources with stable entity identity such as creator/channel, repo owner, community, publisher, product, or vendor. Store a browser-safe `entityOutlierRatio` or `relativeEngagementRatio` on evidence or scoring-only evidence. Use it as a bounded lift to momentum or evidence strength. Document formula, unavailable states, and small-sample caps.                        | Reduces popularity bias, separates unusually strong low-volume evidence from baseline attention, and supports early actionable opportunity discovery.      | S01           |
| 2  | Reviewed source and target onboarding UI                               | `serve.py` and `admin.html` provide localhost admin UI, local Apify token storage, creator search, profile validation, add/remove target lists, private-account blocking, and metadata before saving.                  | `trend-finder-sources.md` documents reviewed source declarations and configured Apify sources, but source configuration remains file/env driven. Creator Lens edits are UI-backed, while source-specific target lists are not. | Add a local-only Source Setup panel on Sources or Engine Replay. Show reviewed declarations, compliance status, credential readiness, configured/active state, quality tier, item cap, and warnings. For sources with targets, allow local target/query management through a token-gated loopback bridge. UI writes only reviewed source IDs and safe target fields.                                                          | Removes brittle JSON/env editing, makes declaration vs configured state understandable, and reduces invalid source configs and placeholder Actor mistakes. | S04           |
| 3  | Delta-aware costly enrichment                                          | `refresh.py` uses cheap stats first, expensive transcripts only for items without transcripts, and preserves existing transcripts. README frames this as avoiding repeated spend.                                      | Trend Finder has snapshots, history, source caps, and paid Google Trends demand limits, but no reusable "cheap collect first, enrich only new/changed/high-value items" contract.                                              | Add an enrichment cache keyed by stable source item IDs. Let adapters emit cheap metadata first, then request paid or slow enrichments only for new, changed, or selected high-candidate evidence. Track saved/skipped counts in Engine Replay. Publish browser-safe summaries only.                                                                                                                                          | Controls recurring paid-source spend, keeps refreshes faster and less failure-prone, and proves costly enrichments are bounded.                            | S02           |
| 4  | Table-first Signal Workbench with local triage state                   | `build.py` renders a sortable, searchable table with creator chips, band filters, compact/comfy density, grid toggle, and `localStorage` completed/deleted rows.                                                       | Trend Finder has selected-topic cockpit tabs but no global dense table for scanning all topics/evidence. Watchlist is generated/read-only, and visibility settings are presentation-only rather than action triage states.     | Add a Signal Workbench table or Brief table mode. Rows represent topics first with expandable evidence rows. Search topic, summary, creator angle, hooks, questions, evidence title/snippet, and source. Filter source role, provenance, movement, hidden-gem state, score band, runtime/fallback state, and source health. Add local-only `acted-on`, `ignored`, `revisit`, and optional notes separate from Watchlist.      | Supports repeated creator/operator review, prevents re-reviewing already handled items, and preserves generated data while allowing local annotations.     | S06           |
| 5  | Browser-safe media evidence previews                                   | `refresh.py` downloads thumbnails; `extract_clips.py` and `refresh.py` extract muted first-three-second MP4 hook clips; `build.py` uses local thumbnails/clips in a modal before falling back to the full source link. | `TrendEvidenceItem` has text, URL, timestamp, relevance, and metrics only. `apify-normalizers.ts` excludes image, media, thumbnail, and transcript fields. The reviewed YouTube source is metadata-oriented and low tier.      | Define optional `evidenceAssets` for reviewed sources that may safely expose thumbnails or short preview artifacts. Keep transcript text private unless a source compliance doc explicitly allows bounded excerpts. Prefer local/proxied safe thumbnails over hotlinked remote images when terms allow. Surface asset provenance and failures in Engine Replay and evidence cards.                                            | Improves creator/video/news verification, makes evidence faster to inspect, and makes media handling explicit instead of leaking raw source fields.        | S03           |
| 6  | Scheduler and first-run setup controls                                 | `admin.html` exposes schedule choices; `serve.py` patches cron and starts refresh; setup gives a clear first-run path before data exists.                                                                              | `trend-finder-pipeline.md` documents scoped scheduler commands, but cadence/status remains CLI-oriented. Trends has a run button, but cadence/status management is not a first-class UI surface.                               | Add local scheduler status and cadence controls where AI OS supports scheduler configuration. Show last scoped run, next scheduled run, skipped/failed status, and extension enablement. Provide first-run checklist for enablement, credentials, reviewed source config, runtime readiness, run now, and Engine Replay review.                                                                                               | Turns Trend Finder from manual run plus docs into an operable recurring workflow and reduces drift between docs, env config, and actual scheduler state.   | S05           |
| 7  | Optional static Brief export                                           | `build.py` generates standalone `index.html`; GitHub Actions refreshes data and commits generated assets; `vercel.json` applies cache headers.                                                                         | Extension docs say generated HTML report output is not implemented; Brief is the current delivery surface.                                                                                                                     | Add optional static Brief export that writes a browser-safe standalone report from the current Trend Finder payload. Export only safe summaries, source health, public evidence links, provenance labels, and bounded prediction/retro context. Exclude prompts, raw source dumps, private snapshots, logs, credentials, local triage notes, and account auth. Treat hosting/deployment as opt-in docs, not default behavior. | Gives operators a shareable/read-only digest without requiring the full app and aligns with the documented but deferred HTML report path.                  | S07           |
| 8  | Cost estimation and spend transparency                                 | README documents a per-run cost model and monthly cost band, and setup makes paid-source spend visible before scheduling.                                                                                              | Trend Finder enforces cost ceilings via per-source `maxTotalChargeUsd`, collection budget env, and Google Trends demand caps, but no UI shows estimated/actual spend or projected cadence cost.                                | Surface bounded actual/estimated spend per source/run in Engine Replay and/or Sources, labeling estimates when exact charges are unavailable. Project recurring spend at configured cadence. Keep it metric-only and browser-safe. Do not expose billing payloads, account IDs, or Actor internals. Tie projections to existing caps.                                                                                         | Makes cost consequences of cadence/source selection visible and complements delta-aware enrichment by showing what is spent.                               | S02           |
| 9  | Exclude pinned, stickied, promoted, and sponsored items from baselines | `refresh.py` sets `skipPinnedPosts: True` on the stats pass so pinned reels do not enter the baseline.                                                                                                                 | Trend Finder normalizers have no pinned, stickied, promoted, sponsored, or ad handling. Such items can distort evidence, engagement, and source-local baselines.                                                               | When a reviewed source exposes these flags, exclude or down-weight items from engagement, evidence strength, and especially baseline computation. Record dropped/down-weighted counts in Engine Replay. Add per-source declaration handling rather than assuming every source exposes flags.                                                                                                                                  | Protects baseline and engagement integrity so source-local outliers reflect organic attention, not placement.                                              | S01           |
| 10 | Retention and pruning contract for enrichment and media stores         | `refresh.py` keeps only the active 28-day window and prunes clips/thumbs no longer in the keep set; `vercel.json` caches content-addressed assets as immutable while HTML revalidates.                                 | Proposed enrichment and media stores have no retention contract yet. Existing private snapshots, predictions, and retros have an 84-day/12-week read window but no explicit time/size pruning in their named helpers.          | Define retention/pruning for enrichment cache and media assets keyed by active evidence IDs, prune out-of-window entries/files each run, and record counts in Engine Replay. Allow content-addressed assets to use immutable cache headers while payload/report revalidates. Verify/document explicit retention for existing private archives if not enforced elsewhere.                                                      | Bounds local cache/asset growth and gives new stores a safe lifecycle before recurring use.                                                                | S02, S03, S07 |
| 11 | Outlier banding with actionability semantics                           | `build.py` maps ratios to Normal, Working, Replicable, and Breakout, with Breakout framed as often unrepeatable and Replicable as the sweet spot.                                                                      | Finding 1 covers storing ratios and formula/bands, but not the insight that the highest lift may be least actionable.                                                                                                          | Band source-local lift and label bands by actionability for the active Creator Lens, not raw magnitude alone. Treat extreme lift as verify-before-acting/likely one-off and moderate sustained lift as more replicable. Keep this as guidance layered on bounded score lift, not a ranking override; mark it heuristic, not guarantee.                                                                                        | Aligns banding with early actionable opportunities and prevents treating the largest ratio as automatically best.                                          | S01           |
| 12 | Live per-stage run progress during the running phase                   | `serve.py` starts refresh as a subprocess, writes `refresh.log`, returns PID/log path, and the admin UI tells the operator where to watch progress.                                                                    | `use-trend-finder-run.ts` has coarse lifecycle phases, elapsed time, and 409 overlap guard, but the long `running` phase is a black box until completion. Pipeline stages already exist for Engine Replay after the run.       | Surface the sanitized stage sequence live during `running`: current stage, completed stages, and per-source counts where available. Reuse Engine Replay stage taxonomy. Keep it loopback-only and browser-safe; stream stage markers only, never raw logs, prompts, provider responses, or Actor/Dataset internals.                                                                                                           | Turns the longest local run into observable progress and reuses existing stage definitions rather than inventing new pipeline structure.                   | S05           |
| 13 | Loopback bridge hardening for file-serving surfaces                    | `serve.py` binds localhost, resolves requested paths, enforces root containment, serves through content-type checks, and sets `Cache-Control: no-store` on API JSON.                                                   | Existing Trend Finder bridges are loopback-only/token-gated JSON config surfaces, not file-serving surfaces. Source setup, media assets, and static export introduce path traversal and content-type risks.                    | Any new local surface that serves or reads files must use loopback binding, token gating, path containment to an allowed root, content-type allowlists, and `no-store` on dynamic responses. Restrict served paths to generated asset/export directories and never serve cache/auth roots.                                                                                                                                    | Adds new file-serving surfaces without weakening existing loopback/token posture. This guardrail lands with findings 2, 5, and 7.                          | S03, S04, S07 |

### Things Not To Copy Directly

* Do not add Instagram/Reels collection without a separate source compliance review and reviewed source declaration.
* Do not expose raw transcripts in browser evidence by default.
* Do not self-commit generated private AI OS runtime data or media assets as a default workflow.
* Do not make public Vercel deployment the default for Trend Finder output.
* Do not replace Trend Finder's six-factor topic score with a single outlier ratio. Source-local outlier ratio is only a bounded scoring signal.
* Do not turn the generated Watchlist into a mutable bookmark list. Local triage annotations stay separate from generated watchlist output.

### Re-verified As Already Handled

The source memo rejected these example patterns after checking current Trend Finder code. Do not re-propose them during Phase 24 planning.

| Example Pattern                                                             | Already In Trend Finder                                                                                                             |
| --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Exponential backoff retry on transient 429/5xx in `refresh.py` `apify_get`. | `hn-adapter.ts` `fetchWithRetry`; `scripts/lib/apify/client.ts` retries; Google Trends demand retries.                              |
| Bounded run/wait timeouts in `wait_for_run` and workflow `timeout-minutes`. | Collector `TREND_FINDER_COLLECTOR_TIMEOUT_MS` and per-source `timeoutMs` budget clamping.                                           |
| Single-flight/no-overlap scheduled runs.                                    | `scheduler-runner.ts` lock/concurrency key and run hook 409 overlap behavior.                                                       |
| Basic run lifecycle feedback with PID/status.                               | `use-trend-finder-run.ts` progress phases plus elapsed timer. Only per-stage streaming is new.                                      |
| Paid-source spend ceilings.                                                 | Per-source `maxTotalChargeUsd`, collection budget env, and Google Trends demand charge cap. Only spend surfacing is new.            |
| Dataset field projection on fetch.                                          | Payloads are already bounded by tier caps and normalizer field exclusions; separate fetch-time projection was not worth extracting. |

### Documentation Update Map

Implement documentation in this order unless session realities require a narrower update:

1. `docs/extensions/trend-finder-scoring.md`: source-local normalization, bounded score use, pinned/stickied/promoted exclusions, and actionability banding.
2. `docs/extensions/trend-finder-pipeline.md`: enrichment cache contract, retention/pruning, spend accounting, scheduler UI state, live progress, and optional static Brief export.
3. `docs/extensions/trend-finder-sources.md`: source setup UI, target-list constraints, compliance-gated configuration, pinned/promoted handling, and source spend reporting.
4. `docs/extensions/trend-finder-ui-surfaces.md`: Signal Workbench/table mode, local triage state, media evidence assets, first-run setup surface, live progress, and loopback file-serving hardening.
5. `docs/extensions/trend-finder-runtime-and-provenance.md`: Engine Replay labels for enrichment skips, spend, media asset failures, scheduler status, report export, pruned counts, dropped pinned/promoted items, and live stage progress.

### Priority And Dependency Order

Original priority recommendation:

1. Source-local outlier normalization.
2. Delta-aware costly enrichment.
3. Signal Workbench with local triage state.
4. Source setup and target-list UI.
5. Scheduler/first-run controls.
6. Browser-safe media evidence previews.
7. Optional static Brief export.

Second-pass layering:

1. Findings 9 and 11 land with finding 1.
2. Finding 13 lands with findings 2, 5, and 7.
3. Finding 10 lands with findings 3 and 5.
4. Finding 8 lands with or just after finding 3.
5. Finding 12 is independent and lowest urgency; ship it when run control is next touched.

The resulting session order is S01 through S09 in the Progress Tracker.

### Shared Implementation Rules

* Preserve Trend Finder's reviewed-source compliance gate. UI configuration can only write reviewed source IDs and safe target fields.
* Keep raw prompts, provider responses, account auth, Actor internals, raw transcripts, private snapshots, and private caches out of browser payloads and static exports.
* Store generated private runtime state under existing private cache/data conventions.
* Do not add workflows that commit local runtime data or media by default.
* Keep local-only bridges loopback-bound, token-gated, path-contained, and restricted to explicit roots before any file-serving surface ships.
* Treat example paths as implementation references, not code to copy.
* Translate Instagram-specific example names into Trend Finder terms such as source, target, evidence, topic, asset, and run.

### Active EXAMPLES Reference Index

Use these local references during `plansession` and implementation:

* Outlier scoring and bands: [EXAMPLES/outlier-lab/build.py:115](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:115), [EXAMPLES/outlier-lab/build.py:167](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:167), [EXAMPLES/outlier-lab/build.py:190](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:190), [EXAMPLES/outlier-lab/build.py:507](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:507), and [EXAMPLES/outlier-lab/refresh.py:149](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/refresh.py:149).
* Delta-aware enrichment and cost framing: [EXAMPLES/outlier-lab/refresh.py:149](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/refresh.py:149), [EXAMPLES/outlier-lab/refresh.py:168](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/refresh.py:168), [EXAMPLES/outlier-lab/refresh.py:221](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/refresh.py:221), [EXAMPLES/outlier-lab/refresh.py:395](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/refresh.py:395), and [EXAMPLES/outlier-lab/README.md:86](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/README.md:86).
* Asset previews, pruning, and file hardening: [EXAMPLES/outlier-lab/refresh.py:293](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/refresh.py:293), [EXAMPLES/outlier-lab/refresh.py:318](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/refresh.py:318), [EXAMPLES/outlier-lab/refresh.py:361](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/refresh.py:361), [EXAMPLES/outlier-lab/extract\_clips.py:31](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/extract_clips.py:31), [EXAMPLES/outlier-lab/build.py:613](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:613), [EXAMPLES/outlier-lab/build.py:844](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:844), [EXAMPLES/outlier-lab/serve.py:110](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/serve.py:110), [EXAMPLES/outlier-lab/serve.py:211](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/serve.py:211), and [EXAMPLES/outlier-lab/vercel.json:13](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/vercel.json:13).
* Source setup and target management: [EXAMPLES/outlier-lab/serve.py:46](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/serve.py:46), [EXAMPLES/outlier-lab/serve.py:91](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/serve.py:91), [EXAMPLES/outlier-lab/serve.py:156](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/serve.py:156), [EXAMPLES/outlier-lab/serve.py:180](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/serve.py:180), [EXAMPLES/outlier-lab/serve.py:241](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/serve.py:241), [EXAMPLES/outlier-lab/serve.py:276](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/serve.py:276), [EXAMPLES/outlier-lab/serve.py:355](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/serve.py:355), [EXAMPLES/outlier-lab/admin.html:207](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/admin.html:207), [EXAMPLES/outlier-lab/admin.html:378](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/admin.html:378), [EXAMPLES/outlier-lab/admin.html:428](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/admin.html:428), [EXAMPLES/outlier-lab/configure.py:64](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/configure.py:64), [EXAMPLES/outlier-lab/configure.py:98](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/configure.py:98), and [EXAMPLES/outlier-lab/configure.py:214](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/configure.py:214).
* Scheduler and run controls: [EXAMPLES/outlier-lab/admin.html:239](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/admin.html:239), [EXAMPLES/outlier-lab/admin.html:494](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/admin.html:494), [EXAMPLES/outlier-lab/admin.html:528](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/admin.html:528), [EXAMPLES/outlier-lab/serve.py:166](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/serve.py:166), [EXAMPLES/outlier-lab/serve.py:293](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/serve.py:293), [EXAMPLES/outlier-lab/serve.py:336](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/serve.py:336), and [EXAMPLES/outlier-lab/README.md:48](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/README.md:48).
* Signal Workbench and triage: [EXAMPLES/outlier-lab/build.py:398](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:398), [EXAMPLES/outlier-lab/build.py:541](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:541), [EXAMPLES/outlier-lab/build.py:557](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:557), [EXAMPLES/outlier-lab/build.py:574](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:574), [EXAMPLES/outlier-lab/build.py:664](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:664), [EXAMPLES/outlier-lab/build.py:693](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:693), [EXAMPLES/outlier-lab/build.py:760](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:760), and [EXAMPLES/outlier-lab/build.py:935](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:935).
* Static export delivery: [EXAMPLES/outlier-lab/build.py:500](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/build.py:500), [EXAMPLES/outlier-lab/index.html:1](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/index.html:1), [EXAMPLES/outlier-lab/.github/workflows/refresh.yml:35](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/.github/workflows/refresh.yml:35), [EXAMPLES/outlier-lab/.github/workflows/refresh.yml:40](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/.github/workflows/refresh.yml:40), and [EXAMPLES/outlier-lab/vercel.json:13](https://github.com/moshehbenavraham/ai-os/blob/main/home/aiwithapex/projects/aios/EXAMPLES/outlier-lab/vercel.json:13).

***

## Progress Tracker

| Session | Name                                            | Status   | Est. Tasks | Validated  |
| ------- | ----------------------------------------------- | -------- | ---------- | ---------- |
| 01      | Source-local Scoring Signals                    | Complete | \~12-25    | 2026-06-07 |
| 02      | Delta-aware Enrichment And Spend Accounting     | Complete | \~12-25    | 2026-06-07 |
| 03      | Browser-safe Evidence Assets And File Hardening | Complete | \~12-25    | 2026-06-08 |
| 04      | Source Setup And Target Configuration           | Complete | \~12-25    | 2026-06-08 |
| 05      | Scheduler First-run And Live Progress Controls  | Complete | \~12-25    | 2026-06-08 |
| 06      | Signal Workbench And Local Triage               | Complete | \~12-25    | 2026-06-08 |
| 07      | Static Brief Export                             | Complete | \~12-25    | 2026-06-08 |
| 08      | Cross-surface Documentation And Reference Mode  | Complete | \~12-25    | 2026-06-08 |
| 09      | End-to-end Validation And Release Hardening     | Complete | \~12-25    | 2026-06-08 |

### Session 09 Implementation Closeout Note

Session 09 records the folded Outlier Lab source memo as implemented through the Phase 24 session artifacts, focused regressions, browser dogfood proofs, private artifact checks, and security-compliance notes. The stale ongoing-project memo remains deleted; completion evidence now lives in this PRD and `.spec_system/archive/sessions/phase24-session09-end-to-end-validation-release-hardening/`. Session 09 validation passed, the session-processing loop ended, and the next workflow step is Phase Transition at `audit`.

***

## Completed Sessions

* `phase24-session01-source-local-scoring-signals`
* `phase24-session02-delta-aware-enrichment-spend-accounting`
* `phase24-session03-browser-safe-evidence-assets-file-hardening`
* `phase24-session04-source-setup-target-configuration`
* `phase24-session05-scheduler-first-run-live-progress-controls`
* `phase24-session06-signal-workbench-local-triage`
* `phase24-session07-static-brief-export`
* `phase24-session08-cross-surface-documentation-reference-mode`
* `phase24-session09-end-to-end-validation-release-hardening`

***

## Objectives

1. Add source-local baseline and actionability signals that reduce popularity bias while keeping the existing six-factor score authoritative.
2. Add delta-aware enrichment, retention, pruning, and spend visibility so costly source work is bounded and observable.
3. Add browser-safe evidence asset and file-serving contracts before any media preview or static export path ships.
4. Make reviewed source setup, target lists, scheduler state, first-run status, and live run progress operable from local UI surfaces.
5. Add a dense Signal Workbench with local-only triage state that never mutates generated Trend Finder output or Watchlist semantics.
6. Add an opt-in static Brief export and finish the phase with aligned docs, in-app reference mode, tests, and security validation.

***

## Prerequisites

* Phase 23 complete.
* Existing Trend Finder extension, source declarations, Engine Replay, scoped scheduler job, Creator Lens, visibility controls, snapshots, predictions, retros, and reviewed Apify source contracts remain available.
* Source compliance documents must be re-reviewed at implementation time before any new source field, target field, media asset, or enrichment output is exposed to browser payloads.
* Generated private runtime files, caches, logs, credentials, prompts, raw provider responses, raw Actor payloads, raw transcripts, and private snapshots must remain out of browser data and static exports.

***

## Technical Considerations

### Architecture

Phase 24 should follow the existing Trend Finder split between script-only runtime code and browser-safe UI contracts. Scoring, source normalization, collection, enrichment, cache retention, spend capture, and export generation belong in script-side or shared typed helpers. Browser surfaces consume only validated, bounded Trend Finder payload fields or local-only presentation state.

Local bridges added by this phase must follow the existing loopback plus token model. Any file-serving bridge also needs path containment to explicit roots, content-type allowlists, and dynamic response `no-store` behavior before it is connected to UI.

### Technologies

* Bun script runtime and test runner.
* React 19, TanStack Start, and TanStack Router for Trend Finder surfaces.
* Zod-backed Trend Finder payload parsing and additive schema defaults.
* Existing scheduler runner and scoped Trend Finder job.
* Existing Apify, Google Trends demand, Engine Replay, and private cache conventions.

### Risks

* Source compliance drift: Re-review terms, source documents, and reviewed declarations before adding entity identity, target fields, promoted flags, media assets, or enrichment outputs.
* Browser privacy regression: Keep raw prompts, provider responses, account auth, raw transcripts, raw source dumps, private snapshots, and cache paths script-only or private.
* Cost and cache growth: Add spend estimates, cache hit/saved counts, and retention/pruning before recurring enrichment or media assets scale.
* File-serving attack surface: Add loopback binding, token checks, path containment, explicit roots, content-type allowlists, and `no-store` dynamic responses before media or export preview paths ship.
* Payload size growth: Keep the shared extension payload cap and degrade gracefully when source breadth, assets, or workbench data grows.

### Relevant Considerations

* \[P02] **New source adapters need per-source compliance review**: This phase extends reviewed source fields and target configuration only after source review.
* \[P06] **Apify actor outputs remain operator-dependent**: Source setup, spend, enrichment, and degraded states must expose safe source IDs/statuses rather than raw Actor internals.
* \[P02] **Extension payloads and demo labels stay bounded**: New scoring, asset, progress, and export fields must stay capped and explicit.
* \[P11] **Scheduler state/log privacy boundary**: Live progress can stream sanitized stage markers, not raw logs or provider/source payloads.
* \[P15] **Aggregate collection must stay budgeted**: Enrichment and spend work should preserve collection budgets and degraded summaries.
* \[P05] **Script-only runtime boundary**: Auth, transport, analyst, scoring, snapshot, enrichment, cache, and source helpers stay out of browser code.
* \[P00] **Do not document planned features as implemented**: Docs and in-app reference updates must distinguish shipped behavior from optional or deferred export/hosting paths.

***

## Success Criteria

Phase complete when:

* [x] All 9 sessions completed.
* [x] Source-local ratios, promoted/pinned exclusion, actionability bands, and bounded score lifts are covered by tests and docs.
* [x] Enrichment caches, spend visibility, asset manifests, and static exports are private-by-default and have retention/pruning contracts.
* [x] Source setup, scheduler controls, first-run status, and live progress expose only browser-safe state through hardened local bridges.
* [x] Signal Workbench triage state remains local-only and separate from generated Watchlist semantics.
* [x] Updated manuals and in-app Reference mode align with implemented behavior.
* [x] Trend Finder unit, script, type, lint, build, and relevant browser tests pass or have documented unrelated blockers.
* [x] Security/compliance review confirms no new browser-visible private data, credential, raw transcript, raw log, raw source payload, or unsafe file path channel.

***

## Dependencies

### Depends On

* Phase 23: Non-Hermes Routes, Polish And Closeout
* Existing Trend Finder scoring, source, Engine Replay, scheduler, Creator Lens, visibility, and documentation surfaces

### Enables

* A more operable recurring Trend Finder workflow.
* More evidence-aware creator triage and reporting.
* Future public-source expansion with clearer compliance, cost, retention, and browser-safety contracts.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/phases/phase_24/prd_phase_24.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
