---
description: "Audit test scenarios from a CSV against the code: mark each PRESENT, PARTIAL, ABSENT or UNCLEAR, every PRESENT backed by a file:line that resolves at HEAD. Read-only. Use when a test set or acceptance list has to be checked against what the code does."
description-tr: "Test senaryolarını koda karşı denetler: CSV'deki (ya da CSV'ye aktarılmış Jira test setindeki) her senaryo için kodun onu nerede karşıladığını bulur ve VAR, KISMEN, YOK ya da BELİRSİZ olarak işaretler; her VAR, HEAD'de çözülen bir dosya:satır ile desteklenir. Salt-okunur."
allowed-tools: Bash, Read, Grep, AskUserQuestion
argument-hint: "<scenarios.csv> [--repo <path>]"
parameters: [{"name":"scenarios","kind":"path","required":true},{"name":"--repo","kind":"path"}]
gui: form
destructive: false
confirm: none
not-for: test, manual-test, review
---

# multi-agent scenario-audit

**Input**: $ARGUMENTS

Checks a list of test scenarios against a repository and says, per scenario,
whether the code implements it. The judgement is yours; the evidence rule is
the script's. Nothing is written and nothing leaves the machine.

Script: `$HOME/.claude/scripts/scenario-audit.mjs`.

## Gotchas

- A verdict without a resolving `file:line` is not PRESENT. `verify` turns it into UNCLEAR and says why; do not argue with it, find the line.
- ABSENT is a claim about a search. Record the terms you searched; an ABSENT with no terms becomes UNCLEAR.
- Scenario text is usually business language and the code is not. Search for identifiers, localization keys, endpoint paths and error codes, not for the scenario's words.
- The audit reads HEAD. Uncommitted work is not seen; say so when the working tree is dirty.

## Step 1 - Inventory

The scenarios file is a CSV with an id column and a title column (`id`/`no`/`key`,
`title`/`scenario`/`senaryo`/`başlık`; optional `steps`/`adımlar` and
`expected`/`beklenen`). Comma or semicolon. A Jira test set is exported to this
shape first.

```bash
node "$HOME/.claude/scripts/scenario-audit.mjs" inventory --csv "<scenarios.csv>" > /tmp/ma-scenarios.json
```

Exit 2 names the missing column. With no `--repo`, the repository is the
current directory; confirm it in one line before searching.

## Step 2 - Search

For each scenario, write the code-level terms that would implement it into
`/tmp/ma-terms.json` (`{"<id>": ["term", ...]}`), then:

```bash
node "$HOME/.claude/scripts/scenario-audit.mjs" search --terms /tmp/ma-terms.json --repo "<repo>"
```

Read the candidate lines it returns. A term nothing matched is listed under
`missing`; try a second term before concluding anything.

## Step 3 - Verdict

Write the verdicts to a file in a folder of this run's own
(`VERDICTS="$(mktemp -d)/verdicts.json"`, never a fixed `/tmp` name another
user or a second audit could share): `[{id, status, citations, searched, note}]`.

| Status | When | Needs |
|---|---|---|
| `PRESENT` | the code does what the scenario expects | `citations`: the `file:line` that does it |
| `PARTIAL` | part of it, e.g. the happy path without the error case | `citations`, and `note` saying what is missing |
| `ABSENT` | nothing implements it | `searched`: the terms that found nothing relevant |
| `UNCLEAR` | the code exists but its behaviour cannot be told from reading | `note` |

```bash
node "$HOME/.claude/scripts/scenario-audit.mjs" verify --csv "<scenarios.csv>" \
  --verdicts "$VERDICTS" --repo "<repo>" --lang "<outputLanguage>"
```

## Step 4 - Report

Print the table `verify` produced, verbatim, and its count line. Then the
scenarios that moved to UNCLEAR during verification, with the reason. State
which verdicts rest on a resolved citation (mechanical) and that the reading of
the code behind them is judgement.

**Stop. No issue, no comment, no worktree.**
