axiom audit grdb performance

Engineering Community

Skill notes

Tool Use Is Mandatory

Run every Glob, Grep, and Read this prompt lists. Do not reason from training data instead of scanning. Run each Grep pattern as written; do not collapse them into one mega-regex. Run the Read verifications each section calls for. "Build a mental model" / "framework detection" means with tool output in hand, not from memory.

Files to Exclude

Skip: *Tests.swift, *Previews.swift, */Pods/*, */Carthage/*, */.build/*, */DerivedData/*, */scratch/*, */docs/*, */.claude/*, */.claude-plugin/*

Phase 1: Framework Detection

Before running detectors, classify the codebase. Several detectors are gated on framework — false positives are worse than missed findings.

Output

Write a brief Framework Map (5-10 lines) summarizing: Library: Raw GRDB / SQLiteData / Both (SQLiteData layered on GRDB) / Neither Connection type: DatabaseQueue / DatabasePool / both / unclear Writable: yes / read-only / mixed App-group sharing detected: yes / no

Phase 2: Pattern Detectors

Run the six detection patterns. For every grep match, use Read to verify the surrounding context before reporting — grep patterns have high recall but need contextual verification. Each detector is gated on the framework classification from Phase 1.

Fluxly profile Runtime and permissions are inferred by Fluxly static checks, not author declarations or runtime test results.
Domain
Engineering
Author-declared agents
No explicit declaration found; this is not inferred or tested compatibility
Static check
94 / 100 · heuristic scan, not runtime safety proof
Runtime evidence
Not run; no isolated runtime test evidence is currently recorded
Author / version / license
@CharlesWiltgen · MIT
Token usage
Heavy
Setup complexity
Guided setup
External API key
Not required
Operating systems
Unspecified (assume cross-platform)
Runtime requirements
No explicit requirements detected
Detected file/system behavior
  • Read-only
  • Write / modify
  • Shell exec
Network behavior
External requests
Install commands
None (reference only)

Heads up: Tool permissions are not declared; actual access depends on the runtime.

01
Phase 1: Framework Detection

Before running detectors, classify the codebase. Several detectors are gated on framework — false positives are worse than missed findings.

02
Step 1: Identify Database Library

Step 1: Identify Database Library

03
Step 2: Identify Writable vs Read-Only Database

Step 2: Identify Writable vs Read-Only Database

04
Step 3: Identify App Group / Multi-Process Usage

Step 3: Identify App Group / Multi-Process Usage

05
Phase 2: Pattern Detectors

Run the six detection patterns. For every grep match, use Read to verify the surrounding context before reporting — grep patterns have high recall but need contextual verification. Each detector is gated on the framework classification from Phase 1.

06
Phase 3: Reason About Performance Completeness

Using the Framework Map from Phase 1, check for what's *missing*: Question · What it detects · Why it matters Is `Configuration.busyMode = .timeout(N)` set for app-group databases? · Cross-process contention surfaces SQLITE_BUSY immediately · App-and-widget contention is normal; without busy_timeout it cascades to user-visible errors Are there any `fetchAll` calls without a `LIMIT` or filter on tables that grow unboundedly? · Memory spikes; main-thread stalls · A 100-row prototype becomes a 100K-row production bug

07
Phase 4: Cross-Reference Findings

Bump severity for these combinations: Finding A · + Finding B · = Compound · Severity Raw SQL with string interpolation (Pattern 1) · User-controllable input in the same code path · SQL injection vector · CRITICAL Missing FK index (Pattern 2) · Grep finds a JOIN against that FK column elsewhere in non-migration code · Production query in the 100s of ms instead of < 10ms · HIGH Missing `observesSuspensionNotifications` (Pattern 5) · Live Activity, background fetch, or watch-face widget extends the backgrounding window · Guaranteed `0xDEAD10CC` in production · CRITICAL

08
Phase 5: Performance Health Score

Metric · Value Library · Raw GRDB / SQLiteData / Both Writable · yes / read-only App-group sharing · yes / no Pattern 1 (SQL interpolation) · N matches

Discussion

Powered by GitHub Discussions. Sign in with GitHub to comment, react, or subscribe.