> 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/specs/phase41-session05-voice-token-bootstrap/tasks.md).

# Task Checklist

**Session ID**: `phase41-session05-voice-token-bootstrap` **Total Tasks**: 20 **Estimated Duration**: 3-4 hours **Created**: 2026-07-03

***

Legend: `[x]` completed; `[ ]` pending; `[P]` parallelizable; `[S4105]` session ref; `TNNN` task ID.

***

## Setup (3 tasks)

* [x] T001 \[S4105] Verify Phase 41 prerequisites and session 05 boundaries against the selected stub (`.spec_system/PRD/phase_41/session_05_voice_token_bootstrap.md`)
* [x] T002 \[S4105] Characterize the direct voice command, server entry, and token comments before changing them (`package.json`, `voice-lab/server.ts`, `voice-lab/.env.example`)
* [x] T003 \[S4105] Characterize current launch, broker, and hook tests that lock in token behavior (`scripts/lib/__tests__/voice-launch-bridge.test.ts`, `scripts/lib/__tests__/voice-broker.test.ts`, `src/hooks/__tests__/use-hermes-intelligence-voice.test.tsx`)

***

## Foundation (5 tasks)

* [x] T004 \[S4105] \[P] Create a voice token bootstrap helper for env, dev-token file, and generated process-local token sources (`scripts/lib/voice-token-bootstrap.ts`)
* [x] T005 \[S4105] \[P] Add token bootstrap unit tests for env, dev-token file, generated token, missing file, and safe metadata cases (`scripts/lib/__tests__/voice-token-bootstrap.test.ts`)
* [x] T006 \[S4105] Update broker health types to carry automatic token readiness and recovery metadata without exposing token values (`scripts/lib/voice-broker.ts`)
* [x] T007 \[S4105] Refactor direct server option construction to use the token bootstrap helper before broker startup (`voice-lab/server.ts`)
* [x] T008 \[S4105] Update local voice environment example copy so direct startup no longer requires manual `AI_OS_VOICE_TOKEN` setup (`voice-lab/.env.example`)

***

## Implementation (8 tasks)

* [x] T009 \[S4105] Implement direct `bun run voice` token bootstrap before health creation and request handling (`voice-lab/server.ts`)
* [x] T010 \[S4105] Preserve `/api/session` request token enforcement while removing default direct-start `missing_token_config` behavior (`scripts/lib/voice-broker.ts`)
* [x] T011 \[S4105] Ensure Start Voice spawned child env carries the Vite same-run token and provider config without secrets in argv (`scripts/lib/voice-launch-bridge.ts`)
* [x] T012 \[S4105] Preserve launch bridge loopback, Host-header, bounded body, env-only provider config, base allowlist, and duplicate-start cleanup paths (`scripts/lib/voice-launch-bridge.ts`)
* [x] T013 \[S4105] Update broker tests for auto-token health, generated direct token readiness, missing key, invalid base, request token, and provider failure paths (`scripts/lib/__tests__/voice-broker.test.ts`)
* [x] T014 \[S4105] Update launch bridge tests for spawned token env, existing token-ready broker health, rejected tokens, missing provider key, spawn failure, and timeout cleanup (`scripts/lib/__tests__/voice-launch-bridge.test.ts`)
* [x] T015 \[S4105] Update hook tests so launch and broker token failures remain distinct and session credentials are not requested after launch failure (`src/hooks/__tests__/use-hermes-intelligence-voice.test.tsx`)
* [x] T016 \[S4105] Verify direct command bootstrap behavior does not log or serialize token values in safe output (`scripts/lib/__tests__/voice-token-bootstrap.test.ts`)

***

## Testing (4 tasks)

* [x] T017 \[S4105] Run focused voice script tests (`bun run test scripts/lib/__tests__/voice-token-bootstrap.test.ts scripts/lib/__tests__/voice-broker.test.ts scripts/lib/__tests__/voice-launch-bridge.test.ts`)
* [x] T018 \[S4105] Run focused voice hook tests (`bun run test src/hooks/__tests__/use-hermes-intelligence-voice.test.tsx`)
* [x] T019 \[S4105] Run script typecheck for the server/helper contract (`bun run typecheck:scripts`)
* [x] T020 \[S4105] Validate ASCII/LF requirements and record implementation evidence (`.spec_system/specs/phase41-session05-voice-token-bootstrap/implementation-notes.md`)

***

## Completion Checklist

* [x] All tasks marked `[x]`
* [x] All tests and checks passing
* [x] All files ASCII-encoded with LF line endings
* [x] implementation-notes.md updated
* [x] Ready for `creview` (next step in the implement -> creview -> validate sequence)

***

## Next Steps

Run the `creview` workflow step.


---

# 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/specs/phase41-session05-voice-token-bootstrap/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.
