> 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-session08-required-derived-field-closeout-gate/tasks.md).

# Task Checklist

**Session ID**: `phase29-session08-required-derived-field-closeout-gate` **Total Tasks**: 20 **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     | 5      | 5      | 0         |
| Implementation | 9      | 9      | 0         |
| Testing        | 4      | 4      | 0         |
| **Total**      | **20** | **20** | **0**     |

***

## Setup (2 tasks)

Initial configuration and environment preparation.

* [x] T001 \[S2908] Verify analyzer state, completed prerequisites, and Session 08 stub scope before implementation (`.spec_system/PRD/phase_29/session_08_required_derived_field_closeout_gate.md`)
* [x] T002 \[S2908] Inspect current collector closeout, schema defaults, static Brief export, QA, payload reporter, and relevant tests before adding the gate (`scripts/extensions/trend-finder/collector.ts`)

***

## Foundation (5 tasks)

Core structures and base implementations.

* [x] T003 \[S2908] \[P] Create required-derived-fields helper contract with bounded field definitions, sanitized issue types, issue caps, and explicit error mapping (`scripts/extensions/trend-finder/required-derived-fields.ts`)
* [x] T004 \[S2908] \[P] Add closeout fixture variants for complete payloads, missing topic fields, missing report branches, and allowed empty fallback shapes (`src/extensions/trend-finder/fixtures.ts`)
* [x] T005 \[S2908] Define required topic fields and report fields with defaults-aware rules for `attentionPattern`, `receptionSignal`, `corroboration`, `evidenceRationales`, and `runNarratives` (`scripts/extensions/trend-finder/required-derived-fields.ts`)
* [x] T006 \[S2908] Preserve schema legacy defaults and export any constants or types needed by closeout without weakening parsing (`src/extensions/trend-finder/schema.ts`)
* [x] T007 \[S2908] Prepare static Brief export and QA error plumbing for blocking closeout issues with schema-validated input and explicit error mapping (`scripts/extensions/trend-finder/static-brief-export.ts`)

***

## Implementation (9 tasks)

Main feature implementation.

* [x] T008 \[S2908] Implement closeout assertion for missing topic derived fields with deterministic ordering, issue caps, and sanitized field/topic messages (`scripts/extensions/trend-finder/required-derived-fields.ts`)
* [x] T009 \[S2908] Implement closeout assertion for report-level derived branches, allowing empty arrays while rejecting missing or wrong-shaped fields (`scripts/extensions/trend-finder/required-derived-fields.ts`)
* [x] T010 \[S2908] Wire collector closeout after browser-safe diagnostics slimming and before snapshot writes, final handoff, and static-brief readiness logging (`scripts/extensions/trend-finder/collector.ts`)
* [x] T011 \[S2908] Wire collector `validateData()` to reject generated payloads that fail closeout with sanitized failure reasons (`scripts/extensions/trend-finder/collector.ts`)
* [x] T012 \[S2908] Wire static Brief export to run closeout before report projection and HTML rendering with duplicate-trigger prevention for repeated export calls (`scripts/extensions/trend-finder/static-brief-export.ts`)
* [x] T013 \[S2908] Add or adapt static Brief QA issue handling for closeout failures without exposing raw source content or private paths (`scripts/extensions/trend-finder/static-brief-qa.ts`)
* [x] T014 \[S2908] Keep required derived branches visible in payload-size reporting and update reporter output only where closeout data needs explicit visibility (`scripts/extensions/trend-finder/measure-payload-size.ts`)
* [x] T015 \[S2908] Update Trend Finder pipeline docs to distinguish legacy schema defaults from strict generated-payload closeout (`docs/extensions/trend-finder-pipeline.md`)
* [x] T016 \[S2908] Update Trend Finder surface docs to state live/static surfaces require generated derived fields before rendering (`docs/extensions/trend-finder-ui-surfaces.md`)

***

## Testing (4 tasks)

Verification and quality assurance.

* [x] T017 \[S2908] \[P] Add helper unit tests for missing fields, allowed empty defaults, wrong-shaped report branches, issue caps, deterministic ordering, and private/raw sentinel exclusion (`scripts/extensions/trend-finder/__tests__/required-derived-fields.test.ts`)
* [x] T018 \[S2908] \[P] Add collector and static Brief export tests for missing-field rejection, complete-payload success, sanitized failure reasons, and no HTML output on failure (`scripts/extensions/trend-finder/__tests__/static-brief-export.test.ts`)
* [x] T019 \[S2908] \[P] Add schema/view-model and e2e regressions proving legacy default parsing remains safe and complete static Brief payloads still render without overflow or private strings (`src/extensions/trend-finder/__tests__/view-model.test.ts`)
* [x] T020 \[S2908] Run focused Vitest suites, static Brief e2e as needed, payload-size check, private-artifact scan, 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 implement workflow step to begin AI-led implementation.


---

# 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-session08-required-derived-field-closeout-gate/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.
