hmo
4f83ee8a01
feat(hygiene): anti-redundancy enforcement — spec rules + weekly audit
...
Root cause analysis of the 2026-07-20 redundancy incident:
1. No single-source-of-truth rule -> same file legitimately lived in 4+
locations, diverging silently
2. Relative path resolution (Path(__file__).parent/'data') -> each
hardlinked copy of mofin_db.py pointed to a DIFFERENT database
3. 'Backup habit' left .bak/legacy files in production dirs, which
monitoring then scanned and reported as false alarms
4. Half-done migrations: DB tables created but old JSON writers/readers
stayed (price_events), old files stayed
5. Dead modules never got buried: xiaoguo 'dead' but bot ran 8 days
as root eating 2.5GB
6. Monitoring checked 'does it exist' not 'is it alive' -> stale file
mtime reported as 'pipeline stalled 14 days' (false alarm)
7. No 'system hygiene' as a check category at all
Prevention implemented:
- dev-spec.md v2.0: 五条红线 -> 十条红线
#6 single source of truth (hardlink only, no independent copies)
#7 absolute data paths only (no __file__-relative data resolution)
#8 no backups/legacy in production data dirs (archive immediately)
#9 dead module burial checklist (6 mandatory steps)
#10 monitor liveness (DB table freshness) not existence
- File Location Constitution: canonical location per content type
- NEW system_hygiene_audit.py: weekly Monday 07:30 cron checking
diverged copies / broken hardlinks / zombie processes / orphan data
files / dead cron scripts / DB freshness -> hygiene_report.json + XMPP
- specs/hygiene.json: module spec per red line #1
- Verified: audit found 5 real issues on first run, all fixed, re-run clean
2026-07-20 19:04:05 +08:00
..
2026-07-08 12:34:39 +08:00
2026-07-06 14:01:54 +08:00
2026-07-08 23:54:01 +08:00
2026-07-09 17:57:17 +08:00
2026-07-20 19:04:05 +08:00
2026-07-08 12:37:36 +08:00
2026-07-20 01:12:38 +08:00
2026-07-20 19:04:05 +08:00
2026-07-20 19:04:05 +08:00
2026-07-20 19:04:05 +08:00
2026-07-20 19:04:05 +08:00
2026-07-20 19:04:05 +08:00
2026-07-20 19:04:05 +08:00
2026-07-20 17:46:57 +08:00
2026-07-10 13:58:23 +08:00
2026-07-04 09:30:50 +08:00
2026-07-08 23:54:01 +08:00
2026-07-09 19:42:35 +08:00
2026-07-10 14:06:20 +08:00
2026-07-20 18:10:05 +08:00
2026-07-20 08:48:08 +08:00
2026-07-20 01:34:37 +08:00
2026-07-19 20:12:47 +08:00
2026-07-19 11:06:50 +08:00
2026-07-20 08:48:08 +08:00
2026-07-20 17:30:15 +08:00
2026-07-20 17:46:57 +08:00
2026-07-20 17:30:15 +08:00
2026-07-20 01:12:38 +08:00
2026-07-19 11:06:50 +08:00
2026-07-20 17:30:15 +08:00
2026-07-19 11:06:50 +08:00
2026-07-20 17:46:57 +08:00
2026-07-20 17:30:15 +08:00
2026-07-19 11:06:50 +08:00
2026-07-06 14:01:54 +08:00
2026-07-08 23:54:01 +08:00
2026-07-20 19:04:05 +08:00
2026-07-08 23:54:01 +08:00
2026-07-20 19:04:05 +08:00
2026-07-08 19:50:44 +08:00
2026-07-14 10:56:38 +08:00
2026-07-20 01:12:38 +08:00
2026-07-14 12:14:08 +08:00
2026-07-06 14:01:54 +08:00
2026-07-08 23:54:01 +08:00
2026-07-08 19:50:44 +08:00
2026-07-10 11:59:08 +08:00
2026-07-14 11:08:07 +08:00
2026-07-19 20:12:47 +08:00
2026-07-20 01:12:38 +08:00
2026-07-20 19:04:05 +08:00
2026-07-20 19:04:05 +08:00
2026-07-14 15:00:56 +08:00
2026-07-19 11:06:50 +08:00
2026-07-20 01:12:38 +08:00
2026-07-19 11:06:50 +08:00
2026-07-20 17:30:15 +08:00
2026-07-10 10:26:14 +08:00
2026-07-20 01:34:37 +08:00
2026-07-06 14:01:54 +08:00
2026-07-20 17:30:15 +08:00
2026-07-01 23:00:28 +08:00
2026-07-06 14:01:54 +08:00
2026-07-03 12:12:05 +08:00
2026-07-09 19:42:35 +08:00
2026-07-17 23:08:11 +08:00
2026-07-20 19:04:05 +08:00
2026-07-14 10:56:38 +08:00
2026-07-20 17:30:15 +08:00
2026-07-20 17:30:15 +08:00
2026-07-20 17:30:15 +08:00
2026-07-20 17:30:15 +08:00
2026-07-20 17:30:15 +08:00
2026-07-19 20:12:47 +08:00
2026-07-19 11:06:50 +08:00
2026-07-02 13:46:53 +08:00
2026-07-01 23:00:28 +08:00
2026-07-08 12:37:36 +08:00
2026-07-19 12:47:15 +08:00
2026-07-08 20:04:32 +08:00
2026-07-08 12:37:36 +08:00
2026-06-27 01:37:18 +08:00
2026-07-20 19:04:05 +08:00
2026-06-24 00:15:33 +08:00
2026-07-08 12:34:39 +08:00
2026-07-06 14:01:54 +08:00
2026-07-20 18:10:05 +08:00
2026-07-09 16:35:27 +08:00
2026-07-06 14:01:54 +08:00
2026-07-06 14:01:54 +08:00
2026-07-08 23:54:01 +08:00
2026-07-08 23:54:01 +08:00
2026-07-20 18:10:05 +08:00
2026-07-14 10:56:38 +08:00
2026-07-08 12:37:36 +08:00
2026-07-06 14:01:54 +08:00
2026-07-09 11:13:45 +08:00
2026-07-08 12:34:39 +08:00
2026-07-08 23:54:01 +08:00
2026-07-20 17:33:39 +08:00
2026-07-20 18:10:05 +08:00
2026-07-20 19:04:05 +08:00
2026-07-20 19:04:05 +08:00
2026-07-20 17:30:15 +08:00
2026-06-30 02:56:35 +08:00
2026-07-13 12:09:25 +08:00
2026-07-19 20:12:47 +08:00
2026-07-08 23:54:01 +08:00
2026-07-09 13:43:30 +08:00
2026-07-10 12:20:18 +08:00
2026-07-08 16:18:26 +08:00
2026-07-20 18:10:05 +08:00
2026-07-06 14:01:54 +08:00
2026-07-13 12:09:25 +08:00
2026-07-04 09:30:50 +08:00
2026-07-08 23:54:01 +08:00
2026-07-06 14:01:54 +08:00
2026-07-20 19:04:05 +08:00
2026-07-20 19:04:05 +08:00
2026-07-03 12:12:05 +08:00
2026-07-04 09:45:27 +08:00
2026-07-20 00:40:32 +08:00
2026-07-20 08:48:08 +08:00
2026-07-20 18:10:05 +08:00
2026-07-14 10:56:38 +08:00
2026-07-08 12:34:39 +08:00
2026-07-06 14:01:54 +08:00
2026-07-13 12:09:25 +08:00
2026-07-13 12:09:25 +08:00
2026-07-08 23:54:01 +08:00
2026-07-08 23:54:01 +08:00
2026-06-29 23:25:54 +08:00
2026-07-08 12:37:36 +08:00
2026-07-08 23:54:01 +08:00
2026-07-08 12:37:36 +08:00
2026-07-17 23:08:11 +08:00
2026-07-08 23:54:01 +08:00
2026-07-08 12:34:39 +08:00
2026-07-08 23:54:01 +08:00
2026-07-19 10:56:42 +08:00
2026-07-09 13:43:30 +08:00
2026-07-06 14:01:54 +08:00
2026-07-07 11:20:04 +08:00
2026-07-19 23:23:46 +08:00
2026-07-17 23:08:11 +08:00
2026-07-08 12:34:39 +08:00
2026-07-10 21:07:59 +08:00
2026-07-19 20:12:47 +08:00
2026-07-20 18:10:05 +08:00
2026-07-20 17:46:57 +08:00
2026-07-20 17:46:57 +08:00
2026-07-20 17:30:15 +08:00
2026-07-19 23:23:46 +08:00
2026-07-19 22:09:15 +08:00
2026-07-19 20:12:47 +08:00
2026-07-20 01:12:38 +08:00
2026-07-20 00:21:49 +08:00
2026-07-19 20:12:47 +08:00
2026-07-20 17:46:57 +08:00
2026-07-19 11:06:50 +08:00
2026-07-19 23:23:46 +08:00
2026-07-19 20:12:47 +08:00
2026-07-08 12:37:36 +08:00
2026-07-20 19:04:05 +08:00
2026-07-20 08:48:08 +08:00
2026-07-08 10:13:49 +08:00
2026-07-20 01:12:38 +08:00
2026-07-20 08:48:08 +08:00
2026-07-20 00:07:28 +08:00
2026-07-20 17:30:15 +08:00
2026-07-07 15:33:14 +08:00
2026-07-19 11:06:50 +08:00
2026-07-10 12:20:18 +08:00
2026-07-08 12:37:36 +08:00
2026-07-01 23:00:28 +08:00
2026-07-06 14:01:54 +08:00
2026-07-09 10:35:34 +08:00
2026-07-02 01:43:33 +08:00