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 actionHHY implementation
Inventory and sizefiles, File.size, and Bytes
Stale filesFile.modified, now, and Duration
Naming and secretsRegex, read_text, and redacted findings
Duplicate contentgroup_by text content without storing source text in the report
Remediationcopy, move, remove, and --dry-run EffectDispatcher
View the complete Asset Governance source on GitHub ↗Includes auditor, cleaner, four HHY modules, risky fixtures, and dry-run plus applied-remediation assertions.

Project layout

Asset Governance project tree
The real layout contains audit and cleanup entry points, governance modules, and intentionally large, stale, duplicate, and sensitive fixtures.
ProgramResponsibility
audit.hhyScan and atomically write report.json; return 1 when a critical finding exists
cleanup.hhyRead report.actions and execute controlled copy/move/remove operations
self-test.shCreate an isolated mktemp workspace, dry-run first, then apply and assert every action

Actual self-test and dry-run

sh
cd hhy-vm
sh asset-governance/self-test.sh
Actual Asset Governance audit, dry-run, and applied-remediation terminal output
Actual run: detects large/naming/stale/sensitive/duplicate findings; dry-run prints the effect plan without changes; all assertions pass after three real actions.

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.

sh
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