Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,4 @@ connection guide in
protected branches and paths, oversized or unrelated diffs, stale heads, and
failed validation; it then creates a Covencat-attributed non-force commit and
queues a fresh review of the new SHA. The loop stops after the configured
`max_attempts` (clamped to 1-3) or on repeated findings or non-progress.
`max_attempts` (clamped to 1-10) or on repeated findings or non-progress.
2 changes: 1 addition & 1 deletion docs/coven-github-connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ file reads, searches, PR text, and model narratives are never execution proof.
Autoreview and branch repair are independent repository opt-ins. Configure
`autoreview.enabled` for exact-SHA reviews and optionally `include_drafts`.
Configure `repair.enabled` only for trusted same-repository branches, with
`max_attempts` from 1 through 3, bounded `allowed_paths`, `protected_paths`,
`max_attempts` from 1 through 10, bounded `allowed_paths`, `protected_paths`,
`protected_branches`, `max_changed_files`, and `max_diff_bytes`. Repair sessions
receive file tools only; the host performs validation, commit, and non-force push
with a fresh repository-scoped installation token. Set `kill_switch` at the
Expand Down
2 changes: 1 addition & 1 deletion src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ function repairPolicy(policy: JsonObject): JsonObject {

function boundedRepairAttempts(policy: JsonObject): number {
const requested = Number(repairPolicy(policy).max_attempts || 2);
return Number.isFinite(requested) ? Math.max(1, Math.min(3, Math.trunc(requested))) : 2;
return Number.isFinite(requested) ? Math.max(1, Math.min(10, Math.trunc(requested))) : 2;
}

function globPatternMatches(patternValue: JsonValue | undefined, path: string): boolean {
Expand Down
5 changes: 5 additions & 0 deletions tests/webhook-adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,11 @@ test("repair eligibility fails closed for forks, protected branches, limits, rep
assert.equal(repairEligibilityIssue({...task, target: {...(task.target as JsonObject), head_repo_id: 2}}, result, policy), "repair_fork_or_untrusted_head");
assert.equal(repairEligibilityIssue({...task, target: {...(task.target as JsonObject), head_ref: "main"}}, result, policy), "repair_protected_branch");
assert.equal(repairEligibilityIssue({...task, repair_iteration: 2}, result, policy), "repair_attempt_limit_reached");
const tenAttemptPolicy = {...policy, repair: {enabled: true, max_attempts: 10}};
assert.equal(repairEligibilityIssue({...task, repair_iteration: 9}, result, tenAttemptPolicy), null);
assert.equal(repairEligibilityIssue({...task, repair_iteration: 10}, result, tenAttemptPolicy), "repair_attempt_limit_reached");
const overLimitPolicy = {...policy, repair: {enabled: true, max_attempts: 100}};
assert.equal(repairEligibilityIssue({...task, repair_iteration: 10}, result, overLimitPolicy), "repair_attempt_limit_reached");
assert.equal(repairEligibilityIssue(task, result, {...policy, kill_switch: true}), "repository_kill_switch");
const signatureProbe = {...task, repair_history: [{finding_signature: "placeholder"}]};
const initialIssue = repairEligibilityIssue(signatureProbe, result, policy);
Expand Down
Loading