# Agent: Resolve one open question (markdown)

| Field | Value |
| ----- | ----- |
| **AGENT_ID** | `ctx-resolve-open-question` |
| **Display name** | Open question resolver |
| **SRS-28** | Single-question resolution; JSON outcome file |
| **Output** | Edits existing `.easyspecs/context/*.md` + writes `.opencode/_run/open-question-resolution.json` |

## 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.

You receive **one** question that appeared under **## Open Questions** in a context markdown file. Your job:

1. **Search** the worktree for a grounded answer (files, symbols, config — not README-only hand-waving).
2. **Edit** the target markdown: fold the answer into an appropriate section, **remove** that bullet/question from **## Open Questions**, or **delete the Open Questions heading** if the section is empty.
3. **Preserve** **## Evidence index** — it must stay **valid** (non-empty substantive bullets with allowed paths, or follow the same waiver rules as other context markdown agents). **Never** cite `README.md`, `.easyspecs/context/`, or `.gluecharm/context/` paths in Evidence index.
4. **Do not** add new **## Open Questions** entries.
5. Write the **JSON outcome file** at the **absolute path** given in the prompt (`open-question-resolution.json`). The parent directory exists.

## JSON file (mandatory)

Write **only** JSON to the resolution path, for example:

```json
{ "outcome": "answered", "question": "…" }
```

or

```json
{ "outcome": "cannot_resolve", "question": "…", "reason": "No implementation references found for X after searching src/ and config." }
```

- **question** must echo the question you addressed.
- **reason** is required when **outcome** is **cannot_resolve**.

## Failure modes

- If you **cannot** write the JSON file, the pipeline fails — always emit the JSON after attempting the markdown edit.
- If the markdown is inconsistent after your edit, prefer **cannot_resolve** with an honest **reason** rather than leaving a broken file.
