Skip to content

Commit db71e70

Browse files
committed
feat: cheap Rust audit + mmctl audit, gate tick on real issues
src/audit.rs (new, 8 unit tests passing) - AuditReport with deterministic checks: missing frontmatter, invalid metadata.type, dangling MEMORY.md entries, files not in index, broken [[wikilinks]], feedback/project entries missing Why/How, duplicate descriptions, MEMORY.md >200 lines. - run_audit(memory_root) is sub-millisecond on realistic input. src/tick.rs - Runs audit::run_audit BEFORE deciding to spawn claude. - If total_issues == 0 → skip the spawn, log "audit clean — files=N ...", save ~30-80k tokens and ~30-60s wallclock per tick. - When the tick does run, the agent receives the audit JSON in the prompt so it never re-scans the directory. cmmd audit / mmctl audit - New subcommands. Sub-second, no claude call, no quota cost. - --json for machine-readable output. - On real ~/.claude/projects/-home-deadpool/memory/ today: 4 issues (3 broken wikilinks, 1 feedback missing Why/How). Verified - cargo test --lib: 20/20 passing (8 new audit tests + 12 existing) - cargo clippy --bins -- -D warnings: clean - cmmd audit against test-fixtures/memory: catches missing frontmatter + dangling MEMORY.md entry as expected
1 parent 5fafd1d commit db71e70

6 files changed

Lines changed: 575 additions & 10 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"schemaVersion": 1,
3+
"repoRoot": "/home/deadpool/Documents/claude-memory-manager-daemon",
4+
"branch": "main",
5+
"taskName": "Session start: mcp-connect",
6+
"latestTaskPreview": "Session start: mcp-connect",
7+
"agentName": "unknown",
8+
"cliName": "unknown",
9+
"worktreePath": "/home/deadpool/Documents/claude-memory-manager-daemon",
10+
"taskMode": "",
11+
"openspecTier": "",
12+
"taskRoutingReason": "colony hook cwd binding",
13+
"startedAt": "2026-05-18T11:12:38.318Z",
14+
"lastHeartbeatAt": "2026-05-18T11:12:38.318Z",
15+
"state": "working",
16+
"sessionKey": "mcp-1021364"
17+
}

0 commit comments

Comments
 (0)