Project · Self-tested
Project: Asset Governance
Audit project assets, generate a governance report, and safely execute copy, move, and remove remediations with Runtime-native dry-run.
Separate audit from remediation
Asset Governance consists of audit.hhy and cleanup.hhy. The auditor scans source, configuration, images, video, and build outputs for oversized, stale, badly named, duplicate-text, and possibly sensitive files. The cleaner accepts only allow-listed report actions and never assembles shell commands.
| Check or action | HHY implementation |
|---|---|
| Inventory and size | files, File.size, and Bytes |
| Stale files | File.modified, now, and Duration |
| Naming and secrets | Regex, read_text, and redacted findings |
| Duplicate content | group_by text content without storing source text in the report |
| Remediation | copy, move, remove, and --dry-run EffectDispatcher |
Project layout

| Program | Responsibility |
|---|---|
| audit.hhy | Scan and atomically write report.json; return 1 when a critical finding exists |
| cleanup.hhy | Read report.actions and execute controlled copy/move/remove operations |
| self-test.sh | Create an isolated mktemp workspace, dry-run first, then apply and assert every action |
Actual self-test and dry-run
cd hhy-vm
sh asset-governance/self-test.sh
Two-phase operation
Run the audit and inspect report.json first. audit returns 1 for a critical finding but still writes the complete report. After approving actions, run dry-run, inspect Runtime's effect plan, and only then apply remediation.
hhy run asset-governance/audit.hhy ./project ./config.json ./report.json
hhy run --dry-run asset-governance/cleanup.hhy ./project ./report.json
hhy run asset-governance/cleanup.hhy ./project ./report.json