> 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/phases/phase_24/session_02_camp_mission_linkage.md).

# Session 02: Camp Mission Linkage

**Session ID**: `phase24-session02-camp-mission-linkage` **Package**: apps/web **Status**: Not Started **Estimated Tasks**: \~18 **Estimated Duration**: 2-4 hours

***

## Objective

Wire the section 5A camp-to-mission linkage end to end: Quest Board accept and assign successes record pending links from real camp, hero, and verbatim prompt data; `mission_start` binds them into `campLinks`; expiry, fallback, and joint-assault derivation are covered by tests.

***

## Scope

### In Scope (MVP)

* Record a pending link `{campId, heroId, prompt, expiresAt}` on Quest Board accept/assign success in `questBoardActions.ts`, using the verbatim prompt from `SuggestionAcceptRestResponse` (or the known `suggestedPrompt`), only for quests that map to a current camp.
* Route the recording through the existing store/projection entry point so `pendingLinks` state stays projection-owned; add the entry point if the reducer substrate lacks a public one.
* Verify and, where gaps exist, complete `mission_start` binding: exact heroId + verbatim prompt match, fallback to first mission on that hero inside the expiry window, expired-link cleanup.
* Joint assault derivation: a selector exposing all missions linked to one camp so rendering can show a coordinated siege.
* Equality guards so no-op recordings do not churn projection references.
* Tests: accept success records a link, assign success records a link, failed/rolled-back actions do not, binding matches verbatim prompts, fallback and expiry behave, replayed `mission_start` events do not bind new links.

### Out of Scope

* Strike rendering, HP drain, camp kills (Session 04).
* Persistence boundary regressions beyond basic reducer guards (Session 07).
* Any protocol or server change.

***

## Prerequisites

* [ ] Phase 23 complete.
* [ ] Session 01 not required; this session is independent.

***

## Deliverables

1. Pending-link recording in `questBoardActions.ts` behind action success.
2. Projection entry point/selector work in `gameProjection.ts` and `useGameStore.ts` for links and joint assault.
3. Focused tests across actions, reducer, and store paths.

***

## Success Criteria

* [ ] Accepting a camp-linked quest against a live server shape records a pending link with real ids and verbatim prompt.
* [ ] A matching `mission_start` binds `missionId -> campId`; non-matching missions do not bind; expired links clean up.
* [ ] Multiple missions can link one camp and the joint-assault selector reports them.
* [ ] Replay traffic cannot create or bind links that persist.
* [ ] Web typecheck and focused tests pass.


---

# 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/phases/phase_24/session_02_camp_mission_linkage.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.
