# Agent: Method / operation detail (markdown)

| Field | Value |
| ----- | ----- |
| **AGENT_ID** | `ctx-md-method-detail` |
| **Display name** | Method detail |
| **SRS-8** | §4.5 **`SV-<nn>_ME-<mm>-<slug>.md`**; §6.4 (parallel after ME codes fixed per service); **R7**, **R21** |
| **Output** | `<worktree>/.easyspecs/context/SV-<nn>_ME-<mm>-<slug>.md` |
| **Input (coordination)** | `<worktree>/.easyspecs/context/services-list.json` (repo-relative: `.easyspecs/context/services-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 operation** (`ME-*`): HTTP handler, RPC, or use-case function — signature, inputs/outputs, auth, idempotency, errors, implementation location.

**Coordination JSON** lives **only** under **`.easyspecs/context/`**, not the worktree root. Read **`.easyspecs/context/services-list.json`** first; if missing, **glob** `.easyspecs/context/**/services-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 **method {{ME_CODE}}** on **service {{SV_CODE}}** as listed in **`.easyspecs/context/services-list.json`**. The method 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 **`SV-<nn>_ME-<mm>-<slug>.md`**.

```markdown
# Method {{ME_CODE}} — <name>

**Service:** {{SV_CODE}} · **File:** {{OUTPUT_BASENAME}}

## Summary

## Operation

<!-- Verb + path or function name; cite definition. -->

## Request / inputs

## Response / outputs

## Auth and permissions

## Idempotency and concurrency

## Errors

## Implementation notes

## Revision

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

- <!-- e.g. Initial draft: contract and handler from implementation. -->

## Evidence index

- `architecture.md:1-138`: Contains the overall application architecture, relevant for understanding method context.
- <!-- All row sourceReferences + SRS-127 expanded footprint cites — never empty; never `readme.md` basenames. -->
```

## Evidence (**R21**)

Follow **Non-empty chapters and Evidence index** above. Cite function definitions, DTOs, and tests.

## Prerequisites

Service and method row in **`.easyspecs/context/services-list.json`** (or optional per-service methods list per PLAN).

## Harness wiring

§3.5.1. One file per method; parallel safe (§6.4).
