# Actor → Business Flow Parity Check

## Context

App: {{APP_NAME}}
Actor docs: {{ACTOR_DOCS}}
Business flow docs: {{BUSINESS_FLOW_DOCS}}

## Instructions

1. Read ALL actor docs at the paths above
2. Read ALL business flow docs at the paths above
3. For each actor, extract the list of authorized/referenced business flows
4. Run every parity check below against each actor
5. Return results as JSON per the Output Format section

## Extraction: Actor Docs

From each actor doc, extract:

- Actor name
- List of authorized or referenced business flows
- Flow links (format: `../business-flow/<flow>/README.md`)

## Extraction: Business Flow Docs

From each business flow README.md, extract:

- Flow name (from directory name or heading)
- Actors involved in the flow

## Parity Checks

For each actor's referenced flows:

| Check ID       | Question                                                     |
| -------------- | ------------------------------------------------------------ |
| flow_existence | Do all flows listed in the actor's "Authorized Flows" exist? |
| link_validity  | Do flow links in the actor doc resolve to real files?        |

### How to Check

1. List all flows referenced by each actor doc
2. Verify a corresponding business flow README exists for each
3. Validate that all `../business-flow/<flow>/README.md` links resolve to actual files in BUSINESS_FLOW_DOCS

## Link Format Reference

| From  | To            | Format                              |
| ----- | ------------- | ----------------------------------- |
| Actor | Business Flow | `../business-flow/<flow>/README.md` |

## Common Gap Patterns

- **Missing flow docs**: Actor references a flow that has no README.md
- **Broken flow links**: Actor doc links to a flow directory that does not exist
- **Unlinked actor**: Actor doc exists but references no flows

## Output Format

Return a JSON object:

```json
{
  "check_type": "actor-flow-parity",
  "app": "{{APP_NAME}}",
  "gaps": [...],
  "inconsistencies": [...],
  "summary": { "total_checks": N, "passed": N, "failed": N, "skipped": N }
}
```

See [parity-report-format.md](parity-report-format.md) for field definitions.
