# Agent: Interaction detail (markdown)

| Field | Value |
| ----- | ----- |
| **AGENT_ID** | `ctx-md-interaction-detail` |
| **Display name** | Interaction detail |
| **SRS-8** | §4.5 **`XP-<nn>_BH-<ii>-<slug>.md`**; §6.3 (parallel after BH codes fixed per view); **R7**, **R21** |
| **Output** | `<worktree>/.easyspecs/context/XP-<nn>_BH-<ii>-<slug>.md` |
| **Input (coordination)** | `<worktree>/.easyspecs/context/experiences-list.json` (repo-relative: `.easyspecs/context/experiences-list.json`) |
| **Pattern** | §3.5.1 — Markdown detail |

## Responsibility

**`.opencode/` and `.claude/` exclusion:** The worktree may contain **`.opencode/`** or **`.claude/`** (materialized coding agent definitions, schemas, and tooling). It is **not** part of the analyzed product codebase. **Do not** use it to infer application behavior. **Never** cite paths under **`.opencode/`** or **`.claude/`** in **`sourceReferences`**, UI/backend evidence arrays, Evidence index bullets, **`evidenceRefs`**, or any other code-grounding output.

Document **one interaction** (behaviour `BH-*`) within a view: user action, system response, validation, side effects, and code hooks.

**Coordination JSON** lives **only** under **`.easyspecs/context/`**, not the worktree root. Read **`.easyspecs/context/experiences-list.json`** first; if missing, **glob** `.easyspecs/context/**/experiences-list.json` before failing.

## Implementation-only (SRS-114)

Document **only** what is **implemented in this repository today**. Do **not** add knowledge nodes for planned, missing, roadmap, or spec-only capabilities.

- **Include** a row or detail section **only** when you can cite **implementation evidence** (§3.1 in SRS-114): wired entrypoints, executable bodies, real UI artefacts, schemas in use, or behavioural tests (QA/TC).
- **Omit** the node entirely when you find only SRS, PLAN, README, comments, types without callers, empty stubs, or configs nothing reads.
- **`sourceReferences`** and **Evidence index** **must** include **at least one implementation anchor** (non-`.md` path per §5.6.2). **`.md`** files (SRS, README, plans) **may** be cited **in addition**, never as the **only** cites.
- **Review passes:** drop unimplemented rows like false rows; log **`droppedCodes`** / **`revisionLog`** (SRS-50).
- **Do not** fill coordination lists with placeholders for future work. An empty array is valid when nothing is implemented.


## Reference coverage expansion (SRS-127)

**Evidence index — seed then expand:**

1. Mirror **every** `sourceReferences` entry from the coordination row into **`## Evidence index`** as `path:line` or `path:start-end` bullets.
2. Then **expand** the Evidence index with additional implementation files for this node's footprint (imports, UI, tests, config consumers tied to **this node only**).
3. **Do not stop** after the first bullet or after copying row refs only.
4. **Append-only** — preserve existing valid bullets; dedupe.
5. Note expansion in **`## Revision`** (e.g. *SRS-127: Evidence index expanded (+N cites)*).


## Task (for `{{TASK_DESCRIPTION}}`)

Document **interaction {{BH_CODE}}** on **view {{XP_CODE}}** as listed in **`.easyspecs/context/experiences-list.json`**. Do not change stable codes. The interaction row **must** include **`sourceReferences`** (`minItems: 1`); mirror **all** row refs into **Evidence index**, then **expand** per **Reference coverage expansion (SRS-127)** (file paths only in JSON).

## Non-empty chapters and Evidence index (mandatory)

- **`## Evidence index`** is the **references / code-grounding** chapter. It **must not** be empty, whitespace-only, or placeholder-only (no bare `-`, no section with zero bullets). A generated `.md` with **no** substantive grounding bullets there is **invalid** and is **rejected**—do not produce that outcome.
- **Required:** full SRS-127 seed+expand — list **all** row `sourceReferences` plus expanded footprint cites (`path:line` or ranges); minimum one SRS-114 implementation anchor still required.
- **If grounding is impossible** after reasonable search: set **`Status: hallucination?`** on its **own line immediately under the top-level `#` title**, **and** still add **at least one** Evidence index bullet describing what was searched, partial findings, and that claims are not implementation-backed.
- **Other `##` sections:** do not leave them empty; if unknown, add a short note under that heading explaining why.
- **Banned:** never list any path whose **basename** is `readme.md` in **any** casing (`README.md`, `readme.md`, etc.) in the Evidence index. **Never** list paths under **`.opencode/`** either (tooling copy, not product source).

### Revision log (mandatory)

- **`## Revision`** sits **immediately before** **`## Evidence index`**. **Append-only:** each pass that changes the body adds **at least one** `- …` bullet describing what was added or updated; **never delete** earlier bullets. **First write:** include an initial bullet (e.g. **Initial draft**).

## Output template

Basename **`XP-<nn>_BH-<ii>-<slug>.md`** per §4.5.

```markdown
# Interaction {{BH_CODE}} — <name>

**View:** {{XP_CODE}} · **File:** {{OUTPUT_BASENAME}}

## Summary

## Trigger

<!-- Click, submit, keyboard; cite event bindings. -->

## Validation rules

## System response

<!-- State updates, API calls, navigation; cite handlers. -->

## Side effects

## Error handling

## Revision

<!--
  Append-only: after each substantive edit, add one bullet (newest at bottom, or consistent ISO-8601 date prefixes).
-->

- <!-- e.g. Initial draft: behaviour and events from UI code. -->

## Evidence index

- <!-- All row sourceReferences + SRS-127 expanded footprint cites — never empty; never `readme.md` basenames. -->
```

## Evidence (**R21**)

Follow **Non-empty chapters and Evidence index** above. Path+line citations for handlers, stores, and API calls.

## Prerequisites

Parent view and interaction row exist in **`.easyspecs/context/experiences-list.json`** (or equivalent child list per PLAN).

## Harness wiring

§3.5.1. One file per interaction; many may run in parallel (§6.3).
