You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by ak...@apache.org on 2026/04/23 09:15:28 UTC

(tooling-agents) branch main updated: Reduce batch size from 75 to 40

This is an automated email from the ASF dual-hosted git repository.

andrewmusselman pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-agents.git


The following commit(s) were added to refs/heads/main by this push:
     new dac818f  Reduce batch size from 75 to 40
dac818f is described below

commit dac818f2cbc6cf41960cf6a975c0732b139fa660
Author: Andrew Musselman <an...@gmail.com>
AuthorDate: Thu Apr 23 02:15:18 2026 -0700

    Reduce batch size from 75 to 40
---
 .../consolidate_asvs_security_audit_reports.py     | 24 ++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/ASVS/agents/consolidate_asvs_security_audit_reports.py b/ASVS/agents/consolidate_asvs_security_audit_reports.py
index 5512fc1..363db7f 100644
--- a/ASVS/agents/consolidate_asvs_security_audit_reports.py
+++ b/ASVS/agents/consolidate_asvs_security_audit_reports.py
@@ -182,6 +182,7 @@ async def run(input_dict, tools):
         print("\n=== PHASE 1: Reading all reports ===")
 
         reports = {}
+        report_dirs = {}  # report_key -> directory it came from
 
         for directory in directories:
             print(f"\n  Reading reports from {directory}...")
@@ -215,6 +216,7 @@ async def run(input_dict, tools):
                     content = base64.b64decode(file_data["content"]).decode("utf-8", errors="replace")
                     report_key = item['name']
                     reports[report_key] = content
+                    report_dirs[report_key] = directory
                     print(f"    Read {report_key} ({len(content)} chars)")
 
         total_reports = len(reports)
@@ -300,16 +302,13 @@ Return ONLY valid JSON:
                             extracted = parse_llm_json(raw)
                         except Exception as e:
                             print(f"ERROR: {e}")
-                            print(f"  DEBUG first 300 chars: {raw[:300]}")
-                            print(f"  DEBUG last 200 chars: {raw[-200:]}")
                             return report_key, None, str(e)
                         extracted["source_report"] = report_key
                         extraction_ns.set(report_key, extracted)
                         print(f"{len(extracted.get('findings', []))} findings, status: {extracted.get('asvs_status', '?')}")
                         return report_key, extracted, None
                     else:
-                        print(f"WARNING: no JSON found with expected keys")
-                        print(f"  DEBUG first 500 chars: {clean_result[:500]}")
+                        print(f"WARNING: no JSON found")
                         return report_key, None, "No JSON in result"
                 except Exception as e:
                     print(f"ERROR: {e}")
@@ -953,6 +952,19 @@ End with ---."""
             lv_findings = [f for f in all_findings if lv_name in f.get("asvs_levels", [])]
             s7.append(f"| {lv_name} | {lv_sections} | {len(lv_findings)} |")
         s7.append(f"\n**Total consolidated findings: {len(all_findings)}**")
+
+        if extraction_errors:
+            s7.append(f"\n\n### Reports Not Included in Consolidation")
+            s7.append(f"\n{len(extraction_errors)} per-section report(s) could not be automatically extracted into this consolidated report. ")
+            s7.append(f"Findings from these sections are available in the original per-section reports:\n")
+            s7.append("| Section | Per-Section Report |")
+            s7.append("|---------|-------------------|")
+            for rk in sorted(extraction_errors):
+                section_id = rk.replace(".md", "")
+                directory = report_dirs.get(rk, directories[0] if directories else "")
+                link = f"https://github.com/{owner}/{repo}/blob/main/{directory}/{rk}"
+                s7.append(f"| {section_id} | [{directory}/{rk}]({link}) |")
+
         s7.append("\n*End of Consolidated Security Audit Report*")
         consolidated_md += "\n".join(s7)
 
@@ -963,8 +975,8 @@ End with ---."""
         ISSUE_FMT = """---\n## Issue: FINDING-NNN - Title\n**Labels:** bug, security, priority:sev\n**Description:**\n### Summary\n### Details\n### Remediation\n### Acceptance Criteria\n- [ ] Fixed\n- [ ] Test added\n### References\n### Priority"""
 
         issues_parts = []
-        for bi in range(0, len(actionable), 75):
-            batch = actionable[bi:bi+75]
+        for bi in range(0, len(actionable), 40):
+            batch = actionable[bi:bi+40]
             is_first = (bi == 0)
             prompt = f"""Generate GitHub issues for {len(batch)} findings.\n{ISSUE_FMT}\n{"Start with: # Security Issues" if is_first else "Continue. No header."}\n\n{json.dumps(batch, indent=2, default=str)}"""
             for attempt in range(3):


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org