> For the complete documentation index, see [llms.txt](https://faction-os.gitbook.io/faction-os-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/sessions/phase18-session05-session-summary-engine-and-noise-filtering/tasks.md).

# Task Checklist

**Session ID**: `phase18-session05-session-summary-engine-and-noise-filtering` **Total Tasks**: 23 **Estimated Duration**: 3-4 hours **Created**: 2026-06-10

***

## 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          | 3      | 3      | 0         |
| Foundation     | 6      | 6      | 0         |
| Implementation | 9      | 9      | 0         |
| Testing        | 5      | 5      | 0         |
| **Total**      | **23** | **23** | **0**     |

***

## Setup (3 tasks)

Initial configuration and environment preparation.

* [x] T001 \[S1805] Verify Session 04 context helpers, event-route session-end signal, and current summary manager prerequisites (`apps/server/src/lib/idleSuggestionContext.ts`)
* [x] T002 \[S1805] Verify protocol `SessionSummary`, follow-up category, and `AnalysisResult` contracts before implementing server normalization (`packages/protocol/src/suggestions.ts`)
* [x] T003 \[S1805] Verify current `SuggestionManager` summary, analysis, persistence, and broadcast behavior before adding filtering (`apps/server/src/managers/suggestionManager.ts`)

***

## Foundation (6 tasks)

Core structures and base implementations.

* [x] T004 \[S1805] \[P] Create analysis noise filter predicates and helpers for analysis-shaped items with schema-validated input and explicit rejection reasons (`apps/server/src/lib/analysisNoiseFilter.ts`)
* [x] T005 \[S1805] \[P] Create session summary system prompt with explicit follow-up categories, max-two output, and no raw prompt/path/transcript leakage (`apps/server/src/llm/prompts/session-summary-engine.md`)
* [x] T006 \[S1805] Register the session summary prompt in the maintained prompt registry without changing existing engine prompt keys (`apps/server/src/llm/prompts/index.ts`)
* [x] T007 \[S1805] Create session summary engine types, response parsing, category validation, and normalized candidate shape with exhaustive enum handling (`apps/server/src/llm/engines/sessionSummaryEngine.ts`)
* [x] T008 \[S1805] Create deterministic session summary fallback builder from safe mission context and modified-file hints with types matching declared contract (`apps/server/src/llm/engines/sessionSummaryEngine.ts`)
* [x] T009 \[S1805] Create summary lifecycle coordinator options, clock injection, generation injection, in-flight map, timeout resources, and destroy contract with cleanup on scope exit for all acquired resources (`apps/server/src/lib/sessionSummaryLifecycle.ts`)

***

## Implementation (9 tasks)

Main feature implementation.

* [x] T010 \[S1805] Implement summary lifecycle trigger keyed by stable session ID with duplicate-trigger prevention while in-flight (`apps/server/src/lib/sessionSummaryLifecycle.ts`)
* [x] T011 \[S1805] Implement 15-second generation timeout, abort propagation, late-result suppression, and compact warning behavior without raw provider payloads (`apps/server/src/lib/sessionSummaryLifecycle.ts`)
* [x] T012 \[S1805] Implement manager write path through `SuggestionManager.setSessionSummary` and emit canonical snapshot updates with idempotency protection and failure-path handling (`apps/server/src/lib/sessionSummaryLifecycle.ts`)
* [x] T013 \[S1805] Wire summary lifecycle construction, dependency injection, and shutdown destroy ordering in the server runtime (`apps/server/src/server.ts`)
* [x] T014 \[S1805] Wire event-route session-end summary generation after mission completion without blocking the HTTP response path (`apps/server/src/routes/event.ts`)
* [x] T015 \[S1805] Apply analysis noise filtering in `SuggestionManager.setAnalysisResult` before parsing and persistence (`apps/server/src/managers/suggestionManager.ts`)
* [x] T016 \[S1805] Apply analysis noise filtering during manager load normalization so persisted noisy items are cleaned on startup (`apps/server/src/managers/suggestionManager.ts`)
* [x] T017 \[S1805] Update server README with session summaries, noise filtering, provider opt-in, fallback behavior, and server-only scope (`apps/server/README_server.md`)
* [x] T018 \[S1805] Keep summary generation and filtering logs compact and redacted with no raw paths, prompts, transcripts, provider payloads, or secrets (`apps/server/src/lib/sessionSummaryLifecycle.ts`)

***

## Testing (5 tasks)

Verification and quality assurance.

* [x] T019 \[S1805] \[P] Write summary engine tests for parser shapes, category validation, max-two cap, fallback output, malformed output, and provider failure paths (`apps/server/tests/sessionSummaryEngine.test.ts`)
* [x] T020 \[S1805] \[P] Write analysis noise filter tests for documented self-talk rejection phrases and valid concrete-item acceptance (`apps/server/tests/analysisNoiseFilter.test.ts`)
* [x] T021 \[S1805] Write summary lifecycle tests for trigger, in-flight guard, timeout, destroy cleanup, fallback output, manager writes, and broadcasts (`apps/server/tests/sessionSummaryLifecycle.test.ts`)
* [x] T022 \[S1805] Write SuggestionManager tests for store-time and load-time analysis noise filtering without corrupting valid persisted state (`apps/server/tests/suggestionManager.test.ts`)
* [x] T023 \[S1805] Write route integration coverage and run focused server Vitest files, server typecheck, and ASCII/LF validation for new artifacts (`apps/server/tests/routes.test.ts`)

***

## 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://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/sessions/phase18-session05-session-summary-engine-and-noise-filtering/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.
