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

# Review, Approve, and Release Work Session Payments

> Learn how employers review submitted work session reports, approve or dispute payments, and how the Aven smart contract releases funds to freelancers.

Every Aven payment begins with a reviewable record. When a freelancer submits a work session, the Aven verifier checks the payment calculation, reserves the correct amount from escrow, and presents the full report to you on the stream page. This guide explains exactly what you are reviewing, how to approve or dispute, and what the smart contract does after each decision.

***

## What a work report contains

Each submitted session produces a structured report with the following fields:

> **Session timing**
>
> The precise **start time**, **stop time**, total **active seconds** (time the watcher detected real activity), and **idle seconds** (periods excluded from the payment calculation).

> **Git branch and commit range**
>
> The active Git **branch name**, **starting commit** hash (the HEAD when the session started), and **ending commit** hash (the HEAD when the session stopped).

> **Changed files**
>
> A list of **relative file paths** that changed during the session. File contents are never uploaded — only paths, plus addition and deletion line counts per file.

> **Additions and deletions**
>
> Aggregate **lines added** and **lines deleted** across all changed files in the session commit range.

> **Worker delivery statement**
>
> The freelancer's written summary of what was accomplished during the session — entered when they run `aven-stellar stop`.

> **Payment amount**
>
> The **calculated payment**: `active seconds × stream rate`, capped by the remaining unreserved escrow. This figure is computed by the verifier and enforced on-chain — neither party enters it manually.

> **Evidence hash**
>
> A **cryptographic commitment** (hash) of the report data. This hash is included in the on-chain attestation, making the work record tamper-evident and independently verifiable.

***

## Reviewing on the dashboard

**1. Navigate to the stream page**

Go to `/stream/[id]` — the unique URL for the engagement. You can find all your active streams from the [dashboard](https://aven-chi.vercel.app/dashboard).

**2. Open the WORK SESSIONS tab**

Select the **WORK SESSIONS** tab on the stream page. Each submitted session is listed with its current status:

| Status | Meaning |
| - | - |
| `Pending` | Submitted but not yet verified by the Aven verifier. |
| `Reserved` | Verifier has validated and reserved the payment amount in escrow. Awaiting your review. |
| `Approved` | You approved the session; funds have been released. |
| `Disputed` | You flagged the session; funds are frozen pending resolution. |

**3. Click a submitted session to expand the full report**

Select any `Reserved` session to open the detailed report panel. All fields described above — timing, Git metadata, changed files, delivery statement, and payment amount — are displayed here.

**4. Review the recorded time, Git changes, and delivery statement**

Cross-reference the freelancer's delivery statement against the Git changes. Verify that:

* The active time is consistent with the scope of work.
* The changed files and commit range reflect the agreed deliverables.
* The delivery statement accurately describes the work performed.

**5. Click Approve or Dispute**

Once you have reviewed the report, select your decision. See the sections below for what each action does on-chain.

***

## What approval does

Approving a session triggers a two-step on-chain sequence:

```mermaid theme={null}
flowchart TD
  A[Employer clicks Approve] --> B[approve_withdrawal called on stream contract]
  B --> C[withdraw_approved called]
  C --> D[Reserved amount transferred to recipient wallet]
  D --> E[Attestation minted on-chain]
  E --> F[Work record permanently linked to both addresses]
```

1. **`approve_withdrawal`** — updates the session status in the stream contract from `Reserved` to `Approved`.
2. **`withdraw_approved`** — executes the fund transfer, moving the exact reserved amount from the stream contract escrow to the recipient's Stellar address.
3. **Attestation minting** — a permanent, verifiable proof record is created on the attestation contract, linking the work report's evidence hash to both the sender and recipient addresses.

The payment lands in the freelancer's Freighter wallet immediately after the transaction is confirmed on the Stellar network. The attestation is visible at `/profile/[recipient-address]` and can be independently verified at `/verify`.

***

## Approval timeout

If you do not approve or dispute a `Reserved` session within the configured timeout period, the session becomes eligible for automatic release:

* The `finalize_timeout` function can be called on the stream contract.
* When triggered, it releases the payment to the recipient as if you had approved it.
* This mechanism protects freelancers from indefinite holds on verified work.

> [!WARNING]
>
> The timeout clock starts as soon as the verifier reserves the payment. If you anticipate needing more time to review a session, communicate with your freelancer promptly — disputed sessions are frozen and are not subject to the timeout, giving you time to investigate.

***

## What happens after approval

**1. Payment lands in the recipient's wallet**

The exact reserved amount is transferred to the freelancer's Freighter wallet on Stellar testnet. The transfer is final and on-chain — it cannot be reversed after the transaction is confirmed.

**2. Attestation is minted on-chain**

A permanent attestation is written to the Aven attestation contract. It records the evidence hash, the payment amount, both addresses, and the stream ID. This becomes part of the freelancer's portable on-chain reputation.

**3. Stream continues (if budget remains)**

After approval, the stream remains open if unreserved escrow still exists. The freelancer can start new work sessions and submit further reports until the budget is exhausted or the stream duration expires.

> [!NOTE]
>
> The Aven verifier independently validates the payment calculation before reserving funds. You are approving the work itself — the contract enforces the correct payment amount. You cannot approve a higher or lower amount than the contract-calculated figure.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.