Find Mismatch
Run static analysis using fallow and fix issues that it suggests. Walk through every file. Focus only on runtime failures/bugs and fix them. Do NOT report style, formatting, performance suggestions, docs/tests, or "consider using X".
1. Process
- JS/TS (Pre-check): Run static analysis.
- Check if installed:
fallow --version.
- Install globally if missing:
npm install -g fallow.
- Execute audit:
fallow audit --format json --quiet.
- Filter findings by git status:
git diff --staged --name-only.
- If staged: auto-apply safe fixes, re-run audit to verify.
- If unstaged: report-only (no modification).
- Review Checklist: Apply checklist to all changes.
- Report: Format findings using the specified template.
2. Checklist Categories
1. Cross-Boundary Contracts
- Calling mismatch: Check RPC, HTTP, IPC, event name/subject match receiver.
- Param names/types:
userId vs user_id, string vs number, flat vs wrapped.
- Return type: Field accesses (
result.field) must match return signature.
2. Serialization & Deserialization
- Casing:
snake_case in DB/backend vs camelCase in JSON/frontend.
- Optionals: Field expected by receiver but optional in producer.
- Enums/discriminators: Discriminant fields (
type, kind) and variants match.
- Base64: Double-encoding layers.
3. Logic Bugs
- Double counting: Counters incremented both in loop/branch and outside.
- Off-by-one: Index, pagination bounds (
page <= total vs page < total).
- Conditions: Redundant/dead flags, unreachable statements, shadowed variables.
4. Property & Method Access
- Null derefs: Method calls or array index access (
items[0].name) without null/length checks.
- Optional chaining: Stop check too early (e.g.
user?.address.street still crashes if address is null).
- This context: Callback bindings in classes.
5. Async & Concurrency
- Race conditions: Shared mutable states, parallel filesystem accesses without coordination.
- Missing
await: Promise ignored, silent errors.
- Leaks: File/DB/network connections not closed in error paths.
6. CSS & Styling
- HSL variables: Raw HSL components (
0 0% 100%) instead of functional format (hsl(0 0% 100%)) fail in Tailwind v4 (unlike v3).
- Inline themes: Circular references, selector mismatch (class vs data-theme).
7. Placeholder & Stub Code
- Unused declarations/files/dependencies, TODO comments, empty catch blocks.
3. Language-Specific Pitfalls
- Python: Hallucinated library methods (pandas, numpy, requests), sync/asyncio confusion, mutable default arguments (
def f(x=[])), silent indentation drops.
- JS/TS: Backend (Node) vs Frontend (Browser) API mix-ups,
any abuse, type-only import mismatches, barrel file false positives (exported but unused in production, used in tests/libraries).
- C++: Raw vs smart pointer mix-ups, missing standard library header
#include, uninitialized variables, buffer overflows.
- Rust: Borrow checker lifetime overcomplication,
unwrap() on None/Err, locking across .await yield points.
- Java / .NET: Hallucinated annotations/attributes, LINQ N+1 queries, Entity Framework model snapshot drift / missing migrations (check model changes under
Entities/ against Migrations/).
- Go: WaitGroup/Channel deadlocks, unexported struct fields in JSON, defer in loop, map concurrent access.
- PHP: Loose type comparisons (
== vs ===), array vs object access, key undefined.
4. Fallow Finding Mapping & Fixes
| Fallow Type |
Checklist Category |
Auto-Fix Action |
unused_exports |
Placeholder & Stub |
Remove export (if used locally) or entire declaration. |
unused_files |
Placeholder & Stub |
Delete file (check dynamic imports first). |
unused_dependencies |
Placeholder & Stub |
Remove dependency from package.json. |
circular_dependencies |
Cross-Boundary |
Defer to manual review (causes init bugs). |
complexity/duplication |
Logic Bugs |
Defer to manual review. |
5. Output Format
Include ## Review Summary header (only if JS/TS project):
## Review Summary
- **Manual review bugs found**: N
- **Fallow auto-fixed**: N findings (staged files only)
- **Fallow non-auto-fixable**: N findings
- **Fallow verdict**: pass / fail
Format individual findings (add [fallow] tag for fallow-sourced bugs):
## Bug #1
- **File**: <path>:<line>
- **Category**: <category>
- **What's wrong**: <description>
- **Runtime effect**: <effect>
- **Fix**: <code>
1---2name: find-mismatch3description: Systematic code review focusing on bugs that break at runtime (contract mismatches, logic/async errors, serialization, styling) and JS/TS static analysis via fallow. Use when reviewing code changes for runtime errors, post-implementation checks, finding contract mismatches, or running static analysis via fallow on changed files.4---56# Find Mismatch78Run static analysis using fallow and fix issues that it suggests. Walk through every file. Focus only on runtime failures/bugs and fix them. Do NOT report style, formatting, performance suggestions, docs/tests, or "consider using X".910## 1. Process111. **JS/TS (Pre-check)**: Run static analysis.12 - Check if installed: `fallow --version`.13 - Install globally if missing: `npm install -g fallow`.14 - Execute audit: `fallow audit --format json --quiet`.15 - Filter findings by git status: `git diff --staged --name-only`.16 - If staged: auto-apply safe fixes, re-run audit to verify.17 - If unstaged: report-only (no modification).182. **Review Checklist**: Apply checklist to all changes.193. **Report**: Format findings using the specified template.2021---2223## 2. Checklist Categories2425### 1. Cross-Boundary Contracts26- Calling mismatch: Check RPC, HTTP, IPC, event name/subject match receiver.27- Param names/types: `userId` vs `user_id`, string vs number, flat vs wrapped.28- Return type: Field accesses (`result.field`) must match return signature.2930### 2. Serialization & Deserialization31- Casing: `snake_case` in DB/backend vs `camelCase` in JSON/frontend.32- Optionals: Field expected by receiver but optional in producer.33- Enums/discriminators: Discriminant fields (`type`, `kind`) and variants match.34- Base64: Double-encoding layers.3536### 3. Logic Bugs37- Double counting: Counters incremented both in loop/branch and outside.38- Off-by-one: Index, pagination bounds (`page <= total` vs `page < total`).39- Conditions: Redundant/dead flags, unreachable statements, shadowed variables.4041### 4. Property & Method Access42- Null derefs: Method calls or array index access (`items[0].name`) without null/length checks.43- Optional chaining: Stop check too early (e.g. `user?.address.street` still crashes if `address` is null).44- This context: Callback bindings in classes.4546### 5. Async & Concurrency47- Race conditions: Shared mutable states, parallel filesystem accesses without coordination.48- Missing `await`: Promise ignored, silent errors.49- Leaks: File/DB/network connections not closed in error paths.5051### 6. CSS & Styling52- HSL variables: Raw HSL components (`0 0% 100%`) instead of functional format (`hsl(0 0% 100%)`) fail in Tailwind v4 (unlike v3).53- Inline themes: Circular references, selector mismatch (class vs data-theme).5455### 7. Placeholder & Stub Code56- Unused declarations/files/dependencies, TODO comments, empty catch blocks.5758---5960## 3. Language-Specific Pitfalls6162- **Python**: Hallucinated library methods (pandas, numpy, requests), sync/asyncio confusion, mutable default arguments (`def f(x=[])`), silent indentation drops.63- **JS/TS**: Backend (Node) vs Frontend (Browser) API mix-ups, `any` abuse, type-only import mismatches, barrel file false positives (exported but unused in production, used in tests/libraries).64- **C++**: Raw vs smart pointer mix-ups, missing standard library header `#include`, uninitialized variables, buffer overflows.65- **Rust**: Borrow checker lifetime overcomplication, `unwrap()` on `None`/`Err`, locking across `.await` yield points.66- **Java / .NET**: Hallucinated annotations/attributes, LINQ N+1 queries, Entity Framework model snapshot drift / missing migrations (check model changes under `Entities/` against `Migrations/`).67- **Go**: WaitGroup/Channel deadlocks, unexported struct fields in JSON, defer in loop, map concurrent access.68- **PHP**: Loose type comparisons (`==` vs `===`), array vs object access, key undefined.6970---7172## 4. Fallow Finding Mapping & Fixes7374| Fallow Type | Checklist Category | Auto-Fix Action |75|---|---|---|76| `unused_exports` | Placeholder & Stub | Remove `export` (if used locally) or entire declaration. |77| `unused_files` | Placeholder & Stub | Delete file (check dynamic imports first). |78| `unused_dependencies` | Placeholder & Stub | Remove dependency from `package.json`. |79| `circular_dependencies`| Cross-Boundary | Defer to manual review (causes init bugs). |80| `complexity`/`duplication` | Logic Bugs | Defer to manual review. |8182---8384## 5. Output Format8586Include `## Review Summary` header (only if JS/TS project):87```88## Review Summary89- **Manual review bugs found**: N90- **Fallow auto-fixed**: N findings (staged files only)91- **Fallow non-auto-fixable**: N findings92- **Fallow verdict**: pass / fail93```9495Format individual findings (add `[fallow]` tag for fallow-sourced bugs):96```97## Bug #198- **File**: <path>:<line>99- **Category**: <category>100- **What's wrong**: <description>101- **Runtime effect**: <effect>102- **Fix**: <code>103```