> 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-session11-validation-documentation-and-handoff/implementation-notes.md).

# Implementation Notes

**Session ID**: `phase18-session11-validation-documentation-and-handoff` **Package**: Cross-package (`packages/protocol`, `apps/server`, `apps/web`, `docs`, `.spec_system`) **Started**: 2026-06-10 11:24 **Last Updated**: 2026-06-10 12:01

***

## Session Progress

| Metric              | Value     |
| ------------------- | --------- |
| Tasks Completed     | 24 / 24   |
| Estimated Remaining | 0 minutes |
| Blockers            | 0         |

***

### Task T024 - Final closeout reports

**Started**: 2026-06-10 11:56 **Completed**: 2026-06-10 12:01 **Duration**: 5 minutes

**Notes**:

* Finalized the security-compliance report, docs handoff, validation record, ready-for-validate report, and implementation summary.
* Updated the Phase 18 PRD and master PRD to say Session 11 implementation is complete while validation remains pending.
* Marked all Session 11 tasks and completion checklist items complete.
* Re-ran final format, lint, ASCII, LF, official secret scan, changed/new artifact secret-pattern scan, and diff checks after the final reports were created.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/security-compliance.md` - Updated final evidence status and assessment.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-docs-handoff.md` - Completed ownership matrix and checklist.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-validation-record.md` - Added final assessment and closeout statuses.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/validation.md` - Added ready-for-validate report.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/IMPLEMENTATION_SUMMARY.md` - Added implementation summary.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/spec.md` - Marked implementation complete.
* `.spec_system/PRD/phase_18/PRD_phase_18.md` - Updated Session 11 status and next workflow.
* `.spec_system/PRD/PRD.md` - Updated Phase 18 progress summary.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T024 complete and updated completion checklist.

**BQC Fixes**:

* Closeout integrity: Final reports distinguish implementation completion from independent validation and keep all no-claim boundaries explicit.

***

### Task T023 - Artifact hygiene and secret checks

**Started**: 2026-06-10 11:54 **Completed**: 2026-06-10 11:54 **Duration**: 1 minute

**Notes**:

* Ran ASCII and CRLF checks across tracked edits plus new session artifacts.
* Ran `npm run security:secrets` through Node 26.2.0.
* Ran `git diff --check`.
* Result: all artifact hygiene and secret checks passed.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-validation-record.md` - Recorded T023 hygiene and secret-check results.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T023 complete and updated progress.

**BQC Fixes**:

* Security and artifact compliance: Confirmed no changed/new text artifacts contain non-ASCII bytes, CRLF endings, detected secrets, or whitespace errors.

***

### Task T022 - Broad root gates

**Started**: 2026-06-10 11:50 **Completed**: 2026-06-10 11:53 **Duration**: 3 minutes

**Notes**:

* Ran the broad formatting, lint, workspace typecheck, and root test gates through Node 26.2.0.
* Result: format, lint, workspace typecheck, and root tests passed.
* Root test result: 215 test files passed, 1 skipped; 2656 tests passed, 1 skipped.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-validation-record.md` - Recorded T022 broad gate results.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T022 complete and updated progress.

**BQC Fixes**:

* Runtime compatibility: Confirmed the full workspace validates under Node 26.2.0 after focused Quest Board changes.

***

### Task T021 - Focused web tests

**Started**: 2026-06-10 11:49 **Completed**: 2026-06-10 11:49 **Duration**: 1 minute

**Notes**:

* Ran focused web Quest Board tests for normalization, store reducers, action client, component controls, scan trigger feedback, keyboard shortcuts, shortcut help, and Settings scan behavior.
* Result: 8 files passed, 114 tests passed.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-validation-record.md` - Recorded T021 focused web test results.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T021 complete and updated progress.

**BQC Fixes**:

* Accessibility and platform compliance: Shortcut and modal tests cover visible help and editable-field guard behavior.

***

### Task T020 - Focused protocol and server tests

**Started**: 2026-06-10 11:48 **Completed**: 2026-06-10 11:48 **Duration**: 1 minute

**Notes**:

* Ran focused protocol and server Quest Board suites for contracts, events, REST vocabulary, manager state/persistence, routes, WebSocket hydration, idle lifecycle, summaries, scanners, scan orchestration, analysis, project scan, and unsupported routes.
* Result: 18 files passed, 114 tests passed.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-validation-record.md` - Recorded T020 focused test results.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T020 complete and updated progress.

