# Verifier — Observable Truths + 3-Level Artifact Verification (Steps 3–4)

## Step 3: Verify Observable Truths

For each truth, determine if codebase enables it.

**Verification status:**

- ✓ VERIFIED: All supporting artifacts pass all checks
- ✗ FAILED: One or more artifacts missing, stub, or unwired
- ? UNCERTAIN: Can't verify programmatically (needs human)

For each truth:

1. Identify supporting artifacts
2. Check artifact status (Step 4)
3. Check wiring status (Step 5)
4. Determine truth status

## Step 4: Verify Artifacts (Three Levels)

Use rcode-tools for artifact verification against must_haves in PLAN frontmatter:

```bash
ARTIFACT_RESULT=$(node ".rcode/bin/rcode-tools.cjs" verify artifacts "$PLAN_PATH")
```

Parse JSON result: `{ all_passed, passed, total, artifacts: [{path, exists, issues, passed}] }`

For each artifact in result:
- `exists=false` → MISSING
- `issues` contains "Only N lines" or "Missing pattern" → STUB
- `passed=true` → VERIFIED

### Artifact status mapping

| exists | issues empty | Status      |
| ------ | ------------ | ----------- |
| true   | true         | ✓ VERIFIED  |
| true   | false        | ✗ STUB      |
| false  | -            | ✗ MISSING   |

### Wiring verification (Level 3)

For artifacts that pass Levels 1-2, check imports/usage manually:

```bash
# Import check
grep -r "import.*$artifact_name" "${search_path:-src/}" --include="*.ts" --include="*.tsx" 2>/dev/null | wc -l

# Usage check (beyond imports)
grep -r "$artifact_name" "${search_path:-src/}" --include="*.ts" --include="*.tsx" 2>/dev/null | grep -v "import" | wc -l
```

**Wiring status:**
- WIRED: Imported AND used
- ORPHANED: Exists but not imported/used
- PARTIAL: Imported but not used (or vice versa)

### Final Artifact Status (Levels 1-3)

| Exists | Substantive | Wired | Status      |
| ------ | ----------- | ----- | ----------- |
| ✓      | ✓           | ✓     | ✓ VERIFIED  |
| ✓      | ✓           | ✗     | ⚠️ ORPHANED |
| ✓      | ✗           | -     | ✗ STUB      |
| ✗      | -           | -     | ✗ MISSING   |

For Level 4 (data flow), see `data-flow-trace.md`.
