> 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/phase17-session06-hook-context-and-provider-skill-parity/tasks.md).

# Task Checklist

**Session ID**: `phase17-session06-hook-context-and-provider-skill-parity` **Total Tasks**: 20 **Estimated Duration**: 3-4 hours **Created**: 2026-06-05

***

## Legend

* `[x]` = Completed
* `[ ]` = Pending
* `[P]` = Parallelizable (can run with other \[P] tasks)
* `[S1706]` = Session reference (phase 17, session 06)
* `TNNN` = Task ID

***

## Progress Summary

| Category       | Total  | Done   | Remaining |
| -------------- | ------ | ------ | --------- |
| Setup          | 3      | 3      | 0         |
| Foundation     | 6      | 6      | 0         |
| Implementation | 7      | 7      | 0         |
| Testing        | 4      | 4      | 0         |
| **Total**      | **20** | **20** | **0**     |

***

## Setup (3 tasks)

Current hook runtime, provider output, and test-pattern review.

### apps/hooks

* [x] T001 \[S1706] Review current hero-active prompt handling, session id resolution, and existing `hero_active` POST behavior (`apps/hooks/src/factionos-hero-active.js`)
* [x] T002 \[S1706] Audit shared hook HTTP, auth token, timeout, redaction, spool, and diagnostic helpers for context GET reuse (`apps/hooks/src/_lib.js`)
* [x] T003 \[S1706] Audit hook process test harness and Codex/Claude fixture coverage for provider-safe output assertions (`apps/hooks/tests/hookRuntime.test.js`)

***

## Foundation (6 tasks)

Bounded context fetch, output gating, and test scaffolding.

### apps/hooks

* [x] T004 \[S1706] \[P] Create focused hero-active Notice Board context test scaffold with fake HTTP server and process runner helpers (`apps/hooks/tests/heroActiveNoticeContext.test.js`)
* [x] T005 \[S1706] Add bounded JSON GET helper for local server reads with timeout, auth header, non-2xx handling, and failure-path handling (`apps/hooks/src/_lib.js`)
* [x] T006 \[S1706] Add Notice Board context response parser that treats missing, non-string, malformed, oversized, or blocked-field responses as no context (`apps/hooks/src/_lib.js`)
* [x] T007 \[S1706] Add provider detection/output helper for safe additional context with silent fallback on unsupported providers (`apps/hooks/src/_lib.js`)
* [x] T008 \[S1706] Add reminder/context formatter with bounded length and privacy redaction for secrets, broad paths, transcripts, commands, and file-like payloads (`apps/hooks/src/_lib.js`)
* [x] T009 \[S1706] Add helper exports and focused unit assertions for auth header, timeout status, context parser, formatter, and output gate (`apps/hooks/tests/heroActiveNoticeContext.test.js`)

***

## Implementation (7 tasks)

Hero-active integration, safe output, and package documentation.

### apps/hooks

* [x] T010 \[S1706] Wire prompt-start context lookup in hero-active after session id resolution with cleanup on scope exit for all acquired resources (`apps/hooks/src/factionos-hero-active.js`)
* [x] T011 \[S1706] Preserve existing `hero_active` POST payload, prompt truncation, session aliasing, and silent POST failure behavior while context lookup is added (`apps/hooks/src/factionos-hero-active.js`)
* [x] T012 \[S1706] Emit provider-safe additional context and the fixed Notice Board reminder only when the provider output gate allows it (`apps/hooks/src/factionos-hero-active.js`)
* [x] T013 \[S1706] Ensure no-context, malformed response, non-2xx response, unreachable server, timeout, and missing session id paths exit 0 without noisy output (`apps/hooks/src/factionos-hero-active.js`)
* [x] T014 \[S1706] Ensure context lookup failures do not create spool entries and diagnostics remain compact and sanitized (`apps/hooks/src/_lib.js`)
* [x] T015 \[S1706] Document hook context lookup, supported provider output, CLI parity fallback, timeout, auth, and privacy boundaries (`apps/hooks/README_hooks.md`)
* [x] T016 \[S1706] Review hook map docs/comments for consistency without changing installer, trust state, or plugin packaging claims (`apps/hooks/hooks.codex.json`)

***

## Testing (4 tasks)

Focused hook behavior, privacy, and workflow validation.

### apps/hooks

* [x] T017 \[S1706] \[P] Add hook tests for context present, reminder insertion, safe provider output, existing POST body, and auth header (`apps/hooks/tests/heroActiveNoticeContext.test.js`)
* [x] T018 \[S1706] \[P] Add hook tests for empty context, missing session id, malformed JSON, non-2xx, unreachable server, and timeout with explicit loading, empty, error, and offline states represented as silent no-context outcomes (`apps/hooks/tests/heroActiveNoticeContext.test.js`)
* [x] T019 \[S1706] \[P] Add hook privacy tests proving raw prompts, transcripts, terminal output, secrets, absolute paths, command bodies, file contents, unsafe server payloads, and diagnostics do not reach output, logs, or spool (`apps/hooks/tests/heroActiveNoticeContext.test.js`)
* [x] T020 \[S1706] Run focused hook context tests plus ASCII/LF validation for session artifacts (`apps/hooks/tests/heroActiveNoticeContext.test.js`)

***

## 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/phase17-session06-hook-context-and-provider-skill-parity/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.
