# MoonDisk reproducible demo

This walkthrough demonstrates the complete project boundary with disposable data. It covers scanning, snapshots, growth comparison, auditing, reporting, cleanup planning, policy review, and the optional quarantine/restore round trip.

## Prerequisites

- A current MoonBit toolchain available as `moon`
- Project dependencies resolved with `moon update`
- PowerShell 7 on Windows, or a POSIX shell on Linux/macOS

## Run the safe default demo

Windows:

```powershell
./scripts/demo.ps1
```

Linux or macOS:

```sh
chmod +x scripts/demo.sh
./scripts/demo.sh
```

The scripts create `demo-output/workspace` inside the repository and never inspect unrelated user directories. They then:

1. Create a small project-like directory with source, log, asset, and build-output files.
2. Save a baseline snapshot.
3. Add generated cache data and save a second snapshot.
4. Print a diff that attributes the growth to its path.
5. Audit the snapshot and create HTML and CSV reports.
6. Generate default cleanup rules and a conservative approval policy.
7. Produce and review a cleanup plan.

Open `demo-output/report.html` in a browser to inspect the standalone report. The generated JSON artifacts remain available for manual inspection.

## Demonstrate quarantine and restoration

The mutation phase is opt-in and only acts on the generated demo workspace:

```powershell
./scripts/demo.ps1 -Apply
```

```sh
./scripts/demo.sh --apply
```

MoonDisk first checks the plan against the conservative policy and rescans the source to reject stale metadata. It then moves accepted build output to `demo-output/quarantine`, writes an operation manifest, audits the quarantined data, and restores it to the original path. The script fails if the restored file is missing.

## Expected evidence

After a successful run, `demo-output` contains:

- `before.snapshot.json` and `after.snapshot.json`
- `report.html` and `files.csv`
- `rules.json`, `policy.json`, and `cleanup.plan.json`
- with the apply option: `operation.json` and `restore.json`

The demo directory is ignored by Git and can be removed at any time.