**BQC Fixes**:

* Failure path completeness: Focused tests include malformed input, missing records, conflicts, provider-disabled fallback, persistence failure, and unsupported-route redaction paths.

***

### Task T019 - PRD and handoff closeout updates

**Started**: 2026-06-10 11:45 **Completed**: 2026-06-10 11:47 **Duration**: 2 minutes

**Notes**:

* Updated Phase 18 tracker to mark Session 11 as implementation-ready with validation pending.
* Added missing Session 09 completed-session summary and Session 11 closeout notes.
* Added Appendix A closeout status summary without modifying the preserved audit rows.
* Updated the master PRD Phase 18 progress paragraph.
* Updated docs handoff statuses and final handoff notes.

**Files Changed**:

* `.spec_system/PRD/phase_18/PRD_phase_18.md` - Updated Session 11 tracker, next workflow, closeout notes, and Appendix A closeout status.
* `.spec_system/PRD/PRD.md` - Updated Phase 18 progress summary.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-docs-handoff.md` - Updated document status and handoff notes.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T019 complete and updated progress.

**BQC Fixes**:

* Contract alignment: PRD records now avoid claiming validation complete before the final gates and `validate` workflow.

***

### Task T018 - Scan, analysis, and project-scan evidence

**Started**: 2026-06-10 11:44 **Completed**: 2026-06-10 11:45 **Duration**: 1 minute

**Notes**:

* Ran focused tests for codebase issue scanners, scan orchestration, ignore patterns, on-demand analysis, project scan, route status/freshness/conflict paths, and web scan request handling.
* Command passed: `npx vitest run apps/server/tests/codebaseIssueScanners.test.ts apps/server/tests/codebaseScanOrchestrator.test.ts apps/server/tests/questIgnore.test.ts apps/server/tests/onDemandAnalysisEngine.test.ts apps/server/tests/projectScanEngine.test.ts apps/server/tests/suggestionRoutes.test.ts apps/web/tests/scanCodebase.test.ts apps/web/tests/SettingsScan.test.tsx`.
* Result: 8 files passed, 56 tests passed.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-validation-record.md` - Recorded redacted scan, analysis, project scan, status, freshness, fallback, and ignore-pattern evidence.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T018 complete and updated progress.

**BQC Fixes**:

* Evidence privacy: Recorded route/status behavior, pass counts, and redacted summaries only.

***

### Task T017 - Runtime evidence for Quest Board core flows

**Started**: 2026-06-10 11:43 **Completed**: 2026-06-10 11:43 **Duration**: 1 minute

**Notes**:

