File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -179,12 +179,20 @@ def main():
179179 ensure_ascii = False , indent = 1 )
180180
181181 needs = buckets ["stale" ] + buckets ["unaudited" ]
182+ # oversized modules: too coarse to be a useful audit unit AND expensive to audit
183+ # (the auditor must read a lot). Split candidates. Threshold overridable via meta.
184+ big_threshold = state .get ("meta" , {}).get ("oversizedLoc" , 2000 )
185+ oversized = sorted (((m ["loc" ], m ["id" ]) for m in state .get ("modules" , [])
186+ if (m .get ("loc" ) or 0 ) >= big_threshold ), reverse = True )
187+ needs_loc = sum (m .get ("loc" ) or 0 for m in state .get ("modules" , []) if m ["id" ] in set (needs ))
182188 report = {
183189 "modules" : len (state .get ("modules" , [])),
184190 "tracked_loc" : tracked_loc ,
185191 "tracked_files" : len (union_files ),
186192 "needs_audit" : needs ,
187193 "needs_audit_count" : len (needs ),
194+ "needs_audit_loc" : needs_loc , # rough proxy for the next audit's token cost
195+ "oversized" : [mid for _ , mid in oversized ], # split candidates (loc >= threshold)
188196 "up_to_date" : len (needs ) == 0 and not buckets ["empty" ],
189197 "git" : git_report ,
190198 ** buckets ,
You can’t perform that action at this time.
0 commit comments