> ## Documentation Index
> Fetch the complete documentation index at: https://docs.manthan.systems/llms.txt
> Use this file to discover all available pages before exploring further.

# verification

> @parmana/verification — a real six-stage verification pipeline, currently unused by the API

`@parmana/verification` (`packages/verification/src/index.ts`) exports `VerificationEngine`, `VerificationBuilder`, `VerificationPipeline`, `VerificationComponent`, a `VerificationContext` type, six verification stages, and `VerificationError`.

<Warning>
  **This package is not imported anywhere under `packages/runtime` or `packages/api`.** What `POST /verify` actually does is call `VerificationCrypto.verify()` from [`crypto`](/docs/packages/crypto) — a single hash comparison — inside `VerificationService` (`packages/runtime/src/services/verification-service.ts`). See [REST API → Verify](/docs/api/verify) for that trace. This package's real, multi-stage pipeline is dormant.
</Warning>

## `VerificationEngine`

```ts theme={null}
class VerificationEngine {
  constructor(pipeline: VerificationPipeline);
  verify(trustRecord: ExecutionTrustRecord): Promise<Verification>;
  isEmpty(): boolean;
  size(): number;
}
```

`verify()` (`packages/verification/src/VerificationEngine.ts`) builds a `VerificationContext` (`{ trustRecord, verified: true, errors: [] }`), runs it through the pipeline, and produces a `Verification` whose `status` is `VERIFIED` only if every stage left `context.verified === true`; otherwise `message` is the joined list of stage errors.

<Note>
  The `Verification` this engine produces has the same shape as the one [`VerificationService`](/docs/packages/runtime) actually returns (`verificationId`, `businessTransactionId`, `trustRecordHash`, `status`, `message`, `verifiedAt`) — unlike the `replay` package's diverging result types, this package's output type is at least consistent with what's really returned by `POST /verify`. It's the depth of checking behind that result that differs.
</Note>

## The six stages

`packages/verification/src/stages/`, intended to run in sequence within a `VerificationPipeline`:

| Stage                            | Checks                                         |
| -------------------------------- | ---------------------------------------------- |
| `IntegrityStage`                 | Structural/hash integrity of the trust record. |
| `AuthorityVerificationStage`     | The recorded Authority.                        |
| `AuthorizationVerificationStage` | The recorded Authorization.                    |
| `IntentVerificationStage`        | The recorded Intent.                           |
| `EvidenceVerificationStage`      | Execution evidence against what was recorded.  |
| `SignatureVerificationStage`     | Cryptographic signatures.                      |

Together these describe a materially deeper verification than the single hash check `VerificationCrypto.verify()` performs — each stage independently re-examines one link in the [Authority → Authorization → Intent → Policy → Decision → Execution](/docs/architecture/overview) trust chain, rather than only confirming the record wasn't tampered with after the fact.

## `VerificationComponent`

Implements the same `RuntimeComponent`-style contract used in [`runtime`](/docs/packages/runtime)'s own pipeline, so this engine could in principle be dropped into the `Runtime`'s component list — but per [Packages → runtime](/docs/packages/runtime#what-s-actually-in-the-pipeline), `RuntimeFactory` doesn't add it (or the `runtime` package's own, separate `VerificationComponent`) today.

## Related

<CardGroup cols={2}>
  <Card title="Verification (concept)" href="/docs/concepts/verification">What verification is meant to guarantee.</Card>
  <Card title="REST API → Verify" href="/docs/api/verify">What actually runs when you call `POST /verify`.</Card>
  <Card title="crypto" href="/docs/packages/crypto">The single check that runs today.</Card>
  <Card title="replay" href="/docs/packages/replay">The other unused-by-the-API engine package.</Card>
</CardGroup>
