PAPERCLIPS-7: Add disassembly audit script
Some checks failed
Architecture Lint / Linter Tests (pull_request) Successful in 29s
Smoke Test / smoke (pull_request) Failing after 29s
Validate Config / YAML Lint (pull_request) Failing after 20s
Validate Config / JSON Validate (pull_request) Successful in 26s
Validate Config / Python Syntax & Import Check (pull_request) Failing after 1m4s
Validate Config / Python Test Suite (pull_request) Has been skipped
Validate Config / Shell Script Lint (pull_request) Failing after 1m13s
Validate Config / Cron Syntax Check (pull_request) Successful in 12s
Validate Config / Deploy Script Dry Run (pull_request) Successful in 16s
PR Checklist / pr-checklist (pull_request) Successful in 4m58s
Validate Config / Playbook Schema Validation (pull_request) Successful in 27s
Architecture Lint / Lint Repository (pull_request) Failing after 23s
Some checks failed
Architecture Lint / Linter Tests (pull_request) Successful in 29s
Smoke Test / smoke (pull_request) Failing after 29s
Validate Config / YAML Lint (pull_request) Failing after 20s
Validate Config / JSON Validate (pull_request) Successful in 26s
Validate Config / Python Syntax & Import Check (pull_request) Failing after 1m4s
Validate Config / Python Test Suite (pull_request) Has been skipped
Validate Config / Shell Script Lint (pull_request) Failing after 1m13s
Validate Config / Cron Syntax Check (pull_request) Successful in 12s
Validate Config / Deploy Script Dry Run (pull_request) Successful in 16s
PR Checklist / pr-checklist (pull_request) Successful in 4m58s
Validate Config / Playbook Schema Validation (pull_request) Successful in 27s
Architecture Lint / Lint Repository (pull_request) Failing after 23s
- New bin/disassembly_audit.py identifies waste: * Zombie processes (defunct, unreclaimable) * Unused systemd services (enabled but inactive) * Dead loops: systemic cron failures (via cron-audit-662) * Stale hermes agent sessions - Recommends keep/kill/disable actions - Estimates monthly cost savings (memory, CPU) - Optional --execute flag for safe disassembly - JSON and markdown report output Closes #335
This commit is contained in:
25
tests/test_disassembly_audit.py
Executable file
25
tests/test_disassembly_audit.py
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Minimal smoke test for disassembly_audit.py (#335)"""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
import json
|
||||
import subprocess
|
||||
|
||||
script_path = Path(__file__).resolve().parent.parent / "bin" / "disassembly_audit.py"
|
||||
|
||||
result = subprocess.run(
|
||||
[sys.executable, str(script_path), "--json"],
|
||||
capture_output=True, text=True, timeout=20
|
||||
)
|
||||
if result.returncode != 0:
|
||||
print(f"Script error: {result.stderr[:500]}")
|
||||
sys.exit(1)
|
||||
|
||||
data = json.loads(result.stdout)
|
||||
assert "zombies" in data
|
||||
assert "unused_services" in data
|
||||
assert "dead_loops_cron" in data
|
||||
assert "dead_loops_hermes" in data
|
||||
assert "cost_savings" in data
|
||||
print("SMOKE TEST: disassembly_audit.py generates valid report structure")
|
||||
Reference in New Issue
Block a user