> 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_27/session_05_velocity_dynamics_upgrade.md).

# Session 05: Velocity Dynamics Upgrade

**Session ID**: `phase27-session05-velocity-dynamics-upgrade` **Status**: Not Started **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Upgrade Trend Finder velocity math with acceleration (delta-of-delta), a statistical significance estimate against historical delta variance, and a bounded burst signal from the daily series -- each with explicit unavailable states below minimum sample sizes.

***

## Source Mapping (from the Alpha Radar improvement map, items 1.1, 1.2)

### Velocity acceleration and significance (item 1.1)

* **Alpha Radar:** every trend carries `velocity_score`, `velocity_acceleration` (second derivative), and `velocity_significance` (statistical significance of the move) in `public/data.json`.
* **Trend Finder today:** the momentum factor's velocity signal is a single evidence-count delta against the previous matched topic (`50 + evidence_delta * 12`, clamped; new topics with evidence start at 65) -- see `docs/extensions/trend-finder-scoring.md` and `scripts/lib/ai-runtime/scoring.ts`. No acceleration, no significance test.
* **Improvement:** compute acceleration (delta-of-delta) and a significance estimate (current delta vs. the topic's historical delta variance) from the 84-day historical context that already exists.
* **Implement in:** `scripts/lib/ai-runtime/scoring.ts` (factor math), `scripts/lib/ai-runtime/historical-context.ts` (per-topic delta series), `scripts/lib/ai-runtime/snapshots.ts` (persist per-run evidence counts -- delivered by Session 04), `src/extensions/trend-finder/schema.ts` (new bounded fields), `src/extensions/trend-finder/components/score-breakdown.tsx` (display).
* **Constraints:** deterministic; needs at least 3 snapshots before significance is meaningful -- emit an explicit `unavailable` state below that threshold, matching the source-local low-sample pattern.

### Burst detection (item 1.2)

* **Alpha Radar:** `burst_score` per trend plus `sparkline_14d` daily counts imply day-bucketed burst detection.
* **Trend Finder today:** recency buckets inside momentum only (`docs/extensions/trend-finder-scoring.md`); no day-bucketed series, so no burst measure (Session 04 adds the series).
* **Improvement:** with daily evidence counts persisted, add a simple burst score (e.g. last-48h share of 14-day volume) as a bounded support signal, capped like source-local lift so it cannot dominate the six-factor score (source-local caps for reference: at most 4 points momentum, 4 points evidence strength, 3 points creator potential).
* **Implement in:** `scripts/lib/ai-runtime/scoring.ts`, `scripts/lib/ai-runtime/snapshots.ts`, `src/extensions/trend-finder/schema.ts`.

***

## Scope

### In Scope (MVP)

* Acceleration derivation from consecutive run deltas
* Significance estimate vs. historical delta variance with a minimum-sample guard (>= 3 snapshots)
* Burst score from the 14-day daily series with a bounded, capped score contribution
* Score breakdown display rows for the three new values with unavailable states
* Tests with hand-computed fixtures for all three derivations, including below-threshold, new-topic, and missing-history cases

### Out of Scope

* Changing the six-factor weights or replacing the existing velocity signal (new values are additive context plus a capped burst support)
* Lifecycle classification (Session 06 consumes these dynamics)
* Forecast/trajectory visuals (Session 07)

***

## Prerequisites

* [ ] Session 04 completed (daily series and per-run evidence counts persist)

***

## Deliverables

1. Acceleration, significance, and burst derivations in the ai-runtime layer
2. Bounded schema fields with additive defaults
3. Score breakdown display with explicit unavailable states
4. Capped burst contribution wired like source-local lift support
5. Fixture-backed tests for all math and threshold behavior

***

## Success Criteria

* [ ] Significance shows `unavailable` below 3 snapshots instead of a number
* [ ] Burst contribution is capped and cannot dominate the weighted score
* [ ] All values are deterministic and reproducible from archived snapshots
* [ ] Existing momentum behavior for legacy payloads is unchanged
* [ ] Engine Replay scoring stage labels remain accurate for the new math


---

# 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_27/session_05_velocity_dynamics_upgrade.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.
