Version 2.0 transforms Ground from a verification tool into a complete AI-native
code quality system. These features enable autonomous agents to find, fix, and
verify issues without human intervention.
Batch Analysis
Single call returns all findings with confidence scores and structured fix actions:
ground_analyze({
"directory": "/path/to/repo",
"checks": ["duplicates", "dead_exports", "orphans"],
"cross_package": true
})
→ {
"summary": {
"total_issues": 15,
"auto_fixable": 12,
"needs_review": 3
},
"findings": {
"duplicates": [
{
"type": "duplicate_function",
"function": "formatCurrency",
"similarity": 0.94,
"confidence": 0.97,
"safe_to_auto_fix": true,
"fix": {
"action": "consolidate",
"target": "packages/shared/utils.ts",
"imports_to_update": [...]
}
}
]
}
}
Incremental Diff Mode
Only reports new issues since a git baseline—agents don't re-process known issues:
ground_diff({
"directory": "/path/to/repo",
"base": "main",
"checks": ["duplicates", "orphans"]
})
→ {
"base": "main",
"changed_files": 19,
"new_issues": [],
"message": "No new issues introduced since 'main'. 19 files changed, all clean."
}
This enables CI integration that only fails PRs introducing new issues:
# .github/workflows/ground.yml
- name: Check for new issues
run: |
ground diff --base origin/main
# Fails only if PR introduces NEW duplicates/orphans
# Ignores pre-existing issues
Structured Fix Output
Fixes are structured data for agents to execute—not patches for humans to read:
{
"action": "consolidate",
"source_files": ["payments/utils.ts", "invoices/utils.ts"],
"target": "packages/shared/src/stripe-utils.ts",
"function": "formatCurrency",
"imports_to_update": [
{
"file": "payments/list.ts",
"old_import": "./utils",
"new_import": "@company/shared"
}
],
"confidence": 0.97,
"safe_to_auto_fix": true,
"rationale": "Same package, identical implementation"
}
Fix Verification
Close the loop without re-running full analysis:
ground_verify_fix({
"fix_type": "duplicate_removed",
"details": {
"function_name": "formatCurrency",
"file_a": "payments/utils.ts",
"file_b": "invoices/utils.ts"
}
})
→ {
"verified": true,
"message": "Verified: 'formatCurrency' no longer duplicated"
}
Config-Driven Noise Reduction
.ground.yml eliminates noise from structural patterns:
# .ground.yml
ignore:
functions:
- getCapabilities # Interface contract (64 integrations)
- constructor # Boilerplate OK
- initialize # Framework pattern
paths:
- "**/*.test.ts" # Test isolation expected
- "**/fixtures/**"
duplicate_pairs:
- ["analytics/track/+server.ts", "io/analytics/track/+server.ts"]