> 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/specs/phase24-session02-camp-mission-linkage/implementation_summary.md).

# Implementation Summary

**Session ID**: `phase24-session02-camp-mission-linkage` **Packages**: apps/web (primary), apps/server (secondary) **Completed**: 2026-07-08 **Duration**: \~1.5 hours

***

## Overview

Wired the section 5A camp-to-mission linkage end to end. The projection's `pendingLinks`/`campLinks` substrate (shipped in Phase 22, previously dead code) is now fed by real Quest Board actions: accepting or assigning a camp-backed codebase issue records a pending link `{campId, heroId, verbatim prompt, expiresAt}` and a matching `mission_start` binds the mission to its camp, with joint-assault derivation exposed via `selectGameCampMissions`.

The session resolved a grounding conflict: the server accept route only handled idle suggestions, and issue cards had no accept capability, so no camp-linked accept could ever occur. The existing accept route now falls through to current codebase issues (same route, unchanged response contracts; acceptance dispatches the suggested prompt without dismissing the issue), and issue cards expose accept/assign.

***

## Deliverables

### Files Modified

| File                                            | Changes                                                                                            |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `apps/server/src/managers/suggestionManager.ts` | Accept fallthrough to current issues; dispatch-shaped value; severity-to-priority mapping          |
| `apps/web/src/lib/questBoardModel.ts`           | accept/assign capabilities on codebase-issue cards                                                 |
| `apps/web/src/lib/legionCamps.ts`               | `legionCampIdForIssueId` deterministic lookup                                                      |
| `apps/web/src/lib/gameProjection.ts`            | `campMissionsFromLinks` inverse derivation; `PENDING_LINK_TTL_MS` (2 min)                          |
| `apps/web/src/store/useGameStore.ts`            | `recordQuestCampPendingLink` guard-mirrored helper; accept/assign wiring; `selectGameCampMissions` |
| 6 test files (2 server, 4 web)                  | 14 new tests                                                                                       |
| `README.md`                                     | Pre-existing version-badge drift fix (0.1.192 -> 0.1.194)                                          |

***

## Technical Decisions

1. **Issue accept is dispatch, not resolution**: the issue and its camp survive acceptance; camps die only on verified kills (Session 04) or clean rescans (Fun Law 1).
2. **No hero, no link**: prompt\_sent accepts without an assigned hero record nothing rather than guessing.
3. **Persistence guards mirrored, not duplicated**: the recording helper captures the same replay/mock persist context as `applyEvent`.
4. **`PENDING_LINK_TTL_MS` exported** beside the link logic for Session 07 regressions and the Phase 12 tuning sweep.

***

## Test Results

| Metric       | Value                                                     |
| ------------ | --------------------------------------------------------- |
| Web project  | 2223 / 2223 passed                                        |
| Node project | 1081 passed, 1 pre-existing skip                          |
| New tests    | 14                                                        |
| Gates        | Biome, tsc (web+server), format:check, ASCII/LF all clean |

***

## Lessons Learned

1. Phase 22 reducer substrate can hide REQUIRED inputs: `expiresAt` was mandatory and omitting it made recording a silent no-op - caught by the end-to-end store test, not the typechecker.
2. Replayed `suggestion_update` snapshots do not build camps (by design), so replay-context guard tests must build camps live before entering replay.

***

## Future Considerations

1. Session 04 consumes `selectGameCampMissions` and `campLinks` for strike playback and joint assault rendering.
2. Session 07 should regression-test pending-link prompt bounds and expiry pruning across serialization seams.
3. QuestBoard UI may want visible accept affordances/copy for issue cards (currently capability-only); Session 04/05 or design Phase 4 ceremony work can surface them.

***

## Session Statistics

* **Tasks**: 19 completed
* **Files Modified**: 12
* **Tests Added**: 14
* **Blockers**: 1 resolved (no camp-backed accept path existed)


---

# 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/specs/phase24-session02-camp-mission-linkage/implementation_summary.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.
