Documentationv1.4.0

Policy Profiles

Configure risk posture and automation behavior per path and team.

Risk Management

Not all code carries the same risk. A conflict in a documentation file is trivial, while a conflict in a payment processing handler is critical. Policy profiles allow you to tune gitresolve's automation threshold based on the file's importance.

Profile

strict

Maximum escalation. Blocks 'Both' strategy for all source files. Forced manual review for sensitive paths.

Profile

balanced

Default posture. Auto-resolves trivial blocks but escalates on semantic structural changes.

Profile

aggressive

Maximum automation. Suitable for generated code, logs, or documentation where safety gates can be relaxed.

Profile

auto

Dynamic resolution. Matches files against .gitresolve/policy.json for path-specific overrides.

Configuration: policy.json

Create a .gitresolve/policy.json at your repository root to configure profiles and history escalation thresholds.

.gitresolve/policy.json
{ "default": "balanced", "max_divergence_commits": 10, "max_callers": 10, "co_change_min_strength": 0.6, "history_max_commits": 500, "path_profiles": { "internal/auth/": "strict", "internal/payments/": "strict", "docs/": "aggressive", "scripts/": "aggressive" }, "team_profiles": { "security-ops": "strict", "dx-team": "aggressive" } }
max_divergence_commits

Threshold of behind-commits against remote default branch before warning on stale divergence (default: 10).

max_callers

Maximum call sites across the codebase before escalating for high blast radius (default: 10).

co_change_min_strength

Minimum historical co-change strength [0.0-1.0] to trigger missing coupled file warnings (default: 0.60).

history_max_commits

Maximum depth of Git commit history mined during index build (default: 500).

Resolution Logic

How the engine determines the active profile.

Path Overrides

The engine uses a longest-path match. If a file is in internal/auth/utils.go, it receives the "strict" profile even if the rest of internal/ is balanced.

Previewing Policy

You can preview which profile is active for a file by running:

$gitresolve resolve --policy-profile auto --dry-run path/to/file.go