> 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/sessions/phase29-session06-cross-topic-substrate-narratives/tasks.md).

# Task Checklist

**Session ID**: `phase29-session06-cross-topic-substrate-narratives` **Total Tasks**: 22 **Estimated Duration**: 3-4 hours **Created**: 2026-06-20

***

## Legend

* `[x]` = Completed
* `[ ]` = Pending
* `[P]` = Parallelizable (can run with other \[P] tasks)
* `[SNNMM]` = Session reference (NN=phase number, MM=session number)
* `TNNN` = Task ID

***

## Progress Summary

| Category       | Total  | Done   | Remaining |
| -------------- | ------ | ------ | --------- |
| Setup          | 2      | 2      | 0         |
| Foundation     | 6      | 6      | 0         |
| Implementation | 9      | 9      | 0         |
| Testing        | 5      | 5      | 0         |
| **Total**      | **22** | **22** | **0**     |

***

## Setup (2 tasks)

Initial configuration and environment preparation.

* [x] T001 \[S2906] Verify analyzer state, completed prerequisites, and Session 06 stub scope before implementation (`.spec_system/PRD/phase_29/session_06_cross_topic_substrate_narratives.md`)
* [x] T002 \[S2906] Inspect current theme rollup, analyst validation, schema, view-model, and static Brief paths before adding run narratives (`scripts/extensions/trend-finder/theme-rollups.ts`)

***

## Foundation (6 tasks)

Core structures and base implementations.

* [x] T003 \[S2906] \[P] Create run-narratives helper contract with bounded text, provenance, confidence caps, citation limits, and deterministic IDs (`scripts/extensions/trend-finder/run-narratives.ts`)
* [x] T004 \[S2906] Add `runNarratives` constants, Zod schemas, report defaults, and legacy-safe parsing with exhaustive fallback behavior (`src/extensions/trend-finder/schema.ts`)
* [x] T005 \[S2906] Extend analyst output types, prompt guidance, and schema for optional run narratives with schema-validated input and explicit error mapping (`scripts/lib/ai-runtime/trend-analyst.ts`)
* [x] T006 \[S2906] Add analyst run-narrative validators for known topic IDs, known evidence IDs, two-topic minimum, bounded copy, and unsupported-claim rejection (`scripts/lib/ai-runtime/trend-analyst.ts`)
* [x] T007 \[S2906] Prepare live view-model narrative rows with citation labels, tones, accessibility text, and safe empty defaults (`src/extensions/trend-finder/view-model.ts`)
* [x] T008 \[S2906] Prepare static Brief report rows and QA coverage for bounded run narrative projection (`scripts/extensions/trend-finder/static-brief-export.ts`)

***

## Implementation (9 tasks)

Main feature implementation.

* [x] T009 \[S2906] Implement deterministic fallback narratives from multi-topic theme groups and shared source/entity/keyword tokens with low-confidence-only output (`scripts/extensions/trend-finder/run-narratives.ts`)
* [x] T010 \[S2906] Implement narrative merge/drop policy so valid AI rows win, invalid rows emit sanitized warnings, and fallback fills safe gaps (`scripts/extensions/trend-finder/run-narratives.ts`)
* [x] T011 \[S2906] Wire collector narrative generation after theme rollups with timeout-free deterministic behavior, sanitized traces, and no raw/private payload leakage (`scripts/extensions/trend-finder/collector.ts`)
* [x] T012 \[S2906] Export or adapt theme rollup group data needed by fallback without changing existing topic assignment behavior (`scripts/extensions/trend-finder/theme-rollups.ts`)
* [x] T013 \[S2906] Project `runNarratives` through schema and view-model with validated citation labels and deterministic ordering (`src/extensions/trend-finder/view-model.ts`)
* [x] T014 \[S2906] Render compact substrate narrative rows on Trends with platform-appropriate accessibility labels, focus behavior, and stable empty/legacy states (`src/extensions/trend-finder/views/trends-view.tsx`)
* [x] T015 \[S2906] Render narrative rows in live Brief without displacing ranked trend content and with safe state reset on data refresh (`src/extensions/trend-finder/views/brief-view.tsx`)
* [x] T016 \[S2906] Project and render escaped narrative rows in static Brief with private/raw field exclusion and safe public citation labels (`scripts/extensions/trend-finder/static-brief-renderer.ts`)
* [x] T017 \[S2906] Update fixtures, payload reporting, and QA scans for AI-valid, fallback, invalid-reference, and legacy narrative cases (`src/extensions/trend-finder/fixtures.ts`)

***

## Testing (5 tasks)

Verification and quality assurance.

* [x] T018 \[S2906] \[P] Add run-narratives helper tests for valid references, one-topic drops, unknown references, generic labels, bounded text, and low-confidence fallback (`scripts/extensions/trend-finder/__tests__/run-narratives.test.ts`)
* [x] T019 \[S2906] \[P] Add analyst validator tests for accepted grounded narratives, unknown topic/evidence references, unsupported claims, and voice-guard failures (`scripts/lib/ai-runtime/__tests__/trend-analyst.test.ts`)
* [x] T020 \[S2906] \[P] Add collector, schema, view-model, and view tests for attachment, warning behavior, legacy defaults, citation labels, accessibility text, and empty states (`src/extensions/trend-finder/__tests__/view-model.test.ts`)
* [x] T021 \[S2906] \[P] Add static Brief export, renderer, and QA tests proving narrative output is escaped and excludes raw source dumps, private paths, prompts, provider responses, and credentials (`scripts/extensions/trend-finder/__tests__/static-brief-export.test.ts`)
* [x] T022 \[S2906] Run focused Vitest suites, payload-size check, type checks as needed, and ASCII validation for session files (`package.json`)

***

## Completion Checklist

Before marking session complete:

* [x] All tasks marked `[x]`
* [x] All tests passing
* [x] All files ASCII-encoded
* [x] implementation-notes.md updated
* [x] Ready for the validate workflow step

***

## Next Steps

Run the validate workflow step for independent review.


---

# 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/sessions/phase29-session06-cross-topic-substrate-narratives/tasks.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.
