> 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_06_cross_topic_substrate_narratives.md).

# Session 06: Cross-Topic Substrate Narratives

**Session ID**: `phase29-session06-cross-topic-substrate-narratives` **Status**: Complete **Completed**: 2026-06-20 **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Name run-level narratives shared by two or more topics, distinct from theme labels and Story Log rows. Maps comparison item 1.8, cross-topic substrate narratives.

***

## Scope

### In Scope (MVP)

* Add bounded `runNarratives` or `themeNarratives` rows over already-generated topics.
* Each row must cite at least two valid topic IDs and existing topic/evidence IDs.
* Cap text length like other analyst output and validate references before publishing, reusing the Session 05 citation-validation discipline.
* Deterministic fallback merges theme labels plus shared source/entity tokens and emits low-confidence rows only.
* Add schema defaults and confirm payload safety.

### Out of Scope

* New theme/demand-center computation (reuses existing theme rollups).
* Any narrative that cannot cite two valid topic IDs (dropped, not invented).

***

## Prerequisites

* [x] Session 05 complete (citation-validation discipline hardened there).

***

## Deliverables

1. Bounded `runNarratives`/`themeNarratives` rows with cited topic/evidence IDs.
2. Validator that drops rows with fewer than two valid topic IDs.
3. Deterministic low-confidence fallback over theme labels and shared tokens.
4. Unit tests for reference validation and fallback behavior.

***

## Success Criteria

* [x] A narrative with fewer than two valid topic IDs is dropped.
* [x] Fallback emits only low-confidence rows.
* [x] All references are validator-checked against real topic/evidence IDs.
* [x] Payload budget and privacy scans remain green.

***

## Key Files

* `scripts/extensions/trend-finder/theme-rollups.ts`
* `scripts/lib/ai-runtime/trend-analyst.ts`
* `src/extensions/trend-finder/schema.ts`
* `src/extensions/trend-finder/view-model.ts`
* `scripts/extensions/trend-finder/static-brief-renderer.ts`

***

## Comparison Notes (folded from comparison plan)

**Effort:** Medium. **Boundary risk:** Low. **Depends on Session 05** - reuses the citation-validation discipline hardened there.

**1.8 Cross-topic substrate narratives.** TrendingAI runs a cross-narratives pass over the batch to name substrate events shared by two or more features, such as pricing moves, access restrictions, ecosystem migrations, or security positioning, with confidence tags on implicated feature cards. Trend Finder has theme labels, demand centers, convergence, and Story Log rows, but no named cross-topic narrative object. Add bounded `runNarratives` or `themeNarratives` with at least two valid topic IDs, existing evidence/topic references, capped text, and deterministic low-confidence fallback.

**TrendingAI source pointers.** `prompts/cross-narratives.md`, `src/feature-sentiment.ts` (`runCrossNarrativePass`).


---

# 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_06_cross_topic_substrate_narratives.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.
