---
name: the-inspection
schedule: "0 9 * * 1-5"
priority: SCHEDULED
member: the-doorman
description: Daily 9am code health scan for TODOs, oversized files, dependency drift, and test coverage gaps.
---

# Ritual: The Inspection

## Trigger
Every weekday at 9:00 AM local time.

## Status
Runs on its declared schedule in [`.github/workflows/rituals.yml`](../../.github/workflows/rituals.yml). Run it manually with:

```bash
npx agenthood ritual run the-inspection
```

## What It Does
Scans the codebase for code health signals: TODOs and FIXMEs, files exceeding size limits, wildcard dependency versions, and any patterns the Doorman considers hygiene violations.

## Steps

1. Search for `TODO` and `FIXME` comments — record file:line for each
2. Find files exceeding 500 lines — list them with line count
3. Parse `package.json` (and equivalents) for wildcard versions
4. Check test file ratio — flag source files with no corresponding test file
5. Check for files modified in the last 7 days with no corresponding test changes
6. Produce the health report

## Report Format

```markdown
## 🔍 Daily Inspection — {Date}

### 📋 TODO / FIXME ({count})
{file:line — comment text}

### 📏 Oversized Files ({count})
{file — N lines (limit: 500)}

### 📦 Dependency Drift ({count})
{dependency@^version — pin to exact version}

### 🧪 Untested Files ({count})
{file — no corresponding test file found}

### ✅ All Clear
{categories with zero findings}

---
*Generated by The Doorman · Agenthood*
```

## Notes
- File size limit: 500 lines (matches `.github/scripts/filesize-check.sh`); configurable thresholds are planned
- TODO age threshold: flag TODOs older than 30 days
- Does not modify any files — report only
- The report's findings can be checked against `.agenthood/provenance/` — past inspection runs are tamper-evident (ADR-015)
