> 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_29/session_02_attention_pattern_and_polarity_grid.md).

# Session 02: Attention Pattern And Polarity Grid

**Session ID**: `phase29-session02-attention-pattern-and-polarity-grid` **Status**: Not Started **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Add the "what kind of attention is this" axis and a compact at-a-glance polarity/attention grid across the run. Maps comparison items 1.4 (`attentionPattern` label) and 1.2 (sentiment/polarity heat grid).

***

## Scope

### In Scope (MVP)

* Add a deterministic `attentionPattern` derived field with states `adoption`, `creator-hype`, `announcement`, `discourse`, and `unavailable`.
* Derive from source-role shares already used by camp/source-breakdown logic plus the Session 01 title heuristics; keep it distinct from `actionRecommendation`.
* Add Zod schema, `DEFAULT_*` literal, and backwards-compatible parsing.
* Render a compact per-topic polarity/attention grid in the Trends header and static Brief using movement, action verdict, and `attentionPattern`. Reserve a reception column for Session 03 to fill.
* Confirm browser safety and update the payload boundary and `measure-payload-size.ts`.

### Out of Scope

* `receptionSignal` polarity (Session 03 fills the reserved column).
* Any new source or comment-body read.

***

## Prerequisites

* [ ] Session 01 complete (title heuristics available for derivation).

***

## Deliverables

1. Deterministic `attentionPattern` field with defaults and `unavailable` state.
2. Schema, scoring/cap wiring as applicable, and payload-boundary update.
3. Compact polarity/attention grid in Trends header and static Brief.
4. Unit tests plus an e2e guard for the new grid surface.

***

## Success Criteria

* [ ] `attentionPattern` publishes with defaults and `unavailable` states.
* [ ] The grid renders for fixture data in live and static surfaces.
* [ ] Payload size and browser sanitization remain green.
* [ ] Deterministic derivation needs no AI runtime to produce a valid value.

***

## Key Files

* `scripts/lib/ai-runtime/source-breakdown.ts`
* `src/extensions/trend-finder/schema.ts`
* `src/extensions/trend-finder/view-model.ts`
* `src/extensions/trend-finder/views/trends-view.tsx`
* `scripts/extensions/trend-finder/static-brief-renderer.ts`
* `scripts/extensions/trend-finder/measure-payload-size.ts`
* `docs/extensions/trend-finder-scoring.md`
* `docs/extensions/trend-finder-ui-surfaces.md`

***

## Comparison Notes (folded from comparison plan)

**Effort:** Medium (1.4), Low (1.2). **Boundary risk:** Low (1.4), None (1.2).

**1.4 Editorial verdict vocabulary.** TrendingAI gives GitHub repos sharp verdicts such as `TRICK`, `VERIFY`, `REAL`, `PRE-VIRAL`, and `HYPE`, and feature cards carry `dominant_pattern` values such as `tutorial-hype`, `adoption`, `complaint`, `news`, and `meta`. Trend Finder's `actionRecommendation` is operational, not a label for what kind of attention a topic is receiving. Adopt a deterministic `attentionPattern` with states `adoption`, `creator-hype`, `announcement`, `discourse`, and `unavailable`, derived from role shares and title heuristics.

**1.2 Sentiment-by-topic heat grid.** TrendingAI shows a heat grid that makes the creator chorus read hot or cold at a glance. Trend Finder's KPI strip shows volume, movement, and mood but no compact polarity-across-run read. Adopt as a presentation layer in Trends and static Brief over movement, action verdict, `attentionPattern`, and later `receptionSignal` (Session 03 fills the reception column).

**TrendingAI source pointers.** Editorial verdicts: `prompts/feature-sentiment.md` (`dominant_pattern`) and the README GitHub verdicts. The 1.2 heat grid is a presentation idea with no single source file.


---

# 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_29/session_02_attention_pattern_and_polarity_grid.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.
