|
6 | 6 | [](LICENSE) |
7 | 7 | [](https://nodejs.org) |
8 | 8 | [](https://www.typescriptlang.org) |
9 | | -[]() |
| 9 | +[]() |
10 | 10 |
|
11 | 11 | --- |
12 | 12 |
|
@@ -122,6 +122,15 @@ CodeMax detects cross-stack issues that frontend-only or backend-only tools stru |
122 | 122 | | `map_dependencies` | Map all connections between frontend files and backend routes. Find orphans and phantoms. | |
123 | 123 | | `check_env` | Cross-reference .env files against actual usage in frontend and backend code. | |
124 | 124 |
|
| 125 | +### Documentation & History |
| 126 | + |
| 127 | +| Tool | Description | |
| 128 | +|------|-------------| |
| 129 | +| `get_history` | Audit trail — health trend over time, issue lifecycle (new, fixed, regressed), scan statistics. Filter by status. | |
| 130 | +| `log_fix` | Document how a specific issue was resolved. Recorded in the ledger and appears in REPORT.md. | |
| 131 | +| `acknowledge_issue` | Mark an issue as intentional/acceptable. Won't be flagged as action items in future reports. | |
| 132 | +| `get_report` | Read the living REPORT.md — all issues, fixes, trends, and contract maps in one document. | |
| 133 | + |
125 | 134 | ### Individual Scans |
126 | 135 |
|
127 | 136 | | Tool | Description | |
@@ -194,6 +203,61 @@ Overall: B (78/100) |
194 | 203 |
|
195 | 204 | --- |
196 | 205 |
|
| 206 | +## Project Documentation (`.codemax/`) |
| 207 | + |
| 208 | +Every audit automatically persists results to a `.codemax/` directory in your project. This gives your team a living audit trail without needing to run CodeMax themselves. |
| 209 | + |
| 210 | +``` |
| 211 | +.codemax/ |
| 212 | +├── ledger.json # Issue lifecycle tracking (all issues, ever) |
| 213 | +└── REPORT.md # Human-readable living document |
| 214 | +``` |
| 215 | + |
| 216 | +### REPORT.md |
| 217 | + |
| 218 | +A Markdown file any developer can read — no tools needed. Updated on every `full_stack_audit`: |
| 219 | + |
| 220 | +- **Health Dashboard** — current scores across all 6 dimensions |
| 221 | +- **Health Trend** — score over time, so you can see if things are improving |
| 222 | +- **Latest Scan Changes** — what's new, what's fixed, what regressed |
| 223 | +- **Open Issues** — every issue with evidence, code snippets, and fix suggestions |
| 224 | +- **Fix Log** — table of everything that was resolved, when, and how |
| 225 | +- **Regression History** — issues that were fixed but came back |
| 226 | +- **API Contract Map** — full frontend-to-backend connection table |
| 227 | +- **Project Structure** — detected frameworks, ORM, paths |
| 228 | + |
| 229 | +### Issue Lifecycle |
| 230 | + |
| 231 | +Issues are tracked through their lifecycle across scans: |
| 232 | + |
| 233 | +``` |
| 234 | +Discovered ──► open ──► fixed (disappears from next scan) |
| 235 | + │ │ |
| 236 | + ▼ ▼ |
| 237 | + acknowledged regressed (comes back) |
| 238 | + (intentional) │ |
| 239 | + ▼ |
| 240 | + fixed (again) |
| 241 | +``` |
| 242 | + |
| 243 | +- **Auto-detection**: Issues are automatically marked `fixed` when they disappear from a scan |
| 244 | +- **Manual logging**: Use `log_fix` to document *how* something was resolved |
| 245 | +- **Regression tracking**: If a fixed issue reappears, it's flagged as `regressed` |
| 246 | +- **Deterministic fingerprints**: Same issue = same fingerprint, even if line numbers shift |
| 247 | + |
| 248 | +### Example Workflow |
| 249 | + |
| 250 | +``` |
| 251 | +1. Run `full_stack_audit` → finds 8 issues, creates .codemax/REPORT.md |
| 252 | +2. Fix 3 issues in your code |
| 253 | +3. Run `full_stack_audit` again → auto-detects 3 fixes, finds 1 new issue |
| 254 | +4. Use `log_fix CTR-X-a1b2c3 "Added Zod validation to POST /api/users"` → records the how |
| 255 | +5. Use `acknowledge_issue DEP-B-d4e5f6` → dead endpoint is intentional (consumed by mobile app) |
| 256 | +6. Open .codemax/REPORT.md → full audit trail, readable by anyone |
| 257 | +``` |
| 258 | + |
| 259 | +--- |
| 260 | + |
197 | 261 | ## Example Output |
198 | 262 |
|
199 | 263 | ### `full_stack_audit` |
@@ -324,25 +388,29 @@ npm test |
324 | 388 | ``` |
325 | 389 | src/ |
326 | 390 | ├── index.ts # Entry point (stdio transport) |
327 | | -├── server.ts # MCP server + 9 tool registrations |
| 391 | +├── server.ts # MCP server + 13 tool registrations |
328 | 392 | ├── types.ts # Shared type definitions |
329 | 393 | ├── analyzers/ |
330 | 394 | │ ├── project-detector.ts # Framework, monorepo, ORM detection |
331 | 395 | │ ├── frontend-scanner.ts # API call extraction (fetch, axios, SWR, etc.) |
332 | 396 | │ ├── backend-scanner.ts # Route extraction (Next.js, Express, etc.) |
333 | 397 | │ └── env-analyzer.ts # Environment variable cross-referencing |
334 | 398 | ├── bridge/ |
335 | | -│ ├── orchestrator.ts # Full audit coordination |
| 399 | +│ ├── orchestrator.ts # Full audit coordination + ledger integration |
336 | 400 | │ ├── contract-analyzer.ts # Frontend ↔ backend contract comparison |
337 | 401 | │ ├── correlator.ts # Cross-stack issue detection |
338 | 402 | │ └── health-scorer.ts # 6-dimension health scoring |
| 403 | +├── tools/ |
| 404 | +│ ├── ledger-manager.ts # Issue lifecycle tracking (fingerprint, fix, regress) |
| 405 | +│ └── report-writer.ts # Living REPORT.md generation |
339 | 406 | ├── utils/ |
340 | 407 | │ └── helpers.ts # URL normalization, scoring, formatting |
341 | 408 | └── __tests__/ |
342 | 409 | ├── helpers.test.ts # Unit tests for utilities |
343 | 410 | ├── project-detector.test.ts # Project detection tests |
344 | 411 | ├── contract-analyzer.test.ts# Contract analysis tests |
345 | | - └── scanners.test.ts # Frontend + backend scanner tests |
| 412 | + ├── scanners.test.ts # Frontend + backend scanner tests |
| 413 | + └── ledger.test.ts # Ledger lifecycle tests |
346 | 414 | ``` |
347 | 415 |
|
348 | 416 | --- |
@@ -371,6 +439,11 @@ Contributions welcome. [Open an issue](https://github.com/rish-e/codemax/issues) |
371 | 439 | - [x] Server Actions support |
372 | 440 | - [x] Environment variable cross-referencing |
373 | 441 | - [x] Health scoring (6 dimensions) |
| 442 | +- [x] Issue lifecycle ledger (open → fixed → regressed) |
| 443 | +- [x] Living REPORT.md documentation |
| 444 | +- [x] Fix logging with descriptions |
| 445 | +- [x] Health trend tracking across audits |
| 446 | +- [x] Regression detection |
374 | 447 | - [ ] GraphQL schema ↔ query contract analysis |
375 | 448 | - [ ] tRPC router ↔ client contract analysis |
376 | 449 | - [ ] Auto-fix engine (generate patches for common issues) |
|
0 commit comments