Skip to content

Commit ead86d7

Browse files
committed
The sibling guard question can be switched off
The reasoning pass has always read ai.code_reasoning_siblings to decide whether to ask about guards a handler leaves off that the ones beside it apply, but the setting was never registered, so it could not be set and the question always ran. It is now a setting, on by default as before, with a box on the AI page beside the one for records returned whole.
1 parent 0a3b2a1 commit ead86d7

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎app/core/ai.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@
127127
"Most handlers not read before that are asked "
128128
"about in one repository per scan, the likeliest "
129129
"first. The rest wait for the next scan."),
130+
"ai.code_reasoning_siblings": (True, False,
131+
"Also ask about handlers that leave off a guard the "
132+
"handlers beside them apply. At most 25 a repository, "
133+
"each once."),
130134
"ai.code_reasoning_exposure": (True, False,
131135
"Also ask about handlers that look a record up from "
132136
"the request and return it whole, C# and Java "
@@ -222,6 +226,7 @@ def read_form(form, text, number, url, checked) -> dict:
222226
"Monthly token limit", 0, 2_000_000_000),
223227
"ai.code_reasoning_per_repo": number(form.get("ai.code_reasoning_per_repo") or 25,
224228
"Handlers per repository", 1, 500),
229+
"ai.code_reasoning_siblings": checked("ai.code_reasoning_siblings"),
225230
"ai.code_reasoning_exposure": checked("ai.code_reasoning_exposure"),
226231
}
227232

‎app/web/templates/ai.html‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,12 @@
306306
all of a repository's branches. Ones answered before do not count and
307307
cost nothing. Whatever is left is read on the next scan, so a large
308308
repository is covered over a few scans and nothing is read twice.</p>
309+
<label class="check"><input type="checkbox" name="ai.code_reasoning_siblings" value="1"
310+
{{ 'checked' if values['ai.code_reasoning_siblings'] }}>
311+
<span>Ask about guards a handler leaves off that the ones beside it apply</span></label>
312+
<p class="faint small">Handlers that touch the same data, or sit together, are compared in the
313+
code for nothing: a check one applies and another skips is a question worth asking. Only those
314+
gaps are asked about: at most 25 a repository, each once.</p>
309315
<label class="check"><input type="checkbox" name="ai.code_reasoning_exposure" value="1"
310316
{{ 'checked' if values['ai.code_reasoning_exposure'] }}>
311317
<span>Ask about handlers that return a looked up record whole</span></label>

0 commit comments

Comments
 (0)