> 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/phase08-session03-local-erasure-runtime-and-controls/tasks.md).

# Task Checklist

**Session ID**: `phase08-session03-local-erasure-runtime-and-controls` **Total Tasks**: 25 **Estimated Duration**: 3-4 hours **Created**: 2026-05-31

***

## 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 | 13     | 13     | 0         |
| Testing        | 3      | 3      | 0         |
| **Total**      | **25** | **25** | **0**     |

***

## Setup (3 tasks)

Initial configuration and environment preparation.

### Cross-cutting

* [x] T001 \[S0803] Verify analyzer state, completed Session 02 prerequisite, Phase 08 routing, and cross-package package context before implementation (`.spec_system/PRD/phase_08/session_03_local_erasure_runtime_and_controls.md`)
* [x] T002 \[S0803] Review Session 02 inventory rows and map local, browser, unsupported, manual-review, Worker, hosted, workspace, backup, log, export, replay, and spool boundaries to implementation decisions (`.spec_system/PRD/phase_08/unified_erasure_inventory.md`)
* [x] T003 \[S0803] Create implementation note scaffold and confirm destructive execution is limited to explicit local/browser erasure with no Worker, hosted, public replay, remote, analytics, push, broad workspace-file, or full trusted unified erasure claim (`.spec_system/specs/phase08-session03-local-erasure-runtime-and-controls/implementation-notes.md`)

***

## Foundation (6 tasks)

Core structures and base implementations.

### packages/protocol

* [x] T004 \[S0803] Add local/browser erasure runtime request, preview, execution, audit, idempotency, partial-failure, verification, unsupported-boundary, and status contracts with exhaustive enum handling (`packages/protocol/src/erasure.ts`)

### apps/server

* [x] T005 \[S0803] \[P] Create safe local erasure path resolver for FactionOS home, archives, memory, settings, lifecycle, project-root, logs, backups, spool, exports, diagnostics, scan runtime, and LLM runtime boundaries with path confinement and no raw path output (`apps/server/src/lib/localErasure.ts`)
* [x] T006 \[S0803] Add dry-run preview builder for eligible, absent, skipped, unsupported, and manual-review local boundaries with bounded counts and redacted labels (`apps/server/src/lib/localErasure.ts`)
* [x] T007 \[S0803] Add confirmed local erasure executor with duplicate-trigger prevention by idempotency key, transaction boundaries, partial-failure reporting, and verification after each boundary (`apps/server/src/lib/localErasure.ts`)
* [x] T008 \[S0803] \[P] Create local erasure HTTP routes for preview and confirm with schema-validated input, explicit error mapping, existing auth enforcement, and no raw sensitive output (`apps/server/src/routes/erasure.ts`)

### apps/web

* [x] T009 \[S0803] \[P] Create browser erasure helper for settings, replay buffers, faction hint, War Room hints, local auth hints, replay URL fragments, and in-memory reset hooks with storage-unavailable handling (`apps/web/src/lib/localErasure.ts`)

***

## Implementation (13 tasks)

Main feature implementation.

### apps/server

* [x] T010 \[S0803] Register local erasure routes after local auth middleware and before unsupported route catch-all with route-level no-overclaim response metadata (`apps/server/src/server.ts`)
* [x] T011 \[S0803] \[P] Write server local erasure runtime tests for dry-run, confirmation phrase validation, idempotency, partial failure, already-absent verification, malformed spool handling, backup/log/export boundaries, and sensitive-output redaction (`apps/server/tests/localErasure.test.ts`)
* [x] T012 \[S0803] \[P] Write server route tests for preview, confirm, malformed bodies, auth-required behavior, duplicate idempotency keys, unsupported boundaries, and explicit error mapping (`apps/server/tests/erasureRoute.test.ts`)

### apps/cli

* [x] T013 \[S0803] Create CLI erasure client and redacted formatter for loopback-only preview, confirm, timeout, auth-required, malformed response, unavailable route, unsupported boundary, and partial-failure states (`apps/cli/src/lib/erasureClient.js`)
* [x] T014 \[S0803] Add `factionos erase` command that previews by default and requires typed `--confirm` plus idempotency protection before destructive local execution (`apps/cli/src/commands/erase.js`)
* [x] T015 \[S0803] Wire CLI help and command dispatch for `erase` without changing existing init/start/status/doctor/uninstall behavior (`apps/cli/src/index.js`)
* [x] T016 \[S0803] \[P] Write CLI erasure tests for preview, confirm, non-loopback rejection, duplicate-trigger prevention while in-flight, malformed JSON, timeout, and redacted console output (`apps/cli/tests/erasureClient.test.js`)

### apps/web

* [x] T017 \[S0803] Create local erasure Zustand store for preview, confirmation, in-flight guard, partial-failure result, verification result, unavailable state, and reset or revalidation on drawer re-entry (`apps/web/src/store/useLocalErasureStore.ts`)
* [x] T018 \[S0803] Create Settings drawer local erasure panel with explicit loading, empty, error, offline/unavailable, preview, typed confirmation, progress, completed, partial-failure, unsupported, and verification states (`apps/web/src/components/LocalErasurePanel.tsx`)
* [x] T019 \[S0803] Mount local erasure panel in Settings without disrupting existing audio, notification, scan, replay, reset, analytics, theme, and faction controls (`apps/web/src/components/SettingsDrawer.tsx`)
* [x] T020 \[S0803] \[P] Write browser erasure helper tests for localStorage cleanup, URL fragment cleanup, War Room hint cleanup, settings/replay reset, storage-unavailable handling, idempotency, and redacted summaries (`apps/web/tests/localErasure.test.ts`)
* [x] T021 \[S0803] \[P] Write LocalErasurePanel tests for focus behavior, typed confirmation, disable-while-pending controls, partial failure, completed state, unavailable server state, unsupported copy, and state reset on close/reopen (`apps/web/tests/LocalErasurePanel.test.tsx`)

### Cross-cutting docs

* [x] T022 \[S0803] Update release, privacy/security, API, CLI, web, and server docs for local/browser erasure behavior, no raw-output guarantees, and remaining Worker/hosted/full-trusted-erasure limitations (`docs/privacy-and-security.md`)

***

## Testing (3 tasks)

Verification and quality assurance.

### Cross-cutting

* [x] T023 \[S0803] Run focused Vitest coverage and affected typechecks for protocol, server, CLI, and web erasure work (`package.json`)
* [x] T024 \[S0803] Run docs/no-overclaim review plus whitespace, ASCII, LF, and `git diff --check` validation, then record command outcomes and residual risks without closing full trusted unified erasure (`.spec_system/specs/phase08-session03-local-erasure-runtime-and-controls/implementation-notes.md`)
* [x] T025 \[S0803] Validate task checklist, implementation notes handoff, ASCII/LF status, and next-step readiness for the validate workflow after implementation completes (`.spec_system/specs/phase08-session03-local-erasure-runtime-and-controls/tasks.md`)

***

## Completion Checklist

Before marking session complete:

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

***

## Next Steps

Run the validate workflow step to verify session completeness.


---

# 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/phase08-session03-local-erasure-runtime-and-controls/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.
