> 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-session07-scan-orchestration-and-quest-ignore-patterns/tasks.md).

# Task Checklist

**Session ID**: `phase18-session07-scan-orchestration-and-quest-ignore-patterns` **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 | 10     | 10     | 0         |
| Testing        | 4      | 4      | 0         |
| **Total**      | **23** | **23** | **0**     |

***

## Setup (3 tasks)

Initial configuration and environment preparation.

### packages/protocol

* [x] T001 \[S1807] Verify scan status, scan mode, scan scope, and scan REST response contracts before route work begins (`packages/protocol/src/suggestions.ts`)

### apps/server

* [x] T002 \[S1807] Verify Session 06 scanner options, manager scan status APIs, suggestion route mounting, and unsupported scan route classifications (`apps/server/src/lib/codebaseIssueScanners.ts`)

### apps/web

* [x] T003 \[S1807] Verify existing Settings scan root persistence, scan client, and drawer status behavior before adding Quest ignore patterns (`apps/web/src/components/SettingsDrawer.tsx`)

***

## Foundation (6 tasks)

Core structures and base implementations.

### apps/server

* [x] T004 \[S1807] \[P] Create Quest ignore pattern helpers with `.factionos-questignore` loading, safe relative pattern normalization, and deterministic path matching (`apps/server/src/lib/questIgnore.ts`)
* [x] T005 \[S1807] \[P] Create codebase scan orchestrator types, single-flight state, scan status transitions, and cleanup hooks for scoped lifecycle work (`apps/server/src/lib/codebaseScanOrchestrator.ts`)
* [x] T006 \[S1807] Extend codebase issue scanner options to accept changed-file subsets and ignore predicates with deterministic ordering and explicit empty/error states (`apps/server/src/lib/codebaseIssueScanners.ts`)
* [x] T007 \[S1807] Add manager-owned codebase issue replacement support with idempotency protection, transaction boundaries, and rollback on validation failure (`apps/server/src/managers/suggestionManager.ts`)

### apps/web

* [x] T008 \[S1807] \[P] Add bounded `questIgnorePatterns` Settings state, persistence, normalization, setter, and reset behavior (`apps/web/src/store/useSettingsStore.ts`)
* [x] T009 \[S1807] \[P] Extend the scan client request model to include Quest ignore patterns and parse status-style scan responses without broad path leakage (`apps/web/src/lib/scanCodebase.ts`)

***

## Implementation (10 tasks)

Main feature implementation.

### apps/server

* [x] T010 \[S1807] Implement full scan orchestration over TODO, git status, lint, build/typecheck, and test scanners with timeout, bounded output, and failure-path handling (`apps/server/src/lib/codebaseScanOrchestrator.ts`)
* [x] T011 \[S1807] Implement git helper logic for current head and working, staged, and committed changed files with timeout, bounded output, and compact failure mapping (`apps/server/src/lib/codebaseScanOrchestrator.ts`)
* [x] T012 \[S1807] Implement diff scan selection, cached TODO-family issue reuse for unchanged files, and full-scan fallback when prior commit or cache is unavailable (`apps/server/src/lib/codebaseScanOrchestrator.ts`)
* [x] T013 \[S1807] Wire non-blocking daily stale-scan startup behavior with cleanup on shutdown and failed-scan status recovery (`apps/server/src/server.ts`)
* [x] T014 \[S1807] Add `POST /suggestions/scan` and `GET /suggestions/scan/status` handlers with schema-validated input, `?full=true` support, duplicate-trigger prevention while in-flight, and explicit error mapping (`apps/server/src/routes/suggestions.ts`)
* [x] T015 \[S1807] Emit canonical suggestion updates after scan status or issue mutations and de-list shipped scan routes while leaving analyze and project-scan routes planned (`apps/server/src/lib/unsupportedRoutes.ts`)

### apps/web

* [x] T016 \[S1807] Add the Settings Quest ignore pattern field with accessible label, bounded helper copy, multiline input sizing, and state reset or revalidation on drawer re-entry (`apps/web/src/components/SettingsDrawer.tsx`)
* [x] T017 \[S1807] Wire Settings scan action to send Quest ignore patterns, prevent duplicate clicks while in-flight, and show explicit loading, success, error, and offline states (`apps/web/src/components/SettingsDrawer.tsx`)

### Package Docs

* [x] T018 \[S1807] Document scan orchestration routes, `.factionos-questignore`, startup staleness scans, and local-only privacy limits (`apps/server/README_server.md`)
* [x] T019 \[S1807] Document Settings Quest ignore pattern persistence and the local-only scan payload boundary (`apps/web/README_web.md`)

***

## Testing (4 tasks)

Verification and quality assurance.

### apps/server

* [x] T020 \[S1807] \[P] Write Quest ignore tests for pattern normalization, unsafe input rejection, ignore-file loading, and matched path exclusion (`apps/server/tests/questIgnore.test.ts`)
* [x] T021 \[S1807] \[P] Write scan orchestrator tests for full/diff selection, commit tracking, cache reuse, fallback behavior, status reporting, and ignored path exclusion (`apps/server/tests/codebaseScanOrchestrator.test.ts`)
* [x] T022 \[S1807] Write route and unsupported-route tests for scan trigger validation, duplicate in-flight handling, status responses, root plus `/api` mounting, and shipped route classification (`apps/server/tests/suggestionRoutes.test.ts`)

### apps/web

* [x] T023 \[S1807] Write web Settings tests for ignore-pattern persistence, malformed snapshots, request payloads, loading/error/offline states, then run focused server/web tests plus ASCII/LF validation (`apps/web/tests/SettingsScan.test.tsx`)

***

## 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-session07-scan-orchestration-and-quest-ignore-patterns/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.
