---
title: "Verify empty exports retain their declared schema"
description: "Check a sandbox report with zero matches, ensuring its downloaded artifact has the expected headers and scope instead of stale records or an invalid file."
canonical_url: "https://vostride.com/agent-library/reporting-exports/empty-export-retains-schema.md"
md_url: "https://vostride.com/agent-library/reporting-exports/empty-export-retains-schema.md"
content_kind: "recipe"
topic: "reporting-exports"
---

# Verify empty exports retain their declared schema

Check a sandbox report with zero matches, ensuring its downloaded artifact has the expected headers and scope instead of stale records or an invalid file.

## Risk

An empty export is still a contract with downstream consumers. Distinguish a valid zero-record artifact from a failed job, a missing file, or a reused previous export containing unrelated data.

## Fixtures

- An owned sandbox report with a filter guaranteed to match no records and a previously completed nonempty export as a stale-cache control.
- A disposable viewer and an approved schema manifest defining column names, order, and any format-specific empty-sheet behavior.
- An independent artifact parser and job oracle exposing filter parameters, artifact identity, and record count.

## Steps

1. Open the report with the no-match filter and verify an explicit zero-result state and the intended filter summary.
2. Request export and verify the job completes under the product empty-export policy rather than silently linking the previous nonempty job.
3. Retrieve and parse the resulting artifact, verifying the expected header schema and zero data records.
4. Inspect the job oracle and verify the artifact identity and filter scope belong to this empty request; verify none of the stale-control identifiers appears in the file.

## Expected results

- The artifact is structurally valid with the documented zero-record schema.
- The export belongs to the current empty filter and has a distinct correct job association.
- No data from the previous nonempty export leaks into the result.

## False-pass traps

- A zero-byte download may be an error response rather than a valid empty report.
- Checking only the UI empty state does not detect reuse of a cached nonempty artifact.

## Cleanup

- Delete both disposable export artifacts and clear the no-match report filter.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa first test](/docs/agent-qa/guides/first-test.md)
- [agent-qa hooks](/docs/agent-qa/guides/hooks.md)
- [agent-qa test](/docs/agent-qa/configuration/test.md)

- [Reporting and export QA recipes](/agent-library/reporting-exports.md)
- [Software factory QA library](/agent-library.md)
