> 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/phase28-session13-keyword-packs-rotation-and-coverage/tasks.md).

# Task Checklist

**Session ID**: `phase28-session13-keyword-packs-rotation-and-coverage` **Total Tasks**: 25 **Estimated Duration**: 3-4 hours **Created**: 2026-06-14

***

## 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          | 4      | 4      | 0         |
| Foundation     | 8      | 8      | 0         |
| Implementation | 9      | 9      | 0         |
| Testing        | 4      | 4      | 0         |
| **Total**      | **25** | **25** | **0**     |

***

## Setup (4 tasks)

Initial configuration and environment preparation.

* [x] T001 \[S2813] Verify Session 13 prerequisites, completed dependency sessions, and compliance gate requirements before source input work (`.spec_system/PRD/phase_28/session_13_keyword_packs_rotation_and_coverage.md`)
* [x] T002 \[S2813] Record the Phase 28 keyword-pack compliance review stance, affected reviewed query fields, and no-free-text rule before Actor-input changes (`docs/sources/apify-source-onboarding.md`)
* [x] T003 \[S2813] Inspect current source declarations and map only reviewed keyword-cap fields eligible for compiled terms (`scripts/extensions/trend-finder/sources/apify-source-config.ts`)
* [x] T004 \[S2813] Inspect Trends-Finderz keyword, rotation, and coverage references and capture only portable deterministic behavior (`EXAMPLES/trends-finderz/lib/config/build-scan-keywords.ts`)

***

## Foundation (8 tasks)

Core structures and base implementations.

* [x] T005 \[S2813] \[P] Create keyword pack contracts, reviewed category set, scan mode parser, env fallback, and source cap tables with schema-validated input and explicit error mapping (`scripts/extensions/trend-finder/sources/keyword-packs.ts`)
* [x] T006 \[S2813] Add stable-core plus rotating-tail keyword selection seeded by `generatedAt`, with normalized dedupe and deterministic ordering (`scripts/extensions/trend-finder/sources/keyword-packs.ts`)
* [x] T007 \[S2813] Add per-source keyword compilation for reviewed query fields with bounded results, source cap enforcement, and spend-label preservation (`scripts/extensions/trend-finder/sources/keyword-packs.ts`)
* [x] T008 \[S2813] Add bounded coverage summary rows, ready/review/thin status derivation, source cap summaries, and selected-window counts (`scripts/extensions/trend-finder/sources/keyword-packs.ts`)
* [x] T009 \[S2813] Extend source-side types with keyword window, category coverage, source cap, and setup summary contracts (`scripts/extensions/trend-finder/sources/types.ts`)
* [x] T010 \[S2813] Extend browser schema defaults for keyword window and coverage QA fields with legacy payload compatibility (`src/extensions/trend-finder/schema.ts`)
* [x] T011 \[S2813] Extend movement analyst input contracts with scan eligibility context so absent rotated-out evidence can be treated as not scanned (`scripts/lib/ai-runtime/movement-analyst.ts`)
* [x] T012 \[S2813] \[P] Create Source Setup keyword coverage summary component with loading, empty, focused-mode, and bounded-row states plus accessibility labels (`src/extensions/trend-finder/components/keyword-coverage-summary.tsx`)

***

## Implementation (9 tasks)

Main feature implementation.

* [x] T013 \[S2813] Add reviewed keyword target metadata and validation to Apify source declarations, rejecting unreviewed target fields (`scripts/extensions/trend-finder/sources/apify-source-config.ts`)
* [x] T014 \[S2813] Apply compiled keyword windows to cloned Apify source inputs before Actor calls, with timeout/failure warnings and no mutation of static declarations (`scripts/extensions/trend-finder/sources/apify-adapter.ts`)
* [x] T015 \[S2813] Resolve scan mode/category in the collector, attach keyword summaries to source setup state, and propagate explicit warnings for invalid input (`scripts/extensions/trend-finder/collector.ts`)
* [x] T016 \[S2813] Record sanitized keyword window summaries in engine trace with bounded counts and unsafe-value rejection (`scripts/extensions/trend-finder/engine-trace.ts`)
* [x] T017 \[S2813] Add frontend engine trace schema, defaults, labels, and artifact mapping for keyword window summaries (`src/extensions/trend-finder/engine-trace.ts`)
* [x] T018 \[S2813] Wire not-scanned movement handling so rotated-out prior topics avoid normal cooling labels and keep explicit provenance text (`scripts/lib/ai-runtime/movement-analyst.ts`)
* [x] T019 \[S2813] Render keyword coverage QA inside Source Setup without adding browser scan-mode mutation controls, with state reset or revalidation on re-entry (`src/extensions/trend-finder/components/source-setup-panel.tsx`)
* [x] T020 \[S2813] Project coverage status labels, source cap summaries, focused-category labels, and setup diagnostics in the view model (`src/extensions/trend-finder/view-model.ts`)
* [x] T021 \[S2813] Update Trend Finder source docs for shipped scan modes, rotation, coverage QA, script-side env keys, and preserved spend labels (`docs/extensions/trend-finder-sources.md`)

***

## Testing (4 tasks)

Verification and quality assurance.

* [x] T022 \[S2813] \[P] Add keyword-pack unit tests for mode parsing, category validation, normalization, dedupe, cap enforcement, rotation determinism, and coverage statuses (`scripts/extensions/trend-finder/sources/__tests__/keyword-packs.test.ts`)
* [x] T023 \[S2813] \[P] Add source config, adapter, collector, and engine-trace tests for cloned input mapping, warnings, setup propagation, sanitization, and spend-label preservation (`scripts/extensions/trend-finder/sources/__tests__/apify-adapter.test.ts`)
* [x] T024 \[S2813] \[P] Add movement, schema, view-model, Source Setup, and keyword coverage component tests for not-scanned handling, legacy defaults, empty states, focused labels, and re-entry behavior (`scripts/lib/ai-runtime/__tests__/movement-analyst.test.ts`)
* [x] T025 \[S2813] Run focused tests, script/app type checks, and ASCII validation for all session files, documenting unrelated repo-wide failures (`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 final spec validation.


---

# 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/phase28-session13-keyword-packs-rotation-and-coverage/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.