* Ran focused runtime tests for hero-idle generation, WebSocket hydration, persistence, route actions, typed card rendering, store hydration, duplicate guards, and feedback paths.
* Command passed: `npx vitest run apps/server/tests/idleSuggestionLifecycle.test.ts apps/server/tests/suggestionWebsocket.test.ts apps/server/tests/suggestionManagerLifecycle.test.ts apps/server/tests/suggestionRoutes.test.ts apps/web/tests/QuestBoard.test.tsx apps/web/tests/questBoardStore.test.ts`.
* Result: 6 files passed, 39 tests passed.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-validation-record.md` - Recorded redacted runtime evidence for T017 flows.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T017 complete and updated progress.

**BQC Fixes**:

* Evidence privacy: Recorded only command names, pass counts, and behavior summaries.

***

### Task T016 - Final unsupported-route reconciliation

**Started**: 2026-06-10 11:42 **Completed**: 2026-06-10 11:43 **Duration**: 1 minute

**Notes**:

* Verified final unsupported-route code and docs references after narrowing `/issues`.
* Renamed the regression test to cover shipped Quest Board routes broadly.
* Ran `npx vitest run apps/server/tests/unsupportedRoutes.test.ts`; 12 tests passed.

**Files Changed**:

* `apps/server/tests/unsupportedRoutes.test.ts` - Renamed the shipped Quest Board route regression test.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T016 complete and updated progress.

**BQC Fixes**:

* Contract alignment: Confirmed shipped `/suggestions/*` and `/issues/:issueId/dismiss` paths are not represented as planned unsupported route families.

***

### Task T015 - Idle suggestion prompt doc reconciliation

**Started**: 2026-06-10 11:40 **Completed**: 2026-06-10 11:42 **Duration**: 2 minutes

**Notes**:

* Replaced stale mission-complete and click-only wording with shipped hero-idle lifecycle behavior.
* Preserved the first fenced system-prompt block used by runtime prompt loading.
* Documented bounded context, cooldown, timeout, fallback, provider opt-in, manager persistence, `suggestion_update`, session-summary separation, card actions, and shortcuts.

**Files Changed**:

* `apps/server/src/llm/prompts/idle-suggestion-engine.md` - Reconciled prompt documentation and runtime prompt block.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T015 complete and updated progress.

**BQC Fixes**:

* Contract alignment: Removed stale non-shipped trigger and card-action claims from the prompt documentation.
* Error information boundaries: Added explicit evidence and prompt-transfer redaction limits.

***

### Task T014 - Privacy and docs index update

**Started**: 2026-06-10 11:39 **Completed**: 2026-06-10 11:40 **Duration**: 1 minute

**Notes**:

* Added `suggestions.json` to the privacy inventory with code-derived text, relative paths, scan status, dismissed IDs, local storage, manual deletion, and trusted-erasure no-claim wording.
* Added Quest Board documentation routing to the docs index and updated current-doc descriptions.

**Files Changed**:

* `docs/privacy-and-security.md` - Added Quest Board data surface, manual deletion, local-only persistence, and no-claim wording.
* `docs/README_docs.md` - Added Quest Board documentation routing and updated current-doc descriptions.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T014 complete and updated progress.

**BQC Fixes**:

* Error information boundaries: Privacy docs now explicitly separate local persistence from provider, analytics, hosted storage, Worker federation, and trusted-erasure claims.

***

### Task T013 - Architecture docs update

**Started**: 2026-06-10 11:38 **Completed**: 2026-06-10 11:39 **Duration**: 1 minute

**Notes**:

* Added `suggestions.json` to the data layer table.
* Documented Quest Board protocol ownership, `SuggestionManager` source-of-truth, engine write paths, snapshot hydration, REST mutation updates, web action boundaries, and executor non-claims.

**Files Changed**:

* `docs/ARCHITECTURE.md` - Added Quest Board data and runtime architecture.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T013 complete and updated progress.

**BQC Fixes**:

* Contract alignment: Architecture now describes one manager-owned write path and the canonical `suggestion_update` delivery path.

***

### Task T012 - Web docs update

**Started**: 2026-06-10 11:38 **Completed**: 2026-06-10 11:38 **Duration**: 1 minute

**Notes**:

* Added a Quest Board cockpit contract section covering canonical snapshots, typed cards, explicit states, actions, triggers, feedback, and shortcuts.
* Documented that accept/assign do not imply real executors, Docker tasks, remote terminals, or codebase issue accept-as-quest behavior.

**Files Changed**:

* `apps/web/README_web.md` - Added Quest Board cards, actions, trigger, feedback, and shortcut contract.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T012 complete and updated progress.

**BQC Fixes**:

* Accessibility and platform compliance: Documented keyboard bindings, editable-field guardrails, and shortcut help expectations.

***

### Task T011 - Server docs update

**Started**: 2026-06-10 11:37 **Completed**: 2026-06-10 11:38 **Duration**: 1 minute

**Notes**:

* Tightened server route docs for Quest Board root and `/api` ownership.
* Added `forceRefresh` request aliases for analysis and project scan route docs.
* Documented that issue accept, executor dispatch, telemetry, and entitlement remain excluded/future work.
* Added unsupported-route reconciliation notes for shipped Quest Board paths.

**Files Changed**:

* `apps/server/README_server.md` - Updated Quest Board route ownership and unsupported-route closeout wording.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T011 complete and updated progress.

**BQC Fixes**:

* Contract alignment: Server README now matches request parser aliases and final unsupported-route inventory.

***

### Task T010 - Protocol docs update

**Started**: 2026-06-10 11:36 **Completed**: 2026-06-10 11:37 **Duration**: 1 minute

**Notes**:

* Rewrote the Phase 18 protocol ownership section as final consumer guidance.
* Added REST alias list, canonical `suggestion_update`, compatibility `idle_suggestion`, retired `quest_board`, local-first exclusions, and compact error expectations.

**Files Changed**:

* `packages/protocol/README_protocol.md` - Updated Quest Board contract ownership and consumer guidance.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T010 complete and updated progress.

**BQC Fixes**:

* Contract alignment: Removed future-session wording and aligned protocol docs with shipped routes and events.

***

### Task T009 - API docs update

**Started**: 2026-06-10 11:34 **Completed**: 2026-06-10 11:36 **Duration**: 2 minutes

**Notes**:

* Added a Quest Board API section covering root and `/api` aliases for summary, scan, analysis, project-scan, accept, dismiss, and issue-dismiss routes.
* Documented validation, compact error mapping, rate/auth/body-cap boundaries, freshness windows, provider opt-in, `suggestion_update`, `idle_suggestion`, and retired `quest_board` guidance.
* Updated the WebSocket hydrate order to include `suggestion_update`.

**Files Changed**:

* `docs/api/README_api.md` - Added Quest Board REST/WebSocket contracts and updated hydrate ordering.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T009 complete and updated progress.

**BQC Fixes**:

* Contract alignment: API docs now match shipped route aliases, validation behavior, and canonical WebSocket snapshot semantics.

***

### Task T008 - Unsupported route inventory verification

**Started**: 2026-06-10 11:32 **Completed**: 2026-06-10 11:34 **Duration**: 2 minutes

**Notes**:

* Verified shipped suggestion, scan, analysis, project-scan, summary, and issue-dismiss routes against the unsupported-route classifier.
* Removed the broad `/issues` task-queue prefix so shipped `/issues/:issueId/dismiss` is not represented as a planned unsupported family.
* Added regression checks for shipped issue-dismiss classifier paths.
* Ran `npx vitest run apps/server/tests/unsupportedRoutes.test.ts`; 12 tests passed.

**Files Changed**:

* `apps/server/src/lib/unsupportedRoutes.ts` - Removed broad `/issues` unsupported prefix.
* `apps/server/tests/unsupportedRoutes.test.ts` - Added issue-dismiss classifier regression checks.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-validation-record.md` - Recorded unsupported-route verification.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T008 complete and updated progress.

**BQC Fixes**:

* Contract alignment: Removed stale unsupported inventory coverage for a shipped Quest Board route family.

***

### Task T007 - Appendix A closeout matrix

**Started**: 2026-06-10 11:30 **Completed**: 2026-06-10 11:32 **Duration**: 2 minutes

**Notes**:

* Extracted Appendix A audit rows and classified them as shipped, deliberately excluded, shipped with FactionOS-specific wording, shipped internally, or clarification.
* Kept telemetry, entitlement gates, codebase issue accept-as-quest, and QuestLogPanel conflation outside Phase 18 shipped claims.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-validation-record.md` - Added Appendix A closeout matrix.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T007 complete and updated progress.

**BQC Fixes**:

* Contract alignment: Classified layout differences, internal APIs, and deliberate exclusions separately to avoid overstating parity.

***

### Task T006 - Security-compliance scaffold

**Started**: 2026-06-10 11:30 **Completed**: 2026-06-10 11:30 **Duration**: 1 minute

**Notes**:

* Created the session security report scaffold with data surfaces, controls, no-claim boundaries, and evidence rules.
* Captured `suggestions.json`, code-derived text, scan roots, provider opt-in, local-only persistence, and trusted-erasure no-claim requirements.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/security-compliance.md` - Added session security and compliance scaffold.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T006 complete and updated progress.

**BQC Fixes**:

* Trust boundary enforcement: Documented expected route validation, approved scan roots, provider opt-in, and error-boundary controls before final validation.

***

### Task T005 - Docs handoff scaffold

**Started**: 2026-06-10 11:29 **Completed**: 2026-06-10 11:30 **Duration**: 1 minute

**Notes**:

* Added document update status tracking and privacy inventory change scaffolds.
* Preserved the route inventory and stable-doc ownership matrix for later closeout updates.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-docs-handoff.md` - Added update-status and privacy-change scaffold tables.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T005 complete and updated progress.

**BQC Fixes**:

* Error information boundaries: Privacy scaffold explicitly disallows raw file contents, command bodies, terminal output, and broad absolute paths in evidence.

***

### Task T004 - Validation evidence scaffold

**Started**: 2026-06-10 11:28 **Completed**: 2026-06-10 11:29 **Duration**: 1 minute

**Notes**:

* Added dedicated evidence sections for all required protocol, manager, route, WebSocket, lifecycle, summary, scanner, analysis, project scan, web card, action, shortcut, focused-test, and broad-gate checks.
* Left all runtime results as Pending until the matching validation tasks execute.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-validation-record.md` - Added required validation scaffold sections.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T004 complete and updated progress.

**BQC Fixes**:

* Contract alignment: Split evidence by owning runtime boundary so later results cannot hide untested behavior behind a broad pass.

***

### Task T003 - Blocker sweep and validation state

**Started**: 2026-06-10 11:27 **Completed**: 2026-06-10 11:28 **Duration**: 1 minute

**Notes**:

* Swept prior Phase 18 validation and security reports for unresolved blockers, failures, credentials, and user-action dependencies.
* Confirmed Node 26.2.0 is installed through nvm and must be selected for validation commands.
* Defined temporary `FACTIONOS_HOME`, provider-transfer-disabled runtime settings, evidence redaction rules, and broad gate commands.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-validation-record.md` - Added blocker sweep, local validation state, redaction rules, and broad gate command list.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T003 complete and updated progress.

**BQC Fixes**:

* Failure path completeness: Captured the default Node version mismatch and the resolved nvm command before tests run.
* Error information boundaries: Added explicit redaction rules for runtime evidence.

***

### Task T002 - Stable docs and source inventory

**Started**: 2026-06-10 11:25 **Completed**: 2026-06-10 11:27 **Duration**: 2 minutes

**Notes**:

* Inventoried current stable docs, package README files, prompt docs, unsupported-route code, and Quest Board source/test coverage.
* Identified API docs, architecture docs, privacy inventory, docs index, web README, idle prompt docs, and unsupported route code as closeout targets.
* Noted that server README already carries substantial Session 02-08 Quest Board runtime coverage and should be tightened, not rewritten wholesale.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-docs-handoff.md` - Added stable-doc ownership matrix, source coverage inventory, route inventory, update checklist, and handoff notes.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T002 complete and updated progress.

**BQC Fixes**:

* Contract alignment: Flagged stale prompt claims and the unsupported `/issues` prefix before docs or code could overstate final route support.

***

### Task T001 - Acceptance matrix

**Started**: 2026-06-10 11:24 **Completed**: 2026-06-10 11:25 **Duration**: 1 minute

**Notes**:

* Reviewed Phase 18 PRD, Session 11 stub, and Session 01-10 validation summaries.
* Built the initial acceptance matrix and prior-session validation status.
* Found no unresolved blocker in prior validation summaries.

**Files Changed**:

* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/phase18-validation-record.md` - Added acceptance matrix, prior-session validation status, and success-criteria trace.
* `.spec_system/specs/phase18-session11-validation-documentation-and-handoff/tasks.md` - Marked T001 complete and updated progress.

**BQC Fixes**:

* Evidence privacy: Used summarized prior validation status only; no raw command output or local payloads were copied.

***

## Task Log

### 2026-06-10 - Session Start

**Environment verified**:

* [x] Prerequisites confirmed
* [x] Tools available
* [x] Directory structure ready
* [x] Cross-package session confirmed

***


---

# 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-session11-validation-documentation-and-handoff/implementation-notes.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.
